Commit Graph

299 Commits

Author SHA1 Message Date
Keith Packard
1addf6fe23 Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
(cherry picked from commit f8dd80d13b)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-26 13:56:57 -07:00
Peter Hutterer
21f58a2b0d Xi: don't double-swap the XListDeviceProperties reply.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 50cc8adafc)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08 22:56:08 -07:00
Peter Hutterer
b575af88d0 Xi: fix copy/paste error causing sizeof against wrong struct.
This wrong check may cause BadLength to be returned to the client even if the
length is correct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8b583ca2b2)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08 22:50:56 -07:00
Pierre Ossman
3b1ff33587 Xi: don't send XKB mapping notifications when XKB is disabled
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-08 12:40:12 -07:00
Peter Hutterer
124da1da5c Xi: don't crash on a NULL property name, just return None.
strcmp doesn't like NULL-pointers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0d9a42dc03)
2009-03-27 15:25:24 -04:00
Peter Hutterer
ea9f51fd42 Xi: add XATOM_FLOAT to server-defined properties.
This property is used to denote type float for input properties. Such
properties can be accessed easily through the XIPropToFloat() function.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit a48c81dcdf)
2009-03-27 15:25:18 -04:00
Peter Hutterer
6ad6b6f900 Xi: add XIPropToInt() auxiliary function.
Converts an XIPropertyValuePtr to an integer, provided that type and format is
right.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 669f6810af)
2009-03-27 15:25:07 -04:00
Thomas Jaeger
b893dc59da Don't release grabs unless all buttons are up
Previously, only buttons <= 5 would count here, but the core protocol
allows for 255 buttons.

http://lists.freedesktop.org/archives/xorg/2009-January/042092.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 717a961528)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 17:26:09 -08:00
Thomas Jaeger
191161a24a Count the number of logically down buttons in buttonsDown
This fixes the following bug.  Assuming your window manager grabs
Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping,
then press the physical button 3 (this shouldn't have any effect), press
Alt and then button 1.  The press event is delivered to the application
instead of firing the grab.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f7f85f6965)
2009-01-30 17:25:24 -08:00
Peter Hutterer
ebb3872925 Xi: fix use of button->down - bitflags instead of int arrays.
The device's button down state array was changed to use DOWN_LENGTH and thus
bitflags for each button in cfcb3da7.

Update the DBSN events to copy this bit-wise state.
Update xkb and Xi to check for the bit flag instead of the array value.

Reported by ajax.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit a85f0d6b98)
2009-01-30 17:11:44 -08:00
Peter Hutterer
82f42730fa mi: force CopyKeyClass for key events. (#19048)
While we don't want to copy all other device classes into the VCK, we need to
copy the key class to transfer the layout from the SDs into the VCK.
This resembles the functionality of SwitchCoreKeyboard in server 1.5.

Thanks to Colin Guthrie for providing the follow-up patch (#19222)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-12 18:27:09 +10:00
Peter Hutterer
6e8626f2eb Xi: silence compiler warning
Don't mix declarations and statements.
(cherry picked from commit fb2a8d0e59)
2008-12-16 12:03:04 -08:00
Peter Hutterer
9a44cc619f Xi: don't update VCP's valuators from DeviceValuator events #18882
The VCP doesn't need to update the valuators anyway since it cannot send XI
events. Just skip that bit.

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

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-16 12:03:04 -08:00
Tom Jaeger
d679cf70a7 Xi: XIGetDevice needs to ignore the MORE_EVENTS flag.
Reported in X.Org Bug 18882, Comment 5.
<http://bugs.freedesktop.org/show_bug.cgi?id=18882>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 78a62d7713)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:42:56 -08:00
Peter Hutterer
3df1db67e3 Xi: change XIUnRegisterPropertyHandler to XIUnregisterPropertyHandler
CamelCase can be taken too far, and AFAICT there's no consumers of that
function yet anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:38:07 -08:00
Peter Hutterer
b983c4fa1e Require inputproto 1.5
Also claim to now support XI 1.5.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01 08:16:57 +10:00
Peter Hutterer
c910886737 Xi: Purge XGE remainders, we don't have any XGE events anymore. 2008-12-01 08:16:57 +10:00
Peter Hutterer
be4bf65d00 input: don't switch MDs' classes around between SDs.
Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and
VCK) do not generate XI events. They don't have to swap device classes but
instead stay at the default number of classes at all times.
This means we can get rid of the DeviceClassesChangedEvents as well.
2008-12-01 08:16:57 +10:00
Peter Hutterer
aba1cbaadc dix: No DeviceEnterLeave events in server 1.6 2008-12-01 08:16:56 +10:00
Peter Hutterer
9739fac045 Xi: don't allow VCP/VCK be OpenDevice'd, but allow all SDs.
Reverting to traditional XI behaviour.
2008-12-01 08:16:56 +10:00
Peter Hutterer
7330cb5650 Xi: don't list attachment in ListInputDevices, but list all SDs.
In XI2, we only list the VCP and the VCK as well as floating SDs to non-XI2
clients. This is not the case here, we just list all devices.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01 08:16:56 +10:00
Peter Hutterer
1d307ed7f2 Xi: remove the GetExtensionVersion hack - don't reply with supported version.
XI2 abuses the GEV request to reply with the min/major version of the
supported extension if the length for the name is 0. Don't do that, yet.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01 08:16:56 +10:00
Peter Hutterer
cfe7301bcf Xi: remove all new XI2 protocol requests and their handling.
This commit reverts to XI 1.4 requests, plus the input device property
requests.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-01 08:16:56 +10:00
Peter Hutterer
de1a8b68eb xkb: extract the correct device in XkbFilterEvents.
If the event is an XI event, we need to work on the correct device, not on
the VCK.

Adds XIGetDevice(event) function to extract the device from an event.
2008-11-04 16:04:16 +10:30
Peter Hutterer
d972399566 Purge device-based WindowAccess code.
Really, this was a bad idea. It's not security, the UI features that would
have been cool (e.g. clicking through windows) aren't implemented anyway, and
there's nothing you can't achieve just by using plain XI anyway.

Requires inputproto 1.9.99.6.
2008-11-04 16:04:15 +10:30
Peter Hutterer
b6b26560d6 Move EXTENSION_BASE and EXTENSION_EVENT_BASE to misc.h. 2008-10-31 17:09:13 +10:30
Peter Hutterer
f781a752e6 Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency. 2008-10-31 17:09:13 +10:30
Julien Cristau
add946daed Nuke unused variables 2008-10-26 11:44:10 +01:00
Peter Hutterer
f3f6ea89aa Xi: check all handlers before applying property changes.
The current code exposes to inconsistent updates, i.e. if handler N succeeds
but handler N+1 fails in setting the property, an error is returned to the
client although parts of the server now behave as if the property change
succeeded.

This patch adds a "checkonly" parameter to the SetProperty handler. The
handlers are then called twice, once with checkonly set to TRUE.
On the checkonly run, handlers _MUST_ return error codes if the property
cannot be applied. Handlers are not permitted to actually apply the changes.
On the second run, handlers are permitted to apply property changes.
Errors codes returned on the second run are ignored.
2008-10-13 13:50:40 +10:30
Peter Hutterer
4808bdec45 Xi: don't memcpy the KeyClassRec from SD to MD. #16167
Most of its component get copied during CopyKeyClass anyway.
The ones that aren't:
  postdown - never changed for virtual devices anyway.
  down - shouldn't change that without sending events.

memcpy'ing the struct also copied mapWidth, which means we didn't realloc
during SetKeySymsMap lateron, overwriting the memory assigned to us.

X.Org Bug 16167 <http://bugs.freedesktop.org/show_bug.cgi?id=16167>
2008-10-10 16:58:08 +10:30
Adam Jackson
c6d6d3e87a Loader: Unexport a handful of consumerless symbols from dixsym. 2008-10-06 16:18:21 -04:00
Adam Jackson
0b7b89fbac xalloc+bzero -> xcalloc 2008-10-06 14:19:30 -04:00
Peter Hutterer
fbd09486c6 Push server-known properties into xserver-properties.h. 2008-09-26 13:32:11 +09:30
Peter Hutterer
a2d83b9dc8 Xi: add "deletable" flag to properties, add DeleteProperty handler.
A property can only be deleted if any of the following is true:
- if a property is deletable and all handlers return Success.
- if a property is non-deleteable and the all handlers return Success AND the
  delete request does not come from a client (i.e. driver or the server).

A client can never delete a non-deletable property.
2008-09-26 13:32:08 +09:30
Peter Hutterer
22e9047268 Xi: allow Set/GetProperties to return a status, and honour this status code.
If a property handler now bails out, return the error code to the caller. This
allows to be slightly more specific with the errors.
2008-09-26 13:32:07 +09:30
Peter Hutterer
1e24e7b9df Xi: remove configure/query device property calls.
This removes all the meta-information about device properties (pending,
fromClient, range, valid_values, immutable).
2008-09-26 13:32:05 +09:30
Peter Hutterer
cc20112a65 Xi: don't include client-side headers.
Spotted by Mikhail Gusarov.
2008-09-19 08:45:43 +09:30
Peter Hutterer
f789408f7d Xi: remove broken SDeviceEnterNotifyEvent, replace with ...Leave...
The event format is the same for both (bar the type), so one is enough.
2008-09-18 13:32:57 +09:30
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Peter Hutterer
95b466e457 Xi: don't include .c files. 2008-08-22 21:38:01 +09:30
Peter Hutterer
c696da75c7 Xi: swap devices property replies. 2008-08-22 21:38:01 +09:30
Peter Hutterer
de1573172a Backport device properties to XI 1.5 instead of XI 2.0 2008-08-15 14:52:13 +09:30
Peter Hutterer
e6813e8de6 Xi: byte-swap device property requests. 2008-08-14 15:01:18 +09:30
Peter Hutterer
139c3ab7b7 Xi: return the state from the correct keyboard in QueryDevicePointer. 2008-08-12 20:42:08 +09:30
Peter Hutterer
591ef3c047 Xi: ChangeDeviceControl presence events should set the appropriate devchange.
Requires inputproto 1.4.4 or higher.
2008-07-29 10:00:01 +09:30
Adam Jackson
d6228cb22a Shape extension is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Peter Hutterer
5bcc45e07e Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property. 2008-07-13 20:54:33 +09:30
Peter Hutterer
e7abe1676a Xi: protect against NULL handlers, don't try to dereference. 2008-07-13 20:54:33 +09:30
Peter Hutterer
2bbb12c355 Xi: remove ChangeDeviceControl for CoreCtl.
If you want to set a device to core, attach it to a master device.
2008-07-13 20:54:33 +09:30
Peter Hutterer
18ff17756c Xi: GetDeviceProperty reply includes deviceid. 2008-07-13 20:54:33 +09:30