diff options
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 8 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.h | 15 | ||||
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.h | 4 |
3 files changed, 15 insertions, 12 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 020e4596..1fcaa552 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -35,11 +35,13 @@ QWindow* NativeWindow::window(){ QVariant NativeWindow::property(NativeWindow::Property prop){ if(hash.contains(prop)){ return hash.value(prop); } + else if(prop == NativeWindow::RelatedWindows){ return QVariant::fromValue(relatedTo); } return QVariant(); //null variant } void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){ - if(prop == NativeWindow::None || hash.value(prop)==val){ return; } + if(prop == NativeWindow::RelatedWindows){ relatedTo = val.value< QList<WId> >(); } + else if(prop == NativeWindow::None || hash.value(prop)==val){ return; } hash.insert(prop, val); emit PropertiesChanged(QList<NativeWindow::Property>() << prop, QList<QVariant>() << val); } @@ -54,7 +56,7 @@ void NativeWindow::setProperties(QList<NativeWindow::Property> props, QList<QVar } void NativeWindow::requestProperty(NativeWindow::Property prop, QVariant val){ - if(prop == NativeWindow::None || hash.value(prop)==val ){ return; } + if(prop == NativeWindow::None || prop == NativeWindow::RelatedWindows || hash.value(prop)==val ){ return; } emit RequestPropertiesChange(winid, QList<NativeWindow::Property>() << prop, QList<QVariant>() << val); } @@ -62,7 +64,7 @@ void NativeWindow::requestProperties(QList<NativeWindow::Property> props, QList< //Verify/adjust inputs as needed for(int i=0; i<props.length(); i++){ if(i>=vals.length()){ props.removeAt(i); i--; continue; } //no corresponding value for this property - if(props[i] == NativeWindow::None || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value + if(props[i] == NativeWindow::None || props[i] == NativeWindow::RelatedWindows || hash.value(props[i])==vals[i] ){ props.removeAt(i); vals.removeAt(i); i--; continue; } //Invalid property or identical value } emit RequestPropertiesChange(winid, props, vals); } diff --git a/src-qt5/core/libLumina/NativeWindow.h b/src-qt5/core/libLumina/NativeWindow.h index a3efd234..e6e90825 100644 --- a/src-qt5/core/libLumina/NativeWindow.h +++ b/src-qt5/core/libLumina/NativeWindow.h @@ -30,9 +30,9 @@ public: enum Property{ /*QVariant Type*/ None, /*null*/ - MinSize, /*QSize*/ - MaxSize, /*QSize*/ - Size, /*QSize*/ + MinSize, /*QSize*/ + MaxSize, /*QSize*/ + Size, /*QSize*/ GlobalPos, /*QPoint*/ Title, /*QString*/ ShortTitle, /*QString*/ @@ -41,17 +41,18 @@ public: Workspace, /*int*/ States, /*QList<NativeWindow::State> : Current state of the window */ WinTypes, /*QList<NativeWindow::Type> : Current type of window (typically does not change)*/ - WinActions, /*QList<NativeWindow::Action> : Current actions that the window allows (Managed/set by the WM)*/ - FrameExtents, /*QList<int> : [Left, Right, Top, Bottom] in pixels */ + WinActions, /*QList<NativeWindow::Action> : Current actions that the window allows (Managed/set by the WM)*/ + FrameExtents, /*QList<int> : [Left, Right, Top, Bottom] in pixels */ + RelatedWindows, /* QList<WId> - better to use the "isRelatedTo(WId)" function instead of reading this directly*/ Active, /*bool*/ Visible /*bool*/ }; static QList<NativeWindow::Property> allProperties(){ - //Return all the available properties (excluding "None") + //Return all the available properties (excluding "None" and "FrameExtents" (WM control only) ) QList<NativeWindow::Property> props; props << MinSize << MaxSize << Size << GlobalPos << Title << ShortTitle << Icon << Name << Workspace \ - << States << WinTypes << WinActions << Active << Visible; + << States << WinTypes << WinActions << RelatedWindows << Active << Visible; return props; }; diff --git a/src-qt5/core/libLumina/NativeWindowSystem.h b/src-qt5/core/libLumina/NativeWindowSystem.h index 53abd633..00841903 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.h +++ b/src-qt5/core/libLumina/NativeWindowSystem.h @@ -26,9 +26,9 @@ private: NativeWindow* findWindow(WId id){ qDebug() << "Find Window:" << id; for(int i=0; i<NWindows.length(); i++){ - qDebug() << " -- Check Window:" << NWindows[i]->id(); if(NWindows[i]->isRelatedTo(id)){ qDebug() << " -- Got Match!"; return NWindows[i]; } } + qDebug() << " -- Could not find Window!"; return 0; } @@ -69,7 +69,7 @@ private: bool screenLocked; public: - enum Property{ None, CurrentWorkspace, Workspaces, VirtualRoots, WorkAreas }; + //enum Property{ None, CurrentWorkspace, Workspaces, VirtualRoots, WorkAreas }; enum MouseButton{NoButton, LeftButton, RightButton, MidButton, BackButton, ForwardButton, TaskButton, WheelUp, WheelDown, WheelLeft, WheelRight}; NativeWindowSystem(); |