Pamhyr: Add recursive window activation.

setup.py
Pierre-Antoine Rouby 2024-02-13 11:32:16 +01:00
parent 83d53a46fb
commit f0f6ad17e2
1 changed files with 17 additions and 3 deletions

View File

@ -573,9 +573,23 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
############# #############
def _activate_window(self, window_hash): def _activate_window(self, window_hash):
window = self.get_sub_win(window_hash) self._try_activate_window_for_window(self, window_hash)
if window is not None:
window.activateWindow() def _try_activate_window_for_window(self,
source_window,
window_hash):
try:
window = source_window.get_sub_win(window_hash)
if window is not None:
window.activateWindow()
else:
for _, win in source_window.sub_win_list:
self._try_activate_window_for_window(
win,
window_hash
)
except Exception:
return
def _update_window_list(self): def _update_window_list(self):
self._propagation_keys.add("window_list") self._propagation_keys.add("window_list")