parent
fe077ffc4d
commit
11513efa22
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,3 +28,4 @@
|
||||
/xdg-desktop-portal-1.7.2.tar.xz
|
||||
/xdg-desktop-portal-1.8.0.tar.xz
|
||||
/xdg-desktop-portal-1.8.1.tar.xz
|
||||
/xdg-desktop-portal-1.12.1.tar.xz
|
||||
|
@ -1,302 +1,14 @@
|
||||
From 9e5e5ae969a96ab8ef6de7c28a0ebc1deae08b86 Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Mon, 9 Aug 2021 16:41:29 +0200
|
||||
Subject: [PATCH 1/3] data: add PowerProfileMonitor interface definition
|
||||
|
||||
---
|
||||
data/Makefile.am.inc | 1 +
|
||||
...freedesktop.portal.PowerProfileMonitor.xml | 43 +++++++++++++++++++
|
||||
2 files changed, 44 insertions(+)
|
||||
create mode 100644 data/org.freedesktop.portal.PowerProfileMonitor.xml
|
||||
|
||||
diff --git a/data/Makefile.am.inc b/data/Makefile.am.inc
|
||||
index aacba2a..3aabe16 100644
|
||||
--- a/data/Makefile.am.inc
|
||||
+++ b/data/Makefile.am.inc
|
||||
@@ -15,6 +15,7 @@ dist_introspection_DATA = \
|
||||
data/org.freedesktop.portal.NetworkMonitor.xml \
|
||||
data/org.freedesktop.portal.Notification.xml \
|
||||
data/org.freedesktop.portal.OpenURI.xml \
|
||||
+ data/org.freedesktop.portal.PowerProfileMonitor.xml \
|
||||
data/org.freedesktop.portal.Print.xml \
|
||||
data/org.freedesktop.portal.ProxyResolver.xml \
|
||||
data/org.freedesktop.portal.RemoteDesktop.xml \
|
||||
diff --git a/data/org.freedesktop.portal.PowerProfileMonitor.xml b/data/org.freedesktop.portal.PowerProfileMonitor.xml
|
||||
new file mode 100644
|
||||
index 0000000..daf487a
|
||||
--- /dev/null
|
||||
+++ b/data/org.freedesktop.portal.PowerProfileMonitor.xml
|
||||
@@ -0,0 +1,43 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<!--
|
||||
+ Copyright (C) 2021 Red Hat, Inc.
|
||||
+
|
||||
+ This library 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 <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ Authors: Bastien Nocera <hadess@hadess.net>
|
||||
+-->
|
||||
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
+ <!--
|
||||
+ org.freedesktop.portal.PowerProfileMonitor:
|
||||
+ @short_description: Power Profile monitoring portal
|
||||
+
|
||||
+ The Power Profile Monitor interface provides information about the
|
||||
+ user-selected system-wide power profile, to sandboxed applications.
|
||||
+ It is not a portal in the strict sense, since it does not involve
|
||||
+ user interaction. Applications are expected to use this interface
|
||||
+ indirectly, via a library API such as the GLib GPowerProfileMonitor interface.
|
||||
+
|
||||
+ This documentation describes version 1 of this interface.
|
||||
+ -->
|
||||
+ <interface name="org.freedesktop.portal.PowerProfileMonitor">
|
||||
+ <!--
|
||||
+ power-saver-enabled:
|
||||
+
|
||||
+ Whether “Power Saver” mode is enabled on the system.
|
||||
+ -->
|
||||
+ <property name="power-saver-enabled" type="b" access="read"/>
|
||||
+
|
||||
+ <property name="version" type="u" access="read"/>
|
||||
+ </interface>
|
||||
+</node>
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
From 9a5ab798e345063eecaf6ef049cfab1ee3d52925 Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Mon, 9 Aug 2021 17:11:25 +0200
|
||||
Subject: [PATCH 2/3] power-profile-monitor: Add portal implementation for
|
||||
GPowerProfileMonitor
|
||||
|
||||
See glib references:
|
||||
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2194
|
||||
---
|
||||
src/Makefile.am.inc | 3 +
|
||||
src/power-profile-monitor.c | 113 ++++++++++++++++++++++++++++++++++++
|
||||
src/power-profile-monitor.h | 25 ++++++++
|
||||
src/xdg-desktop-portal.c | 2 +
|
||||
4 files changed, 143 insertions(+)
|
||||
create mode 100644 src/power-profile-monitor.c
|
||||
create mode 100644 src/power-profile-monitor.h
|
||||
|
||||
diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc
|
||||
index 961a722..7e803dd 100644
|
||||
--- a/src/Makefile.am.inc
|
||||
+++ b/src/Makefile.am.inc
|
||||
@@ -41,6 +41,7 @@ PORTAL_IFACE_FILES =\
|
||||
data/org.freedesktop.portal.Camera.xml \
|
||||
data/org.freedesktop.portal.Secret.xml \
|
||||
data/org.freedesktop.portal.Wallpaper.xml \
|
||||
+ data/org.freedesktop.portal.PowerProfileMonitor.xml \
|
||||
$(NULL)
|
||||
|
||||
PORTAL_IMPL_IFACE_FILES =\
|
||||
@@ -126,6 +127,8 @@ xdg_desktop_portal_SOURCES = \
|
||||
src/memory-monitor.h \
|
||||
src/network-monitor.c \
|
||||
src/network-monitor.h \
|
||||
+ src/power-profile-monitor.c \
|
||||
+ src/power-profile-monitor.h \
|
||||
src/proxy-resolver.c \
|
||||
src/proxy-resolver.h \
|
||||
src/screenshot.c \
|
||||
diff --git a/src/power-profile-monitor.c b/src/power-profile-monitor.c
|
||||
new file mode 100644
|
||||
index 0000000..9ffa87a
|
||||
--- /dev/null
|
||||
+++ b/src/power-profile-monitor.c
|
||||
@@ -0,0 +1,113 @@
|
||||
+/*
|
||||
+ * Copyright © 2021 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 <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ * Authors:
|
||||
+ * Bastien Nocera <hadess@hadess.net>
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <gio/gio.h>
|
||||
+
|
||||
+#include "power-profile-monitor.h"
|
||||
+#include "request.h"
|
||||
+#include "xdp-dbus.h"
|
||||
+#include "xdp-utils.h"
|
||||
+
|
||||
+#if GLIB_CHECK_VERSION(2, 69, 1)
|
||||
+#define HAS_POWER_PROFILE_MONITOR 1
|
||||
+#endif
|
||||
+
|
||||
+typedef struct _PowerProfileMonitor PowerProfileMonitor;
|
||||
+typedef struct _PowerProfileMonitorClass PowerProfileMonitorClass;
|
||||
+
|
||||
+struct _PowerProfileMonitor
|
||||
+{
|
||||
+ XdpPowerProfileMonitorSkeleton parent_instance;
|
||||
+
|
||||
+#ifdef HAS_POWER_PROFILE_MONITOR
|
||||
+ GPowerProfileMonitor *monitor;
|
||||
+#endif /* HAS_POWER_PROFILE_MONITOR */
|
||||
+};
|
||||
+
|
||||
+struct _PowerProfileMonitorClass
|
||||
+{
|
||||
+ XdpPowerProfileMonitorSkeletonClass parent_class;
|
||||
+};
|
||||
+
|
||||
+static PowerProfileMonitor *power_profile_monitor;
|
||||
+
|
||||
+GType power_profile_monitor_get_type (void) G_GNUC_CONST;
|
||||
+static void power_profile_monitor_iface_init (XdpPowerProfileMonitorIface *iface);
|
||||
+
|
||||
+G_DEFINE_TYPE_WITH_CODE (PowerProfileMonitor, power_profile_monitor, XDP_TYPE_POWER_PROFILE_MONITOR_SKELETON,
|
||||
+ G_IMPLEMENT_INTERFACE (XDP_TYPE_POWER_PROFILE_MONITOR, power_profile_monitor_iface_init));
|
||||
+
|
||||
+static void
|
||||
+power_profile_monitor_iface_init (XdpPowerProfileMonitorIface *iface)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#ifdef HAS_POWER_PROFILE_MONITOR
|
||||
+static void
|
||||
+power_saver_enabled_changed_cb (GObject *gobject,
|
||||
+ GParamSpec *pspec,
|
||||
+ PowerProfileMonitor *ppm)
|
||||
+{
|
||||
+ xdp_power_profile_monitor_set_power_saver_enabled (XDP_POWER_PROFILE_MONITOR (ppm),
|
||||
+ g_power_profile_monitor_get_power_saver_enabled (ppm->monitor));
|
||||
+}
|
||||
+#endif /* HAS_POWER_PROFILE_MONITOR */
|
||||
+
|
||||
+static void
|
||||
+power_profile_monitor_init (PowerProfileMonitor *ppm)
|
||||
+{
|
||||
+#ifdef HAS_POWER_PROFILE_MONITOR
|
||||
+ ppm->monitor = g_power_profile_monitor_dup_default ();
|
||||
+ g_signal_connect (ppm->monitor, "notify::power-saver-enabled", G_CALLBACK (power_saver_enabled_changed_cb), ppm);
|
||||
+#endif /* HAS_POWER_PROFILE_MONITOR */
|
||||
+
|
||||
+ xdp_power_profile_monitor_set_version (XDP_POWER_PROFILE_MONITOR (ppm), 1);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+power_profile_monitor_finalize (GObject *object)
|
||||
+{
|
||||
+#ifdef HAS_POWER_PROFILE_MONITOR
|
||||
+ PowerProfileMonitor *ppm = (PowerProfileMonitor *) object;
|
||||
+
|
||||
+ g_clear_object (&ppm->monitor);
|
||||
+#endif /* HAS_POWER_PROFILE_MONITOR */
|
||||
+
|
||||
+ G_OBJECT_CLASS (power_profile_monitor_parent_class)->finalize (object);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+power_profile_monitor_class_init (PowerProfileMonitorClass *klass)
|
||||
+{
|
||||
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
+
|
||||
+ object_class->finalize = power_profile_monitor_finalize;
|
||||
+}
|
||||
+
|
||||
+GDBusInterfaceSkeleton *
|
||||
+power_profile_monitor_create (GDBusConnection *connection)
|
||||
+{
|
||||
+ power_profile_monitor = g_object_new (power_profile_monitor_get_type (), NULL);
|
||||
+
|
||||
+ return G_DBUS_INTERFACE_SKELETON (power_profile_monitor);
|
||||
+}
|
||||
diff --git a/src/power-profile-monitor.h b/src/power-profile-monitor.h
|
||||
new file mode 100644
|
||||
index 0000000..b23ea8b
|
||||
--- /dev/null
|
||||
+++ b/src/power-profile-monitor.h
|
||||
@@ -0,0 +1,25 @@
|
||||
+/*
|
||||
+ * Copyright © 2021 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 <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ * Authors:
|
||||
+ * Bastien Nocera <hadess@hadess.net>
|
||||
+ */
|
||||
+
|
||||
+#pragma once
|
||||
+
|
||||
+#include <gio/gio.h>
|
||||
+
|
||||
+GDBusInterfaceSkeleton * power_profile_monitor_create (GDBusConnection *connection);
|
||||
diff --git a/src/xdg-desktop-portal.c b/src/xdg-desktop-portal.c
|
||||
index 88a6c5e..e5f3002 100644
|
||||
--- a/src/xdg-desktop-portal.c
|
||||
+++ b/src/xdg-desktop-portal.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "print.h"
|
||||
#include "memory-monitor.h"
|
||||
#include "network-monitor.h"
|
||||
+#include "power-profile-monitor.h"
|
||||
#include "proxy-resolver.h"
|
||||
#include "screenshot.h"
|
||||
#include "notification.h"
|
||||
@@ -227,6 +228,7 @@ on_bus_acquired (GDBusConnection *connection,
|
||||
lockdown = xdp_impl_lockdown_skeleton_new ();
|
||||
|
||||
export_portal_implementation (connection, memory_monitor_create (connection));
|
||||
+ export_portal_implementation (connection, power_profile_monitor_create (connection));
|
||||
export_portal_implementation (connection, network_monitor_create (connection));
|
||||
export_portal_implementation (connection, proxy_resolver_create (connection));
|
||||
export_portal_implementation (connection, trash_create (connection));
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
From ba7413f52dfd2c933a261509e511ce724dd5042a Mon Sep 17 00:00:00 2001
|
||||
From 5b065233a76c642d0316d8f3143b0e63ca3b2d40 Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Tue, 24 Aug 2021 16:38:18 +0200
|
||||
Subject: [PATCH 3/3] Force power-profiles-daemon support in
|
||||
Subject: [PATCH] Force power-profiles-daemon support in
|
||||
|
||||
---
|
||||
src/power-profile-monitor.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/src/power-profile-monitor.c b/src/power-profile-monitor.c
|
||||
index 9ffa87a..d033fed 100644
|
||||
index 9ffa87a51296..d033feded5e0 100644
|
||||
--- a/src/power-profile-monitor.c
|
||||
+++ b/src/power-profile-monitor.c
|
||||
@@ -28,9 +28,7 @@
|
||||
@ -310,5 +22,5 @@ index 9ffa87a..d033fed 100644
|
||||
typedef struct _PowerProfileMonitor PowerProfileMonitor;
|
||||
typedef struct _PowerProfileMonitorClass PowerProfileMonitorClass;
|
||||
--
|
||||
2.31.1
|
||||
2.34.1
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (xdg-desktop-portal-1.8.1.tar.xz) = 447d287d6627a1086d97dc5ebda20dfb1d0ca8643cbe54a7af5f6205a122a7be9d1643fded592f922c015561b7e2f4c6b6df555db3e0d3c02aad5bbe944077b6
|
||||
SHA512 (xdg-desktop-portal-1.12.1.tar.xz) = 62df427e2d8d54acd9a34a02a77c26ae3911fbb4c5844eff4a253dc839775c929c6945401b93549ba200ba637d315146767e41f18a831d7627b35de880de0da1
|
||||
|
@ -4,8 +4,8 @@
|
||||
%global low_memory_monitor_version 2.0
|
||||
|
||||
Name: xdg-desktop-portal
|
||||
Version: 1.8.1
|
||||
Release: 6%{?dist}
|
||||
Version: 1.12.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Portal frontend service to flatpak
|
||||
|
||||
License: LGPLv2+
|
||||
@ -24,10 +24,6 @@ BuildRequires: /usr/bin/xmlto
|
||||
%{?systemd_requires}
|
||||
BuildRequires: systemd
|
||||
BuildRequires: git
|
||||
BuildRequires: automake
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: libtool
|
||||
BuildRequires: gettext-devel
|
||||
|
||||
Requires: dbus
|
||||
# Required version for icon validator.
|
||||
@ -60,7 +56,6 @@ The pkg-config file for %{name}.
|
||||
|
||||
%prep
|
||||
%autosetup -S git -p1
|
||||
autoreconf -f -i
|
||||
|
||||
|
||||
%build
|
||||
@ -111,6 +106,10 @@ install -dm 755 %{buildroot}/%{_datadir}/%{name}/portals
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Feb 08 2022 Debarshi Ray <rishi@fedoraproject.org> - 1.12.1-1
|
||||
- Rebase to 1.12.1
|
||||
Resolves: #2051488
|
||||
|
||||
* Tue Aug 24 2021 Bastien Nocera <bnocera@redhat.com> - 1.8.1-6
|
||||
+ xdg-desktop-portal-1.8.1-6
|
||||
- Add PowerProfileMonitor portal
|
||||
|
Loading…
Reference in New Issue
Block a user