SetMinSize() and SetSizeHints() platform differences

Hi all,

I’ve been having weird window sizing issues on Fedora, and I have just found that on Mint 20 (and all Ubuntu versions from 16.04-20.10), SetSizeHints() and SetMinSize() seem to be setting this via the client size (size ignoring window decorations). So when the window opens at what I’ve set the minimum size to be, it cannot be shrunk further.

However, on Fedora 32 and 31, this is setting the whole window size including window decoration. This means that the window opens at the right size, but can be shrunk because it’s also counting the window decoration.

The only difference I can see in wxPython versions is that 4.0.7 is being used on Mint 20, and 4.0.7.post2 is being used on Fedora 32. Is this a wxPython change or something else?

1 Like

There is no difference between 4.0.7 and 4.0.7post2 on Linux, so you can rule that out.

On Fedora, are you using Wayland or X11?

Good call. On Fedora I’m using Wayland (with GNOME 3) and on the host (and on Ubuntu) it’ll be Xorg.

I thought that wxPython used XWayland on Wayland though? Does it not?

No, it will use Wayland natively. Do the differences go away if you use X11 on Fedora? Or, alternatively, try starting your application with GDK_BACKEND=x11 ./your_application.

Yes, it behaves the way I’d expect when I use GDK_BACKEND=x11

I believe that Wayland uses client side decorations, so that probably explains the difference. I’m not sure whether wxWidgets is behaving correctly here, or whether this is expected behavior when running on Wayland. You may want to ask on the wxWidgets mailing lists or open a Trac ticket.

1 Like

Ah okay. Thank you, I will do that

Reported at https://forums.wxwidgets.org/viewtopic.php?f=23&t=47598

Not sure how to mark as solved, but thank you swt2c :slight_smile:

Moved to https://trac.wxwidgets.org/ticket/19097