! 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 !
xfwm4 loses settings for random screens in multi screen setup
Status:
RESOLVED: INVALID

Comments

Description John Feuerstein 2011-06-25 17:31:49 CEST
Created attachment 3753 
reload all screen settings after init

I'm running a 3 screen setup (no Xinerama, no Twinview, or similar) with no
login manager. Starting XFCE4 using "startxfce4" from console sometimes results
in missing window and GTK theme settings on random screens.

I was yet unable to track this down: initSettings() is correctly called for every screen and returns without errors, but somewhere after this the settings for e.g. screen 0 are lost.

Note that I'm not using compositing (while it is supported here).

The attached patch fixes it for me.

Please let me know how to debug this :-)
Comment 1 John Feuerstein 2011-06-26 20:28:06 CEST
I think I've found something:

On startup, xfwm calls initSettings() for every screen, which calls loadSettings(), which calls loadTheme().

loadTheme() does the following to load the UI style:

    while (ui_part[i] && ui_state[i])
    {
        gchar *color;

        color = getUIStyle  (widget, ui_part[i], ui_state[i]);
        setStringValue (rc[i].option, color, rc);
        g_free (color);
        ++i;
    }

getUIStyle() then asks GTK for the widget style:

    style = gtk_rc_get_style (win);

which returns the style, i.e. if (!style) is not entered.

However, this style is not always the configured style. I've seen that it returns the default style for screen 0, screen 1 and then suddenly it starts to return the correct style for the following screens.
I've never seen it return the default style for screen 2 or higher, I guess this is because enough time has passed until initSettings() is called for these higher-numbered screens.

The fact that it sometimes returns the default style for multiple screens makes me doubt that it's gtk_rc_get_style()'s fault (i.e. due to GTK+ internal caching of GtkStyles[1]).

It appears to be a problem related to xfwm4 "starting too fast". Perhaps xfconf/xfsettingsd or some other early dependency is not ready yet (looking at the default session, xfsettingsd and xfwm4 start in parallel).

I've checked the selection owner of each screen's _XSETTINGS_Sn atom (n = screen number) within the loop before calling initSettings() on the screen. It was set in each case even though gtk_rc_get_style() ended up with the default style, so this does not work as an indicator xfwm4 should wait for.

Here is an example run after adding DBG ("%s[%s]=%s", name, state, s); before the final return in getUIStyle():


[SCREEN 0]
DBG[settings.c:413] loadTheme(): XXX getting UI colors:
DBG[ui_style.c:203] getUIStyle(): fg[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#000000000000
DBG[settings.c:423] loadTheme(): XXX getting UI colors complete
DBG[settings.c:425] loadTheme(): XXX theme=Defcon-IV
DBG[parserc.c:237] getThemeDir(): XXX theme=Defcon-IV file=themerc
DBG[parserc.c:51] parseRc(): XXX file=themerc dir=/usr/share/themes/Defcon-IV/xfwm4
DBG[parserc.c:69] parseRc(): XXX fopen(/usr/share/themes/Defcon-IV/xfwm4/themerc)


[SCREEN 1]
DBG[settings.c:413] loadTheme(): XXX getting UI colors:
DBG[ui_style.c:203] getUIStyle(): fg[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[selected]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[insensitive]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): light[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#000000000000
DBG[settings.c:423] loadTheme(): XXX getting UI colors complete
DBG[settings.c:425] loadTheme(): XXX theme=Defcon-IV
DBG[parserc.c:237] getThemeDir(): XXX theme=Defcon-IV file=themerc
DBG[parserc.c:51] parseRc(): XXX file=themerc dir=/usr/share/themes/Defcon-IV/xfwm4
DBG[parserc.c:69] parseRc(): XXX fopen(/usr/share/themes/Defcon-IV/xfwm4/themerc)


[SCREEN 2]
DBG[settings.c:413] loadTheme(): XXX getting UI colors:
DBG[ui_style.c:203] getUIStyle(): fg[selected]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): fg[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#4e4e7676a8a8
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[selected]=#8686ababd9d9
DBG[ui_style.c:203] getUIStyle(): light[selected]=#d2d2e3e3f7f7
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#4e4e7676a8a8
DBG[ui_style.c:203] getUIStyle(): mid[selected]=#9090acaccfcf
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[normal]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#d4d4d2d2d1d1
DBG[ui_style.c:203] getUIStyle(): bg[insensitive]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[insensitive]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[insensitive]=#d4d4d2d2d1d1
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[normal]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#d4d4d2d2d1d1
DBG[settings.c:423] loadTheme(): XXX getting UI colors complete
DBG[settings.c:425] loadTheme(): XXX theme=Defcon-IV
DBG[parserc.c:237] getThemeDir(): XXX theme=Defcon-IV file=themerc
DBG[parserc.c:51] parseRc(): XXX file=themerc dir=/usr/share/themes/Defcon-IV/xfwm4
DBG[parserc.c:69] parseRc(): XXX fopen(/usr/share/themes/Defcon-IV/xfwm4/themerc)


[SCREEN 3]
DBG[settings.c:413] loadTheme(): XXX getting UI colors:
DBG[ui_style.c:203] getUIStyle(): fg[selected]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): fg[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#4e4e7676a8a8
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): fg[normal]=#000000000000
DBG[ui_style.c:203] getUIStyle(): bg[selected]=#8686ababd9d9
DBG[ui_style.c:203] getUIStyle(): light[selected]=#d2d2e3e3f7f7
DBG[ui_style.c:203] getUIStyle(): dark[selected]=#4e4e7676a8a8
DBG[ui_style.c:203] getUIStyle(): mid[selected]=#9090acaccfcf
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[normal]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#d4d4d2d2d1d1
DBG[ui_style.c:203] getUIStyle(): bg[insensitive]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[insensitive]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[insensitive]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[insensitive]=#d4d4d2d2d1d1
DBG[ui_style.c:203] getUIStyle(): bg[normal]=#ededececebeb
DBG[ui_style.c:203] getUIStyle(): light[normal]=#ffffffffffff
DBG[ui_style.c:203] getUIStyle(): dark[normal]=#a9a9a5a5a2a2
DBG[ui_style.c:203] getUIStyle(): mid[normal]=#d4d4d2d2d1d1
DBG[settings.c:423] loadTheme(): XXX getting UI colors complete
DBG[settings.c:425] loadTheme(): XXX theme=Defcon-IV
DBG[parserc.c:237] getThemeDir(): XXX theme=Defcon-IV file=themerc
DBG[parserc.c:51] parseRc(): XXX file=themerc dir=/usr/share/themes/Defcon-IV/xfwm4
DBG[parserc.c:69] parseRc(): XXX fopen(/usr/share/themes/Defcon-IV/xfwm4/themerc)


As you can see, suddenly with [SCREEN 2] it starts to find the configured color values. And it happens with other themes too.

Any idea what could cause this?


[1] http://git.gnome.org/browse/gtk+/tree/gtk/gtkrc.c#n1460

Bug #7770

Reported by:
John Feuerstein
Reported on: 2011-06-25
Last modified on: 2020-05-21

People

Assignee:
Olivier Fourdan
CC List:
2 users

Version

Attachments

reload all screen settings after init (439 bytes, patch)
2011-06-25 17:31 CEST , John Feuerstein
no flags

Additional information