compare_window_position calls into meta_window_stack_position_compare
with inverted inputs instead of duplicating the logic.
This comes at the cost of an extra meta_stack_ensure_sorted which should
be culled out.
To ensure this, need_resort is reset before the sorting process starts.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4183>
Since these will not be used from now on, we can finally clean up
meta_stack_windows_cmp, window_stack_cmp and meta_display_stack_cmp.
Now the only comparison function is meta_window_stack_position_compare.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4183>
This commit adds another way how to disable the a11y manager ACL in development.
Setting the unsafe mode might not be as straightforward as setting an
environment variable for the session, and you can control it invidually too.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
Track unique DBus senders and allow only thse which own a (at least so far)
pre-defined set of well known DBus names.
Carlos Garnacho: Renamed to a more generic helper, use g_bus_watch_name().
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4217>
This commit introduces a new comparator, window_distance_cmp,
which uses either the top left or top right corner of a given window, based
on LTR, as reference for the squared distance.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
Both northwest_cmp and northeast_cmp didn't account for the work_area's
relative x and y coordinates which would lead to improper sorting on
multi-monitor setups.
To fix this, we pass the work_area when necessary and use it to offset the
absolute coordinates.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
Remove unnecessary sqrt() calls in northwest_cmp and northeast_cmp.
The square root would have been necessary if we needed the actual distance,
but we only care about the relative order, so it isn't.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
This is a preparatory commit, it refactors away of the
done_check_denied_focus label, simplifying the control flow.
The only functional difference is that now the auto-maximization when
windows don't fit the work_area is always applied.
The next commits will adapt find_next_cascade to properly handle this.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
This commit only reformats place.c, starting off uncrustify's output, no
functional change is intended.
It mostly aligns comments, as well as properly space out math,
follow current formatter enforced guidelines and fix alignment on a rogue
bracket.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
The method currently returns the stage itself when the property
is NULL.
This has become particularly problematic as the method is detected
as getter by gobject introspection, and gjs now optimizes property
accesses by calling the getter method instead.
Address this by turning the method into a genuine getter without
falling back to the stage.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4256>
The overlay-key and locate-pointer-key are special keys. They
can be used together with other keys to create a combo or they
can be used as a single key. This means that we are treating a
modifier key as a regular key while still allowing to use it as
part of a combo. This requires a special treatment that we can't
extend to an arbitrary list of keys.
However, we would like to use both Super_L and Super_R to
activate the overview. In order to allow this, introduce a new
parsing mechanism. With the new mechanism, if we fail to parse
the configured string, we will try to parse again by appending
_L first and _R later. If both succeed then we will use their
combos for handling the special key.
With this in place, we can configure Super as overlay-key. The
parsing of Super will fail, but Super_L and Super_R will succeed.
Allowing us to use both.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1277
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
The second combo is still disabled. This is in preparation for a
subsequent commit that is going to parse the preference in a
different way and might end up with two combos defined.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
Special keys are going to be represent by up to two combos. This
functions is able to handle them by adding all the keycodes that
these combos resolve to. Special keys don't have modifiers, so there
is no need to devirtualize them.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
This function allows, given an array of combos, to get all the
keycodes associated with them. Right now it is used for just
one combo, but will be used for two combos in order to handle
special keys like the overlay-key and the locate-pointer-key.
As it is now, this function is still useful for aggregate the
GArray creation/destruction in a single place.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
See 44269e6a1dadb643af3a748c2bcca04ac1ab72eb. The function
add_keycodes_for_keysym() is going to be called more than
once on purpose and we want the keycodes do be appended to
a non-empty GArray.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
We are going to need to call this function more than once to add
all the keycodes to the same GArray. Switch to handle GArrays and
rename the function in order to give a hint that keycodes are going
to be added to the passed GArray.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
We use them in a single place, there is no need to internally keep
track of them. The MetaKeyBindingManager has their resolved key
combo (overlay_resolved_key_combo and locate_pointer_resolved_key_combo)
which is enough. Get the special binding combos from the preference
right away when needed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
Only a tiny number of tablet pads that have more than one mode
group, everyone else has one mode toggle button and one group.
Let's not display "Group 0" for everyone if (almost) no-one has a Group
1 anyway.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4248>
HDR being enabled was controlled by toggling a property on
org.gnome.Mutter.DebugControl, which affected how the color space and
HDR metadata of the output was configured. Replace this with a higher
level MetaMonitor / MetaOutput level "color mode" enum, that is also
reflected in the monitor configuration API.
This enum is then used to derive the color space and HDR metadata at the
lower level where it matters. The ForceHDR debug control property is
still left there, as it only affects the color space and transfer
function of the view related to a monitor.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
Commit 48d070dae changed the logic to compare the modifiers mask as a
whole.
Unfortunately, that does not work with all combinations of modifiers, as
some may not be reported when the ISO_Next_Group key is notified.
Revert to the original logic which is to compare against each modifier
mask individually.
Fixes: commit 48d070dae - keybindings: Check for ISO_Next_Group keysym
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4237>
In process_iso_next_group(), we would use try to match mask and keycode
of ISO_Next_Group to tell whether the key combo has been activated.
That works on X11, but not on Wayland with the native backend, because
the keycode does not match.
But we do not need to go all through that burden to match the key combo
we could just use the keysym instead, which would work even when there
is no physical key for ISO_Next_Group.
All we need to do is check whether the symbol is ISO_Next_Group and the
modifier mask matches, which simplifies the code as well.
(Note that we still need to keep the resolved iso_next_group_combo
key combo around because the X11 backend grabs that key combo.)
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3883
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4232>
The gravity argument is no longer effective since the previous
commit. Drop the argument, and rename it to "meta_window_resize_frame",
all callers have been updated.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3972>
We really only need the logind API which can be provided either by
libsystemd or libelogind.
This also pulls out finding a logind provider from the native backend
only code because we make use of it in the generic backend code as well.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4223>