diff --git a/NEWS b/NEWS deleted file mode 100644 index 7749e08..0000000 --- a/NEWS +++ /dev/null @@ -1,67 +0,0 @@ -Changes in 43.1 -================= - -- Close dialogs with the Escape key -- Translation updates - -Changes in 43.0 -================= - -- Translation updates - -Changes in 43.rc -================= - -- Remember last app folder in the Filechooser portal -- Improve Closed signal emission in the RemoteDesktop/Screencast portal [#508] -- Translation updates - -Changes in 43.beta -================= - -- Don't show screenshot sharing dialog for non-interactive screenshots -- Fix restoring window screencast streams -- Translation updates - -Changes in 43.alpha -================= - -- Various fixes to the screencast dialog -- New Dynamic Launcher portal -- Plug various memory leaks -- Tweak wallpaper portal dialog -- Translation updates - -Changes in 42.0.1 -================= - -- Adapt to xdg-desktop-portal screencast restore changes -- Don't send selection on remote desktop when nothing was selected -- Minor cleanups - -Changes in 42.0 -================ - -- Updated translations - -Changes in 42.rc -================ - -- Support dark style preference -- Support virtual screen cast sources -- Redesign screencast portal window -- Implement screencast restoration -- Use libgnome-desktop-4 for wallpapers -- Implement Account portal -- Implement Print portal - -Changes in 41.0 -================ - -- Use the systemd pkg-config file to find the unit directory - -Changes in 41.alpha -================ - -- Initial release -- Port to GTK4 diff --git a/src/externalwindow-wayland.c b/src/externalwindow-wayland.c deleted file mode 100644 index 2d77bf5..0000000 --- a/src/externalwindow-wayland.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#include "config.h" - -#include -#include - -#include "externalwindow-wayland.h" - -static GdkDisplay *wayland_display; - -struct _ExternalWindowWayland -{ - ExternalWindow parent; - - char *handle_str; -}; - -struct _ExternalWindowWaylandClass -{ - ExternalWindowClass parent_class; -}; - -G_DEFINE_TYPE (ExternalWindowWayland, external_window_wayland, - EXTERNAL_TYPE_WINDOW) - -static GdkDisplay * -get_wayland_display (void) -{ - if (wayland_display) - return wayland_display; - - gdk_set_allowed_backends ("wayland"); - wayland_display = gdk_display_open (NULL); - gdk_set_allowed_backends (NULL); - if (!wayland_display) - g_warning ("Failed to open Wayland display"); - - return wayland_display; -} - -ExternalWindowWayland * -external_window_wayland_new (const char *handle_str) -{ - ExternalWindowWayland *external_window_wayland; - GdkDisplay *display; - - display = get_wayland_display (); - if (!display) - { - g_warning ("No Wayland display connection, ignoring Wayland parent"); - return NULL; - } - - external_window_wayland = g_object_new (EXTERNAL_TYPE_WINDOW_WAYLAND, - "display", display, - NULL); - external_window_wayland->handle_str = g_strdup (handle_str); - - return external_window_wayland; -} - -static void -external_window_wayland_set_parent_of (ExternalWindow *external_window, - GdkSurface *surface) -{ - ExternalWindowWayland *external_window_wayland = - EXTERNAL_WINDOW_WAYLAND (external_window); - char *handle_str = external_window_wayland->handle_str; - - if (!gdk_wayland_toplevel_set_transient_for_exported (GDK_TOPLEVEL (surface), handle_str)) - g_warning ("Failed to set portal window transient for external parent"); -} - -static void -external_window_wayland_dispose (GObject *object) -{ - ExternalWindowWayland *external_window_wayland = - EXTERNAL_WINDOW_WAYLAND (object); - - g_free (external_window_wayland->handle_str); - - G_OBJECT_CLASS (external_window_wayland_parent_class)->dispose (object); -} - -static void -external_window_wayland_init (ExternalWindowWayland *external_window_wayland) -{ -} - -static void -external_window_wayland_class_init (ExternalWindowWaylandClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - ExternalWindowClass *external_window_class = EXTERNAL_WINDOW_CLASS (klass); - - object_class->dispose = external_window_wayland_dispose; - - external_window_class->set_parent_of = external_window_wayland_set_parent_of; -} diff --git a/src/externalwindow-wayland.h b/src/externalwindow-wayland.h deleted file mode 100644 index ede29ef..0000000 --- a/src/externalwindow-wayland.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#pragma once - -#include - -#include "externalwindow.h" - -#define EXTERNAL_TYPE_WINDOW_WAYLAND (external_window_wayland_get_type ()) -#define EXTERNAL_WINDOW_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST (object, EXTERNAL_TYPE_WINDOW_WAYLAND, ExternalWindowWayland)) - -typedef struct _ExternalWindowWayland ExternalWindowWayland; -typedef struct _ExternalWindowWaylandClass ExternalWindowWaylandClass; - -GType external_window_wayland_get_type (void); -ExternalWindowWayland *external_window_wayland_new (const char *handle_str); diff --git a/src/externalwindow-x11.c b/src/externalwindow-x11.c deleted file mode 100644 index 743a6e5..0000000 --- a/src/externalwindow-x11.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "externalwindow-x11.h" - - -static GdkDisplay *x11_display; - -struct _ExternalWindowX11 -{ - ExternalWindow parent; - - Window foreign_xid; -}; - -struct _ExternalWindowX11Class -{ - ExternalWindowClass parent_class; -}; - -G_DEFINE_TYPE (ExternalWindowX11, external_window_x11, - EXTERNAL_TYPE_WINDOW) - -static GdkDisplay * -get_x11_display (void) -{ - if (x11_display) - return x11_display; - - gdk_set_allowed_backends ("x11"); - x11_display = gdk_display_open (NULL); - gdk_set_allowed_backends (NULL); - if (!x11_display) - g_warning ("Failed to open X11 display"); - - return x11_display; -} - -ExternalWindowX11 * -external_window_x11_new (const char *handle_str) -{ - ExternalWindowX11 *external_window_x11; - GdkDisplay *display; - int xid; - - display = get_x11_display (); - if (!display) - { - g_warning ("No X display connection, ignoring X11 parent"); - return NULL; - } - - errno = 0; - xid = strtol (handle_str, NULL, 16); - if (errno != 0) - { - g_warning ("Failed to reference external X11 window, invalid XID %s", handle_str); - return NULL; - } - - external_window_x11 = g_object_new (EXTERNAL_TYPE_WINDOW_X11, - "display", display, - NULL); - external_window_x11->foreign_xid = xid; - - return external_window_x11; -} - -static void -external_window_x11_set_parent_of (ExternalWindow *external_window, - GdkSurface *surface) -{ - ExternalWindowX11 *external_window_x11 = - EXTERNAL_WINDOW_X11 (external_window); - GdkDisplay *display; - Display *xdisplay; - Atom atom; - - display = get_x11_display (); - xdisplay = gdk_x11_display_get_xdisplay (display); - - XSetTransientForHint (xdisplay, - GDK_SURFACE_XID (surface), - external_window_x11->foreign_xid); - - atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"); - XChangeProperty (xdisplay, - GDK_SURFACE_XID (surface), - gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"), - XA_ATOM, 32, PropModeReplace, - (guchar *)&atom, 1); -} - -static void -external_window_x11_init (ExternalWindowX11 *external_window_x11) -{ -} - -static void -external_window_x11_class_init (ExternalWindowX11Class *klass) -{ - ExternalWindowClass *external_window_class = EXTERNAL_WINDOW_CLASS (klass); - - external_window_class->set_parent_of = external_window_x11_set_parent_of; -} diff --git a/src/externalwindow-x11.h b/src/externalwindow-x11.h deleted file mode 100644 index d380a3d..0000000 --- a/src/externalwindow-x11.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#pragma once - -#include - -#include "externalwindow.h" - - -#define EXTERNAL_TYPE_WINDOW_X11 (external_window_x11_get_type ()) -#define EXTERNAL_WINDOW_X11(object) (G_TYPE_CHECK_INSTANCE_CAST (object, EXTERNAL_TYPE_WINDOW_X11, ExternalWindowX11)) - -typedef struct _ExternalWindowX11 ExternalWindowX11; -typedef struct _ExternalWindowX11Class ExternalWindowX11Class; - -GType external_window_get_type (void); -ExternalWindowX11 *external_window_x11_new (const char *handle_str); diff --git a/src/externalwindow.c b/src/externalwindow.c deleted file mode 100644 index f4a964d..0000000 --- a/src/externalwindow.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#include "config.h" - -#include - -#include "externalwindow.h" -#ifdef HAVE_GTK_X11 -#include "externalwindow-x11.h" -#endif -#ifdef HAVE_GTK_WAYLAND -#include "externalwindow-wayland.h" -#endif - -enum -{ - PROP_0, - - PROP_DISPLAY, -}; - -typedef struct _ExternalWindowPrivate -{ - GdkDisplay *display; -} ExternalWindowPrivate; - -G_DEFINE_TYPE_WITH_PRIVATE (ExternalWindow, external_window, G_TYPE_OBJECT) - -ExternalWindow * -create_external_window_from_handle (const char *handle_str) -{ -#ifdef HAVE_GTK_X11 - { - const char x11_prefix[] = "x11:"; - if (g_str_has_prefix (handle_str, x11_prefix)) - { - ExternalWindowX11 *external_window_x11; - const char *x11_handle_str = handle_str + strlen (x11_prefix); - - external_window_x11 = external_window_x11_new (x11_handle_str); - return EXTERNAL_WINDOW (external_window_x11); - } - } -#endif -#ifdef HAVE_GTK_WAYLAND - { - const char wayland_prefix[] = "wayland:"; - if (g_str_has_prefix (handle_str, wayland_prefix)) - { - ExternalWindowWayland *external_window_wayland; - const char *wayland_handle_str = handle_str + strlen (wayland_prefix); - - external_window_wayland = - external_window_wayland_new (wayland_handle_str); - return EXTERNAL_WINDOW (external_window_wayland); - } - } -#endif - - g_warning ("Unhandled parent window type %s", handle_str); - return NULL; -} - -void -external_window_set_parent_of (ExternalWindow *external_window, - GdkSurface *surface) -{ - EXTERNAL_WINDOW_GET_CLASS (external_window)->set_parent_of (external_window, - surface); -} - -GdkDisplay * -external_window_get_display (ExternalWindow *external_window) -{ - ExternalWindowPrivate *priv = - external_window_get_instance_private (external_window); - - return priv->display; -} - -static void -external_window_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ExternalWindow *external_window = EXTERNAL_WINDOW (object); - ExternalWindowPrivate *priv = - external_window_get_instance_private (external_window); - - switch (prop_id) - { - case PROP_DISPLAY: - g_set_object (&priv->display, g_value_get_object (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -external_window_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ExternalWindow *external_window = EXTERNAL_WINDOW (object); - ExternalWindowPrivate *priv = - external_window_get_instance_private (external_window); - - switch (prop_id) - { - case PROP_DISPLAY: - g_value_set_object (value, priv->display); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -external_window_init (ExternalWindow *external_window) -{ -} - -static void -external_window_class_init (ExternalWindowClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->get_property = external_window_get_property; - object_class->set_property = external_window_set_property; - - g_object_class_install_property (object_class, - PROP_DISPLAY, - g_param_spec_object ("display", - "GdkDisplay", - "The GdkDisplay instance", - GDK_TYPE_DISPLAY, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS)); -} diff --git a/src/externalwindow.h b/src/externalwindow.h deleted file mode 100644 index 85a5e1e..0000000 --- a/src/externalwindow.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright © 2016 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Jonas Ådahl - */ - -#pragma once - -#include -#include - - -#define EXTERNAL_TYPE_WINDOW (external_window_get_type ()) -#define EXTERNAL_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST (object, EXTERNAL_TYPE_WINDOW, ExternalWindow)) -#define EXTERNAL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, EXTERNAL_TYPE_WINDOW, ExternalWindowClass)) -#define EXTERNAL_WINDOW_GET_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS (klass, EXTERNAL_TYPE_WINDOW, ExternalWindowClass)) - -typedef struct _ExternalWindow ExternalWindow; -typedef struct _ExternalWindowClass ExternalWindowClass; - -struct _ExternalWindow -{ - GObject parent_instance; -}; - -struct _ExternalWindowClass -{ - GObjectClass parent_class; - - void (*set_parent_of) (ExternalWindow *external_window, - GdkSurface *surface); -}; - -GType external_window_get_type (void); -ExternalWindow *create_external_window_from_handle (const char *handle_str); - -void external_window_set_parent_of (ExternalWindow *external_window, - GdkSurface *surface); - -GdkDisplay *external_window_get_display (ExternalWindow *external_window); diff --git a/src/fc-monitor.c b/src/fc-monitor.c deleted file mode 100644 index 7629ada..0000000 --- a/src/fc-monitor.c +++ /dev/null @@ -1,323 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2008 Red Hat, Inc. - * Copyright (C) 2017 Jan Alexander Steffens (heftig) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Author: Behdad Esfahbod, Red Hat, Inc. - */ - -/* NOTE: This file is copied from gnome-settings-daemon, please keep it in sync */ - -#include "fc-monitor.h" - -#include -#include - -#define TIMEOUT_MILLISECONDS 1000 - -static void -fontconfig_cache_update_thread (GTask *task, - gpointer source_object G_GNUC_UNUSED, - gpointer task_data G_GNUC_UNUSED, - GCancellable *cancellable G_GNUC_UNUSED) -{ - if (FcConfigUptoDate (NULL)) { - g_task_return_boolean (task, FALSE); - return; - } - - if (!FcInitReinitialize ()) { - g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, - "FcInitReinitialize failed"); - return; - } - - g_task_return_boolean (task, TRUE); -} - -static void -fontconfig_cache_update_async (GAsyncReadyCallback callback, - gpointer user_data) -{ - GTask *task = g_task_new (NULL, NULL, callback, user_data); - g_task_run_in_thread (task, fontconfig_cache_update_thread); - g_object_unref (task); -} - -static gboolean -fontconfig_cache_update_finish (GAsyncResult *result, - GError **error) -{ - return g_task_propagate_boolean (G_TASK (result), error); -} - -typedef enum { - UPDATE_IDLE, - UPDATE_PENDING, - UPDATE_RUNNING, - UPDATE_RESTART, -} UpdateState; - -struct _FcMonitor { - GObject parent_instance; - - GPtrArray *monitors; - - guint timeout; - UpdateState state; - gboolean notify; -}; - -enum { - SIGNAL_UPDATED, - - N_SIGNALS -}; - -static guint signals[N_SIGNALS] = { 0, }; - -static void fc_monitor_finalize (GObject *object); -static void monitor_files (FcMonitor *self, FcStrList *list); -static void stuff_changed (GFileMonitor *monitor, GFile *file, GFile *other_file, - GFileMonitorEvent event_type, gpointer data); -static void start_timeout (FcMonitor *self); -static gboolean start_update (gpointer data); -static void update_done (GObject *source_object, GAsyncResult *result, gpointer user_data); - -G_DEFINE_TYPE (FcMonitor, fc_monitor, G_TYPE_OBJECT); - -static void -fc_monitor_class_init (FcMonitorClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = fc_monitor_finalize; - - signals[SIGNAL_UPDATED] = g_signal_new ("updated", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, - NULL, - NULL, - G_TYPE_NONE, - 0); -} - -FcMonitor * -fc_monitor_new (void) -{ - return g_object_new (FC_TYPE_MONITOR, NULL); -} - -static void -fc_monitor_init (FcMonitor *self G_GNUC_UNUSED) -{ - FcInit (); -} - -static void -fc_monitor_finalize (GObject *object) -{ - FcMonitor *self = FC_MONITOR (object); - - if (self->timeout) - g_source_remove (self->timeout); - self->timeout = 0; - - g_clear_pointer (&self->monitors, g_ptr_array_unref); - - G_OBJECT_CLASS (fc_monitor_parent_class)->finalize (object); -} - -void -fc_monitor_start (FcMonitor *self) -{ - g_return_if_fail (FC_IS_MONITOR (self)); - g_return_if_fail (self->monitors == NULL); - - self->monitors = g_ptr_array_new_with_free_func (g_object_unref); - - monitor_files (self, FcConfigGetConfigFiles (NULL)); - monitor_files (self, FcConfigGetFontDirs (NULL)); -} - -void -fc_monitor_stop (FcMonitor *self) -{ - g_return_if_fail (FC_IS_MONITOR (self)); - g_clear_pointer (&self->monitors, g_ptr_array_unref); -} - -static void -monitor_files (FcMonitor *self, - FcStrList *list) -{ - const char *str; - - while ((str = (const char *) FcStrListNext (list))) { - GFile *file; - GFileMonitor *monitor; - - file = g_file_new_for_path (str); - - g_debug ("Monitoring %s", str); - monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, NULL); - - g_object_unref (file); - - if (!monitor) - continue; - - g_signal_connect (monitor, "changed", G_CALLBACK (stuff_changed), self); - - g_ptr_array_add (self->monitors, monitor); - } - - FcStrListDone (list); -} - -static const gchar * -get_name (GType enum_type, - gint enum_value) -{ - GEnumClass *klass = g_type_class_ref (enum_type); - GEnumValue *value = g_enum_get_value (klass, enum_value); - const gchar *name = value ? value->value_name : "(unknown)"; - g_type_class_unref (klass); - return name; -} - -static void -stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED, - GFile *file G_GNUC_UNUSED, - GFile *other_file G_GNUC_UNUSED, - GFileMonitorEvent event_type, - gpointer data) -{ - FcMonitor *self = FC_MONITOR (data); - const gchar *event_name = get_name (G_TYPE_FILE_MONITOR_EVENT, event_type); - char *path = g_file_get_path (file); - - switch (self->state) { - case UPDATE_IDLE: - g_debug ("Got %-38s for %s: starting fontconfig update timeout", event_name, path); - start_timeout (self); - break; - - case UPDATE_PENDING: - /* wait for quiescence */ - g_debug ("Got %-38s for %s: restarting fontconfig update timeout", event_name, path); - g_source_remove (self->timeout); - start_timeout (self); - break; - - case UPDATE_RUNNING: - g_debug ("Got %-38s for %s: restarting fontconfig update", event_name, path); - self->state = UPDATE_RESTART; - break; - - case UPDATE_RESTART: - g_debug ("Got %-38s for %s: waiting on fontconfig update", event_name, path); - break; - } - - g_free (path); -} - -static void -start_timeout (FcMonitor *self) -{ - self->state = UPDATE_PENDING; - self->timeout = g_timeout_add (TIMEOUT_MILLISECONDS, start_update, self); - g_source_set_name_by_id (self->timeout, "[gnome-settings-daemon] update"); -} - -static gboolean -start_update (gpointer data) -{ - FcMonitor *self = FC_MONITOR (data); - - self->state = UPDATE_RUNNING; - self->timeout = 0; - - g_debug ("Timeout completed: starting fontconfig update"); - fontconfig_cache_update_async (update_done, g_object_ref (self)); - - return G_SOURCE_REMOVE; -} - -static void -update_done (GObject *source_object G_GNUC_UNUSED, - GAsyncResult *result, - gpointer data) -{ - FcMonitor *self = FC_MONITOR (data); - gboolean restart = self->state == UPDATE_RESTART; - GError *error = NULL; - - self->state = UPDATE_IDLE; - - if (fontconfig_cache_update_finish (result, &error)) { - g_debug ("Fontconfig update successful"); - /* Remember we had a successful update even if we have to restart it */ - self->notify = TRUE; - } else if (error) { - g_warning ("Fontconfig update failed: %s", error->message); - g_error_free (error); - } else - g_debug ("Fontconfig update was unnecessary"); - - if (restart) { - g_debug ("Concurrent change: restarting fontconfig update timeout"); - start_timeout (self); - } else if (self->notify) { - self->notify = FALSE; - - if (self->monitors) { - fc_monitor_stop (self); - fc_monitor_start (self); - } - - /* we finish modifying self before emitting the signal, - * allowing the callback to stop us if it decides to. */ - g_signal_emit (self, signals[SIGNAL_UPDATED], 0); - } - - /* release ref taken in start_update */ - g_object_unref (self); -} - -#ifdef FONTCONFIG_MONITOR_TEST -static void -yay (void) -{ - g_message ("yay"); -} - -int -main (void) -{ - GMainLoop *loop = g_main_loop_new (NULL, TRUE); - FcMonitor *monitor = fc_monitor_new (); - - fc_monitor_start (monitor); - g_signal_connect (monitor, "updated", G_CALLBACK (yay), NULL); - - g_main_loop_run (loop); - return 0; -} -#endif diff --git a/src/fc-monitor.h b/src/fc-monitor.h deleted file mode 100644 index a786096..0000000 --- a/src/fc-monitor.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2017 Jan Alexander Steffens (heftig) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - */ -#ifndef FC_MONITOR_H -#define FC_MONITOR_H - -/* NOTE: this file is copied from gnome-settings-daemon, please keep it in sync */ - -#include - -G_BEGIN_DECLS - -#define FC_TYPE_MONITOR (fc_monitor_get_type ()) -G_DECLARE_FINAL_TYPE (FcMonitor, fc_monitor, FC, MONITOR, GObject) - -FcMonitor *fc_monitor_new (void); - -void fc_monitor_start (FcMonitor *monitor); -void fc_monitor_stop (FcMonitor *monitor); - -G_END_DECLS - -#endif /* FC_MONITOR_H */ diff --git a/src/meson.build b/src/meson.build index 9e001c7..610bc51 100644 --- a/src/meson.build +++ b/src/meson.build @@ -16,18 +16,6 @@ built_sources = gnome.gdbus_codegen( namespace: 'XdpImpl', ) -# Mutter / GNOME Shell D-Bus interfaces -top_srcdir = meson.source_root() -shell_dbus_interfaces = files( - top_srcdir / 'data' / 'org.gnome.Shell.Introspect.xml', -) - -built_sources += gnome.gdbus_codegen( - 'shell-dbus', - sources: shell_dbus_interfaces, - interface_prefix: 'org.freedesktop.impl.portal.', -) - # GResources built_sources += gnome.compile_resources( 'xdg-desktop-portal-helium-resources', @@ -44,10 +32,10 @@ config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), mes built_sources += configure_file(output: 'config.h', configuration: config_h) # Sources -libadwaita_dep = dependency( - 'libadwaita-1', - fallback: ['libadwaita', 'libadwaita_dep'], - default_options: ['examples=false', 'introspection=disabled', 'tests=false', 'vapi=false'], +libhelium_dep = dependency( + 'libhelium-1', + fallback: ['libhelium', 'libhelium_dep'], + default_options: ['demo=false'], ) deps = [ declare_dependency(sources: built_sources), @@ -60,34 +48,18 @@ deps = [ dependency('gsettings-desktop-schemas'), dependency('gnome-desktop-4'), dependency('gnome-bg-4'), - libadwaita_dep, + libhelium_dep, xdg_desktop_portal_dep, ] sources = built_sources + files( - 'externalwindow.c', - 'fc-monitor.c', 'settings.c', - 'shellintrospect.c', 'utils.c', 'xdg-desktop-portal-helium.c', ) common_flags = [] -gtk_x11_dep = dependency('gtk4-x11', required: false) -if gtk_x11_dep.found() - sources += files('externalwindow-x11.c') - deps += [dependency('x11')] - common_flags += ['-DHAVE_GTK_X11'] -endif - -gtk_wayland_dep = dependency('gtk4-wayland', required: false) -if gtk_wayland_dep.found() - sources += files('externalwindow-wayland.c') - common_flags += ['-DHAVE_GTK_WAYLAND'] -endif - add_project_arguments(common_flags, language: 'c') executable( diff --git a/src/settings.c b/src/settings.c index 58baa77..f9d5771 100644 --- a/src/settings.c +++ b/src/settings.c @@ -27,17 +27,10 @@ #include "settings.h" #include "utils.h" -#include "shellintrospect.h" #include "xdg-desktop-portal-dbus.h" -#include "fc-monitor.h" static GHashTable *settings; -static FcMonitor *fontconfig_monitor; -static int fontconfig_serial; -static gboolean enable_animations; - -static void sync_animations_enabled (XdpImplSettings *impl, ShellIntrospect *shell_introspect); typedef struct { GSettingsSchema *schema; @@ -254,25 +247,6 @@ static GVariant * get_accent_color (void) return g_variant_new_tuple (no_preference, 3); } -static GVariant * -get_theme_value (const char *key) -{ - SettingsBundle *bundle = g_hash_table_lookup (settings, "org.gnome.desktop.a11y.interface"); - const char *theme; - gboolean hc = FALSE; - - if (bundle && g_settings_schema_has_key (bundle->schema, "high-contrast")) - hc = g_settings_get_boolean (bundle->settings, "high-contrast"); - - if (hc) - return g_variant_new_string ("HighContrast"); - - bundle = g_hash_table_lookup (settings, "org.gnome.desktop.interface"); - theme = g_settings_get_string (bundle->settings, key); - - return g_variant_new_string (theme); -} - static gboolean settings_handle_read_all (XdpImplSettings *object, GDBusMethodInvocation *invocation, @@ -300,28 +274,12 @@ settings_handle_read_all (XdpImplSettings *object, g_variant_dict_init (&dict, NULL); for (i = 0; keys[i]; ++i) { - if (strcmp (key, "org.gnome.desktop.interface") == 0 && - strcmp (keys[i], "enable-animations") == 0) - g_variant_dict_insert_value (&dict, keys[i], g_variant_new_boolean (enable_animations)); - else if (strcmp (key, "org.gnome.desktop.interface") == 0 && strcmp (keys[i], "gtk-theme") == 0) - g_variant_dict_insert_value (&dict, keys[i], get_theme_value (keys[i])); - else - g_variant_dict_insert_value (&dict, keys[i], g_settings_get_value (value->settings, keys[i])); + g_variant_dict_insert_value (&dict, keys[i], g_settings_get_value (value->settings, keys[i])); } g_variant_builder_add (builder, "{s@a{sv}}", key, g_variant_dict_end (&dict)); } - if (namespace_matches ("org.gnome.fontconfig", arg_namespaces)) - { - GVariantDict dict; - - g_variant_dict_init (&dict, NULL); - g_variant_dict_insert_value (&dict, "serial", g_variant_new_int32 (fontconfig_serial)); - - g_variant_builder_add (builder, "{s@a{sv}}", "org.gnome.fontconfig", g_variant_dict_end (&dict)); - } - if (namespace_matches ("org.freedesktop.appearance", arg_namespaces)) { GVariantDict dict; @@ -353,16 +311,7 @@ settings_handle_read (XdpImplSettings *object, { g_debug ("Read %s %s", arg_namespace, arg_key); - if (strcmp (arg_namespace, "org.gnome.fontconfig") == 0) - { - if (strcmp (arg_key, "serial") == 0) - { - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(v)", g_variant_new_int32 (fontconfig_serial))); - return TRUE; - } - } - else if (strcmp (arg_namespace, "org.freedesktop.appearance") == 0 && + if (strcmp (arg_namespace, "org.freedesktop.appearance") == 0 && strcmp (arg_key, "color-scheme") == 0) { g_dbus_method_invocation_return_value (invocation, @@ -404,20 +353,6 @@ settings_handle_read (XdpImplSettings *object, g_variant_new ("(v)", get_contrast ())); return TRUE; } - else if (strcmp (arg_namespace, "org.gnome.desktop.interface") == 0 && - strcmp (arg_key, "enable-animations") == 0) - { - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(v)", g_variant_new_boolean (enable_animations))); - return TRUE; - } - else if (strcmp (arg_namespace, "org.gnome.desktop.interface") == 0 && - (strcmp (arg_key, "gtk-theme") == 0)) - { - g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(v)", get_theme_value (arg_key))); - return TRUE; - } else if (g_hash_table_contains (settings, arg_namespace)) { SettingsBundle *bundle = g_hash_table_lookup (settings, arg_namespace); @@ -469,14 +404,6 @@ on_settings_changed (GSettings *settings, g_autoptr (GVariant) new_value = g_settings_get_value (settings, key); g_debug ("Emitting changed for %s %s", user_data->namespace, key); - if (strcmp (user_data->namespace, "org.gnome.desktop.interface") == 0 && - strcmp (key, "enable-animations") == 0) - sync_animations_enabled (user_data->self, shell_introspect_get ()); - else - xdp_impl_settings_emit_setting_changed (user_data->self, - user_data->namespace, key, - g_variant_new ("v", new_value)); - if (strcmp (user_data->namespace, "org.gnome.desktop.interface") == 0 && strcmp (key, "color-scheme") == 0) xdp_impl_settings_emit_setting_changed (user_data->self, @@ -506,20 +433,12 @@ on_settings_changed (GSettings *settings, xdp_impl_settings_emit_setting_changed (user_data->self, "org.freedesktop.appearance", key, g_variant_new ("v", get_accent_color ())); - + if (strcmp (user_data->namespace, "com.fyralabs.desktop.appearance") == 0 && strcmp (key, "contrast") == 0) xdp_impl_settings_emit_setting_changed (user_data->self, "org.freedesktop.appearance", key, g_variant_new ("v", get_contrast ())); - - if (strcmp (user_data->namespace, "org.gnome.desktop.a11y.interface") == 0 && - strcmp (key, "high-contrast") == 0) - { - xdp_impl_settings_emit_setting_changed (user_data->self, - "org.gnome.desktop.interface", "gtk-theme", - g_variant_new ("v", get_theme_value ("gtk-theme"))); - } } static void @@ -564,71 +483,11 @@ init_settings_table (XdpImplSettings *settings, } } -static void -fontconfig_changed (FcMonitor *monitor, - XdpImplSettings *impl) -{ - const char *namespace = "org.gnome.fontconfig"; - const char *key = "serial"; - - g_debug ("Emitting changed for %s %s", namespace, key); - - fontconfig_serial++; - - xdp_impl_settings_emit_setting_changed (impl, - namespace, key, - g_variant_new ("v", g_variant_new_int32 (fontconfig_serial))); -} - -static void -set_enable_animations (XdpImplSettings *impl, - gboolean new_enable_animations) -{ - const char *namespace = "org.gnome.desktop.interface"; - const char *key = "enable-animations"; - GVariant *enable_animations_variant; - - if (enable_animations == new_enable_animations) - return; - - enable_animations = new_enable_animations; - enable_animations_variant = - g_variant_new ("v", g_variant_new_boolean (enable_animations)); - xdp_impl_settings_emit_setting_changed (impl, - namespace, - key, - enable_animations_variant); -} - -static void -sync_animations_enabled (XdpImplSettings *impl, - ShellIntrospect *shell_introspect) -{ - gboolean new_enable_animations; - - if (!shell_introspect_are_animations_enabled (shell_introspect, - &new_enable_animations)) - { - SettingsBundle *bundle = g_hash_table_lookup (settings, "org.gnome.desktop.interface"); - new_enable_animations = g_settings_get_boolean (bundle->settings, "enable-animations"); - } - - set_enable_animations (impl, new_enable_animations); -} - -static void -animations_enabled_changed (ShellIntrospect *shell_introspect, - XdpImplSettings *impl) -{ - sync_animations_enabled (impl, shell_introspect); -} - gboolean settings_init (GDBusConnection *bus, GError **error) { GDBusInterfaceSkeleton *helper; - ShellIntrospect *shell_introspect; helper = G_DBUS_INTERFACE_SKELETON (xdp_impl_settings_skeleton_new ()); @@ -639,17 +498,6 @@ settings_init (GDBusConnection *bus, init_settings_table (XDP_IMPL_SETTINGS (helper), settings); - fontconfig_monitor = fc_monitor_new (); - g_signal_connect (fontconfig_monitor, "updated", G_CALLBACK (fontconfig_changed), helper); - fc_monitor_start (fontconfig_monitor); - - shell_introspect = shell_introspect_get (); - g_signal_connect (shell_introspect, "animations-enabled-changed", - G_CALLBACK (animations_enabled_changed), - helper); - sync_animations_enabled (XDP_IMPL_SETTINGS (helper), - shell_introspect); - if (!g_dbus_interface_skeleton_export (helper, bus, DESKTOP_PORTAL_OBJECT_PATH, @@ -659,5 +507,4 @@ settings_init (GDBusConnection *bus, g_debug ("providing %s", g_dbus_interface_skeleton_get_info (helper)->name); return TRUE; - } diff --git a/src/shellintrospect.c b/src/shellintrospect.c deleted file mode 100644 index c2b288d..0000000 --- a/src/shellintrospect.c +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright © 2019 Alberto Fanjul - * Copyright © 2019 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - */ - -#include "config.h" - -#include "shell-dbus.h" -#include "shellintrospect.h" - -struct _Window -{ - uint64_t id; - char *title; - char *app_id; -}; - -struct _ShellIntrospect -{ - GObject parent; - - guint shell_introspect_watch_name_id; - GCancellable *cancellable; - - OrgGnomeShellIntrospect *proxy; - - unsigned int version; - - GPtrArray *windows; - - int num_listeners; - - gboolean animations_enabled; - gboolean animations_enabled_valid; -}; - -G_DEFINE_TYPE (ShellIntrospect, shell_introspect, G_TYPE_OBJECT) - -enum -{ - WINDOWS_CHANGED, - ANIMATIONS_ENABLED_CHANGED, - - N_SIGNALS -}; - -static guint signals[N_SIGNALS]; - -static ShellIntrospect *_shell_introspect; - -static void -window_free (Window *window) -{ - g_free (window->title); - g_free (window->app_id); - g_free (window); -} - -static void -get_windows_cb (GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - ShellIntrospect *shell_introspect = user_data; - g_autoptr(GPtrArray) windows = NULL; - g_autoptr(GVariant) windows_variant = NULL; - g_autoptr(GError) error = NULL; - GVariantIter iter; - uint64_t id; - GVariant *params = NULL; - - g_clear_object (&shell_introspect->cancellable); - - if (!org_gnome_shell_introspect_call_get_windows_finish (shell_introspect->proxy, - &windows_variant, - res, - &error)) - { - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_warning ("Failed to get window list: %s", error->message); - return; - } - - g_variant_iter_init (&iter, windows_variant); - - windows = g_ptr_array_new_full (g_variant_iter_n_children (&iter), - (GDestroyNotify) window_free); - - while (g_variant_iter_loop (&iter, "{t@a{sv}}", &id, ¶ms)) - { - char *app_id = NULL; - char *title = NULL; - unsigned int time_since_user_time = UINT_MAX; - Window *window; - - g_variant_lookup (params, "app-id", "s", &app_id); - g_variant_lookup (params, "title", "s", &title); - g_variant_lookup (params, "time-since-user-time", "u", &time_since_user_time); - - window = g_new0 (Window, 1); - *window = (Window) { - .id = id, - .title = title, - .app_id = app_id - }; - g_ptr_array_add (windows, window); - - g_clear_pointer (¶ms, g_variant_unref); - } - - shell_introspect->windows = g_steal_pointer (&windows); - g_signal_emit (shell_introspect, signals[WINDOWS_CHANGED], 0); -} - -static void -sync_state (ShellIntrospect *shell_introspect) -{ - g_clear_pointer (&shell_introspect->windows, g_ptr_array_unref); - - g_cancellable_cancel (shell_introspect->cancellable); - g_clear_object (&shell_introspect->cancellable); - shell_introspect->cancellable = g_cancellable_new (); - - org_gnome_shell_introspect_call_get_windows (shell_introspect->proxy, - shell_introspect->cancellable, - get_windows_cb, - shell_introspect); -} - -static void -on_windows_changed_cb (GDBusProxy *proxy, - ShellIntrospect *shell_introspect) -{ - if (shell_introspect->num_listeners > 0) - sync_state (shell_introspect); -} - -static void -sync_animations_enabled (ShellIntrospect *shell_introspect) -{ - gboolean animations_enabled; - - animations_enabled = - org_gnome_shell_introspect_get_animations_enabled (shell_introspect->proxy); - if (shell_introspect->animations_enabled_valid && - animations_enabled == shell_introspect->animations_enabled) - return; - - shell_introspect->animations_enabled_valid = TRUE; - shell_introspect->animations_enabled = animations_enabled; - g_signal_emit (shell_introspect, signals[ANIMATIONS_ENABLED_CHANGED], 0); -} - -static void -on_animations_enabled_changed (GObject *object, - GParamSpec *pspec, - ShellIntrospect *shell_introspect) -{ - sync_animations_enabled (shell_introspect); -} - -static void -on_shell_introspect_proxy_acquired (GObject *object, - GAsyncResult *result, - gpointer user_data) -{ - ShellIntrospect *shell_introspect = user_data; - OrgGnomeShellIntrospect *proxy; - g_autoptr(GError) error = NULL; - - proxy = org_gnome_shell_introspect_proxy_new_for_bus_finish (result, - &error); - if (!proxy) - { - g_warning ("Failed to acquire org.gnome.Shell.Introspect proxy: %s", - error->message); - return; - } - - shell_introspect->proxy = proxy; - - g_signal_connect (proxy, "windows-changed", - G_CALLBACK (on_windows_changed_cb), - shell_introspect); - - if (shell_introspect->num_listeners > 0) - sync_state (shell_introspect); - - shell_introspect->version = - org_gnome_shell_introspect_get_version (shell_introspect->proxy); - - if (shell_introspect->version >= 2) - { - g_signal_connect (proxy, "notify::animations-enabled", - G_CALLBACK (on_animations_enabled_changed), - shell_introspect); - sync_animations_enabled (shell_introspect); - } -} - -static void -on_shell_introspect_name_appeared (GDBusConnection *connection, - const char *name, - const char *name_owner, - gpointer user_data) -{ - ShellIntrospect *shell_introspect = user_data; - - org_gnome_shell_introspect_proxy_new_for_bus (G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, - "org.gnome.Shell.Introspect", - "/org/gnome/Shell/Introspect", - shell_introspect->cancellable, - on_shell_introspect_proxy_acquired, - shell_introspect); -} - -static void -on_shell_introspect_name_vanished (GDBusConnection *connection, - const char *name, - gpointer user_data) -{ - ShellIntrospect *shell_introspect = user_data; - - if (shell_introspect->cancellable) - { - g_cancellable_cancel (shell_introspect->cancellable); - g_clear_object (&shell_introspect->cancellable); - } -} - -static void -shell_introspect_class_init (ShellIntrospectClass *klass) -{ - signals[WINDOWS_CHANGED] = g_signal_new ("windows-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, NULL, - G_TYPE_NONE, 0); - signals[ANIMATIONS_ENABLED_CHANGED] = - g_signal_new ("animations-enabled-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL, NULL, NULL, - G_TYPE_NONE, 0); -} - -static void -shell_introspect_init (ShellIntrospect *shell_introspect) -{ -} - -ShellIntrospect * -shell_introspect_get (void) -{ - ShellIntrospect *shell_introspect; - - if (_shell_introspect) - return _shell_introspect; - - shell_introspect = g_object_new (shell_introspect_get_type (), NULL); - shell_introspect->shell_introspect_watch_name_id = - g_bus_watch_name (G_BUS_TYPE_SESSION, - "org.gnome.Shell.Introspect", - G_BUS_NAME_WATCHER_FLAGS_NONE, - on_shell_introspect_name_appeared, - on_shell_introspect_name_vanished, - shell_introspect, NULL); - _shell_introspect = shell_introspect; - return shell_introspect; -} - -GPtrArray * -shell_introspect_get_windows (ShellIntrospect *shell_introspect) -{ - return shell_introspect->windows; -} - -void -shell_introspect_ref_listeners (ShellIntrospect *shell_introspect) -{ - shell_introspect->num_listeners++; - - if (shell_introspect->proxy) - sync_state (shell_introspect); -} - -void -shell_introspect_unref_listeners (ShellIntrospect *shell_introspect) -{ - g_return_if_fail (shell_introspect->num_listeners > 0); - - shell_introspect->num_listeners--; - if (shell_introspect->num_listeners == 0) - g_clear_pointer (&shell_introspect->windows, g_ptr_array_unref); -} - -const char * -window_get_title (Window *window) -{ - return window->title; -} - -const char * -window_get_app_id (Window *window) -{ - return window->app_id; -} - -const uint64_t -window_get_id (Window *window) -{ - return window->id; -} - -gboolean -shell_introspect_are_animations_enabled (ShellIntrospect *shell_introspect, - gboolean *out_animations_enabled) -{ - if (!shell_introspect->animations_enabled_valid) - return FALSE; - - *out_animations_enabled = shell_introspect->animations_enabled; - return TRUE; -} - -void -shell_introspect_wait_for_windows (ShellIntrospect *shell_introspect) -{ - g_assert (shell_introspect->num_listeners > 0); - - sync_state (shell_introspect); - - while (!shell_introspect->windows) - g_main_context_iteration (NULL, TRUE); -} diff --git a/src/shellintrospect.h b/src/shellintrospect.h deleted file mode 100644 index f63ecee..0000000 --- a/src/shellintrospect.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright © 2019 Alberto Fanjul - * Copyright © 2019 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - */ - -#pragma once - -#include -#include -#include - -typedef struct _Window Window; - -G_DECLARE_FINAL_TYPE (ShellIntrospect, shell_introspect, - SHELL, INTROSPECT, GObject) - -ShellIntrospect * shell_introspect_get (void); - -void shell_introspect_ref_listeners (ShellIntrospect *shell_introspect); - -void shell_introspect_unref_listeners (ShellIntrospect *shell_introspect); - -const char * window_get_app_id (Window *window); - -const char * window_get_title (Window *window); - -const uint64_t window_get_id (Window *window); - -GPtrArray * shell_introspect_get_windows (ShellIntrospect *shell_introspect); - -gboolean shell_introspect_are_animations_enabled (ShellIntrospect *shell_introspect, - gboolean *enable_animations); - -void shell_introspect_wait_for_windows (ShellIntrospect *shell_introspect); diff --git a/src/xdg-desktop-portal-helium.c b/src/xdg-desktop-portal-helium.c index 2953a9f..ed30c20 100644 --- a/src/xdg-desktop-portal-helium.c +++ b/src/xdg-desktop-portal-helium.c @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -201,7 +201,7 @@ main (int argc, char *argv[]) NULL, NULL); - adw_init (); + he_init (); g_main_loop_run (loop); diff --git a/subprojects/libadwaita.wrap b/subprojects/libadwaita.wrap deleted file mode 100644 index af5e581..0000000 --- a/subprojects/libadwaita.wrap +++ /dev/null @@ -1,3 +0,0 @@ -[wrap-git] -url = https://gitlab.gnome.org/GNOME/libadwaita.git -revision = 12a10b320300ec32d480c29f26ae55c1d4b2a8b7 diff --git a/xdg-desktop-portal-helium.doap b/xdg-desktop-portal-helium.doap deleted file mode 100644 index e1065d9..0000000 --- a/xdg-desktop-portal-helium.doap +++ /dev/null @@ -1,46 +0,0 @@ - - - xdg-desktop-portal-helium - GNOME Desktop Portal - - XDG Desktop Portal implementation for GNOME. It uses GNOME-specific APIs and - components, such as GNOME Shell, Mutter, GNOME Settings Daemon, and libadwaita, - to provide various portal features. - - - - - - - - C - - - - Georges Basile Stavracas Neto - - gbsneto - - - - - GNOME Release Team - - nobody - - - - - Matthias Clasen - - matthiasc - - - - diff --git a/xdg-desktop-portal-helium.spec b/xdg-desktop-portal-helium.spec index 019224c..25f887a 100644 --- a/xdg-desktop-portal-helium.spec +++ b/xdg-desktop-portal-helium.spec @@ -6,7 +6,7 @@ Name: xdg-desktop-portal-helium Version: 1.1 Release: 15 -Summary: Backend implementation for xdg-desktop-portal for gnomeOS. +Summary: Backend implementation for xdg-desktop-portal for Helium apps. License: LGPLv2+ URL: https://gnomeos.co @@ -21,7 +21,7 @@ BuildRequires: pkgconfig(gnome-bg-4) BuildRequires: pkgconfig(gnome-desktop-4) BuildRequires: pkgconfig(gsettings-desktop-schemas) BuildRequires: pkgconfig(gtk4) -BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: pkgconfig(libhelium-1) BuildRequires: pkgconfig(xdg-desktop-portal) >= %{xdg_desktop_portal_version} BuildRequires: systemd-rpm-macros @@ -29,15 +29,8 @@ Requires: dbus Requires: dbus-common Requires: xdg-desktop-portal >= %{xdg_desktop_portal_version} -Supplements: gnome-shell - -Provides: xdg-desktop-portal-helium = 43 -Provides: xdg-desktop-portal-helium%{?_isa} = 43 -Conflicts: xdg-desktop-portal-helium = 43 -Conflicts: xdg-desktop-portal-helium%{?_isa} = 43 - %description -A backend implementation for xdg-desktop-portal for gnomeOS. +A backend implementation for xdg-desktop-portal for Helium apps. %prep @@ -63,7 +56,7 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/xdg-desktop-portal-h %files -f xdg-desktop-portal-helium.lang %license COPYING -%doc NEWS README.md +%doc README.md %{_libexecdir}/xdg-desktop-portal-helium %{_datadir}/applications/xdg-desktop-portal-helium.desktop %{_datadir}/glib-2.0/schemas/xdg-desktop-portal-helium.gschema.xml