summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2024-03-29 14:21:57 -0400
committerlukefromdc <[email protected]>2024-04-04 01:13:49 -0400
commit859266e85160e814134773adb5b92ec31f7d42ba (patch)
tree6dd938a515a1a0d6bd746d6db6d78755160550e0
parenteb19897e25203a9f7d6e6483e014e9454b737d84 (diff)
downloadmate-control-center-dev-wayland-controls.tar.bz2
mate-control-center-dev-wayland-controls.tar.xz
Appearance: do not use system() call to distinguish x11 from waylanddev-wayland-controls
*We don't need it anymore now that we can run the capplet in wayland
-rw-r--r--capplets/common/mate-theme-apply.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/capplets/common/mate-theme-apply.c b/capplets/common/mate-theme-apply.c
index f43ab198..fa578bfe 100644
--- a/capplets/common/mate-theme-apply.c
+++ b/capplets/common/mate-theme-apply.c
@@ -26,6 +26,7 @@
#include <libmate-desktop/mate-gsettings.h>
#include "mate-theme-apply.h"
#include "gtkrc-utils.h"
+#include <gdk/gdkx.h>
#define INTERFACE_SCHEMA "org.mate.interface"
#define INTERFACE_GNOME_SCHEMA "org.gnome.desktop.interface"
@@ -55,13 +56,17 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info)
GSettings *notification_settings = NULL;
gchar *old_key;
gint old_key_int;
- int ret;
+ gboolean wayland;
/*Find out if we are running under wayland and have xwayland
*Sending signal 0 with killall doesn't kill the process but
*the return value tells us whether the process exists
*/
- ret = system ("killall -0 -e Xwayland");
+ if (GDK_IS_X11_DISPLAY ((gdk_display_get_default())))
+ wayland = FALSE;
+
+ else
+ wayland = TRUE;
interface_settings = g_settings_new (INTERFACE_SCHEMA);
interface_gnome_settings = g_settings_new (INTERFACE_GNOME_SCHEMA);
@@ -79,7 +84,7 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info)
{
g_settings_set_string (interface_settings, GTK_THEME_KEY, meta_theme_info->gtk_theme_name);
- if (ret == 0)
+ if (wayland == TRUE)
g_settings_set_string (interface_gnome_settings,
GTK_THEME_KEY, meta_theme_info->gtk_theme_name);
@@ -120,7 +125,7 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info)
if (compare (old_key, meta_theme_info->icon_theme_name))
{
g_settings_set_string (interface_settings, ICON_THEME_KEY, meta_theme_info->icon_theme_name);
- if (ret == 0)
+ if (wayland == TRUE)
g_settings_set_string (interface_gnome_settings,
ICON_THEME_KEY, meta_theme_info->icon_theme_name);
}
@@ -145,7 +150,7 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info)
if (compare (old_key, meta_theme_info->cursor_theme_name))
{
g_settings_set_string (mouse_settings, CURSOR_THEME_KEY, meta_theme_info->cursor_theme_name);
- if (ret == 0)
+ if (wayland == TRUE)
{
/*Note that this key is in a different place in GNOME than it is in MATE*/
g_settings_set_string (interface_gnome_settings,