diff options
author | Ken Moore <moorekou@gmail.com> | 2015-07-30 18:18:11 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-07-30 18:18:11 -0400 |
commit | d97499cae8e344af6118f38ffa1c4b183a4d30cc (patch) | |
tree | 50641f8327b8b3a2473ad357845a765db6f45aed | |
parent | Final fix for the line find/replace functionality in luminaDesktop.conf parsi... (diff) | |
download | lumina-d97499cae8e344af6118f38ffa1c4b183a4d30cc.tar.gz lumina-d97499cae8e344af6118f38ffa1c4b183a4d30cc.tar.bz2 lumina-d97499cae8e344af6118f38ffa1c4b183a4d30cc.zip |
Fix up the issues with some apps which re-configure the Xsession/screens to match their own internal specifications. On single-screen setups it works fine now, but on multi-screen setups the app does not seem to return the xsettings back to their original specs properly (Tested with OpenArena and MegaMario). This may result in the screen being "flipped" or placed on different monitors after closing the app.
-rw-r--r-- | libLumina/LuminaX11.cpp | 70 | ||||
-rw-r--r-- | libLumina/LuminaX11.h | 1 | ||||
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 23 | ||||
-rw-r--r-- | lumina-desktop/LDesktop.h | 10 | ||||
-rw-r--r-- | lumina-desktop/LPanel.cpp | 18 | ||||
-rw-r--r-- | lumina-desktop/LPanel.h | 2 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 68 | ||||
-rw-r--r-- | lumina-desktop/LSession.h | 3 | ||||
-rw-r--r-- | lumina-desktop/WMProcess.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/WMProcess.h | 7 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/systemtray/LSysTray.cpp | 3 |
11 files changed, 163 insertions, 44 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index 71346e19..61af0803 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -11,6 +11,8 @@ #include <QFile> #include <QObject> #include <QImage> +#include <QApplication> +#include <QDesktopWidget> //X includes (these need to be last due to Qt compile issues) #include <X11/Xlib.h> @@ -1165,6 +1167,50 @@ bool LXCB::WindowIsMaximized(WId win){ return false; } +// === WindowIsFullscreen() === +int LXCB::WindowIsFullscreen(WId win){ + if(DEBUG){ qDebug() << "XCB: WindowIsFullscreen()"; } + if(win==0){ return -1; } + //bool fullS = false; + //See if the _NET_WM_STATE_FULLSCREEN flag is set on the window + /*xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_state_unchecked(&EWMH, win); + if(cookie.sequence == 0){ return false; } + xcb_ewmh_get_atoms_reply_t states; + if( 1 == xcb_ewmh_get_wm_state_reply(&EWMH, cookie, &states, NULL) ){ + //Loop over the states + for(unsigned int i=0; i<states.atoms_len; i++){ + if(states.atoms[i] == EWMH._NET_WM_STATE_FULLSCREEN){ + fullS = true; + break; + } + } + }*/ + //if(!fullS){ + //Fallback check for windows which are painted above everything else + // but don't have the FULLSCREEN flag set (even though they are technically full-screen) + int fscreen = -1; + //qDebug() << "FALLBACK FULLSCREEN CHECK:"; + QRect geom = LXCB::WindowGeometry(win, false); + QDesktopWidget *desk = QApplication::desktop(); + for(int i=0; i<desk->screenCount(); i++){ + QRect sgeom = desk->screenGeometry(i); + qDebug() << " -- Check Window Geom:" << sgeom << geom << this->WindowClass(win); + if( sgeom.contains(geom.center()) ){ + //Allow a 1 pixel variation in "full-screen" detection + qDebug() << " -- Found Screen:" << i; + if( geom.width() >= (sgeom.width()-1) && geom.height()>=(sgeom.height()-1) ){ + qDebug() << " -- Is Fullscreen!"; + //fullS = true; + fscreen = i; + } + break; //found the screen which contains this window + } + } + //} + //return fullS; + return fscreen; +} + // === WindowIcon() === QIcon LXCB::WindowIcon(WId win){ //Fetch the _NET_WM_ICON for the window and return it as a QIcon @@ -1237,17 +1283,17 @@ void LXCB::SetAsPanel(WId win){ //Disable Input focus (panel activation ruins task manager window detection routines) // - Disable Input flag in WM_HINTS xcb_icccm_wm_hints_t hints; - qDebug() << " - Disable WM_HINTS input flag"; + //qDebug() << " - Disable WM_HINTS input flag"; xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_hints_unchecked(QX11Info::connection(), win); - qDebug() << " -- got cookie"; + //qDebug() << " -- got cookie"; if(1 == xcb_icccm_get_wm_hints_reply(QX11Info::connection(), cookie, &hints, NULL) ){ - qDebug() << " -- Set no inputs flag"; + //qDebug() << " -- Set no inputs flag"; xcb_icccm_wm_hints_set_input(&hints, False); //set no input focus xcb_icccm_set_wm_hints(QX11Info::connection(), win, &hints); //save hints back to window } // - Remove WM_TAKE_FOCUS from the WM_PROTOCOLS for the window // - - Generate the necessary atoms - qDebug() << " - Generate WM_PROTOCOLS and WM_TAKE_FOCUS atoms"; + //qDebug() << " - Generate WM_PROTOCOLS and WM_TAKE_FOCUS atoms"; xcb_atom_t WM_PROTOCOLS, WM_TAKE_FOCUS; //the two atoms needed xcb_intern_atom_reply_t *preply = xcb_intern_atom_reply(QX11Info::connection(), \ xcb_intern_atom(QX11Info::connection(), 0, 12, "WM_PROTOCOLS"), NULL); @@ -1260,11 +1306,11 @@ void LXCB::SetAsPanel(WId win){ free(preply); free(freply); gotatoms = true; - qDebug() << " -- success"; + //qDebug() << " -- success"; } // - - Now update the protocols for the window if(gotatoms){ //requires the atoms - qDebug() << " - Get WM_PROTOCOLS"; + //qDebug() << " - Get WM_PROTOCOLS"; xcb_icccm_get_wm_protocols_reply_t proto; if( 1 == xcb_icccm_get_wm_protocols_reply(QX11Info::connection(), \ xcb_icccm_get_wm_protocols_unchecked(QX11Info::connection(), win, WM_PROTOCOLS), \ @@ -1274,12 +1320,12 @@ void LXCB::SetAsPanel(WId win){ //remove the take focus atom and re-save them bool needremove = false; //Note: This first loop is required so that we can initialize the modified list with a valid size - qDebug() << " -- Check current protocols"; + //qDebug() << " -- Check current protocols"; for(unsigned int i=0; i<proto.atoms_len; i++){ if(proto.atoms[i] == WM_TAKE_FOCUS){ needremove = true; break;} } if(needremove){ - qDebug() << " -- Remove WM_TAKE_FOCUS protocol"; + //qDebug() << " -- Remove WM_TAKE_FOCUS protocol"; xcb_atom_t *protolist = new xcb_atom_t[proto.atoms_len-1]; int num = 0; for(unsigned int i=0; i<proto.atoms_len; i++){ @@ -1288,10 +1334,10 @@ void LXCB::SetAsPanel(WId win){ num++; } } - qDebug() << " -- Re-save modified protocols"; + //qDebug() << " -- Re-save modified protocols"; xcb_icccm_set_wm_protocols(QX11Info::connection(), win, WM_PROTOCOLS, num, protolist); } - qDebug() << " -- Clear protocols reply"; + //qDebug() << " -- Clear protocols reply"; xcb_icccm_get_wm_protocols_reply_wipe(&proto); }//end of get protocols check } //end of gotatoms check @@ -1299,13 +1345,13 @@ void LXCB::SetAsPanel(WId win){ // - get the current window types (Not necessary, only 1 type of window needed) // - set the adjusted window type(s) - qDebug() << " - Adjust window type"; + //qDebug() << " - Adjust window type"; xcb_atom_t list[1]; list[0] = EWMH._NET_WM_WINDOW_TYPE_DOCK; xcb_ewmh_set_wm_window_type(&EWMH, win, 1, list); //Make sure it is on all workspaces - qDebug() << " - Set window as sticky"; + //qDebug() << " - Set window as sticky"; SetAsSticky(win); } diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h index d41cbca1..5a38e7fa 100644 --- a/libLumina/LuminaX11.h +++ b/libLumina/LuminaX11.h @@ -143,6 +143,7 @@ public: QString OldWindowName(WId win); //WM_NAME (old standard) QString OldWindowIconName(WId win); //WM_ICON_NAME (old standard) bool WindowIsMaximized(WId win); + int WindowIsFullscreen(WId win); //Returns the screen number if the window is fullscreen (or -1) QIcon WindowIcon(WId win); //_NET_WM_ICON //Window Modification diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 31ac47c3..6546cec4 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -52,11 +52,11 @@ void LDesktop::show(){ for(int i=0; i<PANELS.length(); i++){ PANELS[i]->show(); } } -/*void LDesktop::hide(){ +void LDesktop::hide(){ if(bgWindow!=0){ bgWindow->hide(); } if(bgDesktop!=0){ bgDesktop->hide(); } for(int i=0; i<PANELS.length(); i++){ PANELS[i]->hide(); } -}*/ +} void LDesktop::prepareToClose(){ //Get any panels ready to close @@ -89,6 +89,23 @@ QRect LDesktop::availableScreenGeom(){ } } +void LDesktop::UpdateGeometry(){ + //First make sure there is something different about the geometry + if(desktop->screenGeometry()==bgWindow->geometry()){ return; } + //Now update the screen + // NOTE: This functionality is highly event-driven based on X changes - so we need to keep things in order (no signals/slots) + qDebug() << "Changing Desktop Geom:" << desktopnumber; + bgWindow->setGeometry(desktop->screenGeometry(desktopnumber)); + qDebug() << " - Update Desktop Plugin Area"; + UpdateDesktopPluginArea(); + /*qDebug() << " - Update Panel Geometry"; + for(int i=0; PANELS.length(); i++){ + PANELS[i]->UpdatePanel(true); //only update geometry + }*/ + qDebug() << " - Done With Desktop Geom Updates"; + //QTimer::singleShot(0, this, SLOT(UpdatePanels())); +} + void LDesktop::SystemLogout(){ LSession::handle()->systemWindow(); } @@ -268,7 +285,7 @@ void LDesktop::InitDesktop(){ //This is called *once* during the main initialization routines checkResolution(); //Adjust the desktop config file first (if necessary) if(DEBUG){ qDebug() << "Init Desktop:" << desktopnumber; } - connect(desktop, SIGNAL(resized(int)), this, SLOT(UpdateGeometry(int))); + //connect(desktop, SIGNAL(resized(int)), this, SLOT(UpdateGeometry(int))); if(DEBUG){ qDebug() << "Desktop #"<<desktopnumber<<" -> "<< desktop->screenGeometry(desktopnumber) << LSession::handle()->screenGeom(desktopnumber); } deskMenu = new QMenu(0); connect(deskMenu, SIGNAL(triggered(QAction*)), this, SLOT(SystemApplication(QAction*)) ); diff --git a/lumina-desktop/LDesktop.h b/lumina-desktop/LDesktop.h index b476deab..e1900f5a 100644 --- a/lumina-desktop/LDesktop.h +++ b/lumina-desktop/LDesktop.h @@ -40,12 +40,14 @@ public: int Screen(); //return the screen number this object is managing void show(); - //void hide(); + void hide(); void prepareToClose(); WId backgroundID(); QRect availableScreenGeom(); + void UpdateGeometry(); + public slots: void SystemLogout(); void SystemTerminal(); @@ -105,11 +107,5 @@ private slots: void UpdateDesktopPluginArea(); //make sure the area is not underneath any panels void UpdateBackground(); - void UpdateGeometry(int screen){ - if(screen==desktopnumber){ - bgWindow->setGeometry(desktop->screenGeometry(desktopnumber)); - QTimer::singleShot(0, this, SLOT(UpdatePanels())); - } - } }; #endif diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp index 7767d004..4cdbcbfd 100644 --- a/lumina-desktop/LPanel.cpp +++ b/lumina-desktop/LPanel.cpp @@ -56,7 +56,7 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ LSession::handle()->XCB->SetAsSticky(this->winId()); QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread - connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes + //connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes } LPanel::~LPanel(){ @@ -90,12 +90,12 @@ void LPanel::scalePanel(double xscale, double yscale){ //=========== // PUBLIC SLOTS //=========== -void LPanel::UpdatePanel(){ +void LPanel::UpdatePanel(bool geomonly){ //Create/Update the panel as designated in the Settings file settings->sync(); //make sure to catch external settings changes //First set the geometry of the panel and send the EWMH message to reserve that space - if(DEBUG){ qDebug() << "Update Panel"; } - hidden = settings->value(PPREFIX+"hidepanel",false).toBool(); //default to true for the moment + if(DEBUG){ qDebug() << "Update Panel: Geometry only=" << geomonly << "Screen Size:" << LSession::handle()->screenGeom(screennum); } + hidden = settings->value(PPREFIX+"hidepanel",false).toBool(); QString loc = settings->value(PPREFIX+"location","").toString().toLower(); if(loc.isEmpty() && defaultpanel){ loc="top"; } if(loc=="top" || loc=="bottom"){ @@ -122,15 +122,18 @@ void LPanel::UpdatePanel(){ if(panelPercent<1 || panelPercent>100){ panelPercent = 100; } panelPercent = panelPercent/100.0; QString panelPinLoc = settings->value(PPREFIX+"pinLocation","center").toString().toLower(); //[left/right/center] possible values (assume center otherwise) + if(DEBUG){ qDebug() << " - Panel settings:" << QString::number(panelPercent)+QString("%") << panelPinLoc << loc; } //xloc=xoffset; if(loc=="top"){ //top of screen QSize sz = QSize(xwid*panelPercent, ht); if(panelPinLoc=="left"){} // no change to xloc else if(panelPinLoc=="right"){ xloc = xloc+xwid-sz.width(); } else{ xloc = xloc+((xwid-sz.width())/2) ; } //centered + //qDebug() << " - Panel Sizing:" << xloc << sz; this->setMinimumSize(sz); this->setMaximumSize(sz); this->setGeometry(xloc,0,sz.width(), sz.height()); + //qDebug() << " - Reserve Panel Localation"; if(!hidden){ LX11::ReservePanelLocation(this->winId(), xloc, 0, this->width(), ht, "top"); } else{ LX11::ReservePanelLocation(this->winId(), xloc, 0, this->width(), hidesize, "top"); @@ -189,7 +192,8 @@ void LPanel::UpdatePanel(){ //With QT5, we need to make sure to reset window properties on occasion //LSession::handle()->XCB->SetDisableWMActions(this->winId()); //ensure no WM actions //LSession::handle()->XCB->SetAsSticky(this->winId()); - + if(DEBUG){ qDebug() << " - Done with panel geometry"; } + if(geomonly){ return; } //Now update the appearance of the toolbar if(settings->value(PPREFIX+"customcolor", false).toBool()){ QString color = settings->value(PPREFIX+"color", "rgba(255,255,255,160)").toString(); @@ -315,8 +319,8 @@ void LPanel::enterEvent(QEvent *event){ //Move the panel out so it is fully available this->move(showpoint); } - tmpID = LSession::handle()->XCB->ActiveWindow(); - this->activateWindow(); + //tmpID = LSession::handle()->XCB->ActiveWindow(); + //this->activateWindow(); event->accept(); //just to quiet the compile warning } diff --git a/lumina-desktop/LPanel.h b/lumina-desktop/LPanel.h index f823b73d..cee1b5c7 100644 --- a/lumina-desktop/LPanel.h +++ b/lumina-desktop/LPanel.h @@ -62,7 +62,7 @@ public: void scalePanel(double xscale, double yscale); public slots: - void UpdatePanel(); //Load the settings file and update the panel appropriately + void UpdatePanel(bool geomonly = false); //Load the settings file and update the panel appropriately void UpdateLocale(); //Locale Changed externally void UpdateTheme(); //Theme Changed externally diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 1747154d..8286bdd6 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -48,6 +48,10 @@ LSession::LSession(int &argc, char ** argv) : QApplication(argc, argv){ TrayDmgError = 0; cleansession = true; TrayStopping = false; + screenTimer = new QTimer(this); + screenTimer->setSingleShot(true); + screenTimer->setInterval(2000); //0.2 seconds + connect(screenTimer, SIGNAL(timeout()), this, SLOT(updateDesktops()) ); for(int i=1; i<argc; i++){ if( QString::fromLocal8Bit(argv[i]) == "--noclean" ){ cleansession = false; break; } } @@ -156,7 +160,8 @@ void LSession::setupSession(){ watcher->addPath( QDir::homePath() ); //connect internal signals/slots - connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(updateDesktops()) ); + connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) ); + connect(this->desktop(), SIGNAL(resized(int)), this, SLOT(screenResized(int)) ); connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) ); @@ -343,13 +348,27 @@ void LSession::watcherChange(QString changed){ } } +void LSession::screensChanged(){ + qDebug() << "Screen Number Changed"; + //if(screenTimer->isActive()){ screenTimer->stop(); } + //screenTimer->start(); + updateDesktops(); +} + +void LSession::screenResized(int scrn){ + qDebug() << "Screen Resized:" << scrn << this->desktop()->screenGeometry(scrn); + for(int i=0; i<DESKTOPS.length(); i++){ + if(DESKTOPS[i]->Screen() == scrn){ DESKTOPS[i]->UpdateGeometry(); return; } + } +} + void LSession::checkWindowGeoms(){ //Only do one window per run (this will be called once per new window - with time delays between) if(checkWin.isEmpty()){ return; } - if(RunningApps.contains(checkWin[0]) ){ //just to make sure it did not close during the delay - adjustWindowGeom( checkWin[0] ); + WId win = checkWin.takeFirst(); + if(RunningApps.contains(win) ){ //just to make sure it did not close during the delay + adjustWindowGeom( win ); } - checkWin.removeAt(0); } void LSession::checkUserFiles(){ @@ -431,9 +450,22 @@ void LSession::refreshWindowManager(){ } void LSession::updateDesktops(){ - //qDebug() << " - Update Desktops"; + qDebug() << " - Update Desktops"; QDesktopWidget *DW = this->desktop(); + qDebug() << " -- Number:" << DW->screenCount(); + for(int i=0; i<DW->screenCount(); i++){ qDebug() << " -- Screen["+QString::number(i)+"]:" << DW->screenGeometry(i); } bool firstrun = (DESKTOPS.length()==0); + bool numchange = DESKTOPS.length()!=DW->screenCount(); + //Determine if this is a temporary X screen reset (some full-screen apps modify the screens) + /*WId actWin = XCB->ActiveWindow(); + qDebug() << " -- Active Window:" << XCB->WindowClass(actWin); + //See if the current app is full-screen + int fscreen = -1; + if( XCB->WindowClass(actWin) != "Lumina Desktop Environment" ){ + fscreen = XCB->WindowIsFullscreen(actWin); + }*/ + qDebug() << " -- Desktop Flags:" << firstrun << numchange << DW->isVirtualDesktop(); + //Now go through and if(!firstrun){ savedScreens.clear(); } for(int i=0; i<DW->screenCount(); i++){ if(!firstrun){ savedScreens << DW->screenGeometry(i); } @@ -453,23 +485,31 @@ void LSession::updateDesktops(){ } } //qDebug() << " - Done Starting Desktops"; - + //return; //temporary stop for debugging 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()){ + /*if(DESKTOPS[i]->Screen()==fscreen){ + qDebug() << " - Hide desktop on screen:" << fscreen; + DESKTOPS[i]->hide(); + }else*/ if(DESKTOPS[i]->Screen() >= DW->screenCount()){ qDebug() << " - Close desktop on screen:" << DESKTOPS[i]->Screen(); DESKTOPS[i]->prepareToClose(); delete DESKTOPS.takeAt(i); i--; }else{ qDebug() << " - Show desktop on screen:" << DESKTOPS[i]->Screen(); + //DESKTOPS[i]->UpdateGeometry(); DESKTOPS[i]->show(); //QTimer::singleShot(0,DESKTOPS[i], SLOT(checkResolution())); } } - QTimer::singleShot(1000,WM, SLOT(restartWM())); //Make sure fluxbox also gets prompted to re-load screen config + //Make sure fluxbox also gets prompted to re-load screen config if the number of screens changes + if(numchange){ + qDebug() << "Update WM"; + //QTimer::singleShot(1000,WM, SLOT(restartWM())); //Note: This causes crashes in X if a full-screen app + WM->updateWM(); + } } //Make sure all the background windows are registered on the system as virtual roots QTimer::singleShot(100,this, SLOT(registerDesktopWindows())); @@ -485,7 +525,9 @@ void LSession::registerDesktopWindows(){ } void LSession::adjustWindowGeom(WId win, bool maximize){ - if(DEBUG){ qDebug() << "AdjustWindowGeometry():" << win << maximize; } + //return; //temporary disable + if(DEBUG){ qDebug() << "AdjustWindowGeometry():" << win << maximize << XCB->WindowClass(win); } + if(XCB->WindowIsFullscreen(win) >=0 ){ return; } //don't touch it //Quick hack for making sure that new windows are not located underneath any panels // Get the window location QRect geom = XCB->WindowGeometry(win, false); @@ -568,7 +610,7 @@ 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(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(); } @@ -635,11 +677,13 @@ void LSession::WindowPropertyEvent(){ QList<WId> newapps = XCB->WindowList(); if(RunningApps.length() < newapps.length()){ //New Window found + qDebug() << "New window found"; LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?) //Perform sanity checks on any new window geometries for(int i=0; i<newapps.length() && !TrayStopping; i++){ if(!RunningApps.contains(newapps[i])){ checkWin << newapps[i]; + if(DEBUG){ qDebug() << "New Window - check geom in a moment:" << XCB->WindowClass(newapps[i]); } QTimer::singleShot(100, this, SLOT(checkWindowGeoms()) ); } } @@ -770,6 +814,7 @@ void LSession::attachTrayWindow(WId win){ //static int appnum = 0; if(TrayStopping){ return; } if(RunningTrayApps.contains(win)){ return; } //already managed + qDebug() << "Session Tray: Window Added"; RunningTrayApps << win; LSession::restoreOverrideCursor(); if(DEBUG){ qDebug() << "Tray List Changed"; } @@ -780,6 +825,7 @@ void LSession::removeTrayWindow(WId win){ if(SystemTrayID==0){ return; } for(int i=0; i<RunningTrayApps.length(); i++){ if(win==RunningTrayApps[i]){ + qDebug() << "Session Tray: Window Removed"; RunningTrayApps.removeAt(i); emit TrayListChanged(); break; diff --git a/lumina-desktop/LSession.h b/lumina-desktop/LSession.h index 52da2e6f..9edaf195 100644 --- a/lumina-desktop/LSession.h +++ b/lumina-desktop/LSession.h @@ -98,6 +98,7 @@ private: WMProcess *WM; QList<LDesktop*> DESKTOPS; QFileSystemWatcher *watcher; + QTimer *screenTimer; //Internal variable for global usage AppMenu *appmenu; @@ -134,6 +135,8 @@ public slots: private slots: void watcherChange(QString); + void screensChanged(); + void screenResized(int); void checkWindowGeoms(); //System Tray Functions diff --git a/lumina-desktop/WMProcess.cpp b/lumina-desktop/WMProcess.cpp index 9e398f93..32aee8ea 100644 --- a/lumina-desktop/WMProcess.cpp +++ b/lumina-desktop/WMProcess.cpp @@ -44,6 +44,7 @@ void WMProcess::stopWM(){ } void WMProcess::restartWM(){ + qDebug() << "Restarting WM"; if(isRunning()){ inShutdown = true; this->kill(); @@ -55,6 +56,7 @@ void WMProcess::restartWM(){ void WMProcess::updateWM(){ if(isRunning()){ + qDebug() << "Updating WM"; ::kill(this->pid(), SIGUSR2); //send fluxbox the signal to reload it's configuration } } diff --git a/lumina-desktop/WMProcess.h b/lumina-desktop/WMProcess.h index 287a8967..ff1b3963 100644 --- a/lumina-desktop/WMProcess.h +++ b/lumina-desktop/WMProcess.h @@ -23,9 +23,12 @@ public: void startWM(); void stopWM(); - void restartWM(); + void updateWM(); - + +public slots: + void restartWM(); + private: bool inShutdown; bool isRunning(); diff --git a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp index 519a5e23..d6a87c72 100644 --- a/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp +++ b/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp @@ -161,12 +161,13 @@ void LSysTray::UpdateTrayWindow(WId win){ if(!isRunning || stopping || checking){ return; } for(int i=0; i<trayIcons.length(); i++){ if(trayIcons[i]->appID()==win){ - //qDebug() << "System Tray: Update Window " << win; + qDebug() << "System Tray: Update Window " << win; trayIcons[i]->update(); return; //finished now } } //Could not find tray in the list, run the checkall routine to make sure we are not missing any + qDebug() << "System Tray: Missing Window - check all"; QTimer::singleShot(0,this, SLOT(checkAll()) ); } |