glzr-io / glazewm

GlazeWM is a tiling window manager for Windows inspired by i3 and Polybar.
GNU General Public License v3.0
4.02k stars 123 forks source link

Issue with glazewm & AutoHotkey Script: Windows Taskbar not maintaining hidden state on workspace focus change #606

Closed aaronedev closed 1 month ago

aaronedev commented 2 months ago

Has anyone encountered and resolved this issue, or does anyone have suggestions on how to ensure the windows taskbar remains hidden 🥴 when switching workspace focus using AutoHotkey or a different solution/tool?

Thank you!

aaronedev commented 2 months ago

in case anyone wonders this is my current script that works sometimes when switching workspaces but not all of the time...

global taskbarState := 0 ; save the state of the taskbar (0 = visible, 1 = hidden)
global taskbar

ToggleTaskbarVisibility()
{
  WinGet, taskbar, ID, ahk_class Shell_TrayWnd ; Taskleisten-ID holen.
  if (taskbarState = 0)
  {
    WinHide, ahk_id %taskbar%
    taskbarState := 1
  }
  else
  {
    WinShow, ahk_id %taskbar%
    taskbarState := 0
  }
}

; Set keyboard shortcut Win + T to execute the function.
#t::
  ToggleTaskbarVisibility()
return

; Handle WM_SETTINGCHANGE message to prevent taskbar from hiding when switching workspaces.
OnMessage(0x1A, "HandleSettingChange")

HandleSettingChange(wParam, lParam)
{
  ; Check if the wParam is equal to SPI_SETWORKAREA (0x002F) to detect workspace change.
  if (wParam = 0x002F)
  {
    ; Only restore taskbar visibility when workspace changes if it was hidden.
    if (taskbarState = 1)
    {
      ToggleTaskbarVisibility()
    }
  }
}
zvbt commented 2 months ago

Im using nircmd to hide my taskbar and a .bat with nircmd.exe win trans class Shell_TrayWnd 256 to hide it and nircmd.exe win trans class Shell_TrayWnd 255 to show it

aaronedev commented 2 months ago

@zvbt thanks for letting me know trying that out now!

aaronedev commented 1 month ago

Im using nircmd to hide my taskbar and a .bat with nircmd.exe win trans class Shell_TrayWnd 256 to hide it and nircmd.exe win trans class Shell_TrayWnd 255 to show it

okay nircmd to hide windows taskbar just works! awesome!