max-mapper/menubar

Windows: the window opens at the wrong Y and Z position if icon is in tray menu

Open

#264 aperta il 25 gen 2020

Vedi su GitHub
 (6 commenti) (1 reazione) (0 assegnatari)TypeScript (365 fork)github user discovery
annoyancehelp wanted

Metriche repository

Star
 (6778 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Description

It opens right at the bottom of the screen even if the tray icon is in the tray menu (I'm not sure if this is the correct name) and it opens behind the tray menu (z-axis).

Steps to Reproduce the Problem

  1. Launch the app.
  2. Drag the tray icon into the tray menu or if that's where the tray icon appears when launched, that's fine too.
  3. Click the icon.

Expected Behaviour

The window opens vertically above the icon (when the taskbar is at the bottom of the screen anyway) and on top (z-axis) of the tray menu.

Actual Behaviour

The window is behind the tray menu (z-axis), and the bottom of the window is right up against the taskbar.

Specifications

  • Menubar version: 7.2.0
  • Platform: Windows 10 Pro (Insider Preview)
  • Electron version: 7.1.9

Other information

I'm looking into fixing this now for our app. I have a proof of concept in which I:

  • Set the window to be always on top.
  • Manually hide it when the focus-lost event fires.
  • Comment out the .show call in menubar to prevent flicker.
  • When the after-show event fires, I set the Y position based on where the tray is (i.e. tray bounds) and then show the window (via menubar.window.show()).

I think there may be some other changes that I'm forgetting.

I'll try to get it to update the window position when the tray icon is dragged (there are some platform-specific events for this). Then I'll see how I can clean this up and move as much logic as possible into this library.

I'd love not to use alwaysOnTop so if you've any better ideas, let me know. window.moveTop() doesn't work.

Guida contributor