diff options
author | Ken Moore <ken@ixsystems.com> | 2017-03-07 00:25:58 -0800 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-03-07 00:25:58 -0800 |
commit | c6fab6a167bcd3bba4cafe2532c0529ca76b8068 (patch) | |
tree | f50d153643c35b9cd253c669d9637e7879474639 /src-qt5/core/libLumina/NativeWindowSystem.cpp | |
parent | Make sure we respect the "override_redirect" flag on a window (do not try to ... (diff) | |
download | lumina-c6fab6a167bcd3bba4cafe2532c0529ca76b8068.tar.gz lumina-c6fab6a167bcd3bba4cafe2532c0529ca76b8068.tar.bz2 lumina-c6fab6a167bcd3bba4cafe2532c0529ca76b8068.zip |
Get the ping/pong system all setup within the NativeWindowSystem.
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindowSystem.cpp')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindowSystem.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src-qt5/core/libLumina/NativeWindowSystem.cpp b/src-qt5/core/libLumina/NativeWindowSystem.cpp index 723415f2..c4905d4c 100644 --- a/src-qt5/core/libLumina/NativeWindowSystem.cpp +++ b/src-qt5/core/libLumina/NativeWindowSystem.cpp @@ -173,7 +173,8 @@ public: // === PUBLIC === NativeWindowSystem::NativeWindowSystem() : QObject(){ - obj = 0; + obj = 0; + pingTimer = 0; } NativeWindowSystem::~NativeWindowSystem(){ @@ -491,6 +492,13 @@ void NativeWindowSystem::WindowPropertyChanged(WId id, NativeWindow::Property pr } } +void NativeWindowSystem::GotPong(WId id){ + if(waitingForPong.contains(id)){ + waitingForPong.remove(id); + } + if(waitingForPong.isEmpty() && pingTimer!=0){ pingTimer->stop(); } +} + /*void NativeWindowSystem::NewKeyPress(int keycode, WId win){ emit NewInputEvent(); } @@ -581,5 +589,12 @@ void NativeWindowSystem::RequestKill(WId win){ } void NativeWindowSystem::RequestPing(WId win){ + waitingForPong.insert(win, QDateTime::currentDateTime().addSecs(5) ); xcb_ewmh_send_wm_ping(&obj->EWMH, win, XCB_CURRENT_TIME); + if(pingTimer==0){ + pingTimer = new QTimer(this); + pingTimer->setInterval(2000); //2seconds + connect(pingTimer, SIGNAL(timeout()), this, SLOT(checkPings()) ); + } + pingTimer->start(); } |