- Fix keyboard layouts getting out of sync in anaconda
- Fix infinite loop - Fix crash Related: #1950042
This commit is contained in:
parent
90f8237c97
commit
367e2e8937
116
0001-gobject-utils-Log-when-executing-deferred-tasks.patch
Normal file
116
0001-gobject-utils-Log-when-executing-deferred-tasks.patch
Normal file
@ -0,0 +1,116 @@
|
||||
From ab8482bab7981321f0f2fbd401907ac34028bb1a Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 20 Apr 2021 09:27:01 -0400
|
||||
Subject: [PATCH 1/4] gobject-utils: Log when executing deferred tasks
|
||||
|
||||
At the moment, the code defers execution until "later" in
|
||||
various parts of the code to ensure a flood of related events
|
||||
doesn't lead to a flood of duplicated work.
|
||||
|
||||
But, its on the called code to log at the moment.
|
||||
|
||||
This commit adds logging to the generic part of the code to
|
||||
for clarity.
|
||||
---
|
||||
compositor/kiosk-gobject-utils.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/compositor/kiosk-gobject-utils.c b/compositor/kiosk-gobject-utils.c
|
||||
index a0dfcd8..c38db7e 100644
|
||||
--- a/compositor/kiosk-gobject-utils.c
|
||||
+++ b/compositor/kiosk-gobject-utils.c
|
||||
@@ -1,83 +1,87 @@
|
||||
#include "config.h"
|
||||
#include "kiosk-gobject-utils.h"
|
||||
|
||||
#define COALESCE_INTERVAL 250 /* milliseconds */
|
||||
|
||||
static void
|
||||
on_task_wait_complete (GObject *self,
|
||||
GTask *task)
|
||||
{
|
||||
KioskObjectCallback callback;
|
||||
gpointer user_data;
|
||||
gboolean completed;
|
||||
g_autofree char *data_key = NULL;
|
||||
|
||||
+ g_debug ("KioskGObjectUtils: Executing deferred task '%s'", g_task_get_name (task));
|
||||
+
|
||||
callback = g_object_get_data (G_OBJECT (task), "callback");
|
||||
user_data = g_object_get_data (G_OBJECT (task), "user-data");
|
||||
|
||||
completed = g_task_propagate_boolean (task, NULL);
|
||||
|
||||
if (completed) {
|
||||
callback (self, user_data);
|
||||
}
|
||||
|
||||
data_key = g_strdup_printf ("kiosk-gobject-utils-%p-%p-task",
|
||||
callback, user_data);
|
||||
|
||||
g_object_set_data (G_OBJECT (self), data_key, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_coalesce_timeout (GTask *task)
|
||||
{
|
||||
if (!g_task_return_error_if_cancelled (task)) {
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
kiosk_gobject_utils_queue_defer_callback (GObject *self,
|
||||
const char *name,
|
||||
GCancellable *cancellable,
|
||||
KioskObjectCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autofree char *data_key = NULL;
|
||||
g_autoptr (GSource) timeout_source = NULL;
|
||||
GTask *task;
|
||||
|
||||
g_return_if_fail (G_IS_OBJECT (self));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
data_key = g_strdup_printf ("kiosk-gobject-utils-%p-%p-task",
|
||||
callback, user_data);
|
||||
|
||||
task = g_object_get_data (G_OBJECT (self), data_key);
|
||||
|
||||
if (task != NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
timeout_source = g_timeout_source_new (COALESCE_INTERVAL);
|
||||
|
||||
- if (name != NULL) {
|
||||
- g_source_set_name (timeout_source, name);
|
||||
- }
|
||||
-
|
||||
task = g_task_new (self,
|
||||
cancellable,
|
||||
(GAsyncReadyCallback) on_task_wait_complete,
|
||||
NULL);
|
||||
+
|
||||
+ if (name != NULL) {
|
||||
+ g_task_set_name (task, name);
|
||||
+ g_debug ("KioskGObjectUtils: Deferring task '%s' for %dms", name, COALESCE_INTERVAL);
|
||||
+ }
|
||||
+
|
||||
g_task_attach_source (task, timeout_source, G_SOURCE_FUNC (on_coalesce_timeout));
|
||||
|
||||
g_object_set_data (G_OBJECT (task), "callback", callback);
|
||||
g_object_set_data (G_OBJECT (task), "user-data", user_data);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (self),
|
||||
data_key,
|
||||
task,
|
||||
(GDestroyNotify)
|
||||
g_object_unref);
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 840bac654aef7aa0e241be8ac0052f5a5c67e4d5 Mon Sep 17 00:00:00 2001
|
||||
From f553708a756682d625f51e7c0f3d2a31f39442bb Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 14:39:55 -0400
|
||||
Subject: [PATCH 2/4] input-sources-manager: Fix overzealous rename mistake
|
||||
@ -184,5 +184,5 @@ index 58d7a4c..a1a4cfa 100644
|
||||
old_input_source_group = kiosk_input_sources_manager_get_selected_input_source_group (self);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
2.30.2
|
||||
|
||||
|
229
0003-compositor-Add-signal-for-reporting-X-server-events.patch
Normal file
229
0003-compositor-Add-signal-for-reporting-X-server-events.patch
Normal file
@ -0,0 +1,229 @@
|
||||
From a944f0d27a42028ec18edb17f65957780c400104 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 13:28:00 -0400
|
||||
Subject: [PATCH 3/4] compositor: Add signal for reporting X server events
|
||||
|
||||
The keyboard layout handling code currently doesn't notice
|
||||
when the keyboard layout is changed using libxklavier, out from
|
||||
under it.
|
||||
|
||||
As a first step toward fixing that problem, this commit adds a
|
||||
new signal "x-server-event" to KioskCompositor, so that the
|
||||
InputSourcesManager can watch for root window property changes.
|
||||
---
|
||||
compositor/kiosk-compositor.c | 22 +++++++++++++++++++++-
|
||||
1 file changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index dad7776..14f5de3 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -9,60 +9,67 @@
|
||||
#include <clutter/clutter.h>
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
#include <meta/common.h>
|
||||
#include <meta/display.h>
|
||||
#include <meta/main.h>
|
||||
#include <meta/util.h>
|
||||
#include <meta/meta-window-group.h>
|
||||
|
||||
#include "kiosk-backgrounds.h"
|
||||
#include "kiosk-input-sources-manager.h"
|
||||
#include "kiosk-service.h"
|
||||
|
||||
#include "org.gnome.DisplayManager.Manager.h"
|
||||
|
||||
struct _KioskCompositor
|
||||
{
|
||||
MetaPlugin parent;
|
||||
|
||||
/* weak references */
|
||||
MetaDisplay *display;
|
||||
ClutterBackend *backend;
|
||||
ClutterActor *stage;
|
||||
|
||||
/* strong references */
|
||||
GCancellable *cancellable;
|
||||
KioskBackgrounds *backgrounds;
|
||||
KioskInputSourcesManager *input_sources_manager;
|
||||
KioskService *service;
|
||||
};
|
||||
|
||||
+enum {
|
||||
+ X_SERVER_EVENT,
|
||||
+ NUMBER_OF_SIGNALS
|
||||
+};
|
||||
+
|
||||
+static guint signals [NUMBER_OF_SIGNALS] = { 0, };
|
||||
+
|
||||
G_DEFINE_TYPE (KioskCompositor, kiosk_compositor, META_TYPE_PLUGIN)
|
||||
|
||||
static void kiosk_compositor_dispose (GObject *object);
|
||||
|
||||
static void
|
||||
kiosk_compositor_dispose (GObject *object)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (object);
|
||||
|
||||
if (self->cancellable != NULL) {
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
}
|
||||
|
||||
g_clear_weak_pointer (&self->stage);
|
||||
g_clear_weak_pointer (&self->display);
|
||||
g_clear_weak_pointer (&self->backend);
|
||||
|
||||
g_clear_object (&self->backgrounds);
|
||||
|
||||
G_OBJECT_CLASS (kiosk_compositor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
register_with_display_manager (KioskCompositor *self)
|
||||
{
|
||||
g_autoptr (GDBusConnection) system_bus = NULL;
|
||||
g_autoptr (GdmManager) display_manager = NULL;
|
||||
GVariantBuilder builder;
|
||||
g_autoptr (GError) error = NULL;
|
||||
@@ -329,62 +336,64 @@ kiosk_compositor_show_tile_preview (MetaPlugin *plugin,
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->show_tile_preview == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_hide_tile_preview (MetaPlugin *plugin)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->hide_tile_preview == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_show_window_menu (MetaPlugin *plugin,
|
||||
MetaWindow *window,
|
||||
MetaWindowMenuType menu,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->show_window_menu == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_show_window_menu_for_rect (MetaPlugin *plugin,
|
||||
MetaWindow *window,
|
||||
MetaWindowMenuType menu,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->show_window_menu_for_rect == NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
kiosk_compositor_xevent_filter (MetaPlugin *plugin,
|
||||
- XEvent *xev)
|
||||
+ XEvent *x_server_event)
|
||||
{
|
||||
+ KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
+ g_signal_emit (G_OBJECT (self), signals[X_SERVER_EVENT], 0, x_server_event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
kiosk_compositor_keybinding_filter (MetaPlugin *plugin,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_confirm_display_change (MetaPlugin *plugin)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
|
||||
meta_plugin_complete_display_change (META_PLUGIN (self), TRUE);
|
||||
}
|
||||
|
||||
static const MetaPluginInfo info = {
|
||||
.name = "GNOME Kiosk",
|
||||
.version = VERSION,
|
||||
.author = "Various",
|
||||
.license = "GPLv2+",
|
||||
.description = "Provides Kiosk compositor plugin for mutter"
|
||||
};
|
||||
|
||||
static const MetaPluginInfo *
|
||||
kiosk_compositor_plugin_info (MetaPlugin *plugin)
|
||||
{
|
||||
|
||||
@@ -420,60 +429,71 @@ kiosk_compositor_class_init (KioskCompositorClass *compositor_class)
|
||||
|
||||
plugin_class->start = kiosk_compositor_start;
|
||||
plugin_class->map = kiosk_compositor_map;
|
||||
plugin_class->minimize = kiosk_compositor_minimize;
|
||||
plugin_class->unminimize = kiosk_compositor_unminimize;
|
||||
plugin_class->size_changed = kiosk_compositor_size_changed;
|
||||
plugin_class->size_change = kiosk_compositor_size_change;
|
||||
plugin_class->destroy = kiosk_compositor_destroy;
|
||||
|
||||
plugin_class->switch_workspace = kiosk_compositor_switch_workspace;
|
||||
|
||||
plugin_class->kill_window_effects = kiosk_compositor_kill_window_effects;
|
||||
plugin_class->kill_switch_workspace = kiosk_compositor_kill_switch_workspace;
|
||||
|
||||
plugin_class->show_tile_preview = kiosk_compositor_show_tile_preview;
|
||||
plugin_class->hide_tile_preview = kiosk_compositor_hide_tile_preview;
|
||||
plugin_class->show_window_menu = kiosk_compositor_show_window_menu;
|
||||
plugin_class->show_window_menu_for_rect = kiosk_compositor_show_window_menu_for_rect;
|
||||
|
||||
plugin_class->xevent_filter = kiosk_compositor_xevent_filter;
|
||||
plugin_class->keybinding_filter = kiosk_compositor_keybinding_filter;
|
||||
|
||||
plugin_class->confirm_display_change = kiosk_compositor_confirm_display_change;
|
||||
|
||||
plugin_class->plugin_info = kiosk_compositor_plugin_info;
|
||||
|
||||
plugin_class->create_close_dialog = kiosk_compositor_create_close_dialog;
|
||||
plugin_class->create_inhibit_shortcuts_dialog = kiosk_compositor_create_inhibit_shortcuts_dialog;
|
||||
|
||||
plugin_class->locate_pointer = kiosk_compositor_locate_pointer;
|
||||
+
|
||||
+ signals [X_SERVER_EVENT] =
|
||||
+ g_signal_new ("x-server-event",
|
||||
+ G_TYPE_FROM_CLASS (object_class),
|
||||
+ G_SIGNAL_RUN_LAST,
|
||||
+ 0,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ g_cclosure_marshal_VOID__POINTER,
|
||||
+ G_TYPE_NONE,
|
||||
+ 1, G_TYPE_POINTER);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_init (KioskCompositor *compositor)
|
||||
{
|
||||
g_debug ("KioskCompositor: Initializing");
|
||||
}
|
||||
|
||||
KioskBackgrounds *
|
||||
kiosk_compositor_get_backgrounds (KioskCompositor *self)
|
||||
{
|
||||
g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), NULL);
|
||||
|
||||
return KIOSK_BACKGROUNDS (self->backgrounds);
|
||||
}
|
||||
|
||||
KioskInputSourcesManager *
|
||||
kiosk_compositor_get_input_sources_manager (KioskCompositor *self)
|
||||
{
|
||||
g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), NULL);
|
||||
|
||||
return KIOSK_INPUT_SOURCES_MANAGER (self->input_sources_manager);
|
||||
}
|
||||
|
||||
KioskService *
|
||||
kiosk_compositor_get_service (KioskCompositor *self)
|
||||
{
|
||||
g_return_val_if_fail (KIOSK_IS_COMPOSITOR (self), NULL);
|
||||
|
||||
return KIOSK_SERVICE (self->service);
|
||||
--
|
||||
2.30.2
|
||||
|
1490
0004-input-sources-manager-Support-libxklavier-managed-ke.patch
Normal file
1490
0004-input-sources-manager-Support-libxklavier-managed-ke.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@
|
||||
|
||||
Name: gnome-kiosk
|
||||
Version: 40~alpha
|
||||
Release: 3%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Summary: Window management and application launching for GNOME
|
||||
|
||||
License: GPLv2+
|
||||
@ -41,10 +41,10 @@ Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas
|
||||
Patch10001: 0001-compositor-Be-less-aggressive-about-full-screening-w.patch
|
||||
|
||||
# https://gitlab.gnome.org/halfline/gnome-kiosk/-/merge_requests/2
|
||||
Patch20001: 0001-compositor-Add-signal-for-reporting-X-server-events.patch
|
||||
Patch20001: 0001-gobject-utils-Log-when-executing-deferred-tasks.patch
|
||||
Patch20002: 0002-input-sources-manager-Fix-overzealous-rename-mistake.patch
|
||||
Patch20003: 0003-input-sources-manager-Add-function-to-load-input-sou.patch
|
||||
Patch20004: 0004-wip-Better-support-libxklavier.patch
|
||||
Patch20003: 0003-compositor-Add-signal-for-reporting-X-server-events.patch
|
||||
Patch20004: 0004-input-sources-manager-Support-libxklavier-managed-ke.patch
|
||||
|
||||
%description
|
||||
GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or
|
||||
@ -88,6 +88,12 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.Searc
|
||||
%{_datadir}/wayland-sessions/org.gnome.Kiosk.SearchApp.Session.desktop
|
||||
|
||||
%changelog
|
||||
* Wed Apr 21 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-5
|
||||
- Fix keyboard layouts getting out of sync in anaconda
|
||||
|
||||
* Tue Apr 20 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-4
|
||||
- Fix infinite loop
|
||||
|
||||
* Mon Apr 19 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-3
|
||||
- Fix crash
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user