Jonas Ådahl
9df38c2126
tests/test-runner: Fix include order
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213 >
2023-08-25 21:15:07 +02:00
Jonas Ådahl
baa0f62ced
tests/shell: Restore minimized actor state in idle callback
...
This fixes the following
1. Minimize window; minimize animation starts
2. Do something that immediately destroys the animated actor (e.g. terminate)
3. This triggered the timeline of the animation to emit a "stopped"
signal while all transitions of the actor were destroyed
Previously we'd implicitly animate the scale again (set_scale(..)) which
created a new transition The hash table iterator didn't like this and
abort():ed
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213 >
2023-08-25 21:15:07 +02:00
Jonas Ådahl
1e25cb746a
window: Don't update suspend state after unmanaging
...
The actor will try to update the suspend state when it goes away, which
can in the case of unmap animations be after the window was unmanaged.
In this case, don't try to update any suspend state.
Fixes: 9a2c8b2592
("window: Add suspend state")
Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2984
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213 >
2023-08-25 15:48:19 +02:00
Jonas Ådahl
b743cc3528
tests/test-runner: Add 'sleep suspend_timeout' command
...
It's a tweak to the 'sleep' command to allow well known sleep lengths.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3213 >
2023-08-25 15:47:05 +02:00
Jonas Ådahl
5071a6df87
wayland/xdg-shell: Set the suspended
state to suspended windows
...
This will allow clients to e.g. enter power saving mode when they are
e.g. on another workspace, minimized or fully obstructed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3019 >
2023-08-24 19:57:58 +00:00
Jonas Ådahl
3af02e1b57
wayland/xdg-shell: Implement support for xdg_toplevel.wm_capabilities
...
Nothing dynamic yet, we don't have API for this, but we need it to
implement the next version. Sending "all" should be equivalent to v4
anyhow, so this is harmless.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3019 >
2023-08-24 19:57:58 +00:00
Jonas Ådahl
9a2c8b2592
window: Add suspend state
...
The 'suspend state' is meant to track whether a window is likely to be
visible any time soon. The hueristics for this are as follows:
* If a window is hidden, it will enter the 'hidden' state.
* If a window is visible, and unobscured, it will enter the 'active'
state.
* If a window is visible, but obscured by another window, it will enter
the 'hidden' state.
* If there is a mapped clone of a window, it will enter the 'active'
state.
* If the window has been in the 'hidden' state for 3 seconds, it will
enter the 'suspended' state.
This will eventually be communicated to Wayland clients so that they can
change their behaviour to e.g. save power.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3019 >
2023-08-24 19:57:58 +00:00
Jonas Ådahl
2d7a062913
window-actor: Be more consistent declaring the property
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3019 >
2023-08-24 19:57:57 +00:00
Niels De Graef
069fe8e915
src: Chain up to finalize()
...
We forgot to chain up to the parent class' `finalize()` vfunc in both
`MetaEis` and `MetaEisClient`. Plugs 2 (probably tiny) memory leaks.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3203 >
2023-08-22 21:57:07 +02:00
Daniel van Vugt
c4d7265656
kms/cursor-manager: Transform cursor movement from view space to CRTC
...
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2955 ,
https://gitlab.gnome.org/GNOME/mutter/-/issues/2957
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3180 >
2023-08-22 15:16:27 +00:00
Daniel van Vugt
ca27dbabd9
backends/native: Pass cursor transform from renderer to cursor manager
...
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3180 >
2023-08-22 15:16:27 +00:00
Daniel van Vugt
5a05b1a901
monitor-transform: Invert the behaviour of transform_point
...
Previously it transformed a physical CRTC coordinate to a logical desktop
coordinate. But current and future users of the function all require
conversion from logical coordinates to physical coordinates. We would have
had to always invert the transform parameter which is a waste of time when
we can instead just invert the function behaviour.
We also simplify the parameters to show both the point coordinate and the
area dimensions are potentially transformed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3180 >
2023-08-22 15:16:27 +00:00
Sebastian Keller
133931e3a3
core: Don't unmap XWayland windows without buffers on visibility update
...
18be74ed
was changing meta_window_should_be_showing_on_workspace() to
only show XWayland windows when they have buffers to prevent starting
transitions with a seemingly black window.
This however did not just delay the transition, but when called in
meta_window_update_visibility() could result in the X11 window getting
unmapped again if the call happens before there is a buffer. Then,
depending on the client, the window would either remain hidden or if the
client tries to map the window again, this would repeat the process,
triggering the closing transition every time.
This commit instead just hides the XWayland window from the compositor
but keeps the corresponding X11 window mapped while it does not have a
buffer yet.
Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2611
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2965
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2820
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2867
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3194 >
2023-08-21 18:32:41 +00:00
Carlos Garnacho
5d72be4016
backends/native: Regain time precision in a11y generated events
...
Get times in microseconds, instead of converting from milliseconds.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3190 >
2023-08-21 15:11:15 +00:00
Georges Basile Stavracas Neto
d4c923edf9
screen-cast/window-src: Report alpha-enabled pixel format
...
This allows windows screencasts with proper shadows, instead of
a black border around the window!
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2099
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:42:04 -03:00
Georges Basile Stavracas Neto
215b91a2e6
screen-cast/src: Consider preferred format for stream
...
When creating a new stream, check if the preferred format is
different from the default (COGL_PIXEL_FORMAT_BGRX_8888). If
it is, then also include it in the list of potential formats
for the stream.
COGL_PIXEL_FORMAT_BGRX_8888 is still passed around as it's
both the default, and the fallback for when things go wrong.
When creating buffers, use the negotiated SPA format instead
of a hardcoded value. We leave it to PipeWire to figure out
what's the best format, since clients may not support the
preferred format of the stream.
Due to how chaotic things got, this commit also cleans up
the create_pipewire_stream() to use an auxiliary array of
SPA formats, which is then iterated on in order to generate
the format pods.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:42:04 -03:00
Georges Basile Stavracas Neto
b6bf6572a1
screen-cast/src: Add get_preferred_format vfunc
...
This allows subclasses to hint which pixel format they would
prefer to be used. It may or may not be respected, depending
on the available hardware capabilities.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Georges Basile Stavracas Neto
e24be82c12
backends/screen-cast: Pass pixel format to DMA-BUF constructor
...
Following the previous commit, do the same function parameter
treatment to meta_screen_cast_create_dma_buf_handle().
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Georges Basile Stavracas Neto
b391ded7bf
renderer/native: Try to convert and use Cogl format
...
Convert the CoglPixelFormat format to a DRM format, and try
and use it to create a GBM buffer.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Georges Basile Stavracas Neto
b814aff600
common/drm-formats: Add function to map Cogl → DRM
...
It's basically the reverse mapping. It does not deal with
multiplanar formats.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Georges Basile Stavracas Neto
fdc3f3fec3
cogl/renderer: Pass pixel format to DMA-BUF constructor
...
In future commits, we will want to create DMA-BUFs with pixel
formats other than COGL_PIXEL_FORMAT_BGRX_8888. In preparation
for that, let's start passing a new pixel format parameter to
this function, and the corresponding winsys vfunc.
All callers of this function pass COGL_PIXEL_FORMAT_BGRX_8888
for now. Next commits will change that.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Georges Basile Stavracas Neto
14ed29e7b2
renderer/native: Trivial variable rename
...
Rename 'format' to 'drm_format' to not clash with following
commits.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175 >
2023-08-19 23:00:28 -03:00
Sebastian Keller
73bc074917
core: Destroy the correct opaque region when destroying a frame
...
Freeing the window opaque region rather than the frame one when was
leaking the frame opaque region and wrongly setting the window opaque
region to NULL.
Fixes: 82b2b7688
("core: Add infrastructure to keep window frames' opaque regions")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3188 >
2023-08-17 00:00:55 +02:00
Sebastian Keller
f57c239a26
kms/cursor-manager: Free struct in meta_kms_cursor_manager_impl_free()
...
The free function was not actually freeing anything, which was causing a
small leak.
Fixes: 6d873036e
("Add KMS cursor manager")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3188 >
2023-08-17 00:00:39 +02:00
Sebastian Keller
5fdb6a847f
kms/update: Free struct in meta_kms_crtc_color_updates_free()
...
The free function was only freeing the structs its members were pointing
to, but not the struct itself, causing a small leak.
Fixes: 0180ffdaa
("backends/native: Introduce MetaKmsCrtcColorUpdate")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3188 >
2023-08-16 21:24:28 +02:00
Sebastian Keller
193a21c601
surface-actor-wayland: Fix leak in apply_transform()
...
Using g_object_get() to get the allocation creates a copy that needs to
be freed by the caller.
Fixes: e94b52777
("surface-actor/wayland: Implement stable size and position rounding")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3188 >
2023-08-16 21:24:28 +02:00
Sebastian Keller
03ba3a825e
context: Fix a small leak in meta_context_main_get_x11_display_policy()
...
The caller of sd_pid_get_user_unit() is supposed to free the unit name
string.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3188 >
2023-08-16 21:24:28 +02:00
Carlos Garnacho
90a00dae99
compositor: Handle grab state through ClutterStage::is-grabbed handler
...
This is something the compositor could now track by itself, instead of
being pushed through events. It also makes more sense to do this directly
when the grabbing conditions change, as opposed to the next event.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
0b9f5ae75b
tests: Add test case for restoring focus after overview
...
This is a test case for
https://gitlab.gnome.org/GNOME/mutter/-/issues/2690 .
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
05eeb684d1
window: Postpone focusing until grab ended if uninteractable
...
When GNOME Shell is in the overview, we don't want windows to steal
focus left and right, but once we leave the overview, we do want
whatever was mapped with "take_focus" to get focus. Do that, but after
the last grab was dismissed.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2690
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
587c31b611
tests/test-runner: Add toggle_overview
command
...
This will emit the `overlay-key` key which will be handled by the test
shell.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
8268ec2ee8
tests/test-shell: Emulate overview grabs
...
This mimics what gnome-shell does when the overview is shown. This means
having a grab active, and setting the keyboard focus to the stage
itself.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
524c9aa458
tests: Introduce and use a custom test shell
...
Except for the tests that launches `mutter`, use a custom shell
implementation. It's roughly a copy of default.c with some cleanups on
top. A custom shell allows for a bit more freedom when doing testy
things.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3185 >
2023-08-16 15:34:46 +00:00
Jonas Ådahl
92051d59a6
constraint: Use WxH format for size in debug logs
...
Whether W,H or +W,H means "size" or "position" is rather unclear; fix
that by formating size as WxH instead of +W,H.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3124 >
2023-08-12 21:11:15 +00:00
Bilal Elmoussaoui
cd27cb5c85
cleanup: Fix various typos
...
Using the typos cli app
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3169 >
2023-08-12 20:13:37 +00:00
Michel Dänzer
04f18ae726
backend/x11: Free barriers in meta_backend_x11_dispose
...
Should fix a memory leak.
Fixes: 0debb24e12
("barriers: Make barriers fully part of the
backend").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
b081e51a21
Remove unused meta_x11_display_increment_event_serial
...
Unused since dfcefd3315
("Remove meta_core_increment_event_serial").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
1a5fb51396
Remove unused meta_window_x11_has_active_sync_alarms
...
Never used AFAICT.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
75a7870259
Remove unused meta_wayland_tablet_pad_group_lookup_resource
...
Never used AFAICT.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
76c5eb0060
Remove unused meta_wayland_pointer_constraint_get_seat
...
Unused since 8a8d47725c
("backends: Delegate pointer confinements to
an impl object").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
09feed5d21
Remove unused meta_wayland_data_device_is_dnd_surface
...
Unused since 6ec7fa2cbd
("wayland: Use surface role when special
casing surface commits").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
16e8bb34de
Remove unused meta_stack_get_bottom
...
Unused since 1b3a58c951
("...").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
830f8fcf06
Remove unused meta_seat_x11_lookup_device_id
...
Unused since d72bacb3cd
("backends/x11: Drop handling of
XI_DeviceChange").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
58326c85a4
Remove unused meta_seat_impl_get_devices_in_impl
...
Never used AFAICT.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
43716457d1
Remove unused meta_renderer_x11_nested_ensure_legacy_view
...
Unused since fc8a4afc45
("Remove meta_is_stage_views_enabled()").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
3b847f28ad
Remove unused meta_region_scale_double
...
Unused since 8b3c1f4b87
("cullable: Generalize actor coordinates space
translation for regions").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
65add94bfd
Remove unused meta_rectangle_edge_to_string
...
Unused since 52bc675fcb
("introspection: remove --allow-unprefixed")
(if ever used at all).
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
15df7c62a3
Remove unused meta_power_save_to_dpms_state
...
Unused since 5f6aee3419
("kms/update: Make power saving an update wide
change").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
c3afdefd15
Remove unused meta_output_is_laptop
...
Unused since cbb2a286f2
("monitor-manager: Don't use wacky physical
dimensions in display name").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00
Michel Dänzer
d3ec28848b
Remove unused meta_monitor_get_crtc_mode_for_output
...
Unused since e52641c4b6
("cursor-renderer/native: Replace HW cursor
with KMS cursor manager").
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3154 >
2023-08-12 19:53:46 +00:00