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

Support pinned windows #11

Open
adam-lynch opened this issue Sep 21, 2016 · 7 comments
Open

Support pinned windows #11

adam-lynch opened this issue Sep 21, 2016 · 7 comments

Comments

@adam-lynch
Copy link

Nice module. This is a tricky one.

If you pin a window to the left/right on Windows 10 or Mac OS X for example, kill the app, and re-open it, the window will be put on the left/right but it won't be correct. It'll just be placed in the right place, but it won't be pinned. So ideally this should be supported like how maximizing is supported already (instead of simply restoring the coordinates and dimensions of the maximized window).

I'm not sure how you could work around this though 😞

@tracker1
Copy link

Would have to detect if it's roughly half/quarter screen size, then mark as appropriate, and recalc on load... OSX may be harder with the dock as part of the calculation.

@adam-lynch
Copy link
Author

@tracker1 it still wouldn't be pinned though in that case. A new Electron method might be required to pin the window. Also, it's not always half the screen by the way (the separator can be dragged to adjust the ratio).

@mawie81
Copy link
Owner

mawie81 commented Sep 23, 2016

I just checked on macOS: the window is reported as being fullscreen and will get streched to the whole screen on restart. Even if we could find out that its a split window there is currently no API in electron to reset this.

It seems there isn´t even a native API to trigger this: electron/electron#3545

So I´m not if anything can be done here.

@adam-lynch
Copy link
Author

I just checked on macOS: the window is reported as being fullscreen and will get streched to the whole screen on restart.

That is an acceptable outcome for me. (Might be worth documenting that this happens though)

So I´m not if anything can be done here.

Maybe we could have an option (or just do it always) that if it was pinned on Windows, don't try to restore it at all. I.e. leave the size screen alone if it was pinned when your app was last open.

@adam-lynch
Copy link
Author

Also

It seems there isn´t even a native API to trigger this: electron/electron#3545

I read that after replying... woops. I had assumed you meant there was no native API for Mac or Windows. So Electron might be able to add an API method for it for Windows hypothetically.

But still, even if that's true, before then we could still have it do nothing if it was pinned on Windows.

@mawie81
Copy link
Owner

mawie81 commented Oct 1, 2016

Just checked on a windows machine. When the window is pinned to the left I get a state like this:

{"width":976,"height":1038,"x":-8,"y":0,"isMaximized":false,"isFullScreen":false,"displayBounds":{"x":0,"y":0,"width":1920,"height":1080}}

So the window does not get reported as maximized and just looking at the dimensions also seems quite error prone to kind of guess a pinned window from them.

@wyrdthud
Copy link

wyrdthud commented Feb 28, 2021

I am using Windows Powertools FancyZones to snap program windows to custom screen areas. In fact I have a very simple horizontal layout of two areas, a left part with just a fraction below two thirds of my screen width and a right part with just about one third of my screen width. I would prefer to snap Element Desktop Client to that right part. When restarting Element Desktop Client after having it snapped, it will always appear as a top left positioned window with about half screen height and approx. 40% screen width. In contrast to that, when I snap Element to my right screen area and then manually reduce its size so its window borders do not touch the lower and right screen border (it has to be both; my windows task bar is at the top of my screen), it will restart in exactly that size and at that position.

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

4 participants