diff options
author | Aylur <[email protected]> | 2024-12-19 21:32:48 +0100 |
---|---|---|
committer | Aylur <[email protected]> | 2024-12-19 21:32:48 +0100 |
commit | 61637d6333bd812021763039ceea61e7f7d29dbf (patch) | |
tree | bebdc24df1d5d0a9c7bf2c2f98376c1be341ee80 /lib/hyprland | |
parent | 64150c7739049e3cc9b6b931eba58a635cbc24df (diff) | |
parent | c12fb05408c1cd1b1bca545fec636abda52f6755 (diff) |
Merge branch 'main' into feat/tray-gtk4
Diffstat (limited to 'lib/hyprland')
-rw-r--r-- | lib/hyprland/hyprland.vala | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/hyprland/hyprland.vala b/lib/hyprland/hyprland.vala index ea95cab..5bdff81 100644 --- a/lib/hyprland/hyprland.vala +++ b/lib/hyprland/hyprland.vala @@ -309,17 +309,30 @@ public class Hyprland : Object { switch (args[0]) { case "workspacev2": yield sync_workspaces(); + yield sync_monitors(); focused_workspace = get_workspace(int.parse(args[1])); break; case "focusedmon": var argv = args[1].split(",", 2); + yield sync_monitors(); focused_monitor = get_monitor_by_name(argv[0]); focused_workspace = get_workspace_by_name(argv[1]); break; + // first event that signals a new client case "activewindowv2": - focused_client = get_client(args[1]); + if (args[1] != "" && get_client(args[1]) == null) { + var client = new Client(); + _clients.insert(args[1], client); + yield sync_clients(); + yield sync_workspaces(); + client_added(client); + notify_property("clients"); + focused_client = client; + } else { + focused_client = get_client(args[1]); + } break; // TODO: nag vaxry for fullscreenv2 that passes address @@ -381,20 +394,15 @@ public class Hyprland : Object { break; case "openwindow": - var addr = args[1].split(",")[0]; - var client = new Client(); - _clients.insert(addr, client); yield sync_clients(); yield sync_workspaces(); - client_added(client); - notify_property("clients"); break; case "closewindow": _clients.get(args[1]).removed(); _clients.remove(args[1]); - client_removed(args[1]); yield sync_workspaces(); + client_removed(args[1]); notify_property("clients"); break; @@ -426,7 +434,7 @@ public class Hyprland : Object { minimize(get_client(argv[0]), argv[1] == "0"); break; - case "windowtitle": + case "windowtitlev2": yield sync_clients(); break; |