+ return false;
+}
+}
+
+//-----------------------------------------------------------------------------
+// "property_notify_event" from m_widget
+//-----------------------------------------------------------------------------
+
+extern "C" {
+static gboolean property_notify_event(
+ GtkWidget*, GdkEventProperty* event, wxTopLevelWindowGTK* win)
+{
+ // Watch for changes to _NET_FRAME_EXTENTS property
+ static GdkAtom property = gdk_atom_intern("_NET_FRAME_EXTENTS", false);
+ if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property &&
+ win->IsDecorCacheable() && !win->IsFullScreen())
+ {
+ Atom xproperty;
+#if GTK_CHECK_VERSION(2, 2, 0)
+ if (gtk_check_version(2, 2, 0) == NULL)
+ {
+ xproperty = gdk_x11_atom_to_xatom_for_display(
+ gdk_drawable_get_display(event->window), property);
+ }
+ else
+#endif
+ {
+ xproperty = gdk_x11_atom_to_xatom(property);
+ }
+ Atom type;
+ int format;
+ gulong nitems, bytes_after;
+ long* data = NULL;
+ Status status = XGetWindowProperty(
+ gdk_x11_drawable_get_xdisplay(event->window),
+ gdk_x11_drawable_get_xid(event->window),
+ xproperty,
+ 0, 4, false, XA_CARDINAL,
+ &type, &format, &nitems, &bytes_after, (guchar**)&data);
+ if (status == Success && data && nitems == 4)
+ {
+ wxSize& decorSize = GetDecorSize(win->m_gdkDecor);
+ const wxSize size =
+ wxSize(int(data[0] + data[1]), int(data[2] + data[3]));
+ if (decorSize.x != size.x || decorSize.y != size.y)
+ {
+ // Update window size and frame extents cache
+ win->m_width += size.x - decorSize.x;
+ win->m_height += size.y - decorSize.y;
+ if (win->m_width < 0) win->m_width = 0;
+ if (win->m_height < 0) win->m_height = 0;
+ win->GtkUpdateSize();
+ decorSize = size;
+ }
+ }
+ if (data)
+ XFree(data);
+ }
+ return false;