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

Not decorated a.k.a. Borderless window on Windows resizes more than the work area rect on maximize #1001

Open
vhanla opened this issue Sep 16, 2020 · 1 comment

Comments

@vhanla
Copy link

vhanla commented Sep 16, 2020

  • Operating System: Windows 10 Pro x64 version 2004
  • Revery Version: 0.32.0
  • OCaml version: ~4.10
  • Native, Bytecode, or JS build: Native
  • Link to github repo:

  • Steps to reproduce:
    Modify the Examples.re file to start as not decorated (borderless) window.
    Launch it esy '@examples' x examples and maximize (win+up) with aero snap

  • Actual Result:
    The resized (maximized) window is bigger than the current monitor work area rect.
    e.g. in a screen resolution 1366x768 with a work area rect of 1366x728 is not used to resize, instead the borderless maximized window is resized to 1382x744 which is even bigger than the monitor resolution, as shown in the following screen capture.
    imagen
    As you can see, the maximized window occupies even the space of the other monitor (which is arranged vertically), it is very noticeable if you have the taskbar transparent or disabled on secondary monitor.
    Same issue as Oni2's Window borders on Windows resize weirdly and still have a cut-off in fullscreen onivim/oni2#1893
    imagen

  • Expected Result:
    Fits the monitor work area rect (the area excluding the taskbar).

  • Additional Information:
    I hooked WH_CALLWNDPROCRET for detecting resizing using WM_WINDOWPOSCHANGED windows message and re-resized after the window has been maximized using SetWindowPos by detecting the monitor's work area rect which doesn't work either.

However, if it is resized to 1 pixel less than the work area rect height, it fits almost correctly with the exception that the 1 pixel gap between the window bottom border and the taskbar is present and visible as shown in the following snapshots.

imagen
The gap is visible, and might not be desireable by others, but IMHO it is better than occupying the taskbar space, and it doesn't occupying other monitor's space too.
imagen

The console (debugging console output) shows that it indeed resized to 1366x727 (exactly 1 pixel less in height).
I don't know if this workaround to kind of fix that issue might be suitable for this project, since I really don't know where that resizing overriding is ignoring the work area rect.

Notice that if it is less in height of the work area rect it respects the dimensions to adjust, otherwise, if height is the same or bigger than the work area rect, even this hook is overrided and re-resize is ignored. I don't know why.

These are the changes I did in order to achieve that workaround: vhanla@d19b9d1

Bare in mind I'm new to ReasonML and it doesn't consider fullscreen mode, which I ignore is supported though.

  • Search terms used:
    maximize
@bryphe
Copy link
Member

bryphe commented Feb 2, 2021

Just wanted to say thanks for the great investigation and detailed notes, as well as the proposed fix @vhanla !

I need to review it / test a bit and see how it integrates with some of the issues like (onivim/oni2#3071 and onivim/oni2#3063) - but really appreciate your help here 👍 Will be very useful when I dive into this!

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