keepassxreboot / keepassxc-browser

KeePassXC Browser Extension
GNU General Public License v3.0
1.72k stars 176 forks source link

Keepass browser integration with MacOS Stage Manager lead to strange behavior #1763

Closed gagarine closed 1 year ago

gagarine commented 1 year ago

Often when I click on a user/password field in the browser (Firefox), it will change the stage (closing the browser windows).

More info on stage manager

I guess it's a problem of Keepass taking the focus for a short time or something like that.

I did a few test, but was not able to find a way to reproduce it 100%. ~It seems it has something to do with "hide windows in system tray" settings.~ It seems to happens when Keepass ask to confirme the access autorisation (with the small pop-up window) to access the password for this website. This confirmation dialogue should open in the same stage than the current browser windows and on top of the browser windows.

varjolintu commented 1 year ago

It's probably related to the Access Confirm Dialog yes. It raises the window and then hides it. In macOS, hiding the window actually means we are giving focus away from it to the previous window. It's highly possible this method is not compatible with Stage Manager.

vlebert commented 1 year ago

Hi Just to say I noticed the same behaviour after updating to MacOS Ventura.

However, I didn't like stage manager so I disabled it.

Even disabled, Keepass XC extension sometimes make MacOS switch to an other window (like alt tab) when I enter a website asking for a password. I never noticed such a behaviour before MacOS Ventura

varjolintu commented 1 year ago

@vlebert Does KeePassXC 2.7.1 behave the same with Ventura?

vlebert commented 1 year ago

Hi.

I think I was on 2.7.1 yes. I just upgraded to 2.7.4. Did not see the issue yet. Is it possible that 2.7.4 fixed the issue ? Or the upgrade process?

Let's see in the next days

varjolintu commented 1 year ago

@vlebert Still having the issue?

varjolintu commented 1 year ago

Closing this because it actually belongs to the KeePassXC side. Plus these things happen because of restrictions in the macOS API. It is not possible to activate a popup from an application that exists in a different Space / virtual desktop. The focus always switches to the application that requests it. What makes it weird, is that the popup might show unfocused in the other desktop, but when clicking it the focus switches to the desktop where the main application is.