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 668118 - the big appmenu switcheroo
the big appmenu switcheroo
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-01-17 18:26 UTC by Allison Karlitskaya (desrt)
Modified: 2012-01-18 22:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GApplication: drop support for appmenu/menubars (12.72 KB, patch)
2012-01-17 18:26 UTC, Allison Karlitskaya (desrt)
committed Details | Review
move menus over from GLib (16.60 KB, patch)
2012-01-17 18:26 UTC, Allison Karlitskaya (desrt)
committed Details | Review
adjust to new Gtk properties for app menu (16.62 KB, patch)
2012-01-17 18:27 UTC, Allison Karlitskaya (desrt)
committed Details | Review
Adjust to gtk/mutter changes for Application API (14.00 KB, patch)
2012-01-17 20:47 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-01-17 18:26:36 UTC
We need 4 changes:

  - finish dropping the support from menubars from GLib

  - add them into Gtk, migrating to xproperties

  - wire the xproperties into mutter

  - fix the shell


The move to xprops is for two main reasons:

 1) mutter can load a whole whack of x properties very quickly
    using the pipelining tricks it has, so my initial aversion
    to making a lot of properties was misplaced.

 2) using DBus becomes more difficult because it would involve
    splitting the definition of the dbus interface between glib
    and gtk and gdbus doesn't really work like that.
Comment 1 Allison Karlitskaya (desrt) 2012-01-17 18:26:38 UTC
Created attachment 205466 [details] [review]
GApplication: drop support for appmenu/menubars

This has been moved over to GtkApplication now.
Comment 2 Allison Karlitskaya (desrt) 2012-01-17 18:26:59 UTC
Created attachment 205467 [details] [review]
move menus over from GLib

App menu and menubar are now properties of GtkApplication and their bus
location is exported using X window properties.
Comment 3 Allison Karlitskaya (desrt) 2012-01-17 18:27:25 UTC
Created attachment 205468 [details] [review]
adjust to new Gtk properties for app menu
Comment 4 Allison Karlitskaya (desrt) 2012-01-17 20:47:54 UTC
Created attachment 205484 [details] [review]
Adjust to gtk/mutter changes for Application API
Comment 5 Allison Karlitskaya (desrt) 2012-01-17 20:58:56 UTC
this patch series sometimes causes the shell to freeze up for a few seconds at a time when opening windows that have app menus on them.  i'm not entirely sure why and i'm not in a position to debug it at this very moment.
Comment 6 Matthias Clasen 2012-01-18 13:57:11 UTC
No objection in principle to moving the entire menu business to gtkapplication.

Using X properties more means that other dbus-using backends (wayland...) will need a more standalone implementation for menu support - but that is likely the case anyway. 

We should of course debug the freeze...
Comment 7 Matthias Clasen 2012-01-18 13:58:48 UTC
Review of attachment 205466 [details] [review]:

Sure
Comment 8 Matthias Clasen 2012-01-18 13:59:11 UTC
Review of attachment 205468 [details] [review]:

::: src/meta/window.h
@@ +104,1 @@
 

Is it really right to introduce _gtk_ in the api here ?
We still hope for this to get wider adoption, right ?
Comment 9 Matthias Clasen 2012-01-18 14:01:30 UTC
Review of attachment 205467 [details] [review]:

::: gtk/gtkapplication.c
@@ +207,3 @@
+      /* keep trying until we get a working name... */
+      for (i = 0; *id == 0; i++)
+        {

Do we need to do something in publish_menu to make sure that the window properties get updated ? Or are there usage restrictions that prevent this from ever happening while the window is 'live' ? If so, a small comment somewhere would be nice
Comment 10 Allison Karlitskaya (desrt) 2012-01-18 14:02:59 UTC
Review of attachment 205468 [details] [review]:

::: src/meta/window.h
@@ +104,1 @@
 

There are two reasons for using 'gtk' here.

First is that we probably should have *some* namespace for these properties on X.  I considered (for probably too long) the various namespaces we could use and after some discussion on IRC the feeling was probably just that I should go with 'gtk' for now and switch to something else later if we can standardise (requiring a lockstep upgrade).  If mutter has API guarantees (does it?) then perhaps we should be more careful about naming these public header APIs than we are about naming the X properties.

Second reason: the DBus protocol is a private feature of GLib and GLib is in the 'org.gtk.' world.  You absolutely have to use GLib in order for any of these calls to have any meaning at all (except perhaps the application id) -- so it's a bit of an advertisement of that fact.
Comment 11 Allison Karlitskaya (desrt) 2012-01-18 14:12:05 UTC
Review of attachment 205467 [details] [review]:

::: gtk/gtkapplication.c
@@ +207,3 @@
+      /* keep trying until we get a working name... */
+      for (i = 0; *id == 0; i++)
+        {

6 properties are in play here and I have some patches coming that will restrict when they can be changed:

 - app id: the app-id is construct-only on the application and it will not
           be possible to change the application after the window is
           realized

 - unique bus name: this will not change as long as the session bus is
                    held open (as it is)

 - application path: ditto (effectively)

 - window path: it's determined here and won't change while realized

 - app menu path: it will not be permitted to change this on the app
                  while the app has any windows associated

 - menubar path: ditto
Comment 12 Colin Walters 2012-01-18 14:17:54 UTC
Review of attachment 205484 [details] [review]:

Only one minor comment; the code size reduction is definitely nice.

::: src/shell-app.c
@@ -188,3 @@
 
-const char *
-shell_app_get_dbus_id (ShellApp *app)

Hm, was that really unused?  git grep thinks so...but I swear something in the JS was using it.  Maybe we removed it.
Comment 13 Allison Karlitskaya (desrt) 2012-01-18 14:24:32 UTC
Review of attachment 205484 [details] [review]:

::: src/shell-app.c
@@ -188,3 @@
 
-const char *
-shell_app_get_dbus_id (ShellApp *app)

I went through more or less the same thing... it may make sense to export (and use this) but then it should probably just be called "application ID".

In general, I think it would be pretty cool if the shell moved toward using the namespace application identifiers, where available, in preference to the wmclass/desktopfile/argv[0] approach.
Comment 14 Allison Karlitskaya (desrt) 2012-01-18 16:03:46 UTC
Some testing confirms that the shell freezes happen for me without my patch applied.
Comment 15 Matthias Clasen 2012-01-18 16:18:15 UTC
Review of attachment 205466 [details] [review]:

ok then
Comment 16 Matthias Clasen 2012-01-18 16:19:12 UTC
Review of attachment 205467 [details] [review]:

ok, getting these rules in a comment somewhere (or even the docs) would be nice, but I understand that there's followup patches to that effect
Comment 17 Allison Karlitskaya (desrt) 2012-01-18 18:39:46 UTC
Comment on attachment 205466 [details] [review]
GApplication: drop support for appmenu/menubars

Attachment 205466 [details] pushed as 54b986d - GApplication: drop support for appmenu/menubars
Comment 18 Allison Karlitskaya (desrt) 2012-01-18 18:40:25 UTC
Comment on attachment 205467 [details] [review]
move menus over from GLib

Attachment 205467 [details] pushed as 60317cb - move menus over from GLib
Comment 19 Allison Karlitskaya (desrt) 2012-01-18 18:42:45 UTC
(In reply to comment #16)
> nice, but I understand that there's followup patches to that effect

bug 668203 for that.
Comment 20 Colin Walters 2012-01-18 22:06:10 UTC
Review of attachment 205468 [details] [review]:

Looks fine.
Comment 21 Colin Walters 2012-01-18 22:06:49 UTC
Review of attachment 205484 [details] [review]:

Looks fine then.
Comment 22 Allison Karlitskaya (desrt) 2012-01-18 22:26:35 UTC
Attachment 205468 [details] pushed as 1772a2a - adjust to new Gtk properties for app menu