diff options
author | Ken Moore <moorekou@gmail.com> | 2020-04-24 19:46:53 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2020-04-24 19:46:53 -0400 |
commit | a12bd680f39a0503cb93413d3420fd80158835d9 (patch) | |
tree | 831243bb1c126498df9fcf520f26757c4bcc2ab1 /src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp | |
parent | More updates. (diff) | |
download | lumina-a12bd680f39a0503cb93413d3420fd80158835d9.tar.gz lumina-a12bd680f39a0503cb93413d3420fd80158835d9.tar.bz2 lumina-a12bd680f39a0503cb93413d3420fd80158835d9.zip |
Some more updates to the desktop.
Get the screensaver checks working
Diffstat (limited to 'src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp b/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp index 9b8aa649..8cf78fdf 100644 --- a/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp +++ b/src-qt5/core/lumina-desktop/src-screensaver/LScreenSaver.cpp @@ -8,6 +8,7 @@ #include <QScreen> #include <QApplication> +#include <LSession.h> #define DEBUG 0 LScreenSaver::LScreenSaver() : QWidget(0,Qt::BypassWindowManagerHint | Qt::WindowStaysOnTopHint){ @@ -102,14 +103,18 @@ void LScreenSaver::checkInputEvents(){ change = true; } //Check the last keyboard input timestamp - //unsigned int timecode = WM_Get_User_Time( WM_Get_Active_Window() ); - unsigned int timecode = 0; //Not done yet - read the _NET_WM_USER_TIME number on the active window + WId active = LSession::handle()->XCB->WM_Get_Active_Window(); + if(active != lastActiveWindow){ + lastActiveWindow = active; + change = true; + } + unsigned int timecode = LSession::handle()->XCB->WM_Get_User_Time(active); if(timecode > lastTimeCode){ lastTimeCode = timecode; change = true; } - //If there was an input event detected, update timers and such - if(change){ newInputEvent(); } + //If there was an input event detected (or a window is currently full-screen), update timers and such + if(change || LSession::handle()->XCB->WindowIsFullscreen(active) ){ newInputEvent(); } } void LScreenSaver::ShowScreenSaver(){ |