Commit Graph

9863 Commits

Author SHA1 Message Date
Peter Hutterer
b5ef88c911 dix: clip absolute axes depending on their mode.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 16:18:59 +10:00
Peter Hutterer
ea567b675f dix: populate motion history only if the mode matches the first axis.
XI1 doesn't cater for mixed mode devices, so bail out on the first valuator
that has a different mode.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 16:18:59 +10:00
Peter Hutterer
4381b70f5a input: add valuator_get_mode() helper.
Returns the mode of the specified valuator.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 16:18:56 +10:00
Peter Hutterer
6f6f460c24 dix: send proximity events if one or more axes are Absolute.
We only skip relative events for proximity, not absolute ones. Now with
mixed mode, just unset those axes that are relative.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 15:18:33 +10:00
Chase Douglas
65c0fc81eb Add support for per-axis valuator modes (Relative/Absolute)
The XI2 protocol supports per-axis modes, but the server so far does
not. This change adds support in the server.

A complication is the fact that XI1 does not support per-axis modes.
The solution provided here is to set a per-device mode that defines the
mode of at least the first two valuators (X and Y). Note that initializing
the first two axes to a different mode than the device mode will fail.

For XI1 events, any axes following the first two that have the same mode
will be sent to clients, up to the first axis that has a different mode.
Thus, if a device has relative, then absolute, then relative mode axes,
only the first block of relative axes will be sent over XI1.

Since the XI2 protocol supports per-axis modes, all axes are sent to the
client.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 13:37:57 +10:00
Chase Douglas
290af0418f test: input - set valuators mask for event to core conversion
Commit de8be07cc0 adds a requirement to
event to core conversion that at least one of the X or Y valuators are
set in the valuator mask. This commit fixes the event conversion test to
be compliant.

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>
2010-10-22 13:36:10 +10:00
Paulius Zaleckas
8990b31214 KDrive: Fix error handlig in tslib driver
If ts_open() fails and return NULL, then next call to ts_fd()
segfaults because of NULL dereference. There is no need to
check output of ts_fd() as ts_open() did this internally.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-22 13:36:10 +10:00
Peter Hutterer
9696c782c8 test: valuator_mask tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:53 +10:00
Peter Hutterer
2362adc2da dix: remove valuator_mask_copy_valuators, not needed anymore.
With the switch to masks internally, this isn't needed anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:53 +10:00
Peter Hutterer
2b04a3ef73 xfree86: convert xf86Post{Motion|Key|Button|Proximity}Event to masks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:53 +10:00
Peter Hutterer
0418a39e71 dix: get rid of the now-superfluous valuator arrays in GPE and friends.
The valuators are stored inside the mask, use it from there. are stored
inside the mask, use it from there. are stored inside the mask, use it from
there. are stored inside the mask, use it from there.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:53 +10:00
Peter Hutterer
675f4a8525 Abstract valuator masks through a set of APIs.
This commit introduces an abstraction API for handling masked valuators. The
intent is that drivers just allocate a mask, set the data and pass the mask
to the server. The actual storage type of the mask is hidden from the
drivers.

The new calls for drivers are:
    valuator_mask_new()     /* to allocate a valuator mask */
    valuator_mask_zero()    /* to reset a mask to zero */
    valuator_mask_set()     /* to set a valuator value */

The new interface to the server is
    xf86PostMotionEventM()
    xf86PostButtonEventM()
    xf86PostKeyboardEventM()
    xf86PostProximityEventM()

all taking a mask instead of the valuator array.

The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to
memory allocation restrictions in SIGIO handlers.

For easier review, a lot of the code still uses separate valuator arrays.
This will be fixed in a later patch.

This patch was initially written by Chase Douglas.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:48 +10:00
Aaron Plattner
1a0d9324b3 Revert "Set DamageSetReportAfterOp to true for the damage extension" (#30260)
This commit breaks the Compiz "Wallpaper" plugin.

This reverts commit 8d7b7a0d71.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-20 16:49:14 -07:00
Keith Packard
d738175eaf Merge remote branch 'whot/for-keith' 2010-10-19 22:50:15 -07:00
Chase Douglas
fc48a8f9f5 Add CountBits() to the server.
Function to count the number of bits set in the given array.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-20 09:38:27 +10:00
Peter Hutterer
9872e0f011 xfree86: set mask for valuators 0/1 when emulating core events (#30267)
EventToCore as of the commit below won't generate core motion events if the
valuator mask for x/y isn't set. For DGA, we work around this check by
forcibly setting the mask in the event we pass down.

commit de8be07cc0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Aug 17 12:08:52 2010 +1000

    dix: don't create core motion events for non-x/y valuators.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Andrew Randrianasulu <randrik@mail.ru>
Tested-by: Andy Furniss
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-10-20 08:02:38 +10:00
Peter Hutterer
649293f6b6 xkb: always fill the symsPerKey array, regardless of client flags (#30527)
Even if a client does not modify the symbols, symsPerKey and mapWidths must
be filled from the current configuration. Both arrays are then passed into
other functions (pending the right flag), thus they must contain valid
values regardless of the XkbKeySymsMask flag in req->present.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-10-20 08:01:54 +10:00
Peter Hutterer
ca21a26622 xkb: init mapWidth and symsPerKey arrays to 0.
Helps debugging greatly, random 8 or 16 bit values can sometimes look like
valid values, causing much excitement on the client front.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-10-20 08:01:31 +10:00
Michał Górny
8806a04f7f kdrive: Fix linking with tslib, with -Wl, --as-needed. #30600
Change the library order in TSLIB_LIBS variable, placing ${TSLIB_LIBS}
after the local static libraries. This fixes linking with
-Wl,--as-needed.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30600
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-19 09:27:20 -07:00
Michał Górny
c7e436e998 kdrive: Fix tslib check fallback to set TSLIB_LIBS. #30599
If pkg-config is unable to find tslib but the fallback check does find
it, the compilation continues with tslib support enabled though
TSLIB_LIBS are unset. Thus, the compilation fails with a linking error
on tslib functions.

This patch sets TSLIB_LIBS to '-lts' whenever the tslib fallback check
succeeds.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30599
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-19 09:26:53 -07:00
Jon TURNEY
25801a2556 Cygwin/X: Move duplicate extern variable declarations from various .c files to a new header file
For the global variables defined in winglobals.c, remove duplicate extern
declarations from the beginning of various .c files, and move most of them
into a new header file, winglobals.h

Leave some clipboard related variables alone for the moment, they need treating
more carefully, to avoid mixing client and server type definitions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:02:00 +01:00
Jon TURNEY
04d11abcf2 Cygwin/X: Remove g_hwndKeyboardFocus
It's set but it's value is never used

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:58 +01:00
Jon TURNEY
5e896e425f Cygwin/X: Make g_hmodCommonControls static
Make g_hmodCommonControls static, it's only used in InitOutput.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:56 +01:00
Jon TURNEY
49b996faad Cygwin/X: Make g_hmodDirectDraw static
Add winReleaseDDProcAddresses() for releasing the direct draw module
handle, so g_hmodDirectDraw can be made static

Remove unneeded duplicate extern definitions of g_fpDirectDrawCreate
and g_fpDirectDrawCreateClipper, and move the definition from
winglobals.c to winengine.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:55 +01:00
Jon TURNEY
6f12277e37 Cygwin/X: Make g_hhookKeyboardLL static
Make g_hhookKeyboardLL static, it's only used in winkeyhook.c

Also remove unused externs

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:53 +01:00
Jon TURNEY
9952b51f68 Cygwin/X: Fix typos in comments
Fix a few typos in comments

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:51 +01:00
Jon TURNEY
1de5db73d3 Cygwin/X: Drop several unneeded includes of winprefs.h
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 15:01:50 +01:00
Colin Harrison
8e72310815 Xming: Remove uses of register keyword
I'm pretty sure the compiler has a better idea how to optimize this

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 15:01:48 +01:00
Colin Harrison
d11761c6a6 Xming: Casts to remove warnings on event pointers
winkeybd.c: In function ‘winSendKeyEvent’:
winkeybd.c:489: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type
winmouse.c: In function ‘winMouseButtonsSendEvent’:
winmouse.c:247: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type
winmouse.c: In function ‘winEnqueueMotion’:
winmouse.c:380: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 15:01:19 +01:00
Colin Harrison
10bf8345cf Xming: Warning fix in winDeviceCursorCleanup()
return statement with an expression in a function whose return-type is void

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:42:16 +01:00
Jon TURNEY
cab837a60a Cygwin/X: Reformat the keyboard layout mapping table
Also remove the out-of-date listing of keyboard layout IDs and which ones
have known mappings

XXX: layout zh_TW doesn't exist anymore

This patch brought to you by C-u M-x align-regexp

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:41:40 +01:00
Jon TURNEY
ee2867649d Cygwin/X: Clarify XKB options in XWin man page
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:40:53 +01:00
Colin Harrison
1ba1b12d24 Xming: Warning fix in winApplyHints()
winmultiwindowwm.c: In function ‘winApplyHints’:
winmultiwindowwm.c:1587: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:38:32 +01:00
Colin Harrison
fb64414548 Xming: Fix warnings in ProcWindowsWMFrameSetTitle()
winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’:
winwindowswm.c:516: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness
winwindowswm.c:516: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness
winwindowswm.c:528: warning: pointer targets in passing argument 2 of ‘SetWindowTextA’ differ in signedness

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:38:30 +01:00
Colin Harrison
da5955cc02 Xming: Fix warnings in windialogs.c
windialogs.c: In function ‘winDisplayExitDialog’:
windialogs.c:327: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast
windialogs.c: In function ‘winDisplayAboutDialog’:
windialogs.c:597: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast
windialogs.c: In function ‘winAboutDlgProc’:
windialogs.c:697: warning: comparison between pointer and integer
windialogs.c:701: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘HINSTANCE’
windialogs.c:716: warning: assignment makes integer from pointer without a cast
windialogs.c:736: warning: assignment makes integer from pointer without a cast
windialogs.c:756: warning: assignment makes integer from pointer without a cast

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:35:38 +01:00
Colin Harrison
6d9fb07db2 Xming: Fix warnings in winNameCompare(), winNormalizeName()
winconfig.c: In function ‘winNameCompare’:
winconfig.c:715: warning: array subscript has type ‘char’
winconfig.c:715: warning: array subscript has type ‘char’
winconfig.c:716: warning: array subscript has type ‘char’
winconfig.c:716: warning: array subscript has type ‘char’
winconfig.c:730: warning: array subscript has type ‘char’
winconfig.c:730: warning: array subscript has type ‘char’
winconfig.c:731: warning: array subscript has type ‘char’
winconfig.c:731: warning: array subscript has type ‘char’
winconfig.c: In function ‘winNormalizeName’:
winconfig.c:1092: warning: array subscript has type ‘char’
winconfig.c:1093: warning: array subscript has type ‘char’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:28:28 +01:00
Colin Harrison
20510e5100 Xming: Fix warnings in winClipboardFlushXEvents()
winclipboardxevents.c: In function ‘winClipboardFlushXEvents’:
winclipboardxevents.c:225: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’
winclipboardxevents.c:266: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’
winclipboardxevents.c:619: warning: pointer targets in passing argument 1 of ‘strcat’ differ in signedness
winclipboardxevents.c:659: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
winclipboardxevents.c:669: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness
winclipboardxevents.c:690: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness
winclipboardxevents.c:698: warning: pointer targets in passing argument 1 of ‘strdup’ differ in signedness

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:27:33 +01:00
Colin Harrison
44c8b449d2 Xming: Fix warning in winClipboardErrorHandler()
winclipboardthread.c: In function ‘winClipboardErrorHandler’:
winclipboardthread.c:444: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-10-19 14:26:19 +01:00
Jon TURNEY
1f2a57d9e4 Cygwin/X: Turn off the bad-function-cast warning for XWin code
Turn off the bad-function-cast warning for the XWin code, it's near impossible
to write code which uses Win32 API calls that doesn't trigger this warning

For example, SendMessage(WM_SETICON) returns an LRESULT, but we are supposed to
know this is safe to cast this result to a HICON, which gcc considers a non-matching
type.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:20:05 +01:00
Jon TURNEY
55e528b6cc Cygwin/X: Remove execute permission from source files
Remove execute permission from source files

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:19:29 +01:00
Jon TURNEY
b2b685e269 Cygwin/X: unifdef XFree86Server
Remove XFree86Server define, which was always on anyhow, and the
code which was guarded by !XFree86Server

This completes the process of removal started in 2006 :-)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:17:21 +01:00
Jon TURNEY
9ed70f15ef Cygwin/X: Use normal apostrophe in XWin DDX help text
Use U+0027 APOSTROPHE in XWin DDX help text, rather than
U+2019 RIGHT SINGLE QUOTATION MARK

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:15:38 +01:00
Jon TURNEY
9f8f056a21 Cygwin/X: Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft
Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-10-19 14:02:33 +01:00
Keith Packard
5aff712a8d Merge remote branch 'whot/for-keith' 2010-10-18 17:16:23 -07:00
Adam Jackson
5b98c6267f randr: Remove mirandr
This isn't used anywhere, not least because it's completely
nonfunctional.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:23 -04:00
Olivier Fourdan
7bb653bedc modes: improve aspect ratio match for classic drivers
After we infer the aspect ratio for the screen, we pick the largest
mode matching that aspect ratio from the best mode pool available.
We then clamp virtual size to that mode, and run the resulting mode
list through the driver's ValidMode hook.  In doing so we might filter
away our initial guess.  If this happens we shrink the default mode
to the next largest mode from _any_ mode pool.  This is usually wrong,
and we should instead pick the next aspect-matched mode from the best
available mode pool (as always, user then driver then default).

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:23 -04:00
Adam Jackson
d6d90a4fcc composite: Move the backfill comment to a more appropriate indent level
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:23 -04:00
Adam Jackson
db8840600e composite: Don't backfill non-MapWindow allocations
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:18 -04:00
Adam Jackson
6dd775f57d composite: Don't backfill non-bg-None windows
If there's a defined background then backfilling is a waste of effort,
since exposure processing will paint that in for us.  But note that we
have to backfill if any children are bg=None to preserve semantics with
non-composited servers.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:37:10 -04:00
Adam Jackson
d2064fbb68 ddc: Don't probe for DDC/CI or EEPROM
For whatever reason, some (broken) monitors will crash if you do this.
We're not actually using this information for anything, so let's just
not do it.

Originally reported as http://bugzilla.redhat.com/620333

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 15:42:54 -04:00