pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.49k stars 650 forks source link

pgAdmin steals Ctrl+Plus/Minus keystrokes from Chrome while running in background (Windows) #5857

Open eirikbakke opened 1 year ago

eirikbakke commented 1 year ago

Describe the bug

On Windows 11, when the pgAdmin 4 window is is kept open in the background, the Ctrl+Plus/Minus shortcut for zooming in Chrome will sometimes cease to work, until the pgAdmin window is put back in focus. In this state, pressing Ctrl+Plus several times in Chrome and then Alt+Tabbing to pgAdmin will show pgAdmin zoomed in, as if pgAdmin was "stealing" the keyboard input and handling it itself, despite not being the active window.

This bug was observed on pgAdmin 4 version 6.19 as well as one older version (unsure which one).

The behavior seems not to be specific to Chrome, as I also saw the same behavior happen with a Java app that also responds to the Ctrl+Plus/Minus. So this must be a bug in pgAdmin, rather than a bug in Chrome.

Over the past year, the bug has been observed frequently while running pgAdmin, but never when pgAdmin is not running.

To Reproduce

This bug is intermittent; it tends to occur once every perhaps 1-3 workdays while pgAdmin is open. To try to reproduce the bug, I'd recommend leaving pgAdmin open on Windows 11 while doing other daily tasks in Chrome and other apps, while testing Ctrl+Plus/Minus to zoom frequently in Chrome.

Expected behavior

When the pgAdmin window is not the active window, pgAdmin should not capture or react to keystrokes. Ctrl+Plus/Minus should always work in Chrome regardless of whether pgAdmin is running or not.

Additional context The setup in which this bug was observed was on a laptop that is sometimes connected in a dual-screen setup and sometimes used with the extra monitor disconnected. This may or may not be relevant.

eirikbakke commented 1 year ago

After some more experimentation, it may appear that this bug appears after an external monitor is connected. This suggests the following way to reproduce the problem:

1) On a laptop with no external monitor attached, open pgAdmin and Chrome. 2) Make Chrome the active window, with the pgAdmin window not active. 3) In Chrome, open a few tabs and a web page. Press Ctrl+Plus/Minus a couple of times to verify that zoom in/out works fine. 3) Now connect an external monitor. Chrome will still be the active window. Click on a Chrome tab, and verify that you can use Ctrl+Tab to switch between Chrome tabs. 4) Now press Ctrl+Plus. At this point the bug may be triggered, and nothing will appear to happen. Press Ctrl+Plus a bunch more times; nothing will appear to happen in Chrome. 5) Now go to the pgAdmin window (by clicking in the taskbar or Alt+Tabbing). pgAdmin will be zoomed in, proving that it captured and handled the Ctrl+Plus keystrokes despite being in the background:

pgadmin

(I followed these steps twice and managed to reproduce the bug both times.)

eirikbakke commented 1 year ago

Another observation: This problem also appears with Microsoft Excel; a pgAdmin window that is open in the background steals the Ctrl+Minus keystroke which normally is used to delete a selected row.

FaharAbbasRizvi commented 1 year ago

I am not able to reproduce the issue on Windows 11 with google chrome, Can you please share the small video?

eirikbakke commented 1 year ago

Sure, here's a video that exhibits the problem:

https://vimeo.com/802017941

akshay-joshi commented 5 months ago

It needs to be tested with the Multi-Monitor scenario.