@@ -29,6 +29,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
2929
3030 private GLib . HashTable<Meta . Window , PanelWindow > panel_windows = new GLib .HashTable<Meta . Window , PanelWindow > (null , null );
3131 private GLib . HashTable<Meta . Window , ExtendedBehaviorWindow > positioned_windows = new GLib .HashTable<Meta . Window , ExtendedBehaviorWindow > (null , null );
32+ private GLib . HashTable<Meta . Window , MonitorLabelWindow > monitor_label_windows = new GLib .HashTable<Meta . Window , MonitorLabelWindow > (null , null );
3233
3334 private ShellClientsManager (WindowManager wm ) {
3435 Object (wm: wm);
@@ -244,6 +245,18 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
244245 positioned_windows[window]. make_modal (dim);
245246 }
246247
248+ public void make_monitor_label (Meta .Window window , int monitor_index ) requires (!is_itself_shell_window (window )) {
249+ if (monitor_index < 0 || monitor_index > wm. get_display (). get_n_monitors ()) {
250+ warning (" Invalid monitor index provided: %d " , monitor_index);
251+ return ;
252+ }
253+
254+ monitor_label_windows[window] = new MonitorLabelWindow (window, monitor_index);
255+
256+ // connect_after so we make sure that any queued move is unqueued
257+ window. unmanaging. connect_after ((_window) = > monitor_label_windows. remove (_window));
258+ }
259+
247260 public void propagate (UpdateType update_type , GestureAction action , double progress ) {
248261 foreach (var window in positioned_windows. get_values ()) {
249262 window. propagate (update_type, action, progress);
@@ -258,6 +271,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
258271 return (
259272 (window in positioned_windows && positioned_windows[window]. modal) ||
260273 (window in panel_windows) ||
274+ (window in monitor_label_windows) ||
261275 NotificationStack . is_notification (window)
262276 );
263277 }
@@ -387,6 +401,15 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
387401 set_restore_previous_x11_region (window);
388402 break ;
389403
404+ case " monitor-label" :
405+ int parsed;
406+ if (int . try_parse (val, out parsed)) {
407+ make_monitor_label (window, parsed);
408+ } else {
409+ warning (" Failed to parse %s as monitor label" , val);
410+ }
411+ break ;
412+
390413 default:
391414 break ;
392415 }
0 commit comments