! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
"Unknown option --display" and xfsettingsd doesn't start on session login.
Status:
RESOLVED: FIXED
Product:
Xfce4-settings
Component:
Xfsettingsd

Comments

Description Laurento Frittella 2014-09-23 08:55:44 CEST
After upgrading to the latest version 4.11.3 my session starts in an un-themed flavour and my .xsession-errors contains:

xfsettingsd: Unknown option --display.
Type 'xfsettingsd --help' for usage.

After that I have a .desktop file entry in application started during session login that spawns xfsettingsd without any arg and the theme is finally loaded, but this transition between un-themed and themed session is pretty annoying.

I'm not sure which process is trying to start xfsettingsd with the --display option but I guess it's related with how xfce4-session works.

I tried replacing the xfsettingsd binary with a shell script that simply wraps the actual command and drops the --display arg and everything works as expected (i.e. the theme is loaded properly without any visible transition).
Comment 1 Laurento Frittella 2014-09-23 19:02:30 CEST
Created attachment 5664 
re-enable gtk_get_option_group()

I didn't dig too much into the code, but reading the diff between 4.11.2 and 4.11.3 I found both gtk_get_option_group() and gtk_init() were commented out in main.c

The attached patch enables the gtk_get_option_group() again but keeping the gtk_init() out.

It solves the described issues for me.
Comment 2 Eric Koegel editbugs 2014-09-24 18:39:43 CEST
Good catch. I forgot xfsm does that so that applications end up on the
correct monitor. I was trying to avoid the gtk_get_option_group call because
it calls gtk_init on our behalf before xfsettingsd can fork which causes
issues on Ubuntu (possibly because they load gtk modules for stuff they
patch out of gtk).

https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-init
"Note that there are some alternative ways to initialize GTK+: if you are
calling gtk_parse_args(), gtk_init_check(), gtk_init_with_args() or
g_option_context_parse() with the option group returned by
gtk_get_option_group(), you don't have to call gtk_init()."

Another option is to use:
g_option_context_set_ignore_unknown_options(context, TRUE); to ignore the
--display option rather than make it fatal.
Comment 3 Eric Koegel editbugs 2014-09-25 17:13:08 CEST
Created attachment 5665 
Fix for --display being fatal

Proposed patch. If gtk_init doesn't cause any issues with forking (and it's just dbus) then the first patch would be better.
Comment 4 Alistair Buxton 2014-10-21 03:43:16 CEST
The gtk_init() before fork() problem happens because Ubuntu loads modules at gtk_init() which open the dbus (specifically dbusmenu). After the fork, Gtk will try to reuse that dbus handle, but it's no longer valid due to being owned by the previous process. This means all dbus calls subsequently made by the program will hang.

In general this is just one way that forking after gtk_init() can go horribly wrong, so it should be avoided whenever possible; as such I would recommend going with the second patch.
Comment 5 Sean Davis editbugs 2014-10-21 12:02:31 CEST
Verified the second patch, committed it here: http://git.xfce.org/xfce/xfce4-settings/commit/?id=178f429abeba73643fe6ef794a07b78f3b40e5cf
Comment 6 Simon Steinbeiss editbugs 2014-10-21 12:03:12 CEST
Marking as fixed.
Comment 7 Klaus Kusche 2014-10-22 14:12:04 CEST
Please label as 4.11.4 to allow distributions who provided 4.11.3 
to distribute a fixed version.
Comment 8 Simon Steinbeiss editbugs 2014-10-22 14:45:23 CEST
We will release the fix with the next version, however there might still be a few more small issues we wanna take a look at. Meanwhile distributors can always ship the patch with 4.11.3.

Bug #11188

Reported by:
Laurento Frittella
Reported on: 2014-09-23
Last modified on: 2014-10-22

People

Assignee:
Nick Schermer
CC List:
7 users

Version

Version:
4.11.0

Attachments

re-enable gtk_get_option_group() (589 bytes, patch)
2014-09-23 19:02 CEST , Laurento Frittella
no flags
Fix for --display being fatal (1.32 KB, patch)
2014-09-25 17:13 CEST , Eric Koegel
no flags

Additional information