Compare commits
10 Commits
367e2e8937
...
a675e03382
Author | SHA1 | Date |
---|---|---|
Ray Strode | a675e03382 | |
Ray Strode | b1862a7eb6 | |
Mohan Boddu | 7a1746cb8d | |
Ray Strode | 82c9af346c | |
Tomas Pelka | 6d7ebac74d | |
Ray Strode | 7d31be9928 | |
Ray Strode | b6033081e2 | |
Ray Strode | ee07495667 | |
Ray Strode | aebc69529c | |
Radek Vykydal | a467d4efe2 |
|
@ -1 +1,2 @@
|
|||
/gnome-kiosk-40.alpha.tar.xz
|
||||
/gnome-kiosk-40.0.tar.xz
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
7299ed3df18e96a6258a22e88b6418dc578ac8bb gnome-kiosk-40.0.tar.xz
|
|
@ -1,229 +0,0 @@
|
|||
From 6b1fa184af2a847d8b3d74a09bb65af6803d4e6d Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 13:28:00 -0400
|
||||
Subject: [PATCH 1/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.31.1
|
||||
|
|
@ -1,228 +0,0 @@
|
|||
From 7ea1746494f0b2e381fe8f08249f7751cd8ae578 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 13:00:16 -0400
|
||||
Subject: [PATCH] compositor: Be less aggressive about full screening windows
|
||||
|
||||
It's common for kiosk type applications to have dialogs and utility
|
||||
windows that shouldn't get fullscreen.
|
||||
|
||||
This commit tries to be a little less aggressive above fullscreening
|
||||
windows. Now we assume only the first window is "the application" and
|
||||
subsequent windows are auxillary and should be layered on top.
|
||||
---
|
||||
compositor/kiosk-compositor.c | 78 +++++++++++++++++++++++++++++++----
|
||||
1 file changed, 70 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index b3cd10f..dad7776 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -1,43 +1,45 @@
|
||||
#include "config.h"
|
||||
#include "kiosk-compositor.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (KioskCompositor, kiosk_compositor, META_TYPE_PLUGIN)
|
||||
|
||||
static void kiosk_compositor_dispose (GObject *object);
|
||||
|
||||
static void
|
||||
kiosk_compositor_dispose (GObject *object)
|
||||
{
|
||||
@@ -143,91 +145,151 @@ static void
|
||||
kiosk_compositor_minimize (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
meta_plugin_minimize_completed (plugin, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_unminimize (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
meta_plugin_unminimize_completed (plugin, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_size_changed (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->size_changed == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_size_change (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor,
|
||||
MetaSizeChange which_change,
|
||||
MetaRectangle *old_frame_rect,
|
||||
MetaRectangle *old_buffer_rect)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->size_change == NULL);
|
||||
}
|
||||
|
||||
+static gboolean
|
||||
+kiosk_compositor_wants_window_fullscreen (KioskCompositor *self,
|
||||
+ MetaWindow *window)
|
||||
+{
|
||||
+ MetaWindowType window_type;
|
||||
+ g_autoptr (GList) windows = NULL;
|
||||
+ GList *node;
|
||||
+
|
||||
+ if (!meta_window_allows_resize (window)) {
|
||||
+ g_debug ("KioskCompositor: Window does not allow resizes");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (meta_window_is_override_redirect (window)) {
|
||||
+ g_debug ("KioskCompositor: Window is override redirect");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ window_type = meta_window_get_window_type (window);
|
||||
+
|
||||
+ if (window_type != META_WINDOW_NORMAL) {
|
||||
+ g_debug ("KioskCompositor: Window is not normal");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ windows = meta_display_get_tab_list (self->display, META_TAB_LIST_NORMAL_ALL, NULL);
|
||||
+
|
||||
+ for (node = windows; node != NULL; node = node->next) {
|
||||
+ MetaWindow *existing_window = node->data;
|
||||
+
|
||||
+ if (meta_window_is_fullscreen (existing_window)) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+kiosk_compositor_wants_window_above (KioskCompositor *self,
|
||||
+ MetaWindow *window)
|
||||
+{
|
||||
+ if (meta_window_is_screen_sized (window)) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (meta_window_is_monitor_sized (window)) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
on_faded_in (KioskCompositor *self,
|
||||
ClutterTransition *transition)
|
||||
{
|
||||
MetaWindowActor *actor = g_object_get_data (G_OBJECT (transition), "actor");
|
||||
- MetaWindow *window;
|
||||
-
|
||||
- window = meta_window_actor_get_meta_window (actor);
|
||||
-
|
||||
- if (!meta_window_allows_resize (window) && !meta_window_is_override_redirect (window)) {
|
||||
- meta_window_make_above (window);
|
||||
- }
|
||||
|
||||
meta_plugin_map_completed (META_PLUGIN (self), actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_map (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
MetaWindow *window;
|
||||
ClutterTransition *fade_in_transition;
|
||||
int easing_duration;
|
||||
|
||||
window = meta_window_actor_get_meta_window (actor);
|
||||
|
||||
- if (meta_window_allows_resize (window)) {
|
||||
+ if (kiosk_compositor_wants_window_fullscreen (self, window)) {
|
||||
+ g_debug ("KioskCompositor: Mapping window that does need to be fullscreened");
|
||||
meta_window_make_fullscreen (window);
|
||||
easing_duration = 3000;
|
||||
} else {
|
||||
+ ClutterActor *window_group;
|
||||
+
|
||||
+ g_debug ("KioskCompositor: Mapping window that does not need to be fullscreened");
|
||||
+ window_group = meta_get_top_window_group_for_display (self->display);
|
||||
+
|
||||
+ if (kiosk_compositor_wants_window_above (self, window)) {
|
||||
+ g_object_ref (G_OBJECT (actor));
|
||||
+ clutter_actor_remove_child (clutter_actor_get_parent (CLUTTER_ACTOR (actor)), CLUTTER_ACTOR (actor));
|
||||
+ clutter_actor_add_child (window_group, CLUTTER_ACTOR (actor));
|
||||
+ clutter_actor_set_child_below_sibling (window_group, CLUTTER_ACTOR (actor), NULL);
|
||||
+ g_object_unref (G_OBJECT (actor));
|
||||
+ }
|
||||
+
|
||||
easing_duration = 500;
|
||||
}
|
||||
|
||||
clutter_actor_show (self->stage);
|
||||
clutter_actor_show (CLUTTER_ACTOR (actor));
|
||||
|
||||
clutter_actor_set_opacity (CLUTTER_ACTOR (actor), 0);
|
||||
|
||||
clutter_actor_save_easing_state (CLUTTER_ACTOR (actor));
|
||||
clutter_actor_set_easing_duration (CLUTTER_ACTOR (actor), easing_duration);
|
||||
clutter_actor_set_easing_mode (CLUTTER_ACTOR (actor), CLUTTER_EASE_IN_OUT_QUINT);
|
||||
clutter_actor_set_opacity (CLUTTER_ACTOR (actor), 255);
|
||||
fade_in_transition = clutter_actor_get_transition (CLUTTER_ACTOR (actor), "opacity");
|
||||
clutter_actor_restore_easing_state (CLUTTER_ACTOR (actor));
|
||||
|
||||
g_object_set_data (G_OBJECT (fade_in_transition), "actor", actor);
|
||||
|
||||
g_signal_connect_object (G_OBJECT (fade_in_transition),
|
||||
"completed",
|
||||
G_CALLBACK (on_faded_in),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_destroy (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
From a57b5436cdce6b09daf968d1ff563b0b2e233daa Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 6 Oct 2022 11:01:20 -0400
|
||||
Subject: [PATCH] compositor: Be more permissive about what's considered
|
||||
fullscreen
|
||||
|
||||
GNOME Kiosk will automatically fullscreen the application started
|
||||
for it, but sometimes that application will start another app.
|
||||
|
||||
The second app should not be automatically fullscreened.
|
||||
|
||||
Some apps go fullscreen without actually going fullscreen though.
|
||||
They just go monitor sized.
|
||||
|
||||
This commit makes sure those apps count as fullscreen too.
|
||||
---
|
||||
compositor/kiosk-compositor.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index 2db58ed..c611bb9 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -282,61 +282,61 @@ kiosk_compositor_size_change (MetaPlugin *plugin,
|
||||
static gboolean
|
||||
kiosk_compositor_wants_window_fullscreen (KioskCompositor *self,
|
||||
MetaWindow *window)
|
||||
{
|
||||
MetaWindowType window_type;
|
||||
g_autoptr (GList) windows = NULL;
|
||||
GList *node;
|
||||
|
||||
if (!meta_window_allows_resize (window)) {
|
||||
g_debug ("KioskCompositor: Window does not allow resizes");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (meta_window_is_override_redirect (window)) {
|
||||
g_debug ("KioskCompositor: Window is override redirect");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
window_type = meta_window_get_window_type (window);
|
||||
|
||||
if (window_type != META_WINDOW_NORMAL) {
|
||||
g_debug ("KioskCompositor: Window is not normal");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
windows = meta_display_get_tab_list (self->display, META_TAB_LIST_NORMAL_ALL, NULL);
|
||||
|
||||
for (node = windows; node != NULL; node = node->next) {
|
||||
MetaWindow *existing_window = node->data;
|
||||
|
||||
- if (meta_window_is_fullscreen (existing_window)) {
|
||||
+ if (meta_window_is_monitor_sized (existing_window)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
kiosk_compositor_wants_window_above (KioskCompositor *self,
|
||||
MetaWindow *window)
|
||||
{
|
||||
if (meta_window_is_screen_sized (window)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (meta_window_is_monitor_sized (window)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_faded_in (KioskCompositor *self,
|
||||
ClutterTransition *transition)
|
||||
{
|
||||
MetaWindowActor *actor = g_object_get_data (G_OBJECT (transition), "actor");
|
||||
|
||||
meta_plugin_map_completed (META_PLUGIN (self), actor);
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
|
@ -0,0 +1,239 @@
|
|||
From 28a560fdc1a8571d0e1d34da5cb57f43d2fe1a54 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 14:47:05 -0400
|
||||
Subject: [PATCH 1/6] compositor: Ignore some of the builtin keybindings
|
||||
|
||||
Mutter on wayland currently has a bug where it crashes if the run dialog
|
||||
keybinding is pressed. No one notices the bug for gnome-shell, since
|
||||
gnome-shell overrides mutters run dialog keybinding.
|
||||
|
||||
This commit makes GNOME Kiosk also override the keybinding to avoid the
|
||||
crash. At the same time it neuters a few other builtin keybindings that
|
||||
aren't so useful to GNOME Kiosk.
|
||||
---
|
||||
compositor/kiosk-compositor.c | 90 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 90 insertions(+)
|
||||
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index 43329c7..2db58ed 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -1,42 +1,43 @@
|
||||
#include "config.h"
|
||||
#include "kiosk-compositor.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
#include <meta/common.h>
|
||||
#include <meta/display.h>
|
||||
+#include <meta/keybindings.h>
|
||||
#include <meta/main.h>
|
||||
#include <meta/util.h>
|
||||
#include <meta/meta-window-group.h>
|
||||
|
||||
#include <systemd/sd-daemon.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,
|
||||
@@ -103,82 +104,171 @@ register_with_display_manager (KioskCompositor *self)
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}"));
|
||||
|
||||
gdm_manager_call_register_display_sync (display_manager,
|
||||
g_variant_builder_end (&builder),
|
||||
self->cancellable,
|
||||
&error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("KioskCompositor: Could not register with display manager: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
register_with_systemd (KioskCompositor *self)
|
||||
{
|
||||
sd_notify (TRUE, "READY=1");
|
||||
}
|
||||
|
||||
static void
|
||||
register_session (KioskCompositor *self)
|
||||
{
|
||||
meta_register_with_session ();
|
||||
|
||||
register_with_display_manager (self);
|
||||
|
||||
register_with_systemd (self);
|
||||
}
|
||||
|
||||
+static void
|
||||
+on_builtin_keybinding_triggered (MetaDisplay *display,
|
||||
+ MetaWindow *window,
|
||||
+ ClutterKeyEvent *event,
|
||||
+ MetaKeyBinding *binding,
|
||||
+ KioskCompositor *self)
|
||||
+{
|
||||
+ g_debug ("KioskCompositor: Ignoring '%s' request",
|
||||
+ meta_key_binding_get_name (binding));
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+neuter_builtin_keybindings (KioskCompositor *self)
|
||||
+{
|
||||
+ const char *builtin_keybindings[] = {
|
||||
+ "switch-to-workspace-1",
|
||||
+ "switch-to-workspace-2",
|
||||
+ "switch-to-workspace-3",
|
||||
+ "switch-to-workspace-4",
|
||||
+ "switch-to-workspace-5",
|
||||
+ "switch-to-workspace-6",
|
||||
+ "switch-to-workspace-7",
|
||||
+ "switch-to-workspace-8",
|
||||
+ "switch-to-workspace-9",
|
||||
+ "switch-to-workspace-10",
|
||||
+ "switch-to-workspace-11",
|
||||
+ "switch-to-workspace-12",
|
||||
+ "switch-to-workspace-left",
|
||||
+ "switch-to-workspace-right",
|
||||
+ "switch-to-workspace-up",
|
||||
+ "switch-to-workspace-down",
|
||||
+ "switch-to-workspace-last",
|
||||
+ "panel-main-menu",
|
||||
+ "panel-run-dialog",
|
||||
+ "set-spew-mark",
|
||||
+ "switch-monitor",
|
||||
+ "rotate-monitor",
|
||||
+ "switch-to-session-1",
|
||||
+ "switch-to-session-2",
|
||||
+ "switch-to-session-3",
|
||||
+ "switch-to-session-4",
|
||||
+ "switch-to-session-5",
|
||||
+ "switch-to-session-6",
|
||||
+ "switch-to-session-7",
|
||||
+ "switch-to-session-8",
|
||||
+ "switch-to-session-9",
|
||||
+ "switch-to-session-10",
|
||||
+ "switch-to-session-11",
|
||||
+ "switch-to-session-12",
|
||||
+ "restore-shortcuts",
|
||||
+ "activate-window-menu",
|
||||
+ "toggle-above",
|
||||
+ "toggle-shaded",
|
||||
+ "minimize",
|
||||
+ "toggle-on-all-workspaces",
|
||||
+ "move-to-workspace-1",
|
||||
+ "move-to-workspace-2",
|
||||
+ "move-to-workspace-3",
|
||||
+ "move-to-workspace-4",
|
||||
+ "move-to-workspace-5",
|
||||
+ "move-to-workspace-6",
|
||||
+ "move-to-workspace-7",
|
||||
+ "move-to-workspace-8",
|
||||
+ "move-to-workspace-9",
|
||||
+ "move-to-workspace-10",
|
||||
+ "move-to-workspace-11",
|
||||
+ "move-to-workspace-12",
|
||||
+ "move-to-workspace-last",
|
||||
+ "move-to-workspace-left",
|
||||
+ "move-to-workspace-right",
|
||||
+ "move-to-workspace-up",
|
||||
+ "move-to-workspace-down",
|
||||
+ NULL
|
||||
+ };
|
||||
+ size_t i;
|
||||
+
|
||||
+ g_debug ("KioskCompositor: Neutering builtin keybindings");
|
||||
+
|
||||
+ for (i = 0; builtin_keybindings[i] != NULL; i++) {
|
||||
+ meta_keybindings_set_custom_handler (builtin_keybindings[i],
|
||||
+ (MetaKeyHandlerFunc)
|
||||
+ on_builtin_keybinding_triggered,
|
||||
+ self,
|
||||
+ NULL);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void
|
||||
kiosk_compositor_start (MetaPlugin *plugin)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
g_set_weak_pointer (&self->display, meta_plugin_get_display (META_PLUGIN (self)));
|
||||
g_set_weak_pointer (&self->backend, clutter_get_default_backend ());
|
||||
g_set_weak_pointer (&self->stage, meta_get_stage_for_display (self->display));
|
||||
|
||||
clutter_actor_show (self->stage);
|
||||
|
||||
self->cancellable = g_cancellable_new ();
|
||||
|
||||
self->service = kiosk_service_new (self);
|
||||
kiosk_service_start (self->service, &error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("KioskCompositor: Could not start D-Bus service: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
+ neuter_builtin_keybindings (self);
|
||||
+
|
||||
self->backgrounds = kiosk_backgrounds_new (self);
|
||||
self->input_sources_manager = kiosk_input_sources_manager_new (self);
|
||||
|
||||
register_session (self);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_minimize (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
meta_plugin_minimize_completed (plugin, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_unminimize (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
meta_plugin_unminimize_completed (plugin, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_size_changed (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor)
|
||||
{
|
||||
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->size_changed == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_size_change (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor,
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,429 @@
|
|||
From 00aa37d927c3fd24769bd5c68a8a1ddc9acfb7bd Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Fri, 6 Aug 2021 17:51:14 -0400
|
||||
Subject: [PATCH 1/2] compositor: Support systemd --user sessions
|
||||
|
||||
This commit adds unit files for supporting starting org.gnome.Kiosk
|
||||
from systemd --user.
|
||||
---
|
||||
compositor/data/org.gnome.Kiosk.desktop.in.in | 1 +
|
||||
.../data/systemd/org.gnome.Kiosk.target | 10 ++++++++
|
||||
.../org.gnome.Kiosk@wayland.service.in | 20 ++++++++++++++++
|
||||
.../systemd/org.gnome.Kiosk@x11.service.in | 20 ++++++++++++++++
|
||||
compositor/kiosk-compositor.c | 10 ++++++++
|
||||
meson.build | 24 +++++++++++++++++++
|
||||
6 files changed, 85 insertions(+)
|
||||
create mode 100644 compositor/data/systemd/org.gnome.Kiosk.target
|
||||
create mode 100644 compositor/data/systemd/org.gnome.Kiosk@wayland.service.in
|
||||
create mode 100644 compositor/data/systemd/org.gnome.Kiosk@x11.service.in
|
||||
|
||||
diff --git a/compositor/data/org.gnome.Kiosk.desktop.in.in b/compositor/data/org.gnome.Kiosk.desktop.in.in
|
||||
index bb603c8..cdbbe6a 100644
|
||||
--- a/compositor/data/org.gnome.Kiosk.desktop.in.in
|
||||
+++ b/compositor/data/org.gnome.Kiosk.desktop.in.in
|
||||
@@ -1,12 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=GNOME Kiosk
|
||||
Comment=Compositor for Kiosk and Single Application deployments
|
||||
Exec=@bindir@/gnome-kiosk
|
||||
Categories=GNOME;GTK;Core;System;
|
||||
OnlyShowIn=GNOME;
|
||||
NoDisplay=true
|
||||
X-GNOME-Autostart-Phase=DisplayServer
|
||||
X-GNOME-Provides=panel;windowmanager;
|
||||
X-GNOME-Autostart-Notify=true
|
||||
X-GNOME-AutoRestart=false
|
||||
+X-GNOME-HiddenUnderSystemd=true
|
||||
diff --git a/compositor/data/systemd/org.gnome.Kiosk.target b/compositor/data/systemd/org.gnome.Kiosk.target
|
||||
new file mode 100644
|
||||
index 0000000..eb92b4a
|
||||
--- /dev/null
|
||||
+++ b/compositor/data/systemd/org.gnome.Kiosk.target
|
||||
@@ -0,0 +1,10 @@
|
||||
+[Unit]
|
||||
+Description=GNOME Kiosk
|
||||
+DefaultDependencies=no
|
||||
+
|
||||
+Requisite=gnome-session-initialized.target
|
||||
+PartOf=gnome-session-initialized.target
|
||||
+Before=gnome-session-initialized.target
|
||||
+
|
||||
+Wants=org.gnome.Kiosk@wayland.service
|
||||
+Wants=org.gnome.Kiosk@x11.service
|
||||
diff --git a/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in b/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in
|
||||
new file mode 100644
|
||||
index 0000000..19cd4a0
|
||||
--- /dev/null
|
||||
+++ b/compositor/data/systemd/org.gnome.Kiosk@wayland.service.in
|
||||
@@ -0,0 +1,20 @@
|
||||
+[Unit]
|
||||
+Description=GNOME Kiosk on Wayland
|
||||
+OnFailure=gnome-session-shutdown.target
|
||||
+OnFailureJobMode=replace-irreversibly
|
||||
+CollectMode=inactive-or-failed
|
||||
+RefuseManualStart=on
|
||||
+RefuseManualStop=on
|
||||
+After=gnome-session-manager.target
|
||||
+Requisite=gnome-session-initialized.target
|
||||
+PartOf=gnome-session-initialized.target
|
||||
+Before=gnome-session-initialized.target
|
||||
+ConditionEnvironment=XDG_SESSION_TYPE=%I
|
||||
+
|
||||
+[Service]
|
||||
+Slice=session.slice
|
||||
+Type=notify
|
||||
+ExecStart=/usr/bin/gnome-kiosk
|
||||
+ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY'
|
||||
+Restart=no
|
||||
+TimeoutStopSec=5
|
||||
diff --git a/compositor/data/systemd/org.gnome.Kiosk@x11.service.in b/compositor/data/systemd/org.gnome.Kiosk@x11.service.in
|
||||
new file mode 100644
|
||||
index 0000000..291baaa
|
||||
--- /dev/null
|
||||
+++ b/compositor/data/systemd/org.gnome.Kiosk@x11.service.in
|
||||
@@ -0,0 +1,20 @@
|
||||
+[Unit]
|
||||
+Description=GNOME Kiosk on X11
|
||||
+OnFailure=gnome-session-failed.target
|
||||
+OnFailureJobMode=replace
|
||||
+CollectMode=inactive-or-failed
|
||||
+RefuseManualStart=on
|
||||
+RefuseManualStop=on
|
||||
+After=gnome-session-manager.target
|
||||
+Requisite=gnome-session-initialized.target
|
||||
+PartOf=gnome-session-initialized.target
|
||||
+Before=gnome-session-initialized.target
|
||||
+ConditionEnvironment=XDG_SESSION_TYPE=%I
|
||||
+
|
||||
+[Service]
|
||||
+Slice=session.slice
|
||||
+Type=notify
|
||||
+ExecStart=/usr/bin/gnome-kiosk
|
||||
+Restart=always
|
||||
+RestartSec=0ms
|
||||
+TimeoutStopSec=5
|
||||
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
|
||||
index 6753a87..43329c7 100644
|
||||
--- a/compositor/kiosk-compositor.c
|
||||
+++ b/compositor/kiosk-compositor.c
|
||||
@@ -1,46 +1,48 @@
|
||||
#include "config.h"
|
||||
#include "kiosk-compositor.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#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 <systemd/sd-daemon.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)
|
||||
@@ -85,66 +87,74 @@ register_with_display_manager (KioskCompositor *self)
|
||||
}
|
||||
|
||||
display_manager = gdm_manager_proxy_new_sync (system_bus,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
|
||||
"org.gnome.DisplayManager",
|
||||
"/org/gnome/DisplayManager/Manager",
|
||||
self->cancellable,
|
||||
&error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("KioskCompositor: Could not contact display manager: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}"));
|
||||
|
||||
gdm_manager_call_register_display_sync (display_manager,
|
||||
g_variant_builder_end (&builder),
|
||||
self->cancellable,
|
||||
&error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("KioskCompositor: Could not register with display manager: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+register_with_systemd (KioskCompositor *self)
|
||||
+{
|
||||
+ sd_notify (TRUE, "READY=1");
|
||||
+}
|
||||
+
|
||||
static void
|
||||
register_session (KioskCompositor *self)
|
||||
{
|
||||
meta_register_with_session ();
|
||||
|
||||
register_with_display_manager (self);
|
||||
+
|
||||
+ register_with_systemd (self);
|
||||
}
|
||||
|
||||
static void
|
||||
kiosk_compositor_start (MetaPlugin *plugin)
|
||||
{
|
||||
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
g_set_weak_pointer (&self->display, meta_plugin_get_display (META_PLUGIN (self)));
|
||||
g_set_weak_pointer (&self->backend, clutter_get_default_backend ());
|
||||
g_set_weak_pointer (&self->stage, meta_get_stage_for_display (self->display));
|
||||
|
||||
clutter_actor_show (self->stage);
|
||||
|
||||
self->cancellable = g_cancellable_new ();
|
||||
|
||||
self->service = kiosk_service_new (self);
|
||||
kiosk_service_start (self->service, &error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("KioskCompositor: Could not start D-Bus service: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
self->backgrounds = kiosk_backgrounds_new (self);
|
||||
self->input_sources_manager = kiosk_input_sources_manager_new (self);
|
||||
|
||||
register_session (self);
|
||||
}
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 0766f8d..c2988ad 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -9,60 +9,64 @@ c_compiler = meson.get_compiler('c')
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
|
||||
prefix = get_option('prefix')
|
||||
datadir = join_paths(prefix, get_option('datadir'))
|
||||
bindir = join_paths(prefix, get_option('bindir'))
|
||||
localedir = join_paths(datadir, 'locale')
|
||||
desktop_data_dir = join_paths(datadir, 'applications')
|
||||
session_dir = join_paths(datadir, 'gnome-session', 'sessions')
|
||||
xsessions_dir = join_paths(datadir, 'xsessions')
|
||||
|
||||
po_dir = join_paths(meson.current_source_dir(), 'po')
|
||||
|
||||
config_data = configuration_data()
|
||||
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
||||
config_data.set_quoted('VERSION', meson.project_version())
|
||||
config_data.set_quoted('LOCALEDIR', localedir)
|
||||
|
||||
config_h = configure_file(
|
||||
input: 'config.h.meson',
|
||||
output: 'config.h',
|
||||
configuration: config_data
|
||||
)
|
||||
|
||||
meson.add_install_script ('meson/postinstall.py')
|
||||
|
||||
mutter_dependency = dependency('libmutter-8')
|
||||
mutter_libdir = mutter_dependency.get_pkgconfig_variable('typelibdir')
|
||||
|
||||
+systemd_user_unit_dir = dependency('systemd').get_pkgconfig_variable('systemduserunitdir',
|
||||
+ define_variable: ['prefix', prefix])
|
||||
+systemd_dependency = dependency('libsystemd')
|
||||
+
|
||||
dbus_proxies = []
|
||||
dbus_proxies += {
|
||||
'prefix': 'org.gnome.DisplayManager',
|
||||
'namespace': 'Gdm',
|
||||
'interface': 'Manager',
|
||||
}
|
||||
|
||||
dbus_proxies += {
|
||||
'prefix': 'org.freedesktop',
|
||||
'namespace': 'Sd',
|
||||
'interface': 'locale1',
|
||||
}
|
||||
|
||||
dbus_proxies += {
|
||||
'prefix': 'org.gnome',
|
||||
'namespace': 'Gsm',
|
||||
'interface': 'SessionManager',
|
||||
}
|
||||
|
||||
dbus_interface_sources_map = {}
|
||||
foreach dbus_proxy : dbus_proxies
|
||||
dbus_interface = dbus_proxy['prefix'] + '.' + dbus_proxy['interface']
|
||||
dbus_interface_file = join_paths('dbus-interfaces', dbus_interface + '.xml')
|
||||
sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file,
|
||||
namespace: dbus_proxy['namespace'],
|
||||
interface_prefix: dbus_proxy['prefix'],
|
||||
)
|
||||
dbus_interface_sources_map += { dbus_interface: sources }
|
||||
endforeach
|
||||
|
||||
@@ -75,103 +79,123 @@ sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file,
|
||||
annotations: [
|
||||
[ dbus_interface, 'org.gtk.GDBus.C.Name', 'Service' ],
|
||||
[ dbus_interface + '.InputSources', 'org.gtk.GDBus.C.Name', 'InputSourcesManager' ],
|
||||
[ dbus_interface + '.InputSources.InputSource', 'org.gtk.GDBus.C.Name', 'InputSource' ],
|
||||
]
|
||||
)
|
||||
dbus_interface_sources_map += { dbus_interface: sources }
|
||||
|
||||
dbus_interface = 'org.gnome.Shell'
|
||||
dbus_interface_file = join_paths('dbus-interfaces', dbus_interface + '.xml')
|
||||
sources = gnome.gdbus_codegen(dbus_interface, dbus_interface_file,
|
||||
namespace: 'Kiosk',
|
||||
interface_prefix: 'org.gnome',
|
||||
annotations: [
|
||||
[ dbus_interface, 'org.gtk.GDBus.C.Name', 'ShellDBusService' ]
|
||||
]
|
||||
)
|
||||
dbus_interface_sources_map += { dbus_interface: sources }
|
||||
|
||||
compositor_dependencies = []
|
||||
compositor_dependencies += c_compiler.find_library('m')
|
||||
compositor_dependencies += dependency('gio-2.0')
|
||||
compositor_dependencies += dependency('glib-2.0')
|
||||
compositor_dependencies += dependency('gnome-desktop-3.0')
|
||||
compositor_dependencies += dependency('gobject-2.0')
|
||||
compositor_dependencies += dependency('ibus-1.0')
|
||||
compositor_dependencies += dependency('mutter-cogl-8')
|
||||
compositor_dependencies += dependency('mutter-cogl-pango-8')
|
||||
compositor_dependencies += dependency('mutter-clutter-8')
|
||||
compositor_dependencies += mutter_dependency
|
||||
+compositor_dependencies += systemd_dependency
|
||||
|
||||
compositor_sources = []
|
||||
compositor_sources += 'compositor/kiosk-backgrounds.c'
|
||||
compositor_sources += 'compositor/kiosk-compositor.c'
|
||||
compositor_sources += 'compositor/kiosk-dbus-utils.c'
|
||||
compositor_sources += 'compositor/kiosk-gobject-utils.c'
|
||||
compositor_sources += 'compositor/kiosk-input-sources-manager.c'
|
||||
compositor_sources += 'compositor/kiosk-input-engine-manager.c'
|
||||
compositor_sources += 'compositor/kiosk-input-source-group.c'
|
||||
compositor_sources += 'compositor/kiosk-service.c'
|
||||
compositor_sources += 'compositor/kiosk-shell-service.c'
|
||||
compositor_sources += 'compositor/kiosk-x-keyboard-manager.c'
|
||||
compositor_sources += 'compositor/main.c'
|
||||
|
||||
foreach dbus_interface, sources: dbus_interface_sources_map
|
||||
compositor_sources += sources
|
||||
endforeach
|
||||
|
||||
executable('gnome-kiosk', compositor_sources,
|
||||
dependencies: compositor_dependencies,
|
||||
build_rpath: mutter_libdir,
|
||||
install_rpath: mutter_libdir,
|
||||
install: true
|
||||
)
|
||||
|
||||
desktop_config_data = configuration_data()
|
||||
desktop_config_data.set('bindir', bindir)
|
||||
|
||||
desktop_file = configure_file(
|
||||
input: 'compositor/data/org.gnome.Kiosk.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.desktop.in',
|
||||
configuration: desktop_config_data
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: desktop_file,
|
||||
output: 'org.gnome.Kiosk.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: desktop_data_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
+systemd_service_config_data = configuration_data()
|
||||
+systemd_service_config_data.set('bindir', bindir)
|
||||
+
|
||||
+systemd_service_files = []
|
||||
+systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@wayland.service.in'
|
||||
+systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@x11.service.in'
|
||||
+
|
||||
+foreach service_file : systemd_service_files
|
||||
+ configure_file(
|
||||
+ input: service_file,
|
||||
+ output: '@BASENAME@',
|
||||
+ configuration: systemd_service_config_data,
|
||||
+ install_dir: systemd_user_unit_dir
|
||||
+ )
|
||||
+endforeach
|
||||
+
|
||||
+install_data('compositor/data/systemd/org.gnome.Kiosk.target',
|
||||
+ install_dir: systemd_user_unit_dir)
|
||||
+
|
||||
session_config_data = configuration_data()
|
||||
session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;')
|
||||
|
||||
session_file = configure_file(
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.session.desktop.in',
|
||||
configuration: session_config_data
|
||||
)
|
||||
|
||||
subdir('input-selector')
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: session_file,
|
||||
output: 'org.gnome.Kiosk.SearchApp.session',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: session_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.Session.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: xsessions_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
search_app_desktop_file = configure_file(
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,309 @@
|
|||
From db768718666563f5ad9658ba4cc07987122b4e89 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 9 Aug 2021 10:30:36 -0400
|
||||
Subject: [PATCH 2/2] Add a script for simplifying kiosk setup
|
||||
|
||||
This commit adds a new session "Kiosk Script Session" to the login
|
||||
screen that starts a shell script that starts a gedit window that opens
|
||||
the shell script.
|
||||
|
||||
It should make it easy to customize the session to use a bespoke
|
||||
application from within the session itself.
|
||||
---
|
||||
.../org.gnome.Kiosk.Script.desktop.in.in | 4 ++
|
||||
kiosk-script/gnome-kiosk-script | 23 +++++++
|
||||
.../gnome-session/gnome-kiosk-script.session | 3 +
|
||||
.../systemd/org.gnome.Kiosk.Script.service.in | 8 +++
|
||||
kiosk-script/systemd/session.conf | 3 +
|
||||
.../gnome-kiosk-script-wayland.desktop.in | 9 +++
|
||||
.../gnome-kiosk-script-xorg.desktop.in | 9 +++
|
||||
meson.build | 61 ++++++++++++++++++-
|
||||
8 files changed, 118 insertions(+), 2 deletions(-)
|
||||
create mode 100644 kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
create mode 100755 kiosk-script/gnome-kiosk-script
|
||||
create mode 100644 kiosk-script/gnome-session/gnome-kiosk-script.session
|
||||
create mode 100644 kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
create mode 100644 kiosk-script/systemd/session.conf
|
||||
create mode 100644 kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
create mode 100644 kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
|
||||
|
||||
diff --git a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
new file mode 100644
|
||||
index 0000000..dd562b2
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
@@ -0,0 +1,4 @@
|
||||
+[Desktop Entry]
|
||||
+Name=Kiosk Script
|
||||
+Type=Application
|
||||
+Exec=gnome-kiosk-script
|
||||
diff --git a/kiosk-script/gnome-kiosk-script b/kiosk-script/gnome-kiosk-script
|
||||
new file mode 100755
|
||||
index 0000000..b595cd8
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/gnome-kiosk-script
|
||||
@@ -0,0 +1,23 @@
|
||||
+#!/usr/bin/sh
|
||||
+
|
||||
+if [ ! -e ~/.local/bin/gnome-kiosk-script ]; then
|
||||
+ mkdir -p ~/.local/bin ~/.config
|
||||
+ cat > ~/.local/bin/gnome-kiosk-script <<- "EOF"
|
||||
+ #!/bin/sh
|
||||
+ # This script is located in ~/.local/bin.
|
||||
+ # It's provided as an example script to show how
|
||||
+ # the kiosk session works. At the moment, the script
|
||||
+ # just starts a text editor open to itself, but it
|
||||
+ # should get customized to instead start a full screen
|
||||
+ # application designed for the kiosk deployment.
|
||||
+ gedit ~/.local/bin/gnome-kiosk-script
|
||||
+
|
||||
+ sleep 1.0
|
||||
+ exec "$0" "$@"
|
||||
+EOF
|
||||
+
|
||||
+ chmod +x ~/.local/bin/gnome-kiosk-script
|
||||
+ touch ~/.config/gnome-initial-setup-done
|
||||
+fi
|
||||
+
|
||||
+exec ~/.local/bin/gnome-kiosk-script "$@"
|
||||
diff --git a/kiosk-script/gnome-session/gnome-kiosk-script.session b/kiosk-script/gnome-session/gnome-kiosk-script.session
|
||||
new file mode 100644
|
||||
index 0000000..3b2cc7b
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/gnome-session/gnome-kiosk-script.session
|
||||
@@ -0,0 +1,3 @@
|
||||
+[GNOME Session]
|
||||
+Name=Kiosk
|
||||
+RequiredComponents=org.gnome.Kiosk;org.gnome.Kiosk.Script;
|
||||
diff --git a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
new file mode 100644
|
||||
index 0000000..8194f1c
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=Kiosk script
|
||||
+BindsTo=gnome-session.target
|
||||
+After=gnome-session.target
|
||||
+
|
||||
+[Service]
|
||||
+ExecStart=@bindir@/gnome-kiosk-script
|
||||
+Restart=always
|
||||
diff --git a/kiosk-script/systemd/session.conf b/kiosk-script/systemd/session.conf
|
||||
new file mode 100644
|
||||
index 0000000..a948efb
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/systemd/session.conf
|
||||
@@ -0,0 +1,3 @@
|
||||
+[Unit]
|
||||
+Requires=org.gnome.Kiosk.target
|
||||
+Requires=org.gnome.Kiosk.Script.service
|
||||
diff --git a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
new file mode 100644
|
||||
index 0000000..05e8dea
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
@@ -0,0 +1,9 @@
|
||||
+[Desktop Entry]
|
||||
+Name=Kiosk Script Session (Wayland Display Server)
|
||||
+Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
|
||||
+Exec=gnome-session --session gnome-kiosk-script
|
||||
+TryExec=gnome-session
|
||||
+Type=Application
|
||||
+DesktopNames=GNOME-Kiosk;GNOME;
|
||||
+X-GDM-SessionRegisters=true
|
||||
+
|
||||
diff --git a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in b/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
|
||||
new file mode 100644
|
||||
index 0000000..11dc0cf
|
||||
--- /dev/null
|
||||
+++ b/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
|
||||
@@ -0,0 +1,9 @@
|
||||
+[Desktop Entry]
|
||||
+Name=Kiosk Script Session (X11 Display Server)
|
||||
+Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
|
||||
+Exec=gnome-session --session gnome-kiosk-script
|
||||
+TryExec=gnome-session
|
||||
+Type=Application
|
||||
+DesktopNames=GNOME-Kiosk;GNOME;
|
||||
+X-GDM-SessionRegisters=true
|
||||
+
|
||||
diff --git a/meson.build b/meson.build
|
||||
index c2988ad..1f5a756 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1,49 +1,50 @@
|
||||
project('gnome-kiosk', 'c',
|
||||
version: '40.0'
|
||||
)
|
||||
add_project_arguments('-D_GNU_SOURCE',
|
||||
language: 'c'
|
||||
)
|
||||
|
||||
c_compiler = meson.get_compiler('c')
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
|
||||
prefix = get_option('prefix')
|
||||
datadir = join_paths(prefix, get_option('datadir'))
|
||||
bindir = join_paths(prefix, get_option('bindir'))
|
||||
localedir = join_paths(datadir, 'locale')
|
||||
desktop_data_dir = join_paths(datadir, 'applications')
|
||||
session_dir = join_paths(datadir, 'gnome-session', 'sessions')
|
||||
xsessions_dir = join_paths(datadir, 'xsessions')
|
||||
+wayland_sessions_dir = join_paths(datadir, 'wayland-sessions')
|
||||
|
||||
po_dir = join_paths(meson.current_source_dir(), 'po')
|
||||
|
||||
config_data = configuration_data()
|
||||
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
||||
config_data.set_quoted('VERSION', meson.project_version())
|
||||
config_data.set_quoted('LOCALEDIR', localedir)
|
||||
|
||||
config_h = configure_file(
|
||||
input: 'config.h.meson',
|
||||
output: 'config.h',
|
||||
configuration: config_data
|
||||
)
|
||||
|
||||
meson.add_install_script ('meson/postinstall.py')
|
||||
|
||||
mutter_dependency = dependency('libmutter-8')
|
||||
mutter_libdir = mutter_dependency.get_pkgconfig_variable('typelibdir')
|
||||
|
||||
systemd_user_unit_dir = dependency('systemd').get_pkgconfig_variable('systemduserunitdir',
|
||||
define_variable: ['prefix', prefix])
|
||||
systemd_dependency = dependency('libsystemd')
|
||||
|
||||
dbus_proxies = []
|
||||
dbus_proxies += {
|
||||
'prefix': 'org.gnome.DisplayManager',
|
||||
'namespace': 'Gdm',
|
||||
'interface': 'Manager',
|
||||
}
|
||||
|
||||
@@ -139,62 +140,118 @@ desktop_file = configure_file(
|
||||
input: 'compositor/data/org.gnome.Kiosk.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.desktop.in',
|
||||
configuration: desktop_config_data
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: desktop_file,
|
||||
output: 'org.gnome.Kiosk.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: desktop_data_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
systemd_service_config_data = configuration_data()
|
||||
systemd_service_config_data.set('bindir', bindir)
|
||||
|
||||
systemd_service_files = []
|
||||
systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@wayland.service.in'
|
||||
systemd_service_files += 'compositor/data/systemd/org.gnome.Kiosk@x11.service.in'
|
||||
|
||||
foreach service_file : systemd_service_files
|
||||
configure_file(
|
||||
input: service_file,
|
||||
output: '@BASENAME@',
|
||||
configuration: systemd_service_config_data,
|
||||
install_dir: systemd_user_unit_dir
|
||||
)
|
||||
endforeach
|
||||
|
||||
-install_data('compositor/data/systemd/org.gnome.Kiosk.target',
|
||||
- install_dir: systemd_user_unit_dir)
|
||||
+install_data(
|
||||
+ 'compositor/data/systemd/org.gnome.Kiosk.target',
|
||||
+ install_dir: systemd_user_unit_dir
|
||||
+)
|
||||
+
|
||||
+install_data('kiosk-script/gnome-kiosk-script',
|
||||
+ install_dir: bindir,
|
||||
+ install_mode: 'rwxr-xr-x'
|
||||
+)
|
||||
+
|
||||
+desktop_file = configure_file(
|
||||
+ input: 'kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in',
|
||||
+ output: 'org.gnome.Kiosk.Script.desktop.in',
|
||||
+ configuration: desktop_config_data
|
||||
+)
|
||||
+
|
||||
+i18n.merge_file('desktop',
|
||||
+ input: desktop_file,
|
||||
+ output: 'org.gnome.Kiosk.Script.desktop',
|
||||
+ po_dir: po_dir,
|
||||
+ install: true,
|
||||
+ install_dir: desktop_data_dir,
|
||||
+ type: 'desktop'
|
||||
+)
|
||||
+
|
||||
+configure_file(
|
||||
+ input: 'kiosk-script/systemd/org.gnome.Kiosk.Script.service.in',
|
||||
+ output: '@BASENAME@',
|
||||
+ configuration: systemd_service_config_data,
|
||||
+ install_dir: systemd_user_unit_dir
|
||||
+)
|
||||
+
|
||||
+kiosk_script_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@gnome-kiosk-script.target.d')
|
||||
+install_data('kiosk-script/systemd/session.conf',
|
||||
+ install_dir: kiosk_script_systemd_target_dir
|
||||
+)
|
||||
+
|
||||
+install_data('kiosk-script/gnome-session/gnome-kiosk-script.session',
|
||||
+ install_dir: session_dir,
|
||||
+)
|
||||
+
|
||||
+i18n.merge_file('desktop',
|
||||
+ input: 'kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in',
|
||||
+ output: '@BASENAME@',
|
||||
+ po_dir: po_dir,
|
||||
+ install: true,
|
||||
+ install_dir: xsessions_dir,
|
||||
+ type: 'desktop'
|
||||
+)
|
||||
+
|
||||
+i18n.merge_file('desktop',
|
||||
+ input: 'kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in',
|
||||
+ output: '@BASENAME@',
|
||||
+ po_dir: po_dir,
|
||||
+ install: true,
|
||||
+ install_dir: wayland_sessions_dir,
|
||||
+ type: 'desktop'
|
||||
+)
|
||||
|
||||
session_config_data = configuration_data()
|
||||
session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;')
|
||||
|
||||
session_file = configure_file(
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.session.desktop.in',
|
||||
configuration: session_config_data
|
||||
)
|
||||
|
||||
subdir('input-selector')
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: session_file,
|
||||
output: 'org.gnome.Kiosk.SearchApp.session',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: session_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.Session.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: xsessions_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
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
|
||||
|
||||
At some point during development something called
|
||||
KioskInputSources got renamed to KioskInputSourceGroup.
|
||||
|
||||
Unfortunately, my sed-fu was weak and I renamed things it shouldn't.
|
||||
|
||||
This commit fixes the errors.
|
||||
---
|
||||
compositor/kiosk-input-sources-manager.c | 20 ++++++++++----------
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/compositor/kiosk-input-sources-manager.c b/compositor/kiosk-input-sources-manager.c
|
||||
index 58d7a4c..a1a4cfa 100644
|
||||
--- a/compositor/kiosk-input-sources-manager.c
|
||||
+++ b/compositor/kiosk-input-sources-manager.c
|
||||
@@ -1,60 +1,60 @@
|
||||
#include "config.h"
|
||||
#include "kiosk-input-sources-manager.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include <meta/display.h>
|
||||
#include <meta/keybindings.h>
|
||||
#include <meta/util.h>
|
||||
|
||||
#include <meta/meta-backend.h>
|
||||
#include <meta/meta-plugin.h>
|
||||
|
||||
#define GNOME_DESKTOP_USE_UNSTABLE_API
|
||||
#include <libgnome-desktop/gnome-languages.h>
|
||||
#include <libgnome-desktop/gnome-xkb-info.h>
|
||||
|
||||
#include "org.freedesktop.locale1.h"
|
||||
#include "kiosk-compositor.h"
|
||||
#include "kiosk-dbus-utils.h"
|
||||
#include "kiosk-gobject-utils.h"
|
||||
#include "kiosk-input-engine-manager.h"
|
||||
#include "kiosk-input-source-group.h"
|
||||
|
||||
#define SD_LOCALE1_BUS_NAME "org.freedesktop.locale1"
|
||||
#define SD_LOCALE1_OBJECT_PATH "/org/freedesktop/locale1"
|
||||
|
||||
-#define KIOSK_INPUT_SOURCE_GROUP_SCHEMA "org.gnome.desktop.input-sources"
|
||||
-#define KIOSK_INPUT_SOURCE_GROUP_SETTING "sources"
|
||||
+#define KIOSK_INPUT_SOURCES_SCHEMA "org.gnome.desktop.input-sources"
|
||||
+#define KIOSK_INPUT_SOURCES_SETTING "sources"
|
||||
#define KIOSK_INPUT_OPTIONS_SETTING "xkb-options"
|
||||
|
||||
#define KIOSK_INPUT_SOURCE_OBJECTS_PATH_PREFIX "/org/gnome/Kiosk/InputSources"
|
||||
#define KIOSK_KEYBINDINGS_SCHEMA "org.gnome.desktop.wm.keybindings"
|
||||
#define KIOSK_SWITCH_INPUT_SOURCES_KEYBINDING "switch-input-source"
|
||||
#define KIOSK_SWITCH_INPUT_SOURCES_BACKWARD_KEYBINDING "switch-input-source-backward"
|
||||
|
||||
#define KIOSK_DBUS_INPUT_SOURCES_MANGER_INPUT_SOURCE_INTERFACE "org.gnome.Kiosk.InputSources.InputSource"
|
||||
|
||||
struct _KioskInputSourcesManager
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
/* weak references */
|
||||
KioskCompositor *compositor;
|
||||
MetaDisplay *display;
|
||||
|
||||
KioskDBusInputSourcesManager *dbus_service;
|
||||
GDBusObjectManagerServer *dbus_object_manager;
|
||||
|
||||
/* strong references */
|
||||
GCancellable *cancellable;
|
||||
KioskInputEngineManager *input_engine_manager;
|
||||
SdLocale1 *locale_proxy;
|
||||
GnomeXkbInfo *xkb_info;
|
||||
GSettings *input_sources_settings;
|
||||
GSettings *key_binding_settings;
|
||||
GPtrArray *input_source_groups;
|
||||
|
||||
/* state */
|
||||
@@ -913,94 +913,94 @@ kiosk_input_sources_manager_set_input_sources_from_system_configuration (KioskIn
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_session_input_configuration_changed (KioskInputSourcesManager *self)
|
||||
{
|
||||
g_debug ("KioskInputSourcesManager: Session input sources configuration changed");
|
||||
|
||||
if (self->overriding_configuration) {
|
||||
g_debug ("KioskInputSourcesManager: Ignoring change, because keymap is overriden");
|
||||
return;
|
||||
}
|
||||
|
||||
kiosk_input_sources_manager_set_input_sources_from_session_configuration (self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_session_input_sources_setting_changed (KioskInputSourcesManager *self)
|
||||
{
|
||||
kiosk_gobject_utils_queue_defer_callback (G_OBJECT (self),
|
||||
"[kiosk-input-sources-manager] on_session_input_configuration_changed",
|
||||
self->cancellable,
|
||||
KIOSK_OBJECT_CALLBACK (on_session_input_configuration_changed),
|
||||
NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
kiosk_input_sources_manager_set_input_sources_from_session_configuration (KioskInputSourcesManager *self)
|
||||
{
|
||||
- g_autoptr (GVariant) input_source_group = NULL;
|
||||
+ g_autoptr (GVariant) input_sources = NULL;
|
||||
g_auto (GStrv) options = NULL;
|
||||
- gboolean input_source_group_active;
|
||||
+ gboolean input_sources_active;
|
||||
|
||||
g_return_val_if_fail (KIOSK_IS_INPUT_SOURCES_MANAGER (self), FALSE);
|
||||
|
||||
g_debug ("KioskInputSourcesManager: Setting input sources from session configuration");
|
||||
|
||||
self->overriding_configuration = FALSE;
|
||||
|
||||
if (self->input_sources_settings == NULL) {
|
||||
- self->input_sources_settings = g_settings_new (KIOSK_INPUT_SOURCE_GROUP_SCHEMA);
|
||||
+ self->input_sources_settings = g_settings_new (KIOSK_INPUT_SOURCES_SCHEMA);
|
||||
|
||||
g_signal_connect_object (G_OBJECT (self->input_sources_settings),
|
||||
- "changed::" KIOSK_INPUT_SOURCE_GROUP_SETTING,
|
||||
+ "changed::" KIOSK_INPUT_SOURCES_SETTING,
|
||||
G_CALLBACK (on_session_input_sources_setting_changed),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (G_OBJECT (self->input_sources_settings),
|
||||
"changed::" KIOSK_INPUT_OPTIONS_SETTING,
|
||||
G_CALLBACK (on_session_input_sources_setting_changed),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
|
||||
options = g_settings_get_strv (self->input_sources_settings, KIOSK_INPUT_OPTIONS_SETTING);
|
||||
|
||||
- input_source_group = g_settings_get_value (self->input_sources_settings,
|
||||
- KIOSK_INPUT_SOURCE_GROUP_SETTING);
|
||||
+ input_sources = g_settings_get_value (self->input_sources_settings,
|
||||
+ KIOSK_INPUT_SOURCES_SETTING);
|
||||
|
||||
- input_source_group_active = kiosk_input_sources_manager_set_input_sources (self, input_source_group, (const char * const *) options);
|
||||
+ input_sources_active = kiosk_input_sources_manager_set_input_sources (self, input_sources, (const char * const *) options);
|
||||
|
||||
- if (!input_source_group_active) {
|
||||
+ if (!input_sources_active) {
|
||||
g_debug ("KioskInputSourcesManager: Session has no valid configured input sources");
|
||||
return kiosk_input_sources_manager_set_input_sources_from_system_configuration (self);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
kiosk_input_sources_manager_set_input_sources_from_locales (KioskInputSourcesManager *self,
|
||||
const char * const *locales,
|
||||
const char *options)
|
||||
{
|
||||
KioskInputSourceGroup *old_input_source_group;
|
||||
g_autofree char *old_selected_layout = NULL;
|
||||
g_autofree char *old_input_engine = NULL;
|
||||
g_autofree char *locales_string = NULL;
|
||||
gboolean input_source_group_active;
|
||||
|
||||
g_return_val_if_fail (KIOSK_IS_INPUT_SOURCES_MANAGER (self), FALSE);
|
||||
g_return_val_if_fail (locales != NULL, FALSE);
|
||||
|
||||
locales_string = g_strjoinv (",", (GStrv) locales);
|
||||
|
||||
g_debug ("KioskInputSourcesManager: Setting keymap from locales '%s'",
|
||||
locales_string);
|
||||
|
||||
self->overriding_configuration = TRUE;
|
||||
|
||||
old_input_source_group = kiosk_input_sources_manager_get_selected_input_source_group (self);
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From dccfdfa0852cba4b2ccd7d0daa8f9c779af4cb16 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 14:51:22 -0400
|
||||
Subject: [PATCH 2/6] kiosk-script: Make sure desktop file for script is hidden
|
||||
under systemd
|
||||
|
||||
At the moment the kiosk-script session supports both systemd --user
|
||||
sessions and old school gonme-session-only sessions. Unfortunately,
|
||||
the desktop file for the Script application is missing the magic line
|
||||
to make it get ignored when systemd --user is used.
|
||||
|
||||
That leads to the script getting started twice
|
||||
|
||||
This commit adds the magic line.
|
||||
---
|
||||
kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
index dd562b2..981dbc9 100644
|
||||
--- a/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
+++ b/kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in
|
||||
@@ -1,4 +1,5 @@
|
||||
[Desktop Entry]
|
||||
Name=Kiosk Script
|
||||
Type=Application
|
||||
Exec=gnome-kiosk-script
|
||||
+X-GNOME-HiddenUnderSystemd=true
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
From b321b57e2908fddcde9da31e0d71af54c3e2cd98 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 15 Apr 2021 14:41:41 -0400
|
||||
Subject: [PATCH 3/4] input-sources-manager: Add function to load input sources
|
||||
from strings
|
||||
|
||||
kiosk_input_sources_manager_set_input_sources_from_system_settings
|
||||
currently has code to load fetch the strings from localed and then
|
||||
use them.
|
||||
|
||||
This commit moves the "use them" part to its own function so it can
|
||||
be reused in a subsequent commit for something else.
|
||||
---
|
||||
compositor/kiosk-input-sources-manager.c | 73 ++++++++++++++++--------
|
||||
1 file changed, 48 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/compositor/kiosk-input-sources-manager.c b/compositor/kiosk-input-sources-manager.c
|
||||
index a1a4cfa..4b4ef62 100644
|
||||
--- a/compositor/kiosk-input-sources-manager.c
|
||||
+++ b/compositor/kiosk-input-sources-manager.c
|
||||
@@ -793,147 +793,170 @@ kiosk_input_sources_manager_add_layout (KioskInputSourcesManager *self,
|
||||
input_source_group = kiosk_input_sources_manager_add_new_input_source_group (self, options);
|
||||
}
|
||||
|
||||
mapping_full = !kiosk_input_source_group_add_layout (input_source_group, xkb_layout, xkb_variant);
|
||||
|
||||
if (mapping_full) {
|
||||
g_debug ("KioskInputSourcesManager: Keyboard mapping full, starting another one");
|
||||
|
||||
input_source_group = kiosk_input_sources_manager_add_new_input_source_group (self, options);
|
||||
|
||||
kiosk_input_source_group_add_layout (input_source_group, xkb_layout, xkb_variant);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
kiosk_input_sources_manager_add_input_engine (KioskInputSourcesManager *self,
|
||||
const char *engine_name,
|
||||
const char *options)
|
||||
{
|
||||
KioskInputSourceGroup *input_source_group = NULL;
|
||||
|
||||
g_debug ("KioskInputSourcesManager: Adding input engine '%s'", engine_name);
|
||||
|
||||
input_source_group = kiosk_input_sources_manager_add_new_input_source_group (self, options);
|
||||
|
||||
kiosk_input_source_group_set_input_engine (input_source_group, engine_name);
|
||||
kiosk_input_source_group_set_options (input_source_group, options);
|
||||
}
|
||||
|
||||
|
||||
-gboolean
|
||||
-kiosk_input_sources_manager_set_input_sources_from_system_configuration (KioskInputSourcesManager *self)
|
||||
+static gboolean
|
||||
+kiosk_input_sources_manager_set_input_sources_from_strings (KioskInputSourcesManager *self,
|
||||
+ const char *layouts_string,
|
||||
+ const char *variants_string,
|
||||
+ const char *options_string)
|
||||
{
|
||||
KioskInputSourceGroup *old_input_source_group;
|
||||
g_autofree char *old_input_engine = NULL;
|
||||
g_autofree char *old_selected_layout = NULL;
|
||||
|
||||
- const char *layouts_string = NULL;
|
||||
g_auto (GStrv) layouts = NULL;
|
||||
size_t number_of_layouts = 0;
|
||||
|
||||
- const char *variants_string = NULL;
|
||||
g_auto (GStrv) variants = NULL;
|
||||
size_t number_of_variants = 0;
|
||||
|
||||
- const char *options = NULL;
|
||||
size_t i, j;
|
||||
|
||||
- gboolean input_source_group_active;
|
||||
+ gboolean input_sources_active;
|
||||
|
||||
g_return_val_if_fail (KIOSK_IS_INPUT_SOURCES_MANAGER (self), FALSE);
|
||||
|
||||
- if (self->locale_proxy == NULL) {
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
- g_debug ("KioskInputSourcesManager: Setting keymap from system configuration");
|
||||
-
|
||||
- layouts_string = sd_locale1_get_x11_layout (self->locale_proxy);
|
||||
- g_debug ("KioskInputSourcesManager: System layout is '%s'", layouts_string);
|
||||
-
|
||||
layouts = g_strsplit (layouts_string, ",", -1);
|
||||
number_of_layouts = g_strv_length (layouts);
|
||||
|
||||
- options = sd_locale1_get_x11_options (self->locale_proxy);
|
||||
- g_debug ("KioskInputSourcesManager: System layout options are '%s'", options);
|
||||
-
|
||||
- variants_string = sd_locale1_get_x11_variant (self->locale_proxy);
|
||||
- g_debug ("KioskInputSourcesManager: System layout variant is '%s'", variants_string);
|
||||
variants = g_strsplit (variants_string, ",", -1);
|
||||
number_of_variants = g_strv_length (variants);
|
||||
|
||||
if (number_of_layouts < number_of_variants) {
|
||||
g_debug ("KioskInputSourcesManager: There is a layout variant mismatch");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
old_input_source_group = kiosk_input_sources_manager_get_selected_input_source_group (self);
|
||||
|
||||
if (old_input_source_group != NULL) {
|
||||
old_input_engine = g_strdup (kiosk_input_source_group_get_input_engine (old_input_source_group));
|
||||
old_selected_layout = kiosk_input_source_group_get_selected_layout (old_input_source_group);
|
||||
}
|
||||
|
||||
kiosk_input_sources_manager_clear_input_sources (self);
|
||||
|
||||
for (i = 0, j = 0; layouts[i] != NULL; i++) {
|
||||
char *id = NULL;
|
||||
const char *layout = layouts[i];
|
||||
const char *variant = "";
|
||||
|
||||
if (variants[j] != NULL) {
|
||||
variant = variants[j++];
|
||||
}
|
||||
|
||||
if (variant[0] == '\0') {
|
||||
id = g_strdup (layout);
|
||||
} else {
|
||||
id = g_strdup_printf ("%s+%s", layout, variant);
|
||||
}
|
||||
|
||||
- kiosk_input_sources_manager_add_layout (self, id, options);
|
||||
+ kiosk_input_sources_manager_add_layout (self, id, options_string);
|
||||
}
|
||||
|
||||
- input_source_group_active = activate_best_available_input_source_group (self, old_input_engine, old_selected_layout);
|
||||
+ input_sources_active = activate_best_available_input_source_group (self, old_input_engine, old_selected_layout);
|
||||
|
||||
- if (!input_source_group_active) {
|
||||
+ if (!input_sources_active) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ sync_dbus_service (self);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+gboolean
|
||||
+kiosk_input_sources_manager_set_input_sources_from_system_configuration (KioskInputSourcesManager *self)
|
||||
+{
|
||||
+ const char *layouts_string = NULL;
|
||||
+ const char *variants_string = NULL;
|
||||
+ const char *options = NULL;
|
||||
+
|
||||
+ gboolean input_sources_active;
|
||||
+
|
||||
+ g_return_val_if_fail (KIOSK_IS_INPUT_SOURCES_MANAGER (self), FALSE);
|
||||
+
|
||||
+ if (self->locale_proxy == NULL) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ g_debug ("KioskInputSourcesManager: Setting keymap from system configuration");
|
||||
+
|
||||
+ layouts_string = sd_locale1_get_x11_layout (self->locale_proxy);
|
||||
+ g_debug ("KioskInputSourcesManager: System layout is '%s'", layouts_string);
|
||||
+
|
||||
+ options = sd_locale1_get_x11_options (self->locale_proxy);
|
||||
+ g_debug ("KioskInputSourcesManager: System layout options are '%s'", options);
|
||||
+
|
||||
+ variants_string = sd_locale1_get_x11_variant (self->locale_proxy);
|
||||
+ g_debug ("KioskInputSourcesManager: System layout variant is '%s'", variants_string);
|
||||
+
|
||||
+ input_sources_active = kiosk_input_sources_manager_set_input_sources_from_strings (self, layouts_string, variants_string, options);
|
||||
+
|
||||
+ if (!input_sources_active) {
|
||||
const char * const *locales;
|
||||
|
||||
locales = sd_locale1_get_locale (self->locale_proxy);
|
||||
- input_source_group_active = kiosk_input_sources_manager_set_input_sources_from_locales (self, locales, options);
|
||||
+ input_sources_active = kiosk_input_sources_manager_set_input_sources_from_locales (self, locales, options);
|
||||
}
|
||||
|
||||
sync_dbus_service (self);
|
||||
self->overriding_configuration = FALSE;
|
||||
|
||||
- if (!input_source_group_active) {
|
||||
+ if (!input_sources_active) {
|
||||
g_debug ("KioskInputSourcesManager: System has no valid configured input sources");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_session_input_configuration_changed (KioskInputSourcesManager *self)
|
||||
{
|
||||
g_debug ("KioskInputSourcesManager: Session input sources configuration changed");
|
||||
|
||||
if (self->overriding_configuration) {
|
||||
g_debug ("KioskInputSourcesManager: Ignoring change, because keymap is overriden");
|
||||
return;
|
||||
}
|
||||
|
||||
kiosk_input_sources_manager_set_input_sources_from_session_configuration (self);
|
||||
}
|
||||
|
||||
static void
|
||||
on_session_input_sources_setting_changed (KioskInputSourcesManager *self)
|
||||
{
|
||||
kiosk_gobject_utils_queue_defer_callback (G_OBJECT (self),
|
||||
"[kiosk-input-sources-manager] on_session_input_configuration_changed",
|
||||
self->cancellable,
|
||||
KIOSK_OBJECT_CALLBACK (on_session_input_configuration_changed),
|
||||
NULL);
|
||||
}
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
From 0a9f3dc7cd45bda1fae2e17ab5ef17b1187327a2 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 15:00:20 -0400
|
||||
Subject: [PATCH 3/6] kiosk-script: Install session file with fallback in mind
|
||||
|
||||
---
|
||||
meson/postinstall.py | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson/postinstall.py b/meson/postinstall.py
|
||||
index 537fb3f..ace3927 100755
|
||||
--- a/meson/postinstall.py
|
||||
+++ b/meson/postinstall.py
|
||||
@@ -1,38 +1,44 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
destdir = os.environ.get('DESTDIR', '/')
|
||||
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
||||
datadir = os.path.join(destdir + prefix, 'share')
|
||||
|
||||
+xsessions_dir = os.path.join(datadir, 'xsessions')
|
||||
wayland_sessions_dir = os.path.join(datadir, 'wayland-sessions')
|
||||
if not os.path.exists(wayland_sessions_dir):
|
||||
os.makedirs(wayland_sessions_dir)
|
||||
|
||||
-source_file = os.path.join(datadir, 'xsessions', 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
||||
+source_file = os.path.join(xsessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
||||
destination_file = os.path.join(wayland_sessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
||||
shutil.copyfile(source_file, destination_file)
|
||||
|
||||
+source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script-xorg.desktop')
|
||||
+destination_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop')
|
||||
+source_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script-wayland.desktop')
|
||||
+destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop')
|
||||
+
|
||||
# Packaging tools define DESTDIR and this isn't needed for them
|
||||
if 'DESTDIR' not in os.environ:
|
||||
print('Updating icon cache...')
|
||||
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
|
||||
if not os.path.exists(icon_cache_dir):
|
||||
os.makedirs(icon_cache_dir)
|
||||
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
|
||||
|
||||
print('Updating desktop database...')
|
||||
desktop_database_dir = os.path.join(datadir, 'applications')
|
||||
if not os.path.exists(desktop_database_dir):
|
||||
os.makedirs(desktop_database_dir)
|
||||
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
|
||||
|
||||
print('Compiling GSettings schemas...')
|
||||
schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
|
||||
if not os.path.exists(schemas_dir):
|
||||
os.makedirs(schemas_dir)
|
||||
subprocess.call(['glib-compile-schemas', schemas_dir])
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,188 @@
|
|||
From 2bd27ae9e08d6848ab14cde0a8bf81827df7a98b Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 15:03:38 -0400
|
||||
Subject: [PATCH 4/6] kiosk-script: Give xsession and wayland-session file the
|
||||
same name
|
||||
|
||||
In order for fallback logic to work properly, the two session names
|
||||
need to be the same.
|
||||
|
||||
This commit fixes that.
|
||||
---
|
||||
.../gnome-kiosk-script.desktop.in} | 2 +-
|
||||
.../gnome-kiosk-script-wayland.desktop.in | 9 ---------
|
||||
meson.build | 12 ++----------
|
||||
meson/postinstall.py | 5 ++---
|
||||
4 files changed, 5 insertions(+), 23 deletions(-)
|
||||
rename kiosk-script/{xsessions/gnome-kiosk-script-xorg.desktop.in => sessions/gnome-kiosk-script.desktop.in} (84%)
|
||||
delete mode 100644 kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
|
||||
diff --git a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in b/kiosk-script/sessions/gnome-kiosk-script.desktop.in
|
||||
similarity index 84%
|
||||
rename from kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
|
||||
rename to kiosk-script/sessions/gnome-kiosk-script.desktop.in
|
||||
index 11dc0cf..36f810f 100644
|
||||
--- a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
|
||||
+++ b/kiosk-script/sessions/gnome-kiosk-script.desktop.in
|
||||
@@ -1,9 +1,9 @@
|
||||
[Desktop Entry]
|
||||
-Name=Kiosk Script Session (X11 Display Server)
|
||||
+Name=Kiosk Script Session
|
||||
Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
|
||||
Exec=gnome-session --session gnome-kiosk-script
|
||||
TryExec=gnome-session
|
||||
Type=Application
|
||||
DesktopNames=GNOME-Kiosk;GNOME;
|
||||
X-GDM-SessionRegisters=true
|
||||
|
||||
diff --git a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
deleted file mode 100644
|
||||
index 05e8dea..0000000
|
||||
--- a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
|
||||
+++ /dev/null
|
||||
@@ -1,9 +0,0 @@
|
||||
-[Desktop Entry]
|
||||
-Name=Kiosk Script Session (Wayland Display Server)
|
||||
-Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
|
||||
-Exec=gnome-session --session gnome-kiosk-script
|
||||
-TryExec=gnome-session
|
||||
-Type=Application
|
||||
-DesktopNames=GNOME-Kiosk;GNOME;
|
||||
-X-GDM-SessionRegisters=true
|
||||
-
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 1f5a756..0faf9fe 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -181,75 +181,67 @@ desktop_file = configure_file(
|
||||
input: 'kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.Script.desktop.in',
|
||||
configuration: desktop_config_data
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: desktop_file,
|
||||
output: 'org.gnome.Kiosk.Script.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: desktop_data_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
configure_file(
|
||||
input: 'kiosk-script/systemd/org.gnome.Kiosk.Script.service.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: systemd_service_config_data,
|
||||
install_dir: systemd_user_unit_dir
|
||||
)
|
||||
|
||||
kiosk_script_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@gnome-kiosk-script.target.d')
|
||||
install_data('kiosk-script/systemd/session.conf',
|
||||
install_dir: kiosk_script_systemd_target_dir
|
||||
)
|
||||
|
||||
install_data('kiosk-script/gnome-session/gnome-kiosk-script.session',
|
||||
install_dir: session_dir,
|
||||
)
|
||||
|
||||
-i18n.merge_file('desktop',
|
||||
- input: 'kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in',
|
||||
- output: '@BASENAME@',
|
||||
- po_dir: po_dir,
|
||||
- install: true,
|
||||
- install_dir: xsessions_dir,
|
||||
- type: 'desktop'
|
||||
-)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
- input: 'kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in',
|
||||
+ input: 'kiosk-script/sessions/gnome-kiosk-script.desktop.in',
|
||||
output: '@BASENAME@',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
- install_dir: wayland_sessions_dir,
|
||||
+ install_dir: xsessions_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
session_config_data = configuration_data()
|
||||
session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;')
|
||||
|
||||
session_file = configure_file(
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.session.desktop.in',
|
||||
configuration: session_config_data
|
||||
)
|
||||
|
||||
subdir('input-selector')
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: session_file,
|
||||
output: 'org.gnome.Kiosk.SearchApp.session',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: session_dir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in',
|
||||
output: 'org.gnome.Kiosk.SearchApp.Session.desktop',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: xsessions_dir,
|
||||
type: 'desktop'
|
||||
diff --git a/meson/postinstall.py b/meson/postinstall.py
|
||||
index ace3927..430ae6c 100755
|
||||
--- a/meson/postinstall.py
|
||||
+++ b/meson/postinstall.py
|
||||
@@ -1,44 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
destdir = os.environ.get('DESTDIR', '/')
|
||||
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
||||
datadir = os.path.join(destdir + prefix, 'share')
|
||||
|
||||
xsessions_dir = os.path.join(datadir, 'xsessions')
|
||||
wayland_sessions_dir = os.path.join(datadir, 'wayland-sessions')
|
||||
if not os.path.exists(wayland_sessions_dir):
|
||||
os.makedirs(wayland_sessions_dir)
|
||||
|
||||
source_file = os.path.join(xsessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
||||
destination_file = os.path.join(wayland_sessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
||||
shutil.copyfile(source_file, destination_file)
|
||||
|
||||
-source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script-xorg.desktop')
|
||||
-destination_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop')
|
||||
-source_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script-wayland.desktop')
|
||||
+source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop')
|
||||
destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop')
|
||||
+shutil.copyfile(source_file, destination_file)
|
||||
|
||||
# Packaging tools define DESTDIR and this isn't needed for them
|
||||
if 'DESTDIR' not in os.environ:
|
||||
print('Updating icon cache...')
|
||||
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
|
||||
if not os.path.exists(icon_cache_dir):
|
||||
os.makedirs(icon_cache_dir)
|
||||
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
|
||||
|
||||
print('Updating desktop database...')
|
||||
desktop_database_dir = os.path.join(datadir, 'applications')
|
||||
if not os.path.exists(desktop_database_dir):
|
||||
os.makedirs(desktop_database_dir)
|
||||
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
|
||||
|
||||
print('Compiling GSettings schemas...')
|
||||
schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
|
||||
if not os.path.exists(schemas_dir):
|
||||
os.makedirs(schemas_dir)
|
||||
subprocess.call(['glib-compile-schemas', schemas_dir])
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,46 @@
|
|||
From eeb5eb5688fd55fad3bb7e07c250cdd1f580b5ca Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 15:05:22 -0400
|
||||
Subject: [PATCH 5/6] kiosk-script: Add a hint about using firefox to the kiosk
|
||||
script
|
||||
|
||||
Many kiosk deployments are going to use a web browser, so it makes
|
||||
sense to give a hint about how to do that.
|
||||
|
||||
This commit suggests firefox --kiosk in the script comment
|
||||
---
|
||||
kiosk-script/gnome-kiosk-script | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/kiosk-script/gnome-kiosk-script b/kiosk-script/gnome-kiosk-script
|
||||
index b595cd8..989af41 100755
|
||||
--- a/kiosk-script/gnome-kiosk-script
|
||||
+++ b/kiosk-script/gnome-kiosk-script
|
||||
@@ -1,23 +1,24 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
if [ ! -e ~/.local/bin/gnome-kiosk-script ]; then
|
||||
mkdir -p ~/.local/bin ~/.config
|
||||
cat > ~/.local/bin/gnome-kiosk-script <<- "EOF"
|
||||
#!/bin/sh
|
||||
# This script is located in ~/.local/bin.
|
||||
# It's provided as an example script to show how
|
||||
# the kiosk session works. At the moment, the script
|
||||
# just starts a text editor open to itself, but it
|
||||
# should get customized to instead start a full screen
|
||||
# application designed for the kiosk deployment.
|
||||
+ # e.g., firefox --kiosk https://www.google.com
|
||||
gedit ~/.local/bin/gnome-kiosk-script
|
||||
|
||||
sleep 1.0
|
||||
exec "$0" "$@"
|
||||
EOF
|
||||
|
||||
chmod +x ~/.local/bin/gnome-kiosk-script
|
||||
touch ~/.config/gnome-initial-setup-done
|
||||
fi
|
||||
|
||||
exec ~/.local/bin/gnome-kiosk-script "$@"
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 3e9a6ea82edc0bbd57c0d3088186c30823b956ec Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 11 Aug 2021 15:06:42 -0400
|
||||
Subject: [PATCH 6/6] kiosk-script: Send SIGHUP to script at shutdown time
|
||||
|
||||
Since the kiosk script is a shell script, it ignores SIGTERM.
|
||||
We should send it a hang up signal first to make it comply.
|
||||
---
|
||||
kiosk-script/systemd/org.gnome.Kiosk.Script.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
index 8194f1c..e4da546 100644
|
||||
--- a/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
+++ b/kiosk-script/systemd/org.gnome.Kiosk.Script.service.in
|
||||
@@ -1,8 +1,9 @@
|
||||
[Unit]
|
||||
Description=Kiosk script
|
||||
BindsTo=gnome-session.target
|
||||
After=gnome-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@bindir@/gnome-kiosk-script
|
||||
Restart=always
|
||||
+SendSIGHUP=true
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: desktop-qe.desktop-ci.tier1-gating.functional}
|
|
@ -11,7 +11,7 @@
|
|||
%global gnome_settings_daemon_version 40~rc
|
||||
|
||||
Name: gnome-kiosk
|
||||
Version: 40~alpha
|
||||
Version: 40.0
|
||||
Release: 5%{?dist}
|
||||
Summary: Window management and application launching for GNOME
|
||||
|
||||
|
@ -19,6 +19,8 @@ License: GPLv2+
|
|||
URL: https://gitlab.gnome.org/halfline/gnome-kiosk
|
||||
Source0: https://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz
|
||||
|
||||
Provides: firstboot(windowmanager) = %{name}
|
||||
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext >= %{gettext_version}
|
||||
|
@ -37,14 +39,17 @@ BuildRequires: meson
|
|||
Requires: gnome-settings-daemon%{?_isa} >= %{gnome_settings_daemon_version}
|
||||
Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version}
|
||||
|
||||
# https://gitlab.gnome.org/halfline/gnome-kiosk/-/merge_requests/1
|
||||
Patch10001: 0001-compositor-Be-less-aggressive-about-full-screening-w.patch
|
||||
Patch10001: 0001-compositor-Support-systemd-user-sessions.patch
|
||||
Patch10002: 0002-Add-a-script-for-simplifying-kiosk-setup.patch
|
||||
|
||||
# https://gitlab.gnome.org/halfline/gnome-kiosk/-/merge_requests/2
|
||||
Patch20001: 0001-gobject-utils-Log-when-executing-deferred-tasks.patch
|
||||
Patch20002: 0002-input-sources-manager-Fix-overzealous-rename-mistake.patch
|
||||
Patch20003: 0003-compositor-Add-signal-for-reporting-X-server-events.patch
|
||||
Patch20004: 0004-input-sources-manager-Support-libxklavier-managed-ke.patch
|
||||
Patch20001: 0001-compositor-Ignore-some-of-the-builtin-keybindings.patch
|
||||
Patch20002: 0002-kiosk-script-Make-sure-desktop-file-for-script-is-hi.patch
|
||||
Patch20003: 0003-kiosk-script-Install-session-file-with-fallback-in-m.patch
|
||||
Patch20004: 0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch
|
||||
Patch20005: 0005-kiosk-script-Add-a-hint-about-using-firefox-to-the-k.patch
|
||||
Patch20006: 0006-kiosk-script-Send-SIGHUP-to-script-at-shutdown-time.patch
|
||||
|
||||
Patch30001: 0001-compositor-Be-more-permissive-about-what-s-considere.patch
|
||||
|
||||
%description
|
||||
GNOME Kiosk provides a desktop enviroment suitable for fixed purpose, or
|
||||
|
@ -61,6 +66,17 @@ BuildArch: noarch
|
|||
%description search-appliance
|
||||
This package provides a full screen firefox window pointed to google.
|
||||
|
||||
%package script-session
|
||||
Summary: Basic session used for running kiosk application from shell script
|
||||
License: GPLv2+
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Recommends: gedit
|
||||
Requires: gnome-session
|
||||
BuildArch: noarch
|
||||
|
||||
%description script-session
|
||||
This package generates a shell script and the necessary scaffolding to start that shell script within a kiosk session.
|
||||
|
||||
%prep
|
||||
%autosetup -S git -n %{name}-%{tarball_version}
|
||||
|
||||
|
@ -80,6 +96,18 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.Searc
|
|||
%doc README.md
|
||||
%{_bindir}/gnome-kiosk
|
||||
%{_datadir}/applications/org.gnome.Kiosk.desktop
|
||||
%{_userunitdir}/org.gnome.Kiosk.target
|
||||
%{_userunitdir}/org.gnome.Kiosk@wayland.service
|
||||
%{_userunitdir}/org.gnome.Kiosk@x11.service
|
||||
|
||||
%files -n gnome-kiosk-script-session
|
||||
%{_bindir}/gnome-kiosk-script
|
||||
%{_userunitdir}/gnome-session@gnome-kiosk-script.target.d/session.conf
|
||||
%{_userunitdir}/org.gnome.Kiosk.Script.service
|
||||
%{_datadir}/applications/org.gnome.Kiosk.Script.desktop
|
||||
%{_datadir}/gnome-session/sessions/gnome-kiosk-script.session
|
||||
%{_datadir}/wayland-sessions/gnome-kiosk-script.desktop
|
||||
%{_datadir}/xsessions/gnome-kiosk-script.desktop
|
||||
|
||||
%files -n gnome-kiosk-search-appliance
|
||||
%{_datadir}/applications/org.gnome.Kiosk.SearchApp.desktop
|
||||
|
@ -88,6 +116,35 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Kiosk.Searc
|
|||
%{_datadir}/wayland-sessions/org.gnome.Kiosk.SearchApp.Session.desktop
|
||||
|
||||
%changelog
|
||||
* Wed Nov 09 2022 Ray Strode <rstrode@redhat.com> - 40.0-5
|
||||
- Detect anaconda as the kiosk app better
|
||||
Resolves: #1999060
|
||||
|
||||
* Wed Aug 11 2021 Ray Strode <rstrode@redhat.com> - 40.0-4
|
||||
- Fix crash when hitting alt-f2
|
||||
- Various fixes to the script-session
|
||||
Related: #1965338
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 40.0-3
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Fri Aug 06 2021 Ray Strode <rstrode@redhat.com> - 40.0-2
|
||||
- Support systemd --user sessions
|
||||
- Add script-session subpackage
|
||||
Related: #1965338
|
||||
|
||||
* Mon May 17 2021 Ray Strode <rstrode@redhat.com> - 40.0-1
|
||||
- Update to 40.0
|
||||
Related: #1950042
|
||||
|
||||
* Tue Apr 27 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-7
|
||||
- Fix desktop file
|
||||
Resolves: #1954285
|
||||
|
||||
* Fri Apr 23 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-6
|
||||
- Add vprovides so initial-setup can use this
|
||||
|
||||
* Wed Apr 21 2021 Ray Strode <rstrode@redhat.com> - 40~alpha-5
|
||||
- Fix keyboard layouts getting out of sync in anaconda
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
inspections:
|
||||
desktop: off
|
||||
runpath: off
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (gnome-kiosk-40.alpha.tar.xz) = c79645935438f5512b437ae19ea8016a8b2ce6fd49a4e5426956d6fc21b33d622e82d01ce3c0cb97f540c5a889c1a098b0e9e8d65d33e0669dc989e1d391f9fb
|
||||
SHA512 (gnome-kiosk-40.0.tar.xz) = 2e670046b9cf9031bfa2b95969726c626d83c6d84ffb0ecc50a67414d406f05e515dbf7716b7f84c9342aec84e93369c07199ef233923cbb527d267c61374d35
|
||||
|
|
Loading…
Reference in New Issue