1
0
Fork 0
Commit graph

31942 commits

Author SHA1 Message Date
Sebastian Wick
7ab98f961c cogl/gles: Use the GL_BGRA8_EXT internalformat instead of the format
There is one define for the format (GL_BGRA_EXT) and one for the
internal format (GL_BGRA8_EXT). Use them appropriately.

This also adds defines to consistenly not use the _EXT postfix.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>

(cherry picked from commit c3eb01e547)
2024-08-18 18:28:54 +00:00
Sebastian Wick
66156236e2 cogl/gles: Use a premul required format for opaque fp16 Cogl formats
The opaque fp16 Cogl format variants need a required format that is
already premultiplied whereas the fp16 formats with an alpha channel can
be either straight or premult.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>

(cherry picked from commit d820fe030a)
2024-08-18 18:28:54 +00:00
Sebastian Wick
eecec5a699 cogl/gl: Use internal formats without alpha for non-alpha Cogl formats
The formats COGL_PIXEL_FORMAT_RGB_888 and COGL_PIXEL_FORMAT_BGR_888 for
the gl driver were using internal formats with an alpha channel.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>

(cherry picked from commit 41700d3cc7)
2024-08-18 18:28:54 +00:00
Daniel van Vugt
6e12b423c7 cogl/tests: Avoid floats when converting between int formats
All we need is an intermediate int format with twice as many bits and
to put division at the end to avoid any loss of precision.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3903>

(cherry picked from commit 3eb32cf750)
2024-08-18 18:28:54 +00:00
Daniel van Vugt
35c0c245ee cogl/tests: Avoid rounding/truncation ambiguity in 8/16bpc conversion
The OpenGL specs say rounding is preferred, but not required. Let's
avoid that uncertainty by choosing a test value that rounds and truncates
to the same integer either way. Only green needs fixing since our red,
blue and alpha values already follow this rule.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3903>

(cherry picked from commit 7df6b5c4ed)
2024-08-18 18:28:54 +00:00
Daniel van Vugt
d6a4ffc843 cogl/tests: Avoid converting 16bpc -> float -> 16bpc
Instead just assign 16bpc -> 16bpc

This avoids variations in CPU and GL driver behaviour when using
floats as intermediate values.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3582
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3903>

(cherry picked from commit 5360c58fe5)
2024-08-18 18:28:54 +00:00
Vasil Pupkin
c2c694464c Update Belarusian translation 2024-08-17 00:00:09 +00:00
Michel Dänzer
a60ba34264 cogl: Update latest sync fd also from cogl_gl_framebuffer_flush/finish
This ensures that any drawing for screen casting is reflected in the
sync fd.

Fixes: 99209958b9 ("cogl: Store latest GPU work completed sync fd")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3946>


(cherry picked from commit 61ae9eedb6)
2024-08-13 10:15:55 +00:00
Daniel Șerbănescu
dec5ffdadf Update Romanian translation 2024-08-11 11:28:42 +00:00
Daniel van Vugt
05f9b58965 backends/native: Only warn about cursor sizes once
Because if the current theme has exceeded the dimensions of
`DRM_CAP_CURSOR_WIDTH/HEIGHT` then the warning is just going to repeat
every time the cursor changes. We still fall back to software cursors
just fine so it's not important to repeat the warning.

Also the theme cursor size is not "Invalid" so we change the message to
match that of 47 main.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3597
2024-08-07 14:16:57 +08:00
Florian Müllner
04995f5664
Bump version to 46.4
Update NEWS.
2024-08-04 17:36:56 +02:00
Jonas Ådahl
4fb2a62c1f display: Rename mandatory X11 initialization function
Simply to make it clear that the renamed function is specific to a
particular X11 initialization mode (mandatory Xwayland), put that in the
name, so that it's easier to understand when this function is relevant.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3329>
2024-08-04 15:03:58 +00:00
Jonas Ådahl
56cfac14fb tests/x11: Fix replace test to catch the second instance failing
The test never noticed that the second instance never actually managed
to load; it was looping a multi second retry session trying to redirect
windows, meaning it failed to catch https://gitlab.gnome.org/GNOME/mutter/-/issues/3089.

Fix the test so that it always waits for mutter to finish loading
successfully, just like it waits fro the first.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3329>
2024-08-04 15:03:58 +00:00
Jonas Ådahl
827adc898e display: Move X11 initial focus handling to MetaX11Display
It's X11 specific, so put it in the X11 display manager object.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3329>
2024-08-04 15:03:58 +00:00
Jonas Ådahl
de31822ecc x11-display: Make subwindow redirection call mode specific
This means that for X11 sessions we'll do it before any windows are
mapped, and before any plugin implementation is started. Doing it before
a plugin is started is important, because things that the plugin does
during startup can have consequences on how compositing on Xorg works.

For the Xwayland case, we'll do it relatively in the setup phase. It
appears to have been harmless to do it later in the post-opened signal,
but there is no harm in doing it as one of the earlier steps.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3089
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3329>
2024-08-04 15:03:58 +00:00
Robert Mader
1ccf2cfb56 multi-texture-format: Fix limited range quantization
And stop pre-computing values, making errors like this harder to spot.

The values 0.0625 (16/256) and 0.5 (128/256) were slightly off,
resulting e.g. in "black" not being #000000 but #010001 RGB instead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3906>

(cherry picked from commit dfa5238bf9)
2024-07-29 17:06:29 +02:00
Chao-Hsiung Liao
bb9a2f1ede Update Chinese (Taiwan) translation 2024-07-27 07:38:16 +00:00
Carlos Garnacho
7e0e428016 clutter: Specify that input-only grabs are started inactive in API
Add the _inactive suffix, so that the state of these objects is clear.

(cherry-picked from commit 01444e803f)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3874>
2024-07-09 12:33:23 +02:00
Carlos Garnacho
827c4fea4b clutter: Add API to create inactive ClutterGrabs, and activate them explicitly
This gives greater control to the callers on the place where a grab is being
activated, this may make a difference in the handling of crossing events
triggered through it, e.g. by having callers rely on having already obtained
a ClutterGrab prior to handling the resulting effects.

The "input only" grab has also been turned inactive by default, in order to
to have the ClutterGrab pointer available for checks at the MetaWaylandEventHandler
focus changing methods triggered through grab activation.

(cherry-picked from commit 8e5f3a1f83)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3874>
2024-07-09 12:33:23 +02:00
Jürgen Benvenuti
0ffc27ad5c Update German translation 2024-07-07 16:15:03 +00:00
Florian Müllner
c1ffc17331
Bump version to 46.3.1
Update NEWS.
2024-07-04 00:10:40 +02:00
Michel Dänzer
b09c1d3bfa wayland/actor-surface: Don't bail for Xwayland surfaces
Thawing Xwayland surfaces don't hit meta_window_actor_wayland_set_frozen,
so we need to sync actor state for them here.

v2:
* Guard META_IS_XWAYLAND_SURFACE by HAVE_XWAYLAND, fixes Wayland-only
  build.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3557
Fixes: ec5444f541 ("wayland/actor-surface: Don't sync actor state for frozen actors")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3862>

(cherry picked from commit 041a404ba0)
2024-07-03 18:12:29 +02:00
Marco Trevisan (Treviño)
7515316395 clutter/clone: Do not use global transformation for scaling clones
When cloning an actor we were applying a global scale to it, based on
the size of the clone itself and of the cloned actor.

This implied that the transformed size of the clone was not the one that
was set, but it was taking taking in account the actor scaling too.
So in practice we were scaling it twice.

While this had no visual implications it indeed was causing troubles
when a ClutterClone was reactive because in such case only the scaled
area of the scaled clone was considered reactive.

Assume you had an actor of 100x100 pixels, scaling it to a clone of
50x50 pixels:
 - The scale applied to the clone was 0.5
 - The transformed size of the clone was: 25x25 pixels
 - The clone was reactive only in that sub-area

To avoid this, never touch the clone transformation matrix, but only
transform it at paint time.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2959>

(cherry picked from commit 44c0c311ba)
2024-07-03 10:38:15 +02:00
Florian Müllner
3998f8a422
Bump version to 46.3
Update NEWS.
2024-06-29 21:32:23 +02:00
Corentin Noël
24f2e76576 meta/plugin: Annotate dialog creation virtuals as return full
The two dialog creation virtual functions returned by these functions have to
be unreferenced by the caller (and are actually unreferenced in other places in
the code).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3790>
(cherry picked from commit 4134d12789)
2024-06-29 21:12:29 +02:00
Jeffrey Knockel
18c17aaa5a constraints: Allow resize of windows moved above screen
If the titlebar of a window has been moved above the screen by a user
via an unconstrained move, then any constrained user resize following
this move will cause the window to jump below the top of the screen or
cause other glitchy behavior.

This commit removes the constraint that the titlebar of a window must be
below the top of the screen for any resize that is both (1) triggered by
a user and (2) is a resize that affects only the left, right, or bottom
edges of the window.  This allows users to move a window partially above
the screen and then resize the window to be wider or resize the bottom
edge of the window to make it taller or shorter.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1206
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3764>
(cherry picked from commit 5ba364a947)
2024-06-28 23:22:22 +02:00
Shiki Okasaka
a0dd01c95f clutter: Use character offsets for specifying the surrounding text
clutter_input_focus_set_surrounding() expects cursor and anchor positions
to be provided in character offsets.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3440
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3719>
(cherry picked from commit 4b1411696e)
2024-06-28 23:22:14 +02:00
Orko Garai
7f344053f8 Use byte offset for cursor_end/anchor value sent in preedit_string.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3845>
(cherry picked from commit f214eb5134)
2024-06-28 23:22:06 +02:00
Michel Dänzer
8978f74c1e wayland/surface: Can't send scale events with NULL surface->resource
The committed state can't have any children sub-surfaces either, so
just bail.

Fixes: ae403f2e94 ("wayland: Use new highest scale monitor tracking for fractional_scale_v1")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3552

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3849>
(cherry picked from commit 94f3bbd94b)
2024-06-28 21:18:01 +02:00
Sebastian Wick
7e4f6faaaa wayland/surface: Send unmapped signal when the surface goes away
This was the intention anwyway but it didn't work properly because
GObject::dispose removes all signal handlers and we unmap surfaces in
WaylandShellSurface::finalize. Move all the unmanaging and unmapping to
the dispose vfunc where we can still run all the signal handlers.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3501
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3783>
(cherry picked from commit 4eacf97678)
2024-06-28 21:18:01 +02:00
Sebastian Wick
e8cc52044d wayland: Handle unmapping surfaces
Right now the unmapped signal doesn't always fire which means we didn't
see a surface that's being unmapped in these code paths before. In
particular the resource, window and role can be gone. Handle those
cases.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3783>
(cherry picked from commit 3e7b1d9cbd)
2024-06-28 21:18:01 +02:00
Pascal Nowack
30f73d554f backends/screen-cast-stream-src: Always initially set buffer stride
When mutter creates a dma-buf buffer for screencasting, the buffers
stride will, among other attributes, also be defined.
However, mutter currently only sets the buffer stride, when actually
recording a frame, but not when adding it.
This behaviour disallows screencast consumers (clients) to already
import the respective buffer (i.e. for Vulkan creating a VkImage for the
dma-buf image), as the stride is not yet communicated to the client.

Since the stride won't change after adding the respective buffer,
directly set the buffer stride, when adding the PipeWire buffer. This
allows screencast consumers (clients) to do optimizations in their
encoding paths.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3827>
(cherry picked from commit 0dd4080509)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
1d7c2c7b61 x11: Add another fallback to legacy X11 cursor names
For X11 apps that don't specify their own.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3403
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 807c99fca6)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
d2d98a850c backends: Restore support for loading X11 cursor themes missing "default"
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3184
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit d2c6b77059)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
f744efe347 backends: Add meta_cursor_get_legacy_name()
To aid loading of legacy cursor themes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 4a4ab8c533)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
234013961e backends: Fix parameter alignment check-code-style complains about
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 13b2803a03)
2024-06-28 21:18:01 +02:00
Daniel van Vugt
c1f03eba73 backends/x11: Avoid defining (and freeing!) nonexistent cursors
Such as "default" for legacy X11 themes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3454
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3718>
(cherry picked from commit 847f015017)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
df93ce4524 tests: Mark some tests as skippable
Wayland tests also get kvm and tty test variants, but running tty tests
on your main session makes them fail. The intention for tty tests is to
skip when not run from a tty, so fix that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3811>
(cherry picked from commit 6d8c93ba66)
2024-06-28 21:18:01 +02:00
José Expósito
88f5fb3447 backends/eis-client: Release buttons on device remove
Due to a copy and paste error, buttons were not released when the device
was removed.

Found by Coverity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3809>
(cherry picked from commit 4ae305f19e)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
a193da6d97 kms: Don't use kernel thread when headless
We're not doing anything significant in the KMS thread anyway, so don't
make it a kernel thread, and don't ask to be real time scheduled (which
we wouldn't be anyway, but for clarity).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
(cherry picked from commit 5bca761148)
2024-06-28 21:18:01 +02:00
Jonas Ådahl
80d1b79849 backend/native: Find render node directly via udev
Don't try to find the card, and then the render node from it, just ask
udev to list the render nodes directly. This avoids running into
permission errors when the user cannot open /dev/dri/card* even without
mode setting capabilities.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3805>
(cherry picked from commit 6bd2fd6a74)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
e1efc4c64e wayland: Double check surface/window before looking for modals
While it should not be expected that we pick the pointer into a
MetaSurfaceActor that is disembodied of its MetaWaylandSurface/MetaWindow,
the paths where this should be enforced are somewhat scattered.

So account for the situation in picking code, and prefer a NULL surface
over a crash. This operates on the assumption that this inconsistent state
where Mutter didn't know better to pick a correct surface actor will be fixed
by later crossing events resolving the intermediate state, and that no
other input events will be received meanwhile.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3393
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit e731f2a055)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
2f4dc03451 wayland: Make subsurface actors unreactive early during destruction
When unmapping a subsurface, it does lose early its connection to the
parent surface. This is however a deciding factor in determining whether
the surface (role) has a window.

Make the subsurface actor unreactive if its connection to the parent
MetaWindow was severed, since it should not be eligible for picking anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit 66e23b009c)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
523d716e63 compositor: Make surface actors unreactive after losing their surface
These actors are expected to be destroyed along with their surface, this
however happens later in the process, so there is a moment where actors
are eligible for picking, but do not have a surface anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
(cherry picked from commit 17dc9393e0)
2024-06-28 21:18:01 +02:00
Sebastian Keller
feec993dee events: Don't check for stage grabs before sending events to ibus
Prior to the grabs/focus rework in !3420, Wayland grabs were handled
separately from ClutterGrabs. This required explicitly checking for
ClutterGrabs as those were expected to prevent events from reaching
Wayland clients.

Now after !3420, Wayland client grabs also result in ClutterGrabs, which
means that this check causes input events for popups with grabs to not
get sent to ibus anymore. Instead the events are getting sent to the
client directly, which results no ibus support in popups (unless the
client handles that itself by using a different GTK_IM_MODULE).

However due to the changes from !3420 checking for ClutterGrabs is also
no longer necessary and the meta_wayland_text_input_update() focus check
is now sufficient to only forward events to ibus, when the focus is
actually on a Wayland client. So to fix this we can simply remove the
check.

Fixes: 2a584a8f0 ("wayland: Make use of Wayland event grabbing mechanism")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3502
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3787>
(cherry picked from commit a99e139a68)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
6aaa76dfc3 Revert "wayland: Add meta_wayland_seat_get_input_focus_client() call"
This reverts commit 743fb6df30.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit ad60d7123b)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
c2dc92a214 wayland: Fix possibly out of sync clipboard selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Fixes: 5ca10c31d1 ("wayland: Follow seat's input focus client for clipboard selections")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3490
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit b968796f1f)
2024-06-28 21:18:01 +02:00
Carlos Garnacho
73cab26d0f wayland: Fix possibly out of sync primary selections
Replace the sync_focus() calls with a set_focus() do-it function taking
a surface. This is in line with the rest of the things that happen at
the default MetaWaylandEventInterface.focus implementation, and will
make these correctly observe the presence of grabs, since
meta_wayland_seat_get_input_focus() will return the would-be focus
in these cases.

This change makes the "focused" client selection truly
in sync with the keyboard focus.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3498
Fixes: 9bdb00c459 ("wayland: Follow seat's input focus client for primary selections")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3789>
(cherry picked from commit 9dab806a18)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
2fca52fb91 core/context: Add typecheck guards to the public functions
In the shell side we ended up calling the wrong function [1] and mutter
didn't stop us from doing it, so add some type-check guards to ensure we
don't do similar errors again

[1] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3355

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3791>
(cherry picked from commit 467746c8a7)
2024-06-28 21:18:01 +02:00
Marco Trevisan (Treviño)
6f489292b9 cogl: Do not store the XVisualInfo
We were leaking one instance because _cogl_winsys_egl_context_created()
could be potentially be called twice (via cogl_display_setup() one as
part of cogl_renderer_check_onscreen_template() and the other when
called from clutter_backend_do_real_create_context()), and so we'd ended
up overwriting the reference we had.

However, we really didn't use it anywhere and once used to call the
relevant functions it's just useless.

So let's just keep it as local variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit bcec6df78e)
2024-06-28 21:18:01 +02:00