aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LSession.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-28 14:21:48 -0400
committerKen Moore <moorekou@gmail.com>2015-07-28 14:21:48 -0400
commit33b2e0ec1c3810ccfac177e311fea2b03db8e47c (patch)
tree013ac6fdd53507cd97b9f7dc8698a6fdc5154bfa /lumina-desktop/LSession.cpp
parentJust a minor update to some debugging (when turned on) for checking icons wit... (diff)
downloadlumina-33b2e0ec1c3810ccfac177e311fea2b03db8e47c.tar.gz
lumina-33b2e0ec1c3810ccfac177e311fea2b03db8e47c.tar.bz2
lumina-33b2e0ec1c3810ccfac177e311fea2b03db8e47c.zip
Add some work that make the Lumina desktop/panels appear in the proper locations when XINERAMA is used for combining monitors. However, the interface is still completely unresponsive because the Qt backend is completely screwed up by Xinerama (returns 0's for everything related to screens, geometries, etc, preventing menus from opening up even when manually started). This might be something where we just have to say that Xinerama is not supported for Lumina (at least until lumina-wm get finished up).
Diffstat (limited to 'lumina-desktop/LSession.cpp')
-rw-r--r--lumina-desktop/LSession.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index 6edfe5a4..1747154d 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -8,6 +8,7 @@
#include <LuminaOS.h>
#include <QTime>
+#include <QScreen>
#include "LXcbEventFilter.h"
#include "BootSplash.h"
@@ -110,7 +111,9 @@ void LSession::setupSession(){
//Initialize the internal variables
DESKTOPS.clear();
-
+ savedScreens.clear();
+ for(int i=0; i<this->desktop()->screenCount(); i++){ savedScreens << this->desktop()->screenGeometry(i); }
+
//Start the background system tray
splash.showScreen("systray");
if(DEBUG){ qDebug() << " - Init System Tray:" << timer->elapsed();}
@@ -431,7 +434,9 @@ void LSession::updateDesktops(){
//qDebug() << " - Update Desktops";
QDesktopWidget *DW = this->desktop();
bool firstrun = (DESKTOPS.length()==0);
+ if(!firstrun){ savedScreens.clear(); }
for(int i=0; i<DW->screenCount(); i++){
+ if(!firstrun){ savedScreens << DW->screenGeometry(i); }
bool found = false;
for(int j=0; j<DESKTOPS.length() && !found; j++){
//Match either the screen number or the screen location (preventing duplicates)
@@ -439,7 +444,7 @@ void LSession::updateDesktops(){
}
if(!found){
//Start the desktop on the new screen
- qDebug() << " - Start desktop on screen:" << i;
+ qDebug() << " - Start desktop on screen:" << i << DW->screenGeometry(i) << "Virtual:" << DW->isVirtualDesktop();
if(firstrun && DW->screenGeometry(i).x()==0){
DESKTOPS << new LDesktop(i,true); //set this one as the default
}else{
@@ -452,6 +457,7 @@ void LSession::updateDesktops(){
if(!firstrun){//Done right here on first run
//Now go through and make sure to delete any desktops for detached screens
for(int i=0; i<DESKTOPS.length(); i++){
+
if(DESKTOPS[i]->Screen() >= DW->screenCount()){
qDebug() << " - Close desktop on screen:" << DESKTOPS[i]->Screen();
DESKTOPS[i]->prepareToClose();
@@ -558,6 +564,22 @@ QFileInfoList LSession::DesktopFiles(){
return desktopFiles;
}
+QRect LSession::screenGeom(int num){
+ if(num < 0 || num >= this->desktop()->screenCount() ){ return QRect(); }
+ QRect geom = this->desktop()->screenGeometry(num);
+ QScreen* scrn = this->screens().at(num);
+ if(DEBUG){ qDebug() << "Screen Geometry:" << num << geom << scrn->geometry() << scrn->virtualGeometry(); }
+ if(geom.isNull() ){
+ if( !scrn->geometry().isNull() ){ geom = scrn->geometry(); }
+ else if( !scrn->virtualGeometry().isNull() ){ geom = scrn->virtualGeometry(); }
+ else if(num < savedScreens.length() ){
+ //Qt is backfiring (Xinarama w/ Fluxbox?) - return the saved geometry
+ geom = savedScreens[num];
+ }
+ }
+ return geom;
+}
+
AppMenu* LSession::applicationMenu(){
return appmenu;
}
@@ -618,7 +640,7 @@ void LSession::WindowPropertyEvent(){
for(int i=0; i<newapps.length() && !TrayStopping; i++){
if(!RunningApps.contains(newapps[i])){
checkWin << newapps[i];
- QTimer::singleShot(500, this, SLOT(checkWindowGeoms()) );
+ QTimer::singleShot(100, this, SLOT(checkWindowGeoms()) );
}
}
}
bgstack15