aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-06-05 15:35:21 -0400
committerKen Moore <ken@pcbsd.org>2015-06-05 15:35:21 -0400
commit0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca (patch)
tree17a15c5628bd2ee74330f1d2a0e1f703021d232e /lumina-desktop
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.tar.gz
lumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.tar.bz2
lumina-0a426ea2f51b8500005dfdbcafb9a43d8e9e9bca.zip
Finish up the desktop re-scaling routines for ensure the same interface if you switch out monitors/systems with a different resolution. Also add a quick check to ensure that we don't create duplicate desktops in the same location on the X screen.
Diffstat (limited to 'lumina-desktop')
-rw-r--r--lumina-desktop/LDesktop.cpp21
-rw-r--r--lumina-desktop/LSession.cpp3
2 files changed, 19 insertions, 5 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 86db3fc6..8040c18b 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -116,7 +116,7 @@ void LDesktop::SystemApplication(QAction* act){
void LDesktop::checkResolution(){
//Compare the current screen resolution with the last one used/saved and adjust config values *only*
-
+ //NOTE: This is only run the first time this desktop is created (before loading all the interface) - not on each desktop change
int oldWidth = settings->value(DPREFIX+"screen/lastWidth",-1).toInt();
int oldHeight = settings->value(DPREFIX+"screen/lastHeight",-1).toInt();
QRect scrn = LSession::desktop()->screenGeometry(desktopnumber);
@@ -152,9 +152,22 @@ void LDesktop::checkResolution(){
}
}
//Update any desktop plugins
- /*for(int i=0; i<PLUGINS.length(); i++){
- PLUGINS[i]->scalePlugin(xscale, yscale);
- }*/
+ QStringList plugs = settings->value(DPREFIX+"pluginlist").toStringList();
+ QString pspath = QDir::homePath()+"/.lumina/desktop-plugins/%1.conf";
+ for(int i=0; i<plugs.length(); i++){
+ if(QFile::exists( pspath.arg(plugs[i]) )){
+ //Has existing settings file - need to adjust this as well
+ QSettings pset(QSettings::UserScope, "desktop-plugins",plugs[i]);
+ if(pset.contains("location/height")){ pset.setValue( "location/height", qRound(pset.value("location/height").toInt()*yscale) ); }
+ if(pset.contains("location/width")){ pset.setValue( "location/width", qRound(pset.value("location/width").toInt()*xscale) ); }
+ if(pset.contains("location/x")){ pset.setValue( "location/x", qRound(pset.value("location/x").toInt()*xscale) ); }
+ if(pset.contains("location/y")){ pset.setValue( "location/y", qRound(pset.value("location/y").toInt()*yscale) ); }
+ if(pset.contains("IconSize")){ pset.setValue( "IconSize", qRound(pset.value("IconSize").toInt()*yscale) ); }
+ if(pset.contains("iconsize")){ pset.setValue( "iconsize", qRound(pset.value("iconsize").toInt()*yscale) ); }
+ pset.sync(); //make sure it gets saved to disk right away
+ }
+ }
+
}
issyncing = false;
}
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index 5866b19d..342f509a 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -420,7 +420,8 @@ void LSession::updateDesktops(){
for(int i=0; i<DW->screenCount(); i++){
bool found = false;
for(int j=0; j<DESKTOPS.length() && !found; j++){
- if(DESKTOPS[j]->Screen()==i){ found = true; }
+ //Match either the screen number or the screen location (preventing duplicates)
+ if(DESKTOPS[j]->Screen()==i || DW->screenGeometry(i)==DW->screenGeometry(DESKTOPS[j]->Screen()) ){ found = true; }
}
if(!found){
//Start the desktop on the new screen
bgstack15