forked from pool/xorg-x11-server
Accepting request 186594 from home:tobijk:X11:XOrg
remove the unused "ancient" Xvnc third attempt OBS-URL: https://build.opensuse.org/request/show/186594 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=454
This commit is contained in:
parent
c0f13a7c8c
commit
27d184c295
@ -1,27 +0,0 @@
|
||||
From: Mike Gorse <mgorse@suse.com>
|
||||
Date: Wed Apr 18 22:52:23 UTC 2012
|
||||
Subject: [PATCH] VNC: Add a missing prototype
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
---
|
||||
diff -ur xorg-server-1.12.1.orig/hw/vnc/rfbkeyb.c xorg-server-1.12.1/hw/vnc/rfbkeyb.c
|
||||
--- xorg-server-1.12.1.orig/hw/vnc/rfbkeyb.c 2012-04-18 17:38:08.302219053 -0500
|
||||
+++ xorg-server-1.12.1/hw/vnc/rfbkeyb.c 2012-04-18 16:44:12.873667473 -0500
|
||||
@@ -44,6 +44,7 @@
|
||||
#endif
|
||||
#else
|
||||
#include <dix.h>
|
||||
+#include <extinit.h>
|
||||
#include <mipointer.h>
|
||||
#endif
|
||||
#include "rfb.h"
|
||||
diff -ur xorg-server-1.12.1.orig/hw/vnc/rfbmouse.c xorg-server-1.12.1/hw/vnc/rfbmouse.c
|
||||
--- xorg-server-1.12.1.orig/hw/vnc/rfbmouse.c 2012-04-18 17:38:08.302219053 -0500
|
||||
+++ xorg-server-1.12.1/hw/vnc/rfbmouse.c 2012-04-18 16:43:28.843217928 -0500
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
#else
|
||||
#include <dix.h>
|
||||
+#include <extinit.h>
|
||||
#include <mipointer.h>
|
||||
#endif
|
||||
#include "rfb.h"
|
File diff suppressed because it is too large
Load Diff
@ -1,352 +0,0 @@
|
||||
From: Michal Srb <msrb@suse.cz>
|
||||
Date: Tue, 6 Sep 2011 13:08:25 +0200
|
||||
Subject: [PATCH 4/6] VNC: Don't let VNC access the framebuffer directly any more.
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
Git-commit: 3e0de1d95b3ffd3988016b2d3f40f577393ad046
|
||||
Signed-off: Egbert Eich <eich@suse.de>
|
||||
References: bnc #653915
|
||||
|
||||
It seems that accessing the framebuffer directly is not a good idea anymore.
|
||||
This patch will let the tight encoding read the screen data using GetImage. It
|
||||
may be little slower, but not dramatically - it already does few GetImage calls
|
||||
on every repaint now.
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
||||
---
|
||||
hw/vnc/tight.c | 69 ++++++++++++++++++++++++++++++---------------
|
||||
hw/vnc/vncext.c | 19 ++----------
|
||||
hw/xfree86/vnc/vncInit.c | 11 ++-----
|
||||
hw/xfree86/vnc/vncint.h | 2 -
|
||||
4 files changed, 53 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/hw/vnc/tight.c b/hw/vnc/tight.c
|
||||
index 5c54736..f27c73e 100644
|
||||
--- a/hw/vnc/tight.c
|
||||
+++ b/hw/vnc/tight.c
|
||||
@@ -109,15 +109,17 @@ static unsigned char *tightAfterBuf = NULL;
|
||||
|
||||
static int *prevRowBuf = NULL;
|
||||
|
||||
+static unsigned char* fakeFrameBuffer = NULL;
|
||||
+
|
||||
|
||||
/* Prototypes for static functions. */
|
||||
|
||||
-static void FindBestSolidArea (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
+static void FindBestSolidArea (rfbClientPtr cl, int x, int y, int w, int h,
|
||||
CARD32 colorValue, int *w_ptr, int *h_ptr);
|
||||
-static void ExtendSolidArea (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
+static void ExtendSolidArea (rfbClientPtr cl, int x, int y, int w, int h,
|
||||
CARD32 colorValue,
|
||||
int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);
|
||||
-static Bool CheckSolidTile (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
+static Bool CheckSolidTile (rfbClientPtr cl, int x, int y, int w, int h,
|
||||
CARD32 *colorPtr, Bool needSameColor);
|
||||
static Bool CheckSolidTile8 (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
CARD32 *colorPtr, Bool needSameColor);
|
||||
@@ -126,6 +128,7 @@ static Bool CheckSolidTile16 (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
static Bool CheckSolidTile32 (ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
CARD32 *colorPtr, Bool needSameColor);
|
||||
|
||||
+static Bool SendRectEncodingTight(rfbClientPtr cl, int x, int y, int w, int h);
|
||||
static Bool SendRectSimple (rfbClientPtr cl, int x, int y, int w, int h);
|
||||
static Bool SendSubrect (rfbClientPtr cl, int x, int y, int w, int h);
|
||||
static Bool SendTightHeader (rfbClientPtr cl, int x, int y, int w, int h);
|
||||
@@ -211,6 +214,25 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
VNCSCREENPTR(cl->pScreen);
|
||||
+
|
||||
+ /* Copy the rectangle to the fake buffer for CheckSolidTile functions. */
|
||||
+
|
||||
+ if(!fakeFrameBuffer) fakeFrameBuffer = malloc(pVNC->width * pVNC->height * cl->format.bitsPerPixel / 8);
|
||||
+ (*cl->translateFn)(cl->pScreen, cl->translateLookupTable,
|
||||
+ &pVNC->rfbServerFormat,
|
||||
+ &cl->format, fakeFrameBuffer + (y * pVNC->width * cl->format.bitsPerPixel / 8),
|
||||
+ pVNC->paddedWidthInBytes, pVNC->width, h, 0, y);
|
||||
+
|
||||
+ /* Call the inner part */
|
||||
+
|
||||
+ return SendRectEncodingTight(cl, x, y, w, h);
|
||||
+}
|
||||
+
|
||||
+static Bool
|
||||
+SendRectEncodingTight(rfbClientPtr cl,
|
||||
+ int x, int y, int w, int h)
|
||||
+{
|
||||
+ VNCSCREENPTR(cl->pScreen);
|
||||
int nMaxRows;
|
||||
CARD32 colorValue;
|
||||
int dx, dy, dw, dh;
|
||||
@@ -247,7 +269,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
|
||||
nMaxRows = maxRectSize / nMaxWidth;
|
||||
}
|
||||
-
|
||||
+
|
||||
/* Try to find large solid-color areas and send them separately. */
|
||||
|
||||
for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {
|
||||
@@ -269,11 +291,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w) ?
|
||||
MAX_SPLIT_TILE_SIZE : (x + w - dx);
|
||||
|
||||
- if (CheckSolidTile(cl->pScreen, dx, dy, dw, dh, &colorValue, FALSE)) {
|
||||
+ if (CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, FALSE)) {
|
||||
|
||||
/* Get dimensions of solid-color area. */
|
||||
|
||||
- FindBestSolidArea(cl->pScreen, dx, dy, w - (dx - x), h - (dy - y),
|
||||
+ FindBestSolidArea(cl, dx, dy, w - (dx - x), h - (dy - y),
|
||||
colorValue, &w_best, &h_best);
|
||||
|
||||
/* Make sure a solid rectangle is large enough
|
||||
@@ -286,7 +308,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
/* Try to extend solid rectangle to maximum size. */
|
||||
|
||||
x_best = dx; y_best = dy;
|
||||
- ExtendSolidArea(cl->pScreen, x, y, w, h, colorValue,
|
||||
+ ExtendSolidArea(cl, x, y, w, h, colorValue,
|
||||
&x_best, &y_best, &w_best, &h_best);
|
||||
|
||||
/* Send rectangles at top and left to solid-color area. */
|
||||
@@ -295,7 +317,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
!SendRectSimple(cl, x, y, w, y_best-y) )
|
||||
return FALSE;
|
||||
if ( x_best != x &&
|
||||
- !rfbSendRectEncodingTight(cl, x, y_best,
|
||||
+ !SendRectEncodingTight(cl, x, y_best,
|
||||
x_best-x, h_best) )
|
||||
return FALSE;
|
||||
|
||||
@@ -316,11 +338,11 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
/* Send remaining rectangles (at right and bottom). */
|
||||
|
||||
if ( x_best + w_best != x + w &&
|
||||
- !rfbSendRectEncodingTight(cl, x_best+w_best, y_best,
|
||||
+ !SendRectEncodingTight(cl, x_best+w_best, y_best,
|
||||
w-(x_best-x)-w_best, h_best) )
|
||||
return FALSE;
|
||||
if ( y_best + h_best != y + h &&
|
||||
- !rfbSendRectEncodingTight(cl, x, y_best+h_best,
|
||||
+ !SendRectEncodingTight(cl, x, y_best+h_best,
|
||||
w, h-(y_best-y)-h_best) )
|
||||
return FALSE;
|
||||
|
||||
@@ -339,7 +361,7 @@ rfbSendRectEncodingTight(rfbClientPtr cl,
|
||||
}
|
||||
|
||||
static void
|
||||
-FindBestSolidArea(ScreenPtr pScreen,
|
||||
+FindBestSolidArea(rfbClientPtr cl,
|
||||
int x, int y, int w, int h,
|
||||
CARD32 colorValue,
|
||||
int *w_ptr, int *h_ptr)
|
||||
@@ -357,13 +379,13 @@ FindBestSolidArea(ScreenPtr pScreen,
|
||||
dw = (w_prev > MAX_SPLIT_TILE_SIZE) ?
|
||||
MAX_SPLIT_TILE_SIZE : w_prev;
|
||||
|
||||
- if (!CheckSolidTile(pScreen, x, dy, dw, dh, &colorValue, TRUE))
|
||||
+ if (!CheckSolidTile(cl, x, dy, dw, dh, &colorValue, TRUE))
|
||||
break;
|
||||
|
||||
for (dx = x + dw; dx < x + w_prev;) {
|
||||
dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w_prev) ?
|
||||
MAX_SPLIT_TILE_SIZE : (x + w_prev - dx);
|
||||
- if (!CheckSolidTile(pScreen, dx, dy, dw, dh, &colorValue, TRUE))
|
||||
+ if (!CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, TRUE))
|
||||
break;
|
||||
dx += dw;
|
||||
}
|
||||
@@ -380,7 +402,7 @@ FindBestSolidArea(ScreenPtr pScreen,
|
||||
}
|
||||
|
||||
static void
|
||||
-ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
+ExtendSolidArea(rfbClientPtr cl, int x, int y, int w, int h,
|
||||
CARD32 colorValue,
|
||||
int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr)
|
||||
{
|
||||
@@ -388,7 +410,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
|
||||
/* Try to extend the area upwards. */
|
||||
for ( cy = *y_ptr - 1;
|
||||
- cy >= y && CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
|
||||
+ cy >= y && CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
|
||||
cy-- );
|
||||
*h_ptr += *y_ptr - (cy + 1);
|
||||
*y_ptr = cy + 1;
|
||||
@@ -396,13 +418,13 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
/* ... downwards. */
|
||||
for ( cy = *y_ptr + *h_ptr;
|
||||
cy < y + h &&
|
||||
- CheckSolidTile(pScreen, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
|
||||
+ CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
|
||||
cy++ );
|
||||
*h_ptr += cy - (*y_ptr + *h_ptr);
|
||||
|
||||
/* ... to the left. */
|
||||
for ( cx = *x_ptr - 1;
|
||||
- cx >= x && CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
|
||||
+ cx >= x && CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
|
||||
cx-- );
|
||||
*w_ptr += *x_ptr - (cx + 1);
|
||||
*x_ptr = cx + 1;
|
||||
@@ -410,7 +432,7 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
/* ... to the right. */
|
||||
for ( cx = *x_ptr + *w_ptr;
|
||||
cx < x + w &&
|
||||
- CheckSolidTile(pScreen, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
|
||||
+ CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
|
||||
cx++ );
|
||||
*w_ptr += cx - (*x_ptr + *w_ptr);
|
||||
}
|
||||
@@ -423,11 +445,12 @@ ExtendSolidArea(ScreenPtr pScreen, int x, int y, int w, int h,
|
||||
*/
|
||||
|
||||
static Bool
|
||||
-CheckSolidTile(ScreenPtr pScreen, int x, int y, int w, int h, CARD32 *colorPtr,
|
||||
+CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32 *colorPtr,
|
||||
Bool needSameColor)
|
||||
{
|
||||
- VNCSCREENPTR(pScreen);
|
||||
- switch(pVNC->rfbServerFormat.bitsPerPixel) {
|
||||
+ ScreenPtr pScreen = cl->pScreen;
|
||||
+
|
||||
+ switch(cl->format.bitsPerPixel) {
|
||||
case 32:
|
||||
return CheckSolidTile32(pScreen, x, y, w, h, colorPtr, needSameColor);
|
||||
case 16:
|
||||
@@ -449,7 +472,7 @@ static Bool \
|
||||
int dx, dy; \
|
||||
\
|
||||
fbptr = (CARD##bpp *) \
|
||||
- &pVNC->pfbMemory[y * pVNC->paddedWidthInBytes + x * (bpp/8)]; \
|
||||
+ &fakeFrameBuffer[(y * pVNC->width + x) * (bpp/8)]; \
|
||||
\
|
||||
colorValue = *fbptr; \
|
||||
if (needSameColor && (CARD32)colorValue != *colorPtr) \
|
||||
@@ -460,7 +483,7 @@ static Bool \
|
||||
if (colorValue != fbptr[dx]) \
|
||||
return FALSE; \
|
||||
} \
|
||||
- fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->paddedWidthInBytes); \
|
||||
+ fbptr = (CARD##bpp *)((CARD8 *)fbptr + pVNC->width * (bpp/8)); \
|
||||
} \
|
||||
\
|
||||
*colorPtr = (CARD32)colorValue; \
|
||||
diff --git a/hw/vnc/vncext.c b/hw/vnc/vncext.c
|
||||
index ea913b7..534f3f5 100644
|
||||
--- a/hw/vnc/vncext.c
|
||||
+++ b/hw/vnc/vncext.c
|
||||
@@ -702,15 +702,7 @@ CreateResourceTypes(void)
|
||||
|
||||
static unsigned long vncExtGeneration = 0;
|
||||
#if XFREE86VNC
|
||||
-extern Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart);
|
||||
-
|
||||
-/* copied from miscrinit.c */
|
||||
-typedef struct
|
||||
-{
|
||||
- pointer pbits; /* pointer to framebuffer */
|
||||
- int width; /* delta to add to a framebuffer addr to move one row down */
|
||||
-} miScreenInitParmsRec, *miScreenInitParmsPtr;
|
||||
-
|
||||
+extern Bool VNCInit(ScreenPtr pScreen);
|
||||
|
||||
static Bool
|
||||
vncCreateScreenResources(ScreenPtr pScreen)
|
||||
@@ -719,9 +711,6 @@ vncCreateScreenResources(ScreenPtr pScreen)
|
||||
CreateScreenResourcesProcPtr CreateScreenResources =
|
||||
(CreateScreenResourcesProcPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey);
|
||||
- miScreenInitParmsPtr pScrInitParms;
|
||||
-
|
||||
- pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
|
||||
|
||||
if ( pScreen->CreateScreenResources != vncCreateScreenResources ) {
|
||||
/* Can't find hook we are hung on */
|
||||
@@ -732,9 +721,6 @@ vncCreateScreenResources(ScreenPtr pScreen)
|
||||
(void *) pScreen->CreateScreenResources );
|
||||
}
|
||||
|
||||
- /* Now do our stuff */
|
||||
- VNCInit(pScreen, pScrInitParms->pbits);
|
||||
-
|
||||
/* Unhook this function ... */
|
||||
pScreen->CreateScreenResources = CreateScreenResources;
|
||||
dixSetPrivate(&pScreen->devPrivates, vncCreateScreenResourcesKey, NULL);
|
||||
@@ -744,6 +730,9 @@ vncCreateScreenResources(ScreenPtr pScreen)
|
||||
ret = (*pScreen->CreateScreenResources)(pScreen);
|
||||
}
|
||||
|
||||
+ /* Now do our stuff */
|
||||
+ VNCInit(pScreen);
|
||||
+
|
||||
#ifdef DEBUG
|
||||
ErrorF("vncCreateScreenResources() returns %d\n", ret);
|
||||
#endif
|
||||
diff --git a/hw/xfree86/vnc/vncInit.c b/hw/xfree86/vnc/vncInit.c
|
||||
index 4a124fb..8b2fa5f 100644
|
||||
--- a/hw/xfree86/vnc/vncInit.c
|
||||
+++ b/hw/xfree86/vnc/vncInit.c
|
||||
@@ -49,7 +49,7 @@ extern void VncExtensionInit(void);
|
||||
|
||||
extern void vncInitMouse(void);
|
||||
extern void vncInitKeyb(void);
|
||||
-Bool VNCInit(ScreenPtr pScreen, unsigned char *FBStart);
|
||||
+Bool VNCInit(ScreenPtr pScreen);
|
||||
|
||||
#ifndef XFree86LOADER
|
||||
static unsigned long VNCGeneration = 0;
|
||||
@@ -151,7 +151,7 @@ void rfbLogPerror(char *str)
|
||||
* Called by vncCreateScreenResources()
|
||||
*/
|
||||
Bool
|
||||
-VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
|
||||
+VNCInit(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
VisualPtr visual;
|
||||
@@ -164,9 +164,6 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
|
||||
PictureScreenPtr ps;
|
||||
#endif
|
||||
|
||||
- if (!FBStart)
|
||||
- return FALSE;
|
||||
-
|
||||
#ifndef XFree86LOADER
|
||||
if (VNCGeneration != serverGeneration) {
|
||||
VncExtensionInit();
|
||||
@@ -287,9 +284,7 @@ VNCInit(ScreenPtr pScreen, unsigned char *FBStart)
|
||||
pScreenPriv->depth = pScrn->depth;
|
||||
pScreenPriv->paddedWidthInBytes = PixmapBytePad(pScrn->displayWidth, pScrn->depth);
|
||||
pScreenPriv->bitsPerPixel = rfbBitsPerPixel(pScrn->depth);
|
||||
- pScreenPriv->pfbMemory = FBStart;
|
||||
- pScreenPriv->oldpfbMemory = FBStart;
|
||||
-
|
||||
+
|
||||
pScreenPriv->cursorIsDrawn = TRUE;
|
||||
pScreenPriv->dontSendFramebufferUpdate = FALSE;
|
||||
|
||||
diff --git a/hw/xfree86/vnc/vncint.h b/hw/xfree86/vnc/vncint.h
|
||||
index 18a3630..9e4a36f 100644
|
||||
--- a/hw/xfree86/vnc/vncint.h
|
||||
+++ b/hw/xfree86/vnc/vncint.h
|
||||
@@ -44,13 +44,11 @@ typedef struct {
|
||||
size_t buf_filled;
|
||||
int maxFd;
|
||||
fd_set allFds;
|
||||
- unsigned char * oldpfbMemory;
|
||||
Bool rfbAlwaysShared;
|
||||
Bool rfbNeverShared;
|
||||
Bool rfbDontDisconnect;
|
||||
Bool rfbUserAccept;
|
||||
Bool rfbViewOnly;
|
||||
- unsigned char * pfbMemory;
|
||||
int paddedWidthInBytes;
|
||||
ColormapPtr rfbInstalledColormap;
|
||||
ColormapPtr savedColormap;
|
||||
--
|
||||
1.7.3.4
|
||||
|
@ -1,467 +0,0 @@
|
||||
From: Matthias Hopf <mhopf@suse.de>
|
||||
Date: Tue, 6 Sep 2011 08:35:57 +0200
|
||||
Subject: [PATCH 5/6] VNC: Enable use of all keyboard layouts, independent of remotely set layout
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
Git-commit: 6885b927a6065e6379cfaa3ebbf6c51445a015d9
|
||||
Signed-off: Egbert Eich <eich@suse.de>
|
||||
References: bnc #400520, #605015, #660797
|
||||
|
||||
Changes:
|
||||
|
||||
- Use virtual core keyboard for events and key state lookup:
|
||||
Make layout changes work again - see discussion on
|
||||
https://defect.opensolaris.org/bz/show_bug.cgi?id=8687
|
||||
- keycode lookup:
|
||||
Don't use any static keyboard layout any more.
|
||||
- ISO-Level3-Shift handling:
|
||||
Enable the use of keyboard layouts that use AltGr for 3rd and 4th level.
|
||||
- Make keyboard handling more XKB aware:
|
||||
Previous code was e.g. not multi-group aware.
|
||||
- Nuke use of legacy keymap as far as possible:
|
||||
Creating legacy keymap takes time, and it has to be freed again afterwards.
|
||||
- Free index lookup:
|
||||
Make XKB aware.
|
||||
- Ignore calls for NoSymbol:
|
||||
This destroys otherwise valid entries.
|
||||
- Fix analysis for shift/level3 event faking:
|
||||
Previous broken version lead to e.g. Shift+PgUp not being recognized.
|
||||
- Add tons of debug output (disabled).
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
||||
|
||||
Rebased to 1.12.1 by Mike Gorse <mgorse@suse.com>
|
||||
---
|
||||
diff -pruN xorg-server-1.12.1.orig/hw/vnc/kbdptr.c xorg-server-1.12.1/hw/vnc/kbdptr.c
|
||||
--- xorg-server-1.12.1.orig/hw/vnc/kbdptr.c 2012-04-18 14:14:07.436250934 -0500
|
||||
+++ xorg-server-1.12.1/hw/vnc/kbdptr.c 2012-04-18 14:15:27.656248047 -0500
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "X11/Xproto.h"
|
||||
#include "inputstr.h"
|
||||
#include "inpututils.h"
|
||||
+#include "xkbsrv.h"
|
||||
+#include "xkbstr.h"
|
||||
#define XK_CYRILLIC
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xatom.h>
|
||||
@@ -46,6 +48,7 @@
|
||||
#include "dmxinput.h"
|
||||
#endif
|
||||
|
||||
+#if 0
|
||||
#if !XFREE86VNC
|
||||
|
||||
#define MIN_KEY_CODE 8
|
||||
@@ -196,21 +199,20 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_
|
||||
#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY))
|
||||
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define KEY_IS_PRESSED(keycode) \
|
||||
- (kbdDevice->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
|
||||
+ (inputInfo.keyboard->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
|
||||
|
||||
static void vncXConvertCase(KeySym sym, KeySym *lower, KeySym *upper);
|
||||
|
||||
-static DeviceIntPtr ptrDevice = NULL, kbdDevice = NULL;
|
||||
+static DeviceIntPtr ptrDevice = NULL;
|
||||
|
||||
|
||||
void
|
||||
vncSetKeyboardDevice(DeviceIntPtr kbd)
|
||||
{
|
||||
- if (kbdDevice && kbd)
|
||||
- return; /* set once */
|
||||
- kbdDevice = kbd;
|
||||
+ // obsoleted by inputInfo
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +265,29 @@ EnqueueKey(DeviceIntPtr kbdDev, int type
|
||||
QueueKeyboardEvents(kbdDev, type, detail, NULL);
|
||||
}
|
||||
|
||||
+/* In-server and highly changed version of XkbKeycodeToKeysym */
|
||||
+static KeySym
|
||||
+_XkbKeycodeToKeysym(XkbDescPtr xkb, KeyCode kc, int group, int level)
|
||||
+{
|
||||
+ KeySym ks;
|
||||
+
|
||||
+ if ((kc<xkb->min_key_code)||(kc>xkb->max_key_code))
|
||||
+ return NoSymbol;
|
||||
+ /* Treat single group elements as present in all groups */
|
||||
+ if (XkbKeyNumGroups (xkb,kc) == 1)
|
||||
+ group = 0;
|
||||
+ if ((group<0)||(level<0)||(group>=XkbKeyNumGroups(xkb,kc)))
|
||||
+ return NoSymbol;
|
||||
+ if (level < XkbKeyGroupWidth(xkb, kc, group))
|
||||
+ ks = XkbKeySymEntry(xkb, kc, level, group);
|
||||
+ else
|
||||
+ ks = NoSymbol;
|
||||
+ /* Treat 'K' as 'K K', */
|
||||
+ if (ks == NoSymbol && (level & 1) && level-1 < XkbKeyGroupWidth(xkb, kc, group))
|
||||
+ ks = XkbKeySymEntry(xkb, kc, level-1, group);
|
||||
+ return ks;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Called when the rfbserver receives a rfbKeyEvent event from a client.
|
||||
* Put an X keyboard event into the event queue.
|
||||
@@ -271,21 +296,35 @@ void
|
||||
KbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl)
|
||||
{
|
||||
const int type = down ? KeyPress : KeyRelease;
|
||||
- KeySymsPtr keySyms;
|
||||
- XkbStateRec *xkb;
|
||||
- int i;
|
||||
+ XkbSrvInfoPtr xkbInfo;
|
||||
+ int i, group, level;
|
||||
int keyCode = 0;
|
||||
- int freeIndex = -1;
|
||||
Bool fakeShiftPress = FALSE;
|
||||
Bool fakeShiftLRelease = FALSE;
|
||||
Bool fakeShiftRRelease = FALSE;
|
||||
Bool shiftMustBeReleased = FALSE;
|
||||
Bool shiftMustBePressed = FALSE;
|
||||
+ Bool fakeLevel3Press = FALSE;
|
||||
+ Bool fakeLevel3Release = FALSE;
|
||||
+ Bool level3MustBeReleased = FALSE;
|
||||
+ Bool level3MustBePressed = FALSE;
|
||||
+
|
||||
+ /* Incomplete maps may create NoSymbol - which lets us
|
||||
+ * select and/or overwrite otherwise valid entries.
|
||||
+ * E.g Level3+a in serbian layout creates NoSymbol on os11.4
|
||||
+ * 2011-05-24 mhopf@suse.de */
|
||||
+ if (keySym == NoSymbol) {
|
||||
+ ErrorF("KbdAddEvent: ignoring illegal NoSymbol\n");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- if (!kbdDevice)
|
||||
- return;
|
||||
-
|
||||
- keySyms = XkbGetCoreMap(kbdDevice);
|
||||
+ xkbInfo = inputInfo.keyboard->key->xkbInfo;
|
||||
+ group = xkbInfo->state.group;
|
||||
+ level = (KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE) ? 2 : 0) |
|
||||
+ (XkbStateFieldFromRec(&xkbInfo->state) & ShiftMask ? 1 : 0);
|
||||
+#ifdef DEBUG
|
||||
+ ErrorF ("VNCkbd:\t%s Sym %04x\n", down ? "+":"-", (int)keySym);
|
||||
+#endif
|
||||
|
||||
#ifdef CORBA
|
||||
if (cl) {
|
||||
@@ -303,6 +342,12 @@ KbdAddEvent(Bool down, KeySym keySym, rf
|
||||
*
|
||||
* Alan.
|
||||
*/
|
||||
+ /* Never use predefined keys.
|
||||
+ * This is inherently incapable of dealing with changing
|
||||
+ * keyboard layouts. Not being able to work with non-local xmodmaps
|
||||
+ * is a nuisance at worst, and probably even preferred.
|
||||
+ * 2011-04-15 mhopf@suse.de */
|
||||
+#ifdef NOTANYMORE
|
||||
#if !XFREE86VNC
|
||||
/* First check if it's one of our predefined keys. If so then we can make
|
||||
some attempt at allowing an xmodmap inside a VNC desktop behave
|
||||
@@ -329,107 +374,227 @@ KbdAddEvent(Bool down, KeySym keySym, rf
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
if (!keyCode) {
|
||||
|
||||
/* not one of our predefined keys - see if it's in the current keyboard
|
||||
mapping (i.e. we've already allocated an extra keycode for it) */
|
||||
|
||||
- if (keySyms->mapWidth < 2) {
|
||||
- ErrorF("KbdAddEvent: Sanity check failed - Keyboard mapping has "
|
||||
- "less than 2 keysyms per keycode (KeySym 0x%x)\n", (int)keySym);
|
||||
- return;
|
||||
- }
|
||||
+ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) {
|
||||
+ /* Check all keycodes, but only continue on those where
|
||||
+ * backconversion results in keySym.
|
||||
+ * 2011-05-20 mhopf@suse.de */
|
||||
+
|
||||
+#ifdef DEBUG
|
||||
+ int j;
|
||||
+ ErrorF (" keyCode %3d map# %4d++ level %d of %d: keySyms",
|
||||
+ keyCode, (i / keySyms->mapWidth) * keySyms->mapWidth,
|
||||
+ i % keySyms->mapWidth, keySyms->mapWidth);
|
||||
+ for (j = 0; j < keySyms->mapWidth; j++)
|
||||
+ ErrorF (" %02x", (int)keySyms->map[(i / keySyms->mapWidth) * keySyms->mapWidth + j]);
|
||||
+ ErrorF ("\n");
|
||||
+ ErrorF (" group %d of %d width %d: keySyms",
|
||||
+ group, XkbKeyNumGroups(xkbInfo->desc, keyCode),
|
||||
+ XkbKeyGroupWidth(xkbInfo->desc, keyCode, group));
|
||||
+ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) > group)
|
||||
+ for (j = 0; j < XkbKeyGroupWidth(xkbInfo->desc, keyCode, group); j++)
|
||||
+ ErrorF (" %02x", (int) XkbKeySymEntry(xkbInfo->desc, keyCode, j, group));
|
||||
+ ErrorF ("\n");
|
||||
+#endif
|
||||
|
||||
- for (i = 0; i < NO_OF_KEYS * keySyms->mapWidth; i++) {
|
||||
- if (keySym == keySyms->map[i]) {
|
||||
- keyCode = MIN_KEY_CODE + i / keySyms->mapWidth;
|
||||
-
|
||||
- if (keySyms->map[(i / keySyms->mapWidth)
|
||||
- * keySyms->mapWidth + 1] != NoSymbol) {
|
||||
-
|
||||
- /* this keycode has more than one symbol associated with
|
||||
- it, so shift state is important */
|
||||
-
|
||||
- if ((i % keySyms->mapWidth) == 0)
|
||||
- shiftMustBeReleased = TRUE;
|
||||
- else
|
||||
- shiftMustBePressed = TRUE;
|
||||
- }
|
||||
+ /* Check whether keySym is reachable in current group
|
||||
+ * by any shift/Level3_shift state (preferrable w/o change).
|
||||
+ * This doesn't do real modifyer analysis, only Shift and Level3_Shift.
|
||||
+ * 2011-05-23 mhopf@suse.de */
|
||||
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level) == keySym)
|
||||
+ break;
|
||||
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 2) == keySym) {
|
||||
+ if (level & 2)
|
||||
+ level3MustBeReleased = TRUE;
|
||||
+ else
|
||||
+ level3MustBePressed = TRUE;
|
||||
break;
|
||||
}
|
||||
- if ((freeIndex == -1) && (keySyms->map[i] == NoSymbol)
|
||||
- && (i % keySyms->mapWidth) == 0)
|
||||
- {
|
||||
- freeIndex = i;
|
||||
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 1) == keySym) {
|
||||
+ if (level & 1)
|
||||
+ shiftMustBeReleased = TRUE;
|
||||
+ else
|
||||
+ shiftMustBePressed = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (_XkbKeycodeToKeysym(xkbInfo->desc, keyCode, group, level ^ 3) == keySym) {
|
||||
+ if (level & 2)
|
||||
+ level3MustBeReleased = TRUE;
|
||||
+ else
|
||||
+ level3MustBePressed = TRUE;
|
||||
+ if (level & 1)
|
||||
+ shiftMustBeReleased = TRUE;
|
||||
+ else
|
||||
+ shiftMustBePressed = TRUE;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
+ if (keyCode == MIN_KEY_CODE + NO_OF_KEYS)
|
||||
+ keyCode = 0;
|
||||
}
|
||||
|
||||
if (!keyCode) {
|
||||
KeySym lower, upper;
|
||||
+ KeySymsPtr keySyms = XkbGetCoreMap(inputInfo.keyboard);
|
||||
|
||||
/* we don't have an existing keycode - make one up on the fly and add
|
||||
it to the keyboard mapping. Thanks to Vlad Harchev for pointing
|
||||
out problems with non-ascii capitalisation. */
|
||||
|
||||
- if (freeIndex == -1) {
|
||||
+ /* Find free index for current group. */
|
||||
+ for (keyCode = MIN_KEY_CODE; keyCode < MIN_KEY_CODE + NO_OF_KEYS; keyCode++) {
|
||||
+ /* A keyCode is free if no groups are assigned at all */
|
||||
+ if (XkbKeyNumGroups(xkbInfo->desc, keyCode) == 0)
|
||||
+ break;
|
||||
+#ifdef NOTANYMORE
|
||||
+ /* We can use exact map positions for group 1+2, but only partially
|
||||
+ * filling out xkb legacy maps may suddenly change the # of groups.
|
||||
+ * Reason for that is unknown yet. Might be related to (fixed) NoSymbol issue.
|
||||
+ * 2011-05-24 mhopf@suse.de */
|
||||
+ /* For primary groups: A keyCode is free if current group is empty */
|
||||
+ if (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 1 && group < 2)
|
||||
+ break;
|
||||
+ /* Never touch groups that have a single level only (weird group?!?) */
|
||||
+ if (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 2)
|
||||
+ continue;
|
||||
+ /* For primary groups: A keyCode is free if only NoSymbol is assigned
|
||||
+ * to available levels (only validating levels 0-3) */
|
||||
+ if (group < 2 &&
|
||||
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 0, group) == NoSymbol &&
|
||||
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 1, group) == NoSymbol &&
|
||||
+ (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 3 ||
|
||||
+ (XkbKeySymEntry(xkbInfo->desc, keyCode, 2, group) == NoSymbol &&
|
||||
+ (XkbKeyGroupWidth(xkbInfo->desc, keyCode, group) < 4 ||
|
||||
+ XkbKeySymEntry(xkbInfo->desc, keyCode, 3, group) == NoSymbol))))
|
||||
+ break;
|
||||
+#endif
|
||||
+ }
|
||||
+
|
||||
+ if (keyCode == MIN_KEY_CODE + NO_OF_KEYS) {
|
||||
ErrorF("KbdAddEvent: ignoring KeySym 0x%x - no free KeyCodes\n",
|
||||
(int)keySym);
|
||||
+ free (keySyms->map);
|
||||
+ free (keySyms);
|
||||
return;
|
||||
}
|
||||
|
||||
- keyCode = MIN_KEY_CODE + freeIndex / keySyms->mapWidth;
|
||||
-
|
||||
vncXConvertCase(keySym, &lower, &upper);
|
||||
|
||||
- if (lower == upper) {
|
||||
- keySyms->map[freeIndex] = keySym;
|
||||
-
|
||||
- } else {
|
||||
- keySyms->map[freeIndex] = lower;
|
||||
- keySyms->map[freeIndex+1] = upper;
|
||||
-
|
||||
+ /* Adding keys is not using xkb mechanisms yet, but relying on support
|
||||
+ * for changing keys in the legacy map. Should be changed, eventually.
|
||||
+ * 2011-05-19 mhopf@suse.de */
|
||||
+#ifdef NOTANYMORE
|
||||
+ if (group < 2) {
|
||||
+ /* Only set mapping for active group. Will only work with dual layouts.
|
||||
+ * 2011-05-23 mhopf@suse.de */
|
||||
+ int active_group_offset = group ? 2 : 0;
|
||||
+
|
||||
+ if (lower == upper) {
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset] = keySym;
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset + 1] = NoSymbol;
|
||||
+ } else {
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset] = lower;
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + active_group_offset + 1] = upper;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+ /* Generic layouts needs to set the full map width.
|
||||
+ * Weird enough, mapWidth seems too big...
|
||||
+ * 2011-05-23 mhopf@suse.de */
|
||||
+ for (i = 0; i < (keySyms->mapWidth & ~1); i += 2) {
|
||||
+ if (lower == upper) {
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i] = keySym;
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i + 1] = NoSymbol;
|
||||
+ } else {
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i] = lower;
|
||||
+ keySyms->map[(keyCode - MIN_KEY_CODE) * keySyms->mapWidth + i + 1] = upper;
|
||||
+ }
|
||||
+ }
|
||||
+ if (lower != upper) {
|
||||
if (keySym == lower)
|
||||
shiftMustBeReleased = TRUE;
|
||||
else
|
||||
shiftMustBePressed = TRUE;
|
||||
}
|
||||
+ level3MustBeReleased = TRUE;
|
||||
|
||||
- XkbApplyMappingChange(kbdDevice, keySyms, keyCode, 1, NULL, serverClient);
|
||||
+ XkbApplyMappingChange(inputInfo.keyboard, keySyms, keyCode, 1, NULL, serverClient);
|
||||
|
||||
ErrorF("KbdAddEvent: unknown KeySym 0x%x - allocating KeyCode %d\n",
|
||||
(int)keySym, keyCode);
|
||||
+ free (keySyms->map);
|
||||
+ free (keySyms);
|
||||
}
|
||||
|
||||
- xkb = &kbdDevice->key->xkbInfo->state;
|
||||
+#ifdef DEBUG
|
||||
+ ErrorF ("\t%s Sym %04x Code%3d\tState x%02x %s%s%s\tSh %s%s\tL3 %s%s\n",
|
||||
+ down ? "+":"-", (int)keySym, keyCode, XkbStateFieldFromRec(&xkbInfo->state),
|
||||
+ KEY_IS_PRESSED(SHIFT_L_KEY_CODE) ? "Sl":"",
|
||||
+ KEY_IS_PRESSED(SHIFT_R_KEY_CODE) ? "Sr":"",
|
||||
+ KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE) ? "L3":"",
|
||||
+ shiftMustBePressed ? "+":"", shiftMustBeReleased ? "-":"",
|
||||
+ level3MustBePressed ? "+":"", level3MustBeReleased ? "-":"");
|
||||
+#endif
|
||||
+#ifdef NOTANYMORE
|
||||
+ int back = _XkbKeycodeToKeysym (xkbInfo->desc, keyCode, group,
|
||||
+ ((level3MustBePressed || (!level3MustBeReleased && (level & 2))) ? 2 : 0) |
|
||||
+ ((shiftMustBePressed || (!shiftMustBeReleased && (level & 1))) ? 1 : 0));
|
||||
+ ErrorF ("\tvalidate code %d %-2s%-2s -> sym %04x %s\n\n", keyCode,
|
||||
+ (shiftMustBePressed || (!shiftMustBeReleased && (level & 1))) ? "Sh" : "",
|
||||
+ (level3MustBePressed || (!level3MustBeReleased && (level & 2))) ? "L3" : "",
|
||||
+ back, (back == keySym ? "ok" : "FAILED"));
|
||||
+#endif
|
||||
+
|
||||
if (down) {
|
||||
- if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) {
|
||||
+ /* TODO: would require to check which keycodes are actually
|
||||
+ * bound to ISO_Level3_Shift and/or Shift_L.
|
||||
+ * 2011-04-18 mhopf@suse.de */
|
||||
+ if (level3MustBePressed && !(level & 2)) {
|
||||
+ fakeLevel3Press = TRUE;
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
|
||||
+ }
|
||||
+ if (level3MustBeReleased && (level & 2)) {
|
||||
+ fakeLevel3Release = TRUE;
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
|
||||
+ }
|
||||
+ if (shiftMustBePressed && !(level & 1)) {
|
||||
fakeShiftPress = TRUE;
|
||||
- EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
|
||||
}
|
||||
- if (shiftMustBeReleased && (XkbStateFieldFromRec(xkb) & ShiftMask)) {
|
||||
+ if (shiftMustBeReleased && (level & 1)) {
|
||||
if (KEY_IS_PRESSED(SHIFT_L_KEY_CODE)) {
|
||||
fakeShiftLRelease = TRUE;
|
||||
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
|
||||
}
|
||||
if (KEY_IS_PRESSED(SHIFT_R_KEY_CODE)) {
|
||||
fakeShiftRRelease = TRUE;
|
||||
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_R_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_R_KEY_CODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- EnqueueKey(kbdDevice, type, keyCode);
|
||||
+ EnqueueKey(inputInfo.keyboard, type, keyCode);
|
||||
|
||||
if (fakeShiftPress) {
|
||||
- EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
|
||||
}
|
||||
if (fakeShiftLRelease) {
|
||||
- EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
|
||||
}
|
||||
if (fakeShiftRRelease) {
|
||||
- EnqueueKey(kbdDevice, KeyPress, SHIFT_R_KEY_CODE);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_R_KEY_CODE);
|
||||
+ }
|
||||
+ if (fakeLevel3Press) {
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
|
||||
+ }
|
||||
+ if (fakeLevel3Release) {
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,15 +645,15 @@ KbdReleaseAllKeys(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
- if (!kbdDevice)
|
||||
+ if (!inputInfo.keyboard)
|
||||
return;
|
||||
|
||||
for (i = 0; i < DOWN_LENGTH; i++) {
|
||||
- if (kbdDevice->key->down[i] != 0) {
|
||||
+ if (inputInfo.keyboard->key->down[i] != 0) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
- if (kbdDevice->key->down[i] & (1 << j)) {
|
||||
+ if (inputInfo.keyboard->key->down[i] & (1 << j)) {
|
||||
int detail = (i << 3) | j;
|
||||
- EnqueueKey(kbdDevice, KeyRelease, detail);
|
||||
+ EnqueueKey(inputInfo.keyboard, KeyRelease, detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -pruN xorg-server-1.12.1.orig/hw/vnc/keyboard.h xorg-server-1.12.1/hw/vnc/keyboard.h
|
||||
--- xorg-server-1.12.1.orig/hw/vnc/keyboard.h 2012-04-18 14:14:07.437250922 -0500
|
||||
+++ xorg-server-1.12.1/hw/vnc/keyboard.h 2012-04-18 14:15:27.657248035 -0500
|
||||
@@ -32,3 +32,4 @@
|
||||
#define META_R_KEY_CODE (MIN_KEY_CODE + 108)
|
||||
#define ALT_L_KEY_CODE (MIN_KEY_CODE + 56)
|
||||
#define ALT_R_KEY_CODE (MIN_KEY_CODE + 105)
|
||||
+#define ISO_LEVEL3_KEY_CODE ALT_R_KEY_CODE
|
@ -1,125 +0,0 @@
|
||||
From: Egbert Eich <eich@freedesktop.org>
|
||||
Date: Tue, 6 Sep 2011 14:58:28 +0200
|
||||
Subject: [PATCH 6/6] VNC: Fix crash due to unset input device names.
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
Git-commit: b756a7efff37021ca503fe1e63084daae4082e9d
|
||||
Signed-off: Egbert Eich <eich@suse.de>
|
||||
References: bnc #716074
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
||||
|
||||
---
|
||||
hw/vnc/init.c | 2 +-
|
||||
hw/vnc/rfb.h | 2 +-
|
||||
hw/vnc/rfbkeyb.c | 7 +++++--
|
||||
hw/vnc/rfbmouse.c | 9 +++++++--
|
||||
4 files changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/hw/vnc/init.c b/hw/vnc/init.c
|
||||
index 0977fee..6f83aa8 100644
|
||||
--- a/hw/vnc/init.c
|
||||
+++ b/hw/vnc/init.c
|
||||
@@ -816,7 +816,7 @@ rfbMouseProc(DeviceIntPtr pDevice, int onoff)
|
||||
switch (onoff)
|
||||
{
|
||||
case DEVICE_INIT:
|
||||
- PtrDeviceInit();
|
||||
+ PtrDeviceInit(pDevice, "vncMouse");
|
||||
map[1] = 1;
|
||||
map[2] = 2;
|
||||
map[3] = 3;
|
||||
diff --git a/hw/vnc/rfb.h b/hw/vnc/rfb.h
|
||||
index 70b1a45..aa9abab 100644
|
||||
--- a/hw/vnc/rfb.h
|
||||
+++ b/hw/vnc/rfb.h
|
||||
@@ -578,7 +578,7 @@ extern void rfbGotXCutText(char *str, int len);
|
||||
extern Bool compatibleKbd;
|
||||
extern unsigned char ptrAcceleration;
|
||||
|
||||
-extern void PtrDeviceInit(void);
|
||||
+extern void PtrDeviceInit(DeviceIntPtr pDevice, char *name);
|
||||
extern void PtrDeviceOn(DeviceIntPtr pDev);
|
||||
extern void PtrDeviceOff(void);
|
||||
extern void PtrDeviceControl(DeviceIntPtr dev, PtrCtrl *ctrl);
|
||||
diff --git a/hw/vnc/rfbkeyb.c b/hw/vnc/rfbkeyb.c
|
||||
index 4da29c2..6d97999 100644
|
||||
--- a/hw/vnc/rfbkeyb.c
|
||||
+++ b/hw/vnc/rfbkeyb.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#endif
|
||||
#include <xf86Xinput.h>
|
||||
#include <exevents.h> /* Needed for InitValuator/Proximity stuff */
|
||||
+#include <extinit.h>
|
||||
#include <mipointer.h>
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
@@ -49,7 +50,6 @@
|
||||
|
||||
|
||||
extern void rfbSendBell(void);
|
||||
-extern DeviceIntPtr kbdDevice;
|
||||
extern void vncInitKeyb(void);
|
||||
|
||||
#include <X11/keysym.h>
|
||||
@@ -212,11 +212,15 @@ static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = {
|
||||
};
|
||||
|
||||
#define N_PREDEFINED_KEYS (sizeof(map) / (sizeof(KeySym) * GLYPHS_PER_KEY))
|
||||
+#define RFB_KEYB "rfbKeyb"
|
||||
|
||||
void
|
||||
KbdDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||
{
|
||||
int i;
|
||||
+ Atom atom = MakeAtom(RFB_KEYB, strlen(RFB_KEYB), TRUE);
|
||||
+
|
||||
+ AssignTypeAndName(pDevice, atom, RFB_KEYB);
|
||||
|
||||
for (i = 0; i < MAP_LENGTH; i++)
|
||||
pModMap[i] = NoSymbol;
|
||||
@@ -359,7 +363,6 @@ xf86rfbKeybInit(struct _InputDriverRec *drv,
|
||||
pInfo->control_proc = NULL;
|
||||
pInfo->switch_mode = NULL;
|
||||
pInfo->fd = -1;
|
||||
- pInfo->dev = NULL;
|
||||
|
||||
/* Collect the options, and process the common options. */
|
||||
xf86CollectInputOptions(pInfo, (const char**)drv->default_options);
|
||||
diff --git a/hw/vnc/rfbmouse.c b/hw/vnc/rfbmouse.c
|
||||
index 4657128..86e8f2f 100644
|
||||
--- a/hw/vnc/rfbmouse.c
|
||||
+++ b/hw/vnc/rfbmouse.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#endif
|
||||
#include <xf86Xinput.h>
|
||||
#include <exevents.h> /* Needed for InitValuator/Proximity stuff */
|
||||
+#include <extinit.h>
|
||||
#include <mipointer.h>
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
@@ -63,8 +64,12 @@ PtrDeviceOn(DeviceIntPtr pDev)
|
||||
}
|
||||
|
||||
void
|
||||
-PtrDeviceInit(void)
|
||||
+PtrDeviceInit(DeviceIntPtr pDevice, char *name)
|
||||
{
|
||||
+ Atom atom = MakeAtom(name, strlen(name), TRUE);
|
||||
+
|
||||
+ AssignTypeAndName(pDevice, atom, name);
|
||||
+
|
||||
}
|
||||
|
||||
void
|
||||
@@ -119,7 +124,7 @@ xf86rfbMouseControlProc(DeviceIntPtr dev, int onoff)
|
||||
{
|
||||
case DEVICE_INIT:
|
||||
vncSetPointerDevice(dev);
|
||||
- PtrDeviceInit();
|
||||
+ // PtrDeviceInit(dev, "rfbPointer");
|
||||
map[1] = 1;
|
||||
map[2] = 2;
|
||||
map[3] = 3;
|
||||
--
|
||||
1.7.3.4
|
||||
|
@ -1,45 +0,0 @@
|
||||
From: Michael Schroeder <mls@suse.de>
|
||||
Date: Tue, 6 Sep 2011 07:58:33 +0200
|
||||
Subject: [PATCH 3/6] VNC: Fix crash when no depth translation is required.
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
Git-commit: 74d5e3115cd955b7ee1acc64c6b8b42198ed894b
|
||||
Signed-off: Egbert Eich <eich@suse.de>
|
||||
References: bnc #389386
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
||||
|
||||
---
|
||||
hw/vnc/translate.c | 11 ++++++-----
|
||||
1 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/hw/vnc/translate.c b/hw/vnc/translate.c
|
||||
index 5cc57a3..78030ed 100644
|
||||
--- a/hw/vnc/translate.c
|
||||
+++ b/hw/vnc/translate.c
|
||||
@@ -168,17 +168,18 @@ rfbTranslateNone(ScreenPtr pScreen, char *table, rfbPixelFormat *in, rfbPixelFor
|
||||
{
|
||||
VNCSCREENPTR(pScreen);
|
||||
DrawablePtr pDraw = (DrawablePtr)pScreen->root;
|
||||
- int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4;
|
||||
+ int truewidth = PixmapBytePad(width, in->bitsPerPixel);
|
||||
|
||||
- if ((x + truewidth > pVNC->width) || truewidth != width) {
|
||||
- unsigned char *buffer = malloc(truewidth * height * in->bitsPerPixel / 8);
|
||||
+ if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) {
|
||||
+ unsigned char *buffer = malloc(truewidth * height);
|
||||
unsigned char *buf = buffer;
|
||||
|
||||
- (*pScreen->GetImage)(pDraw, x, y, truewidth, height, ZPixmap, ~0, (char*)buf);
|
||||
+ (*pScreen->GetImage)(pDraw, x, y, width, height, ZPixmap, ~0, (char*)buf);
|
||||
+
|
||||
while (height--) {
|
||||
memcpy(optr, buf, width * in->bitsPerPixel / 8);
|
||||
optr += width * in->bitsPerPixel / 8;
|
||||
- buf += truewidth * in->bitsPerPixel / 8;
|
||||
+ buf += truewidth;
|
||||
}
|
||||
free(buffer);
|
||||
return;
|
||||
--
|
||||
1.7.3.4
|
||||
|
@ -1,74 +0,0 @@
|
||||
From: Egbert Eich <eich@freedesktop.org>
|
||||
Date: Tue, 6 Sep 2011 07:02:11 +0200
|
||||
Subject: [PATCH 2/6] VNC: Readd timeout when vnc viewer connection breaks.
|
||||
Patch-Mainline: Currently no upstream project.
|
||||
Git-commit: 759b49ed1c4ea03e45433c92c2fb8c44a60db34a
|
||||
Signed-off: Egbert Eich <eich@suse.de>
|
||||
References: bnc #441935, bnc #403901
|
||||
|
||||
This prevents Xvnc busy loop forever waiting for a viewer that no longer
|
||||
response due to network or other issues.
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
||||
---
|
||||
hw/vnc/sockets.c | 19 +++++--------------
|
||||
1 files changed, 5 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/hw/vnc/sockets.c b/hw/vnc/sockets.c
|
||||
index 39eb88a..ae43ed0 100644
|
||||
--- a/hw/vnc/sockets.c
|
||||
+++ b/hw/vnc/sockets.c
|
||||
@@ -442,9 +442,7 @@ WriteExact(int sock, char *buf, int len)
|
||||
int n;
|
||||
fd_set fds;
|
||||
struct timeval tv;
|
||||
-#if 0
|
||||
int totalTimeWaited = 0;
|
||||
-#endif
|
||||
|
||||
while (len > 0) {
|
||||
n = write(sock, buf, len);
|
||||
@@ -464,7 +462,6 @@ WriteExact(int sock, char *buf, int len)
|
||||
return n;
|
||||
}
|
||||
|
||||
-#if 0
|
||||
/* Retry every 5 seconds until we exceed rfbMaxClientWait. We
|
||||
need to do this because select doesn't necessarily return
|
||||
immediately when the other end has gone away */
|
||||
@@ -473,19 +470,14 @@ WriteExact(int sock, char *buf, int len)
|
||||
FD_SET(sock, &fds);
|
||||
tv.tv_sec = 5;
|
||||
tv.tv_usec = 0;
|
||||
-#else
|
||||
- /* We're in the WakeupHandler now, so don't wait */
|
||||
|
||||
- FD_ZERO(&fds);
|
||||
- FD_SET(sock, &fds);
|
||||
- tv.tv_sec = 0;
|
||||
- tv.tv_usec = 0;
|
||||
-#endif
|
||||
n = select(sock+1, NULL, &fds, NULL, &tv);
|
||||
-#if 0
|
||||
+
|
||||
if (n < 0) {
|
||||
- rfbLogPerror("WriteExact: select");
|
||||
- return n;
|
||||
+ if (errno != EINTR) {
|
||||
+ rfbLogPerror("WriteExact: select");
|
||||
+ return n;
|
||||
+ }
|
||||
}
|
||||
if (n == 0) {
|
||||
totalTimeWaited += 5000;
|
||||
@@ -496,7 +488,6 @@ WriteExact(int sock, char *buf, int len)
|
||||
} else {
|
||||
totalTimeWaited = 0;
|
||||
}
|
||||
-#endif
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
--
|
||||
1.7.3.4
|
||||
|
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 9 13:25:41 UTC 2013 - tobias.johannes.klausmann@mni.thm.de
|
||||
|
||||
- Remove the unused Xvnc packages
|
||||
- Remove the now unused vnc macro
|
||||
- Remove the Xvnc patches:
|
||||
+ Patch17: n_VNC-Add-support-for-VNC.patch
|
||||
+ Patch18: n_VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
|
||||
+ Patch19: n_VNC-Fix-crash-when-no-depth-translation-is-required.patch
|
||||
+ Patch20: n_VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
|
||||
+ Patch21: n_VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
|
||||
+ Patch22: n_VNC-Fix-crash-due-to-unset-input-device-names.patch
|
||||
+ Patch23: n_Xvnc-pthread.diff
|
||||
+ Patch24: n_VNC-Add-proto.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 8 19:51:35 UTC 2013 - eich@suse.com
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
Name: xorg-x11-server
|
||||
|
||||
%define dirsuffix 1.14.2
|
||||
%define vnc 0
|
||||
|
||||
Summary: X
|
||||
License: GPL-2.0+ and MIT
|
||||
Group: System/X11/Servers/XF86_4
|
||||
@ -91,10 +91,7 @@ BuildRequires: pkgconfig(xv)
|
||||
%if 0%{?suse_version} >= 1130
|
||||
BuildRequires: pkgconfig(libudev) >= 143
|
||||
%endif
|
||||
%if %vnc
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: pkgconfig(vncproto)
|
||||
%endif
|
||||
|
||||
Version: 7.6_%{dirsuffix}
|
||||
Release: 0
|
||||
Url: http://xorg.freedesktop.org/
|
||||
@ -116,24 +113,7 @@ Obsoletes: xorg-x11-Xvfb
|
||||
Obsoletes: xorg-x11-server-glx
|
||||
# Xvfb requires keyboard files as well (bnc#797124)
|
||||
Requires: xkeyboard-config
|
||||
%if %vnc
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch17: n_VNC-Add-support-for-VNC.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch18: n_VNC-Readd-timeout-when-vnc-viewer-connection-breaks.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch19: n_VNC-Fix-crash-when-no-depth-translation-is-required.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch20: n_VNC-Don-t-let-VNC-access-the-framebuffer-directly-an.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch21: n_VNC-Enable-use-of-all-keyboard-layouts-independent-o.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch22: n_VNC-Fix-crash-due-to-unset-input-device-names.patch
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch23: n_Xvnc-pthread.diff
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch24: n_VNC-Add-proto.diff
|
||||
%endif
|
||||
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch45: N_bug-197858_dpms.diff
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
@ -230,27 +210,6 @@ Obsoletes: xorg-x11-sdk
|
||||
%description sdk
|
||||
This package contains the X.Org Server SDK.
|
||||
|
||||
%if %vnc
|
||||
|
||||
%package -n xorg-x11-Xvnc
|
||||
Summary: VNC Server for the X Window System
|
||||
Group: System/X11/Servers/XF86_4
|
||||
Requires: xkbcomp
|
||||
Requires: xkeyboard-config
|
||||
Requires: xorg-x11-fonts-core
|
||||
Provides: XFree86-Xvnc
|
||||
Provides: vnc:/usr/X11R6/bin/Xvnc
|
||||
Obsoletes: XFree86-Xvnc
|
||||
%ifarch ia64
|
||||
Provides: vnc-x86
|
||||
Obsoletes: vnc-x86
|
||||
%endif
|
||||
|
||||
%description -n xorg-x11-Xvnc
|
||||
An X Window System server for Virtual Network Computing (VNC).
|
||||
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n xorg-server-%{dirsuffix} -a4
|
||||
# Early verification if the ABI Defines are correct. Let's not waste build cycles if the Provides are wrong at the end.
|
||||
@ -259,18 +218,7 @@ cp %{SOURCE96} .
|
||||
%patch0 -p1
|
||||
%patch2
|
||||
%patch16 -p1
|
||||
%if %vnc
|
||||
### Needs to be rebased
|
||||
#%patch17 -p1
|
||||
|
||||
#%patch18 -p1
|
||||
#%patch19 -p1
|
||||
#%patch20 -p1
|
||||
#%patch21 -p1
|
||||
#%patch22 -p1
|
||||
#%patch23 -p1
|
||||
#%patch24 -p1
|
||||
%endif
|
||||
### Needs to be rebased
|
||||
#%patch45 -p0
|
||||
%patch77
|
||||
@ -332,9 +280,6 @@ autoreconf -fi
|
||||
%if 0%{?suse_version} > 1120
|
||||
--enable-config-udev \
|
||||
%endif
|
||||
%endif
|
||||
%if %vnc
|
||||
--disable-xcliplist \
|
||||
%endif
|
||||
--with-log-dir="/var/log" \
|
||||
--with-os-name="openSUSE" \
|
||||
@ -382,14 +327,6 @@ install -m 644 $RPM_SOURCE_DIR/modprobe.nvidia %{buildroot}%{_sysconfdir}/modpro
|
||||
%else
|
||||
rm -f %{buildroot}%{_datadir}/aclocal/*.m4
|
||||
%endif
|
||||
%if %vnc
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
||||
cat > %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} << EOF
|
||||
## Name: VNC Server
|
||||
## Description: Opens ports for VNC Server
|
||||
TCP="5801 5901"
|
||||
EOF
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
rm -f %{buildroot}%{_sysconfdir}/X11/10-evdev.conf
|
||||
make -C hw/xfree86/parser
|
||||
@ -505,12 +442,5 @@ exit 0
|
||||
%{_datadir}/aclocal/*.m4
|
||||
%endif
|
||||
%{_sysconfdir}/rpm/macros.xorg-server
|
||||
%if %vnc
|
||||
|
||||
%files -n xorg-x11-Xvnc
|
||||
%defattr(-, root, root)
|
||||
%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
|
||||
#%{_bindir}/Xvnc
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user