From 178ed5536e8f978586f62f8306de9f5f23b0902f Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Wed, 6 Nov 2019 12:36:15 -0800 Subject: [PATCH] Add a --disable-wm-check flag (Bug #16128) --- xfsettingsd/main.c | 5 +++++ xfsettingsd/workspaces.c | 15 ++++++++++++--- xfsettingsd/workspaces.h | 3 +++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/xfsettingsd/main.c b/xfsettingsd/main.c index ccb19ac2..82a32b5b 100644 --- a/xfsettingsd/main.c +++ b/xfsettingsd/main.c @@ -75,6 +75,7 @@ static gboolean opt_version = FALSE; static gboolean opt_no_daemon = FALSE; +static gboolean opt_disable_wm_check = FALSE; static gboolean opt_replace = FALSE; static guint owner_id; @@ -100,6 +101,7 @@ static GOptionEntry option_entries[] = { { "version", 'V', 0, G_OPTION_ARG_NONE, &opt_version, N_("Version information"), NULL }, { "no-daemon", 0, 0, G_OPTION_ARG_NONE, &opt_no_daemon, N_("Do not fork to the background"), NULL }, + { "disable-wm-check", 'D', 0, G_OPTION_ARG_NONE, &opt_disable_wm_check, N_("Do not wait for a window manager on startup"), NULL }, { "replace", 0, 0, G_OPTION_ARG_NONE, &opt_replace, N_("Replace running xsettings daemon (if any)"), NULL }, { NULL } }; @@ -139,6 +141,9 @@ on_name_acquired (GDBusConnection *connection, s_data->accessibility_helper = g_object_new (XFCE_TYPE_ACCESSIBILITY_HELPER, NULL); s_data->shortcuts_helper = g_object_new (XFCE_TYPE_KEYBOARD_SHORTCUTS_HELPER, NULL); s_data->keyboard_layout_helper = g_object_new (XFCE_TYPE_KEYBOARD_LAYOUT_HELPER, NULL); +#ifdef GDK_WINDOWING_X11 + xfce_workspaces_helper_disable_wm_check (opt_disable_wm_check); +#endif s_data->workspaces_helper = g_object_new (XFCE_TYPE_WORKSPACES_HELPER, NULL); s_data->gtk_decorations_helper = g_object_new (XFCE_TYPE_DECORATIONS_HELPER, NULL); diff --git a/xfsettingsd/workspaces.c b/xfsettingsd/workspaces.c index d9121063..8bd3dbf8 100644 --- a/xfsettingsd/workspaces.c +++ b/xfsettingsd/workspaces.c @@ -76,11 +76,10 @@ struct _XfceWorkspacesHelperClass GObjectClass parent; }; - - #ifdef GDK_WINDOWING_X11 static Atom atom_net_number_of_desktops = 0; static Atom atom_net_desktop_names = 0; +static gboolean xfsettingsd_disable_wm_check = FALSE; typedef struct { @@ -476,7 +475,7 @@ xfce_workspaces_helper_set_names (XfceWorkspacesHelper *helper, guint i; gchar **atom_names; - if (!disable_wm_check) + if (!disable_wm_check && !xfsettingsd_disable_wm_check) { /* setup data for wm checking */ wfwm = g_slice_new0 (WaitForWM); @@ -592,3 +591,13 @@ xfce_workspaces_helper_prop_changed (XfconfChannel *channel, xfce_workspaces_helper_set_names (helper, TRUE); } } + + + +#ifdef GDK_WINDOWING_X11 +void +xfce_workspaces_helper_disable_wm_check (gboolean disable_wm_check) +{ + xfsettingsd_disable_wm_check = disable_wm_check; +} +#endif diff --git a/xfsettingsd/workspaces.h b/xfsettingsd/workspaces.h index 4f8cfc68..38f7e15a 100644 --- a/xfsettingsd/workspaces.h +++ b/xfsettingsd/workspaces.h @@ -30,6 +30,9 @@ typedef struct _XfceWorkspacesHelper XfceWorkspacesHelper; typedef struct _XfceWorkspacesHelperClass XfceWorkspacesHelperClass; GType xfce_workspaces_helper_get_type(void) G_GNUC_CONST; +#ifdef GDK_WINDOWING_X11 +void xfce_workspaces_helper_disable_wm_check (gboolean disable_wm_check); +#endif G_END_DECLS -- 2.20.1