summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml
index c82caaa6..af522ec4 100644
--- a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml
+++ b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml
@@ -28,9 +28,12 @@ Singleton {
28 path: root.socketPath 28 path: root.socketPath
29 connected: true 29 connected: true
30 30
31 property bool acked: false
32
31 onConnectionStateChanged: { 33 onConnectionStateChanged: {
32 if (connected) { 34 if (connected) {
33 write('"EventStream"\n') 35 acked = false;
36 write('"EventStream"\n');
34 } 37 }
35 } 38 }
36 39
@@ -66,6 +69,9 @@ Singleton {
66 eventWindowUrgencyChanged(event.WindowUrgencyChanged); 69 eventWindowUrgencyChanged(event.WindowUrgencyChanged);
67 else if (event.WindowLayoutsChanged) 70 else if (event.WindowLayoutsChanged)
68 eventWindowLayoutsChanged(event.WindowLayoutsChanged); 71 eventWindowLayoutsChanged(event.WindowLayoutsChanged);
72 else if (event.Ok && !eventStreamSocket.acked) { eventStreamSocket.acked = true; }
73 else if (event.OverviewOpenedOrClosed) {}
74 else if (event.ConfigLoaded) {}
69 else 75 else
70 console.log(JSON.stringify(event)); 76 console.log(JSON.stringify(event));
71 } catch (e) { 77 } catch (e) {
@@ -154,7 +160,11 @@ Singleton {
154 }); 160 });
155 } 161 }
156 function eventWindowOpenedOrChanged(data) { 162 function eventWindowOpenedOrChanged(data) {
157 root.windows = Array.from(root.windows).filter(win => win.id !== data.window.id).concat([data.window]); 163 root.windows = Array.from(root.windows).map(win => {
164 if (data.window.is_focused)
165 win.is_focused = false;
166 return win;
167 }).filter(win => win.id !== data.window.id).concat([data.window]);
158 } 168 }
159 function eventWindowClosed(data) { 169 function eventWindowClosed(data) {
160 root.windows = Array.from(root.windows).filter(win => win.id !== data.id); 170 root.windows = Array.from(root.windows).filter(win => win.id !== data.id);