From 676b26ca3e9b142cf007af3f439aa1993f2247c4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Nov 2007 17:54:17 +1030 Subject: [PATCH] Xi: notify the clients when the device hierarchy has been changed. --- Xi/chdevhier.c | 10 ++++++++++ Xi/extinit.c | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c index c916c0f47..338c07433 100644 --- a/Xi/chdevhier.c +++ b/Xi/chdevhier.c @@ -79,9 +79,11 @@ int ProcXChangeDeviceHierarchy(ClientPtr client) { DeviceIntPtr ptr, keybd; + DeviceIntRec dummyDev; xAnyHierarchyChangeInfo *any; int required_len = sizeof(xChangeDeviceHierarchyReq); char n; + deviceHierarchyChangedEvent ev; REQUEST(xChangeDeviceHierarchyReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceHierarchyReq); @@ -226,6 +228,14 @@ ProcXChangeDeviceHierarchy(ClientPtr client) any = (xAnyHierarchyChangeInfo*)((char*)any + any->length); } + ev.type = GenericEvent; + ev.extension = IReqCode; + ev.length = 0; + ev.evtype = XI_DeviceHierarchyChangedNotify; + ev.time = GetTimeInMillis(); + + SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask, + (xEvent*)&ev, 1); return Success; } diff --git a/Xi/extinit.c b/Xi/extinit.c index de2653f43..0ecb421f0 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -137,9 +137,8 @@ Mask ExtExclusiveMasks[EMASKSIZE]; * Evtype is index, mask is value at index. */ static Mask xi_filters[3] = { - XI_PointerKeyboardPairingChangedMask, - XI_RandomStringMask, - XI_RawDeviceEventMask, + XI_DeviceHierarchyChangedMask, + XI_RawDeviceEventMask, }; static struct dev_type