File xrdp-filter-tab-from-mstsc-on-focus-change.patch of Package xrdp.12617

From b8c6e8a1ef89d53d2c6a3e0e45c97d270ca1b94b Mon Sep 17 00:00:00 2001
From: Felix Zhang <fezhang@suse.com>
Date: Fri, 22 Apr 2016 07:27:31 +0800
Subject: [PATCH] xrdp filter tab from mstsc on focus change

---
 xrdp/xrdp_wm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 362d0d0..9a2e013 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -1427,6 +1427,7 @@ xrdp_wm_key(struct xrdp_wm *self, int device_flags, int scan_code)
 {
     int msg;
     struct xrdp_key_info *ki;
+    static int last_key_status = -1;
 
     /*g_printf("count %d\n", self->key_down_list->count);*/
     scan_code = scan_code % 128;
@@ -1472,7 +1473,12 @@ xrdp_wm_key(struct xrdp_wm *self, int device_flags, int scan_code)
 
             if (ki != 0)
             {
-                self->mm->mod->mod_event(self->mm->mod, msg, ki->chr, ki->sym,
+                if ((last_key_status != WM_KEYDOWN) && (scan_code == 15) && (device_flags == KBD_FLAG_UP))
+                {
+                    g_writeln("Don't track Tab keys from Windows when Max/Min or Move the rdp client window.\n");
+                }
+                else
+                    self->mm->mod->mod_event(self->mm->mod, msg, ki->chr, ki->sym,
                                          scan_code, device_flags);
             }
         }
@@ -1483,6 +1489,7 @@ xrdp_wm_key(struct xrdp_wm *self, int device_flags, int scan_code)
                              msg, scan_code, device_flags);
     }
 
+    last_key_status = msg;
     return 0;
 }
 
-- 
2.6.6
openSUSE Build Service is sponsored by