From a11e09fb11766ce0a74b66f797e0e0c88ce4aa64 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 25 Jul 2017 23:58:27 +0200 Subject: [PATCH] Skip setting geometry hints for non resizeable windows in wxGTK Avoid calling gtk_window_set_geometry_hints() when the window can't be resized anyhow, this doesn't seem to be necessary and results in warnings like the following when using Gnome: gnome-session[xxx]: Window manager warning: Window 0xxxx (Minimal wx) sets an MWM hint indicating it isn't resizable, but sets min size 198 x 154 and max size 268435454 x 268435454; this doesn't make much sense. Closes https://github.com/wxWidgets/wxWidgets/pull/529 --- src/gtk/toplevel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 2b289f4ea8..4b37b60b62 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1238,6 +1238,17 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH, int incW, int incH ) { base_type::DoSetSizeHints(minW, minH, maxW, maxH, incW, incH); + + if (!HasFlag(wxRESIZE_BORDER)) + { + // It's not useful to set size hints for the windows which can't be + // resized anyhow, and it even results in warnings from Gnome window + // manager, so just don't do it (but notice that it's not an error to + // call this for non-resizeable windows, e.g. because it's done + // implicitly by SetSizerAndFit() which is useful even in this case). + return; + } + m_incWidth = incW; m_incHeight = incH;