32942 Commits

Author SHA1 Message Date
Jonas Ådahl
67995f2730 screen-cast-stream-src/virtual: Remove redundant frame scheduling
We're posting damage; that'll mean a frame clock already being
scheduled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4066>
2024-11-15 12:24:24 +00:00
Jonas Ådahl
ca47be6ee9 screen-cast-stream-src/virtual: Reorganize hooking things up
There were things hooked up (connecting signals, adding stage watches),
but it was a bit disorganized, with "adding watches" doing more, and
"init callbacks" being a bit vague. Split things up to

 * setup view - hook up things that need to listen on a stage view
 * setup cursor tracking - track cursor positions, sprite changes
 * the rest - monitor changes etc

This also properly handles a race condition when we'll enable before the
idle callback creating the view from the virtual monitors is run.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4066>
2024-11-15 12:24:24 +00:00
Jonas Ådahl
7ff5334a3b screen-cast-stream-src/virtual: Stop inhibiting hw cursor
The hardware cursor support in the cursor renderer now acts on a per
stage view basis, so no need to inhibit the hardware cursor, it isn't
going to try to put a hardware cursor on a virtual CRTC anyway.

Instead use overlay inhibitation to decide whether an cursor overlay
should be painted or not. Inhibit the overlay when hidden/metadata, but
not when embedded.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4066>
2024-11-15 12:24:24 +00:00
Jonas Ådahl
13e0b72026 stage: Don't queue overlay damage on views with overlays inhibited
This saves some unnecessary redraws with virtual monitors with
metadata/hidden cursor modes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4066>
2024-11-15 12:24:24 +00:00
Jonas Dreßler
2fdba8cfce tests/monitor-unit: Test initial rotation workaround for portrait-panels
There's a workaround (ec18a559c687 ("monitor-manager: Ignore
tablet-mode-switch on initial config of native portrait mode panels")) for
panels that default to portrait mode, where touch mode is disabled, but
a touchscreen is present. This workaround gets applied when we receive
the first reading from the orientation manager.

Make sure this workaround is applied as expected by adding a test for it.
The test needs to be first in the list of orientation tests, because mutter
only applies the workaround on the first orientation event it receives.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4126>
2024-11-15 12:08:22 +00:00
Jakub Steiner
43cad8d68b fonts: Use static.gnome.org
- centralized font hosting

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4129>
2024-11-12 18:21:01 +01:00
Olivier Fourdan
ad9a192455 window-x11: Emit the configure signal
Emit the configure signal for X11 windows as soon as they get created.

The configuration values then get applied as initial values.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
9927eaa963 wayland: Emit the configure signal
Emit the configure signal from the xdg_toplevel's apply_state function.

A plugin gets a chance to tweak the initial configuration before it gets
applied.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
c597feaa67 wayland/window-configuration: Add MetaWindowConfig support
This allows to bridge MetaWaylandWindowConfiguration and
MetaWindowConfig.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
5a231a4d27 window: Add a window helper function for MetaWindowConfig
The MetaWindowConfig can indicate whether the configuration reflects on
the initial configuration, before the window is first mapped.

Add a smaller helper (private) window function to create the appropriate
"type" of MetaWindowConfig depending whether the window was already
showed or not.

This is preparation work for the following commits where this function
will be used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
d44fd167bb window: Add a "configure" signal
This conveys the initial window configuration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
4c20584b11 window: Use the MetaWindowConfig
This is a fairly large refactoring to replace the window rect and
fullscreen flag with the new MetaWindowConfig object.

No functional change intended at this point.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
a7ef0b137e window: Use the fullscreen API
Use the meta_window_is_fullscreen() API instead of accessing the
fullscreen field of the MetaWindow structure directly.

This is both a (small) cleanup and preparation work for the next commit.

No function change (intended).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Olivier Fourdan
7e098ae671 window: Add a MetaWindowConfig type
This is intended to be used in place of the window rect and fullscreen
flags.

That will also allow for a pre-configuration signal to be added, passing
the configuration so that a plugin can tweak the configuration before it
gets applied first.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4076>
2024-11-12 16:01:35 +01:00
Mario Limonciello
ecbe4a5dad Prefer GPUs with built-in panels connected when selecting a primary GPU
Some laptops don't have the integrated GPU come earlier in the PCI topology
which means that when mutter enumerates the GPUs it may select the dGPU
as the primary.

In a laptop context, this is unlikely to work because the eDP panel can
only be actively connected to a single GPU at a time.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3746
Suggested-by: Jonas Ådahl
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4114>
2024-11-12 11:28:59 +00:00
Mario Limonciello
a280280cff backend/native: Refactor choose_primary_gpu_unchecked() to meet style
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4114>
2024-11-12 11:28:59 +00:00
Bilal Elmoussaoui
d92bb351da clutter: Remove duplicated ShaderType
As we have the exact same one in Cogl.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
2024-11-12 10:01:29 +00:00
Bilal Elmoussaoui
1ba28bc6b4 cogl: Get rid of remaining MetaTexture usages
As that pseudo-interface no longer exists since the migration to
GObjectified CoglTexture.
Also moves cogl_meta_texture_foreach_in_region to the correct namespace.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
2024-11-12 10:01:29 +00:00
Bilal Elmoussaoui
c143e8e303 cogl: Move get_rectangle_indices to it correct namespace
Keep the implementation in cogl-indices.c though as it is too much of
implementation details to be in cogl-context.c.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
2024-11-12 10:01:29 +00:00
Bilal Elmoussaoui
45296416df cogl: Move blit_framebuffer to it correct namespace
As it belongs into CoglFramebuffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
2024-11-12 10:01:29 +00:00
Jonas Ådahl
744894fa46 tests/input-capture-test-client: Wait for devices before enabling
This fixes a race where the barrier would be activated before all
devices would be created, resulting in an unexpected set of received
events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4128>
2024-11-11 20:34:02 +00:00
Jonas Ådahl
4345ff6be4 input-capture/session: Start emulating new devices if already active
The client may not wait for devices to be created before enabling,
meaning we might activate the input capture session before the device
emulation is started. This would result in events silently being
dropped.

This helps with the flaky input-capture test case.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4128>
2024-11-11 20:34:02 +00:00
Sebastian Keller
80f92e0a20 cogl/boxed-value: Set size on initialization
Since 1eba07f6 the size of a boxed value is read when calling
_cogl_boxed_value_set_x(). This results in an uninitialized read when
setting uniforms using cogl_pipeline_set_uniform_*() since the size was
not initialized by _cogl_pipeline_override_uniform() when these
functions call _cogl_boxed_value_set_*().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4125>
2024-11-11 15:37:33 +00:00
Jonas Ådahl
91f1d3dab3 screen-cast-stream-src: Improve state change debug log entry
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
ee41825f03 screne-cast-stream-src: Fix argument alignment
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
bf758f349b screen-cast-stream-src: Track buffer sequence number
Use the 'seq' field in the spa_meta_header struct to track buffer
sequence numbers. This can be useful for predictable buffer tracking in
consumers, or for debugging purposes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
cb702a7d21 screen-cast-stream-src: Use obj_props array for properties
As is convention.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
bc9cc0135b screen-cast-stream-src: Remove stray newline
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
2e068dd124 stage-view: Bump fake swap ready notify callback priority
This will become important when dispatching happens from a frame clock
driver, where the driver itself triggers from a GSource. If the driver
source has a higher priority, we'll risk dispatching before the frame
clock has returned to a state expecting to be dispatched.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
e417643d78 tests/screen-cast-client: Add a couple of more debug logs
It makes it easier to diagnose issues.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
9358d00381 tests/screen-cast-client: Don't fail on empty buffers
These are received when doing cursor-only updates.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
0808c4cf52 tests/screen-cast-client: Remove incorrect 'unused' annotations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Jonas Ådahl
b78eda1b73 tests/screen-cast-client: Fix expected order of events
We expect to first enter the 'streaming' state, and then receive a
buffer, not the other way around.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4065>
2024-11-11 14:53:53 +00:00
Bilal Elmoussaoui
a02aa42a9f cogl: Mark various types as final
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
2a3e6a2df5 cogl/texture: Use macros for generating subclassing boilerplate
We can't unfortunately use the macros for the sub-types as the whole GL
variant of the texture wants access to the struct fields even when using
a macro like COGL_DECLARE_INTERNAL_TYPE. So we would have to re-do the
whole driver integration first.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
34f4b8064f cogl: Move types definition to a common header
Avoids re-defining the types and cyclic dependencies between headers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
80316eb1d6 cogl/texture: Add a is-primitive property
Avoids accessing texture's private struct from sub-types.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
cc3bf059e6 cogl/texture: Add a is_allocated helper
Reduce the usage of direct access of Texture struct fields, so we can
migrate to using macros in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
7d5f1b5898 cogl: Mark helper as static
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
09198db2e6 cogl/indices: Remove unused Indices.set_offset
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Bilal Elmoussaoui
30ed9c05de cogl/primitive: Mark as a final type
Also removes a function declaration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
2024-11-11 12:18:28 +00:00
Robert Obkircher
dbf1edefdf output-xrandr: Ignore duplicate modes reported by xrandr
This fixes an issue where xrandr reports the preferred mode of an
internal laptop display twice. This triggered an assertion that
crashed GDM, because meta_monitor_normal_generate_modes assumes
that the list of display nodes doesn't contain duplicate pointers
to the preferred one.

Closes: <https://gitlab.gnome.org/GNOME/mutter/-/issues/2945>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3176>
2024-11-09 12:01:23 +00:00
Jonas Ådahl
efddf28925 eis-client: Remove brackets from a couple of if then branches
They were done this way to make capability configurations similarly
indented, but lets interpret the coding style strictly instead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:09:52 +01:00
Jonas Ådahl
f63a2ce420 eis-client: Log received events
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:09:52 +01:00
Jonas Ådahl
c46db0a020 eis/client: Add touch support
Touch devices are handled very similarly to how absolute pointer
devices, by creating either shared or standalone devices depending on
what kind of monitor it's associated with.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:09:52 +01:00
Jonas Ådahl
6a1e1d74e5 eis-client: Handle unbinding device types
A EIS client might want to unbind a device capability; doing so should
effectively remove the device, which we didn't. Instead we always
created devices that a seat bind event had capabilities set for.

Fix this by explicitly keeping track of what is our "keyboard", our
"pointer", and whether we have a set of abs pointers, and don't create
duplicates if we already have devices created. For absolute pointer
devices, just keep track if we should have them, because we might have
many, or none, if we happen to be headless at the time being.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:09:17 +01:00
Jonas Ådahl
d2325f1507 eis-client: Configure shared and standalone abs pointer the same way
We don't need two separate configuration helpers, they do the same
thing. This will simplify making the viewport dependent device creation
more generic and reusable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:08:21 +01:00
Jonas Ådahl
ef3870e6aa virtual-input-device/native: Move away from _evdev suffix
For some reason the variable for the *Native subclass of
MetaVirtualInputDevice was suffixed with _evdev. Long long ago the input
backend in clutter was called "evdev", so might be because of that.
Anyway, lets rename to something more closely related, i.e. _native.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:08:21 +01:00
Jonas Ådahl
f76b59322a virtual-input/native: Properly forward 'finish' scroll event flags
This makes kinetic scrolling in e.g. GTK work.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:08:21 +01:00
Jonas Ådahl
2cd84f9263 context/main: Remove unnecessary macro endif/if
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4064>
2024-11-08 22:08:21 +01:00