From 083caf47d89d5ce382d2aba5bef05b3e210f06ac 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 like that of xfdesktop and xfce4-panel --- xfsettingsd/main.c | 6 ++++++ xfsettingsd/workspaces.c | 10 +++++++--- xfsettingsd/workspaces.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xfsettingsd/main.c b/xfsettingsd/main.c index ccb19ac2..6af572a2 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,10 @@ 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); + if (opt_disable_wm_check) + { + xfce_workspaces_helper_disable_wm_check(); + } 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..d3a8e0c8 100644 --- a/xfsettingsd/workspaces.c +++ b/xfsettingsd/workspaces.c @@ -76,7 +76,7 @@ struct _XfceWorkspacesHelperClass GObjectClass parent; }; - +static gboolean global_disable_wm_check = FALSE; #ifdef GDK_WINDOWING_X11 static Atom atom_net_number_of_desktops = 0; @@ -99,7 +99,11 @@ WaitForWM; G_DEFINE_TYPE(XfceWorkspacesHelper, xfce_workspaces_helper, G_TYPE_OBJECT) - +void +xfce_workspaces_helper_disable_wm_check(void) +{ + global_disable_wm_check = TRUE; +} static void xfce_workspaces_helper_class_init(XfceWorkspacesHelperClass *klass) @@ -476,7 +480,7 @@ xfce_workspaces_helper_set_names (XfceWorkspacesHelper *helper, guint i; gchar **atom_names; - if (!disable_wm_check) + if (!disable_wm_check && !global_disable_wm_check) { /* setup data for wm checking */ wfwm = g_slice_new0 (WaitForWM); diff --git a/xfsettingsd/workspaces.h b/xfsettingsd/workspaces.h index 4f8cfc68..0f537491 100644 --- a/xfsettingsd/workspaces.h +++ b/xfsettingsd/workspaces.h @@ -30,6 +30,7 @@ typedef struct _XfceWorkspacesHelper XfceWorkspacesHelper; typedef struct _XfceWorkspacesHelperClass XfceWorkspacesHelperClass; GType xfce_workspaces_helper_get_type(void) G_GNUC_CONST; +void xfce_workspaces_helper_disable_wm_check(void); G_END_DECLS