1
0
Fork 0
Commit graph

182 commits

Author SHA1 Message Date
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
Jasper St. Pierre
d456e68375 keybindings: Fix another place we unfreeze on the wrong xdisplay 2014-04-30 09:32:51 -04:00
Jasper St. Pierre
03efa3ccbc keybindings: Make sure to unfreeze the keyboard on the right xdisplay
This fixes keybindings getting "stuck" after being activated in
X11 compositor mode.
2014-04-30 09:32:51 -04:00
Jasper St. Pierre
41235fcb86 keybindings: Remove now-unused meta_screen_grab_all_keys 2014-04-28 17:34:33 -04:00
Jasper St. Pierre
c8e3b52160 keybindings: Simplify 2014-04-24 11:26:11 -04:00
Jasper St. Pierre
2c53919462 keybindings: Remove two extra error traps 2014-04-24 11:26:11 -04:00
Jasper St. Pierre
1ef06207a4 keybindings: Add two extra checks for key grab binding 2014-04-24 11:26:10 -04:00
Jasper St. Pierre
8c5da24401 keybindings: Fix keybindings
Attach them to the backend's X11 connection.

This breaks the overlay key state machine for native right now.
We'll fix it back up soon.
2014-04-23 16:29:34 -04:00
Jasper St. Pierre
48dc544bef backends: Move most of the code from meta_backend_init into the subclasses 2014-04-21 20:25:21 -04:00
Florian Müllner
abd0ac2cc3 keybindings: Handle switch-to-workspace-{up,down,left,right} again
Commit 585fdd781c not only removed the tabpopup, but set invalid
handlers (a.k.a. NULL) for those shortcuts; add back handling of
basic handling of those shortcuts by switching instantly without any
popups.

https://bugzilla.gnome.org/show_bug.cgi?id=728423
2014-04-17 17:05:38 +02:00
Elad Alfassa
40214b72bf keybindings: Add keybindings to switch to last workspace
When using dynamic workspaces, the last workspaces can vary, so it makes sense
to have a keybinding to go directly to it.

https://bugzilla.gnome.org/show_bug.cgi?id=659288
2014-04-16 21:41:26 +02:00
Jasper St. Pierre
2f229c3928 display: Remove code to calculate the above-tab keycode
We always know it will be KEY_GRAVE + 8.
2014-04-07 17:56:00 -04:00
Jasper St. Pierre
a730361d6c Use libxkbcommon keysym names everywhere 2014-04-07 17:56:00 -04:00
Jasper St. Pierre
db058d4a81 keybindings: Use xkb_keysym_get_name 2014-04-07 17:56:00 -04:00
Jasper St. Pierre
15cf804dbc keybindings: Eliminate the use of the stored modmap
We can simply check the XKB keysym here to see if it's a modifier.
2014-04-07 17:55:59 -04:00
Jasper St. Pierre
b38b037092 keybindings: Don't bother saving num_lock / caps_lock in MetaDisplay
It's unused outside of this one function.
2014-04-07 17:55:58 -04:00
Jasper St. Pierre
42bcad6549 display: Ignore the modmask passed into meta_display_begin_grab_op
A careful analysis of mutter's codebase shows that nothing actually
passes anything but 0 to this. gnome-shell has one instance, but it's
most likely a mistake.

Remove the grab_mask field and the one place in keybindings.c that uses it.

The parameter to begin_grab_op is left in for API compatibility reasons.
2014-04-07 17:45:52 -04:00
Jasper St. Pierre
1d08d75108 keybindings: Rename and move keysym_to_keycode
This makes it more what it's actually doing.
2014-04-07 16:02:08 -04:00
Jasper St. Pierre
4daf20483d keybindings: Handle META_KEY_ABOVE_TAB in get_keycodes_for_keysym
We're going to switch to get_keycodes_for_keysym for the other
bindings, so add that special case here.
2014-04-07 16:01:24 -04:00
Jasper St. Pierre
9fe5a3b407 keybindings: Fix style 2014-04-07 16:00:17 -04:00
Jasper St. Pierre
0466fe9301 Move meta_ui_parse_accelerator into core/
We're currently using GTK+ for this, but we'll stop doing that fairly
quickly and instead just copy the GTK+ code in-tree.
2014-04-07 10:59:46 -04:00
Jasper St. Pierre
b9e9595e8b errors: Kill off meta_error_trap_push_with_return
It isn't special; it's just an alias for meta_error_trap_push.
2014-04-07 10:37:03 -04:00
Jasper St. Pierre
5bcc78498f Move MetaLauncher to meta-backend 2014-03-31 23:44:46 -04:00
Jasper St. Pierre
cd905a34fb compositor: Kill off MetaCompScreen
Compositors haven't been able to manage more than one screen for
quite a while. Merge MetaCompScreen into MetaCompositor, and update
the API to match.

We still keep MetaScreen in the public compositor API for compatibility
purposes.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
47aa583625 display: Kill off grab_screen
Just like active_screen, the screen can always be inferred
from the MetaDisplay, so there's no point in keeping it around.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
d7519f4ebc Remove any possibility for zaphod mode
We previously separated out MetaDisplay and MetaScreen. mutter
would only manage one screen, but we still kept a list of screens
for simplicity.

With Wayland support, we no longer care about the ability to
manage more than one screen at a time. Remove this by killing
the list of screens, in favor of having just one MetaScreen
in MetaDisplay.

We also kill off active_screen at the same time, since it's
not necessary anymore.

A future cleanup should merge MetaDisplay and MetaScreen. To avoid
breaking API, we should probably keep MetaScreen around as a dummy
type.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
15c59f9919 keybindings: Split out check for filter_keybinding
This is a small code cleanup for clarity.
2014-03-20 11:03:54 -04:00
Jasper St. Pierre
044c06bff3 Don't include wayland/ by default either 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
0f85986340 Add a META_MAXIMIZE_BOTH
Which has the value of META_MAXIMIZE_VERTICAL |
META_MAXIMIZE_HORIZONTAL.

This is an obvious code cleanup.
2014-03-15 09:49:56 -04:00
Rui Matos
38e26e5cc3 keybindings: Plug a GSettings instance leak 2014-03-06 19:22:39 +01:00
Rui Matos
91384a32b4 keybindings: Fix ungrabs possibly failing after switching keymaps
We need to resolve the keycode from the keysym again since the keycode
might have changed if there was a keymap switch between the grab and
the ungrab.
2014-03-04 21:13:15 +01:00
Rui Matos
72bd5fb814 keybindings: Fix external grabs not being ungrabbed
Before starting to use display_get_keybinding() we could compare
MetaKeyBinding.modifiers with MetaKeyCombo.modifiers directly. Now, we
need to resolve the virtual modifiers to match with the mask.
2014-03-04 21:13:13 +01:00
Rui Matos
46af3ef9f6 keybindings: Keep keybindings in an hash table instead of an array
This allows us to look for a match with an O(1) search instead of O(n)
which is nice, particularly when running as a wayland compositor in
which case we have to do this search for every key press event (as
opposed to only when our passive grab triggers in the X compositor
case).

We actually need two hash tables. On one we keep all the keybindings
themselves which allows us to add external grabs without constantly
re-allocating the array we were using previously.

The other hash table is an index of the keybindings in the first table
by their keycodes and mask which is how we actually match the key
press events. This second table thus needs to be rebuilt when the
keymap changes since keycodes have to be resolved then but since we're
only keeping pointers to the first table it's a fast operation.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 15:53:36 +01:00
Rui Matos
d417c615d5 keybindings: Use display_get_keybinding() instead of looping explicitly
Instead of looping over an array of keybindings to find the correct
binding, just use display_get_keybinding().

In the next commit, we'll change the array to be a hash map, so this
helps the patch be cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 15:51:17 +01:00
Rui Matos
46cbd0bf48 keybindings: Rename MetaKeyPref.bindings to MetaKeyPref.combos
Let's call it what it really is, otherwise it's just confusing since
MetaKeyBinding also exists.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 15:46:06 +01:00