wx.Frame.Move(), SetPosition(), SetSize() cannot reposition frames on Linux/wxGTK

On both macOS (10.14) and Windows (7) I can use Move(), SetPosition(), and SetSize() on a wx.Frame to reposition it elsewhere on the screen. However on Linux/Ubuntu 22.04 LTS I cannot. This seems like a bug.

Anybody know a workaround for repositioning wx.Frames on wxGTK?


I have tested all 3 code variations that you included in your bug report #2389 using:
Python 3.10.6 + wxPython 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0 on Linux Mint 21.1
[Linux Mint 21 is based on Ubuntu 22.04]

All 3 variations performed as I would expect. Each time I clicked the button, the frame moved to the right by 50 pixels.

Most of my own applications store the positions and sizes of their top level windows in config files when they are closed. When the applications are restarted, the positions and sizes are read from the config files and applied using SetPosition() and SetSize() calls. This works fine on linux, except for the case where the position is (0,0) as described in the bug report #2214 that you linked to in your bug report.

A thought occurred to me - Ubuntu 22.04 uses Wayland by default, whereas Linux Mint uses Xorg. Could that be the reason for the different behaviour? I have seen a few bugs reported for wxPython running on Wayland in the past, but can’t remember if any related to setting the position of a frame.

Yes, good thinking @RichardT. I commented on the issue, I can reproduce the behavior on Wayland but not on Xorg. In fact, I’m not sure it’s possible to move top-level Windows on Wayland.