summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: Make wayland-x11-interop depends on xwayland featurebilelmoussaoui/tests-xwaylandBilal Elmoussaoui2023-04-141-11/+11
|
* frames: Forward _NET_WM_STATE during frame initializationCarlos Garnacho2023-04-141-5/+48
| | | | | | | | | | | | | | | | | Ensure the frame window is created at the right fullscreen state before showing it and assigning it to the client window. A peculiarity of this property on frame windows is that it is typically single-handedly updated from the Mutter side, in synchronization with client window state. It can only differ during creation, since GTK still likes to apply its own state. Also, the only relevant property seems to be _NET_WM_STATE_FULLSCREEN, since the others are less relevant to the role of the frames client, and get applied to the MetaWindow as a whole, instead. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2712 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2961>
* x11: Fix remaining leaks from switch to XGetAtomName()Sebastian Keller2023-04-142-2/+5
| | | | | | | | After this got changed from gdk_x11_get_xatom_name() to XGetAtomName(), this no longer returns a const char* and it now also needs to be freed. Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
* x11: Use Atoms when constructing a new MetaX11SelectionOutputStreamSebastian Keller2023-04-143-21/+24
| | | | | | | | | This was pointlessly being converted between atom and string and back, which with the switch from gdk_x11_get_xatom_name() to XGetAtomName() also introduced a leak for every XGetAtomName() call. Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
* x11: Remove unused member variables from MetaX11SelectionInputStreamSebastian Keller2023-04-143-24/+5
| | | | | | | | | | The private format and type member variables were not being used by any of the callers, so they can simply be removed. This also fixes a leak of type which was introduced when switching from gdk_x11_get_xatom_name() to XGetAtomName(). Fixes: e66f4396e ("x11: Avoid GDK API in X11 selections") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
* wayland: Don't leak XDnD mime type stringsSebastian Keller2023-04-141-2/+4
| | | | | | | | After this got changed from gdk_x11_get_xatom_name() to XGetAtomName(), this no longer returns a const char* and it now also needs to be freed. Fixes: 014cde646 ("wayland: Do not use GDK functions on XDnD implementation") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2957>
* xdg-shell: Early out of apply if dismissedJonas Ådahl2023-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | We might end up trying to apply a pending state late if it was delayed by DMA buffers not being ready. Trying to discard the pending state from the transaction when dismissing is hard, because we might be applying a chain of transactions that would disqualify subsequent transactions if a former one dismisses the popup, so lets just drop what the apply would otherwise do, if we're not going to use it anyway. This fixes the following crash: 0) meta_wayland_surface_get_window (surface=0x0) 1) meta_wayland_xdg_popup_apply_state (surface_role=0xf5ee80, pending=0xf662a0) 2) meta_wayland_surface_role_apply_state (surface_role=0xf5ee80, pending=0xf662a0) 3) meta_wayland_surface_apply_state (surface=0xf5e640, state=0xf662a0) 4) meta_wayland_transaction_apply (transaction=0xf56170, first_candidate=0x7fffffffcee8) 5) meta_wayland_transaction_maybe_apply_one (transaction=0xf56170, first_candidate=0x7fffffffcee8) 6) meta_wayland_transaction_maybe_apply (transaction=0xf56170) 7) meta_wayland_transaction_dma_buf_dispatch (buffer=0xf448a0, user_data=0xf56200) 8) meta_wayland_dma_buf_source_dispatch (base=0xf5f140, callback=0x0, user_data=0x0) 9) g_main_dispatch (context=0x41baa0) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2940>
* wayland/xdg-shell: Dismiss instead of destroy invalid popupJonas Ådahl2023-04-131-1/+1
| | | | | | | | | Destroying is insufficient as it doesn't end any popup pointer grab, if the dismissed popup was the last. This would later hit an assert as the popup grab is assumed to always have at least one popup in its chain. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2728 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2940>
* wayland/xdg-shell: Ignore reposition if popup was dismissedJonas Ådahl2023-04-131-0/+3
| | | | | | | | | If the popup was dismissed (i.e. has no MetaWindow anymore), it'll also have no parent surface. With no parent surface, we'd try to fetch a transaction from NULL and crash, but if we don't try if we were dismissed, we won't reach here anyway. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2940>
* core: Create passive button grab on topmost WindowCarlos Garnacho2023-04-121-1/+4
| | | | | | | | | | | | | | | | With the frames client, we do no longer handle events for the frame window inside Mutter. This means we do not get events "for free" to handle focus on a just clicked frame window. This results in a background window not ending up focused if clicked on its frame. In order to fix this, make the passive button grab extend to the frame window if a window has one. This brings back focus-on-click behavior, while treating windows further as a unitary surface. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2727 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2954>
* core: Pass MetaWindow on passive button grab machineryCarlos Garnacho2023-04-124-22/+27
| | | | | | | | In practical effects the passed Window is always window->xwindow, so pass the MetaWindow and get the better X11 Window deep in the call stack. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2954>
* core: Minor refactorCarlos Garnacho2023-04-121-6/+8
| | | | | | Do not make code live before variable declarations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2954>
* screen-cast/monitor-src: Record frames with presentation timeGeorges Basile Stavracas Neto2023-04-071-4/+17
| | | | | | | | | Pass the timestamp of the frame as the target timestamp of the record. This makes the rudimentary frame throttling mechanism inside MetaScreenCastStreamSrc work with the timing variability that dynamic dispatch times introduced. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* screen-cast/monitor-src: Record DMA-BUF frames immediatelyGeorges Basile Stavracas Neto2023-04-071-4/+14
| | | | | | | | Instead of always, unconditionally scheduling an idle callback for frame recording, try to record a DMA-BUF only frame, and only if that's not possible, schedule the idle callback. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* screen-cast/src: Shuffle a variable aroundGeorges Basile Stavracas Neto2023-04-071-1/+2
| | | | | | | This GError is only used within the frame recording block, so move it there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* screen-cast/src: Clean up DMA-BUF only error pathsGeorges Basile Stavracas Neto2023-04-071-1/+5
| | | | | | | | | | | When a stream source subclass asks for a DMA-BUF only frame record, it is legitimate to return FALSE in do_record_frame() - meaning that a frame was not recorded - but not return an error - meaning nothing actually failed. This avoids spamming the journal with warnings on a legitimate case. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* screen-cast/src: Add frame recording variant with timestampGeorges Basile Stavracas Neto2023-04-072-18/+48
| | | | | | | | | | | | Add meta_screen_cast_stream_src_maybe_record_frame_with_timestamp() which operates on arbitrary timestamps; and make the current function meta_screen_cast_stream_src_maybe_record_frame() just call into the new variant, passing g_get_monotonic_time() as the timestamp. This will be useful later we start using the target timestamp of the frame for screencasting. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* backends/stage: Pass ClutterFrame to MetaStageWatchFuncGeorges Basile Stavracas Neto2023-04-076-5/+15
| | | | | | | We'll need to access the timestamp of the frame later on, so pass it to stage watchers. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* clutter/stage: Assign frames to paint contextGeorges Basile Stavracas Neto2023-04-071-2/+6
| | | | | | | | When rendering through the 'paint-view' handler, assign the frame to the paint context. Otherwise, when rendering outside of the frame clock schedule, don't. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* clutter/paint-context: Allow assigning a ClutterFrameGeorges Basile Stavracas Neto2023-04-073-0/+37
| | | | | | | | | | This is not yet used, but next commits will need to assign a frame to the paint context whenever painting onscreens. Assigning a frame to the paint context is a one-way operation, and treats multiple assignments strictly as a programming error. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
* cursor-tracker: Enhance the documentation and increase annotation coverageCorentin Noël2023-04-072-10/+27
| | | | | | | Add the (optional) parameters when they are actually supported and at least add the minimal documentation on functions. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2951>
* screen-cast-stream-src: Export damaged video regionsSalman2023-04-066-17/+126
| | | | | | | | | This change will export the damaged regions (when available) out to the pipewire client. This change is currently specific to virtual streams only (where I was able to test the change) and maintains the current behavior for other screencast stream types. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2775>
* screen-cast-stream-src: Minor adjustmentSalman2023-04-061-4/+5
| | | | | | This change makes it easier to add/remove stream params during test/dev. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2775>
* stage-impl: Do clipped redraws when drawing offscreenSalman2023-04-061-21/+51
| | | | | | | | | | | | | This change allows clipped redraws for offscreen. The net effect of this change is to preserve the original redraw clip when possible (rather than overwriting it with the full view redraw) in the paint context. This eventually helps in retrieving the fine grained updated regions of the frame since last redraw and sending it to the pipewire client (as shown in a subsquent CL). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2775>
* frames/content: Use gtk_widget_compute_point()Jonas Ådahl2023-04-051-7/+8
| | | | | | The non-graphene-point variant is deprecated. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2949>
* output-xrandr: Don't treat 0 as invalid backlight valueFlorian Müllner2023-04-041-1/+1
| | | | | | | | Whether a value is in range depends on the backlight-min/max values, and I didn't spot anything that excludes 0 as a valid lower limit outright. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2947>
* output-xrandr: Consistently return -1 on errorFlorian Müllner2023-04-041-1/+1
| | | | | | | | | Returning FALSE does not indicate an error, but a valid backlight value of 0. Consumers expect a negative value to indicate no backlight support, so return -1 in case of error, just like we already do for invalid values. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2947>
* x11: Wrap X call with error trapsCarlos Garnacho2023-04-041-0/+7
| | | | | | | | Lest it fails. Try to recover from that and keep reading the mimetypes present in the atom list. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6555 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2945>
* x11: Pass Atom directlyCarlos Garnacho2023-04-043-7/+5
| | | | | | | We convert an atom to string just to convert it to an atom. We can avoid the roundtrip. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2945>
* frames/window-tracker: Select StructureNotifyMask X11 eventsMarco Trevisan (Treviño)2023-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | The window tracker is filtering XEvents manually as it only requires a subset of the ones that Gdk listens to in the root window, and this is nice, but we were restricting the set a bit too much because due to this we were not notified when an xsettings manager was available, and thus in case gsd-xsettings was launched after meta-window-tracker (a normal scenario under X11), no xsetting was actually applied to the decoration windows. As per this, the default settings were used for everything and never updated, until a restart of the window-tracker. In order to be able to monitor the XSettings changes at startup, we also need to select the StructureNotifyMask as gtk always do by default. See also: https://gitlab.gnome.org/GNOME/gtk/-/blob/4.11.1/gdk/x11/gdkscreen-x11.c#L947-950 Fixes: #2580 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2948>
* backend: Fix build with -Dremote_desktop=falseChris Mayo2023-04-031-6/+2
| | | | | | | | | | ../mutter-44.0/src/backends/meta-backend.c: In function ‘meta_backend_real_post_init’: ../mutter-44.0/src/backends/meta-backend.c:560:7: error: ‘MetaBackendPrivate’ {aka ‘struct _MetaBackendPrivate’} has no member named ‘remote_access_controller’ 560 | priv->remote_access_controller = | ^~ Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2655 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2935>
* Update Dutch translationNathan Follens2023-04-021-85/+107
|
* Update Vietnamese translationNgọc Quân Trần2023-04-011-124/+138
|
* backends: Use meta_gamma_lut_new_sized() in a few more placesJonas Ådahl2023-03-302-11/+2
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2944>
* compositor: Drop anchor_window_pos field from MetaWindowDragCarlos Garnacho2023-03-291-19/+0
| | | | | | This is now only set and never used. We can remove it. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2942>
* compositor: Use relative anchor coordinates for window dragsCarlos Garnacho2023-03-291-6/+18
| | | | | | | | | | | | | | | | | | | The anchor position calculations are somewhat unnecessarily complex based on root coordinates of pointer and frame positions. This requires tracking both things, and we don't always get it quite right with the latter (e.g. window repositions, resizes or overshrinks, leaving the anchor position visually outside the window). In order to improve this, capture the window-relative coordinates when starting the window drag, and ensure the window is always repositioned in that position, relative to its current size. This avoids these glitches when unmaximizing a window (e.g. dragged from the bottom through super+button1 press), or moving windows between monitors with different scales. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2730 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2942>
* compositor: Avoid use of variable during resizeCarlos Garnacho2023-03-291-2/+2
| | | | | | | | | | Since we only track changes to window_drag->anchor_window_pos during move operations through on_grab_window_size_changed(), this rectangle is in essence the same than window_drag->initial_window_pos all the time. Just use that and move away from the anchor_window_pos rectangle. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2942>
* onscreen/native: Avoid freezing the frame clock on failed cursor commitsDaniel van Vugt2023-03-291-0/+27
| | | | | | | | | Since 73fb64cbb6 we have preferred to handle failed updates via callback but the cursor-only update path was forgotten and so wasn't getting frame notifications. And so the frame clock would freeze. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2691 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2933>
* Update Chinese (China) translationBoyuan Yang2023-03-271-81/+99
|
* window-actor-x11: Check array bounds before accessing arrayJonas Dreßler2023-03-261-1/+1
| | | | | | | | | | | | scan_visible_region() scans through each value of a uint8_t array and checks whether that value is 255. Right now it always checks one value too much though, resulting in a buffer overflow. Fix that by checking the array bounds before actually accessing the array. Found by running gnome-shell with address sanitizer and starting GIMP. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2856>
* build: Don't disable checks in release buildsSebastian Keller2023-03-242-2/+0
| | | | | | | | | | | Both Clutter and Cogl use g_return(_val)_if_fail() to safeguard introspected API. Release builds were dropping these checks, which could result in a much more crashy experience, especially when considering extensions, but also due to bugs in the shell code itself. This won't affect any major distro, because they all use "plain" builds. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2930>
* tests: Use a more interoperable path to bashSimon McVittie2023-03-225-5/+5
| | | | | | | | | | | On systems that have undergone the /usr merge, /bin/bash and /usr/bin/bash can be used interchangeably, but on systems where /bin and /usr/bin are separate (such as Debian 11 or older), bash was traditionally in /bin and there is no bash in /usr/bin. Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/2385 Signed-off-by: Simon McVittie <smcv@debian.org> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2900>
* backend/nested: Ignore setting pointer constraintJonas Ådahl2023-03-221-0/+8
| | | | | | | This avoids a crash when pointer constraints are enabled by Wayland clients. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2932>
* clutter: Safely transform paths to strings and vice versaEmmanuele Bassi2023-03-211-5/+12
| | | | | | | | | GValues containing objects and strings can be set to NULL, which means the transformation functions from ClutterPath to string and vice versa must be NULL-safe. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2625 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2929>
* Export meta_window_has_pointer ()Ivan Molodetskikh2023-03-202-2/+3
| | | | | | It is needed in gnome-shell in the screenshot UI to tell which window has a pointer over it. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2928>
* compositor/window-drag: Fix keyboard resizeFlorian Müllner2023-03-201-2/+2
| | | | | | | | | | | | | | Both GRAB_OP_KEYBOARD_MOVING and GRAB_OP_KEYBOARD_RESIZING_* are defined as GRAB_OP_WINDOW_BASE with FLAG_KEYBOARD set, but the latter have additional bits set to indicate the direction. That is, the GRAB_OP_KEYBOARD_MOVING bitmask cannot be used to differentiate between move- and resize operations. Instead, check that no direction bits are set. https://gitlab.gnome.org/GNOME/mutter/-/issues/2684 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2908>
* backends: Fall back to the default and not the unknown color spaceSebastian Wick2023-03-202-3/+3
| | | | | | | | | | | The unknown color space's only purpose is to signal that the current KMS state has a unknown color space set. It is not one of the color spaces that can be set. We already only try to set a color space if the default color space is supported so we should use the default color space as a fallback instead of the unknown color space. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2693 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2915>
* kms/impl-device/simple: Avoid destroying a NULL hash tableDaniel van Vugt2023-03-201-1/+1
| | | | | | | | | | Which would trigger: ``` g_hash_table_destroy: assertion 'hash_table != NULL' failed ``` on non-KMS systems like with `nvidia-drm.modeset=0`. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2904>
* wayland/buffer: Avoid spamming the log when a buffer is not scanoutableDaniel van Vugt2023-03-201-4/+3
| | | | | | | | | | It's not really an error and we recover seamlessly. If someone really wants to check if/why direct scanout is failing then they can still use `env MUTTER_DEBUG=render,kms`. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2702 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2918>
* kms/device: Avoid leaking some fieldsJonas Ådahl2023-03-191-0/+3
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2926>