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 527903 - port libslab to GIO
port libslab to GIO
Status: RESOLVED FIXED
Product: gnome-main-menu
Classification: Other
Component: libslab
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME main menu maintainers
GNOME main menu maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-13 17:33 UTC by André Klapper
Modified: 2008-09-07 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
01 - port to GIO (41.31 KB, patch)
2008-07-28 12:56 UTC, Cosimo Cecchi
committed Details | Review
02 - remove all the copy-paste stuff, bump reqs (186.20 KB, patch)
2008-07-28 12:57 UTC, Cosimo Cecchi
committed Details | Review

Description André Klapper 2008-04-13 17:33:55 UTC
see http://live.gnome.org/GioPort .

complete list is:

$:andre\> grep -l -R gnome_vfs .
./libslab/document-tile.c
./libslab/app-shell.c
./libslab/slab-gnome-util.c
./libslab/bookmark-agent.c
./libslab/directory-tile.c
./libslab/egg-recent-model.c
./libslab/egg-recent-item.c
./libslab/recent-files.c
Comment 1 André Klapper 2008-06-05 15:48:12 UTC
according to sreeves planned after the release of opensuse 11
Comment 2 André Klapper 2008-06-29 10:49:45 UTC
*ping* now that suse 11 is out
Comment 3 Lincoln de Sousa 2008-07-11 23:01:32 UTC
Starting to work on this issue right now. (Is there someone already working on it?)
Comment 4 André Klapper 2008-07-13 10:02:21 UTC
just start, i guess that really nobody's working on this... thanks in advance!
Comment 5 Cosimo Cecchi 2008-07-28 12:39:22 UTC
I made series of patches for this, will attach in a short while.
Comment 6 Cosimo Cecchi 2008-07-28 12:56:19 UTC
Created attachment 115425 [details] [review]
01 - port to GIO
Comment 7 Cosimo Cecchi 2008-07-28 12:57:35 UTC
Created attachment 115426 [details] [review]
02 - remove all the copy-paste stuff, bump reqs
Comment 8 Cosimo Cecchi 2008-07-28 13:06:13 UTC
The issue here is that for some reason, gnome-main-menu contains a lot of #ifdefs for glib and gtk+ versions, many c/p files from glib and egg and two parallels implementations of recent files: both with EggRecentModel&friends and with GtkRecentManager.

My first patch removes gnome-vfs from main-menu and libslab, but doesn't touch configure.in and leaves the Egg/ifdef stuff in place.
The second patch, to apply on top of the first one, actually removes all the cruft in g-m-m, bump gtk+ and glib requisites and completely drops gnome-vfs.

Another issue is that we won't be able to drop gnome-vfs until we completely remove the Egg stuff, as that files require it as a dependency, so I propose the second way as the best one for actually making the g-m-m codebase maintainable and up-to-date.

Last thing: if a req for GTK+ 2.13.x is too hard, we can avoid that just by adding two ifdefs when creating the GdkAppLaunchContext.
Comment 9 André Klapper 2008-08-10 12:56:24 UTC
sreeves: ping. please review.
Comment 10 Scott Reeves 2008-08-15 20:02:35 UTC
Nice, thanks for the work on this.  As far as the #ifdefs and pasted code, that was needed for features we wanted in SLED before they were officially released in GNOME. I agree it's a good idea to clean all that up and just depend on the latest versions. A dependency on GTK+ 2.13.x should be no problem.

Let me go through this patch ...
Comment 11 Federico Mena Quintero 2008-08-21 22:27:03 UTC
Awesome patch, Cosimo, thanks! :)

A few comments:

* From bookmark-agent.c:

+	if (priv->store_monitor) {
+		g_file_monitor_cancel (priv->store_monitor);
+		g_object_unref (priv->store_monitor);
+	}

Do we need to disconnect from the monitor's "changed" signal as well?
From a quick reading of the code in gfilemonitor.c, nothing guarantees
that doing g_file_monitor_cancel() will prevent a pending signal from
being emitted (emit_in_idle() and emit_cb() don't check for
cancellation).

* From bookmark-agent.c:

+	if (priv->user_store_monitor) {
+		g_file_monitor_cancel (priv->user_store_monitor);
+		g_object_unref (priv->store_monitor);
+	}

Cut&paste typo; ->store_monitor should be ->user_store_monitor.

* From directory-tile.c:

+		gdk_app_launch_context_set_screen (launch_context,
+						   gtk_widget_get_screen (GTK_WIDGET (tile)));

Sweet!  I'm sure we had a bug about not launching stuff on the correct
screen somewhere...


Please go ahead and commit after making those changes.  Also, could you please tag svn with "BEFORE_GIO_PORT" or something like that?

Thanks again :)
Comment 12 Cosimo Cecchi 2008-08-22 09:56:45 UTC
(In reply to comment #11)

> Do we need to disconnect from the monitor's "changed" signal as well?
> From a quick reading of the code in gfilemonitor.c, nothing guarantees
> that doing g_file_monitor_cancel() will prevent a pending signal from
> being emitted (emit_in_idle() and emit_cb() don't check for
> cancellation).

Yes, don't know if that's required but it shouldn't harm anyway...fixed.

> * From bookmark-agent.c:
> 
> +       if (priv->user_store_monitor) {
> +               g_file_monitor_cancel (priv->user_store_monitor);
> +               g_object_unref (priv->store_monitor);
> +       }
> 
> Cut&paste typo; ->store_monitor should be ->user_store_monitor.

Fixed.
  
> Please go ahead and commit after making those changes.  Also, could you please
> tag svn with "BEFORE_GIO_PORT" or something like that?
> 
> Thanks again :)

You're welcome ;)
Tagged and committed to trunk, closing as FIXED.
Comment 13 Andreas Proschofsky 2008-08-22 11:03:41 UTC
The nautilus extension isn't ported yet:

mv -f .deps/main-menu.Tpo .deps/main-menu.Plo
nautilus-main-menu.c:37:41: error: libgnomevfs/gnome-vfs-utils.h: No such file or directory
make[2]: *** [nautilus-main-menu.lo] Error 1
Comment 14 Cosimo Cecchi 2008-08-22 12:40:25 UTC
Good catch. This was trivial, as the nautilus extension included the gnome-vfs header without really using it, so I just fixed the includes in trunk (while I was at it, I also fixed a warning due to a missing libnautilus-extension include and I replaced gtk/gtkfoo.h includes with a single gtk/gtk.h as for the new GTK+ policy).

2008-08-22  Cosimo Cecchi  <cosimoc@gnome.org>

	* nautilus-main-menu/main-menu.c:
	* nautilus-main-menu/nautilus-main-menu.c:
	Leftover from the GIO transition: fix includes in the nautilus
	extension.
Comment 15 Andreas Proschofsky 2008-08-22 12:49:59 UTC
Thanks a lot, builds perfectly fine now :)
Comment 16 Federico Mena Quintero 2008-08-22 19:06:03 UTC
Fantastic.  Thanks, Cosimo :)
Comment 17 Andreas Proschofsky 2008-08-22 20:33:58 UTC
(In reply to comment #15)
> Thanks a lot, builds perfectly fine now :)
> 

Unfortunately it doesn't work for me, when I try to start it immediately crashes and I get the following in .xsession-errors:

gnome-session[2326]: DEBUG(+): GsmXsmpServer: accept_ice_connection()
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Setting up new connection
gnome-session[2326]: DEBUG(+): GsmXSMPClient: New client '0x808a458 []'
gnome-session[2326]: DEBUG(+): GsmStore: Adding object id /org/gnome/SessionManager/Client20 to store
gnome-session[2326]: DEBUG(+): GsmManager: Client added: /org/gnome/SessionManager/Client20
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Initializing client 0x808a458 []
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Client '0x808a458 []' received RegisterClient(NULL)
gnome-session[2326]: DEBUG(+): GsmManager: Adding new client 10d615c0fabce5a9e4121943694547648400000023260042 to session
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Sending RegisterClientReply to '0x808a458 [10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Sending initial SaveYourself
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   CurrentDirectory = '/'
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   ProcessID = '15588'
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   Program = 'slab'
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [slab 10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   CloneCommand = 'slab' 
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [slab 10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   RestartCommand = 'slab' '--sm-client-id' '10d615c0fabce5a9e4121943694547648400000023260042' '--screen' '0' 
gnome-session[2326]: DEBUG(+): GsmXSMPClient: Set properties from client '0x808a458 [slab 10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmXSMPClient:   UserID = 'suka'

(gnome-panel:2390): Bonobo-WARNING **: add_listener failed 'Unknown CORBA exception id: 'IDL:omg.org/CORBA/COMM_FAILURE:1.0''

** (gnome-panel:2390): WARNING **: panel-applet-frame.c:1377: failed to load applet OAFIID:GNOME_MainMenu (cannot get popup component):
Error checking error; no exception
gnome-session[2326]: DEBUG(+): GsmXsmpServer: ice_io_error_handler (0x80e2658)
gnome-session[2326]: DEBUG(+): GsmXSMPClient: IceProcessMessagesIOError on '0x808a458 [slab 10d615c0fabce5a9e4121943694547648400000023260042]'
gnome-session[2326]: DEBUG(+): GsmManager: disconnect client
gnome-session[2326]: DEBUG(+): GsmManager: disconnect client: /org/gnome/SessionManager/Client20
gnome-session[2326]: DEBUG(+): GsmManager: no application associated with client, not restarting application
gnome-session[2326]: DEBUG(+): GsmStore: Unreffing object: 0x808a458
gnome-session[2326]: DEBUG(+): GsmManager: Client removed: /org/gnome/SessionManager/Client20
gnome-session[2326]: DEBUG(+): GsmClient: disposing /org/gnome/SessionManager/Client20
gnome-session[2326]: DEBUG(+): GsmXSMPClient: xsmp_finalize (0x808a458 [slab 10d615c0fabce5a9e4121943694547648400000023260042])

Unfortunately I have no clue how to better debug panel applets ;)
Comment 18 Cosimo Cecchi 2008-09-07 12:13:12 UTC
I finally found the time to test again trunk in a openSUSE factory installation and I realized that the GIO port introduced a regression which would cause gnome-main-menu not to start up properly. I now fixed this in trunk and tested the basic functionality: it should work fine.
Closing again as FIXED. For other regressions please file new bugs here in bugzilla (and CC me if you like).

2008-09-07  Cosimo Cecchi  <cosimoc@gnome.org>

	* main-menu/src/main-menu-ui.c: (main_menu_ui_new),
	(get_recently_used_store_filename),
	(setup_recently_used_throttle_timeout),
	(setup_recently_used_store_monitor),
	(update_recently_used_sections):
	Call update_recently_used_sections () in an idle when starting
	up the program (this was a regression from the GIO porting, as
	we were using this very same mechanism before).