From 9b057531662b3a376ea8d4cf444eee795d3e373b Mon Sep 17 00:00:00 2001 From: Daniel Kondor Date: Sun, 9 Feb 2025 14:15:59 +0100 Subject: [PATCH] fix issues in the example script --- wf_gtk_global_menu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wf_gtk_global_menu.py b/wf_gtk_global_menu.py index f9a399f20..c5dd1537c 100644 --- a/wf_gtk_global_menu.py +++ b/wf_gtk_global_menu.py @@ -160,7 +160,6 @@ def sock_event(ch, cond): global self_id global active_view_id global conn - print("in sock_event") msg = sock.read_next_event() if msg is None: return False @@ -171,7 +170,7 @@ def sock_event(ch, cond): print(msg["view"]["app-id"], end = " - ") print(msg["view"]["id"]) view_ids[msg["view"]["id"]] = msg["view"]["app-id"] - if msg["view"]["app-id"] == "gtk_socket.py": + if msg["view"]["app-id"] == "wf_gtk_global_menu.py": self_id = msg["view"]["id"] else: print('') @@ -191,7 +190,8 @@ def sock_event(ch, cond): elif msg["event"] == "view-focused": if ("view" in msg) and (msg["view"] is not None): id1 = msg["view"]["id"] - if self_id and (id1 != self_id): + print("focused view has ID: {}".format(id1)) + if not self_id or (id1 != self_id): active_view_id = id1 have_new_menu = False if active_view_id in view_ids: