gardesk/gar / 7c141d5

Browse files

clear _NET_ACTIVE_WINDOW when focusing empty monitor

Authored by espadonne
SHA
7c141d58a637559b3938b93deacfb685b0526b82
Parents
44630cf
Tree
39ea813

1 changed file

StatusFile+-
M gar/src/x11/events.rs 3 1
gar/src/x11/events.rsmodified
@@ -2206,6 +2206,7 @@ impl WindowManager {
2206
         } else {
2206
         } else {
2207
             // No windows on target monitor - clear focus and warp to monitor center
2207
             // No windows on target monitor - clear focus and warp to monitor center
2208
             self.focused_window = None;
2208
             self.focused_window = None;
2209
+            self.conn.set_active_window(None)?;
2209
             self.warp_to_monitor(target_idx)?;
2210
             self.warp_to_monitor(target_idx)?;
2210
             tracing::debug!("No windows on monitor {}, warped to center", target_idx);
2211
             tracing::debug!("No windows on monitor {}, warped to center", target_idx);
2211
         }
2212
         }
@@ -3103,8 +3104,9 @@ impl WindowManager {
3103
             // set_focus handles grab/ungrab for old and new windows
3104
             // set_focus handles grab/ungrab for old and new windows
3104
             self.set_focus(window, true)?;
3105
             self.set_focus(window, true)?;
3105
         } else {
3106
         } else {
3106
-            // No windows - warp to monitor center
3107
+            // No windows - clear EWMH active window and warp to monitor center
3107
             self.focused_window = None;
3108
             self.focused_window = None;
3109
+            self.conn.set_active_window(None)?;
3108
             self.warp_to_monitor(target_idx)?;
3110
             self.warp_to_monitor(target_idx)?;
3109
         }
3111
         }
3110
 
3112