From 331107f04943e5719b3d66e31b9dd9d4c78319b8 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 29 Jan 2018 15:09:37 -0500 Subject: Couple more minor tweaks - trying to get the layering working properly. --- .../src-desktop/src-cpp/RootDesktopObject.cpp | 10 +++++++--- .../src-desktop/src-cpp/RootDesktopObject.h | 2 +- .../lumina-desktop-unified/src-events/NativeWindowSystem.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src-qt5') 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 254a67ac..523fa09f 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 @@ -13,6 +13,7 @@ // === PUBLIC === RootDesktopObject::RootDesktopObject(QObject *parent) : QObject(parent){ + last_window_up = 0; updateScreens(); //make sure the internal list is updated right away connect(this, SIGNAL(changePanels(QStringList)), this, SLOT(setPanels(QStringList)) ); } @@ -140,6 +141,7 @@ void RootDesktopObject::setPanels(QStringList ids){ void RootDesktopObject::setWindows(QList list){ window_objects = list; emit windowsChanged(); + mousePositionChanged(true); } void RootDesktopObject::logout(){ @@ -150,7 +152,7 @@ void RootDesktopObject::lockscreen(){ emit lockScreen(); } -void RootDesktopObject::mousePositionChanged(){ +void RootDesktopObject::mousePositionChanged(bool lowerall){ emit mouseMoved(); // Go through the transparent windows (in order of high->low in stack) // and raise/lower the transparent overlays as needed @@ -162,11 +164,13 @@ void RootDesktopObject::mousePositionChanged(){ Lumina::NWS->raiseWindow(window_objects[i]); last_window_up = window_objects[i]; } - return; //found the currently-hovered window + if(!lowerall){ return; } //found the currently-hovered window + }else if(lowerall){ + Lumina::NWS->lowerWindow(window_objects[i]); } } //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); } + if(last_window_up!=0 && !lowerall){ 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 b1ca6f7e..cc70f813 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 @@ -40,7 +40,7 @@ public: //QML Access Functions Q_INVOKABLE void logout(); Q_INVOKABLE void lockscreen(); - Q_INVOKABLE void mousePositionChanged(); + Q_INVOKABLE void mousePositionChanged(bool lowerall = false); Q_INVOKABLE void launchApp(QString appOrPath); private: 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 28c223ab..494b63c3 100644 --- a/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-events/NativeWindowSystem.cpp @@ -779,8 +779,10 @@ void NativeWindowSystem::NewWindowDetected(WId id){ if(attr == 0){ return; } //could not get attributes of window if(attr->override_redirect){ free(attr); return; } //window has override redirect set (do not manage) free(attr); + xcb_reparent_window(QX11Info::connection(), id, QX11Info::appRootWindow(), 0, 0); //Now go ahead and create/populate the container for this window NativeWindowObject *win = new NativeWindowObject(id); + //Register for events from this window registerClientEvents(win->id()); NWindows << win; @@ -964,13 +966,13 @@ void NativeWindowSystem::CheckDamageID(WId win){ } void NativeWindowSystem::raiseWindow(NativeWindowObject *win){ - qDebug() << "Raise Window:" << win->name(); + qDebug() << "Raise Window:" << win->name() << win->id(); xcb_circulate_window(QX11Info::connection(), XCB_CIRCULATE_RAISE_LOWEST ,win->id()); } void NativeWindowSystem::lowerWindow(NativeWindowObject *win){ - qDebug() << "Lower Window:" << win->name(); + qDebug() << "Lower Window:" << win->name() << win->id(); xcb_circulate_window(QX11Info::connection(), XCB_CIRCULATE_LOWER_HIGHEST ,win->id()); } -- cgit