Skip to content

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

Description

@vhanla
  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions