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 667155 - Demos in gtk2 don't comply with gseal
Demos in gtk2 don't comply with gseal
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.24.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-01-02 22:46 UTC by Connor Behan
Modified: 2012-05-28 08:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
All-in-one patch (31.15 KB, patch)
2012-01-03 20:26 UTC, Connor Behan
needs-work Details | Review
First update (31.74 KB, patch)
2012-01-04 19:03 UTC, Connor Behan
accepted-commit_now Details | Review
Git format patch (35.40 KB, patch)
2012-03-01 05:37 UTC, Connor Behan
none Details | Review
Make gtk2 demos comply with gseal (35.40 KB, patch)
2012-05-26 20:03 UTC, Matthias Clasen
committed Details | Review

Description Connor Behan 2012-01-02 22:46:35 UTC
The demos that are supposed to be "exemplary" use members that are supposed to be private instead of accessor functions. This means that if one were to insert a dummy main function into a demo like ChangeDisplay, it would not compile with -DGSEAL_ENABLE. Once I finish putting in dummy main functions I will post patches.
Comment 1 Matthias Clasen 2012-01-03 16:22:00 UTC
Patches would be welcome, thanks.
Comment 2 Connor Behan 2012-01-03 20:26:38 UTC
Created attachment 204518 [details] [review]
All-in-one patch
Comment 3 Javier Jardón (IRC: jjardon) 2012-01-04 00:52:52 UTC
Review of attachment 204518 [details] [review]:

::: gtk-demo.orig/changedisplay.c
@@ +253,1 @@
 

Avoid duplicate calls:

GtkWidget *content_area;

content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));

gtk_container_add (GTK_CONTAINER (content_area), dialog_label);
gtk_container_add (GTK_CONTAINER (content_area), display_entry);

::: gtk-demo.orig/colorsel.c
@@ +30,1 @@
 

Avoid duplicate calls

::: gtk-demo.orig/offscreen_window.c
@@ +262,1 @@
                     G_CALLBACK (pick_offscreen_child), bin);

This should be:

GdkWindow *gdk_window;

gdk_window = gdk_window_new (gtk_widget_get_parent_window (widget),
                             &attibutes,
                             attributes_mask);
gtk_widget_set_window (widget, gdk_window);
gdk_window_set_user_data (gdk_window, widget)
g_signal_connect (gdk_window,

@@ +288,1 @@
   gdk_window_show (bin->offscreen_window);

And this should be:

gtk_widget_style_attach (widget);

style = gtk_widget_get_style (widget);

gtk_style_set_background (style, gdk_window, GTK_STATE_NORMAL);

::: gtk-demo.orig/offscreen_window2.c
@@ +200,1 @@
                     G_CALLBACK (pick_offscreen_child), bin);

The same as offscreen_window.c

@@ +226,1 @@
   gdk_window_show (bin->offscreen_window);

The same as offscreen_window.c
Comment 4 Connor Behan 2012-01-04 19:03:25 UTC
Created attachment 204596 [details] [review]
First update
Comment 5 Javier Jardón (IRC: jjardon) 2012-01-05 03:40:10 UTC
Review of attachment 204596 [details] [review]:

looks ok to me now
Comment 6 Javier Jardón (IRC: jjardon) 2012-02-21 12:22:08 UTC
@Connor, Do you have commit access? If not, could you attach a patch in git format? 
https://live.gnome.org/GnomeLove/SubmittingPatches
Comment 7 Connor Behan 2012-03-01 05:37:42 UTC
Created attachment 208746 [details] [review]
Git format patch

I don't have commit access. Hope this is to your liking.
Comment 8 Connor Behan 2012-04-28 20:36:18 UTC
Haven't heard about this in awhile. Does my patch still need work or did you just forget to push?
Comment 9 Matthias Clasen 2012-05-26 20:03:52 UTC
The following fix has been pushed:
5b91e0d Make gtk2 demos comply with gseal
Comment 10 Matthias Clasen 2012-05-26 20:03:56 UTC
Created attachment 215064 [details] [review]
Make gtk2 demos comply with gseal

Demos in gtk-demo are supposed to be exemplary. However, if one were to
give them dummy main functions many of them would not compile with
-DGSEAL_ENABLE. This changes the demos to make them use accessor
functions whenever possible instead of direct changes to the struct
members.

http://bugzilla.gnome.org/show_bug.cgi?id=667155
Comment 11 Connor Behan 2012-05-28 08:02:33 UTC
Thanks! (I was a dumbass to miss that semicolon)