After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628049 - Native windows don't work very well
Native windows don't work very well
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Win32
3.2.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-08-26 18:06 UTC by Neil Roberts
Modified: 2018-02-10 03:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initialize more attributes in gdk_window_ensure_native (1.40 KB, patch)
2010-08-26 18:07 UTC, Neil Roberts
committed Details | Review
win32: Use the passed in events_mask when creating a window (1.20 KB, patch)
2010-08-26 18:07 UTC, Neil Roberts
reviewed Details | Review
win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos (2.79 KB, patch)
2010-08-26 18:07 UTC, Neil Roberts
reviewed Details | Review

Description Neil Roberts 2010-08-26 18:06:45 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.
Comment 1 Neil Roberts 2010-08-26 18:07:41 UTC
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.
Comment 2 Neil Roberts 2010-08-26 18:07:45 UTC
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.
Comment 3 Neil Roberts 2010-08-26 18:07:49 UTC
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.
Comment 4 Hans Breuer 2010-08-27 18:45:15 UTC
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.
Comment 5 Hans Breuer 2010-08-27 18:53:00 UTC
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.
Comment 6 Hans Breuer 2010-08-27 20:21:18 UTC
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.
Comment 7 Hans Breuer 2010-08-27 20:45:10 UTC
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).
Comment 8 Hans Breuer 2010-09-05 14:11:23 UTC
Review of attachment 168824 [details] [review]:

commited to gtk-2-22 and pushed
Comment 9 Matthias Clasen 2018-02-10 03:34:41 UTC
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.