mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-15 05:23:40 +00:00
Some checks failed
Build X servers / ubuntu-fetch-pkg (push) Has been cancelled
Build X servers / xserver-build-ubuntu-no-gbm (push) Has been cancelled
Build X servers / xserver-build-ubuntu (push) Has been cancelled
Build X servers / abi-changes-check (push) Has been cancelled
Build X servers / xserver-build-ubuntu-debug (push) Has been cancelled
Build X servers / drivers-prepare-ubuntu (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-elographics:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-evdev:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-joystick:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-keyboard:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-libinput:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-mouse:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-synaptics:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-vmmouse:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-void:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (input-wacom:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-amdgpu:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-apm:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-ark:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-ast:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-ati:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-chips:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-cirrus:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-dummy:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-fbdev:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-freedreno:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-geode:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-i128:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-i740:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-intel:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-mach64:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-mga:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-neomagic:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nested:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nouveau:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-nv:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-omap:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-qxl:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-r128:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-macos (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / xserver-build-solaris (push) Has been cancelled
Build X servers / xserver-build-openbsd (push) Has been cancelled
Build X servers / xserver-build-alpine (push) Has been cancelled
Build X servers / xserver-build-gentoo (push) Has been cancelled
Build X servers / xserver-build-cygwin (push) Has been cancelled
Build X servers / xserver-build-arch (push) Has been cancelled
Build X servers / Check Signed-Off-By (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
check PRs for merge conflicts / notify (push) Has been cancelled
No need to have an actual (const) variable for something that can easily be a #define. And also moving it into the only source file actually using it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
162 lines
5.3 KiB
C
162 lines
5.3 KiB
C
/************************************************************
|
|
|
|
Copyright 1989, 1998 The Open Group
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
the above copyright notice appear in all copies and that both that
|
|
copyright notice and this permission notice appear in supporting
|
|
documentation.
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
Except as contained in this notice, the name of The Open Group shall not be
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
in this Software without prior written authorization from The Open Group.
|
|
|
|
Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
|
|
|
|
All Rights Reserved
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
documentation for any purpose and without fee is hereby granted,
|
|
provided that the above copyright notice appear in all copies and that
|
|
both that copyright notice and this permission notice appear in
|
|
supporting documentation, and that the name of Hewlett-Packard not be
|
|
used in advertising or publicity pertaining to distribution of the
|
|
software without specific, written prior permission.
|
|
|
|
HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
SOFTWARE.
|
|
|
|
********************************************************/
|
|
|
|
/***********************************************************************
|
|
*
|
|
* Request to select input from an extension device.
|
|
*
|
|
*/
|
|
|
|
#include <dix-config.h>
|
|
|
|
#include <X11/extensions/XI.h>
|
|
#include <X11/extensions/XI2.h>
|
|
#include <X11/extensions/XIproto.h>
|
|
|
|
#include "dix/dix_priv.h"
|
|
#include "dix/exevents_priv.h"
|
|
#include "dix/request_priv.h"
|
|
#include "handlers.h"
|
|
|
|
#include "inputstr.h" /* DeviceIntPtr */
|
|
#include "windowstr.h" /* window structure */
|
|
#include "exglobals.h"
|
|
#include "grabdev.h"
|
|
|
|
#define XIAllMasks ((Mask)((1L << 20) - 1))
|
|
|
|
static int
|
|
HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
|
XEventClass * cls, CARD16 *count)
|
|
{
|
|
int i, j;
|
|
Mask mask;
|
|
|
|
/* We use the device ID 256 to select events that aren't bound to
|
|
* any device. For now we only handle the device presence event,
|
|
* but this could be extended to other events that aren't bound to
|
|
* a device.
|
|
*
|
|
* In order not to break in CreateMaskFromList() we remove the
|
|
* entries with device ID 256 from the XEventClass array.
|
|
*/
|
|
|
|
mask = 0;
|
|
for (i = 0, j = 0; i < *count; i++) {
|
|
if (cls[i] >> 8 != 256) {
|
|
cls[j] = cls[i];
|
|
j++;
|
|
continue;
|
|
}
|
|
|
|
switch (cls[i] & 0xff) {
|
|
case _devicePresence:
|
|
mask |= DevicePresenceNotifyMask;
|
|
break;
|
|
}
|
|
}
|
|
|
|
*count = j;
|
|
|
|
if (mask == 0)
|
|
return Success;
|
|
|
|
/* We always only use mksidx = AllDevices for events not bound to
|
|
* devices */
|
|
if (AddExtensionClient(win, client, mask, XIAllDevices) != Success)
|
|
return BadAlloc;
|
|
|
|
RecalculateDeviceDeliverableEvents(win);
|
|
|
|
return Success;
|
|
}
|
|
|
|
/***********************************************************************
|
|
*
|
|
* This procedure selects input from an extension device.
|
|
*
|
|
*/
|
|
|
|
int
|
|
ProcXSelectExtensionEvent(ClientPtr client)
|
|
{
|
|
X_REQUEST_HEAD_AT_LEAST(xSelectExtensionEventReq);
|
|
X_REQUEST_FIELD_CARD32(window);
|
|
X_REQUEST_FIELD_CARD16(count);
|
|
X_REQUEST_REST_COUNT_CARD32(stuff->count);
|
|
|
|
int ret;
|
|
int i;
|
|
WindowPtr pWin;
|
|
struct tmask tmp[EMASKSIZE];
|
|
|
|
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
|
if (ret != Success)
|
|
return ret;
|
|
|
|
if (HandleDevicePresenceMask(client, pWin, (XEventClass *) &stuff[1],
|
|
&stuff->count) != Success)
|
|
return BadAlloc;
|
|
|
|
if ((ret = CreateMaskFromList(client, (XEventClass *) &stuff[1],
|
|
stuff->count, tmp, NULL,
|
|
X_SelectExtensionEvent)) != Success)
|
|
return ret;
|
|
|
|
for (i = 0; i < EMASKSIZE; i++)
|
|
if (tmp[i].dev != NULL) {
|
|
if (tmp[i].mask & ~XIAllMasks) {
|
|
client->errorValue = tmp[i].mask;
|
|
return BadValue;
|
|
}
|
|
if ((ret =
|
|
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
|
|
tmp[i].mask, DeviceButtonGrabMask)) != Success)
|
|
return ret;
|
|
}
|
|
|
|
return Success;
|
|
}
|