Commit Graph

828 Commits

Author SHA1 Message Date
Peter Hutterer
f5ac98747d Standardise copyright headers for all new files created as part of MPX. 2008-04-25 14:50:24 +09:30
Peter Hutterer
89add4ee98 dix: remove obsolete InitWindowPrivates(). 2008-04-25 14:30:26 +09:30
Peter Hutterer
dcdc66fcfc dix: add mi.h include to stop compiler warning 2008-04-25 14:30:06 +09:30
Peter Hutterer
97552413d2 dix: remove "unused variable" compiler warning. 2008-04-25 14:29:46 +09:30
Peter Hutterer
d9c38e84cc dix: remove pairingClient definition.
This variable was used originally to determine which client is allowed to
change the pointer-keyboard pairing. For now, we just let anyone change it and
see how that works out.
2008-04-25 14:29:26 +09:30
Peter Hutterer
aec485f2dc dix: NULL out WindowTable after freeing all the windows.
CloseDownDevices() tries to send PresenceNotify events. If the windows are
already freed, then we are accessing dangling pointers.
2008-04-24 14:19:28 +09:30
Peter Hutterer
c3659cb414 dix: always send FocusIn events if mode is NotifyUngrab.
In the case of a NotifyUngrab, the flag for the device may already be set but
we still need to send the FocusIn event.
2008-04-23 14:22:21 +09:30
Ross Burton
3848422d23 Fix build when XKB is disabled. 2008-04-22 16:25:23 +01:00
Peter Hutterer
8190ef8754 Merge branch 'master' into mpx
Conflicts:

	Xext/EVI.c
	Xext/appgroup.c
	Xext/cup.c
	Xext/mitmisc.c
	Xext/sampleEVI.c
	dix/window.c
2008-04-22 18:04:05 +09:30
Jeremy Huddleston
8822110d7d Fixed dixLookupClient to work with client=NullClient as it did in the 1.3 branch
(cherry picked from commit e41ccc6470)
(cherry picked from commit ce5a5f9399)
2008-04-21 20:09:20 -07:00
Adam Jackson
eafaf40fb3 Death to APPGROUP. 2008-04-18 18:50:05 -04:00
Peter Hutterer
3b93631e59 dix: remove coreOnly check. Core pointer must generate XI events now.
This flag was only used when an event is generated by Warp[Device]Pointer.
Since the VCP now happily generates core events, this flag is obsolete.
2008-04-18 14:39:45 +09:30
Ben Byer
fa0645b452 removed Xquartz debugging code that leaked into master. Our Bad. 2008-04-17 12:27:12 -07:00
Drew Parsons
966ae1781f Create dix/libXpdix.la for Xprint-specific build of libdix.la
(cherry picked from commit 4e2c6dbabdbbaaca213fd08edd422de15d0900cc)

required because of commit 7c0709a736,
which made requestingClient in dix specific to Xprint only.
Add to XPRINT_LIBS in hw/xprint/Makefile.am in front of
$(XSERVER_LIBS) to override definitions in libdix.la for standard xservers.

Follows 571206832d (providing -DXPRINT
to xprint subdirs).

Note it may be possible to restructure the code so that
requestingClient is stored elsewhere than in dix. See discussions
following http://lists.freedesktop.org/archives/xorg/2008-March/033844.html
If this is done it may be possible to revert this commit (if not 571206...).
2008-04-18 01:20:36 +10:00
Peter Hutterer
51c8fd69ec dix: free the unused device classes when closing a device.
This also requires to NULL-ify all pointers while we're actually using them,
otherwise we'd try to free them twice.
2008-04-15 15:09:40 +09:30
Peter Hutterer
48d33ab9b6 dix: float attached devices _before_ disabling the master.
It also helps if we're actually providing the correct argument to
AttachDevice...
2008-04-15 14:29:53 +09:30
Peter Hutterer
1a9d7205cd Merge whot@wombat:~/potoroo/xserver into mpx 2008-04-14 16:25:58 +09:30
Peter Hutterer
cb48d88085 Xi: store unused classes in devPrivates.
Rather than freeing/allocing classes each time the device capabilities need to
swap, store them in the devPrivates system.
When a class is unused, it is pushed into the devPrivates, and later recovered
when needed again. This saves us a lot of memory allocations/frees, admittedly
on the cost of some memory.
2008-04-13 19:48:28 +09:30
Peter Hutterer
755f9e5d78 dix: Ignore focus for passive grabs if the event is a pointer event. 2008-04-13 16:59:53 +09:30
Peter Hutterer
6d22a9615a dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418)
The DDX (xfree86 anyway) maintains its own device list in addition to the one
in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the
server then restarts (last client disconnects), the DDX devices are still
there, will be re-initialised, then the hal devices come in and are added too.
This repeats until we run out of device ids.

This also requires us to strdup() the default pointer/keyboard in
checkCoreInputDevices.

X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418>
2008-04-11 18:45:32 +09:30
Peter Hutterer
90f491cf8e Merge whot@wombat:~/potoroo/xserver into mpx 2008-04-11 08:29:52 +09:30
Peter Hutterer
b4380d8030 dix: don't free MDs classes on init.
The device classes aren't deleted anymore on a class change, so there's no
need to store the MD's original classes. We should however restore the MD to
sane defaults when disconnecting the last device, consider this as TODO item.
2008-04-10 19:25:43 +09:30
Peter Hutterer
04dff74ffd dix: Rework Enter/Leave semaphore system.
Instead of a simple counter, use bits to keep track of which device is where
etc. When device enters a window (or sets focus), the bit matching the device
is set, when it leaves again, it is unset. If there are 0 bits set, then
Leave/Enter/Focus events may be sent to the client.

Same theory as before, but this should get around the insanity with
Grab/Ungrab special cases. Those cases are basically untested though.
2008-04-10 19:22:59 +09:30
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
Jeremy Huddleston
3f51f493b6 XQuartz: Fix issue where clicking on an X11 window might send that event to an X11 window in another space.
(cherry picked from commit df21312c8b)
(cherry picked from commit 2d4194a8d1)
2008-04-08 17:03:18 -07:00
Magnus Vigerlöf
5ffbcfec3d dix: Ensure Proximity events don't kill the server.
Add Prox events to the if-clauses with the other events
that are usually sent from the input devices.
Ensure that the event deliverers won't try to deliver
events of type '0' (some extended events doesn't have
an equivalent core-type)

Small modification by Peter Hutterer.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-04-08 14:43:22 +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
Peter Hutterer
1692dcf197 dix: print out event type if a bogus pointer event occurs. 2008-01-30 13:04:58 +10:30
Peter Hutterer
0ac1755977 Merge branch 'master' into mpx
Conflicts:

	Xext/sampleEVI.c
2008-01-26 13:55:07 +10:30
Eamon Walsh
7724c30a75 XACE: Stop using fake requestVectors in favor of a simple hook call. 2008-01-25 17:28:17 -05:00
Peter Hutterer
379f057646 Xext: add GEDeviceMaskIsSet (GE mask checking per device)
If a mask was set for the NULL device, then we pretend the mask is set for all
devices.
2008-01-25 10:27:26 +10:30
Peter Hutterer
ba315ae5dd Xi: add XACE hooks for device creation (ChangeDeviceHierarchy)
AddInputDevice checks for permissions already, so all we do is modify a few
callers to let AID sort it out.
2008-01-21 23:44:07 +10:30
Peter Hutterer
6492d513c0 dix: if a client has a core grab, return the grab device on QueryPointer.
The correct thing would be to return the ClientPointer. However, if the client
for some reason has a core grab on another device (e.g. as result of a passive
grab), return the coordinates of the grabbed device instead.

This makes the use of nautilus a bit saner.
2008-01-18 21:44:22 +10:30
Peter Hutterer
cd2ad4c2ed dix: remove some superfluous lines in ProcChangeActivePointerGrab. 2008-01-18 20:11:55 +10:30
Peter Hutterer
8a925d201e dix: free the genericMasks when ungrabbing.
This finally plugs a memory hole created by grabs registering for generic
events.
2008-01-18 20:07:20 +10:30
Peter Hutterer
d323fd6420 dix: remove inputInfo.pointer refernce in EventSelectForWindow
If the window being changed is set as the motion hint window for any device,
the device's motion hint window is set to NULL. Which is kinda what the old
code did, except that it did it with only the VCP.
2008-01-18 19:18:07 +10:30
Peter Hutterer
883811c2be dix: remove inputInfo.pointer reference in TryClientEvents.
Unfortunately, this requires a change in the TCE API, and thus a change in all
callers. Tough luck.
2008-01-18 18:48:46 +10:30
Matthieu Herrb
8e133d9674 Fix for CVE-2008-0006 - PCF Font parser buffer overflow. 2008-01-17 15:29:06 +01:00
Kristian Høgsberg
a6a7fadbb0 Don't break grab and focus state for a window when redirecting it.
Composite uses an unmap/map cycle to trigger backing pixmap allocation
and cliprect recomputation when a window is redirected or unredirected.
To avoid protocol visible side effects, map and unmap events are
disabled temporarily.  However, when a window is unmapped it is also
removed from grabs and loses focus, but these state changes are not
disabled.

This change supresses the unmap side effects during the composite
unmap/map cycle and fixes this bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=488264

where compiz would cause gnome-screensaver to lose its grab when
compiz unredirects the fullscreen lock window.
2008-01-16 21:56:08 -05:00
Peter Hutterer
b0bf4308ac dix: print out an error when core type can't be converted.
Helps a bit in tracking down bugs.
2008-01-15 19:15:09 +10:30
Peter Hutterer
32aa252e98 dix: Process an input event as a single event, instead of two separate ones.
This is a significant shift in how input events are perceived. The common
approach was to treat a core event as a different entity than the XI event.
This could result in the XI event being delivered to a different client than
the core event. This doesn't work nicely if they come from the same device.

Instead, we treat an input event as a single event, that is delivered through
two separate APIs. So when delivering an event, we first try the XI event,
then the core event. If the window want's neither, we go to the parent and
repeat. Once either core or XI has been delivered, the processing stops.

Important: Different to the previous method, if a client registers for core
button events, the parent window will not get XI events. This should only
cause problems when you're mixing core and XI events, so don't do that!

Generic events don't fit into this yet, they cause me headaches.
2008-01-15 18:41:51 +10:30
Peter Hutterer
0969a9f749 dix: Emulate core events within CheckDeviceGrabs and ComputeFreezes.
This should restore the correct passive grab processing. When checking for
passive grabs, the core event is emulated and we check first for XI grabs on
the window, then for core grabs. Regardless of which event activates the grab,
the XI event is stored in the device's EQ.

When replaying the event, we take the XI event and replay it on the next
window, again including the emulation of the core event.
2008-01-15 11:31:12 +10:30
Peter Hutterer
a83a0c5a14 dix: remove obsolete comment.
Pairings don't exist anymore and the documented issue is a non-issue now.
2008-01-13 16:14:29 +10:30
Peter Hutterer
38bf01bd1c Merge branch 'master' into mpx 2008-01-10 13:38:46 +10:30
Peter Hutterer
4e85c7c322 Xi: keep a counter of buttons down to avoid duplicate press/release events.
If two devices are attached to the same master device, pressing button 1 on
each of them leads to two button presses from the same device. Some apps
really don't like that.

So we just put a counter in place and only send the first press and the last
release.
2008-01-09 17:36:39 +10:30
Peter Hutterer
981bb9f1e3 dix: set the correct number of valuators in valuator events.
(first_valuator + num_valuators) must never be larger than the number of axes,
otherwise DIX freaks out. And from looking at libXI, anything larger than 6 is
wrong too.
(cherry picked from commit 9f6ae61ad1)
2008-01-08 12:06:02 +10:30
Peter Hutterer
20ace6321a dix: don't try to confine cursor on screen restructure if there is no cursor.
Stops segfaulting when using xrandr. Yay.
2008-01-07 20:08:56 +10:30
Peter Hutterer
57a491e6d3 dix: init GrabPrivateKey to correct value.
Merge detritus from last pull.
2008-01-07 20:06:32 +10:30
Eamon Walsh
7f376f23db devPrivates rework: Free callback lists after use. 2008-01-03 23:17:06 -05:00
Eamon Walsh
de18703d2a dix: Fix bug+leak in callback manager DeleteCallbackList function. 2008-01-03 23:17:06 -05:00
Peter Hutterer
e4a214e40d dix: don't free device's devPrivates manually, dixFreePrivates does it.
Merge detritus from last pull.
2008-01-04 13:32:53 +10:30
Peter Hutterer
b2da44c76d dix: DoChangeKeyboardControl shouldn't be using inputInfo.keyboard. 2008-01-03 18:51:44 +10:30
Peter Hutterer
c7e9b67c54 dix: free ClassesRec when a BadAlloc occurs during CoreKeyboardProc. 2008-01-03 18:09:56 +10:30
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Alan Coopersmith
895073f6b4 Restore include & typedef needed by dtrace
996b621bec deleted a couple lines too many
2008-01-02 18:09:26 -08:00
Daniel Stone
24105cf658 Input: Don't reinit devices
If a device is already initialised (i.e. the virtual core devices) during
IASD, don't init them again.  This fixes a leak.
2007-12-28 15:51:36 +02:00
Jeremy Huddleston
42802a8e6b Xquartz: General Cleanup
General code cleanup, whitespace, dead code removal, added missing prototypes.
Made Xquartz come to foreground later in startup, so it doesn't appear for Xquartz -version
(cherry picked from commit 36922e8ff4)
2007-12-20 13:18:17 -08:00
Eamon Walsh
97c82ce051 XACE: Restore the old background None behavior in response to bug #13683.
From the X11 protocol spec:

"If background None is specified, the window has no defined background."

This means that toolkits and apps cannot rely on the "transparent" nature
of the current implementation!  At some point before the next release,
XACE will switch back to a solid background as the default.
2007-12-17 23:12:01 -05:00
Peter Hutterer
9f6ae61ad1 dix: set the correct number of valuators in valuator events.
(first_valuator + num_valuators) must never be larger than the number of axes,
otherwise DIX freaks out. And from looking at libXI, anything larger than 6 is
wrong too.
2007-12-18 13:57:15 +10:30
Bartosz Fabianowski
5b02a6ca5b Input: Fix proximity events with valuators
Initialise num_events to 1, so we always send a proximity event, and then
optionally valuator events.  Also make sure mieq can deal with valuator
events sent after proximity events.
2007-12-14 13:15:26 +02:00
Eamon Walsh
c8feb73f58 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/EVI.c
	Xext/bigreq.c
	Xext/cup.c
	Xext/dpms.c
	Xext/fontcache.c
	Xext/mitmisc.c
	Xext/xcmisc.c
	Xext/xf86bigfont.c
	Xext/xtest.c
	configure.ac
	dbe/dbe.c
	hw/darwin/darwin.h
	hw/darwin/darwinEvents.c
	hw/darwin/iokit/xfIOKit.h
	hw/darwin/iokit/xfIOKitCursor.c
	hw/darwin/quartz/fullscreen/fullscreen.c
	hw/darwin/quartz/fullscreen/quartzCursor.c
	hw/darwin/quartz/quartz.c
	hw/darwin/quartz/quartzCommon.h
	hw/darwin/quartz/quartzCursor.c
	hw/darwin/quartz/xpr/dri.c
	hw/darwin/quartz/xpr/dristruct.h
	hw/darwin/quartz/xpr/xprCursor.c
	hw/darwin/quartz/xpr/xprFrame.c
	hw/xfree86/modes/xf86RandR12.c
	include/cursor.h
	miext/rootless/rootlessCommon.h
	miext/rootless/rootlessScreen.c
	miext/rootless/rootlessWindow.c
	render/picturestr.h

Trying to pick up the pieces from the darwin churn here...
2007-12-13 18:38:25 -05:00
Peter Hutterer
d86e7f2ecc dix: when getting a bogus event, at least print out the type. 2007-12-11 17:49:16 +10:30
Peter Hutterer
447cd5d411 dix: update comments about inputInfo.pointer. 2007-12-04 19:09:37 +10:30
Peter Hutterer
f44d7dcb5f dix: change the filters to be per-device.
If we have one global filter, one pointer may change the filter value and
affect another pointer.

Reproduceable effect:
blackbox and xterm, start dragging xterm then click anywhere with the other
pointer (attached to different masterd device!).  The button release resets
the filter[Motion_Filter(button)] value, thus stopping dragging and no event
is sent to the client anymore.
Having the filters set per device gets around this.
2007-12-04 19:07:46 +10:30
Peter Hutterer
0931f40bf1 dix: comments, whitespaces, copyright fixes.
Removing my copyright message for now, should eventually be in line with the
rest of the messages.
2007-12-04 17:08:56 +10:30
Peter Hutterer
09c0c1a3cc dix: remove #ifdef XINPUT.
No escaping XINPUT anymore.
2007-12-04 16:51:52 +10:30
Peter Hutterer
004876355b dix: Remove RegisterPairingClient and UnregisterPairingClient. 2007-12-03 14:32:23 +10:30
Adam Jackson
fa47910045 Clean up many #if 0. 2007-12-02 12:40:25 -05:00
Peter Hutterer
6216abe0c1 dix: avoid activating the VCP/VCK twice.
This may set dev->key-xkbinfo to NULL, causing a segfault in xkb code lateron.
Spotted by David Huggins-Daines.
2007-11-30 11:34:24 +10:30
Peter Hutterer
9eb8ea9e61 dix: only freeze the paired MD on a grab, not all other devices. 2007-11-30 11:32:59 +10:30
Eamon Walsh
8503072e1c registry: add missing include statement. 2007-11-26 16:54:33 -05:00
Eamon Walsh
996b621bec registry: swap out the DTRACE XErrorDB stuff for the new registry call. 2007-11-26 15:59:44 -05:00
Eamon Walsh
54cb729ecc registry: Add a call for DTRACE compatibility. 2007-11-26 15:59:01 -05:00
Eamon Walsh
decd5a7c60 registry: Rebase registry to use the server config file of protocol names. 2007-11-26 15:26:49 -05:00
Eamon Walsh
9b0e72c8d9 registry: Add a great big list of protocol names, like the XErrorDB that
ships with Xlib.  This is considered temporary, until server-side XCB can
solve the problem programmatically.
2007-11-26 15:26:04 -05:00
Peter Hutterer
bf3198c8c5 dix: fix typo 2007-11-24 15:00:57 +10:30
Peter Hutterer
5dabe448bd dix: Add special treatment of NotifyUngrab for enter/leave events.
In some cases (e.g. using x2x) the previous model broke, with a window ending
not counting down to 0 anymore. Special treatment for NotifyUngrab seems to
help here.

Current solution: If a NotifyGrab is to be sent ignore it. If a NotifyUngrab
enter is sent, only adjust the semaphore if it is on 0. Likewise, do the same
for a NotifyUngrab leave if the semaphore is on 1. This seems to work alright
so far.
2007-11-24 15:00:43 +10:30
Peter Hutterer
f9269bebae DeviceIntRec: move lastx/lasty from valuator into DeviceIntRec.
We free the ValuatorClassRec quite regularly. If a SIGIO is handled while
we're swapping device classes, we can bring the server down when we try to
access lastx/lasty of the master device.
2007-11-22 17:30:14 +10:30
Jeremy Huddleston
bcbaf2a0ce Darwin: Dead code removal, Code cleanup, Added launcher
Imported changes from xorg-server-1.2-apple to make master more current wrt
file layout, build system changes, and dead code removal.
2007-11-21 19:52:11 -08:00
Eamon Walsh
709c1a70c8 Remove some duplicate include statements. 2007-11-20 15:18:02 -05:00
Eamon Walsh
2d17f47cc7 Merge branch 'master' into XACE-SELINUX
Conflicts:

	hw/xnest/Pixmap.c
	include/dix.h
2007-11-19 18:10:46 -05:00
Eamon Walsh
60be452c2e xace: restore the old SaveScreens function and introduce new API, since the
old version is called from drivers...
2007-11-19 16:59:34 -05:00
Peter Hutterer
bad96e5a86 dix: getevents.c remove trailing whitespaces. 2007-11-18 15:13:45 +10:30
Peter Hutterer
12dd6e9911 dix: reset MD's devPrivate classes to NULL before device initialisation.
XkbInitKeyboardDefviceStruct may call FatalError if it fails. FatalError then
cleans up all the devices, resulting in a segfault if the pointer is
uninitialised.
2007-11-16 17:23:09 +10:30
Peter Hutterer
be3321c2e9 dix: Free both current classes and original classes when closing an MD. 2007-11-16 12:12:41 +10:30
Peter Hutterer
497862df2f dix: explicitly float all attached SDs before closing down devices.
Some drivers flush on shutdown, if our SD is still attached we'd be trying to
route an event through a non-existing device.
2007-11-16 11:20:22 +10:30
Peter Hutterer
9de1ebe2a8 dix: Fix up class restoring when last SD disconnects.
Old code was fundamentally broken, fixes now are:
- free the MDs current device classes
- copy the device classes instead of flipping the pointers
- check for the old MD, not the new one.
2007-11-16 10:45:28 +10:30
Adam Jackson
20fd478324 Small static cleanups on dix/ 2007-11-15 17:01:33 -05:00
Peter Hutterer
53539688ca dix: SetKeySymMap should alloc the map if dst doesn't have one already. 2007-11-15 16:23:48 +10:30
Peter Hutterer
b40646dc10 dix: Add FreeDeviceClass and FreeFeedbackClass for centralised xfree.
Ensures that we only have one way of freeing a device class to avoid leaks in
ChangeMasterDeviceClasses and other places.
2007-11-15 15:43:44 +10:30
Peter Hutterer
c758e5a664 dix: Make sure core MDs copy their initial classes before they are used.
Anything in dev->key, dev->valuator etc. of a MD must always be a copy of the
original class. The intial classes of an MD (the ones set up before an SD is
attached) as well, as we may have to restore them if no SD is attached
anymore.
2007-11-15 10:47:20 +10:30
Peter Hutterer
64711a0948 Xi: When switching MD classes, make a deep copy instead of pointer flip.
Turns out it's really really hard synchronising device state across multiple
duplicated events if they all share the same struct. So instead of doing so,
when the SD changes deep-copy all it's classes into the MD. The MD then has
the same capabilities, but the state can be set separately. This should fix
xkb, key state, repeat etc. problems.

Updating the device state allows us to remove the SwitchCoreKeyboard from the
event gathering, it's all done during event processing now.
2007-11-15 10:41:34 +10:30
Eamon Walsh
1603130236 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/xace.c
	Xext/xace.h
2007-11-14 13:35:50 -05:00
Peter Hutterer
b44c1118f3 dix: Return Success from ProcBell if no BellProc is set.
We must not return BadDevice, this causes applications to crash. If no
BellProc is set, just quietly do nothing and report a Success.
2007-11-14 14:08:21 +10:30
Peter Hutterer
5031238aad dix: remove trailing/wrong whitespaces from devices.c and events.c 2007-11-13 16:58:23 +10:30
Peter Hutterer
c703849e79 dix: Attach spriteInfoRec to same memory block as the DeviceIntRec.
No need to alloc a separate one, we never do anything special with it anyway.
2007-11-13 16:50:18 +10:30
Peter Hutterer
51239f87ce dix: Send MappingNotify when keyboard maps change.
If a slave device is attached to a master device, then we need to send a
mapping notify to the client.
Mapping notify needs to be sent if
 - different slave device but on same master
 - different master

This gives you funny behaviour with the ClientPointer. When a
MappingNotify is sent to the client, the client usually responds with a
GetKeyboardMapping. This will retrieve the ClientPointer's keyboard mapping,
regardless of which keyboard sent the last mapping notify request. So
depending on the CP setting, your keyboard may change layout in each app...
2007-11-13 11:26:16 +10:30
Peter Hutterer
70b4087c4d dix: don't unconditionally update valuators during key events.
Master may not have valuators, device may not have valuators.
2007-11-12 13:10:39 +10:30
Peter Hutterer
23365d2865 dix: allow grab modifier device to be NULL.
This can happen if we check for a passive core grab and our device is a
floating slave device. Doesn't really change anything as SDs can't send core
events but it stops the server from segfaulting.
2007-11-12 13:08:38 +10:30
Peter Hutterer
a05f43bf3e dix: When the last slave is removed, set master to the original classes.
DeviceClassesChangedEvent is sent to the client, where device == new slave.
2007-11-12 11:35:18 +10:30
Peter Hutterer
7a81bafc9b Xi, dix: Add ability to change MD classes + send event when doing so.
Each time a different slave device sends through a master, an
DeviceClassesChangedEvent is enqueued. When this event is processed, all
classes of the matching master device are changed, and the event is sent to
the clients.

Next time the master is queried, it thus shows the evclasses of the last slave
device. The original classes are stored in the devPrivates.

TODO: if all slave devices are removed, the master's original classes need to
be restored.
2007-11-09 23:10:24 +10:30
Peter Hutterer
5bbc468b70 dix: grabbing an attached SD sets it floating for the duration of the grab. 2007-11-09 14:32:06 +10:30
Peter Hutterer
cb75f09146 dix: calloc root window's Generic Event mask, stops segfaults. 2007-11-09 14:31:41 +10:30
Peter Hutterer
59b304d8a2 dix, mi: stop segfaults when a floating device emits events.
For pointers: don't try to set master->valuator fields if there is no master.
For keyboards: check if device is valid before trying to access the fields in
miPointerGetScreen (btw. this disables DGA events for floating keyboards).

Also stop the hideous number of ErrorFs if we request the paired device for a
floating dev.
2007-11-08 15:44:18 +10:30
Peter Hutterer
184a7b8917 Merge branch 'mpx' into mdsd
Conflicts:

	Xi/opendev.c
2007-11-08 09:34:35 +10:30
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Daniel Stone
e717409bae DIX/getevents: Document GetMaximumEventsNum() a little better
Note that the number returned by GMEN can _never_ change, and be a little more
explicit about the figure for repeats.
2007-11-07 03:58:56 +02:00
Daniel Stone
512bac25ec DIX: XKB: Set xkbInfo to NULL as well as freeing it (bug #10639)
XkbRemoveResourceClient wants to access xkbInfo if it exists, so make
sure we NULL it after freeing it.  It doesn't make much sense to move
the RemoveResourceClient call first, as there's not much point in
notifying clients while we're shutting the server down anyway.
2007-11-07 03:58:56 +02:00
Eamon Walsh
d7c5e8bfc1 Modified performance patches from Arjan van de Ven <arjan@infradead.org>
Subject: [PATCH] fix some performance gaps in Xace

The XaceHook function is used in several hotpaths.
The problem with it (performance wise) is twofold:
 * The XaceHook function has a big switch() statement for the hook number in it
 * The XaceHook function uses varargs to reassemble the final dispatch arguments again

Both are expensive operations... for something that is known at compile time

This patch turns the hotpath XaceHook call into a direct call to avoid
the switch and varargs; this gives me over 10% performance gain
on the x11perf benchmark.
2007-11-06 16:26:09 -05:00
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Daniel Stone
dda10c9066 Remove all traces of external RGB database (and Speedo)
Remove all references to an external RGB database (which hasn't been enabled
for a very long time).  Also get rid of some references to Speedo fonts.
2007-11-05 16:28:35 +00:00
Daniel Stone
83e5d9e75d DIX: Remove last alloca call
Replace with heap allocations.
2007-11-05 14:36:54 +00:00
Daniel Stone
914922fd61 DIX: Remove usage of alloca
Replace with heap allocations.
2007-11-05 14:34:43 +00:00
Ben Byer
6e4f5cf83f changing ALLOCATE_LOCAL to xalloc to prevent stack overflow 2007-11-05 05:53:34 -08:00
Aaron Plattner
f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Adam Jackson
f01e149d1a Move SIGUSR1 notification as late as possible.
If we inherited a signal mask from the parent process that ignores SIGUSR1,
then we will send SIGUSR1 to the parent to indicate when we're ready to
accept connections.  Unfortunately, we send this notification way too
early, right after creating the sockets rather than just before entering
the main loop.

Move it to just before Dispatch() so we're not lying quite so much.
2007-11-02 11:54:16 -04:00
Peter Hutterer
352c5a3112 dix: don't compress motion events from different devices (EventEnqueue)
(cherry picked from commit 8840829ab9)
2007-10-28 16:07:30 +02:00
Peter Hutterer
8d3d027062 dix: add XI event support to FixKeyState.
FixKeyState needs to be able to handle XI events, otherwise we get "impossible
keyboard events" on server zaps and other special key combos.
(cherry picked from commit 5ee409794e)
2007-10-28 16:05:04 +02:00
Eamon Walsh
5f9095f0d2 registry: Remove synthetic bit from event types in lookup function. 2007-10-25 19:09:26 -04:00
Eamon Walsh
8c6923018c xace: Add a "manage" access check when setting the Redirect event bits. 2007-10-25 19:01:29 -04:00
Naoki Hamada
242f56f722 Input: Fix key down test (bug #12858)
Fix the botched previous key_is_down test, which would give false positives.
Also move key_autorepeats to a separate inline function.
2007-10-25 18:46:27 +03:00
Eamon Walsh
0388a59a6e Revert "registry: special case minor number when looking up core requests."
This reverts commit 31110d6837.

This is handled properly by StandardMinorOpcode().
2007-10-23 20:59:21 -04:00
Peter Hutterer
b7ee005d32 dix: Don't interfere grabs the interfering device is of different type.
A pointer device should be able to send events while the client has a core
grab on a keyboard device, and likewise.
2007-10-24 10:26:12 +09:30
Peter Hutterer
02508614b9 dix: check for core passive grabs on inferiors when replaying events. 2007-10-24 10:09:18 +09:30
Eamon Walsh
825f09dffd xace: Still more changes to selection code. Removed the SelectionPtr from
the hook - the hook only needs the Atom to control access to the selection
object.  Upgraded the SelectionCallback to take a client argument and
additional type codes so that it can be used for redirection.
2007-10-23 17:12:57 -04:00
Eamon Walsh
9e0a468af1 xace: try to pretend events were sent when a denial occurs.
Probably need to redo the error return paths in these functions
at some point.
2007-10-23 13:35:30 -04:00
Peter Hutterer
7ef863720d dix: Create new sprite for floating devices.
Floating devices get sprites, but still aren't spriteOwners. This prevents
them from getting rendered, and also stops segfaulting.
(not really solving the problems with keyboards though)
2007-10-23 17:28:03 +09:30
Eamon Walsh
12e889d202 xace: Bug fixes, name changes to selection access hooks and fields. 2007-10-19 18:43:38 -04:00
Peter Hutterer
5ba738935f Xi: remove ChangePointerKeyboardPairing in favour of ChangeDeviceHierarchy. 2007-10-19 14:36:37 +09:30
Eamon Walsh
06eb830169 xace: Fix bug in AddPassiveGrabToList(), was using wrong GrabPtr. 2007-10-18 12:31:14 -04:00
Eamon Walsh
6107a24503 dix: Add client parameter to AddPassiveGrabsToList(). 2007-10-18 12:24:55 -04:00
Eamon Walsh
31110d6837 registry: special case minor number when looking up core requests. 2007-10-18 10:30:44 -04:00
Eamon Walsh
e3fd90ae9c registry: Add "X11:" prefix to core protocol names. 2007-10-18 10:29:10 -04:00
Eamon Walsh
c3f7b86255 Merge branch 'master' into XACE-SELINUX
Conflicts:

	os/access.c
2007-10-17 15:00:54 -04:00
Eamon Walsh
e3a8cbe523 xace: add creation/labeling hook to CreateRootWindow(). 2007-10-17 13:48:44 -04:00
Peter Hutterer
1d9ebbac8c dix: Make InitCoreDevices use AllocMasterDevice.
Also change naming a bit, append "pointer" and "keyboard" to master devices
instead of -ptr and -keybd.
2007-10-16 18:46:12 +09:30
Peter Hutterer
299573f461 dix: add AllocMasterDevice for creation of new master devices.
Devices are initiated pretty much the same as the core devices.
2007-10-16 18:40:15 +09:30
Peter Hutterer
b697c4ed14 dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards. 2007-10-16 17:47:06 +09:30
Peter Hutterer
caa69d8f7b dix: fix detritus from adding lastSlave field. 2007-10-16 17:38:13 +09:30
Peter Hutterer
90d077e537 dix: GetPointerEvents: get state from master device before applying valuators.
We need to get lastx/y from the master device before we start applying
acceleration etc. Otherwise we get jumping cursors, which is reasonably bad.
2007-10-16 17:37:33 +09:30
Peter Hutterer
e6bd8ae060 dix: set the device's sprite when using AttachDevice
Sprite is set to the master device's sprite.
2007-10-16 15:59:30 +09:30
Peter Hutterer
c7b878b904 dix: don't treat VCK/VCP separately in DevHasCursor, IsPointer/KeyboardDevice. 2007-10-16 15:07:31 +09:30
Peter Hutterer
e9f149fb56 Fix up detritus from removing GetPairedPointer/Keyboard. 2007-10-16 14:24:20 +09:30
Peter Hutterer
840bde3d32 dix: GetPairedDevice: return dev paired with master for slave devices. 2007-10-16 13:09:35 +09:30
Peter Hutterer
9ecbbf198f dix: adjust PickPointer and PickKeyboard to get the first master device.
Simplifies it a lot, since we always have at least one master device
available at all times, so less mucking around.
2007-10-16 12:05:09 +09:30
Peter Hutterer
0c5f65ecd3 dix: don't allow slave devices as ClientPointer 2007-10-16 12:04:56 +09:30
Peter Hutterer
9ccc9ab6f2 dix: don't call CloseDevice on VCP/VCK separately. 2007-10-16 12:04:48 +09:30
Peter Hutterer
e4fd981b48 dix: check for isMaster before calling DeviceCursorCleanup. 2007-10-16 12:04:40 +09:30
Peter Hutterer
7503d13407 dix: don't check VCK and VCP separately when looking for device ids.
Both are part of the device list again, so we cover them there.
2007-10-16 12:04:30 +09:30
Peter Hutterer
032e906711 dix: Remove GetPairedPointer, GetPairedKeyboard in favour of GetPairedDevice. 2007-10-16 11:57:42 +09:30
Peter Hutterer
3e07e73fef dix: remove pairing/attachment from InitAndStartDevices.
If we enabled in the correct order, this has all been done already.
2007-10-16 11:34:29 +09:30
Peter Hutterer
38baac71bd dix: Set bidirectional pairing, don't allow pairing with already paired devs. 2007-10-16 11:30:59 +09:30