flyingpie / windows-terminal-quake

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

Hiding quake terminal creates new tray icon every time #121

Closed jannispl closed 8 months ago

jannispl commented 9 months ago

It seems that every time I hide the quake terminal using the shortcut, a new tray icon is created.

After opening+closing the terminal several times, my tray is filling up quickly:

grafik

Version 1.6.0

flyingpie commented 9 months ago

@jannispl Thank you for reaching out! Could you post any logs that are generated next to the exe?

jannispl commented 9 months ago

@jannispl Thank you for reaching out! Could you post any logs that are generated next to the exe?

It doesn't seem relevant but here you go:

2024-02-21 09:54:47.593 +01:00 [ERR] Error creating process: 'Started process'
2024-02-21 09:54:49.464 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.535 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.664 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.919 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.212 +01:00 [ERR] Error creating process: 'Started process'
2024-02-21 09:56:29.277 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.350 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.454 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'

The "Main window handle not accessible" is an error that sometimes shows up when quake-terminal is started from autostart (I get a corresponding error message box and continue to launch quake-terminal manually).

jannispl commented 9 months ago

I also checked Terminal settings:

grafik

flyingpie commented 9 months ago

@jannispl Thank you for reaching out! Could you post any logs that are generated next to the exe?

It doesn't seem relevant but here you go:

2024-02-21 09:54:47.593 +01:00 [ERR] Error creating process: 'Started process'
2024-02-21 09:54:49.464 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.535 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.664 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:54:49.919 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.212 +01:00 [ERR] Error creating process: 'Started process'
2024-02-21 09:56:29.277 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.350 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'
2024-02-21 09:56:29.454 +01:00 [ERR] Error creating process: 'Main window handle not accessible.'

The "Main window handle not accessible" is an error that sometimes shows up when quake-terminal is started from autostart (I get a corresponding error message box and continue to launch quake-terminal manually).

What do you mean by "autostart" here?

jannispl commented 9 months ago

What do you mean by "autostart" here?

I have placed a shortcut to windows-quake-terminal.exe in my "Startup" directory (C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup).

Sometimes it works, sometimes it fails and shows me the "Main window handle not accessible" error message.

flyingpie commented 9 months ago

What do you mean by "autostart" here?

I have placed a shortcut to windows-quake-terminal.exe in my "Startup" directory (C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup).

Sometimes it works, sometimes it fails and shows me the "Main window handle not accessible" error message.

Mm, I wonder whether the problem lies with Windows Terminal not being available soon enough, and that the windows-terminal-quake app is started multiple times due to that.

Do you ever have this happen when not using the autostart setup?

jannispl commented 9 months ago

As I said my autostart problem is unrelated to this issue - the tray icon appears regardless of whether quake-terminal is launched by autostart or manually.

flyingpie commented 9 months ago

@jannispl Do you have multiple actual "windows-terminal-quake.exe"-processes running when this occurs, or is it only ever 1? Do some of the icons disappear when you hover them?

jannispl commented 9 months ago

@jannispl Do you have multiple actual "windows-terminal-quake.exe"-processes running when this occurs, or is it only ever 1? Do some of the icons disappear when you hover them?

There is only a single process running. The icons don't disappear when I hover over them. Hovering reveals a tooltip which looks like the title of the tab that was active at the time (although sometimes it's a different tab). Clicking on any of the icons opens a new Windows Terminal window with the tabs that were open before in windows-quake-terminal (without the quake mode). The icon also disappears when clicking.

I also noticed that when hiding the windows-terminal-quake by losing focus (rather than using the shortcut), no new icons appear in the tray.

jannispl commented 9 months ago

After again checking my Windows taskbar/notification area settings, I realized that the terminal tray icons seem to be coming from "PersistentWindows" (5.51), which is a tool I use to restore window positions after (un)docking my laptop. It seems to behave weirdly in combination with windows-quake-terminal. When PersistentWindows is not running, no new tray icons appear. I wonder if this is fixable in either windows-quake-terminal or PersistentWindows?

flyingpie commented 9 months ago

@jannispl Thank you for pointing that out! I'll see if I can reproduce it that way.

jannispl commented 8 months ago

Apparently this is a (hidden) feature of PersistentWindows (minimize to tray while holding ctrl). A command line flag to disable this behavior is going to be introduced in the next release.

flyingpie commented 8 months ago

@jannispl Thank you so much for reporting this! I'll include it in the docs. PersistentWindows seems to solve a problem I was having too :)