microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.12k stars 303 forks source link

Borderless Maximized window does not fill the workspace. #1015

Open cyraid opened 1 year ago

cyraid commented 1 year ago

Windows build number:

10.0.22621.1483

Your Distribution version:

22.04

Your WSL versions:

WSL version: 1.1.5.0 Kernel version: 5.15.90.1 WSLg version: 1.0.50 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.1483

Steps to reproduce:

  1. Create window without decorations (borderless). This could be done using Chrome for example, without titlebar.
  2. Maximize said window, and it won't fill the workspace.

WSL logs:

pulseaudio.log weston.log stderr.log

WSL dumps:

No response

Expected behavior:

Listed in the "actual behaviour", shows what happens when you maximize a borderless (no decorations) window, vs a decorated window. It does not fill the workspace. The expected behaviour should not have a gap when maximized (and should not offset your clicks within the window by said offset).

Actual behavior:

Having a Maximized Window without decorations (borderless): BorderlessMaximized

Having a normal decorated Maximized Window (has decorations): WithBorderMaximized

Seems the window isn't being maximized to the workspace (the size of the desktop excluding the taskbar), and when you click in the window, everything is also offset by the amount shown (you must click up and left with that gap shown in the top left).

albatrossen commented 1 year ago

I have the same problem, but something interesting, if I disable all but one monitor the problem goes away. It fails even with two identical sized monitors.

albatrossen commented 1 year ago

Also for anyone finding this you can use [win]+[down] to recover your window, since it is not possible to use the title bar due to the mouse offset

simon-spinner commented 1 year ago

Since Intellij IDEA version 2023.2 EAP 6, the main window is rendered with a custom title bar under Linux as well. I experience the same behavior including the mouse offset when the window is maximized. The only workaround for me is to set the screen scale in Windows to 100%. Any other screen scale results in a mouse offset and a misaligned window.

zkyf commented 1 year ago

Since Intellij IDEA version 2023.2 EAP 6, the main window is rendered with a custom title bar under Linux as well. I experience the same behavior including the mouse offset when the window is maximized. The only workaround for me is to set the screen scale in Windows to 100%. Any other screen scale results in a mouse offset and a misaligned window.

I have the same problem with 100% scale on my Dell U2414H monitor.

paperclip commented 1 year ago

Looks similar to https://github.com/microsoft/wslg/issues/502 ?

paulius-valiunas commented 8 months ago

Currently I'm having the same problem with OpenLens, this seems to happen with every application that has native window decorations disabled.

Klemmbaustein commented 6 months ago

This happens for me with both VSCode and any borderless programs I've written for myself.

As previously said, it seems to be related to using multiple monitors. If I set the "Multiple displays" option in the Windows settings to anything but "Extend these displays" (So "Duplicate these displays" or "Only show on xy") , it works as expected without any strange offset to the borderless windows.

Edit: This only seems to happen with X11 applications. Wayland applications work fine.

pricelessrabbit commented 5 months ago

i'm currently having the same issue and i can confirm that happens only when i connect multiple monitors and only when i try to use the application with full screen size. Example: image

  1. my mouse position
  2. element selected by mouse
amoskueez commented 3 months ago

@pricelessrabbit might be related to the use of windows power toys fancy zone https://github.com/microsoft/PowerToys/issues/15986

albatrossen commented 3 months ago

From the description on https://github.com/microsoft/PowerToys/issues/15986 is sounds nothing like the symptoms of this issue. The windows are responsive. The window position is just off by around 20 pixels in both x and y. Besides I just checked again, and can say it's still a problem and I do not have powertoys installed and I can still reproduce the issue.

mleandrojr commented 2 months ago

Same here. Two screens with the same resolution and "Extend these displays" option. Bordered windows has the same problem sometimes, but a restore, resize and then maximize again fixes the problem.

The solution does not work with borderless windows. It always has this kind of padding.