WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix pointer encoding in vncfb (middle and

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix pointer encoding in vncfb (middle and right button were swapped).
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Dec 2006 09:14:04 -0800
Delivery-date: Sat, 16 Dec 2006 09:33:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1166203851 0
# Node ID 96b047d22ad5866d66508e64aac22b99b3a5dcd2
# Parent  1b6354023e64af6d02909ac81dfe4b5f4e930dda
Fix pointer encoding in vncfb (middle and right button were swapped).

Signed-off-by: Markus Armbruster <armbru@xxxxxxxxxx>
---
 tools/xenfb/vncfb.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -r 1b6354023e64 -r 96b047d22ad5 tools/xenfb/vncfb.c
--- a/tools/xenfb/vncfb.c       Fri Dec 15 17:29:25 2006 +0000
+++ b/tools/xenfb/vncfb.c       Fri Dec 15 17:30:51 2006 +0000
@@ -148,6 +148,10 @@ static int xk2linux[0x10000] = {
        [XK_plus] = KEY_EQUAL,
 };
 
+static int btnmap[] = {
+       BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_FORWARD, BTN_BACK
+};
+
 static void on_kbd_event(rfbBool down, rfbKeySym keycode, rfbClientPtr cl)
 {
        /*
@@ -184,8 +188,11 @@ static void on_ptr_event(int buttonMask,
                down = buttonMask & (1 << i);
                if (down == last_down)
                        continue;
-               /* FIXME this assumes buttons are numbered the same; verify 
they are */
-               if (xenfb_send_key(xenfb, down != 0, BTN_MOUSE + i) < 0)
+               if (i >= sizeof(btnmap) / sizeof(*btnmap))
+                       break;
+               if (btnmap[i] == 0)
+                       break;
+               if (xenfb_send_key(xenfb, down != 0, btnmap[i]) < 0)
                        fprintf(stderr, "Button %d %s lost (%s)\n",
                                i, down ? "down" : "up", strerror(errno));
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix pointer encoding in vncfb (middle and right button were swapped)., Xen patchbot-unstable <=