Commit Graph

653 Commits

Author SHA1 Message Date
Peter Hutterer
a88386ee27 Xi: only DeliverFocusedEvents if the event is not a pointer event.
A pointer device may have a focus class, but even if so, pointer events must
be delivered to the sprite window, not the focus window.
2008-04-10 14:42:26 +09:30
Peter Hutterer
bce6091c6b dix: Extend IsKeyboardDevice() to not include pointer devices.
If a pointer devices has key classes as well, don't register it as a keyboard
device. Let's see how much that change will break.
2008-04-10 09:59:45 +09:30
Peter Hutterer
cc7dab2d04 dix: Dont deliver grabbed pointer events to a focus window.
If an pointer event is being processed during a device grab, don't deliver it
to the focus window, even if the device has a focus class. Reason being that
some pointers may have a focus class, thus killing drag-and-drop.
2008-04-10 09:58:50 +09:30
Peter Hutterer
8e0a652930 dix: When floating, set sprite to NULL before calling InitializeSprite.
InitializeSprite won't create a new one if it already exists, with the result
of overwriting the master's sprite. This master sprite is then assigned to the
floating slave, and freed when the slave is reattached later.
Setting the sprite to NULL forces InitializeSprite to alloc a new one, and
this one can be freed without further repercussions.
2008-04-10 08:25:36 +09:30
Peter Hutterer
fd06e8f8c1 Merge branch 'master' into dcdc_rework
Conflicts:

	Xext/xevie.c
	dix/dispatch.c
2008-04-07 07:56:41 +09:30
Peter Hutterer
b46a009186 dix: sprite may be NULL, don't dereference it then.
In some rare cases (e.g. when the init fails) a device's sprite is NULL,
dereferencing it to xfree the spriteTrace is a bad idea then.
2008-04-06 09:02:57 +09:30
Peter Hutterer
638a50552e dix: remove debug error message about XI->core type conversion. 2008-04-06 08:36:21 +09:30
Ben Byer
c1be4e3379 shovelling code around ...
(cherry picked from commit 2143182ba4)
2008-04-02 17:47:59 -07:00
Adam Jackson
333e7123dc Fix that last commit.
I can apply patches, really.
2008-03-25 12:48:22 -04:00
Sascha Hlusiak
e7a3644255 Fix getValuatorEvents to compute number of valuators correctly. 2008-03-25 12:32:33 -04:00
Eamon Walsh
056a2ce02c XACE: Check the return value of the selection create hook call. 2008-03-04 02:44:48 -05:00
Peter Hutterer
4f2cd0ed96 Merge branch 'master' into mpx
This merge reverts Magnus' device coorindate scaling changes. MPX core event
generation is very different, so we can't scale in GetPointerEvents.

Conflicts:

	Xi/opendev.c
	dix/devices.c
	dix/dixfonts.c
	dix/getevents.c
	dix/resource.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	mi/mipointer.c
	xkb/ddxBeep.c
	xkb/ddxCtrls.c
	xkb/ddxKeyClick.c
	xkb/ddxList.c
	xkb/ddxLoad.c
	xkb/xkb.c
	xkb/xkbAccessX.c
	xkb/xkbEvents.c
	xkb/xkbInit.c
	xkb/xkbPrKeyEv.c
	xkb/xkbUtils.c
2008-03-04 18:11:10 +10:30
Eamon Walsh
72f2197545 dix: Convert selection list to a linked list.
Fixes a bug where pointers were being invalidated after a realloc.
2008-03-04 02:14:34 -05:00
Eamon Walsh
cc76ea6e3a XACE: Add generic support for property and selection polyinstantiation. 2008-02-29 18:01:37 -05:00
Eamon Walsh
34bf308a9e dix: Refactoring of selection code to allow for polyinstantiation.
Introduces dixLookupSelection() API.
Removes NumCurrentSelections from API.
2008-02-29 18:01:37 -05:00
Eamon Walsh
d5715f7bea dix: Refactoring of property code to allow for polyinstantiation.
Introduces dixLookupProperty() API.
2008-02-29 18:01:37 -05:00
Adam Jackson
c0e1959f28 On second thought, revert that, it'll make large pixmaps painfully slow.
Need to just fix the callers.
2008-02-29 16:45:11 -05:00
Chris Wilson
4a44fe7c86 Bug #10465: Use calloc() for allocating PixmapRec's. 2008-02-29 16:43:14 -05:00
Chris Wilson
5d5fcc7198 Bug #10464: Set pixel value to 0 before FindColor() 2008-02-29 16:42:04 -05:00
Peter Hutterer
2257e20900 dix: set dev->key to NULL after freeing it in CloseDevice. (Bug #12830)
Otherwise XkbRemoveResourceClient may try to dereference it lateron.

X.Org Bug 12830 <http://bugs.freedesktop.org/show_bug.cgi?id=12830>
2008-02-27 17:32:29 +10:30
Peter Hutterer
23ae68a4c7 dix: before copying the classes the first time, set the VCK's classes to NULL.
XkbFinishDeviceInit does the following:
  xkbi->kbdProc= pXDev->kbdfeed->CtrlProc;
  pXDev->kbdfeed->CtrlProc= XkbDDXKeybdCtrlProc;

If we directly copy the device classes for the VCK, pXDev->kbdfeed->CtrlProc
at the time of copying is still XbkDDXKeybdCtrlProc. So at some point
XkbDDXKeybdCtrlProc is called, and calls itself, and calls itself, and...

Setting the device's classes to NULL seems to fix things. The memory isn't
lost, it gets stored into the devPrivates and freed at device closing time.
2008-02-26 15:35:28 +10:30
Peter Hutterer
27b2127893 Xi: remove ungrab handling of ExtendedUngrabDevice request.
This can be done by UngrabDevice, no need for separate codepaths.
2008-02-25 17:00:42 +10:30
Eamon Walsh
f343265a28 XACE: Make the default window background state configurable per-window.
To recap: the original XC-SECURITY extension disallowed background "None" if
the window was untrusted.  XACE 1.0 preserved this check as a hook function.
XACE pre-2.0 removed the hook and first abolished background "None entirely,
then restored it as a global on/off switch in response to Bug #13683.
Now it's back to being per-window, via a flag instead of a hook function.
2008-02-20 15:59:40 -05:00
Eamon Walsh
7c2f0a8bef Remove COMPOSITE ifdefs around WindowRec bitfield as it has no ABI effect. 2008-02-20 15:59:39 -05:00
Peter Hutterer
f14a62f823 dix: set evlen to the size of the reallocated memory.
What a good idea this is... I'm very proud of myself.
2008-02-19 21:44:10 +10:30
Peter Hutterer
750d702676 dix: Ensure enough memory for ClassesChangedEvent for a new device.
Before we enable the device through the driver, we size it up and make sure
that the events in the event list contain enough bytes for a possible
ClassesChangedEvent lateron.
2008-02-19 17:23:51 +10:30
Peter Hutterer
74628d6397 dix: change GetEventList to return length of list and set parameter in place.
Changing DDXs to use new prototype too.
2008-02-19 16:53:15 +10:30
Peter Hutterer
77dba004a9 dix: add InputEventListLen and SetMinimumEventSize
The latter is used to increase the amount of allocated memory for the event
list. This will be needed for ClassesChangedEvents that can be of more or less
arbitrary size (larger than 32 anyway).
2008-02-19 15:52:35 +10:30
Peter Hutterer
3fe64d8d27 Move input event list initialisation and storage from DDX to DIX.
Rather than letting the DDX allocate the events, allocate them once in the DIX
and just pass it around when needed.

DDX should call GetEventList() to obtain this list and then pass it into
Get{Pointer|Keyboard}Events.
2008-02-18 18:46:01 +10:30
Peter Hutterer
09a8fc5c7a Xi: make SizeDeviceInfo public and re-use from CreateClassesChangedEvent. 2008-02-18 18:42:46 +10:30
Peter Hutterer
6d9d18bf77 dix: add support for WindowAccessAllowAll in device access checking.
AllowAll is the last check before the parent window is checked. This allows
to override a DenyAll in the parent window in a simpler way than before (the
previous method required all devices to be in the permit list).
2008-02-18 17:25:15 +10:30
Benjamin Close
660739c6bc dix: Handle the case where a device cursor was removed correctly
In the case that the device cursor was the first in the list of cursors
the window knew about, unsetting the cursor could lead to a segfault
due to pPrev being NULL. Instead catch the condition and correctly remove
the node from the list. Since there is no cursor now set on the device,
we simply return success as the parent windows cursor will propogate
down later.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-02-18 16:39:19 +10:30
Peter Hutterer
24db282301 dix: set num_events to 1 by default. (no RawDeviceEvents anymore)
This should have been part of acb412d539.
2008-02-18 16:16:19 +10:30
Daniel Stone
37867626e3 main(): Remove uncredible failure
NO, NO, NO.

NO.

The only way this could possibly be worse is if you were viewing it in
Comic Sans.
2008-02-17 22:52:06 +02:00
Eamon Walsh
ae43d835bd XACE: Change access modes for some device-related requests.
Opening a device is not really "reading" it.
Requests that globally configure a device should require "manage" access.
2008-02-13 20:20:49 -05:00
Peter Hutterer
acb412d539 dix: Don't generate RawDeviceEvents anymore.
These events have been removed from the protocol pending some more refinement
and more thoughtful integration.
2008-02-14 09:29:50 +10:30
Adam Jackson
b740b865e4 Silence an error message in ConfigureWindow that never happens. 2008-02-14 07:51:33 +11:00
Adam Jackson
89d3249c3e Silence FreeResource() 2008-02-14 07:51:29 +11:00
Adam Jackson
9113fa3de3 Silence the harmless FreeFontPath error message. 2008-02-14 07:12:24 +11:00
Adam Jackson
7c0709a736 requestingClient is an xprintism, hide it for other servers. 2008-02-14 07:11:52 +11:00
Adam Jackson
2ce35f6d45 Simplify critical output flushing. 2008-02-14 07:07:51 +11:00
Adam Jackson
aa5216e897 Rip out useless indirection in the callback list management. 2008-02-14 07:02:13 +11:00
Eamon Walsh
0d492b2166 XACE: Move the selection access hook to its own function. 2008-02-12 19:59:10 -05:00
Eamon Walsh
de16a8c530 XACE: Correct some protocol error values in the colormap routines. 2008-02-07 20:14:16 -05:00
Eamon Walsh
bb1a577a68 XACE: Move the property access hook to its own function. 2008-02-05 20:07:08 -05:00
Magnus Vigerlöf
a56ef7aaa4 dix: Move motion history update until after screen crossing and clipping
Cross screen and clip the coordinates before updating the motion history
so that it will have the same contents as the events that are reported.
2008-02-05 21:12:52 +01:00
Magnus Vigerlöf
a0284d577a dix: Skip call to clipAxis for relative core-events
Relative events that generates both core and extention
events will have its axis cliped and screen changed by
miPointerSetPosition when the events are processed. For
absolute and non core-generating relative events the
axis must be clipped if we shouldn't end up completely
outside the defined ranges (if any).
2008-02-05 21:12:52 +01:00
Magnus Vigerlöf
d9e23c4ff1 Bug # 10324: dix: Add scaling of X and Y on the reported pointer-events
Restore the rescaling code for x and y axis when generating
motion events.
2008-02-05 21:12:52 +01:00
Magnus Vigerlöf
f04c083869 Bug # 10324: dix: Allow arbitrary value ranges in GetPointerEvents
Don't use a possitive value as a marker for if a max-value
is defined on the valuators. Use the existence of a valid
value range instead. This will also make it possible to
define arbitrary start and end-values for min and max as
long as min < max.
2008-02-05 21:12:52 +01:00
Magnus Vigerlöf
12e5324032 dix: Always add valuator information if present
Send valuator information for all event types, not only for
MotionEvents and absolute button events.
2008-02-05 21:12:52 +01:00