-
Notifications
You must be signed in to change notification settings - Fork 15.3k
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
electron.screen.getAllDisplays( ) keeps returning initial screen available space #18622
Comments
electron.screen.getAllDisplays( )
does not return the real available screen height
@pmkary i can dig into this a bit: but we don't presently change anything as it's filtered through Chromium's screen capture code, and it does not seem that code currently takes occlusion by dock into account when making these calculations. |
@codebytere — Shelly, hi! thanks a lot for looking into it. For multi-window software (say financial terminals) of which window management is internally handled, it is very important since we get windows under the dock by API fault all the time. So if it was possible to have the API use native OS calls instead of chromium, it could be marvelous. |
@deepak1556 @codebytere I wonder if microsoft/vscode#74872 is related, which is a regression we see after updating to Electron 4.2.3. It looks like a Window cannot become larger than the primary display bounds if multiple monitors are used. |
@bpasero I don't believe that these issues are related (at least at a glance). Could you try (wherever you are restoring the position), calling |
@codebytere • I gathered a little bit more of info into this. Changing the position of the dock ( |
@bpasero • @MarshallOfSound • I think that Benjamin is right about these issues being connected. We encountered the same issue as vscode's 74872 on a multi-window system where we had to manually align windows on multiple monitors and changes in monitors did break the system. Our windows ended in strange places like under the mac's menubar. At that time we used OpenFin (an electron fork) so we thought it's OpenFin's API fault, (it kept returning initial monitor/display info). But now that I see this within API of electron and since our issues are pretty much the same, I'm 100% certain the two issues are connected. |
@pmkary does your issue reproduce in Electron 4 and not in 3? |
@bpasero — We used OpenFin which didn't specify its version mapping to electron, but I can test it on an electron playground. So I'll be testing it |
@MarshallOfSound I can confirm that the following workaround makes the issue go away:
Is this a known issue? Does it impact other OS than macOS? Should we go with this workaround? I think this should also be conditional when more than one monitor is used as I do not think this issue reproduces on a single monitor. //cc @deepak1556 |
I pushed this workaround for VS Code. |
@MarshallOfSound this is actually causing yet another issue (microsoft/vscode#75830) when using macOS native tabs. Here is what happens (macOS native tabs enabled in VSCode):
I will have to add another workaround to never call I think when passing in the window dimensions as constructor to the |
+1 that this issue is causing us grief. We want to position a window at the bottom of the monitor. My expectation is that workArea and workAreaSize will change as the dock's position changes. If you have a dock that moves from monitor to monitor, Electron only returns the dimensions at application start. |
The Electron version reported on this issue is no longer supported. See our supported versions documentation. If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know. Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated. |
This issue should be reopened, even with latest Electron 28, I need to call |
Preflight Checklist
Issue Details
v5.0.2
macOS 10.14.2
-
Expected Behavior
The
screen
module of theelectron
package has a method calledgetAllDisplays
which should return the size of the screen as well as the available space for the app. In Mac, the dock size is dynamic and therefore by changing the size of the dock, the available space should change as well.Actual Behavior
As you can see, regardless of the dock size the system returns a constant
701
numberThe text was updated successfully, but these errors were encountered: