Skip to content

Commit 3988ff7

Browse files
committed
refactor(config): remove hide_taskbar option and related functionality
- hide_taskbar is not part of the YASB anymore. There was a many issues with it and it was not working as expected.
1 parent 6f2590c commit 3988ff7

File tree

4 files changed

+3
-37
lines changed

4 files changed

+3
-37
lines changed

docs/Configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ All valid options for the widgets are listed on the widgets page.
1515
| `watch_stylesheet` | boolean | `true` | Reload bar when style is changed. |
1616
| `watch_config` | boolean | `true` | Reload bar when config is changed. |
1717
| `debug` | boolean | `false` | Enable debug mode to see more logs |
18-
| `hide_taskbar` | boolean | `false` | Hide Windows taskbar from all screens. Note: for better performance set taskbar auto-hide. |
1918
| `env_file` | string | `None` | Load environment variables from file. |
2019

2120

src/core/utils/win32/windows.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import ctypes.wintypes
22
from core.event_enums import Event
3-
import logging
43

54
user32 = ctypes.windll.user32
65
user32.SetWinEventHook.restype = ctypes.wintypes.HANDLE
@@ -19,7 +18,6 @@
1918
ctypes.wintypes.DWORD
2019
)
2120

22-
2321
class WinEvent(Event):
2422
"""
2523
Win32user Event Constants
@@ -101,22 +99,4 @@ class WinEvent(Event):
10199
EventUIAEventIdStart = 0x4E00
102100
EventUIAEventIdEnd = 0x4EFF
103101
EventUIAPropIdStart = 0x7500
104-
EventUIAPropIdEnd = 0x75FF
105-
106-
107-
class WindowsTaskbar:
108-
@staticmethod
109-
def hide(state, debug):
110-
SW_SHOWNORMAL = 1
111-
SW_HIDE = 0
112-
user32 = ctypes.WinDLL('user32', use_last_error=True)
113-
try:
114-
for class_name in ["Shell_TrayWnd", "Shell_SecondaryTrayWnd"]:
115-
taskbar = user32.FindWindowW(class_name, None)
116-
if taskbar:
117-
user32.ShowWindow(taskbar, SW_HIDE if state else SW_SHOWNORMAL)
118-
if debug:
119-
logging.info(f"Taskbar {taskbar} found and {'hide' if state else 'restore'}.")
120-
except Exception as e:
121-
if debug:
122-
logging.error(f"Failed to hide taskbar: {e}")
102+
EventUIAPropIdEnd = 0x75FF

src/core/validation/config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
'required': False,
2121
'default': None,
2222
},
23-
'hide_taskbar': {
24-
'type': 'boolean',
25-
'default': False,
26-
'required': False,
27-
},
2823
'komorebi': {
2924
'type': 'dict',
3025
'schema': {

src/main.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
import settings
1414
import ctypes
1515
import ctypes.wintypes
16-
from core.utils.win32.windows import WindowsTaskbar
1716
from dotenv import load_dotenv
1817

1918
logging.getLogger('asyncio').setLevel(logging.WARNING)
2019

2120
def main():
2221
config, stylesheet = get_config_and_stylesheet()
23-
global hide_taskbar
24-
hide_taskbar = config['hide_taskbar']
25-
22+
2623
if config['debug']:
2724
settings.DEBUG = True
2825
logging.info("Debug mode enabled.")
@@ -61,22 +58,17 @@ def stop_observer():
6158
if observer:
6259
observer.stop()
6360
observer.join()
64-
if hide_taskbar:
65-
WindowsTaskbar.hide(False, settings.DEBUG)
61+
6662
app.aboutToQuit.connect(stop_observer)
6763

6864
with loop:
69-
if hide_taskbar:
70-
WindowsTaskbar.hide(True, settings.DEBUG)
7165
loop.run_forever()
7266

7367

7468
if __name__ == "__main__":
7569
init_logger()
7670
base_excepthook = sys.excepthook
7771
def exception_hook(exctype, value, traceback):
78-
if hide_taskbar:
79-
WindowsTaskbar.hide(False, settings.DEBUG)
8072
EventService().clear()
8173
logging.error("Unhandled exception", exc_info=value)
8274
sys.exit(1)

0 commit comments

Comments
 (0)