Commit Graph

5261 Commits

Author SHA1 Message Date
Carlos Garnacho
2e8682d607 window: Update drag hotspot as new touches approach
Any number of touches >= 3 starts a drag operation, but the
window jumped around as new touches joined. So recalculate
the touch drag area/hotspot and tiling mode as expected
as soon as touches enter/leave the drag op.
2012-11-03 20:00:21 -04:00
Carlos Garnacho
de0d9e4da8 window: Implement tiling/maximizing through touch events
If during a multitouch drag, the area height is 1.5x the original
size, the window is tiled to the closest side the hotspot is on
(left/right).

If both with/height are 1.5x the original, the window is maximized.
2012-11-03 20:00:21 -04:00
Carlos Garnacho
900b91f385 window: Implement window moving through touch events
Window moving is triggered by 3-4 simultaneous touch events on
the window, the hotspot being in the center of the touch area
bounding rect.
2012-11-03 20:00:20 -04:00
Carlos Garnacho
7971d5a871 devices-xi2: Enable touch events 2012-11-03 20:00:20 -04:00
Carlos Garnacho
c8f0a136cc core: Handle TouchUpdate with TouchPendingEnd as TouchEnd
The touch sequence is possibly unhandled, but we need a call
to meta_window_end_touch() so such touch sequences are notified
to the server, this would trigger the real TouchEnd event as
the touch is rejected, but should be a no-op the second time
2012-11-03 19:59:52 -04:00
Carlos Garnacho
3b578c2983 device-map: Get slave devices in the XI2 implementation
Slave devices are at least needed for touch devices.
2012-11-03 19:59:52 -04:00
Carlos Garnacho
0142e34af8 device-map: Implement passive touch grabs in XI2 backend 2012-11-03 19:59:52 -04:00
Carlos Garnacho
6439856800 device-map: Add grab/ungrab_touch() methods
These functions deal with passive touch grabs, where
available
2012-11-03 19:59:52 -04:00
Carlos Garnacho
704e2320c3 core: Add meta_input_event_get_source_device()
This function would return the slave device behind and
event, this is mostly needed for touch passive grabs,
as XIAllowTouchEvents() at the moment requires a slave
device, this has changed in the latest drafts of the
multitouch protocol.
2012-11-03 19:59:52 -04:00
Carlos Garnacho
bbc69c4220 input-events: Add meta_input_event_get_touch_id()
This function returns the touch ID generating an input event,
if any.
2012-11-03 19:59:38 -04:00
Carlos Garnacho
6a03efe435 input-events: Add meta_input_event_ignored()
This function tells whether an input event should be ignored,
the only current reason being the duplication of touch events
and their emulated XI2 pointer event counterparts.
2012-11-03 19:59:13 -04:00
Carlos Garnacho
85c1058c94 input-events: Handle touch events
TouchBegin/End/Update are now handled similarly to
ButtonPress/Release/MotionNotify.
2012-11-03 19:58:47 -04:00
Jasper St. Pierre
91f87e8173 keybindings: Add a "device" parameter to MetaKeyHandlerFunc
This allows keybinding handlers to get access to devices.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
052e8cc8e2 frame: disallow frame operations if the popup is open
If some device has a popped up menu, meta_frame_get_flags()
returns 0 to indicate other devices cannot trigger any
actions on the frame.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
827999aa82 ui: Add a MetaDevice arg to meta_window_menu_popup()
This will be the device popping up the menu, gtk_menu_popup()
uses the current GTK+ event device, and that might not even be
filled up with mutter event bypassing.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
54a58bd9b8 window: Make MetaWindow keep a pointer to the popup menu
Multiple windows may now have different popup menus, responding
only to the device pair that popped it up.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
dc29985b80 ui: enable multidevice on frame windows
This is so different pointers may have different
cursors on them.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
acbd4bf599 frames: Use the triggering device when updating controls 2012-11-03 19:47:37 -04:00
Carlos Garnacho
b742d1bc64 frames: Get coordinates from event
Don't spare a synchronous X call, instead translate
properly the XEvent coordinates in ui.c and use
the event coordinates in MetaFrames
2012-11-03 19:47:37 -04:00
Carlos Garnacho
ae1290e3b4 display: Make focus info persistent
It must not be freed (at least meanwhile the device pair
exists), so ensure it's kept around, and we don't create
info for a same keyboard twice.
2012-11-03 19:47:37 -04:00
Carlos Garnacho
8037cc5ec4 window: make guess_grab_pointer() more reliable
Now either the current focus keyboard or the client pointer
(i.e. the pointer paired to the last keyboard that had the
window focus) are used to guess the pointer that should be
grabbed.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
275ab901b0 window: set the corresponding client pointer on focused windows.
The client window determines the device pair that is used for
core protocol calls such as XQueryPointer(), so different
clients using the core protocol can be focused by different
devices simultaneously.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
b3a9d1b39a core: enable XInput2 by default
This is nothing but the beginning, things work with a single
pointer/keyboard pair, but will be largely broken with multiple
devices interacting simultaneously, so we first need a policy
to establish a sensible behavior for extra pointer/keyboard
pairs.

the MUTTER_USE_CORE_DEVICES envvar has been added to force use
of Xlib core events for devices in order to check for regressions.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
ac187476ae xi2: Workaround some bugs in XI2 passive grabs
XIAllMasterDevices doesn't quite work for key grabs, so only do
this at the moment for the Virtual Core Keyboard
2012-11-03 19:47:36 -04:00
Carlos Garnacho
f512da8c47 display: Ignore events from slave devices
Mutter only handles master devices.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
2b47bffbee compositor: use meta_device_grab() for pointer/keyboard grabs
These happen invariably on the VCP/VCK pair.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
8da5a01c92 screen: Use meta_device_pointer_set_window_cursor() for startup sequence.
At the moment feedback is only provided for the Virtual Core Pointer
2012-11-03 19:47:36 -04:00
Carlos Garnacho
25dc04440b device-map: Add meta_device_map_list_devices()
This function returns a list of the devices currently handled by
the device map.
2012-11-03 19:47:36 -04:00
Carlos Garnacho
7138cc7ea4 core: Make frame handle per-pointer cursors. 2012-11-03 19:47:36 -04:00
Carlos Garnacho
04cbdb4e23 workspace: use triggering device to focus the default window on workspace switch 2012-11-03 19:47:36 -04:00
Carlos Garnacho
e138726ded screen: make "monitor under pointer" logic work for several devices 2012-11-03 19:47:36 -04:00
Carlos Garnacho
84dfc98636 window: query the guessed pointer's modifiers on _NET_WM_MOVERESIZE 2012-11-03 19:47:36 -04:00
Carlos Garnacho
95247457ef display: Use the grab pointer for delayed window raising 2012-11-03 19:47:35 -04:00
Carlos Garnacho
9b1b7b71e2 keybindings: use the right device for querying the modifier mask. 2012-11-03 19:47:35 -04:00
Carlos Garnacho
4facab385d devices: make meta_device_pointer_query_position() return a boolean
like in XQueryPointer/XIQueryPointer, the return value tells whether
the pointer device is on the same screen than the passed window.
2012-11-03 19:47:35 -04:00
Jasper St. Pierre
cc6dba2113 display: Update mouse mode focus code for XI2 2012-11-03 19:47:35 -04:00
Carlos Garnacho
5f6f67fb4e core: Make keyboard focus handling happen per-keyboard
MetaFocusInfo is a struct holding all necessary info, code has
been updated to use the per-keyboard focus info instead of the
old fields.
2012-11-03 19:47:35 -04:00
Carlos Garnacho
0d97e6adeb core: Add meta_device_keyboard_[gs]et_focus_window()
These functions are meant to replace X[GS]etInputFocus() calls across
the core.
2012-11-03 19:47:35 -04:00
Carlos Garnacho
991fdeb9dd display: Use meta_device_grab() for pointer active grabs. 2012-11-03 19:47:35 -04:00
Carlos Garnacho
df908e5256 keybindings: Use meta_device_grab() for keyboard active grabs 2012-11-03 19:47:35 -04:00
Carlos Garnacho
4b88c1c72a window: Use meta_device_pointer_warp() 2012-11-03 19:47:35 -04:00
Carlos Garnacho
33d4732bde core: Keep track of per pointer/keyboard grabs
There is now a MetaGrabInfo struct, holding all information about
an ongoing grab, there were unfortunately no means of making this
commit smaller, as things are too intertwined to separate it,

On places where it was most obvious, the correct device has been
used (in reaction to events, for example), in other parts, the
private API has been extended to include the MetaDevice (or device
ID for core.h functions), in other places, the virtual core
pointer/keyboard are used out of cluelessness.
2012-11-03 19:47:35 -04:00
Carlos Garnacho
2bbd82ba51 ui: Use input-events.h to translate XEvents to GdkEvents
This is the only use in the UI part of core functions not
exported via core.h, but this is sort of a hack within a hack,
and still better than doing the XInput2 vs core dance again.
2012-11-03 19:47:35 -04:00
Carlos Garnacho
13acafabe2 devices: Make MetaDevice/MetaDeviceMap partly public
MetaDevice is quite limited outside of the core, mostly useful
to represent a device, and get the paired one.
2012-11-03 19:47:34 -04:00
Carlos Garnacho
20537b9bb0 keybindings: Replace XGrabKey() with meta_device_map_grab_key() 2012-11-03 19:47:34 -04:00
Carlos Garnacho
373ef2e6f1 display: Replace XGrabButton with meta_device_map_grab_button() 2012-11-03 19:47:34 -04:00
Carlos Garnacho
93c7a22161 core: Add XInput2 device map implementation 2012-11-03 19:47:34 -04:00
Carlos Garnacho
9f06372e17 Replace XAllowEvents with meta_device_allow_events() 2012-11-03 19:37:53 -04:00
Carlos Garnacho
b3ecd268f6 Use meta_core_select_events() for input events 2012-11-03 19:37:52 -04:00
Carlos Garnacho
c32ee410e9 core: Add method to select events on a window
This function handles XInput2 vs core in input events.
2012-11-03 19:37:52 -04:00