diff options
author | Ken Moore <moorekou@gmail.com> | 2016-04-28 15:19:44 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-04-28 15:19:44 -0400 |
commit | 8cfb00480fe3577932c94f700b2805d78a3d135b (patch) | |
tree | 5c5f2a4ecda9525e18dd3fac8b97f3cfef9aa9fc /src-qt5/core/lumina-desktop | |
parent | Completely change how lumina-screenshot shows the image a bit. Now it is all ... (diff) | |
parent | Have lumina listen to the X root window property changes directly - and updat... (diff) | |
download | lumina-8cfb00480fe3577932c94f700b2805d78a3d135b.tar.gz lumina-8cfb00480fe3577932c94f700b2805d78a3d135b.tar.bz2 lumina-8cfb00480fe3577932c94f700b2805d78a3d135b.zip |
Merge branch 'master' of github.com:pcbsd/lumina
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r-- | src-qt5/core/lumina-desktop/LSession.cpp | 14 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LSession.h | 1 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/LXcbEventFilter.cpp | 7 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index b1a4b55e..2ab01d79 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -48,8 +48,7 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu TrayStopping = false; screenTimer = new QTimer(this); screenTimer->setSingleShot(true); - screenTimer->setInterval(1000); //2 seconds - This needs to be long(ish) to prevent being called while - // X is still setting up any screens + screenTimer->setInterval(50); connect(screenTimer, SIGNAL(timeout()), this, SLOT(updateDesktops()) ); for(int i=1; i<argc; i++){ if( QString::fromLocal8Bit(argv[i]) == "--noclean" ){ cleansession = false; break; } @@ -161,8 +160,8 @@ void LSession::setupSession(){ watcher->addPath( QDir::homePath()+"/Desktop" ); //connect internal signals/slots - connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) ); - connect(this->desktop(), SIGNAL(resized(int)), this, SLOT(screenResized(int)) ); + //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()) ); @@ -723,6 +722,13 @@ void LSession::playAudioFile(QString filepath){ // ======================= // XCB EVENT FILTER FUNCTIONS // ======================= +void LSession::RootSizeChange(){ + qDebug() << "Got Root Size Change"; + if(DESKTOPS.isEmpty()){ return; } //Initial setup not run yet + screenTimer->start(); + //QTimer::singleShot(0,this, SLOT(screensChanged()) ); +} + void LSession::WindowPropertyEvent(){ if(DEBUG){ qDebug() << "Window Property Event"; } QList<WId> newapps = XCB->WindowList(); diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h index ae217bd8..bdcc94a4 100644 --- a/src-qt5/core/lumina-desktop/LSession.h +++ b/src-qt5/core/lumina-desktop/LSession.h @@ -61,6 +61,7 @@ public: //Special functions for XCB event filter parsing only // (DO NOT USE MANUALLY) + void RootSizeChange(); void WindowPropertyEvent(); void WindowPropertyEvent(WId); void SysTrayDockRequest(WId); diff --git a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp index 7ee4f974..c8321c49 100644 --- a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp +++ b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp @@ -17,6 +17,7 @@ XCBEventFilter::XCBEventFilter(LSession *sessionhandle) : QAbstractNativeEventFi session = sessionhandle; //save this for interaction with the session later TrayDmgFlag = 0; stopping = false; + session->XCB->SelectInput(QX11Info::appRootWindow()); //make sure we get root window events InitAtoms(); } @@ -41,7 +42,11 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag //qDebug() << " - Root Window:" << QX11Info::appRootWindow(); //qDebug() << " - Given Window:" << ((xcb_property_notify_event_t*)ev)->window; //System-specific proprty change - if( SysNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){ + if( ((xcb_property_notify_event_t*)ev)->window == QX11Info::appRootWindow() \ + && ( ( ((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_DESKTOP_GEOMETRY) \ + || (((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_WORKAREA) )){ + session->RootSizeChange(); + }else if( SysNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){ //Update the status/list of all running windows session->WindowPropertyEvent(); |