summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/atomnames.h1
-rw-r--r--src/core/window-private.h1
-rw-r--r--src/core/window-props.c23
-rw-r--r--src/core/window.c2
4 files changed, 27 insertions, 0 deletions
diff --git a/src/core/atomnames.h b/src/core/atomnames.h
index 8e149060..3744f428 100644
--- a/src/core/atomnames.h
+++ b/src/core/atomnames.h
@@ -58,6 +58,7 @@ item(_MARCO_RESTART_MESSAGE)
item(_MARCO_RELOAD_THEME_MESSAGE)
item(_MARCO_SET_KEYBINDINGS_MESSAGE)
item(_MARCO_TOGGLE_VERBOSE)
+item(_GTK_THEME_VARIANT)
item(_GTK_FRAME_EXTENTS)
item(_GTK_SHOW_WINDOW_MENU)
item(_MATE_PANEL_ACTION)
diff --git a/src/core/window-private.h b/src/core/window-private.h
index a6b6418c..38184231 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -117,6 +117,7 @@ struct _MetaWindow
char *sm_client_id;
char *wm_client_machine;
char *startup_id;
+ char *gtk_theme_variant;
int net_wm_pid;
diff --git a/src/core/window-props.c b/src/core/window-props.c
index c3200290..0f492a5e 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -1530,6 +1530,28 @@ reload_transient_for (MetaWindow *window,
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
}
+static void
+reload_gtk_theme_variant (MetaWindow *window,
+ MetaPropValue *value,
+ gboolean initial)
+{
+ char *requested_variant = NULL;
+ char *current_variant = window->gtk_theme_variant;
+
+ if (value->type != META_PROP_VALUE_INVALID)
+ {
+ requested_variant = value->v.str;
+ meta_verbose ("Requested \"%s\" theme variant for window %s.\n",
+ requested_variant, window->desc);
+ }
+
+ if (g_strcmp0 (requested_variant, current_variant) != 0)
+ {
+ g_free (current_variant);
+
+ window->gtk_theme_variant = g_strdup (requested_variant);
+ }
+}
/**
* Initialises the property hooks system. Each row in the table named "hooks"
* represents an action to take when a property is found on a newly-created
@@ -1576,6 +1598,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
{ XA_WM_HINTS, META_PROP_VALUE_WM_HINTS, reload_wm_hints },
{ XA_WM_TRANSIENT_FOR, META_PROP_VALUE_WINDOW, reload_transient_for },
{ display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window },
+ { display->atom__GTK_THEME_VARIANT, META_PROP_VALUE_UTF8, reload_gtk_theme_variant, },
{ display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST, reload_gtk_frame_extents },
{ 0 },
};
diff --git a/src/core/window.c b/src/core/window.c
index 7c8a19a9..1c4b5cc6 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -561,6 +561,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->sm_client_id = NULL;
window->wm_client_machine = NULL;
window->startup_id = NULL;
+ window->gtk_theme_variant = NULL;
window->net_wm_pid = -1;
@@ -1229,6 +1230,7 @@ meta_window_free (MetaWindow *window,
g_free (window->title);
g_free (window->icon_name);
g_free (window->desc);
+ g_free (window->gtk_theme_variant);
g_free (window);
}