summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
authorSpeidy <speidy@gmail.com>2016-12-12 15:51:39 -0800
committerSpeidy <speidy@gmail.com>2016-12-12 15:51:39 -0800
commita0cf6030df8364d4a5ab775a8e91ccfeb0ef4209 (patch)
tree57864869313a3be01062333613b4b057952b7534 /xrdp
parent1ef5c2412c07b108bcf5d2984d576578ffb83ef8 (diff)
parent5966de4ee2b8cf14a86b36f47b8015fc17f026ea (diff)
downloadxrdp-proprietary-a0cf6030df8364d4a5ab775a8e91ccfeb0ef4209.tar.gz
xrdp-proprietary-a0cf6030df8364d4a5ab775a8e91ccfeb0ef4209.zip
Merge branch 'devel' of https://github.com/neutrinolabs/xrdp into surface_cmds
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp_encoder.c25
-rw-r--r--xrdp/xrdp_wm.c80
2 files changed, 87 insertions, 18 deletions
diff --git a/xrdp/xrdp_encoder.c b/xrdp/xrdp_encoder.c
index 7f5ace1e..0af0b85e 100644
--- a/xrdp/xrdp_encoder.c
+++ b/xrdp/xrdp_encoder.c
@@ -42,8 +42,10 @@
/*****************************************************************************/
static int
process_enc_jpg(struct xrdp_encoder *self, XRDP_ENC_DATA *enc);
+#ifdef XRDP_RFXCODEC
static int
process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc);
+#endif
static int
process_enc_h264(struct xrdp_encoder *self, XRDP_ENC_DATA *enc);
@@ -82,6 +84,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
(32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8;
self->process_enc = process_enc_jpg;
}
+#ifdef XRDP_RFXCODEC
else if (client_info->rfx_codec_id != 0)
{
LLOGLN(0, ("xrdp_encoder_create: starting rfx codec session"));
@@ -89,13 +92,11 @@ xrdp_encoder_create(struct xrdp_mm *mm)
self->in_codec_mode = 1;
client_info->capture_code = 2;
self->process_enc = process_enc_rfx;
-#ifdef XRDP_RFXCODEC
- self->codec_handle =
- rfxcodec_encode_create(mm->wm->screen->width,
- mm->wm->screen->height,
- RFX_FORMAT_YUV, 0);
-#endif
+ self->codec_handle = rfxcodec_encode_create(mm->wm->screen->width,
+ mm->wm->screen->height,
+ RFX_FORMAT_YUV, 0);
}
+#endif
else if (client_info->h264_codec_id != 0)
{
LLOGLN(0, ("xrdp_encoder_create: starting h264 codec session"));
@@ -291,7 +292,6 @@ process_enc_jpg(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
}
#ifdef XRDP_RFXCODEC
-
/*****************************************************************************/
/* called from encoder thread */
static int
@@ -394,17 +394,6 @@ process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
return 0;
}
-
-#else
-
-/*****************************************************************************/
-/* called from encoder thread */
-static int
-process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
-{
- return 0;
-}
-
#endif
/*****************************************************************************/
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 4917c3aa..446939bc 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -1527,6 +1527,83 @@ xrdp_wm_key_sync(struct xrdp_wm *self, int device_flags, int key_flags)
/*****************************************************************************/
int APP_CC
+xrdp_wm_key_unicode(struct xrdp_wm *self, int device_flags, int unicode)
+{
+ int index;
+
+ for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
+ {
+ if (unicode == self->keymap.keys_noshift[index].chr)
+ {
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ return 0;
+ }
+ }
+
+ for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
+ {
+ if (unicode == self->keymap.keys_shift[index].chr)
+ {
+ if (device_flags & KBD_FLAG_UP)
+ {
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT);
+ }
+ else
+ {
+ xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT);
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ }
+ return 0;
+ }
+ }
+
+ for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
+ {
+ if (unicode == self->keymap.keys_altgr[index].chr)
+ {
+ if (device_flags & KBD_FLAG_UP)
+ {
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT,
+ XR_RDP_SCAN_ALT);
+ }
+ else
+ {
+ xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT,
+ XR_RDP_SCAN_ALT);
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ }
+ return 0;
+ }
+ }
+
+ for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++)
+ {
+ if (unicode == self->keymap.keys_shiftaltgr[index].chr)
+ {
+ if (device_flags & KBD_FLAG_UP)
+ {
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, XR_RDP_SCAN_ALT);
+ xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT);
+ }
+ else
+ {
+ xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT);
+ xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT,
+ XR_RDP_SCAN_ALT);
+ xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE);
+ }
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
+/*****************************************************************************/
+int APP_CC
xrdp_wm_pu(struct xrdp_wm *self, struct xrdp_bitmap *control)
{
int x;
@@ -1721,6 +1798,9 @@ callback(long id, int msg, long param1, long param2, long param3, long param4)
case 4: /* RDP_INPUT_SCANCODE */
rv = xrdp_wm_key(wm, param3, param1);
break;
+ case 5: /* RDP_INPUT_UNICODE */
+ rv = xrdp_wm_key_unicode(wm, param3, param1);
+ break;
case 0x8001: /* RDP_INPUT_MOUSE */
rv = xrdp_wm_process_input_mouse(wm, param3, param1, param2);
break;