Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] sometimes fails to display the window front when clicking the dock icon #11384

Open
qupig opened this issue Oct 20, 2024 · 8 comments
Open

Comments

@qupig
Copy link

qupig commented Oct 20, 2024

Overview

Sometimes clicking on the Dock icon won't show the KeePassXC App window to front, no matter how many times I click on it.
Unless I click the menu bar icon once at this time. (Normally clicking menu bar icon should display a menu, but no, this time the menu is not displayed, only the window is displayed)

Steps to Reproduce

  1. After the app is started normally, it is not minimized, the window is not switched/toggled/hidden through the menu, and the indicator light of the Dock icon is on. (In other words, no state manipulation is done to the App/Window)
  2. Directly run or click on the windows of other Apps (at this time the KeePassXC window is covered by other windows)
  3. After a while, when clicking the KeePassXC Dock icon again in an attempt to bring its window to front, no, it won't bring it to front, no matter how many times you click it.
  4. An easy way to bring it to the front at this point is to click once on the KeePassXC icon in the menu bar, and at this point the menu bar icon will not show the menu unless you click it a second time.
  5. Another complicated way is to right-click the KeePassXC Dock icon, click "Show all windows" in its context menu, and then click the KeePassXC window. This method sometimes fails by bringing the window to the front and then immediately auto-hiding, unless I repeat the entire operation again.

Expected Behavior

Under normal circumstances, clicking on the KeePassXC Dock icon should bring its main window to the front.

Actual Behavior

Its main window cannot be brought to the front, no matter how many times the Dock icon is clicked.

Context

  • This issue does not occur 100% of the time, but for me it happens about 40% of the time.
  • I've noticed that sometimes clicking "Toggle window" in the menu bar icon doesn't work the first time. But this may not be entirely related to the main issue and may be a separate issue.
  • I have not observed other related situations. Such as the current front App is not specific, and the current App does not have a higher-level pinned/floated window. I don't have full memory or high CPU load. So I didn't find the influencing factors.
  • As far as I know, this issue has not occurred with other apps I have installed.
  • The same situation happens from time to time in macOS 14 and 15.
  • It doesn't completely prevent me from using KeePassXC (i.e., not a fatal issue), but it does cause some inconvenience. (Maybe it will be more of an impact on others if they don't try the skills I know of)

KeePassXC - 2.7.9
Revision: 8f6dd13

Operating System: macOS

@qupig qupig added the bug label Oct 20, 2024
@droidmonkey
Copy link
Member

droidmonkey commented Oct 20, 2024

I can't replicate this at all on macOS 16. Both the menu icon "toggle window" and clicking the app icon in the dock bring KeePassXC to the front. It could be perhaps those 40% of the time you have a modal dialog or something else active that is interfering.

I can replicate "Toggle Window" not working the first time. However that is technically "expected behavior" since Toggle Window hides KeePassXC to the tray icon. The first time you use it then KeePassXC will be removed from the Dock. The second time will show KeePassXC window. That menu item is not "Raise KeePassXC"

I can't see anything worthwhile within the log file you posted.

@droidmonkey
Copy link
Member

droidmonkey commented Oct 20, 2024

Actually take it back, slightly, I was able to replicate a state where pressing the dock icon did not bring KeePassXC to the front. It looked like the tray icon was still "activated" during that situation. You can get into this state if you activate the tray menu then click on the menu bar. The tray menu disappears but the icon is still selected and KeePassXC cannot be brought to the front at this point. KeePassXC has to be in the background for this to occur.

@qupig
Copy link
Author

qupig commented Oct 20, 2024

I can replicate "Toggle Window" not working the first time. However that is technically "expected behavior" since Toggle Window hides KeePassXC to the tray icon. The first time you use it then KeePassXC will be removed from the Dock. The second time will show KeePassXC window. That menu item is not "Raise KeePassXC"

I'm not sure if this is what I'm experiencing because usually I don't click on it at all, I do know that it makes the Dock icon's light disappear and reappear.

I think it would be better to improve that menu "text" if possible, e.g. show it as "Hide to tray"/"Show to foreground" in different states. Or even just "Hide to tray" and put a tick in front to show the difference states.

You can get into this state if you activate the tray menu then click on the menu bar. The tray menu disappears but the icon is still selected and KeePassXC cannot be brought to the front at this point. KeePassXC has to be in the background for this to occur.

I can reproduce the situation what you are describing.
But I'm pretty sure that's not what I'm experiencing because usually I don't click on the menu bar/tray icon at all after running KeePassXC, plus I'm pretty sure the tray icon is not in the "activated" state because if its background is lit I will definitely notice.

It could be perhaps those 40% of the time you have a modal dialog or something else active that is interfering.

Like I said on the first floor, I don't identify any specific correlation.
But I can be sure 40% of the time there won't be a "modal dialog" there because I know what that is, and it will definitely affects my other operations.
But I'm not sure about other factors.

@droidmonkey
Copy link
Member

without eliciting any further details it is impossible to correct. If you can identify any other patterns that can cause this situation it will be very helpful.

@qupig
Copy link
Author

qupig commented Oct 20, 2024

I'll definitely add it if I find the patterns.

But unfortunately I can't provide any more information at the moment, I'll keep an eye out for that.

@hardrockhodl
Copy link

I actually solved this problem by writing about my findings.
I only had problems when running my MBP with external displays.
It just hit me!
There is a setting in KeePassXC that toggles "Allow Screen Captures"

Im guessing all macbook owners, just like me is running Displaylink Manager.app to make external display work.
And by some weird reason (or maybe logical) Displaylink needs to be running screensharing to work.

Solution:

(if runninging Displaylink Manager.app)

  • Allow Screen Capture in KeePassXC

shottr_2024-11-14_151149

@qupig
Copy link
Author

qupig commented Nov 14, 2024

@hardrockhodl Thanks for sharing the info, I do use an external monitor, but I'm not using the Displaylink solution, so that's not what I'm experiencing.

The Displaylink solution is to break through the limit of the number of external monitors on the Mac hardware device itself. It uses a virtual-desktop and streaming solution, which is why it requires screen capture.

But I suggest you note that when you allow keepassxc window screen capture, you reduce its security. Now any apps that can capture the screen has the opportunity to obtain the information of your keepassxc window.

@hardrockhodl
Copy link

@qupig Yeah, that is concerning.
Maybe application whitelisting can be a solution?
I'm out of my ballpark here regarding how macOS apps are made, but maybe apple change the behavior of the WindowManager.app in Sequoia.

I'll run etrecheck to see if it can catch any logs about it.

@phoerious phoerious removed the bug label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants