Blob Blame History Raw
From 67ae87c416c1a31648a7fc15cad22dca8e54a56d Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Mon, 22 Feb 2016 11:48:54 +0100
Subject: [PATCH] Don't capture key events of other tabs

Once an RDP tab is opened it captures all key events
on the Vinagre's window.
This commit fixes this so the RDP tab captures the events
just from its own tab.
---
 plugins/rdp/vinagre-rdp-tab.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index b1e059f..39b18a7 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -171,7 +171,6 @@ vinagre_rdp_tab_dispose (GObject *object)
 {
   VinagreRdpTab        *rdp_tab = VINAGRE_RDP_TAB (object);
   VinagreRdpTabPrivate *priv = rdp_tab->priv;
-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (VINAGRE_TAB (rdp_tab)));
 
   if (priv->connected_actions)
     {
@@ -219,13 +218,13 @@ vinagre_rdp_tab_dispose (GObject *object)
 
   if (priv->key_press_handler_id > 0)
     {
-      g_signal_handler_disconnect (window, priv->key_press_handler_id);
+      g_signal_handler_disconnect (GTK_WIDGET (object), priv->key_press_handler_id);
       priv->key_press_handler_id = 0;
     }
 
   if (priv->key_release_handler_id > 0)
     {
-      g_signal_handler_disconnect (window, priv->key_release_handler_id);
+      g_signal_handler_disconnect (GTK_WIDGET (object), priv->key_release_handler_id);
       priv->key_release_handler_id = 0;
     }
 
@@ -1162,11 +1161,11 @@ init_display (VinagreRdpTab *rdp_tab)
       vinagre_rdp_tab_set_scaling (rdp_tab, scaling);
     }
 
-  priv->key_press_handler_id = g_signal_connect (window, "key-press-event",
+  priv->key_press_handler_id = g_signal_connect (GTK_WIDGET (tab), "key-press-event",
                                                  G_CALLBACK (frdp_key_pressed),
                                                  rdp_tab);
 
-  priv->key_release_handler_id = g_signal_connect (window, "key-release-event",
+  priv->key_release_handler_id = g_signal_connect (GTK_WIDGET (tab), "key-release-event",
                                                    G_CALLBACK (frdp_key_pressed),
                                                    rdp_tab);
 }
-- 
2.5.0