aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/NativeWindowSystem.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-03-07 00:25:58 -0800
committerKen Moore <ken@ixsystems.com>2017-03-07 00:25:58 -0800
commitc6fab6a167bcd3bba4cafe2532c0529ca76b8068 (patch)
treef50d153643c35b9cd253c669d9637e7879474639 /src-qt5/core/libLumina/NativeWindowSystem.h
parentMake sure we respect the "override_redirect" flag on a window (do not try to ... (diff)
downloadlumina-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.h')
-rw-r--r--src-qt5/core/libLumina/NativeWindowSystem.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/NativeWindowSystem.h b/src-qt5/core/libLumina/NativeWindowSystem.h
index f5d4c8ae..59e54ca4 100644
--- a/src-qt5/core/libLumina/NativeWindowSystem.h
+++ b/src-qt5/core/libLumina/NativeWindowSystem.h
@@ -12,6 +12,8 @@
#define _LUMINA_NATIVE_WINDOW_SYSTEM_H
#include "NativeWindow.h"
+#include <QDateTime>
+#include <QTimer>
class NativeWindowSystem : public QObject{
Q_OBJECT
@@ -39,6 +41,23 @@ private:
class p_objects;
p_objects* obj;
+ //Internal timers/variables for managing pings
+ QTimer *pingTimer;
+ QHash<WId, QDateTime> waitingForPong;
+ void checkPings(){
+ QDateTime cur = QDateTime::currentDateTime();
+ QList<WId> waiting = waitingForPong.keys();
+ for(int i=0; i<waiting.length(); i++){
+ if(waitingForPong.value(waiting[i]) < cur){
+ waitingForPong.remove(waiting[i]); //Timeout on this window
+ if(waitingForPong.isEmpty() && pingTimer!=0){ pingTimer->stop(); }
+ NativeWindow *win = findWindow(waiting[i]);
+ if(win==0){ win = findTrayWindow(waiting[i]); }
+ if(win!=0){ win->emit WindowNotResponding(waiting[i]); }
+ }
+ }
+ }
+
// Since some properties may be easier to update in bulk
// let the native system interaction do them in whatever logical groups are best
void UpdateWindowProperties(NativeWindow* win, QList< NativeWindow::Property > props);
@@ -77,6 +96,8 @@ public slots:
void NewTrayWindowDetected(WId); //will automatically create the new NativeWindow object
void WindowCloseDetected(WId); //will update the lists and make changes if needed
void WindowPropertyChanged(WId, NativeWindow::Property); //will rescan the window and update the object as needed
+ void GotPong(WId);
+
/* void NewKeyPress(int keycode, WId win = 0);
void NewKeyRelease(int keycode, WId win = 0);
void NewMousePress(int buttoncode, WId win = 0);
bgstack15