wslg icon indicating copy to clipboard operation
wslg copied to clipboard

WSL 2 GUI application is not aware of Windows screen dimensions

Open smuehlst opened this issue 4 years ago • 13 comments

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

  • Run Eclipse for Linux under WSL 2.
  • Open a C/C++ Editor window.
  • Right-click into the editor window to open the editor popup window.
  • Open the "Team" sub-menu from the popup menu.

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

smuehlst avatar Nov 23 '21 12:11 smuehlst

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 avatar Nov 23 '21 17:11 craigloewen-msft

I transferred this over for you!

craigloewen-msft avatar Nov 23 '21 17:11 craigloewen-msft

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

smuehlst avatar Nov 23 '21 18:11 smuehlst

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

smuehlst avatar Nov 23 '21 18:11 smuehlst

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

gianmarcoodorizzi avatar Feb 11 '22 16:02 gianmarcoodorizzi

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

smuehlst avatar Feb 11 '22 18:02 smuehlst

Any workarounds on this yet?

velo avatar Mar 01 '22 20:03 velo

Any workarounds on this yet?

Same request from my side.

salvatore-coppola avatar Jul 07 '22 08:07 salvatore-coppola

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.

drivett27 avatar Nov 10 '22 16:11 drivett27

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.

tmottershead avatar Dec 09 '22 20:12 tmottershead

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.

Achaad avatar Dec 04 '23 08:12 Achaad

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.

Bocom avatar Jan 12 '24 16:01 Bocom

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.

BartXZX avatar Sep 27 '24 09:09 BartXZX