Merge remote-tracking branch 'whot/next'
This commit is contained in:
commit
116f020102
|
@ -596,7 +596,7 @@ Bool
|
|||
PanoramiXCreateConnectionBlock(void)
|
||||
{
|
||||
int i, j, length;
|
||||
Bool disableBackingStore = FALSE;
|
||||
Bool disable_backing_store = FALSE;
|
||||
int old_width, old_height;
|
||||
float width_mult, height_mult;
|
||||
xWindowRoot *root;
|
||||
|
@ -622,10 +622,10 @@ PanoramiXCreateConnectionBlock(void)
|
|||
}
|
||||
if (pScreen->backingStoreSupport !=
|
||||
screenInfo.screens[0]->backingStoreSupport)
|
||||
disableBackingStore = TRUE;
|
||||
disable_backing_store = TRUE;
|
||||
}
|
||||
|
||||
if (disableBackingStore) {
|
||||
if (disable_backing_store) {
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
pScreen = screenInfo.screens[i];
|
||||
pScreen->backingStoreSupport = NotUseful;
|
||||
|
@ -831,15 +831,15 @@ PanoramiXConsolidate(void)
|
|||
saver->type = XRT_WINDOW;
|
||||
|
||||
FOR_NSCREENS(i) {
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
ScreenPtr scr = screenInfo.screens[i];
|
||||
|
||||
root->info[i].id = pScreen->root->drawable.id;
|
||||
root->info[i].id = scr->root->drawable.id;
|
||||
root->u.win.class = InputOutput;
|
||||
root->u.win.root = TRUE;
|
||||
saver->info[i].id = pScreen->screensaver.wid;
|
||||
saver->info[i].id = scr->screensaver.wid;
|
||||
saver->u.win.class = InputOutput;
|
||||
saver->u.win.root = TRUE;
|
||||
defmap->info[i].id = pScreen->defColormap;
|
||||
defmap->info[i].id = scr->defColormap;
|
||||
}
|
||||
|
||||
AddResource(root->info[0].id, XRT_WINDOW, root);
|
||||
|
|
13
Xext/sync.c
13
Xext/sync.c
|
@ -2747,7 +2747,6 @@ init_system_idle_counter(const char *name, int deviceid)
|
|||
{
|
||||
CARD64 resolution;
|
||||
XSyncValue idle;
|
||||
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
|
||||
SyncCounter *idle_time_counter;
|
||||
|
||||
IdleTimeQueryValue(NULL, &idle);
|
||||
|
@ -2758,10 +2757,14 @@ init_system_idle_counter(const char *name, int deviceid)
|
|||
IdleTimeQueryValue,
|
||||
IdleTimeBracketValues);
|
||||
|
||||
priv->deviceid = deviceid;
|
||||
priv->value_less = priv->value_greater = NULL;
|
||||
if (idle_time_counter != NULL) {
|
||||
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
|
||||
|
||||
idle_time_counter->pSysCounterInfo->private = priv;
|
||||
priv->value_less = priv->value_greater = NULL;
|
||||
priv->deviceid = deviceid;
|
||||
|
||||
idle_time_counter->pSysCounterInfo->private = priv;
|
||||
}
|
||||
|
||||
return idle_time_counter;
|
||||
}
|
||||
|
@ -2786,6 +2789,6 @@ void SyncRemoveDeviceIdleTime(SyncCounter *counter)
|
|||
/* FreeAllResources() frees all system counters before the devices are
|
||||
shut down, check if there are any left before freeing the device's
|
||||
counter */
|
||||
if (!xorg_list_is_empty(&SysCounterList))
|
||||
if (counter && !xorg_list_is_empty(&SysCounterList))
|
||||
xorg_list_del(&counter->pSysCounterInfo->entry);
|
||||
}
|
||||
|
|
|
@ -702,7 +702,7 @@ ProcXvUngrabPort(ClientPtr client)
|
|||
static int
|
||||
ProcXvStopVideo(ClientPtr client)
|
||||
{
|
||||
int status, rc;
|
||||
int status, ret;
|
||||
DrawablePtr pDraw;
|
||||
XvPortPtr pPort;
|
||||
|
||||
|
@ -716,9 +716,9 @@ ProcXvStopVideo(ClientPtr client)
|
|||
return status;
|
||||
}
|
||||
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
return XvdiStopVideo(client, pPort, pDraw);
|
||||
}
|
||||
|
|
|
@ -803,6 +803,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
|||
RT_WINDOW, client, DixGetAttrAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = stuff->window;
|
||||
free(overlayWin);
|
||||
return rc;
|
||||
}
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
@ -812,8 +813,10 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
|||
* interest in the overlay window
|
||||
*/
|
||||
pOc = compCreateOverlayClient(pScreen, client);
|
||||
if (pOc == NULL)
|
||||
if (pOc == NULL) {
|
||||
free(overlayWin);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the overlay window exists
|
||||
|
@ -822,6 +825,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
|||
if (cs->pOverlayWin == NULL)
|
||||
if (!compCreateOverlayWindow(pScreen)) {
|
||||
FreeResource(pOc->resource, RT_NONE);
|
||||
free(overlayWin);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
|
@ -831,6 +835,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
|
|||
DixGetAttrAccess);
|
||||
if (rc != Success) {
|
||||
FreeResource(pOc->resource, RT_NONE);
|
||||
free(overlayWin);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,6 +308,13 @@ AC_CHECK_HEADER([execinfo.h],[
|
|||
])]
|
||||
)
|
||||
|
||||
PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
|
||||
if test "x$HAVE_LIBUNWIND" = xyes; then
|
||||
AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Bus options and CPU capabilities. Replaces logic in
|
||||
dnl hw/xfree86/os-support/bus/Makefile.am, among others.
|
||||
|
@ -1336,7 +1343,7 @@ AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
|
|||
|
||||
if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
|
||||
DIX_LIB='$(top_builddir)/dix/dix.O'
|
||||
OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)'
|
||||
OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
|
||||
else
|
||||
DIX_LIB='$(top_builddir)/dix/libdix.la'
|
||||
OS_LIB='$(top_builddir)/os/libos.la'
|
||||
|
|
|
@ -357,6 +357,8 @@ main(int argc, char *argv[], char *envp[])
|
|||
|
||||
FreeFonts();
|
||||
|
||||
FreeAllAtoms();
|
||||
|
||||
FreeAuditTimer();
|
||||
|
||||
if (dispatchException & DE_TERMINATE) {
|
||||
|
|
|
@ -1431,6 +1431,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
CursorVisible = TRUE;
|
||||
|
||||
if (pWin->realized)
|
||||
WindowHasNewCursor(pWin);
|
||||
|
||||
|
@ -3430,6 +3432,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
|
|||
}
|
||||
|
||||
out:
|
||||
CursorVisible = TRUE;
|
||||
|
||||
if (pWin->realized)
|
||||
WindowHasNewCursor(pWin);
|
||||
|
||||
|
|
|
@ -185,19 +185,15 @@ fbGlyphs(CARD8 op,
|
|||
if (maskFormat) {
|
||||
pixman_format_code_t format;
|
||||
pixman_box32_t extents;
|
||||
int x, y;
|
||||
|
||||
format = maskFormat->format | (maskFormat->depth << 24);
|
||||
|
||||
pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
|
||||
|
||||
x = extents.x1;
|
||||
y = extents.y1;
|
||||
|
||||
pixman_composite_glyphs(op, srcImage, dstImage, format,
|
||||
xSrc + srcXoff + xDst, ySrc + srcYoff + yDst,
|
||||
x, y,
|
||||
x + dstXoff, y + dstYoff,
|
||||
extents.x1, extents.y1,
|
||||
extents.x1 + dstXoff, extents.y1 + dstYoff,
|
||||
extents.x2 - extents.x1,
|
||||
extents.y2 - extents.y1,
|
||||
glyphCache, n_glyphs, pglyphs);
|
||||
|
|
|
@ -56,6 +56,7 @@ typedef struct _EphyrInputPrivate {
|
|||
} EphyrKbdPrivate, EphyrPointerPrivate;
|
||||
|
||||
Bool EphyrWantGrayScale = 0;
|
||||
Bool EphyrWantResize = 0;
|
||||
|
||||
Bool
|
||||
ephyrInitialize(KdCardInfo * card, EphyrPriv * priv)
|
||||
|
@ -237,13 +238,11 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
|
|||
KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height);
|
||||
KdSetPointerMatrix(&m);
|
||||
|
||||
priv->bytes_per_line =
|
||||
((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
|
||||
|
||||
buffer_height = ephyrBufferHeight(screen);
|
||||
|
||||
priv->base =
|
||||
hostx_screen_init(screen, screen->width, screen->height, buffer_height);
|
||||
hostx_screen_init(screen, screen->width, screen->height, buffer_height,
|
||||
&priv->bytes_per_line, &screen->fb.bitsPerPixel);
|
||||
|
||||
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
|
||||
scrpriv->shadow = FALSE;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
extern Window EphyrPreExistingHostWin;
|
||||
extern Bool EphyrWantGrayScale;
|
||||
extern Bool EphyrWantResize;
|
||||
extern Bool kdHasPointer;
|
||||
extern Bool kdHasKbd;
|
||||
|
||||
|
@ -116,6 +117,7 @@ ddxUseMsg(void)
|
|||
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
|
||||
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
|
||||
ErrorF("-grayscale Simulate 8bit grayscale\n");
|
||||
ErrorF("-resizeable Make Xephyr windows resizeable\n");
|
||||
ErrorF
|
||||
("-fakexa Simulate acceleration using software rendering\n");
|
||||
ErrorF("-verbosity <level> Set log verbosity level\n");
|
||||
|
@ -210,6 +212,10 @@ ddxProcessArgument(int argc, char **argv, int i)
|
|||
EphyrWantGrayScale = 1;
|
||||
return 1;
|
||||
}
|
||||
else if (!strcmp(argv[i], "-resizeable")) {
|
||||
EphyrWantResize = 1;
|
||||
return 1;
|
||||
}
|
||||
else if (!strcmp(argv[i], "-fakexa")) {
|
||||
ephyrFuncs.initAccel = ephyrDrawInit;
|
||||
ephyrFuncs.enableAccel = ephyrDrawEnable;
|
||||
|
|
|
@ -1006,7 +1006,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
|
|||
EphyrPortPriv *port_priv = a_port_priv;
|
||||
BoxRec clipped_area, dst_box;
|
||||
int result = BadImplementation;
|
||||
int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
|
||||
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, BadValue);
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
|
||||
|
@ -1024,11 +1023,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
|
|||
goto out;
|
||||
}
|
||||
|
||||
drw_x = clipped_area.x1;
|
||||
drw_y = clipped_area.y1;
|
||||
drw_w = clipped_area.x2 - clipped_area.x1;
|
||||
drw_h = clipped_area.y2 - clipped_area.y1;
|
||||
|
||||
if (!ephyrHostXVPutVideo(a_info->pScreen->myNum,
|
||||
port_priv->port_number,
|
||||
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
|
||||
|
@ -1055,7 +1049,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
|
|||
EphyrPortPriv *port_priv = a_port_priv;
|
||||
BoxRec clipped_area, dst_box;
|
||||
int result = BadImplementation;
|
||||
int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
|
||||
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
|
||||
|
@ -1073,11 +1066,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
|
|||
goto out;
|
||||
}
|
||||
|
||||
drw_x = clipped_area.x1;
|
||||
drw_y = clipped_area.y1;
|
||||
drw_w = clipped_area.x2 - clipped_area.x1;
|
||||
drw_h = clipped_area.y2 - clipped_area.y1;
|
||||
|
||||
if (!ephyrHostXVGetVideo(a_info->pScreen->myNum,
|
||||
port_priv->port_number,
|
||||
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
|
||||
|
@ -1104,7 +1092,6 @@ ephyrPutStill(KdScreenInfo * a_info,
|
|||
EphyrPortPriv *port_priv = a_port_priv;
|
||||
BoxRec clipped_area, dst_box;
|
||||
int result = BadImplementation;
|
||||
int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
|
||||
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
|
||||
|
@ -1122,11 +1109,6 @@ ephyrPutStill(KdScreenInfo * a_info,
|
|||
goto out;
|
||||
}
|
||||
|
||||
drw_x = clipped_area.x1;
|
||||
drw_y = clipped_area.y1;
|
||||
drw_w = clipped_area.x2 - clipped_area.x1;
|
||||
drw_h = clipped_area.y2 - clipped_area.y1;
|
||||
|
||||
if (!ephyrHostXVPutStill(a_info->pScreen->myNum,
|
||||
port_priv->port_number,
|
||||
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
|
||||
|
@ -1153,7 +1135,6 @@ ephyrGetStill(KdScreenInfo * a_info,
|
|||
EphyrPortPriv *port_priv = a_port_priv;
|
||||
BoxRec clipped_area, dst_box;
|
||||
int result = BadImplementation;
|
||||
int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
|
||||
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
|
||||
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
|
||||
|
@ -1171,11 +1152,6 @@ ephyrGetStill(KdScreenInfo * a_info,
|
|||
goto out;
|
||||
}
|
||||
|
||||
drw_x = clipped_area.x1;
|
||||
drw_y = clipped_area.y1;
|
||||
drw_w = clipped_area.x2 - clipped_area.x1;
|
||||
drw_h = clipped_area.y2 - clipped_area.y1;
|
||||
|
||||
if (!ephyrHostXVGetStill(a_info->pScreen->myNum,
|
||||
port_priv->port_number,
|
||||
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
|
||||
|
|
|
@ -117,6 +117,8 @@ extern EphyrKeySyms ephyrKeySyms;
|
|||
|
||||
extern int monitorResolution;
|
||||
|
||||
extern Bool EphyrWantResize;
|
||||
|
||||
char *ephyrResName = NULL;
|
||||
int ephyrResNameFromCmd = 0;
|
||||
char *ephyrTitle = NULL;
|
||||
|
@ -617,7 +619,8 @@ hostx_set_cmap_entry(unsigned char idx,
|
|||
*/
|
||||
void *
|
||||
hostx_screen_init(EphyrScreenInfo screen,
|
||||
int width, int height, int buffer_height)
|
||||
int width, int height, int buffer_height,
|
||||
int *bytes_per_line, int *bits_per_pixel)
|
||||
{
|
||||
int bitmap_pad;
|
||||
Bool shm_success = False;
|
||||
|
@ -694,10 +697,13 @@ hostx_screen_init(EphyrScreenInfo screen,
|
|||
malloc(host_screen->ximg->bytes_per_line * buffer_height);
|
||||
}
|
||||
|
||||
*bytes_per_line = host_screen->ximg->bytes_per_line;
|
||||
*bits_per_pixel = host_screen->ximg->bits_per_pixel;
|
||||
|
||||
XResizeWindow(HostX.dpy, host_screen->win, width, height);
|
||||
|
||||
/* Ask the WM to keep our size static */
|
||||
if (host_screen->win_pre_existing == None) {
|
||||
if (host_screen->win_pre_existing == None && !EphyrWantResize) {
|
||||
size_hints = XAllocSizeHints();
|
||||
size_hints->max_width = size_hints->min_width = width;
|
||||
size_hints->max_height = size_hints->min_height = height;
|
||||
|
@ -858,7 +864,7 @@ hostx_load_keymap(void)
|
|||
(max_keycode - min_keycode + 1) *
|
||||
width);
|
||||
if (!ephyrKeySyms.map)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < (max_keycode - min_keycode + 1); i++)
|
||||
for (j = 0; j < width; j++)
|
||||
|
@ -871,6 +877,7 @@ hostx_load_keymap(void)
|
|||
ephyrKeySyms.maxKeyCode = max_keycode;
|
||||
ephyrKeySyms.mapWidth = width;
|
||||
|
||||
out:
|
||||
XFree(keymap);
|
||||
}
|
||||
|
||||
|
@ -1011,19 +1018,27 @@ hostx_get_event(EphyrHostXEvent * ev)
|
|||
|
||||
case ConfigureNotify:
|
||||
{
|
||||
struct EphyrHostScreen *host_screen =
|
||||
host_screen_from_window(xev.xconfigure.window);
|
||||
struct EphyrHostScreen *host_screen;
|
||||
|
||||
if (host_screen && host_screen->win_pre_existing != None) {
|
||||
ev->type = EPHYR_EV_CONFIGURE;
|
||||
ev->data.configure.width = xev.xconfigure.width;
|
||||
ev->data.configure.height = xev.xconfigure.height;
|
||||
ev->data.configure.window = xev.xconfigure.window;
|
||||
ev->data.configure.screen = host_screen->mynum;
|
||||
return 1;
|
||||
/* event compression as for Expose events, cause
|
||||
* we don't want to resize the framebuffer for
|
||||
* every single change */
|
||||
while (XCheckTypedWindowEvent(HostX.dpy, xev.xconfigure.window,
|
||||
ConfigureNotify, &xev));
|
||||
host_screen = host_screen_from_window(xev.xconfigure.window);
|
||||
|
||||
if (!host_screen ||
|
||||
(host_screen->win_pre_existing == None && !EphyrWantResize)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
ev->type = EPHYR_EV_CONFIGURE;
|
||||
ev->data.configure.width = xev.xconfigure.width;
|
||||
ev->data.configure.height = xev.xconfigure.height;
|
||||
ev->data.configure.window = xev.xconfigure.window;
|
||||
ev->data.configure.screen = host_screen->mynum;
|
||||
|
||||
return 1;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -193,7 +193,8 @@ hostx_set_cmap_entry(unsigned char idx,
|
|||
unsigned char r, unsigned char g, unsigned char b);
|
||||
|
||||
void *hostx_screen_init(EphyrScreenInfo screen,
|
||||
int width, int height, int buffer_height);
|
||||
int width, int height, int buffer_height,
|
||||
int *bytes_per_line, int *bits_per_pixel);
|
||||
|
||||
void
|
||||
|
||||
|
|
|
@ -465,16 +465,6 @@ fbdevRandRSetConfig(ScreenPtr pScreen,
|
|||
int oldheight;
|
||||
int oldmmwidth;
|
||||
int oldmmheight;
|
||||
int newwidth, newheight;
|
||||
|
||||
if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) {
|
||||
newwidth = pSize->width;
|
||||
newheight = pSize->height;
|
||||
}
|
||||
else {
|
||||
newwidth = pSize->height;
|
||||
newheight = pSize->width;
|
||||
}
|
||||
|
||||
if (wasEnabled)
|
||||
KdDisableScreen(pScreen);
|
||||
|
|
|
@ -441,10 +441,8 @@ ps2SkipInit(KdPointerInfo * pi, int ninit, Bool ret_next)
|
|||
{
|
||||
Kmouse *km = pi->driverPrivate;
|
||||
int c = -1;
|
||||
int skipping;
|
||||
Bool waiting;
|
||||
|
||||
skipping = 0;
|
||||
waiting = FALSE;
|
||||
while (ninit || ret_next) {
|
||||
c = MouseReadByte(&km->iob, MOUSE_TIMEOUT);
|
||||
|
@ -469,8 +467,6 @@ static Bool
|
|||
ps2Init(KdPointerInfo * pi)
|
||||
{
|
||||
Kmouse *km = pi->driverPrivate;
|
||||
int skipping;
|
||||
Bool waiting;
|
||||
int id;
|
||||
unsigned char *init;
|
||||
int ninit;
|
||||
|
@ -483,8 +479,6 @@ ps2Init(KdPointerInfo * pi)
|
|||
*/
|
||||
if (!MouseWriteByte(km->iob.fd, PSMC_SEND_DEV_ID, 100))
|
||||
return FALSE;
|
||||
skipping = 0;
|
||||
waiting = FALSE;
|
||||
id = ps2SkipInit(pi, 0, TRUE);
|
||||
switch (id) {
|
||||
case 3:
|
||||
|
|
|
@ -1821,16 +1821,11 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki,
|
|||
unsigned char scan_code, unsigned char is_up)
|
||||
{
|
||||
unsigned char key_code;
|
||||
KeyClassPtr keyc = NULL;
|
||||
KeybdCtrl *ctrl = NULL;
|
||||
int type;
|
||||
|
||||
if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key)
|
||||
return;
|
||||
|
||||
keyc = ki->dixdev->key;
|
||||
ctrl = &ki->dixdev->kbdfeed->ctrl;
|
||||
|
||||
if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) {
|
||||
key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode;
|
||||
|
||||
|
@ -1864,7 +1859,6 @@ void
|
|||
KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
|
||||
int rz)
|
||||
{
|
||||
CARD32 ms;
|
||||
unsigned char buttons;
|
||||
int x, y, z;
|
||||
int (*matrix)[3] = kdPointerMatrix.matrix;
|
||||
|
@ -1875,8 +1869,6 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
|
|||
if (!pi)
|
||||
return;
|
||||
|
||||
ms = GetTimeInMillis();
|
||||
|
||||
/* we don't need to transform z, so we don't. */
|
||||
if (flags & KD_MOUSE_DELTA) {
|
||||
if (pi->transformCoordinates) {
|
||||
|
|
|
@ -1174,7 +1174,6 @@ void
|
|||
KdXVDisable(ScreenPtr pScreen)
|
||||
{
|
||||
XvScreenPtr pxvs;
|
||||
KdXVScreenPtr ScreenPriv;
|
||||
XvAdaptorPtr pAdaptor;
|
||||
XvPortPtr pPort;
|
||||
XvPortRecPrivatePtr pPriv;
|
||||
|
@ -1184,7 +1183,6 @@ KdXVDisable(ScreenPtr pScreen)
|
|||
return;
|
||||
|
||||
pxvs = GET_XV_SCREEN(pScreen);
|
||||
ScreenPriv = GET_KDXV_SCREEN(pScreen);
|
||||
|
||||
for (i = 0; i < pxvs->nAdaptors; i++) {
|
||||
pAdaptor = &pxvs->pAdaptors[i];
|
||||
|
|
|
@ -413,7 +413,6 @@ static void
|
|||
xf86VTSwitch(void)
|
||||
{
|
||||
int i;
|
||||
static int prevSIGIO;
|
||||
InputInfoPtr pInfo;
|
||||
IHPtr ih;
|
||||
|
||||
|
|
|
@ -1370,7 +1370,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
int saveType;
|
||||
PixmapFormatRec *BankFormat;
|
||||
ClockRangePtr cp;
|
||||
ClockRangePtr storeClockRanges;
|
||||
int numTimings = 0;
|
||||
range hsync[MAX_HSYNC];
|
||||
range vrefresh[MAX_VREFRESH];
|
||||
|
@ -1492,16 +1491,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
/*
|
||||
* Store the clockRanges for later use by the VidMode extension.
|
||||
*/
|
||||
storeClockRanges = scrp->clockRanges;
|
||||
while (storeClockRanges != NULL) {
|
||||
storeClockRanges = storeClockRanges->next;
|
||||
}
|
||||
for (cp = clockRanges; cp != NULL; cp = cp->next,
|
||||
storeClockRanges = storeClockRanges->next) {
|
||||
storeClockRanges = xnfalloc(sizeof(ClockRange));
|
||||
nt_list_for_each_entry(cp, clockRanges, next) {
|
||||
ClockRangePtr newCR = xnfalloc(sizeof(ClockRange));
|
||||
memcpy(newCR, cp, sizeof(ClockRange));
|
||||
newCR->next = NULL;
|
||||
if (scrp->clockRanges == NULL)
|
||||
scrp->clockRanges = storeClockRanges;
|
||||
memcpy(storeClockRanges, cp, sizeof(ClockRange));
|
||||
scrp->clockRanges = newCR;
|
||||
else
|
||||
nt_list_append(newCR, scrp->clockRanges, ClockRange, next);
|
||||
}
|
||||
|
||||
/* Determine which pixmap format to pass to scanLineWidth() */
|
||||
|
|
|
@ -743,7 +743,7 @@ xf86TokenToOptName(const OptionInfoRec * table, int token)
|
|||
const OptionInfoRec *p;
|
||||
|
||||
p = xf86TokenToOptinfo(table, token);
|
||||
return p->name;
|
||||
return p ? p->name : NULL;
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -320,15 +320,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
|
|||
newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
|
||||
sizeof(FreeBoxCallbackProcPtr) *
|
||||
(offman->NumCallbacks + 1));
|
||||
if (!newCallbacks)
|
||||
return FALSE;
|
||||
else
|
||||
offman->FreeBoxesUpdateCallback = newCallbacks;
|
||||
|
||||
newPrivates = realloc(offman->devPrivates,
|
||||
sizeof(DevUnion) * (offman->NumCallbacks + 1));
|
||||
|
||||
if (!newCallbacks || !newPrivates)
|
||||
if (!newPrivates)
|
||||
return FALSE;
|
||||
|
||||
offman->FreeBoxesUpdateCallback = newCallbacks;
|
||||
offman->devPrivates = newPrivates;
|
||||
else
|
||||
offman->devPrivates = newPrivates;
|
||||
|
||||
offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
|
||||
offman->devPrivates[offman->NumCallbacks].ptr = devPriv;
|
||||
|
|
|
@ -158,8 +158,10 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
|
|||
if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
|
||||
return FALSE;
|
||||
|
||||
if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
|
||||
if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) {
|
||||
free(pAdapt);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) {
|
||||
free(pAdapt);
|
||||
|
|
|
@ -91,15 +91,16 @@ resort(unsigned char *s_block)
|
|||
unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end;
|
||||
unsigned char tmp;
|
||||
|
||||
s_ptr = find_header(s_block);
|
||||
if (!s_ptr)
|
||||
return NULL;
|
||||
s_end = s_block + EDID1_LEN;
|
||||
|
||||
d_new = malloc(EDID1_LEN);
|
||||
if (!d_new)
|
||||
return NULL;
|
||||
d_end = d_new + EDID1_LEN;
|
||||
|
||||
s_ptr = find_header(s_block);
|
||||
if (!s_ptr)
|
||||
return NULL;
|
||||
for (d_ptr = d_new; d_ptr < d_end; d_ptr++) {
|
||||
tmp = *(s_ptr++);
|
||||
*d_ptr = tmp;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
* Externing inputInfo is not the nice way to do it but it works.
|
||||
*/
|
||||
#include "inputstr.h"
|
||||
extern InputInfo inputInfo;
|
||||
|
||||
DevPrivateKeyRec xf86CursorScreenKeyRec;
|
||||
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
/* Has backtrace support */
|
||||
#undef HAVE_BACKTRACE
|
||||
|
||||
/* Has libunwind support */
|
||||
#undef HAVE_LIBUNWIND
|
||||
|
||||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
#undef HAVE_BYTESWAP_H
|
||||
|
||||
|
|
|
@ -638,6 +638,11 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
|
|||
xfixes/cursor.c uses it to determine if the cursor is enabled */
|
||||
extern Bool EnableCursor;
|
||||
|
||||
/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
|
||||
* CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
|
||||
*/
|
||||
extern Bool CursorVisible;
|
||||
|
||||
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
|
||||
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
|
||||
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
|
||||
|
|
|
@ -34,6 +34,11 @@ if XDMCP
|
|||
libos_la_SOURCES += $(XDMCP_SRCS)
|
||||
endif
|
||||
|
||||
if HAVE_LIBUNWIND
|
||||
AM_CFLAGS += $(LIBUNWIND_CFLAGS)
|
||||
libos_la_LIBADD += $(LIBUNWIND_LIBS)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
|
||||
|
||||
if SPECIAL_DTRACE_OBJECTS
|
||||
|
|
|
@ -30,6 +30,80 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LIBUNWIND
|
||||
|
||||
#define UNW_LOCAL_ONLY
|
||||
#include <libunwind.h>
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <dlfcn.h>
|
||||
|
||||
void
|
||||
xorg_backtrace(void)
|
||||
{
|
||||
unw_cursor_t cursor;
|
||||
unw_context_t context;
|
||||
unw_word_t off;
|
||||
unw_proc_info_t pip;
|
||||
int ret, i = 0;
|
||||
char procname[256];
|
||||
const char *filename;
|
||||
Dl_info dlinfo;
|
||||
|
||||
pip.unwind_info = NULL;
|
||||
ret = unw_getcontext(&context);
|
||||
if (ret) {
|
||||
ErrorFSigSafe("unw_getcontext failed: %s [%d]\n", unw_strerror(ret),
|
||||
ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = unw_init_local(&cursor, &context);
|
||||
if (ret) {
|
||||
ErrorFSigSafe("unw_init_local failed: %s [%d]\n", unw_strerror(ret),
|
||||
ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ErrorFSigSafe("\n");
|
||||
ErrorFSigSafe("Backtrace:\n");
|
||||
ret = unw_step(&cursor);
|
||||
while (ret > 0) {
|
||||
ret = unw_get_proc_info(&cursor, &pip);
|
||||
if (ret) {
|
||||
ErrorFSigSafe("unw_get_proc_info failed: %s [%d]\n",
|
||||
unw_strerror(ret), ret);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = unw_get_proc_name(&cursor, procname, 256, &off);
|
||||
if (ret && ret != -UNW_ENOMEM) {
|
||||
if (ret != -UNW_EUNSPEC)
|
||||
ErrorFSigSafe("unw_get_proc_name failed: %s [%d]\n",
|
||||
unw_strerror(ret), ret);
|
||||
procname[0] = '?';
|
||||
procname[1] = 0;
|
||||
}
|
||||
|
||||
if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname &&
|
||||
*dlinfo.dli_fname)
|
||||
filename = dlinfo.dli_fname;
|
||||
else
|
||||
filename = "?";
|
||||
|
||||
ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname,
|
||||
ret == -UNW_ENOMEM ? "..." : "", (int)off,
|
||||
(void *)(pip.start_ip + off));
|
||||
|
||||
ret = unw_step(&cursor);
|
||||
if (ret < 0)
|
||||
ErrorFSigSafe("unw_step failed: %s [%d]\n", unw_strerror(ret), ret);
|
||||
}
|
||||
ErrorFSigSafe("\n");
|
||||
}
|
||||
#else /* HAVE_LIBUNWIND */
|
||||
#ifdef HAVE_BACKTRACE
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -246,3 +320,4 @@ xorg_backtrace(void)
|
|||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
4
os/log.c
4
os/log.c
|
@ -279,6 +279,10 @@ LogSetParameter(LogParameter param, int value)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Signal-safe snprintf, with some limitations over snprintf. Be careful
|
||||
* which directives you use.
|
||||
*/
|
||||
static int
|
||||
pnprintf(char *string, size_t size, const char *f, va_list args)
|
||||
{
|
||||
|
|
|
@ -363,13 +363,12 @@ void
|
|||
RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
|
||||
{
|
||||
ScreenPtr master = crtc->pScreen->current_master;
|
||||
int ret;
|
||||
PixmapPtr mscreenpix;
|
||||
rrScrPriv(crtc->pScreen);
|
||||
|
||||
mscreenpix = master->GetScreenPixmap(master);
|
||||
|
||||
ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
|
||||
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
|
||||
if (crtc->scanout_pixmap) {
|
||||
master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
|
||||
/*
|
||||
|
@ -442,7 +441,7 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
|
|||
RRCrtcPtr rr_crtc, int x, int y, int w, int h)
|
||||
{
|
||||
RegionRec root_pixmap_region, total_region, new_crtc_region;
|
||||
int i, c;
|
||||
int c;
|
||||
BoxRec newbox;
|
||||
BoxPtr newsize;
|
||||
ScreenPtr slave;
|
||||
|
@ -502,10 +501,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
|
|||
new_height == screen_pixmap->drawable.height) {
|
||||
ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2);
|
||||
} else {
|
||||
int ret;
|
||||
rrScrPriv(pScreen);
|
||||
ret = pScrPriv->rrScreenSetSize(pScreen,
|
||||
new_width, new_height, 0, 0);
|
||||
pScrPriv->rrScreenSetSize(pScreen, new_width, new_height, 0, 0);
|
||||
}
|
||||
|
||||
/* set shatters TODO */
|
||||
|
|
|
@ -129,8 +129,7 @@ typedef struct _CursorScreen {
|
|||
#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt)
|
||||
|
||||
/* The cursor doesn't show up until the first XDefineCursor() */
|
||||
static Bool CursorVisible = FALSE;
|
||||
|
||||
Bool CursorVisible = FALSE;
|
||||
Bool EnableCursor = TRUE;
|
||||
|
||||
static Bool
|
||||
|
@ -142,12 +141,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
|
||||
Unwrap(cs, pScreen, DisplayCursor, backupProc);
|
||||
|
||||
/*
|
||||
* Have to check ConnectionInfo to distinguish client requests from
|
||||
* initial root window setup. Not a great way to do it, I admit.
|
||||
*/
|
||||
if (ConnectionInfo)
|
||||
CursorVisible = EnableCursor;
|
||||
CursorVisible = CursorVisible && EnableCursor;
|
||||
|
||||
if (cs->pCursorHideCounts != NULL || !CursorVisible) {
|
||||
ret = (*pScreen->DisplayCursor) (pDev, pScreen, NullCursor);
|
||||
|
|
|
@ -3073,6 +3073,7 @@ XkbComputeGetIndicatorMapReplySize(XkbIndicatorPtr indicators,
|
|||
nIndicators++;
|
||||
}
|
||||
rep->length = (nIndicators * SIZEOF(xkbIndicatorMapWireDesc)) / 4;
|
||||
rep->nIndicators = nIndicators;
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -3984,13 +3985,11 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev,
|
|||
xkbSetNamesReq * stuff, CARD32 *data)
|
||||
{
|
||||
XkbDescRec *xkb;
|
||||
XkbNamesRec *names;
|
||||
CARD32 *tmp;
|
||||
Atom bad;
|
||||
|
||||
tmp = data;
|
||||
xkb = dev->key->xkbInfo->desc;
|
||||
names = xkb->names;
|
||||
|
||||
if (stuff->which & XkbKeyTypeNamesMask) {
|
||||
int i;
|
||||
|
|
151
xkb/xkbActions.c
151
xkb/xkbActions.c
|
@ -222,7 +222,6 @@ _XkbFilterSetState(XkbSrvInfoPtr xkbi,
|
|||
|
||||
#define LATCH_KEY_DOWN 1
|
||||
#define LATCH_PENDING 2
|
||||
#define NO_LATCH 3
|
||||
|
||||
static int
|
||||
_XkbFilterLatchState(XkbSrvInfoPtr xkbi,
|
||||
|
@ -230,6 +229,7 @@ _XkbFilterLatchState(XkbSrvInfoPtr xkbi,
|
|||
{
|
||||
|
||||
if (filter->keycode == 0) { /* initial press */
|
||||
AccessXCancelRepeatKey(xkbi,keycode);
|
||||
filter->keycode = keycode;
|
||||
filter->active = 1;
|
||||
filter->filterOthers = 1;
|
||||
|
@ -250,91 +250,102 @@ _XkbFilterLatchState(XkbSrvInfoPtr xkbi,
|
|||
else if (pAction && (filter->priv == LATCH_PENDING)) {
|
||||
if (((1 << pAction->type) & XkbSA_BreakLatch) != 0) {
|
||||
filter->active = 0;
|
||||
if (filter->upAction.type == XkbSA_LatchMods)
|
||||
xkbi->state.latched_mods &= ~filter->upAction.mods.mask;
|
||||
else
|
||||
xkbi->state.latched_group -=
|
||||
XkbSAGroup(&filter->upAction.group);
|
||||
}
|
||||
else if ((pAction->type == filter->upAction.type) &&
|
||||
(pAction->mods.flags == filter->upAction.mods.flags) &&
|
||||
(pAction->mods.mask == filter->upAction.mods.mask)) {
|
||||
if (filter->upAction.mods.flags & XkbSA_LatchToLock) {
|
||||
XkbControlsPtr ctrls = xkbi->desc->ctrls;
|
||||
|
||||
if (filter->upAction.type == XkbSA_LatchMods)
|
||||
pAction->mods.type = XkbSA_LockMods;
|
||||
else
|
||||
pAction->group.type = XkbSA_LockGroup;
|
||||
if (XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask) &&
|
||||
(ctrls->enabled_ctrls & XkbStickyKeysMask)) {
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (filter->upAction.type == XkbSA_LatchMods)
|
||||
pAction->mods.type = XkbSA_SetMods;
|
||||
else
|
||||
pAction->group.type = XkbSA_SetGroup;
|
||||
}
|
||||
if (filter->upAction.type == XkbSA_LatchMods)
|
||||
xkbi->state.latched_mods &= ~filter->upAction.mods.mask;
|
||||
else
|
||||
xkbi->state.latched_group -=
|
||||
XkbSAGroup(&filter->upAction.group);
|
||||
filter->active = 0;
|
||||
/* If one latch is broken, all latches are broken, so it's no use
|
||||
to find out which particular latch this filter tracks. */
|
||||
xkbi->state.latched_mods = 0;
|
||||
xkbi->state.latched_group = 0;
|
||||
}
|
||||
}
|
||||
else if (filter->keycode == keycode) { /* release */
|
||||
else if (filter->keycode == keycode && filter->priv != LATCH_PENDING){
|
||||
/* The test above for LATCH_PENDING skips subsequent releases of the
|
||||
key after it has been released first time and the latch became
|
||||
pending. */
|
||||
XkbControlsPtr ctrls = xkbi->desc->ctrls;
|
||||
int needBeep;
|
||||
int beepType = _BEEP_NONE;
|
||||
int needBeep = ((ctrls->enabled_ctrls & XkbStickyKeysMask) &&
|
||||
XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask));
|
||||
|
||||
needBeep = ((ctrls->enabled_ctrls & XkbStickyKeysMask) &&
|
||||
XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask));
|
||||
if (filter->upAction.type == XkbSA_LatchMods) {
|
||||
xkbi->clearMods = filter->upAction.mods.mask;
|
||||
if ((filter->upAction.mods.flags & XkbSA_ClearLocks) &&
|
||||
(xkbi->clearMods & xkbi->state.locked_mods) ==
|
||||
xkbi->clearMods) {
|
||||
xkbi->state.locked_mods &= ~xkbi->clearMods;
|
||||
filter->priv = NO_LATCH;
|
||||
beepType = _BEEP_STICKY_UNLOCK;
|
||||
unsigned char mask = filter->upAction.mods.mask;
|
||||
unsigned char common;
|
||||
|
||||
xkbi->clearMods = mask;
|
||||
|
||||
/* ClearLocks */
|
||||
common = mask & xkbi->state.locked_mods;
|
||||
if ((filter->upAction.mods.flags & XkbSA_ClearLocks) && common) {
|
||||
mask &= ~common;
|
||||
xkbi->state.locked_mods &= ~common;
|
||||
if (needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
/* LatchToLock */
|
||||
common = mask & xkbi->state.latched_mods;
|
||||
if ((filter->upAction.mods.flags & XkbSA_LatchToLock) && common) {
|
||||
unsigned char newlocked;
|
||||
|
||||
mask &= ~common;
|
||||
newlocked = common & ~xkbi->state.locked_mods;
|
||||
if(newlocked){
|
||||
xkbi->state.locked_mods |= newlocked;
|
||||
if (needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
|
||||
XkbStickyKeysMask);
|
||||
|
||||
}
|
||||
xkbi->state.latched_mods &= ~common;
|
||||
}
|
||||
/* Latch remaining modifiers, if any. */
|
||||
if (mask) {
|
||||
xkbi->state.latched_mods |= mask;
|
||||
filter->priv = LATCH_PENDING;
|
||||
if (needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
}
|
||||
else {
|
||||
xkbi->groupChange = -XkbSAGroup(&filter->upAction.group);
|
||||
/* ClearLocks */
|
||||
if ((filter->upAction.group.flags & XkbSA_ClearLocks) &&
|
||||
(xkbi->state.locked_group)) {
|
||||
xkbi->state.locked_group = 0;
|
||||
filter->priv = NO_LATCH;
|
||||
beepType = _BEEP_STICKY_UNLOCK;
|
||||
if (needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
/* LatchToLock */
|
||||
else if ((filter->upAction.group.flags & XkbSA_LatchToLock)
|
||||
&& (xkbi->state.latched_group)) {
|
||||
xkbi->state.locked_group += XkbSAGroup(&filter->upAction.group);
|
||||
xkbi->state.latched_group -= XkbSAGroup(&filter->upAction.group);
|
||||
if(XkbSAGroup(&filter->upAction.group) && needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
/* Latch group */
|
||||
else if(XkbSAGroup(&filter->upAction.group)){
|
||||
xkbi->state.latched_group += XkbSAGroup(&filter->upAction.group);
|
||||
filter->priv = LATCH_PENDING;
|
||||
if (needBeep)
|
||||
XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH,
|
||||
XkbStickyKeysMask);
|
||||
}
|
||||
}
|
||||
if (filter->priv == NO_LATCH) {
|
||||
|
||||
if (filter->priv != LATCH_PENDING)
|
||||
filter->active = 0;
|
||||
}
|
||||
else {
|
||||
filter->priv = LATCH_PENDING;
|
||||
if (filter->upAction.type == XkbSA_LatchMods) {
|
||||
xkbi->state.latched_mods |= filter->upAction.mods.mask;
|
||||
needBeep = xkbi->state.latched_mods ? needBeep : 0;
|
||||
xkbi->state.latched_mods |= filter->upAction.mods.mask;
|
||||
}
|
||||
else {
|
||||
xkbi->state.latched_group +=
|
||||
XkbSAGroup(&filter->upAction.group);
|
||||
}
|
||||
if (needBeep && (beepType == _BEEP_NONE))
|
||||
beepType = _BEEP_STICKY_LATCH;
|
||||
}
|
||||
if (needBeep && (beepType != _BEEP_NONE))
|
||||
XkbDDXAccessXBeep(xkbi->device, beepType, XkbStickyKeysMask);
|
||||
}
|
||||
else if (filter->priv == LATCH_KEY_DOWN) {
|
||||
filter->priv = NO_LATCH;
|
||||
filter->filterOthers = 0;
|
||||
else if (pAction && (filter->priv == LATCH_KEY_DOWN)) {
|
||||
/* Latch was broken before it became pending: degrade to a
|
||||
SetMods/SetGroup. */
|
||||
if (filter->upAction.type == XkbSA_LatchMods)
|
||||
filter->upAction.type = XkbSA_SetMods;
|
||||
else
|
||||
filter->upAction.type = XkbSA_SetGroup;
|
||||
filter->filter = _XkbFilterSetState;
|
||||
filter->priv = 0;
|
||||
return filter->filter(xkbi, filter, keycode, pAction);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue