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

Menubar window is incorrectly positioned when opened while the tray icon is hidden on Windows #438

Open
leolabs opened this issue Mar 26, 2023 · 1 comment

Comments

@leolabs
Copy link

leolabs commented Mar 26, 2023

Description

I'm working on an app that runs in the menubar and opens its window on launch. This works well when the tray icon is visible on Windows, but when it isn't, the window is incorrectly positioned as if it was horizontally centered around x=0. Pinning the tray icon to the tray area solves the problem but it still looks weird to first-time users.

CleanShot.2023-03-26.at.22.54.26.mp4

Steps to Reproduce the Problem

I instantiated menubar with these settings:

const mb = menubar({
  preloadWindow: true,
  icon: `AppIcon.png`, // abridged for brevity
  index: "http://localhost:3009/",
  browserWindow: {
    width: 420,
    height: 460,
    resizable: false,
    vibrancy: "popover",
  },
});

mb.on("ready", () => {
  mb.showWindow();
});

Expected Behaviour

When the tray icon's position is unknown, the window should be positioned on the bottom right as a fallback.

Actual Behaviour

The window is partially hidden on the bottom left of the screen.

Specifications

  • Menubar version: 9.3.0
  • Platform: Windows
  • Electron version: v16.2.8
@kaiserdj
Copy link

kaiserdj commented Jun 7, 2023

Here is a way to work around the problem temporarily until the bug is fixed: #435 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants