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

Commitf5085f4

Browse files
committed
refactor(systray): simplify client setup timing and screen ID retrieval
- Replaced the delayed client setup with a single shot timer for immediate execution.- Streamlined the screen ID retrieval process by directly using the screen method.
1 parent3d95e56 commitf5085f4

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,8 @@ def __init__(
152152
self.widget_layout.insertWidget(0,self.unpinned_vis_btn)
153153
else:
154154
self.widget_layout.insertWidget(-1,self.unpinned_vis_btn)
155-
156-
# Delay the client setup for a bit just to give YASB tray icon some time to init
157-
init_timer=QTimer(self)
158-
init_timer.setSingleShot(True)
159-
init_timer.timeout.connect(self.setup_client)# pyright: ignore [reportUnknownMemberType]
160-
init_timer.start(5000)
155+
156+
QTimer.singleShot(0,self.setup_client)# pyright: ignore [reportUnknownMemberType]
161157

162158
defsetup_client(self):
163159
"""Setup the tray monitor client and connect signals"""
@@ -443,11 +439,7 @@ def load_state(self):
443439

444440
defget_screen_id(self):
445441
"""Get the screen id for the current systray widget instance"""
446-
window_handle=self.windowHandle()
447-
ifwindow_handleisnotNone:
448-
screen=window_handle.screen()
449-
else:
450-
screen=QGuiApplication.primaryScreen()
442+
screen=self.screen()
451443
ifscreenisnotNone:
452444
raw_id=f"{screen.manufacturer()}{screen.name()}{screen.serialNumber()}".upper()
453445
self.screen_id=re.sub(r"\W+","",raw_id)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp