0

I want to be able to have my taskbar auto-hide when I'm focused on my desktop instead of any windows. I should be able to still hover my mouse down at the bottom to reveal the taskbar, but I just want auto-hide to be enabled when the desktop is focused.

I know that there are scripts that you can run in order to enable and disable auto-hide, but I don't know how to detect if I am focused on the background.

I'm running Windows 11, but I don't believe it is any different from Windows 10 in this case.

1
  • Unclear: do you mean you want the taskbar visible when a less-than-fullscreen-window is focused, rather than the Desktop? Commented Oct 31, 2021 at 19:44

1 Answer 1

0

Really late answer here. I don't know any native way of doing this, but I wrote this Autohotkey script that hides the taskbar if the desktop has the focus. I couldn't get it to auto-show the taskbar on mouse hover if the desktop has the focus, but if any other window is activated first the mouse hover works. This script also completely hides the taskbar (at least on latest Win 10). So no ugly grey lines at the bottom. I also added the following hotkeys:

Show taskbar: Left Ctrl + Right Alt + s

Hide taskbar: Left Ctrl + Right Alt + h

Kill script: Left Ctrl + Right Alt + Escape

The "Kill script" hotkey will work everywhere and the two others works if the desktop has focus. If your keyboard has the Altgr key, this can be used instead of Left Ctrl + Right Alt. If you spend a few minutes with Autohotkey, you can change them to whatever you want. Autohotkey (current stable release) is needed to run it (free and open source).

#NoEnv
#SingleInstance,Force
#Persistent
SetWinDelay,0



GroupAdd, DesktopGroup, ahk_class Progman ; Adding both classes of desktop to the group "DesktopGroup" 
GroupAdd, DesktopGroup, ahk_class WorkerW ; 


Loop {
  IfWinActive, ahk_group DesktopGroup
    IfWinExist, ahk_class Shell_TrayWnd
    {
      WinHide,ahk_class Shell_TrayWnd
      WinHide,Start ahk_class Button
    }
    Else
      WinWaitNotActive, ahk_group DesktopGroup
  Else
    IfWinNotExist, ahk_class Shell_TrayWnd
      WinShow,ahk_class Shell_TrayWnd
      WinShow,Start ahk_class Button
    
}

<^>!Esc::ExitApp

#IfWinActive, ahk_group DesktopGroup
<^>!s::
{
  WinShow,ahk_class Shell_TrayWnd
  WinShow,Start ahk_class Button
  Return
}
<^>!h::
{
  WinHide,ahk_class Shell_TrayWnd
  WinHide,Start ahk_class Button
  Return
}
#IfWinActive

License: WTFPL

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .