Commits on Source (30)
-
Carlos Garnacho authored
We are using internal API that has the benefit of checking that the focus surface still matches, but has the drawback that it does not check the MetaWaylandKeyboard state. In order to fix this, look for keyboard focus and serial matches specifically when triggering activation. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2148> (cherry picked from commit d2998a8e)
99b0b78e -
Robert Mader authored
This calculation wrongly applied a `x2 - x1` pattern. Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1971 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2169> (cherry picked from commit 6204769f)
4913578b -
Olivier Fourdan authored
When dealing with a faulty hardware or bugs in the driver, it might be interesting to force the use of software cursors for debugging purposes. Add a debug environment variable MUTTER_DEBUG_DISABLE_HW_CURSORS to disable hardware cursors and force using software cursors. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2046 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2150> (cherry picked from commit 56939abd)
5d0c2663 -
Process surface damage in the right order, simplifying the calculations. No functional change intended. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2168> (cherry picked from commit f4717d0a)
75689b69 -
If no viewport is set, the neutral viewport is the surface size without viewport destination size applied - i.e. transform and scale applied to the buffer size. Change it accordingly, giving us the same values we'd return in `get_width` in this case. As result, this only changes cases where a viewport destination size but no viewport source rectangle is set. The change fixes exactly such cases, e.g. the Gstreamer Wayland sink. Can be tested with: `gst-play-1.0 --videosink=waylandsink`. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2168> (cherry picked from commit c1668116)
e7570757 -
Most clients nowadays switched to buffer damage, most notably Mesa and Xwayland. Thus lets avoid the extra cost of allocating three `cairo_region_t`s and doing some calculations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2168> (cherry picked from commit c498ae33)
7b64c159 -
Jonas Ådahl authored
In various places we retrieved the default seat from the ClutterBackend. All the clutter backends implement this by calling meta_backend_get_default_seat() which will then return MetaBackendPrivate::default_seat. Lets avoid this by fetching the default seat directly. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2002>
8a715233 -
Jonas Ådahl authored
This will later be used to invalidate GPU state when closing device nodes. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147> (cherry picked from commit 25ed64b6)
7e706742 -
Jonas Ådahl authored
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147> (cherry picked from commit c87779f6)
4714fa05 -
Jonas Ådahl authored
During tear down, if anything teared down after the seat tries to get the cursor renderer, we'd crash trying to get it as the seat would already be gone. Avoid this by returning NULL when there is no seat. It's assumed that any path that will happen during tear down that relies on getting the cursor renderer will gracefully handle it not being present, e.g. by relying on the cursor rendering cleaning up itself. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147> (cherry picked from commit ada52426)
53b1ad28 -
Jonas Ådahl authored
This ensures we don't have any left over cursor GPU buffers (via gbm_bo's) after destroying the corresponding gbm_device (owned by MetaRenderDevice). Fixes crashes with backtraces such as 1) meta_drm_buffer_gbm_finalize at ../src/backends/native/meta-drm-buffer-gbm.c:450 4) invalidate_cursor_gpu_state at ../src/backends/native/meta-cursor-renderer-native.c:1167 9) update_cursor_sprite_texture at ../src/wayland/meta-wayland-cursor-surface.c:70 10) meta_wayland_surface_role_apply_state at ../src/wayland/meta-wayland-surface.c:1869 11) meta_wayland_surface_apply_state at ../src/wayland/meta-wayland-surface.c:832 12) meta_wayland_surface_commit at ../src/wayland/meta-wayland-surface.c:993 13) wl_surface_commit at ../src/wayland/meta-wayland-surface.c:1158 14) ffi_call_unix64 at ../src/x86/unix64.S:76 15) ffi_call at ../src/x86/ffi64.c:525 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147> (cherry picked from commit 4159c76a)
8eeccfc3 -
Jonas Ådahl authored
An incorrect assumption that after mode set there would be no pending page flips was made. This meant that if there was a mode set, followed by a page flip, if that page flip was for a CRTC on a now unused GPU, we'd crash due to the renderer GPU data having already been freed. This commit avoids that by keeping it alive as long as the page flips are still in the air. It fixes crashes with backtraces such as 0) meta_render_device_get_egl_display (render_device=0x0) at ../src/backends/native/meta-render-device.c:320 1) secondary_gpu_state_free (secondary_gpu_state=0x1c8cc30) at ../src/backends/native/meta-onscreen-native.c:560 2) meta_onscreen_native_dispose (object=0x1cb65e0) at ../src/backends/native/meta-onscreen-native.c:2168 3) g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3540 4) g_object_unref (_object=0x1cb65e0) at ../gobject/gobject.c:3470 5) clutter_stage_view_finalize (object=0x1cbb450) at ../clutter/clutter/clutter-stage-view.c:1412 6) g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3578 7) g_object_unref (_object=0x1cbb450) at ../gobject/gobject.c:3470 8) meta_kms_page_flip_closure_free (closure=0x1d47e60) at ../src/backends/native/meta-kms-page-flip.c:76 9) g_list_foreach (list=<optimized out>, func=0x7fb3ada67111 <meta_kms_page_flip_closure_free>, user_data=0x0) at ../glib/glist.c:1090 10) g_list_free_full (list=0x1cb4d20 = {...}, free_func=<optimized out>) at ../glib/glist.c:244 11) meta_kms_page_flip_data_unref (page_flip_data=0x1c65510) at ../src/backends/native/meta-kms-page-flip.c:109 12) meta_kms_callback_data_free (callback_data=0x227ebf0) at ../src/backends/native/meta-kms.c:372 13) flush_callbacks (kms=0x18e2630) at ../src/backends/native/meta-kms.c:391 14) callback_idle (user_data=0x18e2630) at ../src/backends/native/meta-kms.c Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147> (cherry picked from commit 287908e0)
7ab1853a -
Jonas Ådahl authored
This is so that it can unregister from it on tear down. The tracker owns references to cursors too, but this cycle is already broken as the backend calls 'g_object_run_dispose()' when tearing the cursor tracker down. Fixes a crash on shutdown.
ea67a063 -
Otherwise we often advertise wrongly calculated modes. Original patch from Jonas Ådahl and the xrandr project. Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/275 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2190>
19b1c497 -
Sebastian Keller authored
The list returned by clutter_actor_get_children() is caller owned. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2193> (cherry picked from commit 39415974)
2368d85c -
Jonas Ådahl authored
When Xwayland was not initalized, we'd still clean things up. What this accidentally meant was that the uninitialized display number 0 was cleanud up, which very likely was main display of the host session. What this meant in practice was that /tmp/.X11-unix/X0 was often removed, causing every Flatpak X11 application to fail to start until Xwayland was restarted nad the X0 socket file was restored. Fix this in two ways: firstly only shutdown Xwayland if we ever started it, i.e. if the X11 display policy was not 'disabled'. This should fix the issue most of the times. Secondly only clean up the socket if it was ever initialized. This should fix things if the socket creation failed, as if it did, the name would be set. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2162> (cherry picked from commit 0df12ebe)
cd6abd50 -
Sebastian Keller authored
This was always true and therefore resulting in all configurations being considered as having a size, even when they don't change the size, such as a state change. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2103> (cherry picked from commit 67033b0a)
8c6b3e03 -
Ievgen Popovych authored
Signed-off-by: Ievgen Popovych <jmennius@gmail.com> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2187> (cherry picked from commit b596de26)
db0481f9 -
Sebastian Keller authored
When rendering to a buffer that is not the stage view buffer, we can not know where the buffer will be displayed on the screen. As a result we also can not know what translation would need to be applied to culling. This was causing glitches when the gnome-shell magnifier was applying offscreen effects. ClutterOffscreenEffect causes MetaWindowGroup to be rendered to an offscreen buffer at an offset, because it draws to a slightly larger texture with an accordingly translated origin. This translation then later is canceled out again when the offscreen buffer is drawn. To meta_actor_painting_untransformed() however which only sees the translation used when drawing to the buffer this looked like the window group was being rendered at the offset. This then lead to redraw_clip getting translated accordingly, resulting in wrong coordinates used for culling. Similarly this was leading to issues when taking area screenshots while at 1x zoom. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1678 Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4876 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2080> (cherry picked from commit 450ab0fd)
aa305068 -
Mark authored
Swap which windows are switched with which in the workspace switching animation of the default plugin since this was backwards (resulting in failures), but animate only those which are on either the current workspace or the one to switch to. Have the animation span the entire screen as intended. Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2038 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2076> (cherry picked from commit 888e69d3)
f614f8ce -
Erik Massop authored
Since the completion callback (on_switch_workspace_effect_complete) sets priv->tml_switch_workspace1 to NULL, the unref was trying to unref NULL, and the reffed ClutterTimeline was not getting unreffed. This could be triggered by rapidly switching workspaces, switching again before the animation of the initial switch was done. Found while working on #2038. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2120> (cherry picked from commit 7bb0055a)
73435807 -
Jonas Ådahl authored
We save the window rect before going fullscreen to a dedicated variable, so we can go back to the correct dimension. We also have a dedicated variable for returning from other window states, e.g. maximized, and this one we initialized when creating the MetaWindow. This meant that we could always rely on this being up to date on X11 windows that were mapped maximized or fullscreen. What the commit that introduced the saved rect dedicated for going unfullscreen missed was to initialize the new saved rectangle too when creating the MetaWindow. This resulted in windows mapped as fullscreen often ending up misbehaving when unfullscreening, as mutter would tell them to unfullscreen to 0x0. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1786 Fixes: a51ad8f9 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2210> (cherry picked from commit 13f35ab0)
157555cf -
Next commits will reintroduce a certain behavior of stage capturing that can only happen with DMA-BUF buffers. To control this, add a new flag tp MetaScreenCastRecordFlags for this behavior. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2186> (cherry picked from commit 8fe45d77)
54dd9bdd -
When the before-paint function is executed, it's only purpose is to check if there's any scanout queue, and immediately record it if any. However, since [1], we regressed in this specific case with the introduction of an idle callback in the before-paint function. The regression only happens when the PipeWire stream is using DMA-BUF buffers, and it would operate as follows: 1. In before-paint, when there's a scanout available, we queue an idle callback to capture the monitor. The idle callback (almost always) executes after the scanout is pulled from the stage view 2. meta_screen_cast_stream_src_maybe_record_frame() is called by the idle callback. In the DMA-BUF case, it then runs meta_screen_cast_monitor_stream_src_record_to_framebuffer() 3. In meta_screen_cast_monitor_stream_src_record_to_framebuffer(), because the stage view doesn't have a scanout anymore, it ends up calling cogl_blit_framebuffer() with the stage view framebuffer. This is the regression bug. This regression presents itself in the form of the screencast stream showing the desktop when there's an unredirected fullscreen application window running. Revert before-paint - and only that - back to immediately capturing any available scanout. Only record these frames when the target buffer is a DMA-BUF handle. Nothing is captured on before-paint if the stream is not using DMA-BUF, since the regular paint routine will handle these frames regularly post-paint. [1] https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1914 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2186> (cherry picked from commit 77d5c8c9)
67c98158 -
Jonas Ådahl authored
If there are any pending updates, for example if we painted one of multiple monitors but without having posted the update due to waiting for another monitor to be painted, but before we paint all of them and post the update, another hotplug event happens, we'd have stale pending KMS update. When that update eventually would be processed, we'd try to apply out-of-date updates which may contain freed memory. Fix this by discarding any update when we're rebuilding the views. We can be sure not to need any of the old updates since we're rebuilding the whole content anyway. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1928 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2216> (cherry picked from commit 8e91c629)
da9ae90b -
Jonas Ådahl authored
There was a sanity check that complained if there was still a "next framebuffer" when disposing an onscreen. This is correct to complain about under normal operation, as we always wait until receiving the page flip callback before cleaning up the onscreen and their state. However, when there are many hotplugs occurring, we might end up with race conditions when the above sanity check is not valid: when we have more than one monitor active, paint 1 one of them, but receive a hotplug event before we paint the other(s), we will discard the already painted onscreen before really issuing a page flip. In this situation, we will have the "next framebuffer", but having that is not a bug, it's a race condition, thus to not leak in this situation, make sure to clean up the next framebuffer here too. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2081 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2225> (cherry picked from commit bb6ae40a)
593c22ea -
Hans de Goede authored
Commit 2289f561 ("monitor-manager: Don't apply unneeded orientation changes") added an early return to handle_orientation_change () in case the transform is unchanged. But this did not take the correction of the transform for devices with 90° mounted panels into account causing a desired orientation change to get skipped if the new orientation matches the corrected logical orientation from the previous transform setting. Fix this by calling meta_monitor_crtc_to_logical_transform () on the transform before comparing it, matching the meta_monitor_crtc_to_logical_transform () call in create_for_builtin_display_rotation (). Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233 (cherry picked from commit cc9bb7c5) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2223>
55779b3b -
Marco Trevisan authored
When checking panel orientation on logical monitors we should take panel orientation transform to check it's properly applied, so ensure that we're checking the right one. (cherry picked from commit 54b36d77) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2223>
786f1b72 -
Florian Müllner authored
Update NEWS. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2223>
f51ad291 -
Marco Trevisan authoredfd3e53c9