Compare commits

...

92 commits

Author SHA1 Message Date
Peter Hutterer
10c42f5752 xserver 1.13.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-17 15:50:48 +10:00
Dave Airlie
8039b6b7a3 xf86: fix flush input to work with Linux evdev devices.
So when we VT switch back and attempt to flush the input devices,
we don't succeed because evdev won't return part of an event,
since we were only asking for 4 bytes, we'd only get -EINVAL back.

This could later cause events to be flushed that we shouldn't have
gotten.

This is a fix for CVE-2013-1940.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ca03b9161)
2013-04-17 15:46:03 +10:00
Peter Hutterer
87d7e3e352 dix: only show the cursor if a window defines one (#58398)
e02f864fdf "Suppress cursor display until the first XDefineCursor() request"
disabled cursor display a priori unless -retro is given.

On a plain server, caling XFixesHideCursor() and XFixesShowCursor() would
show the default root cursor, despite no client actually defining a cursor.

Change the logic, disable CursorVisible by default and only enable it from
the window's CWCursor logic. If no window ever defines a cursor, said cursor
stays invisible.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
(cherry picked from commit c100211034)
2013-04-02 15:37:31 +10:00
Daniel Martin
b1c01839d8 ephyr: Fix crash on 24bpp host framebuffer
Use bytes_per_line and bits_per_pixel from the created XImage to fix
    https://bugzilla.redhat.com/show_bug.cgi?id=518960

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bd58ebe4cf)
2013-04-02 15:37:14 +10:00
Aaron Plattner
4bd8e9ecc3 xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
This is necessary when the input handler deletes itself from the
list. Bug found by Maarten Lankhorst, this patch uses the list macros
instead of open-coding the fix.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit da92690107)
2013-04-02 15:36:27 +10:00
Matt Dew
eec5eb2f09 Bump version to 1.13.3 2013-03-07 23:08:09 -07:00
Dave Airlie
f7ac913019 randr: cleanup provider properly
So in the cold plug server shutdown case, we reap the resources
before we call CloseScreen handlers, so the config->randr_provider
is a dangling pointer when the xf86CrtcCloseScreen handler is called,

however in the hot screen unplug case, we can't rely on automatically
reaped resources, so we need to clean up the provider in the xf86CrtcCloseScreen
case.

This patch provides a cleanup callback from the randr provider removal
into the DDX so it can cleanup properly, this then gets called by the automatic
code for cold plug, or if hot unplug it gets called explicitly.

Fixes a number of random server crashes on shutdown
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58174
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=891140

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-07 21:34:12 -07:00
Matt Dew
4d98c7da78 bump rev from 1.13.3-rc1 to 1.13.3-rc2 2013-02-28 23:48:03 -07:00
Matt Dew
412c4abbae Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~whot/xserver into server-1.13-branch 2013-02-18 13:23:07 -07:00
Aaron Plattner
e604b19fc5 randr: unref the provider shared pixmap the appropriate number of times
When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt
of 1.  Then, PixmapShareToSlave bumps the refcnt to 2.  However, there's no
corresponding PixmapUnshareFromSlave where the refcnt can be decreased again,
and there's no convenient common place where the refcnt can be decremented when
the slave pixmap is destroyed.

Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-18 13:19:05 -07:00
Carlos Garnacho
e7b4b83679 dix: Set focus field on XI2 crossing events
Set on DeviceEnterLeaveEvent() the xXIEnterEvent->focus field
similarly to how the CoreEnterLeaveEvent() function above does
for core events.

This fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=677329
reported to GTK+, where focus handling on window managers with
sloppy focus or no window manager present was broken due to this
field being always set to FALSE.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 509b3c3dc8)
2013-02-18 12:13:53 +10:00
Peter Hutterer
29a0c87f4d dix: when shutting down slave devices, shut down xtest devices last
XTest devices are the first ones in the list, being initialised together
with the master devices. If we disable the devices in-order and a device has
a button down when being disabled, the XTest device is checked for a
required button release (xkbAccessX.c's ProcessPointerEvent). This fails if
the device is already NULL.

Instead of putting the check there, disable the devices in the reverse order
they are initialised. Disable physical slaves first, then xtest devices,
then the master devices.

Testcase: shut down server with a button still held down on a physical
device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3e4be4033a)
2013-02-18 12:13:49 +10:00
Peter Hutterer
d8a09a4b15 dix: pre-scale relative events from abs devices to desktop ratio (#31636)
Absolute devices may send relative events depending on the mode (synaptics
by default, wacom per option). The relative events are added to the previous
position, converted into device coordinates and then scaled into desktop
coordinates for pointer movement.

Because the device range must be mapped into the desktop coordinate range,
this results in uneven scaling depending dimensions, e.g. on a setup with
width == 2 * height, a relative movement of 10/10 in device coordinates
results in a cursor movement of 20/10 (+ acceleration)

Other commonly user-visible results:
* the touchpad changing acceleration once an external monitor as added.
* drawing a circle on a wacom tablet in relative mode gives an ellipsis in
  the same ratio as the desktop dimensions.

Solution: pre-scale the incoming relative x/y coordinates by width/height
ratio of the total desktop size. Then add them to the previous
coordinates and scale back with the previous mapping, which will undo the
pre-scaling and give us the right movement.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 61a99aff9d)
2013-02-18 12:09:55 +10:00
Sybren van Elderen
79f5430ba6 dix: when scaling from desktop coord, take the total desktop size (#51904)
Scaled is already in desktop coordinates, take the total width into account,
not just the current screen's width.

Fixes Xdmx pointer position calculation.

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

Signed-off-by: Sybren van Elderen <sowmestno@msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a191dbfe85)
2013-02-18 12:09:38 +10:00
Peter Hutterer
fa6cbd099f dmx: don't include dmx-config.h from xdmxconfig (#37502)
dmx-config.h is a server header which includes dix-config.h. That again
defines a bunch of server-specifics, including setting the size of XID to
32 bit.

libX11 uses unsigned long (8 bits on x86_64). XGCValues thus ends up being
16 bytes smaller in xdmxconfig than in the library, causing garbage to be
sent to the server.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1058fcf57f)
2013-02-18 12:09:23 +10:00
Daniel Martin
63f928a9d7 xfixes: Fix minor number in QueryVersion
Due to a typo the major version number was passed as minor version to
version_compare().

Regression-from: ffd4874798

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 36740d02b9)
2013-02-18 12:07:25 +10:00
Peter Hutterer
bc4c3158ba xkb: only post a XTest release if the XTest device has the button down
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5daa442fe1)
2013-02-18 11:20:34 +10:00
Peter Hutterer
b3b7be7d49 xkb: always post XTest button up when the physical button released (#28808)
Regression introduced by commit 2decff6393
  xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP

XTest buttons must be released when a physical button is released. This was
fixed in 1432785839, but
2decff6393 changed a condition that this code
didn't get triggered anymore.

"dev" for pointer events is now always the VCP which doesn't have a xkbi
struct. So move this condition out and always trigger the XTest released for
button events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Frank Roscher <Frank-Roscher@gmx.net>
(cherry picked from commit c4fee9d2ec)
2013-02-18 11:20:34 +10:00
Matt Dew
c260ae1a0c Update release to 1.13.3-rc1 2013-02-16 00:08:59 -07:00
Jeremy Huddleston Sequoia
b6c59f73d2 XORG_TLS: Pick the first option that works (ie: prefer __thread)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-02-15 23:32:08 -07:00
Jeremy Huddleston Sequoia
1c7c7d407e os: Ensure <dix-config.h> is included in strndup.c
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-15 23:31:47 -07:00
Jeremy Huddleston Sequoia
e2f4be5ba5 XQuartz: Ensure <dix-config.h> is included in capabilities.c
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-15 23:31:26 -07:00
Dave Airlie
a2d9bade38 randr: bump advertised RandR version to 1.4
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-15 23:21:11 -07:00
Matt Dew
3ffa491426 Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~whot/xserver into server-1.13-branch 2013-01-25 16:34:29 -07:00
Matt Dew
100027127c Bump version number to 1.13.2 2013-01-24 22:53:34 -07:00
Dave Airlie
dc1c70f299 xserver: fix build regression since 91ab237358
inputstr, double defines TouchListener typedef, maybe some gcc handles it,
but not all.

fixes tinderbox

Reported-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 605dfc6804)
2013-01-22 08:28:52 +10:00
Yuly Novikov
310ac85080 dix: Save touchpoint last coordinates before transform. #49347
DDXTouchPointInfoRec.valuators used to store axis values after transform.
This resulted in Coordinate Transformation Matrix
being applied multiple times to the last coordinates,
in the case when only pressure changes in the last touch event.

Changed DDXTouchPointInfoRec.valuators to store values before transform.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347

Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3b9f1c7017)

Conflicts:
	dix/getevents.c
2013-01-21 14:09:59 +10:00
Peter Hutterer
d07dfb11c2 xfree86: don't access the old input handler after freeing it
Introduced in 323869f329

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f4a58469a2)
2013-01-21 13:53:19 +10:00
Andreas Wettstein
f7f566f9e3 xkb: Do not use base group as an array index.
The base group is not brought into range and, therefore, using it as an array
index crashed the X server.  Also, at this place, we should ignore locked
groups, but not latched groups.  Therefore, use sum of base and latched groups,
brought into range.

Reproducible with:
key <FK07> {
    type= "ONE_LEVEL",
    symbols[Group1]= [              NoSymbol ],
    actions[Group1]= [ LatchGroup(group=-1, clearLocks) ]
};

And hitting F7 will exceed the group level and access arbitrary memory.

Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3578cc3c2e)
2013-01-21 13:53:04 +10:00
Carlos Garnacho
da0c913da8 render: Unwrap early on the animated cursor BlockHandler
The loop above the previous call may end up triggering other
handlers attaching to the same function slot, so unwrapping
the handler after that could leave the just attached handler
in a dangling but not unset state.

This issue was most visible on the XO, where destroying a
window with an animated cursor set and running  would trigger
this inconsistent state, never calling the miSpriteBlockHandler
again after the animated cursor is unset.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit df746a7341)
2013-01-21 13:53:02 +10:00
Carlos Garnacho
4cdd3bfc00 mi: Ensure pointer emulating touch events update the sprite
Different miPointerSpriteFuncRec implementations do a varying
business at ultimately calling miPointerUpdateSprite(), this
particularly fails when using the plain mi sprite on touch events,
where the sprite is just moved/updated on cursor changes.

So, ensure miPointerUpdateSprite() is called generically for
pointer emulating touch events as with regular motion events.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0fbd779a82)
2013-01-21 13:53:00 +10:00
Peter Hutterer
7b5b7b1467 dix: remove already-moved hunk
Should've been removed in bc1f90a615, but got
left here due to a botched rebase.

Fixes stray button events sent to clients after deactivating an async
pointer grab on a pointer-emulating-touch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0e1ab433f4)
2013-01-21 13:52:49 +10:00
Peter Hutterer
66299cb7b8 dix: check for the right device's xi2 mask
events.c: In function 'DeactivatePointerGrab':
events.c:1524:51: warning: 'dev' may be used uninitialized in this function
[-Wuninitialized

dev is unset when we get here, the device to check is "mouse".
Introduced in ece8157a59.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 32a6d8a6b5)
2013-01-21 13:52:47 +10:00
Peter Hutterer
7c859fd5d1 dix: add resource type to touch listeners
Instead of guessing what resource type the listener is and what property to
retrieve, store the resource type in the listener directly.

Breaks XIT test cases:
TouchGrabTestMultipleTaps.PassiveGrabPointerEmulationMultipleTouchesFastSuccession

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56557

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
(cherry picked from commit f59499b5d0)
2013-01-21 13:52:46 +10:00
Keith Packard
df12c4daa7 input: Record grab pointer in TouchListener
This places a pointer to the grab related to a TouchListener directly
in the TouchListener structure rather than hoping to find the grab
later on using the resource ID.

Passive grabs have resource ID in the resource DB so they can be
removed when a client exits, and those resource IDs get copied when
activated, but implicit grabs are constructed on-the-fly and have no
resource DB entry.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9ad0fdb135)
2013-01-21 13:52:44 +10:00
Keith Packard
5272f71cf8 input: Pull TouchListener declaration to top-level
No reason to have a struct declared inside another struct

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 91ab237358)
2013-01-21 13:52:40 +10:00
Peter Hutterer
041ab46aba xfree86: update the device state for all DGA events (#59100)
DGA only handles master devices but it does intercept slave device events as
well (since the event handlers are per event type, not per device).

The DGA code must thus call into UpdateDeviceState to reset the button/key
state on the slave device before it discards the remainder of the event.

Test case:
- Passive GrabModeSync on VCP
- Press button
- Enable DGA after ButtonPress
- AllowEvents(SyncPointer)
- Release button

The button release is handled by DGAProcessPointerEvent but the device state
is never updated, so the slave ends up with the button permanently down.
And since the master's button state is the union of the slave states, the
master has the button permanently down.

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

Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ad3bc57134)
2013-01-21 13:52:04 +10:00
Peter Hutterer
c201d00014 xfree86: set event->detail for DGA pointer events
Reported-by: Steven Elliott <selliott4@austin.rr.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit c5f2818edb)
2013-01-21 13:52:03 +10:00
Peter Hutterer
de0ea3544f dix: don't filter RawEvents if the grab window is not the root window (#53897)
If a XI2.1+ client has a grab on a non-root window, it  must still receive
raw events on the root window.

Test case: register for XI_ButtonPress on window and XI_RawMotion on root.
No raw events are received once the press activates an implicit grab on the
window.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4e13dd9014)
2013-01-21 13:51:59 +10:00
Peter Hutterer
5ed2523f4d xfree86: print message to the log when zapping the server
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3420a7778c)
2013-01-21 13:50:33 +10:00
Peter Hutterer
956700d14d Xi: if a TouchEnd appears on a actively grabbing client, always accept
Once the TouchEnd appears on the device, the touch is done. If the client
still has a pointer grab, accept it to avoid clients with TouchOwnership
selections to wait indefinitely for the actual touch event.

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

Conflicts:
	Xi/exevents.c
2013-01-21 13:49:55 +10:00
Peter Hutterer
39157fd240 dix: when deactivating pointer-only grabs, don't emulate TouchEnd events
A client with a pointer grab on a touch device must reject the touch when
detactivating the grab while the touch is active. However, such a rejecting
must not trigger a ButtonRelease event to be emulated and sent to the
client.
Set the grabbing listener's state to HAS_END, so we simply skip delivery to
that client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ece8157a59)
2013-01-21 13:45:08 +10:00
Peter Hutterer
e162667433 dix: only reject active grabs on ungrab and do it before actually ungrabbing
An active grab ungrabbing is the same as rejecting the grab, since the
client is no longer interested in those events. So reject any touch grab,
but do so before actually deactivating since we're interested in the
TouchEnd for the current grabbing client.

A passive grab otoh is _not_ like rejecting a grab, since it deactivates
automatically when the touch ends.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bc1f90a615)
2013-01-21 13:45:05 +10:00
Peter Hutterer
b72ffcf6ae dix: don't call ProcessInputEvents() when accepting/rejecting touches
TouchListenerAcceptReject may be called during normal event processing, but
ProcessInputEvents is not reentrant and calling it here smashes the event
queue.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 146f48c293)
2013-01-21 13:44:59 +10:00
Peter Hutterer
d5142c4e9d dix: don't allow overriding a grab with a different type of grab (#58255)
If a client has a core grab, don't allow re-grabbing with type XI2, etc.
This was the intent of the original commit
xorg-server-1.5.99.1-782-g09f9a86, but ineffective.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit dd3242c87a)
2013-01-08 12:35:42 +10:00
Peter Hutterer
7800cf99f5 dix: don't copy the wrong event mask when activating a passive grab
GrabMask is a union of core, XI1 and XI2 masks. If a XI2 grab is activated,
the value is a random pointer value, using it as mask has unpredictable
effects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f793b5fd3e)
2013-01-08 12:35:42 +10:00
Peter Hutterer
c15bdf3163 Xi: don't use devices after removing them
RemoveDevice() frees the DeviceIntPtr, we shouldn't use the pointer after
that

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 58bff17e43)
2013-01-08 12:35:42 +10:00
Matt Dew
3a8c618a73 version bump for 1.13.1.901 (rc1) 2013-01-03 23:36:00 -07:00
Alan Coopersmith
95780608df EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel
d785368e0e converted the other miinitext functions to use ARRAY_SIZE,
and removed the sentinel, but missed EnableDisableExtensionError so
passing an invalid extension name could cause the server to walk off
the end off the list looking for a sentinel that wasn't there.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-03 23:05:38 -07:00
Dave Airlie
a6d89f30dd glx/dri2: initialise api to avoid indirect rendering failing randomly
Running glxinfo under indirect rendering would randomly fail against the
intel driver, as it would create a context with no attribs, and then the
api value would be passed to the driver uninitialised.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-01-03 23:03:42 -07:00
Raphael Kubo da Costa
65642ccb78 vfb: Initialize the GLX extension again.
This should fix a regression in the 1.13.0 release: commit
5f5bbbe543 removed a code path used by Xvfb
and made it use the default one when initializing extensions. However, this
meant the GLX extension was not initialized anymore since it is not part of
the `staticExtensions' array.

Since it is not possible to just add it to that array after commit
aad428b8e2, adopt an approach similar to
xwin's and xquartz's and initialize the extension from vfb's `InitOutput'.

Signed-off-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2012-12-23 15:22:25 -07:00
Jeremy Huddleston Sequoia
e348e4afc5 XQuartz: Don't add the 15bit visual any more
Mountain Lion only supports 32bit backing stores, so don't use 15bit visuals until libXplugin adapts

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit ba4bb3bc1b)
2012-12-19 16:50:07 -08:00
Jeremy Huddleston Sequoia
34fb39a960 XQuartz: Add some verbose logging to debug xp_lock_window being unbalanced
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit f54987de97)
2012-12-18 00:31:53 -08:00
Jeremy Huddleston Sequoia
06e2ecd0df XQuartz: Avoid a possible deadlock with DRI on OS X 10.7.5 and OS X 10.8.2
<rdar://problem/12338921>
http://bugs.winehq.org/show_bug.cgi?id=31751

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 25d26875bc)
2012-12-18 00:31:53 -08:00
Matt Dew
92ecbf5f0f No changes from 1.13.0.902 (rc2)
Bump version to 1.13.1
2012-12-13 21:05:24 -07:00
Matt Dew
ede07c1af3 Bump version 2012-12-06 22:46:46 -07:00
Matt Dew
e2369dd404 Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~whot/xserver into server-1.13-branch 2012-12-06 21:53:42 -07:00
Daniel Martin
79220f4390 Xi: Fix modifier swapping in XIPassiveGrabDevice
XIPassiveGrabDevice uses a list of uint32_t as modifier sets.

The ModifierInfo struct represents the current modifier states and is
therefor used in XIQueryPointer and various events.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit aa9a9ad08b)
2012-12-05 17:37:40 +10:00
Sybren van Elderen
521f3fb566 hw/dmx: add update_desktop_dimensions() call
The Xdmx server did not update the desktop dimensions when computing screen
origins.

Signed-off-by: Sybren van Elderen <sowmestno@msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6e18599d69)
2012-12-05 17:36:11 +10:00
Peter Hutterer
73bd33b4d4 xkb: fill in keycode and event type for slow keys enablement
eventType is set for the type that triggered a XkbControlsNotify event.
Technically, SlowKeys is triggered by a timer which doesn't have a matching
core event type. So we used to use 0 here.

Practically, the timer is triggered by a key press + hold and cancelled when
the key is released before the timeout expires. So we might as well set
KeyPress (keycode) in the ControlsNotify to give clients a chance to differ
between timer-triggered SlowKeys and client-triggered ones.

This is a chance in behaviour, though I suspect with little impact.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 2c4388a00e)
2012-12-05 17:36:07 +10:00
Jasper St. Pierre
2def985466 cursor: Revise edge cases for the pointer moving towards barriers
Since barriers block the invisible line between pixels, that means
that we need to explicitly check the boundaries, or else we'll have
a potential off-by-one error. This fixes issues when trying to move
down or right across a barrier and having the pointer visibly bounce.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a51b2c3913)
2012-12-05 17:36:04 +10:00
Peter Hutterer
4a957c9e81 When resetting device idle time, reset XIAll(Master)Devices too (#56649)
When the screen saver is forcibly deactivated, the idle time counter is
reset for all devices but not for the fake XIAllDevices and
XIAllMasterDevices. XScreenSaverQueryInfo uses XIAlldevices to fill the
"idle" field, thus returning the wrong value.

Regression introduced in
commit 6aef209ebc
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Mar 12 13:51:02 2012 +1000

    Change lastDeviceIdleTime to be per-device

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Giacomo Perale <ghepeu@virgilio.it>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2dc6d92284)
2012-12-05 17:36:02 +10:00
Chris Wilson
d71a17cfab xf86: select a fake output for headless servers
Following commit 37d956e3ac
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Sep 10 11:14:20 2012 +1000

    xf86: fix compat output selection for no output GPUs

headless servers can no longer startup as we no longer select a compat
output for the fake framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56343
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e54f71a2c7)
2012-12-04 10:44:21 +10:00
Keith Packard
72ef659874 xf86: fix compat output selection for no output GPUs
This should work properly with dynamic outputs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 37d956e3ac)
2012-12-04 10:44:02 +10:00
Dave Airlie
a2748aa6bd randr: call RRProviderInit in the proper place.
No idea where this got lost across development cycles, but its
definitely missing.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=57448

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e9ea96d6a8)
2012-12-04 10:43:40 +10:00
Matt Dew
c0e68f8e70 Bump release info for this RC1. 2012-11-22 21:37:57 -07:00
Michel Dänzer
395c9e1708 EXA: Track source/mask pixmaps more explicitly for Composite fallback regions.
In particular, make sure pExaScr->src/maskPix are cleared when the
corresponding pictures aren't associated with drawables, i.e. solid or gradient
pictures. Without this, we would in some cases associate the source/mask region
with unrelated pixmaps from previous Composite fallbacks, resulting in random
corruption.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47266

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1ca096d5e0)
2012-11-07 23:34:10 -07:00
Matt Dew
7914986fb8 Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~whot/xserver into server-1.13-branch 2012-11-07 23:24:53 -07:00
Carlos Garnacho
1a4ec493bf Xi: Set modifier mask on touch events
Button mask should be out-of-band with the emulated
pointer events as touch devices don't truly have
"buttons". Even though, it's handy to have the modifier
mask from the paired keyboard on touch events.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b4e44b285e)
2012-11-07 09:59:24 +10:00
Carlos Garnacho
2f99b38747 Xi: Update the device after delivering the emulated pointer event(#56558)
Ensure emulated pointer events contain the state that applies before the
event was processed, so the device state must be updated after delivering
such emulated events.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 863f32c930)
2012-11-07 09:59:20 +10:00
Carlos Garnacho
10d9cd36b4 Sync TouchListener memory allocation with population in TouchSetupListeners()
The allocated TouchListener array may fall short by 1 if hitting the worst case
situation where there's an active grab, passive grabs on each window in the
sprite trace and event selection for touch in one of the windows. This may lead
to memory corruptions as the array is overflown.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ced56f322e)
2012-11-07 09:59:06 +10:00
Peter Hutterer
835737244f dix: fix zaphod screen scrossing (#54654)
POINTER_SCREEN coordinates are screen-relative. For a Zaphod setup, the
coordinates after a screen crossing are already relative to the new screen's
origin. Add that offset to the coordinates before re-setting.

regression introduced by
commit bafbd99080
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Aug 8 11:34:32 2012 +1000

    dix: work around scaling issues during WarpPointer (#53037)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e7cd5cce74)
2012-11-07 09:59:01 +10:00
Peter Hutterer
a3f11d2f60 Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738)
If a client is still waiting for the TouchBegin, don't deliver a TouchEnd
event.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Thomas Jaeger <thjaeger@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6764471901)
2012-11-07 09:59:00 +10:00
Peter Hutterer
11319a9225 xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
For button release events, the current code picks the VCK. Because that has
a XKB struct, it thinks this is a PointerKeys event and proceeds to send the
release event through the XTest pointer. That has no effect in normal
operation as the button is never down and an attempt is silently discarded
(normal event processing continues with the VCP).

On server shutdown, the XTest device is already removed, leading to a
null-pointer derefernce when the device is checked for whether buttons are
down (XkbFakeDeviceButton → button_is_down(xtest pointer)).

The current state has only worked by accident, the right approach here is to
handle the VCP's event as such and not switch to the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2decff6393)
2012-11-07 09:58:54 +10:00
Chase Douglas
9ddc6ad9d0 End physically active touches when device is disabled
Otherwise:

* We can't end the touches while device is disabled
* New touches after enabling the device may erroneously be mapped to old
  logical touches

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3b67cd2614)
2012-11-07 09:58:38 +10:00
Peter Hutterer
36f9c2d1dd dix: fix crash on shutdown if a disabled device is still grabbed (XI1 grab)
A disabled device doesn't have a sprite (less so a sprite->win) and triggers
a NULL-pointer dereference on shutdown when all active grabs are released as
part of the cleanup.

Fix this by checking for sprite being non-null and setting the focus window
to the NullWindow if it is. The rest of the patch just attempts to make
things more readable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4b7f00346d)
2012-11-07 09:58:18 +10:00
Matt Dew
b3d25d8d65 Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~airlied/xserver into server-1.13-branch 2012-11-01 22:17:59 -06:00
Dave Airlie
b87edf1acc xf86: fix multi-seat video device support. (v2)
If we are not seat 0 the following apply:

don't probe any bus other than platform
don't probe any drivers other than platform
assume the first platform device we match on the bus is the primary GPU.

This just adds checks in the correct places to ensure this, and
with this X can now start on a secondary seat for an output device.

v2: fix Seat0 macros
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 70e5766874)
2012-11-02 10:17:53 +10:00
Dave Airlie
1e8c960f87 config/udev: ignore change on drm devices
for input devices we handle change like remove/add, but for
drm devices we get change events when we hotplug outputs,
so lets just ignore change at this level, and let the drivers
handle it. We may in the future want to route driver udev
from here instead.

Reported-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e0b92f5f86)
2012-11-02 10:17:40 +10:00
Dave Airlie
c7c0755891 xf86/platform: scan pci after probing devices
This solves a race if we are trying to dynamically power off
secondary GPUs. Its not the greatest fix ever but it probably
as good as we can do for now.

The GPU probing causes the devices to be powered up, then when
we scan the PCI bus we get the correct information from the kernel,
rather than a bunch of 0xff due to the device being powered off.

drop gratuitous '&'.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 10672a5abe)
2012-11-02 10:17:06 +10:00
Dave Airlie
39ebf87be7 dri2: invalidate drawable after sharing pixmap
After we share the pixmap, the backing storage may have changed,
and we need to invalidate and buffers pointing at it.

This fixes GL compositors and prime windows lacking contents initially.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 22746df15b)
2012-11-02 10:17:01 +10:00
Matt Dew
5a612aa44d Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~jturney/xserver into server-1.13-branch 2012-10-30 22:12:56 -06:00
Jon TURNEY
0456d56092 Fix 'make distcheck' for hw/xwin
Add some missing header files to _SOURCES so they get distributed properly

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
(cherry picked from commit a69429a17b)
2012-10-16 15:14:55 +01:00
Jon TURNEY
018248136a Fix compilation of Xorg DDX without XF86VIDMODE
Fix compilation of Xorg DDX without XF86VIDMODE since 6e74fdda, by putting
xf86vmode.c back under the XF86VIDMODE automake conditional it was accidentally
taken out of.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 1d9fd7ffb0)
2012-10-16 15:14:55 +01:00
Jon TURNEY
d46af34732 hw/xwin: Only add GLX extension once.
Using of LoadExtension() to add GLX onto to the end of the list of extensions on
every server regeneration leads to hilarious consequences (i.e. crashing) after
the first regeneration :-)

Possibly xf86ExtensionInit() and QuartzExtensionInit() need a similar fix.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
(cherry picked from commit 25741b1aa3)
2012-10-16 15:14:54 +01:00
Jon TURNEY
cdd7413bbe Correct description of -displayfd option in man page.
A display number, not a port number, is written to the specified fd.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 7ceb854812)
2012-10-16 15:14:53 +01:00
Peter Hutterer
8f39a6b0b3 xfree86: add xf86UpdateDesktopDimensions()
This call is required for external drivers (specifically NVIDIA) that do
not share the xfree86 infrastructure to update the desktop dimensions.
Without it, the driver would update the ScreenRecs but not update the total
dimensions the input code relies on for transformation.

This call is a thin wrapper around the already-existing internal call and
should be backported to all stable series servers, with the minor ABI bump.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
CC: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 0a75bd640b)

Conflicts:
	hw/xfree86/common/xf86Module.h
2012-10-12 09:48:10 +10:00
Yufeng Shen
bea56fc9c4 dix: fix scale_to_desktop for edge ABS events
Scale_to_desktop() converts ABS events from device coordinates
to screen coordinates:
[dev_X_min, dev_X_max]  -> [screen_X_min, screen_X_max]
[dev_Y_min, dev_Y_max]  -> [screen_Y_min, screen_Y_max]

An edge ABS event with X = dev_X_max (e.g., generated from the
edge of a touchscreen) will be converted to have screen X value
= screen_X_max, which, however, will be filterd out when xserver
tries to find proper Window to receive the event, because the
range check for a Window to receive events is
       window_X_min <= event_screen_X < window_X_max
Events with event_screen_X = screen_X_max will fail the test get
and rejected by the Window.

To fix this, we change the device to screen coordinates mapping to
[dev_X_min, dev_X_max]  -> [screen_X_min, screen_X_max-1]
[dev_Y_min, dev_Y_max]  -> [screen_Y_min, screen_Y_max-1]

Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0b02150c27)
2012-10-12 09:47:21 +10:00
Daniel Drake
f9709b8a63 Xi: Don't check for TOUCH_END, it's never set
This flag is never set, so checking for it here means that we'll
never release the simulated mouse button press after the user touches
(and releases) the touchscreen for the first time.

Fixes a problem where the XO laptop touchpad became totally
unusable after touching the screen for the first time (since X then
behaved as if the mouse button was held down all the time).

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3e6358ee6c)
2012-10-08 11:19:39 +10:00
Peter Hutterer
f5fad30822 dix: fix crash on XI 1.x grabs on disabled devices. (#54934)
If the device is disabled, the sprite window is NULL and dereferencing
crashes the server.

This is only triggered for XI 1.x grabs (ProcXGrabDevice) as XI2 grabs would
trigger another code path, creating a sprite for the disabled device as if
detaching it (which is wrong and fixed with this patch too).

Grabbing a disabled device doesn't make sense as it won't send events
anyway. However, the protocol specs do not prohibit it, so we need to keep
it working.
Luckily, oldWin is only used for focus out events, which aren't necessary
given that the device is disabled.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
(cherry picked from commit 9d6b836570)
2012-10-08 11:19:33 +10:00
Daniel Stone
aacfc321b4 Touch: Fix duplicate TouchBegin selection with virtual devices
Given the following scenario:
  1) client A selects for TouchBegin on window W for device D
  2) client B selects for TouchBegin on window W for XIAllDevices
  3) client C selects for TouchBegin on window W with device E

Step 3 will fail with BadImplementation, because attempting to look up
XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work.
This should succeed (or, if it was selecting for device D, fail with
BadAccess as it would be a duplicate selection).

Fix this by performing the appropriate lookup for virtual devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
(cherry picked from commit 3d2b768efa)
2012-10-08 11:19:22 +10:00
Peter Hutterer
e31e272f4f dix: set the device transformation matrix
The property handler is registered after setting the property, so
dev->transform remains as all-zeros. That causes pixman_f_transform_invert()
to fail (in transformAbsolute()) and invert remains as garbage. This
may then cause a cursor jump to 0,0.

Since the axes are not yet initialized here and we need to allow for drivers
changing the matrix, we cannot use the property handler for matrix
initialization, essentially duplicating the code.

Triggered by the fix to (#49347) in 749a593e49

https://bugzilla.redhat.com/show_bug.cgi?id=852841

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3d1051aecb)
2012-09-27 14:27:18 +10:00
60 changed files with 562 additions and 263 deletions

View file

@ -393,6 +393,8 @@ ScreenSaverFreeSuspend(pointer value, XID id)
UpdateCurrentTimeIf();
nt_list_for_each_entry(dev, inputInfo.devices, next)
lastDeviceEventTime[dev->id] = currentTime;
lastDeviceEventTime[XIAllDevices] = currentTime;
lastDeviceEventTime[XIAllMasterDevices] = currentTime;
SetScreenSaverTimer();
}
}

View file

@ -949,8 +949,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
if (!(event->flags & TOUCH_POINTER_EMULATED))
return DONT_PROCESS;
if (!(event->flags & TOUCH_END))
return DONT_PROCESS;
DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask,
&t->state);
@ -1199,7 +1197,6 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
TouchOwnershipEvent *ev)
{
Bool was_owner = (resource == ti->listeners[0].listener);
void *grab;
int i;
/* Send a TouchEnd event to the resource being removed, but only if they
@ -1214,11 +1211,7 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
/* Remove the resource from the listener list, updating
* ti->num_listeners, as well as ti->num_grabs if it was a grab. */
if (TouchRemoveListener(ti, resource)) {
if (dixLookupResourceByType(&grab, resource, RT_PASSIVEGRAB,
serverClient, DixGetAttrAccess) == Success)
ti->num_grabs--;
}
TouchRemoveListener(ti, resource);
/* If the current owner was removed and there are further listeners, deliver
* the TouchOwnership or TouchBegin event to the new owner. */
@ -1312,34 +1305,19 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
rc = dixLookupResourceByType((pointer *) grab, listener->listener,
RT_PASSIVEGRAB,
serverClient, DixSendAccess);
if (rc != Success) {
/* the grab doesn't exist but we have a grabbing listener - this
* is an implicit/active grab */
rc = dixLookupClient(client, listener->listener, serverClient,
DixSendAccess);
if (rc != Success)
return FALSE;
*grab = dev->deviceGrab.grab;
if (!*grab)
return FALSE;
}
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
*client = rClient(*grab);
*win = (*grab)->window;
*mask = (*grab)->xi2mask;
}
else {
if (listener->level == CORE)
rc = dixLookupWindow(win, listener->listener,
serverClient, DixSendAccess);
else
rc = dixLookupResourceByType((pointer *) win, listener->listener,
RT_INPUTCLIENT,
serverClient, DixSendAccess);
rc = dixLookupResourceByType((pointer *) win, listener->listener,
listener->resource_type,
serverClient, DixSendAccess);
if (rc != Success)
return FALSE;
@ -1479,6 +1457,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
*/
l = &ti->listeners[ti->num_listeners - 1];
l->listener = devgrab->resource;
l->grab = devgrab;
//l->resource_type = RT_NONE;
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
l->type = LISTENER_POINTER_GRAB;
@ -1561,6 +1541,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
uint32_t touchid;
int type = ev->any.type;
int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED);
DeviceIntPtr kbd;
if (!t)
return;
@ -1570,9 +1551,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
else
touchid = ev->device_event.touchid;
if (emulate_pointer)
UpdateDeviceState(dev, &ev->device_event);
if (type == ET_TouchBegin) {
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
emulate_pointer);
@ -1580,32 +1558,41 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
else
ti = TouchFindByClientID(dev, touchid);
/* Under the following circumstances we create a new touch record for an
* existing touch:
*
* - The touch may be pointer emulated
* - An explicit grab is active on the device
* - The grab is a pointer grab
*
* This allows for an explicit grab to receive pointer events for an already
* active touch.
*/
if (!ti && type != ET_TouchBegin && emulate_pointer &&
dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
/* Active pointer grab */
if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
(dev->deviceGrab.grab->grabtype == CORE ||
dev->deviceGrab.grab->grabtype == XI ||
!xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) {
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
emulate_pointer);
if (!ti) {
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
"grabbed touchpoint %d\n",
dev->name, type, touchid);
return;
}
!xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin)))
{
/* Active pointer grab on touch point and we get a TouchEnd - claim this
* touchpoint accepted, otherwise clients waiting for ownership will
* wait on this touchpoint until this client ungrabs, or the cows come
* home, whichever is earlier */
if (ti && type == ET_TouchEnd)
TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
else if (!ti && type != ET_TouchBegin) {
/* Under the following circumstances we create a new touch record for an
* existing touch:
*
* - The touch may be pointer emulated
* - An explicit grab is active on the device
* - The grab is a pointer grab
*
* This allows for an explicit grab to receive pointer events for an already
* active touch.
*/
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
emulate_pointer);
if (!ti) {
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
"grabbed touchpoint %d\n",
dev->name, touchid);
return;
}
TouchBuildSprite(dev, ti, ev);
TouchSetupListeners(dev, ti, ev);
TouchBuildSprite(dev, ti, ev);
TouchSetupListeners(dev, ti, ev);
}
}
if (!ti) {
@ -1619,9 +1606,14 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
* events which _only_ emulate motion just work normally */
if (emulate_pointer && ev->any.type != ET_TouchUpdate)
DeliverEmulatedMotionEvent(dev, ti, ev);
if (emulate_pointer && IsMaster(dev))
CheckMotion(&ev->device_event, dev);
kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
event_set_state(NULL, kbd, &ev->device_event);
ev->device_event.corestate = event_get_corestate(NULL, kbd);
/* Make sure we have a valid window trace for event delivery; must be
* called after event type mutation. Touch end events are always processed
* in order to end touch records. */
@ -1643,6 +1635,9 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (ev->any.type == ET_TouchEnd)
TouchEndTouch(dev, ti);
}
if (emulate_pointer)
UpdateDeviceState(dev, &ev->device_event);
}
/**
@ -1864,6 +1859,11 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
goto out;
}
if (listener->state == LISTENER_AWAITING_BEGIN) {
listener->state = LISTENER_HAS_END;
goto out;
}
/* Event in response to reject */
if (ev->device_event.flags & TOUCH_REJECT) {
if (listener->state != LISTENER_HAS_END)

View file

@ -304,15 +304,16 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
flags[keybd->id] |= XIDeviceDisabled;
flags[ptr->id] |= XIDeviceDisabled;
RemoveDevice(XTestptr, FALSE);
RemoveDevice(XTestkeybd, FALSE);
RemoveDevice(keybd, FALSE);
RemoveDevice(ptr, FALSE);
flags[XTestptr->id] |= XISlaveRemoved;
flags[XTestkeybd->id] |= XISlaveRemoved;
flags[keybd->id] |= XIMasterRemoved;
flags[ptr->id] |= XIMasterRemoved;
RemoveDevice(XTestptr, FALSE);
RemoveDevice(XTestkeybd, FALSE);
RemoveDevice(keybd, FALSE);
RemoveDevice(ptr, FALSE);
unwind:
return rc;
}

View file

@ -50,7 +50,7 @@ int
SProcXIPassiveGrabDevice(ClientPtr client)
{
int i;
xXIModifierInfo *mods;
uint32_t *mods;
REQUEST(xXIPassiveGrabDeviceReq);
@ -63,12 +63,10 @@ SProcXIPassiveGrabDevice(ClientPtr client)
swaps(&stuff->mask_len);
swaps(&stuff->num_modifiers);
mods = (xXIModifierInfo *) &stuff[1];
mods = (uint32_t *) &stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
swapl(&mods->base_mods);
swapl(&mods->latched_mods);
swapl(&mods->locked_mods);
swapl(mods);
}
return ProcXIPassiveGrabDevice(client);

View file

@ -180,8 +180,13 @@ ProcXISelectEvents(ClientPtr client)
if (CLIENT_ID(iclient->resource) == client->index)
continue;
dixLookupDevice(&tmp, evmask->deviceid, serverClient,
DixReadAccess);
if (evmask->deviceid == XIAllDevices)
tmp = inputInfo.all_devices;
else if (evmask->deviceid == XIAllMasterDevices)
tmp = inputInfo.all_master_devices;
else
dixLookupDevice(&tmp, evmask->deviceid, serverClient,
DixReadAccess);
if (!tmp)
return BadImplementation; /* this shouldn't happen */

View file

@ -300,9 +300,15 @@ wakeup_handler(pointer data, int err, pointer read_mask)
return;
action = udev_device_get_action(udev_device);
if (action) {
if (!strcmp(action, "add") || !strcmp(action, "change")) {
if (!strcmp(action, "add")) {
device_removed(udev_device);
device_added(udev_device);
} else if (!strcmp(action, "change")) {
/* ignore change for the drm devices */
if (strcmp(udev_device_get_subsystem(udev_device), "drm")) {
device_removed(udev_device);
device_added(udev_device);
}
}
else if (!strcmp(action, "remove"))
device_removed(udev_device);

View file

@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.13.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2012-09-05"
RELEASE_NAME="Iced Tea"
AC_INIT([xorg-server], 1.13.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2013-04-17"
RELEASE_NAME="Pokey Stick"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE

View file

@ -306,6 +306,9 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
/* unity matrix */
memset(transform, 0, sizeof(transform));
transform[0] = transform[4] = transform[8] = 1.0f;
dev->transform.m[0][0] = 1.0;
dev->transform.m[1][1] = 1.0;
dev->transform.m[2][2] = 1.0;
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM),
XIGetKnownProperty(XATOM_FLOAT), 32,
@ -440,6 +443,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
if (*prev != dev)
return FALSE;
TouchEndPhysicallyActiveTouches(dev);
ReleaseButtonsAndKeys(dev);
SyncRemoveDeviceIdleTime(dev->idle_counter);
dev->idle_counter = NULL;
@ -510,6 +514,12 @@ DisableAllDevices(void)
{
DeviceIntPtr dev, tmp;
/* Disable slave devices first, excluding XTest devices */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (!IsXTestDevice(dev, NULL) && !IsMaster(dev))
DisableDevice(dev, FALSE);
}
/* Disable XTest devices */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (!IsMaster(dev))
DisableDevice(dev, FALSE);

View file

@ -1435,6 +1435,7 @@ UpdateTouchesForGrab(DeviceIntPtr mouse)
ti->listeners[0].type = LISTENER_POINTER_GRAB;
else
ti->listeners[0].type = LISTENER_GRAB;
ti->listeners[0].grab = grab;
}
}
}
@ -1503,11 +1504,27 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
{
GrabPtr grab = mouse->deviceGrab.grab;
DeviceIntPtr dev;
Bool wasPassive = mouse->deviceGrab.fromPassiveGrab;
Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab &&
mouse->deviceGrab.implicitGrab);
XID grab_resource = grab->resource;
int i;
/* If an explicit grab was deactivated, we must remove it from the head of
* all the touches' listener lists. */
for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) {
TouchPointInfoPtr ti = mouse->touch->touches + i;
if (ti->active && TouchResourceIsOwner(ti, grab_resource)) {
/* Rejecting will generate a TouchEnd, but we must not
emulate a ButtonRelease here. So pretend the listener
already has the end event */
if (grab->grabtype == CORE || grab->grabtype == XI ||
!xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin))
ti->listeners[0].state = LISTENER_HAS_END;
TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
}
}
TouchRemovePointerGrab(mouse);
mouse->valuator->motionHintWindow = NullWindow;
@ -1531,15 +1548,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
ReattachToOldMaster(mouse);
ComputeFreezes();
/* If an explicit grab was deactivated, we must remove it from the head of
* all the touches' listener lists. */
for (i = 0; mouse->touch && i < mouse->touch->num_touches; i++) {
TouchPointInfoPtr ti = mouse->touch->touches + i;
if (ti->active && TouchResourceIsOwner(ti, grab_resource))
TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
}
}
/**
@ -1555,11 +1563,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
WindowPtr oldWin;
/* slave devices need to float for the duration of the grab. */
if (grab->grabtype == XI2 &&
if (grab->grabtype == XI2 && keybd->enabled &&
!(passive & ImplicitGrabMask) && !IsMaster(keybd))
DetachFromMaster(keybd);
if (grabinfo->grab)
if (!keybd->enabled)
oldWin = NULL;
else if (grabinfo->grab)
oldWin = grabinfo->grab->window;
else if (keybd->focus)
oldWin = keybd->focus->win;
@ -1569,7 +1579,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
oldWin = keybd->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
if (oldWin)
DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
if (syncEvents.playingEvents)
grabinfo->grabTime = syncEvents.time;
else
@ -1590,13 +1601,10 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
{
GrabPtr grab = keybd->deviceGrab.grab;
DeviceIntPtr dev;
WindowPtr focusWin = keybd->focus ? keybd->focus->win
: keybd->spriteInfo->sprite->win;
WindowPtr focusWin;
Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab &&
keybd->deviceGrab.implicitGrab);
if (focusWin == FollowKeyboardWin)
focusWin = inputInfo.keyboard->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
keybd->deviceGrab.grab = NullGrab;
@ -1607,6 +1615,17 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
if (dev->deviceGrab.sync.other == grab)
dev->deviceGrab.sync.other = NullGrab;
}
if (keybd->focus)
focusWin = keybd->focus->win;
else if (keybd->spriteInfo->sprite)
focusWin = keybd->spriteInfo->sprite->win;
else
focusWin = NullWindow;
if (focusWin == FollowKeyboardWin)
focusWin = inputInfo.keyboard->focus->win;
DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
if (!wasImplicit && grab->grabtype == XI2)
@ -2213,7 +2232,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
* @return TRUE if the event should be discarded, FALSE otherwise.
*/
static BOOL
FilterRawEvents(const ClientPtr client, const GrabPtr grab)
FilterRawEvents(const ClientPtr client, const GrabPtr grab, WindowPtr root)
{
XIClientPtr client_xi_version;
int cmp;
@ -2229,7 +2248,10 @@ FilterRawEvents(const ClientPtr client, const GrabPtr grab)
client_xi_version->minor_version, 2, 0);
/* XI 2.0: if device is grabbed, skip
XI 2.1: if device is grabbed by us, skip, we've already delivered */
return (cmp == 0) ? TRUE : SameClient(grab, client);
if (cmp == 0)
return TRUE;
return (grab->window != root) ? FALSE : SameClient(grab, client);
}
/**
@ -2282,7 +2304,7 @@ DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
*/
ic.next = NULL;
if (!FilterRawEvents(rClient(&ic), grab))
if (!FilterRawEvents(rClient(&ic), grab, root))
DeliverEventToInputClients(device, &ic, root, xi, 1,
filter, NULL, &c, &m);
}
@ -4539,6 +4561,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
{
GrabPtr grab = mouse->deviceGrab.grab;
xXIEnterEvent *event;
WindowPtr focus;
int filter;
int btlen, len, i;
DeviceIntPtr kbd;
@ -4580,6 +4603,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
event->group.locked_group = kbd->key->xkbInfo->state.locked_group;
}
focus = (kbd) ? kbd->focus->win : None;
if ((focus != NoneWin) &&
((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
event->focus = TRUE;
FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin,
None, FALSE);
@ -5016,7 +5044,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
grab = grabInfo->grab;
if (grab && grab->grabtype != grabtype)
*status = AlreadyGrabbed;
if (grab && !SameClient(grab, client))
else if (grab && !SameClient(grab, client))
*status = AlreadyGrabbed;
else if ((!pWin->realized) ||
(confineTo &&

View file

@ -787,11 +787,33 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl
* @param[in,out] mask Valuator data for this event, modified in-place.
*/
static void
moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
{
int i;
Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
/* for abs devices in relative mode, we've just scaled wrong, since we
mapped the device's shape into the screen shape. Undo this. */
if ((flags & POINTER_ABSOLUTE) == 0 && dev->valuator &&
dev->valuator->axes[0].min_value < dev->valuator->axes[0].max_value) {
double ratio = 1.0 * screenInfo.width/screenInfo.height;
if (ratio > 1.0) {
double y;
if (valuator_mask_fetch_double(mask, 1, &y)) {
y *= ratio;
valuator_mask_set_double(mask, 1, y);
}
} else {
double x;
if (valuator_mask_fetch_double(mask, 0, &x)) {
x *= ratio;
valuator_mask_set_double(mask, 0, x);
}
}
}
/* calc other axes, clip, drop back into valuators */
for (i = 0; i < valuator_mask_size(mask); i++) {
double val = dev->last.valuators[i];
@ -844,14 +866,14 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
scaled = valuator_mask_get_double(mask, 0) + scr->x;
scaled = rescaleValuatorAxis(scaled,
NULL, dev->valuator->axes + 0,
0, scr->width);
screenInfo.x, screenInfo.width);
valuator_mask_set_double(mask, 0, scaled);
}
if (valuator_mask_isset(mask, 1)) {
scaled = valuator_mask_get_double(mask, 1) + scr->y;
scaled = rescaleValuatorAxis(scaled,
NULL, dev->valuator->axes + 1,
0, scr->height);
screenInfo.y, screenInfo.height);
valuator_mask_set_double(mask, 1, scaled);
}
}
@ -896,9 +918,9 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask,
/* scale x&y to desktop coordinates */
*screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL,
screenInfo.x, screenInfo.width);
screenInfo.x, screenInfo.width - 1);
*screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL,
screenInfo.y, screenInfo.height);
screenInfo.y, screenInfo.height - 1);
*devx = x;
*devy = y;
@ -1387,7 +1409,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
if ((flags & POINTER_NORAW) == 0)
set_raw_valuators(raw, &mask, raw->valuators.data);
moveRelative(pDev, &mask);
moveRelative(pDev, flags, &mask);
}
/* valuators are in device coordinate system in absolute coordinates */
@ -1400,8 +1422,9 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
coordinates were.
*/
if (flags & POINTER_SCREEN) {
screenx = sx;
screeny = sy;
scr = miPointerGetScreen(pDev);
screenx = sx + scr->x;
screeny = sy + scr->y;
}
scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
@ -1950,32 +1973,27 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
default:
return 0;
}
if (t->mode == XIDirectTouch && !(flags & TOUCH_CLIENT_ID)) {
if (!valuator_mask_isset(&mask, 0))
valuator_mask_set_double(&mask, 0,
valuator_mask_get_double(touchpoint.ti->
valuators, 0));
if (!valuator_mask_isset(&mask, 1))
valuator_mask_set_double(&mask, 1,
valuator_mask_get_double(touchpoint.ti->
valuators, 1));
}
/* Get our screen event co-ordinates (root_x/root_y/event_x/event_y):
* these come from the touchpoint in Absolute mode, or the sprite in
* Relative. */
if (t->mode == XIDirectTouch) {
transformAbsolute(dev, &mask);
if (!(flags & TOUCH_CLIENT_ID)) {
for (i = 0; i < valuator_mask_size(&mask); i++) {
double val;
for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) {
double val;
if (valuator_mask_fetch_double(&mask, i, &val))
valuator_mask_set_double(touchpoint.ti->valuators, i, val);
}
if (valuator_mask_fetch_double(&mask, i, &val))
valuator_mask_set_double(touchpoint.ti->valuators, i, val);
/* If the device doesn't post new X and Y axis values,
* use the last values posted.
*/
else if (i < 2 &&
valuator_mask_fetch_double(touchpoint.ti->valuators, i, &val))
valuator_mask_set_double(&mask, i, val);
}
}
transformAbsolute(dev, &mask);
clipAbsolute(dev, &mask);
}
else {

View file

@ -219,7 +219,10 @@ CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice,
grab->resource = FakeClientID(client);
grab->device = device;
grab->window = window;
grab->eventMask = mask->core; /* same for XI */
if (grabtype == CORE || grabtype == XI)
grab->eventMask = mask->core; /* same for XI */
else
grab->eventMask = 0;
grab->deviceMask = 0;
grab->ownerEvents = param->ownerEvents;
grab->keyboardMode = param->this_device_mode;

View file

@ -572,8 +572,8 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
return FALSE;
/* Mark which grabs/event selections we're delivering to: max one grab per
* window plus the bottom-most event selection. */
ti->listeners = calloc(sprite->spriteTraceGood + 1, sizeof(*ti->listeners));
* window plus the bottom-most event selection, plus any active grab. */
ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners));
if (!ti->listeners) {
sprite->spriteTraceGood = 0;
return FALSE;
@ -682,15 +682,20 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
* Add the resource to this touch's listeners.
*/
void
TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
enum TouchListenerType type, enum TouchListenerState state,
WindowPtr window)
TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
enum InputLevel level, enum TouchListenerType type,
enum TouchListenerState state, WindowPtr window,
GrabPtr grab)
{
ti->listeners[ti->num_listeners].listener = resource;
ti->listeners[ti->num_listeners].resource_type = resource_type;
ti->listeners[ti->num_listeners].level = level;
ti->listeners[ti->num_listeners].state = state;
ti->listeners[ti->num_listeners].type = type;
ti->listeners[ti->num_listeners].window = window;
ti->listeners[ti->num_listeners].grab = grab;
if (grab)
ti->num_grabs++;
ti->num_listeners++;
}
@ -709,6 +714,11 @@ TouchRemoveListener(TouchPointInfoPtr ti, XID resource)
if (ti->listeners[i].listener == resource) {
int j;
if (ti->listeners[i].grab) {
ti->listeners[i].grab = NULL;
ti->num_grabs--;
}
for (j = i; j < ti->num_listeners - 1; j++)
ti->listeners[j] = ti->listeners[j + 1];
ti->num_listeners--;
@ -739,9 +749,9 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
type = LISTENER_POINTER_GRAB;
}
TouchAddListener(ti, grab->resource, grab->grabtype,
type, LISTENER_AWAITING_BEGIN, grab->window);
ti->num_grabs++;
/* grab listeners are always RT_NONE since we keep the grab pointer */
TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype,
type, LISTENER_AWAITING_BEGIN, grab->window, grab);
}
/**
@ -796,8 +806,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (!xi2mask_isset(iclients->xi2mask, dev, XI_TouchOwnership))
TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, XI2,
type, LISTENER_AWAITING_BEGIN, win);
TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2,
type, LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE;
}
}
@ -811,9 +821,9 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
continue;
TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, XI,
TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win);
win, NULL);
return TRUE;
}
}
@ -826,9 +836,9 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* window owner */
if (IsMaster(dev) && (win->eventMask & core_filter)) {
TouchEventHistoryAllocate(ti);
TouchAddListener(ti, win->drawable.id, CORE,
TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win);
win, NULL);
return TRUE;
}
@ -838,8 +848,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
continue;
TouchEventHistoryAllocate(ti);
TouchAddListener(ti, oclients->resource, CORE,
type, LISTENER_AWAITING_BEGIN, win);
TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE,
type, LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE;
}
}
@ -994,8 +1004,6 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
for (i = 0; i < nev; i++)
mieqProcessDeviceEvent(dev, events + i, NULL);
ProcessInputEvents();
FreeEventList(events, GetMaximumEventsNum());
return nev ? Success : BadMatch;
@ -1029,3 +1037,31 @@ TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
return TouchListenerAcceptReject(dev, ti, i, mode);
}
/**
* End physically active touches for a device.
*/
void
TouchEndPhysicallyActiveTouches(DeviceIntPtr dev)
{
InternalEvent *eventlist = InitEventList(GetMaximumEventsNum());
int i;
OsBlockSignals();
mieqProcessInputEvents();
for (i = 0; i < dev->last.num_touches; i++) {
DDXTouchPointInfoPtr ddxti = dev->last.touches + i;
if (ddxti->active) {
int j;
int nevents = GetTouchEvents(eventlist, dev, ddxti->ddx_id,
XI_TouchEnd, 0, NULL);
for (j = 0; j < nevents; j++)
mieqProcessDeviceEvent(dev, eventlist + j, NULL);
}
}
OsReleaseSignals();
FreeEventList(eventlist, GetMaximumEventsNum());
}

View file

@ -1431,6 +1431,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
}
}
CursorVisible = TRUE;
if (pWin->realized)
WindowHasNewCursor(pWin);
@ -3132,6 +3134,8 @@ dixSaveScreens(ClientPtr client, int on, int mode)
UpdateCurrentTimeIf();
nt_list_for_each_entry(dev, inputInfo.devices, next)
lastDeviceEventTime[dev->id] = currentTime;
lastDeviceEventTime[XIAllDevices] = currentTime;
lastDeviceEventTime[XIAllMasterDevices] = currentTime;
}
SetScreenSaverTimer();
}
@ -3465,6 +3469,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
}
out:
CursorVisible = TRUE;
if (pWin->realized)
WindowHasNewCursor(pWin);

View file

@ -209,6 +209,7 @@ typedef struct {
RegionRec srcReg;
RegionRec maskReg;
PixmapPtr srcPix;
PixmapPtr maskPix;
DevPrivateKeyRec pixmapPrivateKeyRec;
DevPrivateKeyRec gcPrivateKeyRec;

View file

@ -442,6 +442,13 @@ ExaSrcValidate(DrawablePtr pDrawable,
RegionPtr dst;
int xoff, yoff;
if (pExaScr->srcPix == pPix)
dst = &pExaScr->srcReg;
else if (pExaScr->maskPix == pPix)
dst = &pExaScr->maskReg;
else
return;
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
box.x1 = x + xoff;
@ -449,8 +456,6 @@ ExaSrcValidate(DrawablePtr pDrawable,
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : &pExaScr->maskReg;
RegionInit(&reg, &box, 1);
RegionUnion(dst, dst, &reg);
RegionUninit(&reg);
@ -495,16 +500,19 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
if (pSrc != pDst)
RegionTranslate(pSrc->pCompositeClip,
-pSrc->pDrawable->x, -pSrc->pDrawable->y);
}
} else
pExaScr->srcPix = NULL;
if (pMask && pMask->pDrawable) {
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
RegionNull(&pExaScr->maskReg);
maskReg = &pExaScr->maskReg;
pExaScr->maskPix = pMaskPix;
if (pMask != pDst && pMask != pSrc)
RegionTranslate(pMask->pCompositeClip,
-pMask->pDrawable->x, -pMask->pDrawable->y);
}
} else
pExaScr->maskPix = NULL;
RegionTranslate(pDst->pCompositeClip,
-pDst->pDrawable->x, -pDst->pDrawable->y);

View file

@ -514,7 +514,7 @@ create_driver_context(__GLXDRIcontext * context,
unsigned minor_ver;
uint32_t flags;
int reset;
int api;
int api = __DRI_API_OPENGL;
if (num_attribs != 0) {
if (!dri2_convert_glx_attribs(screen, num_attribs, attribs,

View file

@ -31,9 +31,6 @@
*
*/
#ifdef HAVE_DMX_CONFIG_H
#include <dmx-config.h>
#endif
#include <stdio.h>
#include <stdlib.h>

View file

@ -346,6 +346,8 @@ dmxComputeScreenOrigins(void)
screenInfo.screens[i]->y -= minY;
}
}
update_desktop_dimensions();
}
/** Recompute origin information in the #dmxScreens list. This is

View file

@ -237,13 +237,11 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height);
KdSetPointerMatrix(&m);
priv->bytes_per_line =
((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
buffer_height = ephyrBufferHeight(screen);
priv->base =
hostx_screen_init(screen, screen->width, screen->height, buffer_height);
hostx_screen_init(screen, screen->width, screen->height, buffer_height,
&priv->bytes_per_line, &screen->fb.bitsPerPixel);
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
scrpriv->shadow = FALSE;

View file

@ -617,7 +617,8 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(EphyrScreenInfo screen,
int width, int height, int buffer_height)
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel)
{
int bitmap_pad;
Bool shm_success = False;
@ -694,6 +695,9 @@ hostx_screen_init(EphyrScreenInfo screen,
malloc(host_screen->ximg->bytes_per_line * buffer_height);
}
*bytes_per_line = host_screen->ximg->bytes_per_line;
*bits_per_pixel = host_screen->ximg->bits_per_pixel;
XResizeWindow(HostX.dpy, host_screen->win, width, height);
/* Ask the WM to keep our size static */

View file

@ -193,7 +193,8 @@ hostx_set_cmap_entry(unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(EphyrScreenInfo screen,
int width, int height, int buffer_height);
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel);
void

View file

@ -66,6 +66,7 @@ from The Open Group.
#endif /* HAS_SHM */
#include "dix.h"
#include "miline.h"
#include "glx_extinit.h"
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
@ -885,12 +886,30 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
} /* end vfbScreenInit */
static const ExtensionModule vfbExtensions[] = {
#ifdef GLXEXT
{ GlxExtensionInit, "GLX", &noGlxExtension },
#endif
};
static
void vfbExtensionInit(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(vfbExtensions); i++)
LoadExtension(&vfbExtensions[i], TRUE);
}
void
InitOutput(ScreenInfo * screenInfo, int argc, char **argv)
{
int i;
int NumFormats = 0;
if (serverGeneration == 1)
vfbExtensionInit();
/* initialize pixmap formats */
/* must have a pixmap depth to match every screen depth */

View file

@ -15,6 +15,7 @@ XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h
endif
if XF86VIDMODE
XF86VMODESOURCES = xf86vmode.c
XF86VMODE_SDK = vidmodeproc.h
endif
@ -47,7 +48,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
xf86VidMode.c xf86fbman.c xf86cmap.c \
xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
xf86Mode.c xorgHelper.c xf86Extensions.h \
xf86Extensions.c xf86vmode.c \
xf86Extensions.c $(XF86VMODESOURCES) \
$(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la

View file

@ -468,4 +468,8 @@ extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
/* flags passed to xf86 allocate screen */
#define XF86_ALLOCATE_GPU_SCREEN 1
/* Update the internal total dimensions of all ScreenRecs together */
extern _X_EXPORT void
xf86UpdateDesktopDimensions(void);
#endif /* _XF86_H */

View file

@ -81,6 +81,8 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
if (drv->platformProbe != NULL) {
foundScreen = xf86platformProbeDev(drv);
}
if (ServerIsNotSeat0())
return foundScreen;
#endif
#ifdef XSERVER_LIBPCIACCESS
@ -214,6 +216,8 @@ xf86BusProbe(void)
{
#ifdef XSERVER_PLATFORM_BUS
xf86platformProbe();
if (ServerIsNotSeat0())
return;
#endif
#ifdef XSERVER_LIBPCIACCESS
xf86PciProbe();

View file

@ -1033,6 +1033,9 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd)
UpdateDeviceState(keybd, &ev);
if (!IsMaster(keybd))
return;
/*
* Deliver the DGA event
*/
@ -1074,6 +1077,7 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
DeviceEvent ev = {
.header = ET_Internal,
.length = sizeof(ev),
.detail.key = event->detail,
.type = event->subtype,
.corestate = butc ? butc->state : 0
};
@ -1083,6 +1087,9 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse)
UpdateDeviceState(mouse, &ev);
if (!IsMaster(mouse))
return;
/*
* Deliver the DGA event
*/
@ -1190,9 +1197,6 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device)
if (!pScreenPriv)
return;
if (!IsMaster(device))
return;
switch (event->subtype) {
case KeyPress:
case KeyRelease:

View file

@ -180,6 +180,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
switch (action) {
case ACTION_TERMINATE:
if (!xf86Info.dontZap) {
xf86Msg(X_INFO, "Server zapped. Shutting down.\n");
#ifdef XFreeXDGA
DGAShutdown();
#endif
@ -271,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
}
if (err >= 0) { /* we don't want the handlers called if select() */
IHPtr ih; /* returned with an error condition, do we? */
IHPtr ih, ih_tmp; /* returned with an error condition, do we? */
for (ih = InputHandlers; ih; ih = ih->next) {
nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) {
if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
(FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) {
ih->ihproc(ih->fd, ih->data);
@ -618,14 +619,16 @@ InputHandlerProc
xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
{
static IHPtr handler = NULL;
IHPtr old_handler = handler;
InputHandlerProc old_proc = NULL;
if (old_handler)
xf86RemoveGeneralHandler(old_handler);
if (handler) {
old_proc = handler->ihproc;
xf86RemoveGeneralHandler(handler);
}
handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
return (old_handler) ? old_handler->ihproc : NULL;
return old_proc;
}
static void

View file

@ -1898,3 +1898,9 @@ xf86ScrnToScreen(ScrnInfoPtr pScrn)
return screenInfo.screens[pScrn->scrnIndex];
}
}
void
xf86UpdateDesktopDimensions(void)
{
update_desktop_dimensions();
}

View file

@ -80,7 +80,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(13, 0)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(13, 1)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(18, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(7, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)

View file

@ -213,11 +213,12 @@ xf86platformProbe(void)
int i;
Bool pci = TRUE;
config_odev_probe(xf86PlatformDeviceProbe);
if (!xf86scanpci()) {
pci = FALSE;
}
config_odev_probe(&xf86PlatformDeviceProbe);
for (i = 0; i < xf86_num_platform_devices; i++) {
char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
@ -358,6 +359,9 @@ xf86platformProbeDev(DriverPtr drvp)
break;
}
else {
/* for non-seat0 servers assume first device is the master */
if (ServerIsNotSeat0())
break;
if (xf86_platform_devices[j].pdev) {
if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
break;

View file

@ -766,6 +766,44 @@ static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable)
}
}
/*
* A TraverseTree callback to invalidate all windows using the same
* pixmap
*/
static int
DRI2InvalidateWalk(WindowPtr pWin, pointer data)
{
if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
return WT_DONTWALKCHILDREN;
DRI2InvalidateDrawable(&pWin->drawable);
return WT_WALKCHILDREN;
}
static void
DRI2InvalidateDrawableAll(DrawablePtr pDraw)
{
if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDraw;
PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin);
/*
* Find the top-most window using this pixmap
*/
while (pWin->parent &&
pDraw->pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
pWin = pWin->parent;
/*
* Walk the sub-tree to invalidate all of the
* windows using the same pixmap
*/
TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
DRI2InvalidateDrawable(&pPixmap->drawable);
}
else
DRI2InvalidateDrawable(pDraw);
}
DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
{
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
@ -831,6 +869,8 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
spix->screen_x = mpix->screen_x;
spix->screen_y = mpix->screen_y;
#endif
DRI2InvalidateDrawableAll(pDraw);
return &spix->drawable;
}
@ -1048,18 +1088,7 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
return FALSE;
}
/*
* A TraverseTree callback to invalidate all windows using the same
* pixmap
*/
static int
DRI2InvalidateWalk(WindowPtr pWin, pointer data)
{
if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
return WT_DONTWALKCHILDREN;
DRI2InvalidateDrawable(&pWin->drawable);
return WT_WALKCHILDREN;
}
int
DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
@ -1162,26 +1191,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
*/
*swap_target = pPriv->swap_count + pPriv->swapsPending;
if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDraw;
PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
/*
* Find the top-most window using this pixmap
*/
while (pWin->parent &&
pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
pWin = pWin->parent;
/*
* Walk the sub-tree to invalidate all of the
* windows using the same pixmap
*/
TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
DRI2InvalidateDrawable(&pPixmap->drawable);
}
else
DRI2InvalidateDrawable(pDraw);
DRI2InvalidateDrawableAll(pDraw);
return Success;
}

View file

@ -66,6 +66,7 @@ xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs)
config = xnfcalloc(1, sizeof(xf86CrtcConfigRec));
config->funcs = funcs;
config->compat_output = -1;
scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config;
}
@ -742,16 +743,8 @@ xf86CrtcCloseScreen(ScreenPtr screen)
}
/* detach any providers */
if (config->randr_provider) {
if (config->randr_provider->offload_sink) {
DetachOffloadGPU(screen);
config->randr_provider->offload_sink = NULL;
}
else if (config->randr_provider->output_source) {
DetachOutputGPU(screen);
config->randr_provider->output_source = NULL;
}
else if (screen->current_master)
DetachUnboundGPU(screen);
RRProviderDestroy(config->randr_provider);
config->randr_provider = NULL;
}
return TRUE;
}
@ -1841,11 +1834,15 @@ SetCompatOutput(xf86CrtcConfigPtr config)
if (compat >= 0) {
config->compat_output = compat;
}
else {
else if (config->compat_output >= 0 && config->compat_output < config->num_output) {
/* Don't change the compat output when no valid outputs found */
output = config->output[config->compat_output];
}
/* All outputs are disconnected, select one to fake */
if (!output && config->num_output)
output = config->output[0];
return output;
}

View file

@ -1885,6 +1885,27 @@ xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, i
}
}
static void
xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
if (config->randr_provider == provider) {
if (config->randr_provider->offload_sink) {
DetachOffloadGPU(screen);
config->randr_provider->offload_sink = NULL;
}
else if (config->randr_provider->output_source) {
DetachOutputGPU(screen);
config->randr_provider->output_source = NULL;
}
else if (screen->current_master)
DetachUnboundGPU(screen);
}
config->randr_provider = NULL;
}
static Bool
xf86RandR12Init12(ScreenPtr pScreen)
{
@ -1914,6 +1935,7 @@ xf86RandR12Init12(ScreenPtr pScreen)
rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
rp->rrProviderDestroy = xf86RandR14ProviderDestroy;
pScrn->PointerMoved = xf86RandR12PointerMoved;
pScrn->ChangeGamma = xf86RandR12ChangeGamma;

View file

@ -421,7 +421,8 @@ xf86FlushInput(int fd)
{
fd_set fds;
struct timeval timeout;
char c[4];
/* this needs to be big enough to flush an evdev event. */
char c[256];
DebugF("FlushingSerial\n");
if (tcflush(fd, TCIFLUSH) == 0)

View file

@ -20,6 +20,10 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

View file

@ -231,13 +231,15 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
}
// TODO: Make PseudoColor visuals not suck in TrueColor mode
// if(dfb->depth > 8)
// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
if (dfb->depth > 15)
miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor,
RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5,
5),
BM_ARGB(0, 5, 5, 5));
// if(dfb->depth > 8)
// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
//
// TODO: Re-add support for 15bit
// if (dfb->depth > 15)
// miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor,
// RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5,
// 5),
// BM_ARGB(0, 5, 5, 5));
if (dfb->depth > 24)
miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor,
RM_ARGB(0, 8, 8, 8), GM_ARGB(0, 8, 8,

View file

@ -64,6 +64,7 @@
#include "mi.h"
#include "mipointer.h"
#include "rootless.h"
#include "rootlessCommon.h"
#include "x-hash.h"
#include "x-hook.h"
#include "driWrap.h"
@ -380,6 +381,11 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id,
DRIDrawablePrivPtr pDRIDrawablePriv;
if (pDrawable->type == DRAWABLE_WINDOW) {
/* <rdar://problem/12338921>
* http://bugs.winehq.org/show_bug.cgi?id=31751
*/
RootlessStopDrawing((WindowPtr)pDrawable, FALSE);
pDRIDrawablePriv = CreateSurfaceForWindow(pScreen,
(WindowPtr)pDrawable, &wid);

View file

@ -49,6 +49,10 @@
#include <pthread.h>
#endif
#ifdef DEBUG_XP_LOCK_WINDOW
#include <execinfo.h>
#endif
#define DEFINE_ATOM_HELPER(func, atom_name) \
static Atom func(void) { \
static int generation; \
@ -376,6 +380,18 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
unsigned int rowbytes[2];
xp_error err;
#ifdef DEBUG_XP_LOCK_WINDOW
void* callstack[128];
int i, frames = backtrace(callstack, 128);
char** strs = backtrace_symbols(callstack, frames);
ErrorF("=== LOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid));
for (i = 0; i < frames; ++i) {
ErrorF(" %s\n", strs[i]);
}
free(strs);
#endif
err = xp_lock_window(x_cvt_vptr_to_uint(
wid), NULL, NULL, data, rowbytes, NULL);
if (err != Success)
@ -395,6 +411,18 @@ xprStopDrawing(RootlessFrameID wid, Bool flush)
{
xp_error err;
#ifdef DEBUG_XP_LOCK_WINDOW
void* callstack[128];
int i, frames = backtrace(callstack, 128);
char** strs = backtrace_symbols(callstack, frames);
ErrorF("=== UNLOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid));
for (i = 0; i < frames; ++i) {
ErrorF(" %s\n", strs[i]);
}
free(strs);
#endif
err = xp_unlock_window(x_cvt_vptr_to_uint(wid), flush);
/* This should be a FatalError, but we started tripping over it. Make it a
* FatalError after http://xquartz.macosforge.org/trac/ticket/482 is fixed.

View file

@ -359,6 +359,10 @@ have_depth:
dfb->blueMask = 0;
break;
#if 0
// Removed because Mountain Lion removed support for
// 15bit backing stores. We can possibly re-add
// this once libXplugin is updated to work around it.
case 15:
dfb->visuals = TrueColorMask; //LARGE_VISUALS;
dfb->preferredCVC = TrueColor;
@ -369,6 +373,7 @@ have_depth:
dfb->greenMask = GM_ARGB(0, 5, 5, 5);
dfb->blueMask = BM_ARGB(0, 5, 5, 5);
break;
#endif
// case 24:
default:

View file

@ -164,7 +164,7 @@ void XwinExtensionInit(void)
int i;
#ifdef XWIN_GLX_WINDOWS
if ((g_fNativeGl) && (serverGeneration == 1)) {
if (g_fNativeGl) {
/* install the native GL provider */
glxWinPushNativeProvider();
}
@ -901,7 +901,8 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
{
int i;
XwinExtensionInit();
if (serverGeneration == 1)
XwinExtensionInit();
/* Log the command line */
winLogCommandLine(argc, argv);

View file

@ -109,13 +109,16 @@ SRCS = InitInput.c \
winclipboard.h \
winconfig.h \
win.h \
winglobals.h \
winkeybd.h \
winkeynames.h \
winlayouts.h \
winmessages.h \
winmonitors.h \
winmsg.h \
winms.h \
winmultiwindowclass.h \
winmultiwindowicons.h \
winprefs.h \
winresource.h \
winwindow.h \

View file

@ -6,7 +6,8 @@ libXwinGLX_la_SOURCES = \
glwindows.h \
glwrap.c \
indirect.c \
wgl_ext_api.c
wgl_ext_api.c \
wgl_ext_api.h
if XWIN_MULTIWINDOW
DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW

View file

@ -560,9 +560,9 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev,
XID resource);
extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource,
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
enum InputLevel level, enum TouchListenerType type,
enum TouchListenerState state, WindowPtr window);
enum TouchListenerState state, WindowPtr window, GrabPtr grab);
extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti,
InternalEvent *ev);
@ -579,6 +579,7 @@ extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti,
int listener, int mode);
extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
uint32_t touchid, Window grab_window, XID *error);
extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
/* misc event helpers */
extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
@ -627,6 +628,11 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
* CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
*/
extern Bool CursorVisible;
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,

View file

@ -298,6 +298,17 @@ typedef struct _ValuatorClassRec {
int v_scroll_axis; /* vert smooth-scrolling axis */
} ValuatorClassRec;
typedef struct _TouchListener {
XID listener; /* grabs/event selection IDs receiving
* events for this touch */
int resource_type; /* listener's resource type */
enum TouchListenerType type;
enum TouchListenerState state;
enum InputLevel level; /* matters only for emulating touches */
WindowPtr window;
GrabPtr grab;
} TouchListener;
typedef struct _TouchPointInfo {
uint32_t client_id; /* touch ID as seen in client events */
int sourceid; /* Source device's ID for this touchpoint */
@ -306,14 +317,7 @@ typedef struct _TouchPointInfo {
* but still owned by a grab */
SpriteRec sprite; /* window trace for delivery */
ValuatorMask *valuators; /* last recorded axis values */
struct _TouchListener {
XID listener; /* grabs/event selection IDs receiving
* events for this touch */
enum TouchListenerType type;
enum TouchListenerState state;
enum InputLevel level; /* matters only for emulating touches */
WindowPtr window;
} *listeners;
TouchListener *listeners; /* set of listeners */
int num_listeners;
int num_grabs; /* number of open grabs on this touch
* which have not accepted or rejected */
@ -323,15 +327,13 @@ typedef struct _TouchPointInfo {
size_t history_size; /* Size of history in elements */
} TouchPointInfoRec;
typedef struct _TouchListener TouchListener;
typedef struct _DDXTouchPointInfo {
uint32_t client_id; /* touch ID as seen in client events */
Bool active; /* whether or not the touch is active */
uint32_t ddx_id; /* touch ID given by the DDX */
Bool emulate_pointer;
ValuatorMask *valuators; /* last recorded axis values */
ValuatorMask *valuators; /* last axis values as posted, pre-transform */
} DDXTouchPointInfoRec;
typedef struct _TouchClassRec {

View file

@ -65,7 +65,7 @@
/* RandR */
#define SERVER_RANDR_MAJOR_VERSION 1
#define SERVER_RANDR_MINOR_VERSION 3
#define SERVER_RANDR_MINOR_VERSION 4
/* Record */
#define SERVER_RECORD_MAJOR_VERSION 1

View file

@ -171,6 +171,7 @@ typedef struct _XkbSrvInfo {
KeyCode mouseKey;
KeyCode inactiveKey;
KeyCode slowKey;
KeyCode slowKeyEnableKey;
KeyCode repeatKey;
CARD8 krgTimerActive;
CARD8 beepType;

View file

@ -28,7 +28,7 @@ AC_DEFUN([XORG_TLS], [
ac_cv_tls=none
keywords="__thread __declspec(thread)"
for kw in $keywords ; do
AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw)
AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw ; break ;)
done
])
AC_MSG_RESULT($ac_cv_tls)

View file

@ -130,7 +130,7 @@ causes the server to generate a core dump on fatal errors.
.B \-displayfd \fIfd\fP
specifies a file descriptor in the launching process. Rather than specify
a display number, the X server will attempt to listen on successively higher
display numbers, and upon finding a free one, will write the port number back
display numbers, and upon finding a free one, will write the display number back
on this file descriptor as a newline-terminated string. The \-pn option is
ignored when using \-displayfd.
.TP 8

View file

@ -623,7 +623,11 @@ mieqProcessInputEvents(void)
mieqProcessDeviceEvent(dev, &event, screen);
/* Update the sprite now. Next event may be from different device. */
if (event.any.type == ET_Motion && master)
if (master &&
(event.any.type == ET_Motion ||
((event.any.type == ET_TouchBegin ||
event.any.type == ET_TouchUpdate) &&
event.device_event.flags & TOUCH_POINTER_EMULATED)))
miPointerUpdateSprite(dev);
#ifdef XQUARTZ

View file

@ -212,10 +212,12 @@ EnableDisableExtension(const char *name, Bool enable)
void
EnableDisableExtensionError(const char *name, Bool enable)
{
ExtensionToggle *ext = &ExtensionToggleList[0];
ExtensionToggle *ext;
int i;
Bool found = FALSE;
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
ext = &ExtensionToggleList[i];
if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) {
ErrorF("[mi] Extension \"%s\" can not be disabled\n", name);
found = TRUE;
@ -226,7 +228,8 @@ EnableDisableExtensionError(const char *name, Bool enable)
ErrorF("[mi] Extension \"%s\" is not recognized\n", name);
ErrorF("[mi] Only the following extensions can be run-time %s:\n",
enable ? "enabled" : "disabled");
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
ext = &ExtensionToggleList[i];
if (ext->disablePtr != NULL) {
ErrorF("[mi] %s\n", ext->name);
}

View file

@ -27,6 +27,10 @@
* SUCH DAMAGE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

View file

@ -264,6 +264,8 @@ RRInit(void)
return FALSE;
if (!RROutputInit())
return FALSE;
if (!RRProviderInit())
return FALSE;
RRGeneration = serverGeneration;
}
if (!dixRegisterPrivateKey(&rrPrivKeyRec, PRIVATE_SCREEN, 0))

View file

@ -57,7 +57,7 @@
#define RANDR_13_INTERFACE 1 /* requires RANDR_12_INTERFACE */
#define RANDR_GET_CRTC_INTERFACE 1
#define RANDR_INTERFACE_VERSION 0x0103
#define RANDR_INTERFACE_VERSION 0x0104
typedef XID RRMode;
typedef XID RROutput;
@ -232,6 +232,9 @@ typedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen,
RRProviderPtr offload_sink);
typedef void (*RRProviderDestroyProcPtr)(ScreenPtr pScreen,
RRProviderPtr provider);
/* These are for 1.0 compatibility */
typedef struct _rrRefresh {
@ -330,6 +333,9 @@ typedef struct _rrScrPriv {
Bool discontiguous;
RRProviderPtr provider;
RRProviderDestroyProcPtr rrProviderDestroy;
} rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;

View file

@ -372,6 +372,11 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
if (crtc->scanout_pixmap) {
master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
/*
* Unref the pixmap twice: once for the original reference, and once
* for the reference implicitly added by PixmapShareToSlave.
*/
master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap);
}

View file

@ -389,6 +389,8 @@ RRProviderDestroyResource (pointer value, XID pid)
{
rrScrPriv(pScreen);
if (pScrPriv->rrProviderDestroy)
(*pScrPriv->rrProviderDestroy)(pScreen, provider);
pScrPriv->provider = NULL;
}
free(provider);

View file

@ -143,6 +143,8 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen,
Bool activeDevice = FALSE;
CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */
Unwrap(as, pScreen, BlockHandler);
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) {
if (!activeDevice) {
@ -180,7 +182,6 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen,
if (activeDevice)
AdjustWaitForDelay(pTimeout, soonest - now);
Unwrap(as, pScreen, BlockHandler);
(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
if (activeDevice)
Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);

View file

@ -139,8 +139,7 @@ typedef struct _CursorScreen {
#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt)
/* The cursor doesn't show up until the first XDefineCursor() */
static Bool CursorVisible = FALSE;
Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
static Bool
@ -152,12 +151,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
Unwrap(cs, pScreen, DisplayCursor, backupProc);
/*
* Have to check ConnectionInfo to distinguish client requests from
* initial root window setup. Not a great way to do it, I admit.
*/
if (ConnectionInfo)
CursorVisible = EnableCursor;
CursorVisible = CursorVisible && EnableCursor;
if (cs->pCursorHideCounts != NULL || !CursorVisible) {
ret = (*pScreen->DisplayCursor) (pDev, pScreen, NullCursor);
@ -1090,7 +1084,11 @@ barrier_is_blocking(const struct PointerBarrier * barrier,
if (dir & BarrierNegativeX && x1 == (barrier->x1 - 1))
return FALSE;
/* startpoint adjacent to barrier, moving towards -> block */
if (x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) {
if (dir & BarrierPositiveX && x1 == (barrier->x1 - 1) && y1 >= barrier->y1 && y1 <= barrier->y2) {
*distance = 0;
return TRUE;
}
if (dir & BarrierNegativeX && x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) {
*distance = 0;
return TRUE;
}
@ -1102,7 +1100,11 @@ barrier_is_blocking(const struct PointerBarrier * barrier,
if (dir & BarrierNegativeY && y1 == (barrier->y1 - 1))
return FALSE;
/* startpoint adjacent to barrier, moving towards -> block */
if (y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) {
if (dir & BarrierPositiveY && y1 == (barrier->y1 - 1) && x1 >= barrier->x1 && x1 <= barrier->x2) {
*distance = 0;
return TRUE;
}
if (dir & BarrierNegativeY && y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) {
*distance = 0;
return TRUE;
}

View file

@ -74,7 +74,7 @@ ProcXFixesQueryVersion(ClientPtr client)
if (version_compare(stuff->majorVersion, stuff->minorVersion,
SERVER_XFIXES_MAJOR_VERSION,
SERVER_XFIXES_MAJOR_VERSION) < 0) {
SERVER_XFIXES_MINOR_VERSION) < 0) {
rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion;
}

View file

@ -291,8 +291,8 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
return 4000;
}
xkbi->krgTimerActive = _OFF_TIMER;
cn.keycode = 0;
cn.eventType = 0;
cn.keycode = xkbi->slowKeyEnableKey;
cn.eventType = KeyPress;
cn.requestMajor = 0;
cn.requestMinor = 0;
if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
@ -304,6 +304,7 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
}
xkbi->slowKeyEnableKey = 0;
return 0;
}
@ -462,6 +463,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
if (ctrls->enabled_ctrls & XkbAccessXKeysMask) {
/* check for magic sequences */
if ((sym[0] == XK_Shift_R) || (sym[0] == XK_Shift_L)) {
xkbi->slowKeyEnableKey = key;
if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) {
xkbi->krgTimerActive = _KRG_WARN_TIMER;
xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000,
@ -709,7 +711,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
DeviceEvent *event = &ev->device_event;
dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
dev = (IsMaster(mouse) || IsFloating(mouse)) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
if (dev && dev->key) {
xkbi = dev->key->xkbInfo;
@ -721,23 +723,27 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
changed |= XkbPointerButtonMask;
}
else if (event->type == ET_ButtonRelease) {
if (xkbi) {
xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
if (IsMaster(dev)) {
DeviceIntPtr source;
int rc;
if (IsMaster(dev)) {
DeviceIntPtr source;
int rc;
rc = dixLookupDevice(&source, event->sourceid, serverClient,
DixWriteAccess);
if (rc != Success)
ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
event->sourceid);
else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) {
DeviceIntPtr xtest_device;
rc = dixLookupDevice(&source, event->sourceid, serverClient,
DixWriteAccess);
if (rc != Success)
ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
event->sourceid);
else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
xtest_device = GetXTestDevice(GetMaster(dev, MASTER_POINTER));
if (button_is_down(xtest_device, ev->device_event.detail.button, BUTTON_PROCESSED))
XkbFakeDeviceButton(dev, FALSE, event->detail.key);
}
}
if (xkbi)
xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
changed |= XkbPointerButtonMask;
}

View file

@ -642,6 +642,7 @@ XkbComputeCompatState(XkbSrvInfoPtr xkbi)
CARD16 grp_mask;
XkbStatePtr state = &xkbi->state;
XkbCompatMapPtr map;
XkbControlsPtr ctrls;
if (!state || !xkbi->desc || !xkbi->desc->ctrls || !xkbi->desc->compat)
return;
@ -650,9 +651,14 @@ XkbComputeCompatState(XkbSrvInfoPtr xkbi)
grp_mask = map->groups[state->group].mask;
state->compat_state = state->mods | grp_mask;
state->compat_lookup_mods = state->lookup_mods | grp_mask;
ctrls= xkbi->desc->ctrls;
if (xkbi->desc->ctrls->enabled_ctrls & XkbIgnoreGroupLockMask)
grp_mask = map->groups[state->base_group].mask;
if (ctrls->enabled_ctrls & XkbIgnoreGroupLockMask) {
unsigned char grp = state->base_group+state->latched_group;
if (grp >= ctrls->num_groups)
grp = XkbAdjustGroup(XkbCharToInt(grp), ctrls);
grp_mask = map->groups[grp].mask;
}
state->compat_grab_mods = state->grab_mods | grp_mask;
return;
}