GNOME Bugzilla – Bug 141721
gdk_gc_set_subwindow() doesn't seem to do anything on win32
Last modified: 2010-08-25 05:46:09 UTC
I've been trying to use gdk_gc_set_subwindow (GDK_INCLUDE_INFERIORS) in Glade-3 to draw selection rectangles. It works on Linux but not on win32. Looking at the code the value is stored in GdkGCWin32 but doesn't seem to be used. (Though I could be wrong.) Is it correct that this doesn't work on win32? It may be that it is impossible to support this on win32, which is OK as long as it is documented.
Yes, the subwindow mode of a GC is maintained in the GdkGCWin32 structure but not used for anything. I don't remember what subwindow_mode means in X11 (and I don't have access to copy of the X11 proto spec and/or Xlib reference right now). I can't say yet how hard it would be to implement its semantics.
Normally any drawing in a window is clipped by any child windows. But if you call gdk_gc_set_subwindow (GDK_INCLUDE_INFERIORS) you can draw over child windows as well.
It ought to be possible to implement this in gdk/win32. Creating the Win32 DC corresponding to the GdkGC with GetDCEx() instead of GetDC(), and not setting the DCX_CLIPCHILDREN bit in the flags argument should give a DC that allows writing on child windows. Could you please attach a minimal but complete test program?
Created attachment 92781 [details] Test program by "Roberto"
GdkGC has been removed in GTK3