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 612472 - Does not compile with -DGSEAL_ENABLED
Does not compile with -DGSEAL_ENABLED
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on: 597895
Blocks: 561956 585391
 
 
Reported: 2010-03-10 20:23 UTC by André Klapper
Modified: 2011-01-30 11:45 UTC
See Also:
GNOME target: 3.0
GNOME version: 2.29/2.30


Attachments
Major work on the GSEAL compliance. (61.23 KB, patch)
2010-04-13 15:13 UTC, Stéphane Maniaci
committed Details | Review

Description André Klapper 2010-03-10 20:23:06 UTC
This module does not build with -DGSEAL_ENABLED.
See http://live.gnome.org/GnomeGoals/UseGseal .

Note that maybe this report cannot be fixed yet, as GTK+ still misses some accessor functions (see bug 588389, bug 597610) needed for sealing.
Also see http://live.gnome.org/GTK%2B/3.0/PendingSealings for current status.

The jhbuild output posted here of course only lists the very first error when trying to compile.

gdm-host-chooser-dialog.c: In function ‘gdm_host_chooser_dialog_constructor’:
gdm-host-chooser-dialog.c:136: error: ‘GtkDialog’ has no member named ‘vbox’
make[3]: *** [gdm-host-chooser-dialog.o] Error 1
make[3]: Leaving directory `/home/andre/svn-gnome/gdm/gui/simple-chooser'
Comment 1 Stéphane Maniaci 2010-04-13 15:13:18 UTC
Created attachment 158614 [details] [review]
Major work on the GSEAL compliance.

Here's my kick at this bug, unfortunately, I couldn't get it all done because of some bitwise magic I'm not familiar with and the GtkMenu "active" property I couldn't deal with.

Also, worth mention, I included <stdlib.h> in a file using the standard exit() function, I don't know if this is common practice.

Some questions about GtkAllocation : when should I use a pointer and when shouldn't I ?

Overall, this patch is kinda large and I'm not a Gtk expert, so please double-check it !
Comment 2 André Klapper 2010-04-14 14:56:24 UTC
Thanks for working on this!
Patch is missing a bump in configure.ac which currently says GTK_REQUIRED_VERSION=2.12.0
Comment 3 Ray Strode [halfline] 2010-04-21 21:08:08 UTC
We should probably commit this for 2.31 but not 2.30 branch (i still need to look it over)
Comment 4 André Klapper 2010-04-21 21:12:14 UTC
(In reply to comment #1)
> Some questions about GtkAllocation : when should I use a pointer and when
> shouldn't I ?

Basically it's always

+ GtkAllocation allocation;
+ gtk_widget_get_allocation (widget, &allocation);
- widget->allocation.width;
- widget->allocation.height;
+ allocation.width;
+ allocation.height;
Comment 5 André Klapper 2010-04-23 15:35:47 UTC
(In reply to comment #3)
> We should probably commit this for 2.31 but not 2.30 branch (i still need to
> look it over)

Definitely 2.31-only stuff. The earlier it's in the better so we can find potential accessors in gtk+ that are still missing.
Comment 6 Brian Cameron 2010-05-03 20:55:30 UTC
I committed the patch in comment #2.  I did not update configure.ac to specify
a newer version of GTK.  What version should be specified there?  Let me know and
I will update this also.

GTK_REQUIRED_VERSION=2.12.0

Is this work done, or is more work needed?
Comment 7 André Klapper 2010-05-04 11:28:02 UTC
Brian: "Newest" symbol I found in your commit diff is gtk_widget_get_realized() which was introduced in GTK+ 2.19.7. So probably bump to 2.20 and you're fine.


This report can be closed once entire gdm compiles with -DGSEAL_ENABLE. (When it does compiling can only fail again if somebody writes old-style code in gdm but it cannot fail again because for example the gtk+ team changes something.)
Hence setting -DGSEAL_ENABLE as a default flag somewhere in configure.ac is encouraged.

I have just fixed two trivial issues in http://git.gnome.org/browse/gdm/commit/?id=cb80e59f93b6069dd3fe46f8ed22af853901cfda so the only issues that are still left to fix are:

gui/user-switch-applet/applet.c: In function ‘applet_key_press_event_cb’:
applet.c:374: error: ‘GtkMenuShell’ has no member named ‘active’
applet.c:376: error: ‘GtkMenuShell’ has no member named ‘have_grab’
applet.c:377: error: ‘GtkMenuShell’ has no member named ‘active’
gui/user-switch-applet/applet.c: In function ‘fill_applet’:
applet.c:1511: error: ‘GtkObject’ has no member named ‘flags’
applet.c:1511: error: ‘GtkObject’ has no member named ‘flags’
Comment 8 Brian Cameron 2010-05-04 22:07:24 UTC
Thanks.  I updated configure.ac so that the GTK required version is 2.20.0 and the line now reads as follows:

GTK_REQUIRED_VERSION=2.20.0
Comment 9 André Klapper 2010-06-10 15:56:42 UTC
*ping*
Can the few remaining issues please be fixed soon (next two weeks, before 2.31.4)?
Comment 10 William Jon McCann 2010-06-11 03:55:31 UTC
I've fixed the flags part in master.  However, I'm not sure what to do about the following code:
/*
 * gnome-panel/applets/wncklet/window-menu.c:window_menu_key_press_event()
 */
                /*
                 * We need to call _gtk_menu_shell_activate() here as is done in
                 * window_key_press_handler in gtkmenubar.c which pops up menu
                 * when F10 is pressed.
                 *
                 * As that function is private its code is replicated here.
                 */
                if (!menu_shell->active) {
                        gtk_grab_add (GTK_WIDGET (menu_shell));
                        menu_shell->have_grab = TRUE;
                        menu_shell->active = TRUE;
                }

And not really sure what it is doing either.
Comment 11 Federico Mena Quintero 2010-06-22 18:59:47 UTC
A bit of history:

WnckSelector is a GtkMenuBar with a single item.  That item has an image (the current window's icon), and a submenu which actually *is* the menu of all windows.

GtkMenuBar of course descends from GtkMenuShell.

GtkMenuShell is this old lumbering beast.  _gtk_menu_shell_activate() is private just for historical reasons; there's no good reason to keep it from being public.  It is just used to pass around grabs between nested submenus (see how it is called in gtkmenuitem.c).

The code in the panel (and now gdm) is already a bit obsolete; GTK+ has this pattern in gtkmenubar.c:window_key_press_handler():

  _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
  _gtk_menu_shell_activate (menu_shell);
  gtk_menu_shell_select_first (menu_shell, FALSE);

We could very well add a gtk_menu_shell_fire_and_forget_from_the_keyboard() that does all that.  Patches welcome ;)
Comment 12 Matthias Clasen 2011-01-21 20:23:53 UTC
master compiles fine against current gtk3
Comment 13 Germán Poo-Caamaño 2011-01-30 11:45:45 UTC
FWIW, for gnome-panel (fallback) I was expecting that once gdm
had a solution for this hack, we could apply it to gnome-panel,
too.  In the meantime, we were working in fixing other 
issues.

However, we can not delete the menu from the panel.
Any suggestion? (rather than using Xlib directly).