1
0
Fork 0
Commit graph

1600 commits

Author SHA1 Message Date
Jasper St. Pierre
d233238c64 window: Be better at filtering window grab mods
It turns out that Clutter doesn't actually filter NumLock / ScrollLock /
CapsLock from button events due to its terrible event translation code.

Check only the grab mods to check if it's unmodified.
2014-08-15 16:06:54 -04:00
Jasper St. Pierre
f28c7835a1 workspace: Fix build
Forgot to squash, sigh.
2014-08-15 13:48:25 -04:00
Jasper St. Pierre
cecf7f4bf0 events: Revert a local change I accidentally made 2014-08-15 13:47:57 -04:00
Jasper St. Pierre
c687cf9db6 display: Simplify yet even more grab op code 2014-08-15 13:46:54 -04:00
Jasper St. Pierre
54d2218ac2 workspace: Simplify some more grab op code 2014-08-15 13:46:54 -04:00
Jasper St. Pierre
471e6b9e13 cursor-renderer: Popups need to set cursors, too
Popups could not set the cursor image, because the cursor tracker would
ignore window cursors if we had a popup active. The correct condition to
check for is already in should_block_wayland. Rename this to the more
sensible name windows_are_interactable, and use it in the cursor tracker.
2014-08-15 13:46:54 -04:00
Jasper St. Pierre
d931af33c4 display: Init X11 events separately 2014-08-15 13:46:53 -04:00
Jasper St. Pierre
a0e3c05428 display: Don't bother recording the grab timestamp
It's not used anywhere.
2014-08-15 13:09:18 -04:00
Jasper St. Pierre
a5f993f269 window: Filter out buttons when checking if the event is unmodified 2014-08-15 08:41:10 -04:00
Jasper St. Pierre
31361e464a events: Make the ungrabbed button press handling more bullet proof
Instead of returning a value based on whether or not we handled it, we
have this logic: either we have taken a grab on the window, in which
case we have a grab op and have handled it ourselves, or we did not take
a grab and *need* to replay the event to the window.

Handle this in events.c by checking the grab operation in the same way
that we check the other grab ops.
2014-08-15 08:41:10 -04:00
Jasper St. Pierre
bb977c00ca window: Don't mark the event as handled for odd event combinations
This is an accidental regression from 7a109a1. If we mark the event as
handled, then we *need* to set grab_op, or do some other sort of
behavior, since we have a grab.
2014-08-15 08:41:09 -04:00
Jasper St. Pierre
39f65f9f86 backend: Add a keymap-changed signal 2014-08-14 17:36:29 -04:00
Jasper St. Pierre
1e225ecdaf keybindings: Add a helper for taking the standard three-button grab 2014-08-14 17:35:49 -04:00
Jasper St. Pierre
cfb85d9a9a keybindings: Seal off the keybindings manager into its own structure
This helps clean up MetaDisplay, and also helps us move it into a
backend-specific thing in the future.
2014-08-14 17:35:48 -04:00
Jasper St. Pierre
f88c20f335 keybindings: Add an accessor for window grab modifiers
Since we're going to seal it away in the future.
2014-08-14 17:35:24 -04:00
Jasper St. Pierre
c98824bc9e window: Centralize the checks for the window grab modifiers
The code in the grab code was only checking for one of the modifiers to
be down, instead of all of them.
2014-08-14 17:35:24 -04:00
Jasper St. Pierre
69a35bb85f Remove support for the debugging window grabs feature
mutter doesn't really run nested in a useful way anymore.
2014-08-14 17:35:23 -04:00
Jasper St. Pierre
a3bb6c12e5 keybindings: Make devirtualize_modifiers a private function
This is now only used internally in keybindings.c
2014-08-14 17:35:23 -04:00
Jasper St. Pierre
586f118279 keybindings: Move the button grabs to here as well 2014-08-14 17:35:23 -04:00
Jasper St. Pierre
31081e5dac keybindings: Simplify a bit more code 2014-08-14 17:35:23 -04:00
Jasper St. Pierre
ef363e9d2e display: Simplify the regrab on focus mode 2014-08-14 17:35:23 -04:00
Jasper St. Pierre
9fa77acb8c display: Move devirtualize_modifiers into keybindings
It's mostly only used here.
2014-08-14 17:35:23 -04:00
Jasper St. Pierre
1e30db64d1 keybindings: Don't bother not reloading keymaps for MappingModifier
Now that we always use XKB, it's very unlikely that we'll get a
MappingNotifier without a subsequence XkbKeymapNotify event. Just
do all the work always.

This will also help us considerably for the future when we'll be
putting the keymap event in the backend.
2014-08-14 17:35:08 -04:00
Jasper St. Pierre
e830b66604 Remove a few extra HAVE_XKBs 2014-08-14 14:19:31 -04:00
Jasper St. Pierre
5f0fab2156 Conditionalize Wayland support again 2014-08-13 20:28:22 -04:00
Jasper St. Pierre
467465c99c backend: Create the stage in the backend, rather than the compositor
This allows creating the stage much earlier than it otherwise would have
been. Our initialization sequence has always been a bit haphazard, with
first the MetaBackend created, then the MetaDisplay, and inside of that,
the MetaScreen and MetaCompositor.

Refactor this out so that the MetaBackend creates the Clutter
stage. Besides the clarity of early initialization, we now have much
easier access to the stage, allowing us to use it for things such as
key focus and beyond.
2014-08-13 20:08:46 -04:00
Jasper St. Pierre
e935b52e51 display: Move composite version checks here 2014-08-13 19:32:39 -04:00
Jasper St. Pierre
879407c10c window: Kill off a now-unnecessary state variable 2014-08-13 18:25:46 -04:00
Jasper St. Pierre
e76be14dbb stack: Rewrite to not be based on X11 xtransient_for properties
This fixes some stacking issues with Wayland windows.
2014-08-13 18:25:34 -04:00
Jasper St. Pierre
7fa15c74b4 window: Fix some minor constant type issues 2014-08-13 18:14:15 -04:00
Emmanuele Bassi
9440bdb1aa core: Select the X11 backend of Clutter
Mutter depends on the X11 windowing backend of Clutter, unless it's used
as a Wayland display server.

This allows Mutter to run without breaking in case Clutter changes the
order with which windowing backends are selected, like it was the case
for bug https://bugzilla.gnome.org/show_bug.cgi?id=734587

The order of selection of the Clutter backends has not been made public,
so it cannot be relied upon since the introduction of the multiple
backends support; since Mutter requires the X11 backend functionality,
it should select the X11 windowing system, in the same way it selects
the EGL backend when compiled and run as a Wayland display server.
2014-08-13 14:27:20 +01:00
Rui Matos
7d54631ebf backends: Make MetaBackend available to introspection
This moves meta-backend.h under meta/ and, for now, just exposes to
introspection the methods that we actually need in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-07 11:31:59 +02:00
Rui Matos
6af48de0b8 Use libX11's Xkb* API unconditionally
At this point there shouldn't be any system capable of running mutter
that doesn't have it and we're introducing functionality like setting
the keymap that has an hard requirement on it.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-06 14:53:10 +02:00
Giovanni Campagna
d0f2c6be6d ui: always set the frame background to None
This way the xserver never paints the frame background, even if
the client window is destroyed. This allows us to have clean
destroy window animation.

There is no problem with interactive resizing because applications
are using the XSync protocol, so we're not painting unless the
client has redrawn.

https://bugzilla.gnome.org/show_bug.cgi?id=734054
2014-07-31 17:54:38 +02:00
Jasper St. Pierre
cc839029b9 window: Don't leak the input region 2014-07-28 11:23:38 +02:00
Jasper St. Pierre
4fe66ce0a9 prefs: Scale the root window cursor by the scale factor
This fixes small cursors on HiDPI displays.
2014-07-27 18:09:12 +02:00
Jasper St. Pierre
0e7221c361 window: Clean up keyboard-resizing code path 2014-07-27 15:03:38 +02:00
Jasper St. Pierre
c30ef668de events: Fix compilation when disabling the native backend 2014-07-24 14:54:38 -04:00
Carlos Garnacho
62e0c42803 events: Do not swallow touch events on windows
Those might eventually trigger a gesture into recognition.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:31 +02:00
Carlos Garnacho
70aee2d95e display: cancel wayland client touches when the compositor is grabbed
When a compositor grab begins, clients will stop receiving events, so any
ongoing sequence at that time must be cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:30 +02:00
Carlos Garnacho
63c7591698 events: Simplify gesture event management
MetaGestureTracker has been separating the "did I handle an event?" and the
"should the event be filtered out?" questions, merge this and make
handle_event() reply to "should the event be only handled by me?".

If a sequence wasn't accepted yet by the gesture tracker, the event will
go through (eg. not handled exclusively by the gesture tracker) and it'll
still be processed by Clutter, triggering gesture actions, and maybe
changing the sequence into other state.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
f28f5dc0b6 window: Implement single-touch window dragging
On X11 this works because only emulated pointer events are listened for. On
wayland, the single touch behavior must be enforced in touch events, ignoring
every other sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
41fdc4ac2e display: Add meta_display_is_pointer_emulating_sequence()
This function tells the obvious on X11, and implements a similar mechanism
on wayland to determine the "pointer emulating" sequence, or one to stick
with when implementing single-touch behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
177ec27cca gesture-tracker: Add meta_gesture_tracker_get_n_current_touches()
Due to the way the MetaGestureTracker processes every touch event, this
will tell as closely to Clutter as possible the current number of touches
happening on the stage.

Even though, this is subject to windowing behavior, on X11, rejected touches
will be soon followed by a XI_TouchEnd event, so the compositor will stop
seeing touch sequences that are still operating on clients. On wayland, touch
sequences are processed by the compositor during all their lifetime, so these
will stay on the MetaGestureTracker with META_SEQUENCE_PENDING_END state, yet
still tracked.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
6c22759d29 display: Add forgotten meta_display_cancel_touch 2014-07-23 18:37:51 -04:00
Carlos Garnacho
25b6a40ad4 display: Implement gesture-induced touch cancellation for wayland
On wayland, touches are initially both handled by the compositor and sent
to clients, proceeding to cancellation on clients only after the compositor
claims the sequence for itself. Implement the cancellation detail through
MetaGestureTracker::state-changed.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:17:04 +02:00
Carlos Garnacho
38e4906f72 window: Use event data getters in event handling code
This makes these functions more independent wrt touch vs pointer events

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:15:51 +02:00
Jasper St. Pierre
e49bbe2ed8 cursor-tracker: Don't require a screen
This allows us to do initialization earlier and not have to poke into
Wayland internals from the cursor tracker.
2014-07-22 11:10:14 -04:00
Jasper St. Pierre
679844f791 display: Call meta_window_grab_op_ended after everything else is reset
This properly sends the resizing state to the correct Wayland surface.
2014-07-17 16:03:01 -04:00
Jasper St. Pierre
5df59f75cd restart: Fix pointer/XID confusion
This causes an error in recent gcc.
2014-07-17 11:50:58 -04:00