Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita124931

Browse files
committed
fix(active_window): improve window hiding logic and update ignored classes
1 parent6d8dfc5 commita124931

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

‎src/core/widgets/yasb/active_window.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414
fromcore.utils.widgets.animation_managerimportAnimationManager
1515
importatexit
1616

17-
IGNORED_TITLES= ['',' ','FolderView','Program Manager','python3','pythonw3','YasbBar','Search','Start','yasb']
17+
IGNORED_TITLES= ['',' ','FolderView','Program Manager','python3','pythonw3','YasbBar','Search','Start']
1818
IGNORED_CLASSES= ['WorkerW','TopLevelWindowForOverflowXamlIsland','Shell_TrayWnd','Shell_SecondaryTrayWnd']
1919
IGNORED_PROCESSES= ['SearchHost.exe','komorebi.exe','yasb.exe']
2020
IGNORED_YASB_TITLES= [APP_BAR_TITLE]
2121
IGNORED_YASB_CLASSES= [
22-
'Qt662QWindowIcon',
23-
'Qt662QWindowIcon',
24-
'Qt662QWindowToolSaveBits',
25-
'Qt662QWindowToolSaveBits'
22+
'Qt673QWindowIcon',
23+
'Qt673QWindowToolSaveBits'
2624
]
2725

2826
try:
@@ -125,6 +123,15 @@ def __init__(
125123

126124
atexit.register(self._stop_events)
127125

126+
127+
def_set_no_window_or_hide(self)->None:
128+
ifself._label_no_window:
129+
self._window_title_text.setText(self._label_no_window)
130+
ifself._label_icon:
131+
self._window_icon_label.hide()
132+
else:
133+
self.hide()
134+
128135
def_stop_events(self)->None:
129136
self._event_service.clear()
130137

@@ -143,7 +150,7 @@ def _on_focus_change_workspaces(self, event: str) -> None:
143150
else:
144151
self._update_retry_count=0
145152
else:
146-
self.hide()
153+
self._set_no_window_or_hide()
147154

148155

149156
def_toggle_title_text(self)->None:
@@ -165,14 +172,14 @@ def _on_focus_change_event(self, hwnd: int, event: WinEvent) -> None:
165172
monitor_name=win_info['monitor_info'].get('device',None)
166173

167174
ifself._monitor_exclusiveandself.screen().name()!=monitor_nameandwin_info.get('monitor_hwnd','Unknown')!=self.monitor_hwnd:
168-
self.hide()
175+
self._set_no_window_or_hide()
169176
else:
170177
self._update_window_title(hwnd,win_info,event)
171178

172179
# Check if the window title is in the list of ignored titles
173180
if(win_info['title']inIGNORED_TITLES):
174-
self.hide()
175-
181+
self._set_no_window_or_hide()
182+
176183
def_on_window_name_change_event(self,hwnd:int,event:WinEvent)->None:
177184
ifself._win_infoandhwnd==self._win_info["hwnd"]:
178185
self._on_focus_change_event(hwnd,event)
@@ -231,7 +238,7 @@ def _update_window_title(self, hwnd: int, win_info: dict, event: WinEvent) -> No
231238
win_info['title']=truncated_title
232239
self._window_title_text.setText(self._label_no_window)
233240
ifself._label_icon:
234-
self._window_icon_label.setText(self._label_no_window)
241+
self._window_icon_label.hide()
235242

236243
self._win_info=win_info
237244
self._update_text()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp