Commit Graph

1203 Commits

Author SHA1 Message Date
Peter Hutterer
993ca5acbd dix: when unsetting a cursor, update the sprite immediately (#23608)
Removing the device cursor while the cursor was within the window did not
update the visible sprite until the next enter/leave event.

X.Org Bug 23608 <http://bugs.freedesktop.org/show_bug.cgi?id=23608>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:27 +10:00
Peter Hutterer
0e4dd3b2d2 Un-export ApplyPointerMapping. This is an in-server function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:26 +10:00
Eamon Walsh
a470e8426e Correct outdated e-mail address in "Author" statements.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-09-02 17:56:52 -04:00
Eamon Walsh
0f3a64c3a5 Add DRI2 requests to protocol.txt
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-28 23:29:05 -04:00
Peter Hutterer
903c3db1d1 Xext: rename Xtst* to XTest*
This patch corrects a misnaming of XTest-related functions.

The extension itself announces itself as XTEST. Xtst is the library name
itself, but all library functions are prefixed by XTest. Same with the
naming in the server.

- Rename all *Xtst* functions to *XTest* for consistency with the library
  and in-server API.
- Rename the "Xtst device" property to "XTEST device" for consistency with
  the extension naming.
- Rename the device naming to "<master device name> XTEST device". The
  default xtest devices become "Virtual core XTEST pointer" and "Virtual
  core XTEST keyboard".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:51 +10:00
Peter Hutterer
8bfd23e144 input: move XTest device initialization into Xext/xtest.c
XTest devices are non-optional but nonetheless specific to the XTEST
extension.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:50 +10:00
Peter Hutterer
a95f80fa91 dix: use IsXtstDevice instead of the direct key lookup.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-27 14:24:50 +10:00
Jeremy Huddleston
0f613007cd CheckWindowOptionalNeed: Ensure w->optional is set to avoid SEGFAULT
If CheckWindowOptionalNeed is called consecutively (and the first removes optional), then
we will SEGFAULT.  This can happen in XQuartz because ReparentWindow will call
pScreen->ReparentWindow which can DeleteProperty which will CheckWindowOptionalNeed... then
ReparentWindow will call it again later indiscriminantly.
(cherry picked from commit b608c864cc)
2009-08-25 20:16:20 -07:00
Keith Packard
e7dd1efef4 Ensure that rotation updates happen frequently
The smart scheduler is designed to minimize scheduler overhead by
increasing the interval between WaitForSomething calls when a single
client is running. However, the software rotation code depends on
its BlockHandler being invoked for screen updates; the long delays
caused by the smart scheduler optimizations means that screen updates
can be delayed a long time as well.

The change is simple -- prevent the smart scheduler from increasing
the scheduling interval while any screen is using software rotation.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:14:19 -07:00
Peter Hutterer
80f18a7326 input: move CorePointer/KeyboardProc declarations into header.
The extern declaration in xichangehierarchy.c was broken anyway.
This fixes a crash on creating a new master device.

Reported-by: Maxim Levitsky
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:09:23 +10:00
Peter Hutterer
ef75301854 dix: FixUpEventFromWindow mustn't scramble non-device events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:06:37 +10:00
Richard Hughes
6b5978dcf1 Do not reset lastDeviceEventTime when we do dixSaveScreens
When we turn off DPMS with DPMSModeOff and do dixSaveScreens, don't reset the
event time else session clients using IDLETIME will be reset.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-18 10:51:31 +10:00
Eamon Walsh
d4b8f7602b xace: fix access mode in dixLookupWindow call within ProcUngrabKey.
Referencing a window (as grab-window) only requires GetAttr access.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:11 -04:00
Eamon Walsh
6d2f4e4878 Add XI2 requests to protocol.txt
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:11 -04:00
Peter Hutterer
2851f04cb2 dix: rework DeviceChangedEvents a bit.
DCEs are now processed when sent throught the master device, not when sent
through the slave device. This includes a removal of some un-used (or partly
used) fields in the DCE itself to something more self-explanatory.

TODO: if a device has events queued and its attachment is changed, the DCE
is silently dropped now. Instead, it should be generated as soon as the
first event after the attachment is sent.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 13:25:35 +10:00
Peter Hutterer
dca4de72d3 dix: fix potential use of unused variable 'mask'.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 10:14:20 +10:00
Peter Hutterer
3989dc1d34 dix: use the XI2 defines for class types.
Doesn't matter really, they have the same values anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 10:14:20 +10:00
Peter Hutterer
fe045820f1 input: move DeviceChangedEvent conversion into eventconvert.c
The version in eventconvert.c was half broken and for some reason we ended
up with a second version in exevents.c (which works). Move it over to where
it belongs and call EventToXI2 instad of having a custom function for it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 10:14:20 +10:00
Peter Hutterer
6c292d1705 dix: update the sprite trace for all masters && floating slaves (#23257)
When the windows are restructured, CheckMotion needs to be called for all
masters and floating slaves to update the spriteTrace.

X.Org Bug 23257 <http://bugs.freedesktop.org/show_bug.cgi?id=23257>

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-14 14:39:56 +10:00
Peter Hutterer
c477ac8a15 dix: re-name internal eventToClassesChanged to eventToDeviceChanged
DeviceClassesChangedEvents (where this name comes from) have been replaced
with DeviceChangedEvents.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:36 +10:00
Peter Hutterer
59dc59a72f test: add XI2 eventconversion test for raw events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-13 11:19:35 +10:00
Soren Sandmann Pedersen
211511f150 Disable the out-of-bounds workaround in pixman.
This workaround was necessary for older X servers, but now fb should
be using correct coordinates.

Also bump pixman requirement to 0.15.20.
2009-08-11 14:40:42 -04:00
Peter Hutterer
3abbd327f4 dix: detach SD during XI2 grabs only.
XI1 grabs on slave devices leave the device attached - just like in earlier
versions of XI.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-06 10:05:12 +10:00
Peter Hutterer
c29aa7da22 Revert "dix: Remove temporary detachment of slave devices."
This reverts commit 0c0ef42292.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-06 10:05:12 +10:00
Alan Coopersmith
95b678e6dc Correct modifier map built when ProcSetModifierMapping is called
Fixes xmodmap changes to modifiers to stop corrupting modifier maps

Previous code had two bugs:
 - the code to increment mod was after the code to continue if no
   modifier was set, so mod wouldn't be incremented for modifiers
   with no keys mapped to them (such as if you called
   xmodmap -e 'clear Lock')
 - the value it set in the modifier map was the raw modifier number,
   not the bitmask value for that modifier

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-05 11:15:54 +10:00
Peter Hutterer
26b83ad4a2 dix: require PointerProc and KeyboardProc to be passed into AllocDevicePair.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-05 09:33:15 +10:00
Peter Hutterer
d3e5629fac dix: call SetFocusOut and LeaveWindow when disabling a device.
PointerWindows[x] would be set after removing a master pointer. Destroying
this window then crashed the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-03 10:11:48 +10:00
Peter Hutterer
97ed946cfc dix: SetFocusOut and LeaveWindow don't need parameters other than dev.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-03 10:11:48 +10:00
Peter Hutterer
46ac9f9241 dix: pass the sourceid around for enter/leave events.
The sourceid for enter/leave events as a result of pointer motion is the ID
of the slave device. The sourceid for those as a result of a grab activating
is the device itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 11:04:28 +10:00
Peter Hutterer
c299b2228f dix: remove obsolete comment, parameter described doesn't exist.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:14 +10:00
Peter Hutterer
5085ac09a5 input: switch internal event types to enums.
Use enum EventType instead of ints. This requires a load of default
cases in various switch statements to silence compiler warnings.

Reported-by: Aaron Plattner
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:14 +10:00
Peter Hutterer
845e65f080 xkb: move XkbFilterEvents to xkbsrv.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:14 +10:00
Peter Hutterer
f85619b14d dix: update GetMaximumEventsNum() to real value (3).
GPE and friends now use internal events so they may generate up to 3 events.
One (optional) DeviceChanged event and one raw event plus a device event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Peter Hutterer
4e9b2938cd include: untangle events.h from the SDK headers.
InternalEvents shouldn't be used anywhere outside the X server itself. Split
up into events.h for opaque typedefs for the events needed by various
headers and eventstr.h for the actual struct definitions.

eventstr.h must only be included by code that requires internal events and
is not part of the SDK.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Aaron Plattner
587c3a2d19 Bug #22804: Reject out of bounds XGetImage requests
The XGetImage man page states:

    If the drawable is a window, the window must be viewable, and it must be the
    case that if there were no inferiors or overlapping windows, the specified
    rectangle of the window would be fully visible on the screen and wholly
    contained within the outside edges of the window, or a BadMatch error
    results.  Note that the borders of the window can be included and read with
    this request.

However, the server was only checking the requested region against the screen
bounds, allowing XGetImage requests to read pixels outside the bounds of a
window's ancestors.  Normally, this would just read other pixels from the
screen, but if one of the ancestor windows is redirected, the window's backing
pixmap may be smaller than the window itself.

This change checks the region against the window's bounding drawable, which is
either the screen pixmap, a redirected window's backing pixmap, or the root
window for servers that don't support GetWindowPixmap.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-07-22 12:52:49 -07:00
Peter Hutterer
ecd618957e dix: fix null-pointer dereference on activating enter/focus grabs.
EventToXI2 returns a NULL event for enter/focus events since these events
aren't yet wrapped into internal events. This is a quickfix only, it works
thanks to the alignment of internal and XI2 event types.

Eventually, enter/leave events should be wrapped into internal events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 15:27:16 +10:00
Peter Hutterer
48585bd1e3 dix: use the event mask of the grab for TryClientEvents.
A client that grabs for button/key events may not have the
ButtonPress/KeyPress mask set and should not receive an event in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:13:05 +10:00
Pierre Willenbrock
4dc91b3e54 Check if new space was actually allocated before freeing.
There will be no new space allocated, if mode != PropModeReplace and
len == 0, or if mode is not one of the handled modes.
This fixes freeing data that is still in use, leading to double frees and
other memory corruption.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:13:04 +10:00
Peter Hutterer
9a1bfa5664 input: remove XI2 keysym grabs, use keycode grabs instead.
Keysym grabs are tricky in the details, keycode grabs are known to work. So
for now, provide keycode grabs only.

Requires inputproto 1.9.99.15.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:12:51 +10:00
Gaetan Nadon
7b9915b11e dix: xserver "make dist" fails due to eventconvert.h (#27825)
This header file is not in the /dix dir, but in the /include dir.
The makefile aborted and the xserver distribution files were not created.
The fix is to remove this header file from the libdix_la_SOURCES
in the dix/Makefile.am.

X.Org Bug 27825 <http://bugs.freedesktop.org/show_bug.cgi?id=27825>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-19 20:01:12 +10:00
Oliver McFadden
b5f6da1e9b Revert "Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:"
This reverts commit 7333dc2969.

False positive.
2009-07-17 06:34:00 +03:00
Oliver McFadden
7333dc2969 Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:
Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details]
167  	    rc = XIPropToInt(val, &nelem, &ptr);

Event leaked_storage: Variable "ptr" goes out of scope
2009-07-16 19:03:14 +03:00
Éric Piel
52088d3c2d xserver: remove unused code in clipValuators
The axes variables was never used, remove it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 17:09:22 +10:00
Peter Hutterer
d3f6b43a24 Update to xextproto 7.0.99.1.
xextproto had Xlib client headers moved into libXext.
Protocol header files are named fooproto.h, header files with constants
foo.h or fooconst.h where foo.h was already in use for client-side headers.
2009-07-15 17:00:05 +10:00
Peter Hutterer
35ff5cd26e dix: fix wrong raw valuator copy
internal events keep valuator data at the index for the valuator, not like
the wire events that start with first_valuator.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 10:36:30 +10:00
Peter Hutterer
975bf60a82 dix: use sizeof(FP3232) instead of 2 * sizeof(int32_t).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 10:36:30 +10:00
Peter Hutterer
d040af7fa3 Update to type-specific raw events - require inputproto 1.9.99.14.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 10:36:30 +10:00
Peter Hutterer
2d35ea8d95 dix: switch to byte-counting functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:05:54 +10:00
Peter Hutterer
2c535b6f13 dix: don't send presence events for attaching/detaching slave devices.
The code that didn't list attached slave devices for XI1 clients doesn't
exist anymore, so there's no need for these presence events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 09:00:35 +10:00
Peter Hutterer
0c0ef42292 dix: Remove temporary detachment of slave devices.
Previously, an active grab on an attached slave device would send the device
floating for the duration of the grab. This breaks existing XI applications
(e.g. the GIMP) since they grab all devices automatically - resulting in the
loss of control over the VCP.

The behaviour of extended input devices during a grab in relation to the
core pointer is not specified in the XI protocol specification.
The removal of the temporary detachment restores the behaviour of extended
input devices as present in currently released servers - even if a device is
grabbed, an event from this device will result in an event from the core
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12 21:54:35 +10:00