1
0
Fork 0
Commit graph

216 commits

Author SHA1 Message Date
Rui Matos
6ba0491adf keybindings: Freeze and ungrab the keyboard only on X11 backend
This isn't needed in the native backend because we control all the
input event flow there.

https://bugzilla.gnome.org/show_bug.cgi?id=736433
2014-09-11 19:05:53 +02:00
Rui Matos
c8f015c6d7 keybindings: Ignore extra modifier bits when matching iso_next_group
Clutter events include the layout index codified into modifier_state,
unlike XI2 device events, which means that we need to mask it out so
that we can match successfully.
2014-09-02 18:11:31 +02:00
Jasper St. Pierre
8a0da1cb07 keybindings: Make sure to filter out the virtualized mod itself
When devirtualizing the modifier, we can't include the virtualized mod
itself, otherwise our grab won't have the correct mask.
2014-08-19 14:58:47 -04:00
Jasper St. Pierre
5f7b81eb95 keybindings: Use a less hacky method of getting the proper modifier mask
This is the method Ran suggests as a workaround in
https://github.com/xkbcommon/libxkbcommon/pull/10
2014-08-18 15:54:34 -04:00
Jasper St. Pierre
1af0033368 keybindings: Rewrite the keymap code so that it uses libxkbcommon
This way we aren't depending on Xwayland for native key mapping support,
and are instead using the native interfaces.
2014-08-18 09:11:50 -04:00
Jasper St. Pierre
3645c63c08 keybindings: Rewrite the modmap code so that it uses libxkbcommon
This removes our Xwayland dependency in the native path. The direct
grabs are still there for the X11 backend and are a bit disgusting,
but that's OK. We can refactor it out later.

This introduces some pretty lousy hackery because it depends on
https://github.com/xkbcommon/libxkbcommon/pull/10 , and I really
don't want to wait on that to squash this dep.
2014-08-18 09:11:50 -04:00
Jasper St. Pierre
0b98fbab0a Remove a few extra "ui.h" includes 2014-08-17 23:02:15 -04:00
Jasper St. Pierre
f42258327b util: Move the text direction stuff out of MetaUI
GTK+ doesn't need to be initialized to get locale direction,
which means we can do this without bringing up MetaUI at all.
2014-08-17 22:59:43 -04:00
Jasper St. Pierre
7d1ef3f447 keybindings: Remove unused includes 2014-08-17 22:53:42 -04:00
Christophe Fergeau
20a6243c85 Remove use of META_KEY_BINDING_REVERSES
Now that the internal mutter bindings and gnome-shell stopped using
META_KEY_BINDING_REVERSES, and after moving the 'adding shift reverses
the keybinding action' logic to gnome-control-center, we can remove
META_KEY_BINDING_REVERSES from mutter.

Plugin API is broken as this constant is removed from the exported
headers. ABI is broken as using this flag is now a noop.

https://bugzilla.gnome.org/show_bug.cgi?id=732385
2014-08-17 19:29:43 +02:00
Christophe Fergeau
bb59b8c249 Don't automatically add bindings for -backward actions
Currently the bindings for {switch,cycle}.* actions are created with the
META_KEY_BINDING_REVERSES flag so that <shift>+binding triggers the
reverse action. However, gnome-control-center does not know about this
kind of implicit bindings, and, for example, cannot warn when the user
tries to setup a conflicting <shift>+xxx binding.

These backward <shift> bindings are being explicitly set in
gsettings-desktop-schemas, so the META_KEY_BINDING_REVERSES annotation
can be removed for them from mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=732385
2014-08-17 19:29:43 +02:00
Christophe Fergeau
c5c6b2257f Add meta_key_binding_is_reversed()
MetaKeyBinding can be marked as being reversed
(META_KEY_BINDING_IS_REVERSED), but MetaKeyHandlerFunc callbacks
cannot check whether this flag was set or not on the MetaKeyBinding
which triggered the callback.

https://bugzilla.gnome.org/show_bug.cgi?id=732295
2014-08-17 19:29:43 +02:00
Jasper St. Pierre
fb6438cdd4 keybindings: Hardcode Mod2Mask for Num Lock
This is actually part of the XKB specification, so we don't need to look
for it at runtime.
2014-08-15 16:22:16 -04:00
Jasper St. Pierre
517e8f6fbd common: Create a better encoding for MetaGrabOp
MetaGrabOp is painful and tedious to work with, because it's a
sequential series of values, meaning we have to use a giant unreadable
switch statement to figure out some basic things about the value.

To solve this, modify the encoding for MetaGrabOp and for the specific
window grab operations so that they're a set of bitflags that we can
easily check.
2014-08-15 16:08:49 -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
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
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
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
Jasper St. Pierre
2a3d4b62a7 keybindings: Fix backend check in change_keygrabs
We really can't do this unless the backend X server is the same as the
frontend X server, as we pass a frontend XID to the backend, which is
only the case when we're not a Wayland compositor.
2014-07-14 15:31:19 -04:00
Jasper St. Pierre
d7d8c92a9a Remove unused Wayland includes 2014-07-13 11:35:01 -04:00
Jasper St. Pierre
3c0fae74f1 window: Move get_toplevel_xwindow to window-x11 2014-06-16 18:29:38 -04:00
Jasper St. Pierre
806a666950 Make the native backend build-optional 2014-05-29 12:43:08 -04:00
Jasper St. Pierre
b240a5e819 keybindings: Only add VT keybindings if we're using the native backend 2014-05-29 12:43:07 -04:00
Florian Müllner
d380d30ef4 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 21:55:03 +02:00
Jasper St. Pierre
6e06648f7a window: Refactor all move/resize operations to be in frame rect space
For Wayland, we want to have everything possible in terms of the frame
rect, or "window geometry" as the Wayland protocol calls it, in order
to properly eliminate some flashing when changing states to fullscreen
or similar.

For this, we need to heavily refactor how the code is structured, and
make it so that meta_window_move_resize_internal is specified in terms
of the frame rect coordinate space, and transforming all entry points
to meta_window_move_resize_internal.

This is a big commit that's hard to tear apart. I tried to split it
as best I can, but there's still just a large amount of changes that
need to happen at once.

Expect some regressions from this. Sorry for any temporary regression
that this might cause.
2014-05-27 15:44:34 -04:00
Jasper St. Pierre
626516d12e window: Remove meta_window_move as well
Move to meta_window_move_frame everywhere...
2014-05-27 15:44:33 -04:00
Jasper St. Pierre
1c94df2553 window: Replace meta_window_resize_with_gravity with a frame-rect variant
More low-hanging fruit for our window geometry cleanups...
2014-05-27 15:44:33 -04:00
Florian Müllner
31db32e826 Actually implement opening the app menu
The last commit added support for the "appmenu" button in decorations,
but didn't actually implement it. Add a new MetaWindowMenuType parameter
to the show_window_menu () functions and use it to ask the compositor
to display the app menu when the new button is activated.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:40:06 +02:00
Jasper St. Pierre
0f37c1b58e keybindings: Replace the incomprehensible set of flags with a gravity param 2014-05-22 16:09:14 -04:00
Jasper St. Pierre
c448650a60 keybindings: Correct move_to_corner_backend
meta_window_get_position() returns the client rect position, which
we then pass to meta_window_move_frame. Just use the existing frame
rect coordinates.
2014-05-22 15:47:30 -04:00
Jasper St. Pierre
c45f616fdc keybindings: Fix code style 2014-05-22 15:47:30 -04:00
Jasper St. Pierre
47d72680ff keybindings: Correct coords for window menu for CSD windows 2014-05-22 10:51:05 -04:00
Jasper St. Pierre
6513cbb470 Add back coordinates to the window menu
It looks weird to have Alt+Space pop up under the cursor instead
of the top-left corner of the window, and the Wayland request will
pass through the coordinates as well.

Add it to the compositor interface, and extend the
_GTK_SHOW_WINDOW_MENU ClientMessage to support it as well.
2014-05-22 10:50:57 -04:00
Jasper St. Pierre
21991a7edb window: Remove some overcomplicated uses of meta_window_move_resize
Replace them with meta_window_move_frame, since that's all we need
to do.
2014-05-21 13:15:49 -04:00
Jasper St. Pierre
80266d3071 keybindings: Clean up code a tiny bit 2014-05-20 12:25:41 -04:00
Jasper St. Pierre
8640982e68 Convert window menus to a compositor implementation 2014-05-17 15:16:23 -04:00
Jasper St. Pierre
c81a0dede2 keybindings: Don't crash if we don't have any windows to activate
Pressing Alt+Tab when we have no windows should not crash your
desktop, especially when it's so easy to hit when trying to test
switching VTs.
2014-05-15 15:50:31 -04:00
Jasper St. Pierre
fc8a2b8a42 keybindings: Rename initial_selection to window
Since we removed the tabpopup, this name doesn't make much sense
anymore.
2014-05-15 15:50:31 -04:00
Jasper St. Pierre
f5bff4b7f3 events: Move the overlay_key_only_pressed handling to keybindings.c
Now the switch statement is entirely about window operations.
2014-05-08 15:28:06 -04:00
Jasper St. Pierre
bbfdf5dd2a events: Move keybindings event handling out of the giant switch 2014-05-08 15:28:06 -04:00
Jasper St. Pierre
324d7d720d keybindings: Don't mark a replayed keypress event as handled
This is needed so it goes to Wayland clients.
2014-05-07 09:30:22 -04:00
Jasper St. Pierre
413e39ecbb keybindings: Fix <Super> key crash
If we exit early as not handled, then the normal process_event
handler will fire, and trigger the overlay-key binding. As that's
a special binding that doesn't have a handler, trying to trigger
that handler will crash mutter.

Instead of returning early, just check for xdisplay every time
we try to drive the X grab state machine. We really need a better
solution for this on the Wayland side.
2014-05-07 09:30:21 -04:00
Jasper St. Pierre
845fdda22c keybindings: Make sure not to call meta_change_keygrab under Wayland 2014-05-03 12:50:19 -04:00