diff options
Diffstat (limited to 'src-qt5/core')
5 files changed, 34 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp index 07d4e463..8540f44e 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.cpp @@ -8,7 +8,7 @@ #include <QQmlEngine> #include <QApplication> #include <QScreen> - +#include <global-objects.h> #include <QDebug> // === PUBLIC === @@ -138,6 +138,21 @@ void RootDesktopObject::lockscreen(){ void RootDesktopObject::mousePositionChanged(){ emit mouseMoved(); + // Go through the transparent windows (in order of high->low in stack) + // and raise/lower the transparent overlays as needed + QPoint pos = QCursor::pos(); + for(int i=window_objects.length()-1; i>=0; i--){ + if(window_objects[i]->geometry().contains(pos) ){ + if(last_window_up!= window_objects[i]){ + if(last_window_up!=0){ Lumina::NWS->lowerWindow(last_window_up); } + Lumina::NWS->raiseWindow(window_objects[i]); + last_window_up = window_objects[i]; + } + return; //found the currently-hovered window + } + } + //failover for when no window has the mouse over it (lower all of them) + if(last_window_up!=0){ Lumina::NWS->lowerWindow(last_window_up); } } void RootDesktopObject::launchApp(QString appOrPath){ diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h index ad0e538b..b1ca6f7e 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/RootDesktopObject.h @@ -47,6 +47,7 @@ private: QList<ScreenObject*> s_objects; QList<PanelObject*> panel_objects; QList<NativeWindowObject*> window_objects; + QPointer<NativeWindowObject> last_window_up; public slots: void updateScreens(); //rescan/update screen objects diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/NativeWindow.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/NativeWindow.qml index 2150e37c..a0bd36f4 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/NativeWindow.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/NativeWindow.qml @@ -207,6 +207,9 @@ Rectangle { height: parent.height anchors.fill: frameContents onClicked: { console.log(parent.mapToGlobal(mouse.x, mouse.y)); } + onPositionChanged: { + RootObject.mousePositionChanged() + } } } } diff --git a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp index 063c1337..3d6b0f3e 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp @@ -962,6 +962,17 @@ void NativeWindowSystem::CheckDamageID(WId win){ } } +void NativeWindowSystem::raiseWindow(NativeWindowObject *win){ + qDebug() << "Raise Window:" << win->name(); + xcb_circulate_window(QX11Info::connection(), XCB_CIRCULATE_RAISE_LOWEST ,win->id()); +} + + +void NativeWindowSystem::lowerWindow(NativeWindowObject *win){ + qDebug() << "Lower Window:" << win->name(); + xcb_circulate_window(QX11Info::connection(), XCB_CIRCULATE_LOWER_HIGHEST ,win->id()); +} + // === PRIVATE SLOTS === //These are the slots which are built-in and automatically connected when a new NativeWindow is created diff --git a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h index 5810fc36..74849cf4 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h +++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.h @@ -80,6 +80,9 @@ public: static Qt::Key KeycodeToQt(int keycode); static NativeWindowSystem::MouseButton MouseToQt(int button); + void raiseWindow(NativeWindowObject *win); + void lowerWindow(NativeWindowObject *win); + public slots: //These are the slots which are typically only used by the desktop system itself or the NativeWindowEventFilter |