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 615292 - Use single GTK and Glib includes
Use single GTK and Glib includes
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
2.30.x
Other All
: Normal minor
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks: 563413 597888
 
 
Reported: 2010-04-09 13:56 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-07-15 01:33 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
Use single GTK includes (3.61 KB, patch)
2010-04-09 13:57 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Use single GTK includes.v2 (2.37 KB, patch)
2010-04-11 16:59 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Do not use GDK internal includes (1.59 KB, patch)
2010-04-11 17:02 UTC, Javier Jardón (IRC: jjardon)
reviewed Details | Review
Make build work with GSEAL (5.73 KB, patch)
2010-06-25 13:34 UTC, Jonh Wendell
committed Details | Review
Use single GTK and Glib includes (905 bytes, patch)
2010-06-30 14:08 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Use single GTK and Glib includes.v3 (1.68 KB, patch)
2010-06-30 15:06 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Javier Jardón (IRC: jjardon) 2010-04-09 13:56:02 UTC
GTK+ is moving toward a model where it is only allowed to include the 'toplevel' headers.

See http://live.gnome.org/GnomeGoals/CleanupGTKIncludes for more info
Comment 1 Javier Jardón (IRC: jjardon) 2010-04-09 13:57:02 UTC
Created attachment 158296 [details] [review]
Use single GTK  includes
Comment 2 Jens Granseuer 2010-04-09 14:06:41 UTC
Review of attachment 158296 [details] [review]:

::: capplets/display/scrollarea.c
@@ +507,3 @@
     else if (private->bg_pixmap &&
+	     private->bg_pixmap != (GdkPixmap *) GDK_PARENT_RELATIVE &&
+	     private->bg_pixmap != (GdkPixmap *) 2L)

Eek! No way!
Comment 3 Javier Jardón (IRC: jjardon) 2010-04-09 20:18:00 UTC
What about adding

#define GDK_NO_BG ((GdkPixmap*)2L)

to the beginning of the file?
Comment 4 Jens Granseuer 2010-04-09 20:36:24 UTC
That would certainly be much better already.

I guess my main concern, however, would be: why did GDK remove that define (and not others like GDK_PARENT_RELATIVE)? Can we still rely on that value if they removed it from the public interface?
Comment 5 Javier Jardón (IRC: jjardon) 2010-04-09 21:11:10 UTC
GDK_PARENT_RELATIVE_BG and GDK_NO_BG are defined in gdk/gdkprivate.h, so they are internal GDK defines.

I think GDK_NO_BG was never defined as public API
Comment 6 Jens Granseuer 2010-04-10 11:20:36 UTC
Ok, fine. That makes me think the GDK_PARENT_RELATIVE we're currently using is wrong, though, and should actually be GDK_PARENT_RELATIVE_BG.
Comment 7 Javier Jardón (IRC: jjardon) 2010-04-11 16:58:53 UTC
gnome-controls-center is currently using GDK_PARENT_RELATIVE_BG. This is a internal define equivalent to (GdkPixmap *) GDK_PARENT_RELATIVE

See http://git.gnome.org/browse/gtk+/tree/gdk/gdkprivate.h#n34
Also, GdkWindowObject is not defined in the public api neither.

I'm going to split the patch so we can commit the "non-controversial" part.
Comment 8 Javier Jardón (IRC: jjardon) 2010-04-11 16:59:37 UTC
Created attachment 158430 [details] [review]
Use single GTK  includes.v2
Comment 9 Javier Jardón (IRC: jjardon) 2010-04-11 17:02:52 UTC
Created attachment 158431 [details] [review]
Do not use GDK internal includes

Note that this patch is not complete, as I'm not sure how retrieve the internal bg_pixmap and bg_color variables without use GdkWindowObject
Comment 10 Jens Granseuer 2010-04-13 16:43:00 UTC
Review of attachment 158431 [details] [review]:

::: capplets/display/scrollarea.c
@@ +508,3 @@
     }
     else if (private->bg_pixmap &&
+	     private->bg_pixmap != (GdkPixmap *) GDK_PARENT_RELATIVE &&

Hm. Since we now define GDK_NO_BG ourselves, I'd prefer to have a similar
#define GDK_PARENT_RELATIVE_BG ((GdkPixmap *) GDK_PARENT_RELATIVE)
Comment 11 Javier Jardón (IRC: jjardon) 2010-04-13 17:21:34 UTC
Comment on attachment 158430 [details] [review]
Use single GTK  includes.v2

commit 6012559536a7144b85571ffad6b69e0c6e0df646
Comment 12 Jonh Wendell 2010-06-24 17:26:00 UTC
Also, all members of GdkWindowObject were GSEAL'd, so, things like private->bg_pixmap don't build anymore.
Comment 13 Matthias Clasen 2010-06-24 17:28:10 UTC
See gdk_window_get_back_pixmap and gdk_window_coords_to_parent. 
Those should let you do what you are doing with direct member access currently.
Comment 14 Jonh Wendell 2010-06-25 13:34:18 UTC
Created attachment 164621 [details] [review]
Make build work with GSEAL

Thanks for the hint, Matthias.

With this patch I've managed to build g-c-c master in my machine.
Comment 15 Thomas Wood 2010-06-30 13:44:56 UTC
Comment on attachment 164621 [details] [review]
Make build work with GSEAL

Committed, thanks.
Comment 16 Javier Jardón (IRC: jjardon) 2010-06-30 14:08:52 UTC
Created attachment 164966 [details] [review]
Use single GTK and Glib includes

This one is still needed
Comment 17 Javier Jardón (IRC: jjardon) 2010-06-30 15:06:57 UTC
Created attachment 164970 [details] [review]
Use single GTK and Glib includes.v3
Comment 18 Javier Jardón (IRC: jjardon) 2010-07-15 01:33:49 UTC
This is fixed now