14
14
from core .utils .widgets .animation_manager import AnimationManager
15
15
import atexit
16
16
17
- IGNORED_TITLES = ['' ,' ' ,'FolderView' ,'Program Manager' ,'python3' ,'pythonw3' ,'YasbBar' ,'Search' ,'Start' , 'yasb' ]
17
+ IGNORED_TITLES = ['' ,' ' ,'FolderView' ,'Program Manager' ,'python3' ,'pythonw3' ,'YasbBar' ,'Search' ,'Start' ]
18
18
IGNORED_CLASSES = ['WorkerW' ,'TopLevelWindowForOverflowXamlIsland' ,'Shell_TrayWnd' ,'Shell_SecondaryTrayWnd' ]
19
19
IGNORED_PROCESSES = ['SearchHost.exe' ,'komorebi.exe' ,'yasb.exe' ]
20
20
IGNORED_YASB_TITLES = [APP_BAR_TITLE ]
21
21
IGNORED_YASB_CLASSES = [
22
- 'Qt662QWindowIcon' ,
23
- 'Qt662QWindowIcon' ,
24
- 'Qt662QWindowToolSaveBits' ,
25
- 'Qt662QWindowToolSaveBits'
22
+ 'Qt673QWindowIcon' ,
23
+ 'Qt673QWindowToolSaveBits'
26
24
]
27
25
28
26
try :
@@ -125,6 +123,15 @@ def __init__(
125
123
126
124
atexit .register (self ._stop_events )
127
125
126
+
127
+ def _set_no_window_or_hide (self )-> None :
128
+ if self ._label_no_window :
129
+ self ._window_title_text .setText (self ._label_no_window )
130
+ if self ._label_icon :
131
+ self ._window_icon_label .hide ()
132
+ else :
133
+ self .hide ()
134
+
128
135
def _stop_events (self )-> None :
129
136
self ._event_service .clear ()
130
137
@@ -143,7 +150,7 @@ def _on_focus_change_workspaces(self, event: str) -> None:
143
150
else :
144
151
self ._update_retry_count = 0
145
152
else :
146
- self .hide ()
153
+ self ._set_no_window_or_hide ()
147
154
148
155
149
156
def _toggle_title_text (self )-> None :
@@ -165,14 +172,14 @@ def _on_focus_change_event(self, hwnd: int, event: WinEvent) -> None:
165
172
monitor_name = win_info ['monitor_info' ].get ('device' ,None )
166
173
167
174
if self ._monitor_exclusive and self .screen ().name ()!= monitor_name and win_info .get ('monitor_hwnd' ,'Unknown' )!= self .monitor_hwnd :
168
- self .hide ()
175
+ self ._set_no_window_or_hide ()
169
176
else :
170
177
self ._update_window_title (hwnd ,win_info ,event )
171
178
172
179
# Check if the window title is in the list of ignored titles
173
180
if (win_info ['title' ]in IGNORED_TITLES ):
174
- self .hide ()
175
-
181
+ self ._set_no_window_or_hide ()
182
+
176
183
def _on_window_name_change_event (self ,hwnd :int ,event :WinEvent )-> None :
177
184
if self ._win_info and hwnd == self ._win_info ["hwnd" ]:
178
185
self ._on_focus_change_event (hwnd ,event )
@@ -231,7 +238,7 @@ def _update_window_title(self, hwnd: int, win_info: dict, event: WinEvent) -> No
231
238
win_info ['title' ]= truncated_title
232
239
self ._window_title_text .setText (self ._label_no_window )
233
240
if self ._label_icon :
234
- self ._window_icon_label .setText ( self . _label_no_window )
241
+ self ._window_icon_label .hide ( )
235
242
236
243
self ._win_info = win_info
237
244
self ._update_text ()