Backport disable animations
Resolves: https://issues.redhat.com/browse/RHEL-153244
This commit is contained in:
parent
93c1a3efa8
commit
8cf7e9f228
107
0001-compositor-Expose-whether-animations-are-enabled.patch
Normal file
107
0001-compositor-Expose-whether-animations-are-enabled.patch
Normal file
@ -0,0 +1,107 @@
|
||||
From e1443530eae8efcc052dea94ba3bccc6a1bd17b4 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Tue, 10 Feb 2026 17:32:47 +0100
|
||||
Subject: [PATCH 1/3] compositor: Expose whether animations are enabled
|
||||
|
||||
Add an API to expose whether animations are enabled in the compositor.
|
||||
|
||||
No functional change yet, this is preparation work for the following
|
||||
commits.
|
||||
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/129>
|
||||
(cherry picked from commit 6f683a07fd99b67eb4e5d84d798be4bcb2088649)
|
||||
---
|
||||
compositor/kiosk-compositor.c | 33 ++++++++++++++++++++++++++++-----
|
||||
compositor/kiosk-compositor.h | 1 +
|
||||
2 files changed, 29 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index f95ab8b..5336c49 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -65,6 +65,9 @@ struct _KioskCompositor
|
||||
KioskShellService *shell_service;
|
||||
KioskMagnifier *magnifier;
|
||||
GSettings *interface_settings;
|
||||
+
|
||||
+ /* private */
|
||||
+ gboolean animations_enabled;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -247,6 +250,16 @@ neuter_builtin_keybindings (KioskCompositor *self)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+on_enable_animations_changed (GSettings *settings,
|
||||
+ const char *key,
|
||||
+ KioskCompositor *self)
|
||||
+{
|
||||
+ self->animations_enabled = g_settings_get_boolean (settings, key);
|
||||
+ g_debug ("KioskCompositor: Animations %s",
|
||||
+ self->animations_enabled ? "enabled" : "disabled");
|
||||
+}
|
||||
+
|
||||
static void
|
||||
kiosk_compositor_start (MetaPlugin *plugin)
|
||||
{
|
||||
@@ -294,6 +307,12 @@ kiosk_compositor_start (MetaPlugin *plugin)
|
||||
}
|
||||
|
||||
self->interface_settings = g_settings_new (GNOME_DESKTOP_INTERFACE_SCHEMA);
|
||||
+ self->animations_enabled = g_settings_get_boolean (self->interface_settings,
|
||||
+ GNOME_DESKTOP_ENABLE_ANIMATIONS);
|
||||
+ g_signal_connect (self->interface_settings,
|
||||
+ "changed::" GNOME_DESKTOP_ENABLE_ANIMATIONS,
|
||||
+ G_CALLBACK (on_enable_animations_changed),
|
||||
+ self);
|
||||
|
||||
kiosk_gobject_utils_queue_immediate_callback (G_OBJECT (self),
|
||||
"[kiosk-compositor] register_session",
|
||||
@@ -391,7 +410,6 @@ kiosk_compositor_map (MetaPlugin *plugin,
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
MetaWindow *window;
|
||||
- gboolean animations_enabled;
|
||||
|
||||
window = meta_window_actor_get_meta_window (actor);
|
||||
|
||||
@@ -400,10 +418,7 @@ kiosk_compositor_map (MetaPlugin *plugin,
|
||||
clutter_actor_show (self->stage);
|
||||
clutter_actor_show (CLUTTER_ACTOR (actor));
|
||||
|
||||
- animations_enabled = g_settings_get_boolean (self->interface_settings,
|
||||
- GNOME_DESKTOP_ENABLE_ANIMATIONS);
|
||||
-
|
||||
- if (animations_enabled) {
|
||||
+ if (self->animations_enabled) {
|
||||
kiosk_compositor_map_with_fade_in (self, actor, window);
|
||||
} else {
|
||||
kiosk_compositor_map_immediately (self, actor);
|
||||
@@ -610,3 +625,11 @@ kiosk_compositor_get_window_tracker (KioskCompositor *self)
|
||||
|
||||
return KIOSK_WINDOW_TRACKER (self->tracker);
|
||||
}
|
||||
+
|
||||
+gboolean
|
||||
+kiosk_compositor_are_animations_enabled (KioskCompositor *self)
|
||||
+{
|
||||
+ g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), FALSE);
|
||||
+
|
||||
+ return self->animations_enabled;
|
||||
+}
|
||||
diff --git a/compositor/kiosk-compositor.h b/compositor/kiosk-compositor.h
|
||||
index eac98ba..ba10434 100644
|
||||
--- a/compositor/kiosk-compositor.h
|
||||
+++ b/compositor/kiosk-compositor.h
|
||||
@@ -21,5 +21,6 @@ KioskInputSourcesManager *kiosk_compositor_get_input_sources_manager (KioskCompo
|
||||
KioskService *kiosk_compositor_get_service (KioskCompositor *compositor);
|
||||
KioskAppSystem *kiosk_compositor_get_app_system (KioskCompositor *compositor);
|
||||
KioskWindowTracker *kiosk_compositor_get_window_tracker (KioskCompositor *compositor);
|
||||
+gboolean kiosk_compositor_are_animations_enabled (KioskCompositor *compositor);
|
||||
|
||||
G_END_DECLS
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
From 614ad53c10ef7ad4cb8c3d812e4356bfb320e930 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Tue, 10 Feb 2026 17:43:59 +0100
|
||||
Subject: [PATCH 2/3] compositor: Add new command line option to force
|
||||
animations
|
||||
|
||||
Similar to what gnome-shell does, this adds a new command line option
|
||||
"--force-animations" to enable animations even if disabled in the
|
||||
settings.
|
||||
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/129>
|
||||
(cherry picked from commit 32fc0ceb5a58d52a0ef3d8ab27063f0ae5ccae46)
|
||||
---
|
||||
compositor/kiosk-compositor.c | 4 ++++
|
||||
compositor/main.c | 13 +++++++++++++
|
||||
compositor/main.h | 9 +++++++++
|
||||
3 files changed, 26 insertions(+)
|
||||
create mode 100644 compositor/main.h
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index 5336c49..9f027d9 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "kiosk-shell-screenshot-service.h"
|
||||
#include "kiosk-window-config.h"
|
||||
#include "kiosk-magnifier.h"
|
||||
+#include "main.h"
|
||||
|
||||
#include "org.gnome.DisplayManager.Manager.h"
|
||||
|
||||
@@ -631,5 +632,8 @@ kiosk_compositor_are_animations_enabled (KioskCompositor *self)
|
||||
{
|
||||
g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), FALSE);
|
||||
|
||||
+ if (are_animations_forced ())
|
||||
+ return TRUE;
|
||||
+
|
||||
return self->animations_enabled;
|
||||
}
|
||||
diff --git a/compositor/main.c b/compositor/main.c
|
||||
index adc748d..0e2e036 100644
|
||||
--- a/compositor/main.c
|
||||
+++ b/compositor/main.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "kiosk-compositor.h"
|
||||
|
||||
static char **argv_ignored = NULL;
|
||||
+static gboolean force_animations = FALSE;
|
||||
|
||||
static void
|
||||
command_exited_cb (GPid command_pid,
|
||||
@@ -77,6 +78,12 @@ static GOptionEntry
|
||||
N_ ("Print version"),
|
||||
NULL
|
||||
},
|
||||
+ {
|
||||
+ "force-animations", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE,
|
||||
+ &force_animations,
|
||||
+ N_ ("Force animations to be enabled"),
|
||||
+ NULL
|
||||
+ },
|
||||
{
|
||||
G_OPTION_REMAINING,
|
||||
.arg = G_OPTION_ARG_STRING_ARRAY,
|
||||
@@ -86,6 +93,12 @@ static GOptionEntry
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
+gboolean
|
||||
+are_animations_forced (void)
|
||||
+{
|
||||
+ return force_animations;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
set_working_directory (void)
|
||||
{
|
||||
diff --git a/compositor/main.h b/compositor/main.h
|
||||
new file mode 100644
|
||||
index 0000000..6c23b78
|
||||
--- /dev/null
|
||||
+++ b/compositor/main.h
|
||||
@@ -0,0 +1,9 @@
|
||||
+#pragma once
|
||||
+
|
||||
+#include <glib.h>
|
||||
+
|
||||
+G_BEGIN_DECLS
|
||||
+
|
||||
+gboolean are_animations_forced (void);
|
||||
+
|
||||
+G_END_DECLS
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 63705c307bda1bc025a117f8d900dfe3edd8c84e Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 19 Feb 2026 16:53:47 +0100
|
||||
Subject: [PATCH 3/3] compositor: Disable animations w/out HW acceleration
|
||||
|
||||
Without hardware accelerated rendering, animations can be sluggish.
|
||||
|
||||
Disable animations automatically if the backend does not provide
|
||||
hardware accelerated rendering.
|
||||
|
||||
Animations can still be forced using the "--force-animations" command
|
||||
line option though.
|
||||
|
||||
This is similar to what GNOME Shell does, so we keep consistent with
|
||||
GNOME Shell.
|
||||
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/gnome-kiosk/-/merge_requests/131>
|
||||
(cherry picked from commit 32fd771ca6c3f953e4f9f380f0bfca2797b82eae)
|
||||
---
|
||||
compositor/kiosk-compositor.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index 9f027d9..05dcb7b 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -630,10 +630,16 @@ kiosk_compositor_get_window_tracker (KioskCompositor *self)
|
||||
gboolean
|
||||
kiosk_compositor_are_animations_enabled (KioskCompositor *self)
|
||||
{
|
||||
+ MetaBackend *meta_backend;
|
||||
+
|
||||
g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), FALSE);
|
||||
|
||||
if (are_animations_forced ())
|
||||
return TRUE;
|
||||
|
||||
+ meta_backend = meta_context_get_backend (self->context);
|
||||
+ if (!meta_backend_is_rendering_hardware_accelerated (meta_backend))
|
||||
+ return FALSE;
|
||||
+
|
||||
return self->animations_enabled;
|
||||
}
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -58,6 +58,11 @@ Patch: 0001-accessibility-panel-Add-cursor-size.patch
|
||||
# https://issues.redhat.com/browse/RHEL-153242
|
||||
Patch: 0001-magnifier-Add-a-magnifier-for-accessibility.patch
|
||||
|
||||
# https://issues.redhat.com/browse/RHEL-153244
|
||||
Patch: 0001-compositor-Expose-whether-animations-are-enabled.patch
|
||||
Patch: 0002-compositor-Add-new-command-line-option-to-force-anim.patch
|
||||
Patch: 0003-compositor-Disable-animations-w-out-HW-acceleration.patch
|
||||
|
||||
%description
|
||||
GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or
|
||||
single application deployments like wall displays and point-of-sale systems.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user