[gnome-settings-daemon/wip/benzea/cleanups-and-small-fixes: 45/51] clipboard: Balance out error trapping code



commit a7748dbf0846640bfa55885b2c84eabbe774a685
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Feb 25 16:29:53 2019 +0100

    clipboard: Balance out error trapping code
    
    The error trap would only be popped if the if branch was taken. Move the
    error trap pushing into the if branch to prevent possible issues.

 plugins/clipboard/gsd-clipboard-manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/clipboard/gsd-clipboard-manager.c b/plugins/clipboard/gsd-clipboard-manager.c
index 49a969a9..571533a2 100644
--- a/plugins/clipboard/gsd-clipboard-manager.c
+++ b/plugins/clipboard/gsd-clipboard-manager.c
@@ -447,9 +447,9 @@ convert_clipboard_manager (GsdClipboardManager *manager,
                         if (gdk_error_trap_pop () != Success)
                                 return;
 
-                        gdk_error_trap_push ();
-
                         if (xev->xselectionrequest.property != None) {
+                                gdk_error_trap_push ();
+
                                 XGetWindowProperty (manager->display,
                                                     xev->xselectionrequest.requestor,
                                                     xev->xselectionrequest.property,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]