Commit Graph

288 Commits

Author SHA1 Message Date
Peter Hutterer
d4dad6f84f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/events.c
	hw/xfree86/common/xf86Xinput.c
2007-04-12 11:11:03 +09:30
Magnus Vigerlöf
4f05f9591e Input: Always add devices with first available ID
Scan the device list when adding a new device, and make sure we can use
the first available ID, instead of always incrementing.
2007-04-10 23:58:20 +03:00
Magnus Vigerlöf
07c56abf84 Input: Plug memory leak in device free
Remember to also free the motion history, if we're using the DIX-managed
history.
2007-04-10 23:58:20 +03:00
Daniel Stone
e92743bc98 getevents: Copy modifier state from extended to core devices
Make core events carry the same modifier state as the extended events, so
that holding down Ctrl on keyboard A and pressing Q on keyboard B won't
cause your app to quit.
2007-04-10 23:58:20 +03:00
Stefan Huehner
1f6741db19 Bug #10560: Code-Cleanup: function declarations () -> (void)
X.Org Bugzilla #10560: <https://bugs.freedesktop.org/show_bug.cgi?id=10560>
Patch #9511 <https://bugs.freedesktop.org/attachment.cgi?id=9511>
2007-04-09 14:33:15 -07:00
Peter Hutterer
f1f8b562aa Alloc sprite memory in devices' devPrivates, allow undisplaying cursors.
Improve memory usage by allocating the sprite's memory only to devices that
actually have a sprite and provide means to remove a device's cursor from the
screen (more hotplugging, yay!).
This commit breaks ScreenRec's ABI.
2007-04-09 19:31:59 +09:30
Peter Hutterer
7cef789fa1 Close down virtual core devices when closing all devices. 2007-04-09 18:37:48 +09:30
Peter Hutterer
6081b8c76f Don't explicitly init sprite for VCP, EnableDevice() will take care of that. 2007-04-09 18:35:47 +09:30
Peter Hutterer
00b1d52f41 Adding some comments to devices.c. 2007-04-09 18:32:00 +09:30
Peter Hutterer
aa77ffb510 Fix: pick new ClientPointer when device is closed. 2007-04-09 18:29:00 +09:30
Peter Hutterer
676188531b Unrealize cursor only once, not per device. 2007-04-04 17:35:06 +09:30
Peter Hutterer
207f710d16 Delete all grabs from all devices when deleting a window. 2007-04-03 19:02:14 +09:30
Peter Hutterer
5f382c9c7f Merge branch 'master' into mpx 2007-04-03 15:07:18 +09:30
Peter Hutterer
f09ee168e2 Revert "o fix minor error in comment for GetPointerEvents()"
This reverts commit 96ce17aa94.
2007-04-03 15:07:00 +09:30
Peter Hutterer
9b0b340668 Make GrabDevice differ between core grabs and device grabs. 2007-04-03 15:06:26 +09:30
Peter Hutterer
e8777a91f3 Merge branch 'master' into mpx
Conflicts:

	Xi/closedev.c
	Xi/exevents.c
	Xi/extinit.c
	Xi/listdev.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	include/extinit.h
	mi/mipointer.c
2007-04-02 15:36:26 +09:30
Peter Hutterer
96ce17aa94 o fix minor error in comment for GetPointerEvents() 2007-04-02 11:30:47 +09:30
Peter Hutterer
63d8f01819 dix: Fix wrong cursor refcount.
Calloc cursor struct to ensure devPrivates are zeroed out and don't
        increase the refcnt for devices automatically when allocating a new
        cursor. Use new DeviceIsPointerType() to detect if device is a pointer
        _before_ device has been activated and can thus be identified and set
        up grab functions accordingly. This way we can increase the refcnt
        when we get a pointer grab.
2007-03-30 14:59:43 +09:30
Peter Hutterer
20e4314b17 dix: Try to get closer to the correct refcnt for cursors.
This commit introduces a memory leak, as the refcnt never seems to get
        down to 0 and thus cursors will not be freed. Solves the problems with
        GNOME segfaulting every 30 seconds though.
2007-03-29 19:12:32 +09:30
Peter Hutterer
0c607f4b19 dix: Pick keyboard instead of using virtual keyboard in Grab/UngrabKey. 2007-03-29 14:43:50 +09:30
Eamon Walsh
f7c5aa0dc0 Remove dead NEED_DBE_BUF_BITS code. 2007-03-26 10:21:44 -04:00
Adam Jackson
4b5802ddbd General DIX static and dead code cleanup. 2007-03-25 17:57:54 -04:00
Adam Jackson
9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
Peter Hutterer
ac2356843e dix: Increase allocation size for core keyboard keymap to avoid buffer overrun when copying keymap from extension devices. 2007-03-25 15:24:47 +09:30
Peter Hutterer
5f9c10e8da Clean up DeviceIntPtr, prepare for Server 1.4 ABI. Move sprite-related
information into a new SpriteInfoRec, remove isMPDev flag.
2007-03-25 15:00:03 +09:30
Peter Hutterer
e54311395e dix: Increase allocation size for core keyboard keymap to avoid buffer
overrun when copying keymap from extension devices.
2007-03-25 09:41:33 +09:30
Peter Hutterer
f8cd19bd16 Xi: add GetClientPointer and GetPointerPairing requests.
dix:    use PickKeyboard for ProcSetInputFocus and ProcGetInputFocus instead
        of the core keyboard.
2007-03-22 17:47:01 +10:30
Adam Jackson
021fc5cb2c Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as
include/xkbsrv.h, and the world updated to look for it in the new place,
since it made no sense to define server API in an extension header.  Any
further work along this line will need to do similar things with XKBgeom.h
and friends.
2007-03-20 18:37:02 -04:00
Peter Hutterer
0acf993e28 dix: Move sprite initalization/pairing from ActivateDevice to
EnableDevice.
        zero out spriteTrace, otherwise GetCurrentRootWindow() may return
        invalid data.

        Evdev adds previously hotplugged devices on its own when rescanning,
        and ActivateDevice does not get called for those devices. Sprites need
        to be initialized or paired before the device gets started, so the
        safest place to do so is EnableDevice (which actually does get called
        by the evdev driver).
2007-03-19 16:11:01 +10:30
Peter Hutterer
015d728bcd Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	dix/events.c
	mi/misprite.c
2007-03-19 09:42:56 +10:30
Peter Hutterer
b167583fe2 o fix minor error in comment for GetPointerEvents() 2007-03-16 15:58:05 +10:30
Peter Hutterer
65b0eb60b0 Xi: move IsPointerDevice into dix.
dix:    IsPointerDevice and IsKeyboardDevice, use same ways to identify type
        of device as XI does for the XListInputDevices reply.
        Autopair each non-pointer device with VCP when activating, pair with
        real device after activation.
        Don't return non-keyboard devices when calling GetPairedKeyboard or
        PickKeyboard, otherwise we segfault for 'evdev brain'.
2007-03-16 15:52:24 +10:30
Peter Hutterer
456f429ad6 dix: fix: don't return when device is same as argument.
fix: set access default rule to 0 on init.
2007-03-15 21:48:19 +10:30
Peter Hutterer
c3eb248cf9 dix: fix: don't skip first item in list when seeking for a device cursor. 2007-03-14 13:21:33 +10:30
Peter Hutterer
ce9409aceb dix: Get the state from the paired device and the real device to fill the
state field in the event, rather than using the virtual devices.
        ProcessPointerEvent: name argument "device" instead of "other".
        Add GetPairedKeyboard().
2007-03-13 19:16:56 +10:30
Peter Hutterer
577464af43 dix: restore commit b3b2a6a0d4 that for some
reason got wiped.
        fix ProcGrabKeyboard to use PickKeyboard
        fix PickKeyboard to actually work.
2007-03-09 17:13:05 +10:30
Peter Hutterer
07806f4081 Xi: Add SetClientPointer request handling. 2007-03-09 15:45:25 +10:30
Peter Hutterer
b3b2a6a0d4 dix: Check if client has a grab on any other device before mouse/kbd
event is delivered to the client. Client's don't cope well with
        receiving core events from other devices when having a grab on a
        pointer or keyboard.
2007-03-08 22:16:17 +10:30
Peter Hutterer
63169ce52d dix: remove 'register' keyword for all variables. 2007-03-08 17:50:25 +10:30
Peter Hutterer
ceca5670fe dix: Each device needs to differ between a core grab and an XI grab,
otherwise a Xi grab may overwrite or release a core grab.
        Replace grab and associates with coreGrab and deviceGrab structures,
        adjust rest of dix/Xi/etc to compile.

xfree86: Don't check for core devices, we'll have the virtual ones anyway.
         If we check, the first mouse device is duplicated and sends
         double events.
2007-03-08 17:17:23 +10:30
Eamon Walsh
b5fde366e2 Properly free device devPrivates - memory leak fix. 2007-03-07 12:29:55 -05:00
Peter Hutterer
537bc2ead4 Xi: Don't deactivate core grabs from non-core button/key releases.
dix:    set coreGrab flag for grabs caused by GrabPointer and button presses.
        remove virtual core devices from device list, only real devices are in
        the list now.
        Auto-pair each keyboard with a real pointer if one is available,
          provides multiple keyboards automatically after startup if devices
          are configured.
        fix GuessFreePointerDevice() to do what it's supposed to do.

mi:     fix: call miPointerMove from miPointerWarpCursor.
        fix: remove unused id field from miCursorInfoRec
        don't update sprite for virtual core pointer.
2007-03-07 18:19:20 +10:30
Eamon Walsh
81526232bc remove PIXPRIV check as this flag is always set. 2007-03-06 17:19:11 -05:00
Eamon Walsh
a7cd53deb9 remove PIXPRIV checks as this flag is always set. 2007-03-06 17:05:03 -05:00
Peter Hutterer
39aa791771 dix: Add GuessFreePointerDevice(). Runs through device list and tries to
find a pointer that hasn't been paired yet.

xfree86:  Use GuessFreePointerDevice() for newly connected non-sprite devices.
2007-03-05 15:31:16 +10:30
Peter Hutterer
1f0075786f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/getevents.c
	hw/xfree86/ramdac/xf86Cursor.c
	mi/mipointer.c
	xkb/xkbUtils.c
2007-03-05 12:37:17 +10:30
Peter Hutterer
12175b668a o fix minor error in comment for GetPointerEvents() 2007-03-03 13:57:39 +10:30
Peter Hutterer
57aa5e908d dix, Xext, Xtrap, Xi: replace inputInfo.pointer with PickPointer where
possible. More replacements to come.
2007-03-02 17:14:37 +10:30
Peter Hutterer
e43b8a4e40 dix: Add ClientPointer to client, used for picking which pointer to use in
ambiguious request. PickPointer and PickKeyboard are used for getting
        the appropriate pointer when situation is unclear.
        Fix some issues with InitializeSprite.

dix, xfree86: Remove last traces of InitSprite.
2007-03-02 15:21:46 +10:30
Peter Hutterer
43bd35fcf8 dix: Remove InitSprite, work can be done by InitializeSprite.
Free sprite struct if a spriteOwner is paired.

xfree86: Use PairDevices instead of passing booleans around when creating a
         sprite.

Xext:    Switch back to using LookupPointer/KeyboardDevice instead of
         inputInfo.xyz.
2007-03-01 17:19:37 +10:30