microsoft / wslg

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

WSLg - maximized windows disappear #1058

Open krzysz00 opened 1 year ago

krzysz00 commented 1 year ago

Windows Version

Microsoft Windows [Version 10.0.22621.1555]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.90.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. Open a graphical application (ex. xeyes)
  2. Press the maximize button

Alternatively, have an application that resizes itself to maximized (ex. emacs after loading a .emacs.desktop file)

Expected Behavior

The window is maximized

Actual Behavior

The window "disappears". It minimizes to the taskbar, and pressing the button on the taskbar causes a portion of the window - about half, horizontally - to flicker on to my second monitor (not where it was initially) before disappearing to the minimized state.

Such windows can only be removed by ^C-ing their process.

Diagnostic Logs

WslLogs-2023-05-03_23-38-18.zip

xev.txt (running xev, maximizing the window)

xeyes-strace.txt

hideyukn88 commented 4 months ago

@deadcombo,

Putting the computer to sleep seems to trigger it reliably now

To clarify this, does disappearance occur when window is being maximized or actually any window regardless maximized or not maximized, all disappear when the computer is placed to sleep? thanks!

tmax22 commented 4 months ago

Here are a couple of notes about when this issue usually happens:

deadcombo commented 4 months ago

@hideyukn88

2.:

xwininfo: Window id: 0x390 (the root window) (has no name)

  Root window id: 0x390 (the root window) (has no name)
  Parent window id: 0x0 (none)
     8 children:
     0x200032 (has no name): ()  1366x768+0+0  +0+0
        1 child:
        0x600140 "*Org Agenda* - GNU Emacs at willow": ("emacs" "Emacs")  1366x768+0+0  +0+0
           2 children:
           0x600144 (has no name): ()  1366x768+0+0  +0+0
              1 child:
              0x600383 (has no name): ("emacs" "Emacs")  119x53+65+167  +65+167
                 2 children:
                 0x600387 (has no name): ()  119x53+0+0  +65+167
                 0x600384 (has no name): ()  1x1+-1+-1  +64+166
           0x600141 (has no name): ()  1x1+-1+-1  +-1+-1
     0x60017b (has no name): ("emacs" "Emacs")  28x47+0+0  +0+0
        1 child:
        0x60017c (has no name): ()  1x1+-1+-1  +-1+-1
     0x60014d (has no name): ()  1x1+-1+-1  +-1+-1
     0x600015 (has no name): ()  1x1+-1+-1  +-1+-1
     0x600001 "emacs": ("emacs" "Emacs")  10x10+10+10  +10+10
     0x200027 "Weston WM": ()  10x10+0+0  +0+0
     0x200002 (has no name): ()  8192x8192+0+0  +0+0
     0x200001 (has no name): ()  10x10+0+0  +0+0

3 - I haven't managed to find the window in the Spy++ tree.

mprasil commented 4 months ago

I can confirm, I'm observing the same as @tmax22 mentioned. Another annoyance on top of that is that even when I get the windows back by running random graphical application, the windows do not restore to their previous virtual desktop. They all end up on the same desktop I just happen to be viewing at the time.

mprasil commented 4 months ago

To clarify this, does disappearance occur when window is being maximized or actually any window regardless maximized or not maximized, all disappear when the computer is placed to sleep? thanks!

@hideyukn88 the window disappears whether it's maximized or not. I can reproduce it just by unplugging the screen.

Having said that, I think it might be very specific to the toolkit the app is using. For Emacs specifically, the gtk3 version seems to have the issue while pgtk ("pure gtk") build of the same Emacs version is behaving OK. (does not disappear)