Merge remote branch 'whot/for-keith'
This commit is contained in:
commit
bbffb85461
|
@ -58,7 +58,6 @@ device_added(struct udev_device *udev_device)
|
|||
char *config_info = NULL;
|
||||
const char *syspath;
|
||||
const char *tags_prop;
|
||||
const char *usb_vendor = NULL, *usb_model = NULL;
|
||||
const char *key, *value, *tmp;
|
||||
InputOption *options = NULL, *tmpo;
|
||||
InputAttributes attrs = {};
|
||||
|
@ -94,6 +93,8 @@ device_added(struct udev_device *udev_device)
|
|||
parent = udev_device_get_parent(udev_device);
|
||||
if (parent) {
|
||||
const char *ppath = udev_device_get_devnode(parent);
|
||||
const char *product = udev_device_get_property_value(parent, "PRODUCT");
|
||||
unsigned int usb_vendor, usb_model;
|
||||
|
||||
name = udev_device_get_sysattr_value(parent, "name");
|
||||
LOG_SYSATTR(ppath, "name", name);
|
||||
|
@ -104,6 +105,13 @@ device_added(struct udev_device *udev_device)
|
|||
|
||||
attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
|
||||
LOG_SYSATTR(ppath, "id", attrs.pnp_id);
|
||||
|
||||
/* construct USB ID in lowercase hex - "0000:ffff" */
|
||||
if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) {
|
||||
attrs.usb_id = Xprintf("%04x:%04x", usb_vendor, usb_model);
|
||||
if (attrs.usb_id)
|
||||
LOG_PROPERTY(path, "PRODUCT", product);
|
||||
}
|
||||
}
|
||||
if (!name)
|
||||
name = "(unnamed)";
|
||||
|
@ -152,12 +160,6 @@ device_added(struct udev_device *udev_device)
|
|||
} else if (!strcmp(key, "ID_VENDOR")) {
|
||||
LOG_PROPERTY(path, key, value);
|
||||
attrs.vendor = value;
|
||||
} else if (!strcmp(key, "ID_VENDOR_ID")) {
|
||||
LOG_PROPERTY(path, key, value);
|
||||
usb_vendor = value;
|
||||
} else if (!strcmp(key, "ID_VENDOR_MODEL")) {
|
||||
LOG_PROPERTY(path, key, value);
|
||||
usb_model = value;
|
||||
} else if (!strcmp(key, "ID_INPUT_KEY")) {
|
||||
LOG_PROPERTY(path, key, value);
|
||||
attrs.flags |= ATTR_KEYBOARD;
|
||||
|
@ -179,16 +181,6 @@ device_added(struct udev_device *udev_device)
|
|||
}
|
||||
}
|
||||
|
||||
/* construct USB ID in lowercase hex - "0000:ffff" */
|
||||
if (usb_vendor && usb_model) {
|
||||
attrs.usb_id = Xprintf("%s:%s", usb_vendor, usb_model);
|
||||
if (attrs.usb_id) {
|
||||
char *cur;
|
||||
for (cur = attrs.usb_id; *cur; cur++)
|
||||
*cur = tolower(*cur);
|
||||
}
|
||||
}
|
||||
|
||||
LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
|
||||
name, path);
|
||||
rc = NewInputDeviceRequest(options, &attrs, &dev);
|
||||
|
|
|
@ -2018,8 +2018,9 @@ ProcChangeKeyboardControl (ClientPtr client)
|
|||
keyboard = PickKeyboard(client);
|
||||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
|
||||
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
if ((pDev == keyboard ||
|
||||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
@ -2027,8 +2028,9 @@ ProcChangeKeyboardControl (ClientPtr client)
|
|||
}
|
||||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
|
||||
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
if ((pDev == keyboard ||
|
||||
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
|
||||
if (ret != Success)
|
||||
error = ret;
|
||||
|
@ -2088,7 +2090,8 @@ ProcBell(ClientPtr client)
|
|||
newpercent = base - newpercent + stuff->percent;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if ((dev == keybd || (!IsMaster(dev) && dev->u.master == keybd)) &&
|
||||
if ((dev == keybd ||
|
||||
(!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) &&
|
||||
dev->kbdfeed && dev->kbdfeed->BellProc) {
|
||||
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess);
|
||||
|
@ -2157,7 +2160,8 @@ ProcChangePointerControl(ClientPtr client)
|
|||
}
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
|
||||
if ((dev == mouse ||
|
||||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
dev->ptrfeed) {
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
|
||||
if (rc != Success)
|
||||
|
@ -2166,7 +2170,8 @@ ProcChangePointerControl(ClientPtr client)
|
|||
}
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
|
||||
if ((dev == mouse ||
|
||||
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||
dev->ptrfeed) {
|
||||
dev->ptrfeed->ctrl = ctrl;
|
||||
}
|
||||
|
@ -2336,7 +2341,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
|||
maxbuttons = max(maxbuttons, dev->button->numButtons);
|
||||
}
|
||||
|
||||
if (master->button->numButtons != maxbuttons)
|
||||
if (master->button && master->button->numButtons != maxbuttons)
|
||||
{
|
||||
int i;
|
||||
DeviceChangedEvent event;
|
||||
|
@ -2347,7 +2352,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
|||
|
||||
event.header = ET_Internal;
|
||||
event.type = ET_DeviceChanged;
|
||||
event.time = CurrentTime;
|
||||
event.time = GetTimeInMillis();
|
||||
event.deviceid = master->id;
|
||||
event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
|
||||
event.buttons.num_buttons = maxbuttons;
|
||||
|
|
|
@ -102,6 +102,15 @@ EventToCore(InternalEvent *event, xEvent *core)
|
|||
switch(event->any.type)
|
||||
{
|
||||
case ET_Motion:
|
||||
{
|
||||
DeviceEvent *e = &event->device_event;
|
||||
/* Don't create core motion event if neither x nor y are
|
||||
* present */
|
||||
if (!BitIsOn(e->valuators.mask, 0) &&
|
||||
!BitIsOn(e->valuators.mask, 1))
|
||||
return BadMatch;
|
||||
}
|
||||
/* fallthrough */
|
||||
case ET_ButtonPress:
|
||||
case ET_ButtonRelease:
|
||||
case ET_KeyPress:
|
||||
|
|
|
@ -286,7 +286,7 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
|||
{
|
||||
CARD8 keys_per_mod[8];
|
||||
int max_keys_per_mod;
|
||||
KeyCode *modkeymap;
|
||||
KeyCode *modkeymap = NULL;
|
||||
int i, j, ret;
|
||||
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
|
||||
|
@ -310,18 +310,20 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
|||
}
|
||||
}
|
||||
|
||||
modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
|
||||
if (!modkeymap)
|
||||
return BadAlloc;
|
||||
if (max_keys_per_mod != 0) {
|
||||
modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
|
||||
if (!modkeymap)
|
||||
return BadAlloc;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
keys_per_mod[i] = 0;
|
||||
for (i = 0; i < 8; i++)
|
||||
keys_per_mod[i] = 0;
|
||||
|
||||
for (i = 8; i < MAP_LENGTH; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
|
||||
modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
|
||||
keys_per_mod[j]++;
|
||||
for (i = 8; i < MAP_LENGTH; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
|
||||
modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
|
||||
keys_per_mod[j]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1095,7 +1095,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
|
|||
ev.header = ET_Internal;
|
||||
ev.length = sizeof(ev);
|
||||
ev.type = event->subtype;
|
||||
ev.corestate = butc->state;
|
||||
ev.corestate = butc ? butc->state : 0;
|
||||
if (master && master->key)
|
||||
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#include "xf86InPriv.h"
|
||||
#include "compiler.h"
|
||||
#include "extinit.h"
|
||||
#include "loaderProcs.h"
|
||||
|
||||
#ifdef DPMSExtension
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
|
||||
.\" shorthand for double quote that works everywhere.
|
||||
.ds q \N'34'
|
||||
.TH __xservername__ __appmansuffix__ __vendorversion__
|
||||
.SH NAME
|
||||
__xservername__ - X11R7 X server
|
||||
|
@ -440,6 +442,14 @@ Immediately kills the server -- no questions asked. It can be disabled by
|
|||
setting the
|
||||
.B DontZap
|
||||
__xconfigfile__(__filemansuffix__) file option to a TRUE value.
|
||||
.PP
|
||||
.RS 8
|
||||
It should be noted that zapping is triggered by the
|
||||
.B Terminate_Server
|
||||
action in the keyboard map. This action is not part of the default keymaps
|
||||
but can be enabled with the XKB option
|
||||
.B \*qterminate:ctrl_alt_bksp\*q.
|
||||
.RE
|
||||
.TP 8
|
||||
.B Ctrl+Alt+Keypad-Plus
|
||||
Change video mode to next one specified in the configuration file.
|
||||
|
|
|
@ -277,8 +277,9 @@ xf86OpenConsole(void)
|
|||
tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
|
||||
|
||||
/* need to keep the buffer clean, else the kernel gets angry */
|
||||
console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
|
||||
drain_console, NULL);
|
||||
if (xf86Info.allowEmptyInput)
|
||||
console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
|
||||
drain_console, NULL);
|
||||
|
||||
/* we really should have a InitOSInputDevices() function instead
|
||||
* of Init?$#*&Device(). So I just place it here */
|
||||
|
|
|
@ -161,6 +161,7 @@ char tmpname[PATH_MAX];
|
|||
}
|
||||
if (!in) {
|
||||
haveDir= FALSE;
|
||||
free(buf);
|
||||
buf = Xprintf(
|
||||
"'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg,
|
||||
XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long)
|
||||
|
@ -176,6 +177,7 @@ char tmpname[PATH_MAX];
|
|||
}
|
||||
if (!in) {
|
||||
haveDir= FALSE;
|
||||
free(buf);
|
||||
buf = Xprintf(
|
||||
"xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg,
|
||||
componentDirs[what],(long)
|
||||
|
@ -200,8 +202,7 @@ char tmpname[PATH_MAX];
|
|||
}
|
||||
if (!in)
|
||||
{
|
||||
if (buf != NULL)
|
||||
free(buf);
|
||||
free(buf);
|
||||
#ifdef WIN32
|
||||
unlink(tmpname);
|
||||
#endif
|
||||
|
@ -264,8 +265,7 @@ char tmpname[PATH_MAX];
|
|||
fclose(in);
|
||||
unlink(tmpname);
|
||||
#endif
|
||||
if (buf != NULL)
|
||||
free(buf);
|
||||
free(buf);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,8 @@ ProcXkbSelectEvents(ClientPtr client)
|
|||
masks = XkbFindClientResource((DevicePtr)dev,client);
|
||||
if (!masks){
|
||||
XID id = FakeClientID(client->index);
|
||||
AddResource(id,RT_XKBCLIENT,dev);
|
||||
if (!AddResource(id,RT_XKBCLIENT,dev))
|
||||
return BadAlloc;
|
||||
masks= XkbAddClientResource((DevicePtr)dev,client,id);
|
||||
}
|
||||
if (masks) {
|
||||
|
@ -3019,6 +3020,7 @@ register unsigned bit;
|
|||
to = (CARD8 *)wire;
|
||||
if ((to-map)!=length) {
|
||||
client->errorValue = _XkbErrCode2(0xff,length);
|
||||
free(map);
|
||||
return BadLength;
|
||||
}
|
||||
}
|
||||
|
@ -5377,7 +5379,8 @@ ProcXkbPerClientFlags(ClientPtr client)
|
|||
}
|
||||
else if (want && (!interest)) {
|
||||
XID id = FakeClientID(client->index);
|
||||
AddResource(id,RT_XKBCLIENT,dev);
|
||||
if (!AddResource(id,RT_XKBCLIENT,dev))
|
||||
return BadAlloc;
|
||||
interest= XkbAddClientResource((DevicePtr)dev,client,id);
|
||||
if (!interest)
|
||||
return BadAlloc;
|
||||
|
|
|
@ -806,6 +806,7 @@ ProcessInputProc backupproc;
|
|||
/* never actually used uninitialised, but gcc isn't smart enough
|
||||
* to work that out. */
|
||||
memset(&old, 0, sizeof(old));
|
||||
memset(&ev, 0, sizeof(ev));
|
||||
|
||||
if ((filter->keycode!=0)&&(filter->keycode!=keycode))
|
||||
return 1;
|
||||
|
|
|
@ -1045,15 +1045,6 @@ XkbInterestPtr interest;
|
|||
interest->dev = dev;
|
||||
interest->client = client;
|
||||
interest->resource = id;
|
||||
interest->stateNotifyMask= 0;
|
||||
interest->ctrlsNotifyMask= 0;
|
||||
interest->namesNotifyMask= 0;
|
||||
interest->compatNotifyMask= 0;
|
||||
interest->bellNotifyMask= FALSE;
|
||||
interest->accessXNotifyMask= 0;
|
||||
interest->iStateNotifyMask= 0;
|
||||
interest->iMapNotifyMask= 0;
|
||||
interest->altSymsNotifyMask= 0;
|
||||
interest->next = dev->xkb_interest;
|
||||
dev->xkb_interest= interest;
|
||||
return interest;
|
||||
|
|
|
@ -556,6 +556,7 @@ Bool checkNames;
|
|||
else if ((kf!=NULL)&&((kf->xkb_sli->flags&XkbSLI_IsDefault)!=0)) {
|
||||
XkbDescPtr xkb;
|
||||
xkb= dev->key->xkbInfo->desc;
|
||||
sli= kf->xkb_sli;
|
||||
sli->physIndicators= xkb->indicators->phys_indicators;
|
||||
if (xkb->names->indicators!=sli->names) {
|
||||
checkNames= TRUE;
|
||||
|
@ -584,6 +585,8 @@ Bool checkNames;
|
|||
sli->maps= NULL;
|
||||
sli->names= NULL;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
|
||||
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
|
||||
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
|
||||
|
@ -714,10 +717,12 @@ XkbSrvLedInfoPtr sli;
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
|
||||
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
|
||||
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
|
||||
sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
|
||||
if (sli) {
|
||||
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
|
||||
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
|
||||
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
|
||||
sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
|
||||
}
|
||||
return sli;
|
||||
}
|
||||
|
||||
|
|
|
@ -534,8 +534,7 @@ XkbAction *act;
|
|||
|
||||
case XkbSA_XFree86Private:
|
||||
/* copy the kind of action */
|
||||
strncpy((char*)act->any.data, (char*)wire.actionData,
|
||||
XkbAnyActionDataSize);
|
||||
memcpy(act->any.data, wire.actionData, XkbAnyActionDataSize);
|
||||
break ;
|
||||
|
||||
case XkbSA_Terminate:
|
||||
|
@ -687,7 +686,11 @@ int nRead=0;
|
|||
if ((tmp=XkmGetCountedString(file,buf,100))<1)
|
||||
return -1;
|
||||
nRead+= tmp;
|
||||
if ((buf[0]!='\0')&&(xkb->names)) {
|
||||
|
||||
if (!xkb->names)
|
||||
continue;
|
||||
|
||||
if (buf[0]!='\0') {
|
||||
Atom name;
|
||||
name= XkbInternAtom(buf,0);
|
||||
xkb->names->groups[i]= name;
|
||||
|
|
Loading…
Reference in New Issue
Block a user