diff --git a/nwg_panel/main.py b/nwg_panel/main.py index 9bc7e6f..3c30a23 100644 --- a/nwg_panel/main.py +++ b/nwg_panel/main.py @@ -185,54 +185,54 @@ def hypr_watcher(): event_name = e_full_string.split(">>")[0] - # if event_name in ["monitoradded", "openwindow", "movewindow"]: - # monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() - # for item in common.h_taskbars_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # last_client_title = client_title - # last_client_addr = client_addr - # continue - # - # if event_name == "focusedmon": - # monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() - # for item in common.h_workspaces_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # last_client_title = client_title - # last_client_addr = client_addr - # continue - # - # if event_name == "activewindow" and client_title != last_client_title: - # monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() - # for item in common.h_taskbars_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # for item in common.h_workspaces_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # last_client_title = client_title - # continue - # - # if event_name == "activewindowv2" and client_addr != last_client_addr: - # monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() - # for item in common.h_taskbars_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # for item in common.h_workspaces_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # last_client_addr = client_addr - # continue - # - # if event_name in ["changefloatingmode", "closewindow"]: - # monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() - # for item in common.h_taskbars_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # for item in common.h_workspaces_list: - # GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) - # - # last_client_addr = "" - # last_client_title = "" + if event_name in ["monitoradded", "openwindow", "movewindow"]: + monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() + for item in common.h_taskbars_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + last_client_title = client_title + last_client_addr = client_addr + continue + + if event_name == "focusedmon": + monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() + for item in common.h_workspaces_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + last_client_title = client_title + last_client_addr = client_addr + continue + + if event_name == "activewindow" and client_title != last_client_title: + monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() + for item in common.h_taskbars_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + for item in common.h_workspaces_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + last_client_title = client_title + continue + + if event_name == "activewindowv2" and client_addr != last_client_addr: + monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() + for item in common.h_taskbars_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + for item in common.h_workspaces_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + last_client_addr = client_addr + continue + + if event_name in ["changefloatingmode", "closewindow"]: + monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() + for item in common.h_taskbars_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + for item in common.h_workspaces_list: + GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow, activeworkspace) + + last_client_addr = "" + last_client_title = "" def on_i3ipc_event(i3conn, event):