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 774784 - Failed to get desktop session proxy is not an error!
Failed to get desktop session proxy is not an error!
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-21 12:52 UTC by Christian Lanig
Modified: 2017-07-13 00:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Wall of pointless Warnings. (81.14 KB, image/png)
2016-11-21 12:52 UTC, Christian Lanig
  Details
GtkApplication: Lack of optional components shouldn't warn (1.79 KB, patch)
2016-12-15 22:14 UTC, Philip Chimento
committed Details | Review

Description Christian Lanig 2016-11-21 12:52:45 UTC
Created attachment 340418 [details]
Wall of pointless Warnings.

Trying to connect to the dbus session proxy gtk checks for an error in https://github.com/GNOME/gtk/blob/master/gtk/gtkapplication-dbus.c#L195
But the only implemented DEs are Xfce and Gnome. For other DEs a failing connection is not an error. This results in unsuitable warnings distracting the user of pretty much every gtk+ application resulting in numerous misleading bug reports in the applications' bug trackers.

Gtk-WARNING **: Failed to get the GNOME session proxy: The name org.gnome.SessionManager is not owned

Gtk-WARNING **: Failed to get the Xfce session proxy: The name org.xfce.SessionManager is not owned


The same may suit for
https://github.com/GNOME/gtk/blob/master/gtk/gtkapplication-dbus.c#L332
resulting in

Gtk-WARNING **: Failed to get an inhibit portal proxy: The name org.freedesktop.portal.Desktop is not owned
Comment 1 Philip Chimento 2016-12-14 20:52:08 UTC
This also causes gtester test cases to fail when GtkApplication is used inside them, if they are run under a fake session bus as they often are. (Warnings are fatal inside gtester.)

I propose downgrading those messages to g_message() or g_debug() level, I can attach a patch if it's likely to be committed.
Comment 2 Emmanuele Bassi (:ebassi) 2016-12-14 21:14:28 UTC
g_debug() is probably the better option.
Comment 3 Christian Lanig 2016-12-14 23:05:58 UTC
Sounds very reasonable. I agree.
Comment 4 Matthias Clasen 2016-12-15 19:25:36 UTC
sure, I will say one thing though: If you are using a fake session bus for your tests, are you really testing the same thing that your users experiencing ?
Comment 5 Philip Chimento 2016-12-15 22:14:08 UTC
Created attachment 342045 [details] [review]
GtkApplication: Lack of optional components shouldn't warn

The GNOME session manager, the Xfce session manager, and the Inhibit
portal are all not needed for normal operation of GTK, and it's expected
that they're not present on some systems. So we should not log warnings
if they are not found.
Comment 6 Philip Chimento 2016-12-15 22:16:19 UTC
(In reply to Matthias Clasen from comment #4)
> sure, I will say one thing though: If you are using a fake session bus for
> your tests, are you really testing the same thing that your users
> experiencing ?

Well, no :-) I would say if these were installed-tests then it would indeed be wrong, but on a headless autobuilder with uninstalled tests you pretty much need the fake bus.
Comment 7 Emmanuele Bassi (:ebassi) 2016-12-16 18:22:38 UTC
Review of attachment 342045 [details] [review]:

I'd probably make it more explicit in the commit message that the actual issue is that we cannot run GTK apps under a fake session for testing.
Comment 8 Philip Chimento 2016-12-18 04:19:41 UTC
OK to commit to master and gtk-3-22 with an updated commit message, then?
Comment 9 Matthias Clasen 2016-12-19 16:01:50 UTC
Please do, thanks
Comment 10 Philip Chimento 2016-12-19 23:25:35 UTC
Attachment 342045 [details] pushed as 76e5fd4 - GtkApplication: Lack of optional components shouldn't warn