Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Menu positioning not correct on different taskbar positions on Windows #232

Open
vkolova opened this issue Jun 20, 2019 · 6 comments
Open

Comments

@vkolova
Copy link

vkolova commented Jun 20, 2019

Description

Positioning of menu window is incorrect on Windows when you change taskbar position.

Steps to Reproduce the Problem

  1. Add menubar
  2. Change taskbar position

Expected Behaviour

Actual Behaviour

top
left
right

Specifications

  • Menubar version: 6.1.0
  • Platform: Windows 10
  • Electron version: 5.0.1
@amaury1093
Copy link
Collaborator

Agreed, reproduced. Since I think changing taskbar position is not a frequent operation, I consider this issue a lower-priority.

If anyone wants to work on this, feel free to open a PR!

@thomasdarde
Copy link

Hello

It's not perfect but this was wat I did put in place

mb.on("show", function() {
    if(process.platform === 'win32'){
      var trayBounds = mb._tray.getBounds()
      var windowPosition = "trayBottomCenter"
      if(trayBounds.width === trayBounds.height && trayBounds.x < trayBounds.y) {
        log.info("Tray is on left side")
        windowPosition = "center"
      }
      // Force right place for the window
      // On launch it can show beside the menubar
      mb.setOption("windowPosition", windowPosition)
    }
  })

semenov-oleg pushed a commit to semenov-oleg/menubar that referenced this issue Nov 24, 2020
semenov-oleg pushed a commit to semenov-oleg/menubar that referenced this issue Nov 24, 2020
amaury1093 pushed a commit that referenced this issue Jan 20, 2021
* Improve 'windows' OS detection of taskbar location
Should be helpful for the following issues
#264
#232

* Update windows position before windows displaying
Referring to the issue
#232

* Improve 'windows' OS detection of taskbar location (fix multi-monitor systems)

* Fix lint issues

* Removed win32 vertical optimization
Trying to solve issue:
#298

Co-authored-by: Oleg Semenov <oleg.semenov@theyr.com>
@RobbieTheWagner
Copy link
Contributor

@thomasdarde does that work for both left positioned taskbars and the normal bottom position? If so, is this something we could incorporate into the library?

@thomasdarde
Copy link

it does, feel free to reuse this code

@RobbieTheWagner
Copy link
Contributor

@thomasdarde would you perhaps be able to open a PR? This was the most recently merged one for Windows placement https://github.com/maxogden/menubar/pull/307/files. Perhaps you could use that as reference for where to put in your solution?

@thomasdarde
Copy link

sorry it's a long time since I did update this code and I'm quite busy now

JaeBradle added a commit to JaeBradle/menubar that referenced this issue Oct 19, 2022
* Improve 'windows' OS detection of taskbar location
Should be helpful for the following issues
max-mapper/menubar#264
max-mapper/menubar#232

* Update windows position before windows displaying
Referring to the issue
max-mapper/menubar#232

* Improve 'windows' OS detection of taskbar location (fix multi-monitor systems)

* Fix lint issues

* Removed win32 vertical optimization
Trying to solve issue:
max-mapper/menubar#298

Co-authored-by: Oleg Semenov <oleg.semenov@theyr.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants