From a3f9941b51d83f64c80e99b7a26ab63d3283be82 Mon Sep 17 00:00:00 2001 From: piotr Date: Sun, 8 Jan 2023 01:31:20 +0100 Subject: [PATCH] tweak output # detection --- nwg_panel/main.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nwg_panel/main.py b/nwg_panel/main.py index bd2427b..ca3eb8b 100644 --- a/nwg_panel/main.py +++ b/nwg_panel/main.py @@ -115,14 +115,15 @@ def check_tree(): if tree.ipc_data != common.ipc_data: num = num_active_outputs(tree) if num != common.outputs_num: - if num < common.outputs_num: - print("Number of outputs decreased {}, restarting".format(num)) - # restart() - Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 0, restart) - else: - print("Number of outputs increased ({}); restart in {} ms." - .format(num, common_settings["restart-delay"])) - Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 0, restart) + Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 0, restart) + # if num < common.outputs_num: + # print("Number of outputs decreased {}, restarting".format(num)) + # # restart() + # Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 0, restart) + # else: + # print("Number of outputs increased ({}); restart in {} ms." + # .format(num, common_settings["restart-delay"])) + # Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 0, restart) for item in common.taskbars_list: item.refresh(tree)