summaryrefslogtreecommitdiffstats
path: root/source/x/scim-bridge/patches/scim-bridge-0.4.16-scim-bridge-client-imcontext-gtk.c.patch
blob: 21f1f824e845f912fbd1983a592c8af1e63cb8d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- scim-bridge-0.4.16/client-gtk/scim-bridge-client-imcontext-gtk.c.bak	2008-11-02 14:44:23.000000000 +0800
+++ scim-bridge-0.4.16/client-gtk/scim-bridge-client-imcontext-gtk.c	2010-09-11 23:19:10.556978680 +0800
@@ -35,6 +35,8 @@
 #include "scim-bridge-output.h"
 #include "scim-bridge-string.h"
 
+#define SEND_EVENT_MASK 0x02
+
 /* Typedef */
 struct _ScimBridgeClientIMContext
 {
@@ -200,7 +202,7 @@
 {
     scim_bridge_pdebugln (7, "key_snooper ()");
 
-    if (!event->send_event && scim_bridge_client_is_messenger_opened () && focused_imcontext != NULL) {
+    if (!(event->send_event & SEND_EVENT_MASK)  && scim_bridge_client_is_messenger_opened () && focused_imcontext != NULL) {
         if (focused_imcontext->client_window != NULL) {
             int new_window_x;
             int new_window_y;
@@ -556,7 +558,7 @@
 { 
     GdkEventKey gdk_event;
     scim_bridge_key_event_bridge_to_gdk (&gdk_event, imcontext->client_window, key_event);
-    gdk_event.send_event = TRUE;
+    gdk_event.send_event |= SEND_EVENT_MASK;
     if (imcontext == focused_imcontext && focused_widget != NULL) {
         const char *signal_name = NULL;
         if (scim_bridge_key_event_is_pressed (key_event)) {
@@ -762,7 +764,7 @@
 
     ScimBridgeClientIMContext *imcontext = SCIM_BRIDGE_CLIENT_IMCONTEXT (context);
     
-    if (!event->send_event && scim_bridge_client_is_messenger_opened () && imcontext != NULL && !key_snooper_used) {
+    if (!(event->send_event & SEND_EVENT_MASK) && scim_bridge_client_is_messenger_opened () && imcontext != NULL && !key_snooper_used) {
 
         if (imcontext->client_window != NULL) {
             int new_window_x;
@@ -875,7 +877,7 @@
         scim_bridge_client_open_messenger ();
     }
 
-    if (is_key_snooper_enabled ()) {
+    if (!key_snooper_used && is_key_snooper_enabled ()) {
         key_snooper_id = gtk_key_snooper_install ((GtkKeySnoopFunc) &key_snooper, NULL);
         key_snooper_used = TRUE;
     }