Commit Graph

7918 Commits

Author SHA1 Message Date
Peter Hutterer
a25f248fc3 Xi: Send Enter or Leave events with XIPassive(Un)grabNotify
If a passive enter or focus in grab activates, send additional enter or
focus events with mode XIPassiveGrabNotify to the grabbing client.
Likewise, if the grab deactivates, send additional leave or focus out
events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-28 15:02:35 +10:00
Adam Jackson
2107becb0c xfree86: Remove unused (and useless) xf86{Add,Delete}ModuleInfo 2009-05-27 17:13:19 -04:00
Federico Mena Quintero
e08c6a0752 randr: bug #21554 - re-probe outputs when coming back from laptop unsuspend
Make xf86 RANDR wrap the EnterVT call chain, so it can re-probe the
outputs when a laptop comes back from suspend/unsuspend (actually, any
time that we enter our VT again).  The X server should then send RR*
events to clients, so they can cope with a monitor that was unplugged
while the laptop was suspended.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-05-27 15:57:29 -04:00
Søren Sandmann Pedersen
b12010e10f Merge branch 'master' of git+ssh://sandmann@git.freedesktop.org/git/xorg/xserver 2009-05-27 15:56:30 -04:00
Søren Sandmann Pedersen
6e69272473 Fix alpha map computation in miComputeCompositeRegion()
According to the RENDER spec, the origin of the alpha map is
interpreted relative to the origin of the drawable of the image, not
the origin of the drawable of the alpha map.

This commit fixes that and adds an alpha-test.c test program.

The only use of alpha maps I have been able to find is in Qt and they
don't use a non-zero alpha origin.
2009-05-27 15:51:19 -04:00
Jeremy Huddleston
f1441b8353 XQuartz: More localization updates
(cherry picked from commit b107390c9f)
2009-05-27 10:16:11 -07:00
Joe Krahn
996357e905 Cygwin/X: Update icons directly, rather than modifying the window's class
Update icons directly to windows rather than modifying
the window's class.  Respect custom icons overriden via
the configuration file.

fd.o bugzilla #4491

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:14:32 +01:00
Jon TURNEY
9955252564 Cygwin/X: Remove unused TimeSinceLastInputEvent()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:14:10 +01:00
Colin Harrison
966c8fccf1 Xming: Fix some log spam
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:13:11 +01:00
Colin Harrison
d190a27a33 Xming: Various tidy ups in winClipboardFlushXEvents()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:12:51 +01:00
Colin Harrison
fbe9ed27b1 Xming: Avoid log spam if a windows application won't provide CF_UNICODETEXT clipboard format
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:12:31 +01:00
Colin Harrison
71ba9856a4 Xming: Cache atom lookups in clipboard integration code
Cache the CLIPBOARD atom lookups in winClipboardWindowProc()
Cache atom lookups in winClipboardFlushXEvents()
Recache on server regeneration

Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:12:12 +01:00
Colin Harrison
4ec110327b Xming: Prevent the mouse wheel from stalling when another window is minimized.
Fix internal WM to prevent the mouse wheel from stalling when another window is minimized.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:11:54 +01:00
Jon TURNEY
888e6961a4 Cygwin/X: Correctly allow for the native window frame width in ValidateSizing()
Fix internal WM to correctly calculate the native window border when validating window sizing

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:11:36 +01:00
Joe Krahn
a72865868f Cygwin/X: Consolidate dialog initialization in winInitDialog()
Changed windialogs.c to set icons via window properties rather than class
properties, and use LoadImage() for small icons, because LoadIcon() can only open
large icons. Since this code is redundant across the dialogs, I put it in the
winCenterDialog function, along with a few other redundant instructions, and
renamed in winInitDialog().

Also, don't bogusly put our dialogs at the center of the virtual desktop if we
are on a multimonitor system (this causes the dialog to end up split across two
monitors in a dual-monitor side-by-side setup)

Corrections to use HWND_TOPMOST instead of HWND_TOP and not to use SWP_NOZORDER
from Colin Harrison

fd.o bugzilla #4491

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:11:18 +01:00
Colin Harrison
d053c3b35f Xming: Slightly adjust the formatting of the logged command line
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-05-27 14:11:00 +01:00
Peter Hutterer
a7e23a79c1 Xi: Add support for Enter and FocusIn grabs.
Enter grabs are checked for in CheckMotion(), each time the sprite window
changes the current grab is deactivated (if applicable) and the new grab is
activated (if applicable). Exception - if the grab is on a parent window of
the current window since we keep the grab across descendants.

Since CheckMotion() may change the grab status of a device, we mustn't get
"dev->deviceGrab.grab" in ProcessOtherEvents until after CheckMotion().
FocusIn grabs are checked in much the same manner.

The event delivery for grabs replaces the NotifyNormal on window change with
a NotifyGrab on window change. Note that this happens before the grab
activates, so the EnterNotify(NotifyGrab) is still delivered to the window,
not to the grabbing client. This is in line with the core protocol semantics
for NotifyGrab events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 14:40:58 +10:00
Peter Hutterer
ec2fe9660d Require inputproto 1.9.99.10 2009-05-27 14:19:09 +10:00
Peter Hutterer
0ef6ba9f3b Xi: set the passive grab's resource mask on ungrabbing.
Not having the resource mask set means we never match an existing grab,
hence we never actually ungrab.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:19 +10:00
Peter Hutterer
1f61d6647f Xi: use GetMaster(MASTER_KEYBOARD) to get the modifier device for XI2 pgrabs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:19 +10:00
Peter Hutterer
bedfd561fa dix: fix wrong cast of eventMask into CreateGrab. 2009-05-27 13:54:19 +10:00
Peter Hutterer
023f959e68 Xi: fix an inputInfo.keyboard usage.
In the case of a RevertToFollowKeyboard, the master device should be used
(since this is the closest equivalent to the VCK as before). Only if the
master keyboard is the same as the device, revert to the VCK itself.
2009-05-27 13:54:19 +10:00
Peter Hutterer
b3463fd6a8 dix: convert window coordinates to FP1616 before calculating event_x/y
root_x/y are already in FP1616 at this point.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:19 +10:00
Peter Hutterer
10b5e98101 dix: take grabs into account for XI_Enter/Leave events. 2009-05-27 13:54:18 +10:00
Peter Hutterer
1815defdb2 Xi: only deactivate passive grabs if the event type matches.
This didn't use to be a problem when devices could only be pointers or
keyboards, not both. Nowadays, slave devices may have both buttons and
keyboards, and in this case we don't want to deactivate a passive keyboard
grab when a button release is detected.
2009-05-27 13:54:18 +10:00
Peter Hutterer
9dc3810a03 dix: set the right grab event type for implicit passive grabs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:18 +10:00
Nicolai Hähnle
6583477035 Remove reference to non-existing requestLog and requestLogIndex
These fields were removed in 252ec50481.

Signed-off-by: Nicolai Haehnle <nhaehnle@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 10:04:28 +10:00
Peter Hutterer
53e821ab4a Xi: add request processing for XIGetSelectedEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-25 14:58:12 +10:00
Peter Hutterer
b377994336 Xi: advance by the right number of bytes when trawling XI2 event masks.
The wire layout is  [struct xXIEventMask][mask bytes]. So the pointer needs
to not only be advanced by the mask bytes, but also by the size of the
struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-25 14:58:08 +10:00
Julien Cristau
12e725d08b randr: fix server crash in RRGetScreenInfo
We don't return rates to randr < 1.1 clients, so don't allocate space
for them.  This fixes a FatalError due to not all allocated space being
used.

X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>

Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-05-24 11:13:47 +02:00
Matthieu Herrb
c70511931c fix typo in cabff9007 which led to an unintialized memory read and a crash. 2009-05-24 10:33:40 +02:00
Adam Jackson
99e22b86c5 EDID: Add modes from Established Timings III descriptor to mode pool
EDID 1.4, section 3.10.3.9
2009-05-22 13:27:16 -04:00
Peter Hutterer
b395da91c5 Xi: silence two compiler warnings
chdevcur.c:97: warning: ‘SecurityLookupIDByType’ is deprecated (declared at
../include/resource.h:269)

xiproperty.c:200: warning: passing argument 2 of ‘GetEventFilter’ from
incompatible pointer type

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:58 +10:00
Peter Hutterer
4a36db6077 os: fix compiler warning "too few arguments to format"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:58 +10:00
Peter Hutterer
da0d3baf71 dix: protect event generation against single-valuator devices.
If we have a single-axis device and it sends events it should not access
non-existant memory.
2009-05-22 15:44:57 +10:00
Peter Hutterer
b25e29e801 mi: use GetMaster() from MIPOINTER and MISPRITE.
Both may in some cases be called for a SD attached to a master keyboard. In
this case, we need to get the right master device (i.e. the pointer).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
c9df51b070 input: allow for master pointers to not have a button class.
There's devices (e.g. some barcode readers) that have axes but no buttons.
When such a device sends a motion event, the valuator and button class is
copied into the master pointer (i.e. removing the button class).
So we need a couple of extra sanity checks for the button class to exist.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
ebe45e1a72 input: introduce partial class copying depending on the event.
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.

Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
bc63c8a457 dix: introduce GetMaster()
For hybrid devices (keys + buttons/axes) the attached master device is
generally the wrong one. One shouldn't post a button event through a
keyboard and vice versa.

GetMaster(dev) returns the right master device for the given type needed.
This may be the MD paired with this device's MD.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
d79318f269 dix: Add a deviceid to the DeviceChangedEvent.
ChangeDeviceId would actually overwrite the flags field if deviceid wasn't
present. Aside from the event of course not telling which device generated
it in the first place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
eeffb83fea ABI_XINPUT_VERSION 6 2009-05-22 15:44:57 +10:00
Peter Hutterer
438a4eafa5 input: remove nested union from InternalEvent.
There's no need for internal events to be a struct with a single nested
union, we might as well make the union itself the InternalEvent.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:56 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Peter Hutterer
add2defac7 Split the signal-handler's lastSlave out into a separate variable.
dev->u.lastSlave was not signal safe since it was accessed by the DIX and
during signal handling.
Replaced with:
'dev->last.slave' for the signal handler's lastSlave (used to generate
                  DeviceChangedEvents), .
'dev->u.lastSlave' for the DIX lastSlave (currently only used in
                   change_modmap)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:03 +10:00
Tomas Janousek
525aa17f80 Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields.
In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and
.totalVModMapKeys were not initialized, contained random values and caused
accesses to unallocated and later modified memory, causing
XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of
nonzero values, resulting in writes past the end of an array in XkbSendMap.

This patch initializes those values sensibly and reverts commits 5c0a2088 and
6dd4fc46, which have been plain non-sense.

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 12:24:21 +10:00
Peter Hutterer
7db55a0806 dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of
looping and searching for the master device, we can just use dev->u.master
directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 12:24:21 +10:00
Peter Hutterer
cabff9007a xfree86: treat other drivers as mouse drivers in the config.
Historically, if no input device was referenced in the ServerLayout,
the server would pick the first "mouse" device found in the xorg.conf.
This patch gives evdev, synaptics, vmmouse and void the same status. If
there is a section in the config file using this driver - use it as the core
pointer.

Device selection is in driver-order, not in config-order. If a "mouse"
device is listed after a "synaptics" device, the "mouse" device gets
preference. This replicates the original behaviour.

This code only takes effect if AllowEmptyInput is off and there is no core
pointer in the server layout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 12:24:21 +10:00
Søren Sandmann Pedersen
a8bd1e1f96 Fix alpha map computation in miComputeCompositeRegion()
According to the RENDER spec, the origin of the alpha map is
interpreted relative to the origin of the drawable of the image, not
the origin of drawable of the alpha map.

The only use of alpha maps I have been able to find is in Qt and they
don't use a non-zero alpha origin.
2009-05-21 18:21:28 -04:00
Adam Jackson
a2c5ee36b2 EDID: Be more cautious about finding vendor blocks.
Many old monitors zero-fill the detailed descriptors, so check for that
to avoid a useless warning like:

(WW) RADEON(0): Unknown vendor-specific block 0
2009-05-21 10:20:48 -04:00
Peter Hutterer
73c7398aaf dix: 'namespace' HAS_OLD_SLAVE and HAS_NEW_SLAVE.
We need more flags for this in the near future, so let's namespace them now.
2009-05-21 11:59:17 +10:00