From 0048a03080ab12570c4c2b049d762f35e03e5f6c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 14 Aug 2017 16:59:07 -0400 Subject: A bit more random work: 1) Icon overlay fixes for desktop icons 2) Some more Lumina 2.x debugging/work --- src-qt5/core/libLumina/LIconCache.cpp | 6 ++--- src-qt5/core/libLumina/NativeEmbedWidget.cpp | 1 + src-qt5/core/libLumina/NativeEventFilter.cpp | 27 ++++++++++++++++++---- src-qt5/core/libLumina/NativeWindow.h | 32 +++++++++++++-------------- src-qt5/core/libLumina/NativeWindowSystem.cpp | 7 +++--- 5 files changed, 47 insertions(+), 26 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/libLumina/LIconCache.cpp b/src-qt5/core/libLumina/LIconCache.cpp index bb81bc47..70c360fb 100644 --- a/src-qt5/core/libLumina/LIconCache.cpp +++ b/src-qt5/core/libLumina/LIconCache.cpp @@ -57,7 +57,7 @@ QString LIconCache::findFile(QString icon){ QString cTheme = QIcon::themeName(); if(cTheme.isEmpty()){ QIcon::setThemeName("material-design-light"); - cTheme = "material-design-light"; + cTheme = "material-design-light"; } //Make sure the current search paths correspond to this theme if( QDir::searchPaths("icontheme").filter("/"+cTheme+"/").isEmpty() ){ @@ -231,7 +231,7 @@ QStringList LIconCache::getChildIconDirs(QString path){ QDir D(path); QStringList out; QStringList dirs = D.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); - if(!dirs.isEmpty() && (dirs.contains("32x32") || dirs.contains("scalable")) ){ + if(!dirs.isEmpty() && (dirs.contains("32x32") || dirs.contains("scalable")) ){ //Need to sort these directories by image size //qDebug() << " - Parent:" << parent << "Dirs:" << dirs; for(int i=0; iid()); registerClientEvents(this->winId()); + qDebug() << "Events Registered:" << WIN->id() << this->winId(); return true; } diff --git a/src-qt5/core/libLumina/NativeEventFilter.cpp b/src-qt5/core/libLumina/NativeEventFilter.cpp index a6b2f3b5..354dbe76 100644 --- a/src-qt5/core/libLumina/NativeEventFilter.cpp +++ b/src-qt5/core/libLumina/NativeEventFilter.cpp @@ -65,7 +65,7 @@ static xcb_ewmh_connection_t EWMH; static xcb_atom_t _NET_SYSTEM_TRAY_OPCODE = 0; inline void ParsePropertyEvent(xcb_property_notify_event_t *ev, NativeEventFilter *obj){ - //qDebug() << "Got Property Event:" << ev->window << ev->atom; + qDebug() << "Got Property Event:" << ev->window << ev->atom; NativeWindow::Property prop = NativeWindow::None; //Now determine which properties are getting changed, and update the native window as appropriate if(ev->atom == EWMH._NET_WM_NAME){ prop = NativeWindow::Title; } @@ -76,14 +76,33 @@ inline void ParsePropertyEvent(xcb_property_notify_event_t *ev, NativeEventFilte else if( ev->atom == EWMH._NET_WM_STATE){ prop = NativeWindow::States; } //Send out the signal if necessary if(prop!=NativeWindow::None){ - if(DEBUG){ qDebug() << "Detected Property Change:" << ev->window << prop; } + //if(DEBUG){ + qDebug() << "Detected Property Change:" << ev->window << prop; + //} obj->emit WindowPropertyChanged(ev->window, prop); }else{ //qDebug() << "Unknown Property Change:" << ev->window << ev->atom; } } -inline void ParseClientMessageEvent(xcb_client_message_event *ev, NativeEventFilter *obj){ +inline void ParseClientMessageEvent(xcb_client_message_event_t *ev, NativeEventFilter *obj){ + NativeWindow::Property prop = NativeWindow::None; + QVariant val; + if(ev->type==EWMH._NET_WM_NAME){ prop = NativeWindow::Title; } + else if(ev->type==EWMH._NET_WM_ICON){ prop = NativeWindow::Icon; } + else if(ev->type==EWMH._NET_WM_ICON_NAME){ prop = NativeWindow::ShortTitle; } + else if(ev->type==EWMH._NET_WM_DESKTOP){ + prop = NativeWindow::Workspace; + val = QVariant( (int) ev->data.data32[0] ); + }else if(ev->type==EWMH._NET_WM_WINDOW_TYPE){ prop = NativeWindow::WinTypes; } + else if(ev->type==EWMH._NET_WM_STATE){ prop = NativeWindow::States; } + + if(prop!=NativeWindow::None){ + //if(DEBUG){ + qDebug() << "Detected Property Change Request:" << ev->window << prop; //} + if(val.isNull()){ obj->emit WindowPropertyChanged(ev->window, prop); } + else{ obj->emit RequestWindowPropertyChange(ev->window, prop, val); } + } } @@ -226,7 +245,7 @@ bool EventFilter::nativeEventFilter(const QByteArray &eventType, void *message, //addTrayApp( ((xcb_client_message_event_t*)ev)->data.data32[2] ); } //Ignore the System Tray messages at the moment - }else if(((xcb_client_message_event_t*)ev)->window == QX11Info::appRootWindow()){ + }else if(((xcb_client_message_event_t*)ev)->window != QX11Info::appRootWindow()){ ParseClientMessageEvent((xcb_client_message_event_t*)ev, obj); } break; diff --git a/src-qt5/core/libLumina/NativeWindow.h b/src-qt5/core/libLumina/NativeWindow.h index 47359b7d..d04815ce 100644 --- a/src-qt5/core/libLumina/NativeWindow.h +++ b/src-qt5/core/libLumina/NativeWindow.h @@ -30,22 +30,22 @@ public: enum Property{ /*QVariant Type*/ None=0, /*null*/ - MinSize, /*QSize*/ - MaxSize, /*QSize*/ - Size, /*QSize*/ - GlobalPos, /*QPoint*/ - Title, /*QString*/ - ShortTitle, /*QString*/ - Icon, /*QIcon*/ - Name, /*QString*/ - Workspace, /*int*/ - States, /*QList : Current state of the window */ - WinTypes, /*QList : Current type of window (typically does not change)*/ - WinActions, /*QList : Current actions that the window allows (Managed/set by the WM)*/ - FrameExtents, /*QList : [Left, Right, Top, Bottom] in pixels */ - RelatedWindows, /* QList - better to use the "isRelatedTo(WId)" function instead of reading this directly*/ - Active, /*bool*/ - Visible /*bool*/ + MinSize=1, /*QSize*/ + MaxSize=2, /*QSize*/ + Size=3, /*QSize*/ + GlobalPos=4, /*QPoint*/ + Title=5, /*QString*/ + ShortTitle=6, /*QString*/ + Icon=7, /*QIcon*/ + Name=8, /*QString*/ + Workspace=9, /*int*/ + States=10, /*QList : Current state of the window */ + WinTypes=11, /*QList : Current type of window (typically does not change)*/ + WinActions=12, /*QList : Current actions that the window allows (Managed/set by the WM)*/ + FrameExtents=13, /*QList : [Left, Right, Top, Bottom] in pixels */ + RelatedWindows=14, /* QList - better to use the "isRelatedTo(WId)" function instead of reading this directly*/ + Active=15, /*bool*/ + Visible=16 /*bool*/ }; static QList allProperties(){ diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp index 74eef2b9..71e95a0e 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.cpp +++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp @@ -254,7 +254,8 @@ void NativeWindowSystem::stop(){ NativeWindow* NativeWindowSystem::findWindow(WId id, bool checkRelated){ //qDebug() << "Find Window:" << id; for(int i=0; iid() || id==NWindows[i]->frameId() ){ return NWindows[i]; } + if(id==NWindows[i]->id() ){ return NWindows[i]; } + else if(id==NWindows[i]->frameId() ){ qDebug() << "Matched Frame:" << id; return NWindows[i]; } //if(checkRelated && NWindows[i]->isRelatedTo(id)){ return NWindows[i]; } //else if(!checkRelated && id==NWindows[i]->id()){ return NWindows[i]; } } @@ -496,7 +497,7 @@ void NativeWindowSystem::ChangeWindowProperties(NativeWindow* win, QList< Native valList.y = win->property(NativeWindow::GlobalPos).toPoint().y(); }*/ uint16_t mask = 0; - mask = mask | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; + mask = mask | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;// | XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; qDebug() << "Configure window Geometry:" << sz; xcb_configure_window_aux(QX11Info::connection(), win->id(), mask, &valList); } @@ -667,7 +668,7 @@ void NativeWindowSystem::NewWindowDetected(WId id){ registerClientEvents(win->id()); NWindows << win; UpdateWindowProperties(win, NativeWindow::allProperties()); - qDebug() << "New Window [& associated ID's]:" << win->id() << win->property(NativeWindow::RelatedWindows); + qDebug() << "New Window [& associated ID's]:" << win->id() << win->frameId() << win->property(NativeWindow::RelatedWindows); //Now setup the connections with this window connect(win, SIGNAL(RequestClose(WId)), this, SLOT(RequestClose(WId)) ); connect(win, SIGNAL(RequestKill(WId)), this, SLOT(RequestKill(WId)) ); -- cgit