flyingpie / windows-terminal-quake

Enable Quake-style dropdown for (almost) any application.
https://wtq.flyingpie.nl
MIT License
596 stars 39 forks source link

Taskbar icon cannot be hidden #122

Closed GoodbyeNJN closed 6 months ago

GoodbyeNJN commented 9 months ago

I have set "TaskBarIconVisibility": "AlwaysHidden", but the Windows Terminal icon still exists on the taskbar.

My system environment is as follows:

Settings:

{
    "$schema": "./windows-terminal-quake.schema.1.json",
    "Hotkeys": [
        {
            "Modifiers": "Windows",
            "Key": "Oemtilde"
        }
    ],
    "CloseTerminalOnExit": false,
    "DisableWhenActiveAppIsInFullscreen": false,
    "SuppressHotKeyForProcesses": [],
    "KeepOriginalSize": false,
    "HorizontalAlign": "Center",
    "HorizontalScreenCoverage": 60,
    "VerticalOffset": 0,
    "VerticalScreenCoverage": 50,
    "MaximizeAfterToggle": true,
    "Opacity": 100,
    "TaskBarIconVisibility": "AlwaysHidden",
    "ToggleAnimationFrameTimeMs": 25,
    "ToggleDurationMs": 250,
    "ToggleAnimationType": "EaseOutQuart",
    "ToggleMode": "Move",
    "PreferMonitor": "WithCursor",
    "MonitorIndex": 1,
    "AlwaysOnTop": false,
    "HideOnFocusLost": false,
    "LogLevel": "Error",
    "Notifications": false,
    "StartHidden": false,
    "WindowsTerminalCommand": "wt.exe"
}

Logs:

2024-03-02 01:29:35.673 +08:00 [INF] Setting log level to 'Debug'.
2024-03-02 01:29:35.698 +08:00 [INF] Windows Terminal Quake started
2024-03-02 01:29:35.850 +08:00 [ERR] Error creating process: 'Started process'
2024-03-02 01:29:35.912 +08:00 [INF] Got process with id '5104' and name 'WindowsTerminal' and title ''.
2024-03-02 01:29:35.918 +08:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-03-02 01:29:35.988 +08:00 [INF] Got process with id '5104' and name 'WindowsTerminal' and title ''.
2024-03-02 01:29:35.994 +08:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-03-02 01:29:36.114 +08:00 [INF] Got process with id '5104' and name 'WindowsTerminal' and title ''.
2024-03-02 01:29:36.120 +08:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-03-02 01:29:36.397 +08:00 [INF] Got process with id '5104' and name 'WindowsTerminal' and title ''.
2024-03-02 01:29:36.403 +08:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-03-02 01:29:36.926 +08:00 [INF] Got process with id '5104' and name 'WindowsTerminal' and title '~'.
2024-03-02 01:29:36.935 +08:00 [INF] Registering hot key Windows + Oemtilde
2024-03-02 01:29:36.952 +08:00 [INF] Open
2024-03-02 01:29:36.952 +08:00 [INF] Focus gained
2024-03-02 01:29:36.954 +08:00 [INF] Selecting screen with cursor.
2024-03-02 01:29:36.956 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=0,Width=1316,Height=617}
2024-03-02 01:29:41.442 +08:00 [INF] Close
2024-03-02 01:29:41.443 +08:00 [INF] Selecting screen with cursor.
2024-03-02 01:29:41.443 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=0,Width=1316,Height=617}
2024-03-02 01:29:41.474 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=0,Width=1316,Height=617}
2024-03-02 01:29:41.505 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-4,Width=1316,Height=617}
2024-03-02 01:29:41.538 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-24,Width=1316,Height=617}
2024-03-02 01:29:41.568 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-75,Width=1316,Height=617}
2024-03-02 01:29:41.600 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-187,Width=1316,Height=617}
2024-03-02 01:29:41.631 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-378,Width=1316,Height=617}
2024-03-02 01:29:41.662 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-713,Width=1316,Height=617}
2024-03-02 01:29:41.694 +08:00 [DBG] Target screen bounds: {X=0,Y=0,Width=2194,Height=1234}. Terminal bounds: {X=439,Y=-1234,Width=1316,Height=617}
flyingpie commented 8 months ago

@GoodbyeNJN Thank you for reaching out!

Does this always happen, even if you restart either windows-terminal-quake or Windows Terminal?

GoodbyeNJN commented 8 months ago

@flyingpie Yes, this happens all the time regardless of restarting windows-terminal-quake or Windows Terminal.

flyingpie commented 8 months ago

@GoodbyeNJN Could you check your "Actions" in Windows Terminal?

My suspicion is that this is due to Windows Terminal's own Quake mode, which also maps to "Windows + ~":

image

Could you try to remove or change the action, see what happens?

GoodbyeNJN commented 8 months ago

@flyingpie I tried removing the 'Windows + ~' hotkey bindings from Windows Terminal, or changing the windows-terminal-quake hotkeys to 'Ctrl + ~', and both ended up with the same result. Even if I changed both hotkey bindings at the same time, I still couldn't get the Windows Terminal icon to hide properly.

flyingpie commented 8 months ago

@GoodbyeNJN Does this also happen if you use a different key then tilde?

GoodbyeNJN commented 8 months ago

@flyingpie I tried Ctrl+Space, Ctrl+D0, Alt+Space, but none of them could hide the icons properly.

flyingpie commented 8 months ago

@GoodbyeNJN Interesting! Just so we're on the same page, we're talking about this thing, right? image

GoodbyeNJN commented 8 months ago

@flyingpie Yes, we do communicate the same thing. I simply recorded a gif and you can see what's currently happening on my computer.

icon-not-hide

flyingpie commented 8 months ago

@GoodbyeNJN Thank you for the gif! I'll try to reproduce this with the same setup. Could you try to run the non-preview version of Windows Terminal, see if that makes a difference?

GoodbyeNJN commented 8 months ago

@flyingpie I tried the non-preview version of Windows Terminal and it still not hide. I doubt it's an issue with the developer preview of Windows 11

flyingpie commented 8 months ago

@GoodbyeNJN Yeah I wasn't assuming that either, but just ruling things out.

Next guess, when WTQ starts, it looks for an existing "WindowsTerminal" process, but the preview version is called "WindowsTerminalPreview", so it doesn't find it, and starts a new one.

This new one is started using "wt.exe" ("WindowsTerminalCommand"-setting), which presumably starts the stable build of Windows Terminal.

You could take a look under "App execution aliases", see if both "Windows Terminal" and "Windows Terminal Preview" are in there. Then switch the active one to "Windows Terminal Preview", and try again: image

Alternatively you could try to change the "WindowsTerminalCommand"-property to point to the preview build, but that's less nice. Maybe useful for debugging though:

  "WindowsTerminalCommand": "C:/Program Files/WindowsApps/Microsoft.WindowsTerminalPreview_1.20.10572.0_x64_8wekyb3d8bbwe/WindowsTerminal.exe"
flyingpie commented 6 months ago

Hopefully one of the provided solutions have helped. I've added some of the problems found to the docs.

If the problem persists, feel free to re-open this issue, or open a new one.