Commit Graph

95 Commits

Author SHA1 Message Date
Peter Hutterer 20fb07f436 input: remove DDX event list handling
The current approach to event posting required the DDX to request the event
list (allocated by the DIX) and then pass that list into QueuePointerEvent
and friends.

Remove this step and use the DIX event list directly. This means that
QueuePointerEvent is not reentrant but it wasn't before anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:36 +10:00
Peter Hutterer 8670c46bdf input: replace EventListPtr with InternalEvent array
EventListPtr is a relic from pre-1.6, when we had protocol events in the
event queue and thus events of varying size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:36 +10:00
Peter Hutterer e7150db535 input: Provide Queue{Button|Keyboard|Proximity}Event helpers
Don't require every caller to use GPE + mieqEnqueue, provide matching
Queue...Event functions instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:33 +10:00
Jeremy Huddleston 3e253c603b XQuartz: Remove the threadSafety dead-ish code
It's been a few years now since we've needed this to debug thread
boundaries, so punt it out to clean up the namespace polution.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-25 18:57:02 -07:00
Jeremy Huddleston a52c8078c9 XQuartz: Use xorg_backtrace() instead of spewCallStack()
xorg_backtrace() has been in os for two years now, we might as well
start using it.

Ref: 94ed0ba1b5

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-25 18:57:02 -07:00
Keith Packard 918a9c99cf Merge remote-tracking branch 'jeremyhu/master' 2011-04-22 11:20:16 -07:00
Jeremy Huddleston 72bd232b11 XQuartz: Send tablet proximity events with tilt and pressure
<rdar://problem/6257569>

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-22 01:24:44 -07:00
Jeremy Huddleston 3960115dbc XQuartz: Fix prototypes for thread functions
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21 23:56:18 -07:00
Jeremy Huddleston 7524dbd061 XQuartz: Make the DarwinProcessFDAdditionQueue_thread wait 3 seconds to allow xinitrc to catch up
Previously, we weren't always waiting the full three seconds.  This should
be better, but is still sub-optimal.  We really want to start processing
these once a WM has been started.

http://xquartz.macosforge.org/trac/ticket/416

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21 23:56:18 -07:00
Peter Hutterer 071a6ac4d0 input: remove GetKeyboardValuatorEvents, this is now unnecessary.
GetKeyboardValuatorEvents handles NULL valuator masks already, so the
GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18 13:05:46 +10:00
Jeremy Huddleston 418bb57a39 XQuartz: Call RRScreenSizeNotify after handling externally-generated XP_EVENT_DISPLAY_CHANGED
We get an XP_EVENT_DISPLAY_CHANGED event when our display configuration is
changed.  If this change was caused by hotplugging a monitor or Mac Display
Preferences changes by the user, we need to call RRScreenSizeNotify in order
to ensure new connections get the correct screen size.

http://xquartz.macosforge.org/trac/ticket/460

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-01-23 22:39:14 -08:00
Jeremy Huddleston 965e709f2b XQuartz: Build-fixes for XQuartz for recent input API changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-11-12 11:49:49 +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
Jeremy Huddleston c45bea0c04 XQuartz: RandR: Refactor legacy mode-switching to be better integrated with RandR
Adds three new functions
void QuartzRandRSetFakeRootless (void);
void QuartzRandRSetFakeFullscreen (void);
void QuartzRandRToggleFullscreen (void);

The first two are identical to requesting the fake modes from a RandR client
The third responds to cmd-alt-a to leave fullscreen or RandR.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-28 10:09:11 -07:00
Jeremy Huddleston 229323a19b XQuartz: RandR: Don't change the rootless preference when changing RandR mode
Also renames a bunch of other variables for better consistency.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-28 09:50:35 -07:00
Jeremy Huddleston 026a47e212 XQuartz: RandR: Respond better to resolution changes made outside X
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-09-28 09:50:34 -07:00
Jeremy Huddleston e5bc62a032 XQuartz: Ignore kXquartzToggleFullscreen when rootless
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-08-12 20:26:36 -10:00
Jamey Sharp a83cff9f4d Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jeremy Huddleston 67a51cd9ef XQuartz: Fix a bunch of compilation warnings about style
(cherry picked from commit 54000bdcbca52a2de31f7c1a1147de6d8e9dbbb8)
2009-09-27 23:31:35 -07:00
Jeremy Huddleston 226b1033b4 XQuartz: Transition from xEvent based mieq to InternalEvent
(cherry picked from commit a3dbde2de87ee4f577748a8c447501a3ea462559)
2009-09-27 23:31:07 -07:00
Jeremy Huddleston 07c935b72f XQuartz: Use applewmproto 1.4 updated headers.
(cherry picked from commit 203df06c0eb2dcd5adfa788a1ba9569650c15f9c)
2009-08-25 20:16:47 -07:00
Jeremy Huddleston 48703083a1 XQuartz: Use pDev=NULL for DarwinSendDDXEvent
These events aren't really related to physical input devices anyways, so it doesn't make sense to use the pointer.
(cherry picked from commit bfe0b9cfa7af4a48dba849cab1eb152c409b4e08)
2009-07-25 20:18:15 -07:00
Jeremy Huddleston 09b024db63 XQuartz: Use the master device in DarwinSendDDXEvent to avoid duplicate events.
(cherry picked from commit 6fa62192af937aa9656f64b516050bc099231c7a)
2009-07-25 15:25:17 -07:00
Jeremy Huddleston 80a7bb2605 XQuartz: Solve the tablet 100% CPU bug
This happened because we put a byte in the fd to wake up dispatch, but we never actually enqueued anything in mieq because the num_events was 0.
(cherry picked from commit c21ca7558d2faf93c61f5feaafd7c878e9e21942)
2009-04-11 17:26:07 -07:00
Jeremy Huddleston 5e55becddc XQuartz: Make sure the Fn doesn't trigger unneccessary calls to DarwinUpdateModKeys()
(cherry picked from commit 70a18558c6b0a02b633fd8974f002cdf3cdc713e)
2009-04-11 17:22:38 -07:00
Jeremy Huddleston bd1d917909 XQuartz: Re-enable Fn as an option for 3button mouse simulation.
Patch from Martin Otte <otte@duke.edu>
(cherry picked from commit b5ec3be6b5449b5d575bc1472fdd1c9cb15cb8be)
2009-04-11 17:22:20 -07:00
Jeremy Huddleston d6976e1436 XQuartz: Re-enable support for capslock
(cherry picked from commit 4901b8147e593d26d7a31a9b73a201254b948916)
2009-02-24 23:14:01 -08:00
Jeremy Huddleston 0720816aea XQuartz: Only call DarwinUpdateModKeys when needed
Previously, we were calling it on almost every itteration through sendX11Event
(cherry picked from commit 6461729647ff4441d80811e73f0c0d2f108f2700)
2009-01-11 16:37:46 -08:00
Jeremy Huddleston 5339c22a8c XQuartz: Add locking to make mieq thread safe on OSX
(cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494)
2009-01-11 01:56:45 -08:00
Jeremy Huddleston 2f361186f9 XQuartz: Don't use NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK
We don't have keycodes for them, so don't try to use them
(cherry picked from commit cb912aca3a2834c4ad8e386c8a0d05c1bb31b0e7)
2008-12-31 12:45:34 -08:00
Peter Hutterer cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Jeremy Huddleston ccd2c668c1 XQuartz: darwinPointer reports the actual pixel position now rather than a relative position
(cherry picked from commit a41e7f75decd340d064fdc0d2c4fe6c88d7dbc82)
2008-12-06 14:12:27 -08:00
Jeremy Huddleston 8e2287c220 XQuartz: Updated some code to use newer server API 2008-11-22 13:57:45 -08:00
Jeremy Huddleston 9f49f5172d XQuartz: Silence pointer debug spam
(cherry picked from commit 9ca099e928653b5a0fb745186e17bfcc3d74ccc0)
2008-10-31 15:49:52 -07:00
Jeremy Huddleston 93298c7f8f XQuartz: Don't map the menu bar to the screen area.
(cherry picked from commit 1115917ada127a1cd6a8b61efe7fd134e2ea85fd)
2008-10-31 15:49:44 -07:00
Jeremy Huddleston 93d7cd31c5 XQuartz: Purge the old XQUARTZ_EXPORTS_LAUNCHD_FD option
(cherry picked from commit 490756c7fbe0792c4bd6ae434e7a48e0beffa5c7)
2008-10-31 15:48:15 -07:00
Jeremy Huddleston d13c3cbd43 XQuartz: Some motion made towards supporting fullscreen.
(cherry picked from commit 99be3d68b64059caada739a373e5e01844c776e0)
2008-10-08 18:45:17 -07:00
Jeremy Huddleston 1657dfb843 XQuartz: Using absolute ranges for pointer location to increase resolution and better support tablets.
(cherry picked from commit d79ccb45f68b65d65718b5b77efe2fae6eeda762)
2008-10-03 11:14:38 -07:00
Jeremy Huddleston aae878b890 XQuartz: Actually send the pointer event from the pen even if it happes to actually have 0 pressure and 0 tilt.
(cherry picked from commit f41583761955cb9c92c43239bfaa8ae0e5d95e33)
2008-10-03 11:13:03 -07:00
Jeremy Huddleston 5446adebfb XQuartz: Send AppleWMReloadPreferences where appropriate.
(cherry picked from commit 490cbe9888e2c1080495b003c429fdb1659444e1)
2008-10-03 11:12:49 -07:00
Jeremy Huddleston 12a59c44cb XQuartz: Fixed threading issue with TSM.
(cherry picked from commit 93ab4e0071670bb80bfa1170dd97ed9d6d51c67a)
2008-09-26 12:31:21 -07:00
Jeremy Huddleston 999f3362d5 XQuartz: Dead code removal
(cherry picked from commit 43184cd379c4fb7254391b8a362016cbf89b5529)
2008-09-12 15:26:18 -07:00
Jeremy Huddleston 46168b3b40 XQuartz: Updated Tablet code to include ranges for valuators and added cursor and erasor
(cherry picked from commit 6bca78760951cb5cb57ea66b7631a2dc230dc27a)
(cherry picked from commit fafcafd6de39cf6b5967793f03b30b49db36fec5)
2008-09-03 09:33:53 -07:00
Jeremy Huddleston b3836e5bdd XQuartz: Cleaned up our sleeping before adding the launchd socket.
(cherry picked from commit ebfe49dfca6e04d66232bad760f522629397cc35)
(cherry picked from commit 2cf74a76d54d795cfc3c0380a526b9177327782d)
2008-09-03 09:24:59 -07:00
Jeremy Huddleston dc1171df5b XQuartz: Fixed bogus args to debug ErrorF
(cherry picked from commit f0351c2b80f30ae31f041798b84139141fc3d5a5)
2008-08-26 20:19:41 -07:00
Jeremy Huddleston be06961312 XQuartz: More input fixes
stuck-modifier fixes (capslock)
3button-emulation now doesn't send the modifier key with the click
Added other options to fake_button2 and fake_button3 defaults options:
	({l,r}{control,alt,command,shift})
(cherry picked from commit 8fb6a1cf44c35a20dfb0c05c9824f94898f88da7)
(cherry picked from commit ae9c1b3cfb3874b4d1251681c24bda91c398bcab)
2008-08-20 10:00:20 -07:00
Jeremy Huddleston 8b9ed7dec2 XQuartz: Fixed a stuck modifier key bug.
(cherry picked from commit eeb6e5a9e98dcf045ec230f160d5992080dceba6)
2008-08-14 09:13:37 -07:00
Jeremy Huddleston 1770c85374 XQuartz: Made 3-button mouse simulation a little more consistent.
(cherry picked from commit d207b037d2ae213369e5627a17d8831c9bc16ad8)
2008-08-14 09:13:35 -07:00
Jeremy Huddleston e72b1d21e4 XQuartz: Now properly disable xauth checking on launchd socket and mostly fix the xinitrc / launchd race condition 2008-08-06 13:37:21 -07:00
Jeremy Huddleston 26d31ad1c7 XQuartz: Added code and made comments more helpful for debugging first-client-auth bug.
(cherry picked from commit a8f0d32216e321b8ae6da182be9b1ea792f6e004)
2008-08-05 18:47:35 -07:00