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 586731 - Should build with -DGSEAL_ENABLE
Should build with -DGSEAL_ENABLE
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
trunk
Other Linux
: Normal normal
: ---
Assigned To: Thomas Andersen
GNOME Games maintainers
Depends on: 69872 328069 585211
Blocks: 585391
 
 
Reported: 2009-06-23 09:50 UTC by Thomas Andersen
Modified: 2010-07-04 08:56 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
Gseal fixes for libgames-support, glines, and gnobots2 (15.83 KB, patch)
2009-06-23 09:55 UTC, Thomas Andersen
committed Details | Review
Gseal fixes for gnotravex, gnotski, and gtali (7.83 KB, patch)
2009-06-24 22:58 UTC, Thomas Andersen
committed Details | Review
Gseal fixes for mahjongg, same-gnome, and part of gnomine (16.15 KB, patch)
2009-07-20 00:06 UTC, Thomas Andersen
committed Details | Review
Add games-gtk-compat.h and use it for a few sealings in aisleriot (14.10 KB, patch)
2009-07-24 18:08 UTC, Thomas Andersen
reviewed Details | Review
Updated patch. Add games-gtk-compat.h and use it for a few sealings in aisleriot (15.38 KB, patch)
2009-08-18 18:08 UTC, Thomas Andersen
committed Details | Review
More fixes related to gseal. Mostly ->allocation (11.00 KB, patch)
2009-08-31 19:32 UTC, Thomas Andersen
none Details | Review
More fixes related to gseal. Mostly ->allocation (v2) (10.76 KB, patch)
2009-08-31 22:54 UTC, Thomas Andersen
none Details | Review
More fixes related to gseal. Mostly ->allocation (v3) (12.00 KB, patch)
2009-08-31 23:20 UTC, Thomas Andersen
committed Details | Review
GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE (4.15 KB, patch)
2009-10-05 22:16 UTC, Thomas Andersen
none Details | Review
GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE v2 (4.58 KB, patch)
2009-10-05 22:38 UTC, Thomas Andersen
committed Details | Review
Patch for aisleriot statusbar issues (1.43 KB, patch)
2009-10-06 20:22 UTC, Thomas Andersen
needs-work Details | Review
Patch for aisleriot statusbar issues v2 (1.46 KB, patch)
2009-10-06 21:40 UTC, Thomas Andersen
committed Details | Review
GTK_WIDGET_DRAWABLE(), GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS) and GTK_WIDGET_HAS_FOCUS() (4.78 KB, patch)
2009-12-08 06:58 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
minefield: Fix GSEAL issues (8.91 KB, patch)
2009-12-08 06:59 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
gnibbles: Fix GSEAL issues (1.41 KB, patch)
2009-12-08 06:59 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
GTK_WIDGET_DRAWABLE(), GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS) and GTK_WIDGET_HAS_FOCUS().v2 (4.39 KB, patch)
2009-12-09 19:36 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Use widow directly as it is already available (1.16 KB, patch)
2010-03-11 17:50 UTC, Thomas Andersen
committed Details | Review
Similar fix as last for ar-clutter-embed.c (1.51 KB, patch)
2010-03-28 18:29 UTC, Thomas Andersen
committed Details | Review
Use accessor functions. Final patch (6.14 KB, patch)
2010-04-06 02:15 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Use accessor functions. Final patch (6.66 KB, patch)
2010-04-06 12:32 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Use accessor functions. Final patch.v3 (6.69 KB, patch)
2010-04-06 14:19 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Fix a GSEAL issue with GdkVisual (1.00 KB, patch)
2010-06-15 06:30 UTC, Thomas Andersen
accepted-commit_now Details | Review
Fix a GSEAL issue with GdkVisual (1.55 KB, patch)
2010-06-15 20:56 UTC, Thomas Andersen
committed Details | Review

Description Thomas Andersen 2009-06-23 09:50:14 UTC
To be ready for GNOME 3 we should be able to build with -DGSEAL_ENABLE

Patch follows for libgames-support, glines and gnobots. The rest are WIP.

Chpe: I need to add GTK_CHECK_VERSION to games-scores-dialog.c and games-gridframe.c for maemo right? What about aisleriot, should I ignore it or do you want a patch for it too?

Currently it is not possible to fix 100% as there are no accessor functions for GtkObject flags and GtkWidget allocation yet.
Comment 1 Thomas Andersen 2009-06-23 09:55:32 UTC
Created attachment 137238 [details] [review]
Gseal fixes for libgames-support, glines, and gnobots2
Comment 2 Christian Persch 2009-06-23 10:23:29 UTC
games-scores-dialog.c and games-gridframe.c are unused on maemo.

Aisleriot already has quite enough #ifdef'd code already, I'd really hate to add more of it. Maybe a different approach would work: as far as I can tell, all of these new accessors just do "return widget->member" directly, without doing any additional work, right? In that case, we could add a games-gtk-compat.h header to libgames-support, that has 

#if !GTK_CHECK_VERSION (x, y, z)

#define gtk_widget_get_window(widget) ((widget)->window)

....

#endif /* GTK < x.y.z */

and just include that in aisleriot's code and then use the new accessors regardless of the gtk version.

And if in future a new accessor is added to gtk and we'd have to bump our gtk req just for this reason, we could just add to the compat header and keep the lower gtk req, also for other games. In fact that fixes the biggest complaint I have about these accessors: the needless gtk req bumping :)
Comment 3 Thomas Andersen 2009-06-23 20:29:03 UTC
Yes the ifdef's are starting to become a pain. I was hoping that you had an idea how to avoid it :) The games-gtk-compat.h sounds like a good solution.

It looks like most accessors were added in 2.13.4 (GSEAL branch merged) and then some extra in later versions. But I guess we only care about those accessors we actually use in aisleriot (or entire gnome-games).

I think I will just commit the games I fix soon but leave a patch for aisleriot & games-gtk-compat.h for review by you here. Unless you do it before me that is... :)
Comment 4 Thomas Andersen 2009-06-24 22:58:42 UTC
Created attachment 137344 [details] [review]
Gseal fixes for gnotravex, gnotski, and gtali
Comment 5 Thomas Andersen 2009-07-20 00:06:25 UTC
Created attachment 138773 [details] [review]
Gseal fixes for mahjongg, same-gnome, and part of gnomine
Comment 6 Thomas Andersen 2009-07-24 18:08:28 UTC
Created attachment 139170 [details] [review]
Add games-gtk-compat.h and use it for a few sealings in aisleriot

Chpe: This is a first stab at the aisleriot/games-gtk-compat.h stuff. I only included gtk_widget_get_window and gtk_widget_get_state in this patch. I just wanted to make sure that this was what you had in mind.
Comment 7 Christian Persch 2009-07-24 21:38:56 UTC
Yes, that looks fine. A few comments:

+// Temporary fix from http://live.gnome.org/GnomeGoals/UseGseal

No C++ comments please.

+#undef GTK_OBJECT_FLAGS
+#define GTK_OBJECT_FLAGS(i) (GTK_OBJECT (i)->GSEAL(flags))

This block should be #ifdef GSEAL_ENABLE, I think?

+  source = gdk_bitmap_create_from_data (gtk_widget_get_window (widget), data, 20, 20);
+  mask = gdk_bitmap_create_from_data (gtk_widget_get_window (widget), mask_data, 20, 20);

Where the same GtkWidget accessor is used more than once in a function, I'd prefer to call it only once, by using a local variable of the appropriate type.

With these changes, please commit. Thanks!
Comment 8 Thomas Andersen 2009-08-18 18:08:32 UTC
Created attachment 141100 [details] [review]
Updated patch. Add games-gtk-compat.h and use it for a few sealings in aisleriot

Patch updated with comments. Thanks Christian
Comment 9 Thomas Andersen 2009-08-29 19:26:59 UTC
Committed a small patch adding getter/setter for allocation to games-gtk-compat.h
http://git.gnome.org/cgit/gnome-games/commit/?id=3ef185bbda8d9fbba65ac4a76739ee63e29d7233
Comment 10 Thomas Andersen 2009-08-31 19:32:05 UTC
Created attachment 142157 [details] [review]
More fixes related to gseal. Mostly ->allocation

Mostly fixes for ->allocation.

Also a few fixes other fixes to complete aisleriot (except for flags)
Comment 11 Thomas Andersen 2009-08-31 22:54:23 UTC
Created attachment 142173 [details] [review]
More fixes related to gseal. Mostly ->allocation (v2)

Same patch as before but adjusted for comments from chpe on irc
Comment 12 Thomas Andersen 2009-08-31 23:20:12 UTC
Created attachment 142174 [details] [review]
More fixes related to gseal. Mostly ->allocation (v3)

Same as previous. Just added a few small fixes to aisleriot/window.c

In aisleriot_window_init the "widget surgery" in the statusbar code looks tricky to do with gseal. Chpe?
Comment 13 Thomas Andersen 2009-10-05 22:16:27 UTC
Created attachment 144853 [details] [review]
GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE

touches aisleriot. Chpe, review?
Comment 14 Thomas Andersen 2009-10-05 22:38:48 UTC
Created attachment 144857 [details] [review]
GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE v2

updated as per comments on irc
Comment 15 Thomas Andersen 2009-10-06 20:22:16 UTC
Created attachment 144912 [details] [review]
Patch for aisleriot statusbar issues

patch based on comments from chpe on irc
Comment 16 Thomas Andersen 2009-10-06 20:39:49 UTC
patch untested btw
Comment 17 Christian Persch 2009-10-06 20:41:55 UTC
Comment on attachment 144912 [details] [review]
Patch for aisleriot statusbar issues

+  GtkWidget *statusbar_hbox,*label, *time_box, *frame;
+  frame = GTK_FRAME (list->data);

That's a type mismatch. Since we only need the frame as a container, let's declare it GtkContainer*, and use GTK_CONTAINER cast, and remove the 2 casts in the gtk_container_* calls. And let's call it statusbar_frame.

+  gtk_container_remove (GTK_CONTAINER (frame), gtk_bin_get_child (GTK_BIN (frame)));
+  gtk_box_pack_start (GTK_BOX (statusbar_hbox), gtk_bin_get_child (GTK_BIN (frame)), TRUE, TRUE, 0);

This won't work; on the 2nd line the frame has no child anymore, obviously :) So you need a local statusbar_label var.
Comment 18 Thomas Andersen 2009-10-06 21:40:21 UTC
Created attachment 144918 [details] [review]
Patch for aisleriot statusbar issues v2

make much more sense now. Thanks
Comment 19 Christian Persch 2009-10-06 21:45:54 UTC
Comment on attachment 144918 [details] [review]
Patch for aisleriot statusbar issues v2

Looks ok now. Assuming it also _works_ as expected, ok to commit :)
Comment 20 Thomas Andersen 2009-10-06 21:54:13 UTC
Comment on attachment 144918 [details] [review]
Patch for aisleriot statusbar issues v2

Thanks. Committed:
http://git.gnome.org/cgit/gnome-games/commit/?id=7436c9e0f02797e0b1f2c5429266668baf00fd81
Comment 21 Javier Jardón (IRC: jjardon) 2009-12-08 06:58:21 UTC
Created attachment 149308 [details] [review]
GTK_WIDGET_DRAWABLE(), GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS) and GTK_WIDGET_HAS_FOCUS()
Comment 22 Javier Jardón (IRC: jjardon) 2009-12-08 06:59:09 UTC
Created attachment 149309 [details] [review]
minefield: Fix GSEAL issues
Comment 23 Javier Jardón (IRC: jjardon) 2009-12-08 06:59:51 UTC
Created attachment 149310 [details] [review]
gnibbles: Fix GSEAL issues
Comment 24 Javier Jardón (IRC: jjardon) 2009-12-08 07:01:49 UTC
Still missing (no GTK+ api available):

GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED)
GTK_WIDGET_REALIZED()
GTK_WIDGET_MAPPED()
Comment 25 Javier Jardón (IRC: jjardon) 2009-12-09 19:36:50 UTC
Created attachment 149475 [details] [review]
GTK_WIDGET_DRAWABLE(), GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS) and GTK_WIDGET_HAS_FOCUS().v2

Updated patch after yesterday Chpe changes
Comment 26 Thomas Andersen 2010-03-11 17:50:57 UTC
Created attachment 155880 [details] [review]
Use widow directly as it is already available

This broke with bf42fd6efd28fa415a8df6660649d2565e40a2b0

With this patch we build with GSEAL again (with gtk 2.19.6)
Comment 27 Christian Persch 2010-03-11 17:54:14 UTC
Comment on attachment 155880 [details] [review]
Use widow directly as it is already available

Please commit.
Comment 28 Christian Persch 2010-03-11 17:57:45 UTC
Also, ar-clutter-embed.c will need a similar fix.
Comment 29 Thomas Andersen 2010-03-28 18:29:01 UTC
Created attachment 157330 [details] [review]
Similar fix as last for ar-clutter-embed.c

Patch for ar-clutter-embed.c attached. Will commit after 2.30 is branched
Comment 30 Javier Jardón (IRC: jjardon) 2010-04-06 02:15:15 UTC
Created attachment 158013 [details] [review]
Use accessor functions. Final patch
Comment 31 Christian Persch 2010-04-06 12:12:36 UTC
Comment on attachment 158013 [details] [review]
Use accessor functions. Final patch

When you replace these functions with the new accessors in aisleriot, you need to make sure that the file includes <libgames-support/games-gtk-compat.h>, which ar-fullscreen-button.c is missing.

Also, if the macro occurs twice or more in the same function, you should introduce a local variable to hold the result instead of calling the accessor multiple times.
Comment 32 Christian Persch 2010-04-06 12:15:45 UTC
And this:

+#define gtk_widget_set_realized(widget, TRUE)                   GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED)

doesn't work, of course.
Comment 33 Javier Jardón (IRC: jjardon) 2010-04-06 12:32:39 UTC
Created attachment 158044 [details] [review]
Use accessor functions. Final patch

Updated patch with your comments

About this:

#define gtk_widget_set_realized(widget, TRUE) GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED)

seems to work here.
Comment 34 Christian Persch 2010-04-06 12:48:13 UTC
But it doesn't when you pass FALSE. gtk_widget_set_realized needs to have identical function whether it's the new accessor or the compat macro. So you need to fix it to support FALSE too.
Comment 35 Javier Jardón (IRC: jjardon) 2010-04-06 14:19:55 UTC
Created attachment 158049 [details] [review]
Use accessor functions. Final patch.v3

Ok, I think this should work (thanks to ebassi here ;))
Comment 36 Thomas Andersen 2010-04-06 21:37:38 UTC
Looks good to me.

We should probably also fix this in the same way as gtk_widget_set_realized:
#define gtk_widget_set_can_focus(widget, can_focus) GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS)

Chpe, okay to commit with that extra fix?
Comment 37 Christian Persch 2010-04-06 21:58:13 UTC
(In reply to comment #36)
> We should probably also fix this in the same way as gtk_widget_set_realized:
> #define gtk_widget_set_can_focus(widget, can_focus) GTK_WIDGET_SET_FLAGS
> (widget, GTK_CAN_FOCUS)
Yes.
 
> Chpe, okay to commit with that extra fix?

Sure.
Comment 38 Javier Jardón (IRC: jjardon) 2010-04-07 02:29:55 UTC
Comment on attachment 158049 [details] [review]
Use accessor functions. Final patch.v3

committed with the requested fixes

commit da14cdf0c479d91a1eaa0eeffa4bea6e870c0115
Comment 39 Javier Jardón (IRC: jjardon) 2010-04-07 02:31:00 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release.

Congrats! :)
Comment 40 Thomas Andersen 2010-04-07 16:41:21 UTC
I had a quick look at games-gtk-compat.h yesterday and noticed that gtk_widget_set_window has two problems.

1) The space between the macro name and the first parentheses will cause it to be treated like an object instead of a function.

2) Both tokens of "window" will be replaced on the right side.

It currently looks like this:
#define gtk_widget_set_window (widget, window) ((widget)->window=window)


To illustrate what is going on I've put the following in a file (test.c) and let the preprocessor expand the macro.

#define gtk_widget_set_window (widget, window) ((widget)->window=window)
gtk_widget_set_window(my_widget, my_window);

thomas@mosegris:~$ gcc -E test.c
...
(widget, window) ((widget)->window=window)(my_widget, my_window);

Not the result we wanted...

With the fixed version:

#define gtk_widget_set_window(widget, window_arg) ((widget)->window=window_arg)
gtk_widget_set_window(my_widget, my_window);

thomas@mosegris:~$ gcc -E test.c
...
((my_widget)->window=my_window);

Much better :)
Comment 41 Christian Persch 2010-06-12 21:22:57 UTC
This isn't done completely: aisleriot/window.c still has this:

  gtk_box_pack_end (GTK_BOX (GTK_MESSAGE_DIALOG (dialog)->label->parent), entry, FALSE, FALSE, 0);
Comment 42 Thomas Andersen 2010-06-15 06:30:32 UTC
Created attachment 163655 [details] [review]
Fix a GSEAL issue with GdkVisual

I don't see that error when I'm compiling. Do I need to pass something specific to autogen/make for that code to be compiled?

On the other hand I do see a problem in aisleriot/board-noclutter.c with GdkVisual->depth. The patch fixes that but I suppose we want to add a compat for that as well.
Comment 43 Christian Persch 2010-06-15 14:10:01 UTC
The aisleriot thing only happens with --enable-debug-ui (debug only code, but essential; fixing it depends on gtk bug 328069).
Comment 44 Christian Persch 2010-06-15 14:10:44 UTC
Comment on attachment 163655 [details] [review]
Fix a GSEAL issue with GdkVisual

Looks fine. We do need a compat define for this, of course.
Comment 45 Thomas Andersen 2010-06-15 20:56:54 UTC
Created attachment 163725 [details] [review]
Fix a GSEAL issue with GdkVisual

With compat define. (Untested as my build broke for unrelated reasons)
Comment 46 André Klapper 2010-07-02 17:27:39 UTC
Can the last patch get a review please?
Comment 47 Christian Persch 2010-07-03 08:54:31 UTC
What patch? All patches are committed.

AFAIK this is FIXED.
Comment 48 André Klapper 2010-07-04 08:56:02 UTC
(In reply to comment #47)
> What patch? All patches are committed.
> 
> AFAIK this is FIXED.

Oh true - compiling git master with DGSEAL_ENABLE worked fine for me.