microsoft / wslg

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

WSL 2 GUI application is not aware of Windows screen dimensions #584

Open smuehlst opened 2 years ago

smuehlst commented 2 years ago

Version

Microsoft Windows [Version 10.0.22000.318]

WSL Version

WSL 2

Kernel Version

5.10.60.1

Distro Version

Debian GNU/Linux 11 64-bit from Microsoft Store

Other Software

Eclipse 2021-09 Linux 64-bit

Repro Steps

Expected Behavior

The "Team" sub-menu should be opened so that it is fully visible on the Windows screen.

This is a screenshot of running the Windows version of Eclipse, after right-clicking into the editor window to open a popup menu and after opening the sub-menu "Team":

Windows GUI Eclipse

Note that the "Team" sub-menu is popped up upwards so it can be fully displayed on the screen. If the sub-menu were popped up downwards it wouldn't fit on the screen

This is a screenshot of the Linux version of the same Eclipse version, when opening the same editor popup menu and "Team" sub-menu:

WSL2 GUI Eclipse

Note that the "Team" sub-menu is opened downwards, and extends beyond the screen so some of the sub-menu entries are invisible and cannot be clicked. This does never happen when running Eclipse under a real Linux graphical desktop.

Actual Behavior

The "Team" sub-menu is opened downwards so that it is not fully visible on the Windows screen, and some of the menu entries can't be clicked.

Apparently the Linux GUI application running under WSL 2 is not aware of the actual screen dimensions.

Diagnostic Logs

No response

craigloewen-msft commented 2 years ago

Could you please file this as an open item on the WSLg repo? The full team that works on WSLg monitors that repo instead at: microsoft/wslg

You can file the issue here: https://github.com/microsoft/wslg/issues/new?assignees=&labels=bug&template=bug_report.md&title=

And feel free to link back to this issue if you like. I'll close this one for bookkeeping purposes so it can be tracked on the wslg repo instead. Thanks!

craigloewen-msft commented 2 years ago

I transferred this over for you!

smuehlst commented 2 years ago

@craigloewen-msft Thank you for moving the issue to the right repository, I was not aware of this.

smuehlst commented 2 years ago

Adding the missing information about the WSLg version: I have "Windows Subsystem for Linux WSLg Preview" version 1.0.26.

gianmarcoodorizzi commented 2 years ago

@smuehlst did you find a way to work around this?

smuehlst commented 2 years ago

@gianmarcoodorizzi Unfortunately not, the problem is still bothering me.

velo commented 2 years ago

Any workarounds on this yet?

salvatore-coppola commented 2 years ago

Any workarounds on this yet?

Same request from my side.

drivett27 commented 1 year ago

I take it there is no resolution for this yet? I have a requirement for running Eclipse under WSL and it is incredibly awkward and annoying to have to try and choose menu options when they don't realign to fit the "desktop" So same request from me as well please.

tmottershead commented 1 year ago

I have a kind of workaround for the pop-up menus disappearing off screen, but then I have issues with the find/replace dialog box disappearing to the back of the Z plane and hiding. The pop-up menus workaround is to set GDK_BACKEND=x11 before running eclipse. I have an alias to do this:

alias eclipse='GDK_BACKEND=x11 ~/eclipse/eclipse &'

To be honest, I think I'm going to disable Wayland and go back to using VcXsrv for the time being.

Achaad commented 10 months ago

Is there any solution or at least some progress with it? Due to corporation policies I have no choice but to run Eclipse via WSLg and this issue is really inconvenient.

Bocom commented 8 months ago

It's disappointing that this has still not been fixed.

The only alternative (aside from not using WSLg) being "use X11" (by using the GDK_BACKEND=x11 workaround posted above) is not great, in part because it only makes the situation slightly better for me; I can see most of the menu, but some of it still gets obscured by the taskbar.

BartXZX commented 4 days ago

Might be related to this weston issue. IntelliJ on wayland has the same issue. Unfortunately it looks like the issue is not really progressing much.