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 688499 - work towards not linking against gtk
work towards not linking against gtk
Status: RESOLVED OBSOLETE
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on: 688497
Blocks: 688757
 
 
Reported: 2012-11-16 23:32 UTC by Matthias Clasen
Modified: 2021-06-14 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make the fallback end session dialog a separate program (88.02 KB, patch)
2012-11-23 07:55 UTC, Matthias Clasen
none Details | Review
Make the fallback end session dialog a separate program (86.76 KB, patch)
2012-11-23 08:21 UTC, Matthias Clasen
none Details | Review
drop the user of eggdesktopfile (18.74 KB, patch)
2012-11-23 08:33 UTC, Matthias Clasen
none Details | Review
drop use of eggdesktopfile (19.05 KB, patch)
2012-11-23 18:40 UTC, Matthias Clasen
reviewed Details | Review
Drop use of EggDesktopfile in GsmAutostartApp (29.23 KB, patch)
2012-12-04 15:01 UTC, Ray Strode [halfline]
committed Details | Review

Description Matthias Clasen 2012-11-16 23:32:09 UTC
It is not really right for a session manager to link against a toolkit.
The http://git.gnome.org/browse/gnome-session/log/?h=wip/cleanups branch has a bunch of work towards dropping that. Among other things, it:

- drops the fallback warning dialog

- uses zenity for init warnings

- turn the fail whale into a standalone binary

- turn the fallback inhibit+logout dialogs into a standalone binary that implements the EndSessionDialog dbus api

- ports GsmAutostartApp to GDesktopAppInfo
Comment 1 Colin Walters 2012-11-20 02:12:19 UTC
"It is not really right" isn't a really good motivation.  Not saying it's wrong, but...

One thing I think you're losing here is correct focus stealing timestamp handling, where we pass around the event timestamp down into startup-notification.  If we link with GTK+, that's provided GdkAppLaunchContext.

It probably doesn't matter too much...but if we were to say add a button "Restore session" somewhere, which caused gnome-session to launch saved apps, we should be passing the timestamp of that click down to the apps.

Also, it looks like your spawn handling is doing G_SPAWN_DO_NOT_REAP_CHILD, but is not installing a child watch, so you'll collect zombies.

Those are the two things I noticed in a quick look at the top of the patch stack.  I can look in more detail later.
Comment 2 Matthias Clasen 2012-11-20 02:22:02 UTC
right, so the motivations are:

- detangle the gsm-manager state machine by moving the fallback code behind the same dbus api as the shell 
- get the fallback code out of process, so we can easily drop it
- make it easier to test ui code like the fail whale by making it standalone
- gain (a little bit) of login speed (if we get to the point where w avoid gtk initialization)
Comment 3 Bastien Nocera 2012-11-21 21:35:44 UTC
Most of the changes looks fine to me.

But I'd like to start using GnomeIdleMonitor (bug 688841). gnome-desktop currently requires GTK+ for the bg crossfade code though, so we'd need to move the bg code somewhere else, then I can use gnome-desktop without GTK+, and make gnome-session use GnomeIdleMonitor. Clear? :)
Comment 4 Matthias Clasen 2012-11-22 02:48:39 UTC
Yes, very clear :-)

To reiterate, I'm not super-concerned about dropping the gtk dependency in the short term. In the medium-term, background rendering moves to the shell.
Comment 5 Matthias Clasen 2012-11-23 07:54:36 UTC
I've pushed most of the easy patches; the remaining interesting ones are below
Comment 6 Matthias Clasen 2012-11-23 07:55:34 UTC
Created attachment 229699 [details] [review]
Make the fallback end session dialog a separate program
Comment 7 Matthias Clasen 2012-11-23 08:21:48 UTC
Created attachment 229701 [details] [review]
Make the fallback end session dialog a separate program
Comment 8 Matthias Clasen 2012-11-23 08:33:47 UTC
Created attachment 229702 [details] [review]
drop the user of eggdesktopfile
Comment 9 Matthias Clasen 2012-11-23 18:40:12 UTC
Created attachment 229739 [details] [review]
drop use of eggdesktopfile
Comment 10 Bastien Nocera 2012-11-23 23:09:02 UTC
Review of attachment 229701 [details] [review]:

Any chance you could split that up in 2 patches, one adding the new program, and another converting to use that new tool.
Comment 11 Matthias Clasen 2012-11-24 19:43:42 UTC
(In reply to comment #10)
> Review of attachment 229701 [details] [review]:
> 
> Any chance you could split that up in 2 patches, one adding the new program,
> and another converting to use that new tool.

I can try - it will require some gymnastics, because I am reusing some source files and just move them over from being compiled into gnome-session to being compiled into gnome-session-failed.
Comment 12 Ray Strode [halfline] 2012-12-04 14:34:26 UTC
Review of attachment 229739 [details] [review]:

Seems to work with the below changes. I'll post an updated patch.

::: gnome-session/gsm-autostart-app.c
@@ +138,3 @@
         current_desktop = gsm_util_get_current_desktop ();
+        g_desktop_app_info_set_desktop_env (current_desktop);
+        if (!g_app_info_should_show (G_APP_INFO (priv->app_info))) {

should_show isn't right here. A lot of the desktop files are NoDisplay, also it doesn't take current_desktop into account, but that's more minor.

Should be current_desktop != NULL && g_desktop_app_info_get_show_in (..., current_desktop)

@@ +141,2 @@
                 if (current_desktop) {
                         g_debug ("app %s not installed or not for %s",

TryExec is checked when the AppInfo is created, so no installed isn't a potential failure case.

@@ +698,3 @@
+        app->priv->app_info = g_desktop_app_info_new_from_filename (desktop_filename);
+        if (app->priv->app_info == NULL) {
+                g_warning ("Could not parse desktop file %s", desktop_filename);

this could fail for parse error or TryExec not finding the executable now.

@@ +1033,3 @@
         g_assert (startup_id != NULL);
 
         env[0] = g_strdup_printf ("DESKTOP_AUTOSTART_ID=%s", startup_id);

this is unused now and should get dropped

@@ +1054,1 @@
         g_free (env[0]);

this line can be dropped

@@ +1272,3 @@
+        provides_str = g_desktop_app_info_get_string (aapp->priv->app_info,
+                                                      GSM_AUTOSTART_APP_PROVIDES_KEY);
+

need to handle null provides_str here
Comment 13 Ray Strode [halfline] 2012-12-04 15:01:05 UTC
Created attachment 230665 [details] [review]
Drop use of EggDesktopfile in GsmAutostartApp

This requires a few additions to the GDesktopAppInfo API,
which have landed in GLib 2.35.3.
Comment 14 Matthias Clasen 2012-12-05 01:08:09 UTC
Those changes look good to me.
Comment 15 Ray Strode [halfline] 2013-02-19 18:46:01 UTC
Comment on attachment 230665 [details] [review]
Drop use of EggDesktopfile in GsmAutostartApp

Attachment 230665 [details] pushed as a0741c8 - Drop use of EggDesktopfile in GsmAutostartApp
Comment 16 Michael Catanzaro 2016-09-13 21:33:06 UTC
Review of attachment 229701 [details] [review]:

This patch is pretty old, do we still want it?
Comment 17 Bastien Nocera 2016-09-13 22:11:12 UTC
Review of attachment 229701 [details] [review]:

We'd still want something close to it, if it still applies.
Comment 18 André Klapper 2021-06-14 18:21:45 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of gnome-session, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-session/-/issues/

Thank you for your understanding and your help.