electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: DevTools context menu does not appear on multi-monitor

Open keiches opened this issue 2 years ago • 1 comments

Preflight Checklist

Electron Version

20.1.1

What operating system are you using?

macOS

Operating System Version

macOS Monterey 12.5.1

What arch are you using?

x64

Last Known Working Electron version

20.0.3

Expected Behavior

  1. Run Electron App. runs.
  2. Open DevTools.
  3. Go Tabs (like Sources or Elements)
  4. Select some source code or DOM
  5. Click right mouse button
  6. Context menu appears

Actual Behavior

When App. runs, DevTools opens go Source tab, click right mouse button on second monitor. not first (main) monitor. then, Context menu does not appear

but, on the first (main) monitor and the internal display of the macbook pro, it appears.

Testcase Gist URL

No response

Additional Information

I'm upgrade Electron 20.0.3 to 20.1.1 a few days ago. using Vuejs-devtools 6.2.1 try to remove all of cached directory about Electron browser (likes "$HOME//Library/Application Support/my_electron_app) but does not change

keiches avatar Sep 13 '22 08:09 keiches

Hey @keiches, thanks for reporting this. Quick question about your description:

You mention that you're using Vuejs-devtools in your app. Is that a required component for triggering the bug, or does the same bug occur for you in plain old vanilla Electron w/o any extra dependencies?

ckerr avatar Sep 13 '22 15:09 ckerr

I'm also getting this bug through Electron 21.2.2, on macOS Monterey 12.4, and have been getting it in every version of macOS and Electron for the last five years, since Mojave 10.14.6 and Electron 4. I never realized the DevTools context menu would appear if it were on the same screen.

I just ran a quick test to confirm this on a Mac Pro with Monterey 12.4 and 16" MacBook Pro 2019 with Catalina 10.15.7; both are Intel Macs and both have 3 physical displays.

  1. Install and run a fresh copy of the minimal Electron app for testing:
    $ mkdir ~/tmp
    $ cd ~/tmp
    $ git clone https://github.com/electron/electron-quick-start
    $ cd electron-quick-start
    $ npm install
    $ npm run start
    
  2. Open DevTools for the resulting window by selecting the View ... Toggle Developer Tools menu item.
  3. Pop the DevTools window loose by going to the vertical 3-dot menu and clicking on the "Undock into separate window" icon.
  4. Finally, right-click anywhere in the Developer Tools window that's supposed to have a context menu (like an element in the Elements panel).

Results:

  • If the Developer Tools window is on the same screen as the other window, the context menu appears like normal.
  • If I drag Developer Tools to another window, the same right-click shows nothing.
  • If I then drag the main window over to that screen, right-clicking will show the context menu again.
  • If I then drag Developer Tools back to the first screen, leaving the main window on the other screen, no more context menu.

Interestingly, even when the context menu doesn't show up, it still acts like the menu is there; if I right-click on an element in Elements, then hit the up arrow, then hit Enter, it will do the Store as global variable thing as if the menu was visible, and the element will be stored in a variable called temp1.

Edited to add: The good news is, if you go to System Preferences ... Mission Control and turn off Displays have separate Spaces, the context menu works as expected, even if the BrowserWindow and the associated DevTools window are on separate physical screens.

chorpler avatar Nov 02 '22 23:11 chorpler

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Feb 02 '23 02:02 github-actions[bot]

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar May 09 '23 01:05 github-actions[bot]

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

github-actions[bot] avatar Jun 08 '23 02:06 github-actions[bot]