Accepting request 449717 from home:Zaitor

Yet a resub, added boo ref in spec too

OBS-URL: https://build.opensuse.org/request/show/449717
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=265
This commit is contained in:
Bjørn Lie 2017-01-12 12:18:38 +00:00 committed by Git OBS Bridge
parent 12d9c6d711
commit fbefa47427
3 changed files with 100 additions and 3 deletions

View File

@ -0,0 +1,86 @@
From f906815f6d62c6c9555286f7b95d11671eabee21 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 17 Nov 2016 14:03:37 +0100
Subject: media-keys: Fix shutdown dialog delay when using kbd shortcut
After pressing the Ctrl+Alt+Del shortcut, the shutdown dialog doesn't
appear on screen for a couple of seconds.
The media-keys daemon calls the 'Shutdown' method synchronously. After that
gnome-session calls the daemon with 'QueryEndSession'. The daemon cannot
reply as it's blocked waiting for the reply to the Shutdown method.
Sending the message asynchronously fixes that delay.
Based on report by Xiaoguang Wang <xwang@suse.com>
https://bugzilla.gnome.org/show_bug.cgi?id=774452
---
plugins/media-keys/gsd-media-keys-manager.c | 46 +++++++++++++++++++----------
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index d77ed10..cb90d08 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -810,26 +810,42 @@ do_media_action (GsdMediaKeysManager *manager,
}
static void
+gnome_session_shutdown_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GVariant *result;
+ GError *error = NULL;
+
+ result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object),
+ res,
+ &error);
+ if (result == NULL) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_warning ("Failed to call Shutdown on session manager: %s",
+ error->message);
+ g_error_free (error);
+ } else {
+ g_variant_unref (result);
+ }
+}
+
+static void
gnome_session_shutdown (GsdMediaKeysManager *manager)
{
- GError *error = NULL;
- GVariant *variant;
GDBusProxy *proxy;
proxy = G_DBUS_PROXY (gnome_settings_bus_get_session_proxy ());
- variant = g_dbus_proxy_call_sync (proxy,
- "Shutdown",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
- if (variant == NULL) {
- g_warning ("Failed to call Shutdown on session manager: %s", error->message);
- g_error_free (error);
- return;
- }
- g_variant_unref (variant);
+
+ g_dbus_proxy_call (proxy,
+ "Shutdown",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ manager->priv->bus_cancellable,
+ gnome_session_shutdown_cb,
+ NULL);
+
g_object_unref (proxy);
}
--
cgit v0.12

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Jan 11 15:23:50 UTC 2017 - zaitor@opensuse.org
- Add gnome-settings-daemon-fix-shutdown-dialog-delay.patch: Fix
shutdown dialog delay when using kbd shortcut (bgo#774452).
- Apply gnome-settings-daemon-initial-keyboard.patch also for
openSUSE, this fix is also needed there (boo#1009515).
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Oct 13 10:46:18 UTC 2016 - sckang@suse.com Thu Oct 13 10:46:18 UTC 2016 - sckang@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package gnome-settings-daemon # spec file for package gnome-settings-daemon
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -45,12 +45,14 @@ Patch21: gnome-settings-daemon-notify-idle-resumed.patch
Patch22: gnome-settings-daemon-bnc873545-hide-warnings.patch Patch22: gnome-settings-daemon-bnc873545-hide-warnings.patch
# PATCH-FIX-SLE gnome-settings-daemon-sle-configure-timeout-blank.patch bnc#869685 bgo#710904 cxiong@suse.com -- monitor off timeout is too short, extends it to 5 min # PATCH-FIX-SLE gnome-settings-daemon-sle-configure-timeout-blank.patch bnc#869685 bgo#710904 cxiong@suse.com -- monitor off timeout is too short, extends it to 5 min
Patch24: gnome-settings-daemon-sle-configure-timeout-blank.patch Patch24: gnome-settings-daemon-sle-configure-timeout-blank.patch
# PATCH-FIX-SLE gnome-settings-daemon-initial-keyboard.patch bsc#979051 federico@suse.com -- Deal with the default keyboard being set from xkb instead of GNOME # PATCH-FIX-OPENSUSE gnome-settings-daemon-initial-keyboard.patch bsc#979051 boo#1009515 federico@suse.com -- Deal with the default keyboard being set from xkb instead of GNOME
Patch29: gnome-settings-daemon-initial-keyboard.patch Patch29: gnome-settings-daemon-initial-keyboard.patch
# PATCH-FIX-OPENSUSE gnome-settings-daemon-bring-back-updates-plugin.patch bsc#991024 sckang@suse.com -- Add the updates plugin back # PATCH-FIX-OPENSUSE gnome-settings-daemon-bring-back-updates-plugin.patch bsc#991024 sckang@suse.com -- Add the updates plugin back
Patch31: gnome-settings-daemon-bring-back-updates-plugin.patch Patch31: gnome-settings-daemon-bring-back-updates-plugin.patch
# PATCH-FEATURE-OPENSUSE gnome-settings-daemon-more-power-button-actions.patch bsc#996342 fezhang@suse.com -- Bring back the "shutdown" and "interactive" power button actions. # PATCH-FEATURE-OPENSUSE gnome-settings-daemon-more-power-button-actions.patch bsc#996342 fezhang@suse.com -- Bring back the "shutdown" and "interactive" power button actions.
Patch32: gnome-settings-daemon-more-power-button-actions.patch Patch32: gnome-settings-daemon-more-power-button-actions.patch
# PATCH-FIX-UPSTREAM gnome-settings-daemon-fix-shutdown-dialog-delay.patch bgo#774452 zaitor@opensuse.org -- Fix shutdown dialog delay when using kbd shortcut
Patch33: gnome-settings-daemon-fix-shutdown-dialog-delay.patch
BuildRequires: cups-devel BuildRequires: cups-devel
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gtk-doc BuildRequires: gtk-doc
@ -158,12 +160,13 @@ gnome-patch-translation-prepare
%patch21 -p1 %patch21 -p1
%patch22 -p1 %patch22 -p1
%patch24 -p0 %patch24 -p0
%patch29 -p1
%endif %endif
%patch29 -p1
%if 0%{?suse_version} == 1315 %if 0%{?suse_version} == 1315
%patch31 -p1 %patch31 -p1
%patch32 -p1 %patch32 -p1
%endif %endif
%patch33 -p1
%build %build
%if 0%{?suse_version} == 1315 %if 0%{?suse_version} == 1315