[Xfce4-commits] [apps/xfdashboard] 01/02: Allow user to decide if animations should be enabled at all via Xfconf settings
noreply at xfce.org
noreply at xfce.org
Tue Nov 5 12:55:43 CET 2019
This is an automated email from the git hooks/post-receive script.
n o m a d p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfdashboard.
commit a37944e150ee0f1aa7c7d8d062bc12b3b2a62850
Author: Stephan Haller <nomad at froevel.de>
Date: Tue Nov 5 11:40:55 2019 +0100
Allow user to decide if animations should be enabled at all via Xfconf settings
---
libxfdashboard/theme-animation.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/libxfdashboard/theme-animation.c b/libxfdashboard/theme-animation.c
index b90537b..1ac0fbd 100644
--- a/libxfdashboard/theme-animation.c
+++ b/libxfdashboard/theme-animation.c
@@ -33,6 +33,7 @@
#include <libxfdashboard/transition-group.h>
#include <libxfdashboard/stylable.h>
+#include <libxfdashboard/application.h>
#include <libxfdashboard/enums.h>
#include <libxfdashboard/utils.h>
#include <libxfdashboard/compat.h>
@@ -52,6 +53,9 @@ G_DEFINE_TYPE_WITH_PRIVATE(XfdashboardThemeAnimation,
/* IMPLEMENTATION: Private variables and methods */
+#define ENABLE_ANIMATIONS_XFCONF_PROP "/enable-animations"
+#define DEFAULT_ENABLE_ANIMATIONS TRUE
+
enum
{
XFDASHBOARD_THEME_ANIMATION_APPLY_TO_ORIGIN_SENDER=0,
@@ -645,6 +649,7 @@ XfdashboardAnimation* xfdashboard_theme_animation_create(XfdashboardThemeAnimati
XfdashboardAnimationClass *animationClass;
GSList *iterTargets;
gint counterTargets;
+ gboolean animationEnabled;
#ifdef DEBUG
gboolean doDebug=TRUE;
#endif
@@ -666,6 +671,20 @@ XfdashboardAnimation* xfdashboard_theme_animation_create(XfdashboardThemeAnimati
return(NULL);
}
+ /* Check if user wants animation at all. If user does not want any animation,
+ * return the empty one.
+ */
+ animationEnabled=xfconf_channel_get_bool(xfdashboard_application_get_xfconf_channel(NULL),
+ ENABLE_ANIMATIONS_XFCONF_PROP,
+ DEFAULT_ENABLE_ANIMATIONS);
+ if(!animationEnabled)
+ {
+ XFDASHBOARD_DEBUG(self, ANIMATION, "User disabled animations");
+
+ /* Return NULL as user does not want any animation */
+ return(animation);
+ }
+
/* Get best matching animation specification for sender and signal.
* If no matching animation specification is found, return the empty one.
*/
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list