forked from pool/at-spi2-core
Accepting request 235800 from home:dliang:branches:GNOME:Factory
bnc#873541: register to gnome-session on autostart, bnc#876680: register only once OBS-URL: https://build.opensuse.org/request/show/235800 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/at-spi2-core?expand=0&rev=116
This commit is contained in:
parent
b881620d46
commit
ab47c66c89
13
at-spi2-core-cancel-logout.patch
Normal file
13
at-spi2-core-cancel-logout.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff -Npur at-spi2-core-2.10.2-bak/registryd/registry-main.c at-spi2-core-2.10.2/registryd/registry-main.c
|
||||||
|
--- at-spi2-core-2.10.2-bak/registryd/registry-main.c 2014-05-30 03:00:30.249444690 +0800
|
||||||
|
+++ at-spi2-core-2.10.2/registryd/registry-main.c 2014-05-30 03:01:05.005444798 +0800
|
||||||
|
@@ -164,6 +164,9 @@ register_client (void)
|
||||||
|
const char *startup_id;
|
||||||
|
const char *app_id;
|
||||||
|
|
||||||
|
+ if (client_proxy)
|
||||||
|
+ return TRUE;
|
||||||
|
+
|
||||||
|
startup_id = g_getenv ("DESKTOP_AUTOSTART_ID");
|
||||||
|
if (!startup_id)
|
||||||
|
startup_id = "";
|
@ -1,3 +1,16 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri May 30 03:14:44 UTC 2014 - dliang@suse.com
|
||||||
|
|
||||||
|
- Add at-spi2-core-cancel-logout.patch (bnc#876680)
|
||||||
|
gnome-session emit SessionRunning after turn back from
|
||||||
|
QueryEndSession
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue May 6 06:33:19 UTC 2014 - dliang@suse.com
|
||||||
|
|
||||||
|
- Add at-spi2-register-on-session-running.patch
|
||||||
|
register the client when session manager is running. (bnc#873541)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Mar 25 09:34:15 UTC 2014 - dimstar@opensuse.org
|
Tue Mar 25 09:34:15 UTC 2014 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
@ -26,6 +26,10 @@ Url: http://www.gnome.org/
|
|||||||
Source0: http://download.gnome.org/sources/at-spi2-core/2.12/%{name}-%{version}.tar.xz
|
Source0: http://download.gnome.org/sources/at-spi2-core/2.12/%{name}-%{version}.tar.xz
|
||||||
Source98: baselibs.conf
|
Source98: baselibs.conf
|
||||||
Source99: %{name}-rpmlintrc
|
Source99: %{name}-rpmlintrc
|
||||||
|
# PATCH-FIX-OPENSUSE at-spi2-register-on-session-running.patch bnc#873541 dliang@suse.com -- register to session in autostart session
|
||||||
|
Patch0: at-spi2-register-on-session-running.patch
|
||||||
|
# PATCH-FIX-OPENSUSE at-spi2-core-cancel-logout.patch bnc#876680 dliang@suse.com -- register to gnome-session only one time
|
||||||
|
Patch1: at-spi2-core-cancel-logout.patch
|
||||||
BuildRequires: glib2-devel
|
BuildRequires: glib2-devel
|
||||||
BuildRequires: gobject-introspection-devel
|
BuildRequires: gobject-introspection-devel
|
||||||
BuildRequires: intltool
|
BuildRequires: intltool
|
||||||
@ -80,6 +84,8 @@ to develop applications that require these.
|
|||||||
%lang_package
|
%lang_package
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure \
|
%configure \
|
||||||
|
83
at-spi2-register-on-session-running.patch
Normal file
83
at-spi2-register-on-session-running.patch
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
diff -Npur at-spi2-core-2.12.0/registryd/registry-main.c at-spi2-core-2.12.0-new/registryd/registry-main.c
|
||||||
|
--- at-spi2-core-2.12.0/registryd/registry-main.c 2014-03-17 21:47:05.000000000 +0800
|
||||||
|
+++ at-spi2-core-2.12.0-new/registryd/registry-main.c 2014-05-06 14:45:04.371517936 +0800
|
||||||
|
@@ -57,8 +57,10 @@ static GDBusProxy *client_proxy = N
|
||||||
|
|
||||||
|
#define SM_CLIENT_DBUS_INTERFACE "org.gnome.SessionManager.ClientPrivate"
|
||||||
|
|
||||||
|
+static gboolean register_client (void);
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
-on_session_over (GDBusProxy *proxy,
|
||||||
|
+on_session_signal (GDBusProxy *proxy,
|
||||||
|
gchar *sender_name,
|
||||||
|
gchar *signal_name,
|
||||||
|
GVariant *parameters,
|
||||||
|
@@ -66,20 +68,38 @@ on_session_over (GDBusProxy *proxy,
|
||||||
|
{
|
||||||
|
if (g_strcmp0 (signal_name, "SessionOver") == 0) {
|
||||||
|
g_main_loop_quit (mainloop);
|
||||||
|
+ } else if (g_strcmp0 (signal_name, "SessionRunning") == 0) {
|
||||||
|
+ if (!register_client ())
|
||||||
|
+ g_warning ("Unable to register client with session manager");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
session_manager_connect (void)
|
||||||
|
{
|
||||||
|
+ GVariant *res;
|
||||||
|
+ gboolean is_running;
|
||||||
|
|
||||||
|
sm_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, 0, NULL,
|
||||||
|
SM_DBUS_NAME,
|
||||||
|
SM_DBUS_PATH,
|
||||||
|
SM_DBUS_INTERFACE, NULL, NULL);
|
||||||
|
|
||||||
|
+ res = g_dbus_proxy_call_sync (sm_proxy,
|
||||||
|
+ "IsSessionRunning", NULL,
|
||||||
|
+ 0, 1000, NULL, NULL);
|
||||||
|
+
|
||||||
|
+ if (res) {
|
||||||
|
+ g_variant_get (res, "(b)", &is_running);
|
||||||
|
+ g_variant_unref (res);
|
||||||
|
+ if (is_running) {
|
||||||
|
+ if (!register_client ())
|
||||||
|
+ g_warning ("Unable to register client with session manager");
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
g_signal_connect (G_OBJECT (sm_proxy), "g-signal",
|
||||||
|
- G_CALLBACK (on_session_over), NULL);
|
||||||
|
+ G_CALLBACK (on_session_signal), NULL);
|
||||||
|
|
||||||
|
return (sm_proxy != NULL);
|
||||||
|
}
|
||||||
|
@@ -87,7 +107,7 @@ session_manager_connect (void)
|
||||||
|
static gboolean
|
||||||
|
end_session_response (gboolean is_okay, const gchar *reason)
|
||||||
|
{
|
||||||
|
- GVariant *ret;
|
||||||
|
+ GVariant *ret;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
if (!reason)
|
||||||
|
@@ -132,7 +152,7 @@ static gboolean
|
||||||
|
register_client (void)
|
||||||
|
{
|
||||||
|
GError *error;
|
||||||
|
- GVariant *res;
|
||||||
|
+ GVariant *res;
|
||||||
|
const char *startup_id;
|
||||||
|
const char *app_id;
|
||||||
|
|
||||||
|
@@ -232,9 +252,6 @@ main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
if (!session_manager_connect ())
|
||||||
|
g_warning ("Unable to connect to session manager");
|
||||||
|
-
|
||||||
|
- if (!register_client ())
|
||||||
|
- g_warning ("Unable to register client with session manager");
|
||||||
|
}
|
||||||
|
|
||||||
|
g_main_loop_run (mainloop);
|
Loading…
x
Reference in New Issue
Block a user