diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop')
3 files changed, 20 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() + } } } } |