GNOME Bugzilla – Bug 628049
Native windows don't work very well
Last modified: 2018-02-10 03:34:41 UTC
I'm trying to update clutter-gtk to work with Gtk+3.0 on Win32. However it seems that there's a number of bugs when a GdkWindow gets converted to a native window which clutter-gtk needs. Attached are 3 patches to fix some issues. There still seems to be a problem that whenever a native window is added to the hierarchy then the other existing non-native windows don't seem to get painted. I haven't been able to work out why this is yet.
Created attachment 168824 [details] [review] Initialize more attributes in gdk_window_ensure_native The attributes struct has some members that aren't covered by the attributes_mask so they should always be filled in. The Win32 backend was using the window type member when creating the window implementation. Previously this was left uninitialized so it would end up thinking the window is input_only and nothing would get painted.
Created attachment 168825 [details] [review] win32: Use the passed in events_mask when creating a window _gdk_window_impl_new was using the event mask from the attributes struct to initialize the window's event mask. However when called from gdk_window_ensure_native this member is not filled in so the window would end up with a random event mask. The event mask is also passed in as an argument so it might as well just use that.
Created attachment 168826 [details] [review] win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos In _gdk_window_move_resize_child it tries to decide whether to pass SWP_NOSIZE and SWP_NOMOVE based on whether the new size and position is different from the window's existing position. However it seems that GDK now ends up updating the window's position before calling _gdk_window_move_resize_child so this would mean it would think the window never changes size or position so SWP_NOSIZE|SWP_NOMOVE would always be set. This causes child windows to never be resized. This patch changes it so that it never passes either flag to SetWindowPos. I don't know whether this will cause any side effects but you'd think it shouldn't do any harm to reassert the current size.
Review of attachment 168826 [details] [review]: Thanks for the patch, I've applied it to my local tree, because it is nicer than my hacked version from http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00200.html Will push together with the cleaned up _gdk_window_impl() work.
Review of attachment 168825 [details] [review]: Thanks for spotting. Although I followed Alexander Larsson's advice from http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00214.html I still missed that detail. Now incorporated in the bigger _gdk_window_impl_new() overhaul.
Review of attachment 168824 [details] [review]: If I understood Alex correctly all these atrributes should not be used anymore. The just pushed is (to gtk-2-22) new _gdk_window_impl_new () should work without.
All the stuff is pushed to gtk-2-22 just now. Can't build gtk-3-0 myself, due to broken caior/pixmap (for msvc).
Review of attachment 168824 [details] [review]: commited to gtk-2-22 and pushed
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue for it.