[gnome-shell/wip/carlosg/cleanup-gtk-usage: 6/7] st: Use StSettings for enable-animations check
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/cleanup-gtk-usage: 6/7] st: Use StSettings for enable-animations check
- Date: Wed, 30 Jan 2019 21:00:24 +0000 (UTC)
commit aad0ea2a7e42a4651d21e2924b65bc7d69b95103
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jan 30 19:48:28 2019 +0100
st: Use StSettings for enable-animations check
Keep a statically allocated one so all widgets will use a single
object.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
src/st/st-widget.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 9f0ab0a7e..d12dbb3e2 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -37,6 +37,7 @@
#include "st-label.h"
#include "st-private.h"
+#include "st-settings.h"
#include "st-texture-cache.h"
#include "st-theme-context.h"
#include "st-theme-node-transition.h"
@@ -44,7 +45,6 @@
#include "st-widget-accessible.h"
-#include <gtk/gtk.h>
#include <atk/atk-enum-types.h>
/* This is set in stone and also hard-coded in GDK. */
@@ -814,7 +814,6 @@ st_widget_real_get_focus_chain (StWidget *widget)
return g_list_reverse (visible);
}
-
static void
st_widget_class_init (StWidgetClass *klass)
{
@@ -1567,6 +1566,7 @@ st_widget_recompute_style (StWidget *widget,
StWidgetPrivate *priv = st_widget_get_instance_private (widget);
StThemeNode *new_theme_node = st_widget_get_theme_node (widget);
int transition_duration;
+ StSettings *settings;
gboolean paint_equal;
gboolean animations_enabled;
@@ -1586,9 +1586,8 @@ st_widget_recompute_style (StWidget *widget,
paint_equal = st_theme_node_paint_equal (old_theme_node, new_theme_node);
- g_object_get (gtk_settings_get_default (),
- "gtk-enable-animations", &animations_enabled,
- NULL);
+ settings = st_settings_get ();
+ g_object_get (settings, "enable-animations", &animations_enabled, NULL);
if (animations_enabled && transition_duration > 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]