2

I have a Bash script running some Zenity question boxes. When run on for instance Ubuntu the placement of the boxes are always consistent (top and middle of screen). However when I run the same script on Ubuntu in WSL2 the placement hops around. First time the box shows up lower left. Next time upper left. And so on. It shows up seemingly randomly.

Anyone knows what causes this behavior?

Ramhound
  • 44,080
Paul Bergström
  • 424
  • 1
  • 4
  • 17

1 Answers1

0

It shows up seemingly randomly.

This sounds like a limitation of WSL/Wayland/Weston in general. I can reproduce the same behavior just running a basic xterm -- The window placement is seemingly random on each launch.

Under Linux, if an application doesn't specify its own placement, the window manager is responsible for doing so. Gnome/Mutter has implemented a Smart Window Placement feature, which is the behavior I believe you are likely seeing on "regular" Ubuntu.

On WSL, support for graphical apps is provided through Wayland/Xwayland, with the Weston compositor, through an RDP backend to display it in Windows. Weston is pretty "basic", since it is really just considered a reference implementation.

As a workaround, I tried to use devilspie2 as mentioned in the Ask Ubuntu answer linked above, but that doesn't work on XWayland under Weston either, unfortunately.

NotTheDr01ds
  • 28,025