@@ -122,6 +122,7 @@ SOFTWARE.
122
122
#include "xiqueryversion.h"
123
123
#include "xisetclientpointer.h"
124
124
#include "xiwarppointer.h"
125
+ #include "xibarriers.h"
125
126
126
127
/* Masks for XI events have to be aligned with core event (partially anyway).
127
128
* If DeviceButtonMotionMask is != ButtonMotionMask, event delivery
@@ -251,7 +252,8 @@ static int (*ProcIVector[]) (ClientPtr) = {
251
252
ProcXIChangeProperty , /* 57 */
252
253
ProcXIDeleteProperty , /* 58 */
253
254
ProcXIGetProperty , /* 59 */
254
- ProcXIGetSelectedEvents /* 60 */
255
+ ProcXIGetSelectedEvents , /* 60 */
256
+ ProcXIBarrierReleasePointer /* 61 */
255
257
};
256
258
257
259
/* For swapped clients */
@@ -316,7 +318,8 @@ static int (*SProcIVector[]) (ClientPtr) = {
316
318
SProcXIChangeProperty , /* 57 */
317
319
SProcXIDeleteProperty , /* 58 */
318
320
SProcXIGetProperty , /* 59 */
319
- SProcXIGetSelectedEvents /* 60 */
321
+ SProcXIGetSelectedEvents , /* 60 */
322
+ SProcXIBarrierReleasePointer /* 61 */
320
323
};
321
324
322
325
/*****************************************************************
@@ -839,6 +842,32 @@ STouchOwnershipEvent(xXITouchOwnershipEvent * from, xXITouchOwnershipEvent * to)
839
842
swapl (& to -> child );
840
843
}
841
844
845
+ static void
846
+ SBarrierEvent (xXIBarrierEvent * from ,
847
+ xXIBarrierEvent * to ) {
848
+
849
+ * to = * from ;
850
+
851
+ swaps (& from -> sequenceNumber );
852
+ swapl (& from -> length );
853
+ swaps (& from -> evtype );
854
+ swapl (& from -> time );
855
+ swaps (& from -> deviceid );
856
+ swaps (& from -> sourceid );
857
+ swapl (& from -> event );
858
+ swapl (& from -> root );
859
+ swapl (& from -> root_x );
860
+ swapl (& from -> root_y );
861
+
862
+ swapl (& from -> dx .integral );
863
+ swapl (& from -> dx .frac );
864
+ swapl (& from -> dy .integral );
865
+ swapl (& from -> dy .frac );
866
+ swapl (& from -> dtime );
867
+ swapl (& from -> barrier );
868
+ swapl (& from -> eventid );
869
+ }
870
+
842
871
/** Event swapping function for XI2 events. */
843
872
void
844
873
XI2EventSwap (xGenericEvent * from , xGenericEvent * to )
@@ -885,6 +914,11 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
885
914
case XI_RawTouchEnd :
886
915
SRawEvent ((xXIRawEvent * ) from , (xXIRawEvent * ) to );
887
916
break ;
917
+ case XI_BarrierHit :
918
+ case XI_BarrierLeave :
919
+ SBarrierEvent ((xXIBarrierEvent * ) from ,
920
+ (xXIBarrierEvent * ) to );
921
+ break ;
888
922
default :
889
923
ErrorF ("[Xi] Unknown event type to swap. This is a bug.\n" );
890
924
break ;
@@ -1263,6 +1297,9 @@ XInputExtensionInit(void)
1263
1297
if (!AddCallback (& ClientStateCallback , XIClientCallback , 0 ))
1264
1298
FatalError ("Failed to add callback to XI.\n" );
1265
1299
1300
+ if (!XIBarrierInit ())
1301
+ FatalError ("Could not initialize barriers.\n" );
1302
+
1266
1303
extEntry = AddExtension (INAME , IEVENTS , IERRORS , ProcIDispatch ,
1267
1304
SProcIDispatch , IResetProc , StandardMinorOpcode );
1268
1305
if (extEntry ) {
0 commit comments