Commit Graph

28592 Commits

Author SHA1 Message Date
Luming Zh
b8bd5977be Update Chinese (China) translation 2022-01-30 19:18:55 +00:00
sicklylife
c09cffc3e2 Update Japanese translation 2022-01-30 15:25:37 +00:00
sicklylife
4c47b1e1a4 Update Japanese translation 2022-01-30 15:12:27 +00:00
Carlos Garnacho
e8ed9ece1c core: Drop META_GRAB_OP_COMPOSITOR
There is no longer meta_plugin_begin_modal(), so this grab operation
is no longer used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2100>
2022-01-29 02:11:37 +01:00
Carlos Garnacho
b6de66e353 compositor: Remove meta_plugin_begin/end_modal
Amazingly, this is no longer used. This way to let Clutter grab input
is no longer necessary.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2100>
2022-01-29 02:11:37 +01:00
Carlos Garnacho
527cc51665 clutter: Refactor event emission into a common function
Without input device grabs in play, all functions that emit
pointer/key/crossing/touch events are pretty much the same. Remove this
duplication and use a common emit_event() function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2100>
2022-01-29 02:11:37 +01:00
Carlos Garnacho
ac4face82a clutter: Remove input device grabs
Both device-global and input-sequence-local. These are no longer used,
in favor of ClutterGrab.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2100>
2022-01-29 02:11:37 +01:00
Carlos Garnacho
b8853b07a5 tests: Rewrite interactive Clutter grabs tests
So it uses ClutterGrab, instead of an API that is soon to disappear.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2100>
2022-01-29 02:11:37 +01:00
Carlos Garnacho
d51469ea2a clutter: Move priv variable initialization after precondition checks
In case of misuse (e.g. passing NULL stage) this might result in crashes
before the precondition checks managed to kick in. Move this priv variable
initialization after these checks.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
a840c039a0 core: Handle redirection changes in and out of ClutterGrab grabs
Wayland event processing and WM operations are themselves outside the
ClutterGrab loop so far. Until this is sorted out, these pieces of
event handling have got to learn to stay aside while there is a
ClutterGrab going on.

So, synchronize foci and other state when grabs come in or out, and
make it sure that Wayland event processing does not happen while
grabs happen.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
0e234d76f4 clutter: Use ClutterGrab for ClutterText implicit grab
This is used to temporarily redirect input to the entry, while
text is being selected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
3a79b7b066 clutter: Add docs and introspection annotations to grabs
Since we want these accessed from bindings this must be a boxed
type. This has the side effect of making ClutterGrab a refcounted
object, since we want to avoid JS from pointing to freed memory
and maybe causing crashes if misusing the object after dismiss.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
ff98cbb19f clutter: Fix CLUTTER_LEAVE handling of ClutterClickAction
Toggling the click action on when leaving the actor/action sounds weird,
this was presumably meant to toggle it off on leave, and back to in_held
on enter. This way, the CLUTTER_LEAVE handling also matches what we want
to do in case of grabs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
f22ea7399c clutter: Cancel ClutterGestureActions on leave+grab_notify events
The lack of handling of regular crossing events here is dubious, perhaps
to be fixed later on. So far, ensure gestures are cancelled whenever
a grab-inducted crossing event would leave this action in the blue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
c2d7e635b1 clutter: Drop clutter_stage_[gs]et_throttle_motion_events()
This setting stays at the default and is left untouched, drop this
external switch on event handling internals.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
db44279997 clutter: Drop undefined function declarations
These functions arent' there anymore, drop them from the header.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
6144244201 clutter: Drop clutter_stage_[gs]et_motion_events_enabled()
This is (luckily!) unused, and it's inconvenient to have a toggle to
break the input model we are striving towards. Drop this function
and stick to the default behavior.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Carlos Garnacho
4b0e998ab8 clutter: Key events should not be delivered to non reactive actors
Drop this piece of old code that assumes all actors want key events.
We currently have the reactive flag to indicate these want input.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
2022-01-29 00:37:14 +00:00
Robert Mader
27cbf7b23d clutter/actor: Soften the check for guessed scale
In some use cases it's useful to have scaling below 100%. Right
now the assert here prevents doing that, so soften it to `0.5` -
likely about the lower limit what people would try (and what is
exposed by default on KDE).

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1465
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2263>
2022-01-28 23:33:30 +01:00
Olivier Fourdan
b8870a11b8 xwayland: Warn when autoclose-xwayland is not usable
The experimental feature "autoclose-xwayland" requires a couple of
prerequisites:

1. Be able to (re)start Xwayland on demand, i.e. with systemd
2. Xwayland must support the terminate delay

Add a warning message if "autoclose-xwayland" was requested but any of
those prerequisites is not met.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2258>
2022-01-28 15:46:56 +00:00
Olivier Fourdan
6ce80ccc54 xwayland: Remove stop xserver timeout
Since commit 226afa24a - "Use Xwayland auto-terminate feature", the
callback function shutdown_xwayland_cb() does not check for the
autoclose-xwayland experimental feature anymore.

As a result, when running nested or outside of systemd,
gnome-shell/mutter would quit after 10 seconds unless some X11 window
was mapped.

But now that we rely on Xwayland's own terminate feature, there really is
no need to use any xserver timeout function anymore.

We do not need to keep track of X11 windows being created or unmapped, as
again, Xwayland does all that for us at the client level.

Remove all this code that we do not need anymore.

fixes: 226afa24a - Use Xwayland auto-terminate feature

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2258>
2022-01-28 15:46:56 +00:00
Marek Černocký
936773493c Updated Czech translation 2022-01-28 11:33:27 +01:00
Marek Černocký
dd9ef964ec Updated Czech translation 2022-01-28 11:30:44 +01:00
Daniel van Vugt
c970bb3e6c cogl: Merge FEATURE_ID_GET_GPU_TIME into FEATURE_ID_TIMESTAMP_QUERY
Because both code paths require the existence of `GL_TIMESTAMP[_EXT]`
which is only guaranteed if `ARB_timer_query` (included in GL core 3.3)
is implemented.

We know when that is true because `context->glGenQueries` and
`context->glQueryCounter` are non-NULL. So that is the minimum
requirement for any use of `GL_TIMESTAMP`, even when it is used in
`glGetInteger64v`.

Until now, Raspberry Pi (OpenGL 2.1) would find a working implementation
of `glGetInteger64v` but failed to check whether the driver understands
`GL_TIMESTAMP` (it doesn't).

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2107
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2253>
2022-01-27 22:58:59 +00:00
Yuri Chornoivan
264e1a9066 Update Ukrainian translation 2022-01-27 14:54:09 +00:00
Carlos Garnacho
dbfde95c5c clutter: Do not check redraw area for pointer repicks
This looks like a relic of glReadPixels-based picking, the pointer
might well be outside redrawn areas, yet still require a device
update (e.g. in order to reflect the actor layout changes in the
"clear area" info).

Instead, always update all devices that are inside the view after
relayouts, the tracking on the need for that update is now done
on each ClutterStageView, instead of globally in the ClutterStage.

This theoretically fixes situations where pointers might miss
updating their "clear area" after the actor tree changed.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2117
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2257>
2022-01-27 11:08:24 +00:00
Aleksandr Melman
b31fb804df Update Russian translation 2022-01-27 10:48:21 +00:00
Matheus Barbosa
12dcc3d60c Update Brazilian Portuguese translation 2022-01-26 19:42:09 +00:00
Fran Dieguez
29d7919c89 Update Galician translation 2022-01-26 19:00:02 +00:00
Hugo Carvalho
c5e5d351ea Update Portuguese translation 2022-01-26 15:49:01 +00:00
Olivier Fourdan
226afa24aa xwayland: Use Xwayland auto-terminate feature
When using Xwayland-on-demand (default), if the (experimental) autoclose
features is enabled, we can rely on Xwayland's auto-terminate feature
instead of explicitly killing the Xwayland process.

With it, gone is the mechanism that was added to check the X11 clients
connected and their executable to check whether we can (safely) kill
Xwayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1794>
2022-01-26 14:42:22 +01:00
Olivier Fourdan
42855b69e7 xwayland: Mark our X11 connection terminatable
The connection to the Xserver for the X11 window manager part of mutter
even on Wayland may prevent the Xserver from shutting down.

Currently, what mutter does is to check the X11 clients still connected
to Xwayland using the XRes extension, with a list of X11 clients that
can be safely ignored (typically the GNOME XSettings daemon, the IBus
daemon, pulseaudio and even mutter window manager itself).

When there is just those known clients remaining, mutter would kill
Xwayland automatically.

But that's racy, because between the time mutter checks with Xwayland
the remaining clients and the time it actually kills the process, a new
X11 client might have come along and won't be able to connect to
Xwayland that mutter is just about to kill.

Because of that, the feature “autoclose-xwayland” is marked as an
experimental feature in mutter and not enabled by default.

Thankfully, the Xserver has all it takes to manage that already, and
is even capable of terminating itself once all X11 clients are gone (the
-terminate option on the command line).

With XFixes version 6, the X11 clients can declare themselves
"terminatable", so that the Xserver could simply ignore those X11
clients when checking the remaining clients and terminate itself
automatically.

Use that mechanism to declare mutter's own connection to the Xserver as
"terminatable" when Xwayland is started on demand so that it won't hold
Xwayland alive for the sole purpose of mutter itself.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1794>
2022-01-26 14:42:22 +01:00
Olivier Fourdan
ffa5fd776d ci: Build Xserver from git
This is to get support for the “-terminate delay” option in Xwayland
with libXfixes 6.0.

libXfixes 6.0 provides the new ClientDisconnectMode that clients can
use to declare themselves as to-be-terminated.

This can be used to let Xwayland terminate itself automatically when no
other (“non-terminatable”) X11 client is left.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1794>
2022-01-26 14:42:22 +01:00
Yosef Or Boczko
0dd652e4e4 Update Hebrew translation 2022-01-25 21:22:02 +00:00
Hugo Carvalho
724131fce0 Update Portuguese translation 2022-01-25 19:37:21 +00:00
Boyuan Yang
1a51696bec Update Chinese (China) translation 2022-01-25 18:18:46 +00:00
Jonas Ådahl
b5f99bd12e doc: Add monitor configuration documentation
This describes how the `monitors.xml` file work, and how to override the
newly introduced configurable policy.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
b49421d8e8 monitor-config-store: Allow changing D-Bus configuration policy
Adding a <dbus/> element containing a boolean (yes/no) determines
whether org.gnome.Mutter.DisplayConfig ApplyMonitorsConfig will be
callable. The state is also introspectable via the
ApplyMonitorsConfigAllowed property on the same interface.

For example

    <monitors version="2">
      <policy>
        <dbus>no</dbus>
      </policy>
    </monitors>

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
3d4a6875e6 monitor-config-store: Add test for monitor configuration policy
The test aims to verify that setting the following policy

    <policy>
      <stores>
        <store>system</store>
      </stores>
    </policy>

only applies monitor configurations from the system level.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
d8a66a3892 tests: Split out monitor configuration tests to its own test case
This makes it easier to run without having to run all the other tests,
and it will allow us to be more particular with its setup.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
67425bf653 tests: Move orientation helper to monitor test utils
It was used by both the orientation tests, and the monitor configuration
tests. Lets move the helper to common ground.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
20686f3354 tests/monitor-unit-tests: Remove left-over function declaration
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
85a3ca3d17 tests: Add more monitor config policy parsing tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
c611b64c53 monitor-config-store: Add way to define config store loading policy
This adds a way to define a way, at the system level, to define a policy
of how monitor configuration files are loaded.

The intended use case is to e.g. either prefer system level monitor
configurations before user levels, or only allow system level
configurations.

Examples:

Prefer system over user level configurations:

    <monitors version="2">
      <policy>
        <stores>
          <store>system</store>
          <store>user</store>
        </stores>
      </policy>
      <configuration>
        ...
      </configuration>
    </monitors>

Only allow system level configurations:

    <monitors version="2">
      <policy>
        <stores>
          <store>system</store>
        </stores>
      </policy>
      <configuration>
        ...
      </configuration>
    </monitors>

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
6c4380ed41 monitor-config-store: Fix incorrect string comparison with empty string
strncmp() always return 0 if the passed length is 0. What this means is
that whatever the first string check happens to be, if the parsed XML
cdata was empty (e.g. if we got <element></element>), the first
condition would evaluate to true, which is rather unexpected.

Fix this by making sure the string length is correct first. Also move it
into a helper so we don't need to repeat the same strlen() check every
time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
b74e99b10b monitor-config-store: Make parsing a bit more forgiving
Allow unknown XML elements inside <monitors>. This makes extending in
the future easier.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
2022-01-25 16:25:48 +00:00
Jonas Ådahl
2d7a8c3ce9 kms: Don't enter power saving via updates
The way device backends implement power saving differ, and power saving
needs to contain nothing incompatible in the same update. Make it
impossible to e.g. mode set, page flip, etc while entering power save by
not using MetaKmsUpdate's at all for this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
2022-01-25 15:47:03 +00:00
Jonas Ådahl
3472ff50ce tests/kms/device: Add power saving test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
2022-01-25 15:47:03 +00:00
Jonas Ådahl
2e774e8e14 tests/kms: Check predicted state is correctly predicted
When we're predicting state, i.e. when having posted an update while
avoiding reading KMS state, copy the predicted state, update the actual
state, and check that the predicted state matches the newly updated one.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
2022-01-25 15:47:03 +00:00
Jonas Ådahl
2478000c73 kms: Properly predict power saving effect on tracked state
Entering power saving effectively disables CRTCs, and thus the CRTC id a
connector is associated with. Make sure that the tracked state reflects
this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
2022-01-25 15:47:03 +00:00