1
0
Fork 0
Commit graph

321 commits

Author SHA1 Message Date
Armin Krezović
d79ffd3976 Move UI and key grabs to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
e1c67a1824 Move monitor management API to MetaDisplay
This includes changing various users to use MetaDisplay directly, who
used MetaScreen only for this before.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
68f261e8e2 Move rest of non-X11 specific objects from MetaScreen
This moves following objects from MetaScreen to MetaDisplay

- workareas_later and in_fullscreen_later signals and functions
- startup_sequences signals and functions
- tile_preview functions

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
98d912ba5f Move stack tracking and guard_window outside of MetaScreen
Move stack, stack_tracker to MetaDisplay guard_window to MetaX11Display

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
dacc041d0c Switch meta_error_trap functions to MetaX11Display
They are X11 specific functions, used for X11 code. They have been
improved per jadahl's suggestion to use gdk_x11_lookup_xdisplay and
gdk_x11_display_error_trap_* functions, instead of current code.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
18779109de Start populating MetaX11Display
- Moved xdisplay, name and various atoms from MetaDisplay
- Moved xroot, screen_name, default_depth and default_xvisual
  from MetaScreen

- Moved some X11 specific functions from screen.c and display.c
  to meta-x11-display.c

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Olivier Fourdan
49f029571c keybindings: Super should be inhibitable
When a Wayland client issues a shortcut inhibit request which is granted
by the user, the Super key should be passed to the surface instead of
being handled by the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=790627
2017-12-21 09:08:41 +01:00
Jonas Ådahl
44269e6a1d keybindings: Only add multiple keycodes from the same level
The reason why multiple keycodes could be mapped to a single keysym was
to support having both KEY_FAVORITES and KEY_BOOKMARK map to
XF86Favorites. However, iterating through all layout levels adding all
key codes has severe consequences on layouts with levels that map
things like numbers and arrow. The result is that keybindings that
should only have been added for keycodes from the first level, are
replaced by some unexpected keycode where the same keysym was found on
another level.

An example of this is the up-arrow key and l symbol. Normally you'd find
both the up-arrow symbol and the l symbol on the first level and be done
with it. However, on the German Neo-2 layout, layout level 4 maps the
KEY_E to the l symbol, while layout level 4 maps KEY_E to up-arrow.
Which ever gets to take priority is arbitrary, but for this particular
case KEY_E incorrectly mapped to up-arrow instead of the l symbol,
causing the keyboard shortcut Super+l, which would normally lock the
screen, to trigger the workspace-up (Super+up-arrow) key binding.

https://bugzilla.gnome.org/show_bug.cgi?id=789300
2017-12-20 15:02:39 +08:00
Jonas Ådahl
315a6f43d7 monitor-manager: Keep pointer to backend
Instead of accessing the global singleton, keep a pointer to the
backend in the MetaMonitorManager struct.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
2017-10-05 16:18:43 -04:00
Florian Müllner
00a5db71cf window: Allow resizing of tiled windows
Currently tiled windows are not resizable and their size is fixed
to half the screen width. Adjust the code to work with fractions
other than half, and allow users to adjust the split by dragging
the window edge that is not constrained by a monitor edge.

Follow-up patches will improve on that by resizing neighboring
tiled windows by a shared edge, and making the functionality
available to client-side decorated windows implementing the
new edge constraints protocol.
2017-10-03 19:38:31 -03:00
Florian Müllner
c7fa57cd28 window: Pass mode as parameter to tile() operation
Now that the preview tile mode has been split from the window's
tile_mode property, it is much more natural to pass the requested
tile_mode to the tile() function instead of setting it externally
and calling the function to apply the state.
2017-10-03 19:38:31 -03:00
Florian Müllner
8f2c86d79e window: Split out preview_tile_mode
The existing semantics of the tile_mode property are terribly confusing,
as it depends on some other property whether it represents the requested
or current mode. Clear this up by just using separate variables for the
two. As it is unlikely that we will ever support more than one tile
preview, we can track the requested mode globally instead of adding
another per-window variable.

https://bugzilla.gnome.org/show_bug.cgi?id=645153
2017-10-03 19:38:31 -03:00
Jonas Ådahl
487b8a0430 keybindings: Resolve on us layout too if primary is not latin based
If a non-latin based keyboard layout is active, for example Cyrillic,
keybindings won't work unless we resolve the bound keysyms on a
secondary latin based layout. So, to make keybindings work on non-latin
based layouts, detect if a keymap doesn't have all of the basic latin
letters (a-z) and resolve from an additional US layout as well.

https://bugzilla.gnome.org/show_bug.cgi?id=787016
2017-09-25 15:31:07 -04:00
Jonas Ådahl
8b060342bd keybindings: Add support for resolving from multiple layouts
Add the infrastructure to resolve keybinding symbols from multiple
layouts. It is still unused, but will be, when the primary layout does
not have the required latin keysyms in it.

https://bugzilla.gnome.org/show_bug.cgi?id=787016
2017-09-25 15:31:07 -04:00
Jonas Ådahl
27d6c063ad keybindings: Keep a pointer to the backend
A few less singleton getting.

https://bugzilla.gnome.org/show_bug.cgi?id=787016
2017-09-25 15:31:07 -04:00
Jonas Ådahl
92a53f08f4 keybindings: Only resolve keysyms for the current layout group
When resolving what keycodes a key binding resolves to, only look up
key codes from the current layout group. Without this, unwanted
overlaps may occur. For example when a keymap has both a dvorak and a
qwerty layout on different layout groups, one keybinding may be bound
on multiple keys, arbitrarily "shadowing" another.

https://bugzilla.gnome.org/show_bug.cgi?id=786408
2017-08-21 21:19:18 +08:00
Olivier Fourdan
dd12f569d9 wayland: add inhibit shortcut mechanism
Add a mechanism to MetaWaylandSurface that inhibits compositor's own
shortcuts when the surface has input focus, so that clients can receive
all key events regardless of the compositor own shortcuts.

This will help with implementing "fake" active grabs in Wayland and
XWayland clients.

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-08-02 11:58:55 +02:00
Rui Matos
7e330bd65f keybindings: Add a switch-monitor builtin keybinding
Moved from g-s-d's media keys plugin, where it was called "video-out",
since it requires changing the current monitor configuration and we
want to remove the old DBus API.

This implementation is intentionally simple and not really meant for
more than debugging and validating the various configurations. A
better user experience will be introduced in gnome-shell with a custom
keybinding handler.

The default value includes <Super>P in addition to the standard keysym
for historical reasons.

https://bugzilla.gnome.org/show_bug.cgi?id=781906
2017-07-19 11:18:53 +02:00
Rui Matos
c614a2db28 keybindings: Add a rotate-monitor builtin keybinding
Moved from g-s-d's media keys plugin, where it was called
"video-rotate", since it requires changing the current monitor
configuration and we want to remove the old DBus API.

https://bugzilla.gnome.org/show_bug.cgi?id=781906
2017-07-14 15:31:20 +02:00
Christian Kellner
68dacb531b keybindings: handle multiple keycodes for keysym
A single keysym can resolve to multiple keycodes. Instead of only using
the first one and ignoring the others, we store all codes in
MetaResolvedKeyCombo and then handle all of them in keybinding
resolution. If we already have bound a keycode for a keybinding with a
specific keysym then this can get overwritten by a new keybinding with a
different keysym that resolves to the same keycode. Now that we resolve
and bind all keycodes for a keysym this might happen more often; in that
case warn but still overwrite, but only for the first keycode for each
keysym. If a secondary (i.e. all non-first keycodes) is already indexed
we just ignore that; this should resemble the old behavior  where we
only took the first keycode for any keysym as close as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=781223
2017-05-30 15:23:00 +02:00
Jose Marino
9a123847e0 keybindings: fix erratic raise_or_lower behavior
Function "handle_raise_or_lower (src/core/keybindings.c)" is called
when running 'raise-or-lower' on a window. This function iterates
through all the windows in the stack to determine if our window is
already on top or obscured. The problem is that the window stack
includes windows in another workspaces and also windows that are
minimized.

https://bugzilla.gnome.org/show_bug.cgi?id=705200
2017-02-07 14:30:38 +01:00
Jonas Ådahl
4e812410cc monitor-manager: Move logical monitor into its own file
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
a422d6fe08 Move logical monitor neighbor API into monitor manager
Move the last piece of monitor grid getter API to the monitor manager
away from MetaScreen. The public facing API are still there, but are
thin wrappers around the MetaMonitorManager API.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
842ff5d6aa Rename MetaMonitorInfo MetaLogicalMonitor
In preparation for further refactorizations, rename the MetaMonitorInfo
struct to MetaLogicalMonitor. Eventually, part of MetaLogicalMonitor
will be split into a MetaMonitor type.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Rui Matos
2b59b4c793 keybindings: Grab buttons with any modifier combo on unfocused windows
We currently only focus unfocused windows on button press if no
modifiers (or just ignored modifiers) are in effect. This behavior
seems surprising and counter-intuitive so let's do it for any modifier
combination instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746642
2016-11-23 18:40:11 +01:00
Rui Matos
0249993377 keybindings: Remove #if 0'd code
There's no reason to keep this ~15 year old piece of code around as
well as the preference handling that would only make sense if this
hunk was actually enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=746642
2016-11-23 18:40:05 +01:00
Rui Matos
d829fa19d2 keybindings: Factor out a function to determine XIGrabModifiers
This de-dups code and reduces the amount of protocol round trips.

https://bugzilla.gnome.org/show_bug.cgi?id=746642
2016-11-21 15:34:43 +01:00
Jonas Ådahl
95a68854ad configure.ac: Add AC_GNU_SOURCE
We define it here and there already, and if we are to include private
cogl files, we need it in more places. Lets just add it everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Rui Matos
e160babe3f keybindings: Avoid using unitialized memory and grabbing random keys
meta_parse_accelerator() considers 0 length accelerator strings as
valid, meaning that the keybinding should be disabled. Unfortunately,
it doesn't initialize the MetaKeyCombo so if the caller doesn't
initialize it either, we end up using random values and possibly
grabbing random keys.

https://bugzilla.gnome.org/show_bug.cgi?id=766270
2016-05-12 20:06:02 +02:00
Rui Matos
82a247ccf5 keybindings: Keep virtual modifier masks around
Besides the resolved real modifier masks, having the virtual masks
around will be useful too.

https://bugzilla.gnome.org/show_bug.cgi?id=748526
2016-04-19 18:02:25 +02:00
Olivier Fourdan
5d6af70bc9 keybindings: Fix keyboard move/resize on Wayland
Rework the code to keep the grab/ungrab logic when running as a Wayland
compositor.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=758076
2016-04-19 09:02:06 +02:00
Florian Müllner
46eb682c83 Revert "window: Remove old tiling code"
This reverts commit 8bded7d497.
2016-01-10 15:16:09 +01:00
Florian Müllner
40c3c69435 Revert "window: Add new tiling code"
This reverts commit 50e3e3b929.
2016-01-10 15:16:08 +01:00
Jasper St. Pierre
50e3e3b929 window: Add new tiling code
The new tiling code, instead of based around "tiling states", is instead
based around constrained edges. This allows us to have windows that have
three constrained edges, but keep one free-floating, e.g. a window tiled
to the left has the left, top, and bottom edges constrained, but the
right edge can be left resizable.

This system also is easily extended to support corner tiling. We also,
using the new "size state" system, also keep normal, tiled, and
maximized sizes independently, allowing the maximize button to bounce
between maximized and tiled states without reverting to normal in
between. Dragging from the top will always restore the normal state,
though.

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:09:30 -08:00
Jasper St. Pierre
8bded7d497 window: Remove old tiling code
We'll soon replace this with a better scheme

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:08:32 -08:00
Florian Müllner
25a796afc6 Fix constness warnings 2015-09-24 03:01:51 +02:00
Jonas Ådahl
14b0a83f64 Don't calculate the main window monitor every time it`s needed
The main monitor of a window is maintained as 'window->monitor' and is
updated when the window is resized or moved. Lets avoid calculating it
every time it`s needed.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:54:14 +08:00
Ray Strode
96b202c80d wayland: add keybindings for VT8-VT12
We currently only support switching to 1-7.
This commit brings us parity with X, and let's
us switch to all 12.

https://bugzilla.gnome.org/show_bug.cgi?id=744800
2015-02-19 16:42:58 -05:00
Jasper St. Pierre
5c60ea6635 keybindings: Consistently use slice allocation for MetaKeyBinding 2015-01-09 14:15:17 -08:00
Jasper St. Pierre
a1d8110221 keybindings: Merge rebuild_binding_index into reload_combos
The two are always called at the same time.
2015-01-08 14:36:47 -08:00
Jasper St. Pierre
9d6357f05a keybindings: Rename MetaKeyDevirtCombo to MetaResolvedKeyCombo
rtcm thought this was less awkward of a name.
2015-01-08 14:36:47 -08:00
Jasper St. Pierre
5bc2bcd109 keybindings: Simplify our keycode/mask pairs with MetaKeyDevirtCombo 2015-01-06 19:24:29 -08:00
Jasper St. Pierre
d12390002a keybindings: Have meta_change_keygrab take a MetaKeyDevirtCombo 2015-01-06 19:13:03 -08:00
Jasper St. Pierre
13acf9e35d keybindings: Have meta_accelerator_parse take a MetaKeyCombo 2015-01-06 19:11:57 -08:00
Jasper St. Pierre
3beb187cac keybindings: Split the resolved keybinding out from MetaKeyCombo
MetaKeyCombo is about the *unresolved* keybinding, which can either be a
"keysym" (<Ctrl>F) or a "keycode" (<Ctrl>0x21). When we resolved the
keysym to a keycode, we stuffed it back in the same MetaKeyCombo, which
confused about what the "keycode" field was for. Thus, we often stomped
on the user's explicit choice if they chose a keycode binding value.

To solve this, create a separate structure, the "devirtualized key combo"
or MetaKeyDevirtCombo, which contains a resolved keycode from the
keysym, and a devirtualized modifier mask. The MetaKeyCombo is now
always a "source" value, and the MetaKeyDevirtCombo is now always what
the user chose.

This also lets us significantly clean up the overlay and ISO key binding
paths.
2015-01-06 19:03:11 -08:00
Jasper St. Pierre
a3b8dcbd04 keybindings: Apply the same fix for keycodes to the GrabAccelerator API 2015-01-06 18:50:30 -08:00
Jasper St. Pierre
3ff8b0051d keybindings: Allow using keycodes directly for overlay-key
The reason MetaKeyCombo has a keycode value at all is *not* to store the
devirtualized keycode from the keysym, but instead to allow people that
type in "0x55" into the preference. Everything except the overlay-key
respected this. Make the overlay-key binding respect this.
2015-01-06 18:50:30 -08:00
Jasper St. Pierre
a8bf7934fb keybindings: Use one path to reload binding combos
Rather than one for modifiers and one for keycodes.
2015-01-06 18:50:29 -08:00
Jasper St. Pierre
7159845c6e keybindings: Embed MetaKeyCombo into MetaKeyGrab directly
A simple cleanup
2015-01-06 18:46:35 -08:00
Jasper St. Pierre
e4e00b383e keybindings: Remove keysym argument from meta_change_keygrab
It's only used for a debug statement.
2015-01-06 18:46:24 -08:00
Jasper St. Pierre
64295e8cd7 keybindings: Always freeze on the stage window
This is what gnome-shell does, so there's no reason to include this as
part of our API.
2014-10-14 14:36:47 -07:00
Jasper St. Pierre
310083aeb2 keybindings: Remove special-case code for reversing automatically
Since we now directly expose the reverses bindings directly, we
don't have to have this special-case in do_choose_window.

More importantly, if the backwards binding is pressed and has the Shift
key included, this will actually revert it

This doesn't matter for Alt-Tab in gnome-shell, which already replaces
it with a better Alt-Tab replacement, but it does matter for Alt-Esc,
which switches between windows directly.
2014-10-01 16:51:45 -06:00
Rui Matos
60c22b6236 keybindings: Do a breadth first search in our keysym to keycode code
Commit 1af0033368 made a subtle change
regarding how XKeysymToKeycode behaves. It does a depth first search
while XKeysymToKeycode is documented to do a breadth first search:

"this function looks in each column of the core keyboard mapping in
turn and returns the lowest numbered key that matches in the lowest
numbered group" - from the XKB library documentation

Looping over all keycodes for each layout and level index makes us go
back to the previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=737134
2014-09-24 23:20:42 +02:00
Florian Müllner
4a71621fbc keybindings: Fix indentation 2014-09-22 22:01:37 +02:00
Florian Müllner
565b9d73d5 keybindings: Do not depend on linux headers for above-tab key
Commit 2f229c3928 removed the code to compute the above-tab
keycode and replaced it with a simple constant from linux/input.h.
We obviously cannot depend on linux headers on non-linux systems,
so provide a fallback definition in that case (which is expected
to work assuming the system is using the Xorg xf86-input-keyboard
driver).

https://bugzilla.gnome.org/show_bug.cgi?id=737135
2014-09-22 21:54:48 +02:00
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