! 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 !
Avoid race with xsettings at startup
Status:
RESOLVED: FIXED
Product:
Xfce4-settings
Component:
Xfsettingsd

Comments

Description Olivier Fourdan editbugs 2019-07-19 14:04:06 CEST
Description:

This is to address bug 15712 which IMHO is a race at startup.

Attaching a couple of patches.
Comment 1 Olivier Fourdan editbugs 2019-07-19 14:15:45 CEST
Created attachment 8787 
[PATCH 1/2] xfsettingsd: Start xsettings prior to complete startup

On startup, different gtk based applications are launched concurently.

If we start xsettings simulatenously, those applications fail to detect
xsettings and ignore the various preferences set via xsettings (themes,
icons, etc.)

Make sure we spawn xsettings prior to declare ourself ready with the
session manager.
Comment 2 Olivier Fourdan editbugs 2019-07-19 14:17:46 CEST
Created attachment 8788 
[PATCH 2/2] xsettings: Grab and sync the X server at startup

Grab the Xserver when declaring ourself the xsettings manager and flush
it prior to ungrab it to make sure all get set for other clients.

The goal is to avoid other X11 clients from reading xsettings until we
are done initializing.
Comment 3 Olivier Fourdan editbugs 2019-07-19 22:04:57 CEST
Created attachment 8791 
[PATCH 1/2] xfsettingsd: Start settings prior to complete startup
Comment 4 Olivier Fourdan editbugs 2019-07-19 22:06:43 CEST
Created attachment 8792 
[PATCH 2/2] xsettings: Grab and sync the X server at startup
Comment 5 Simon Steinbeiss editbugs 2019-07-20 08:55:38 CEST
Thanks, I'll review after the weekend!
Comment 6 Olivier Fourdan editbugs 2019-07-20 17:51:31 CEST
Created attachment 8795 
[PATCH 1/5] Revert "xfsettingsd: Start with the highest priority

This reverts commit 92ddf97f8e8b976c3aa4483e2a5d1a23078ae84f.
Comment 7 Olivier Fourdan editbugs 2019-07-20 17:54:15 CEST
Created attachment 8797 
[PATCH 2/5] xfsettingsd: Start settings prior to complete startup

On startup, different gtk based applications are launched concurently.

If we start the settings simultaneously, those applications fail to detect
the settings and ignore the various preferences set via xsettings (themes,
icons, etc.).

Make sure we spawn all settings prior to declare ourself ready with the
session manager.
Comment 8 Olivier Fourdan editbugs 2019-07-20 17:59:21 CEST
Created attachment 8799 
[PATCH 3/5] xsettings: Grab and sync the X server at startup

Grab the Xserver when declaring ourself the xsettings manager and flush
it prior to ungrab it to make sure all get set for other clients.

The goal is to avoid other X11 clients from reading xsettings until we
are done initializing.
Comment 9 Olivier Fourdan editbugs 2019-07-20 18:00:09 CEST
Created attachment 8800 
[PATCH 4/5] displays: Use current display

Instead of getting the default display again and again.
Comment 10 Olivier Fourdan editbugs 2019-07-20 18:02:13 CEST
Created attachment 8801 
[PATCH 5/5] displays: Sync display when applying config

Currently, the display plugin would flush the display when applying the
configuration.

Use a sync intsead to make sure the request is actually send and
processed by the Xserver.
Comment 11 Olivier Fourdan editbugs 2019-07-21 10:24:20 CEST
Created attachment 8805 
[PATCH 1/4] xfsettingsd: Start settings prior to complete startup

On startup, different gtk based applications are launched concurently.

If we start the settings simultaneously, those applications fail to detect
the settings and ignore the various preferences set via xsettings (themes,
icons, etc.).

Make sure we spawn all settings prior to declare ourself ready with the
session manager.
Comment 12 Olivier Fourdan editbugs 2019-07-21 10:26:48 CEST
Created attachment 8806 
[PATCH 2/4] xsettings: Grab and sync the X server at startup

Grab the Xserver when declaring ourself the xsettings manager and flush
it prior to ungrab it to make sure all get set for other clients.

The goal is to avoid other X11 clients from reading xsettings until we
are done initializing.
Comment 13 Olivier Fourdan editbugs 2019-07-21 10:28:42 CEST
Created attachment 8807 
[PATCH 3/4] displays: Use current display

Instead of getting the default display again and again.
Comment 14 Olivier Fourdan editbugs 2019-07-21 10:30:38 CEST
Created attachment 8808 
[PATCH 4/4] displays: Sync display when applying config

Currently, the display plugin would flush the display when applying the
configuration.

Use a sync instead to make sure the request is actually sent and
processed by the Xserver.
Comment 15 Philip Müller 2019-07-21 13:20:09 CEST
Applied those new 4 patches also on our end. Seems to work.
Comment 16 Git Bot editbugs 2019-07-26 00:15:59 CEST
Olivier Fourdan referenced this bugreport in commit 9c4acaaf5ea233f342b20e709eed25f1be1915ac

xfsettingsd: Start settings prior to complete startup (Bug #15725)

https://git.xfce.org/xfce/xfce4-settings/commit?id=9c4acaaf5ea233f342b20e709eed25f1be1915ac
Comment 17 Git Bot editbugs 2019-07-26 00:16:02 CEST
Olivier Fourdan referenced this bugreport in commit 523abc95d66cf7aa76f76ba0a6f0363b2dd4c51c

xsettings: Grab and sync XServer on startup (Bug #15725)

https://git.xfce.org/xfce/xfce4-settings/commit?id=523abc95d66cf7aa76f76ba0a6f0363b2dd4c51c

Bug #15725

Reported by:
Olivier Fourdan
Reported on: 2019-07-19
Last modified on: 2019-07-31

People

Assignee:
Simon Steinbeiss
CC List:
2 users

Version

Version:
unspecified

Attachments

[PATCH 1/2] xfsettingsd: Start xsettings prior to complete startup (1.91 KB, patch)
2019-07-19 14:15 CEST , Olivier Fourdan
no flags
[PATCH 2/2] xsettings: Grab and sync the X server at startup (1.64 KB, patch)
2019-07-19 14:17 CEST , Olivier Fourdan
no flags
[PATCH 1/2] xfsettingsd: Start settings prior to complete startup (3.00 KB, patch)
2019-07-19 22:04 CEST , Olivier Fourdan
no flags
[PATCH 2/2] xsettings: Grab and sync the X server at startup (1.64 KB, patch)
2019-07-19 22:06 CEST , Olivier Fourdan
no flags
[PATCH 1/5] Revert "xfsettingsd: Start with the highest priority (1.16 KB, patch)
2019-07-20 17:51 CEST , Olivier Fourdan
no flags
[PATCH 2/5] xfsettingsd: Start settings prior to complete startup (2.94 KB, patch)
2019-07-20 17:54 CEST , Olivier Fourdan
no flags
[PATCH 3/5] xsettings: Grab and sync the X server at startup (1.64 KB, patch)
2019-07-20 17:59 CEST , Olivier Fourdan
no flags
[PATCH 4/5] displays: Use current display (5.63 KB, patch)
2019-07-20 18:00 CEST , Olivier Fourdan
no flags
[PATCH 5/5] displays: Sync display when applying config (1.06 KB, patch)
2019-07-20 18:02 CEST , Olivier Fourdan
no flags
[PATCH 1/4] xfsettingsd: Start settings prior to complete startup (3.00 KB, patch)
2019-07-21 10:24 CEST , Olivier Fourdan
no flags
[PATCH 2/4] xsettings: Grab and sync the X server at startup (1.64 KB, patch)
2019-07-21 10:26 CEST , Olivier Fourdan
no flags
[PATCH 3/4] displays: Use current display (5.63 KB, patch)
2019-07-21 10:28 CEST , Olivier Fourdan
no flags
[PATCH 4/4] displays: Sync display when applying config (1.06 KB, patch)
2019-07-21 10:30 CEST , Olivier Fourdan
no flags

Additional information