1
0
Fork 0
Commit graph

32278 commits

Author SHA1 Message Date
Bilal Elmoussaoui
69d66eb82f cogl: Expose Atlas API
Needed to build cogl-pango out of tree

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3909>
2024-07-30 20:20:45 +00:00
Bilal Elmoussaoui
b035350ffd cogl: Replace RectangleMapEntry with MtkRectangle
Avoids exposing the former in the next commit even if MtkRectangle
uses signed integers compared to RectangleMapEntry. But as
those rectangles are defined inside of Cogl, it should be okay
I guess?

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3909>
2024-07-30 20:20:45 +00:00
Bilal Elmoussaoui
1f255be055 cogl: Properly export required functions by cogl-pango
Needed for moving cogl-pango out of tree

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3909>
2024-07-30 20:20:45 +00:00
Robert Mader
dfa5238bf9 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>
2024-07-29 14:44:42 +00:00
Chao-Hsiung Liao
857a72faf0 Update Chinese (Taiwan) translation
(cherry picked from commit bb9a2f1ede)
2024-07-27 07:38:25 +00:00
Daniel van Vugt
3eb32cf750 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>
2024-07-26 09:23:46 +00:00
Daniel van Vugt
7df6b5c4ed 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>
2024-07-26 09:23:46 +00:00
Daniel van Vugt
5360c58fe5 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>
2024-07-26 09:23:46 +00:00
Bilal Elmoussaoui
d283f84d6c window: Call set_normal_hints on Wayland windows as well
As that would initialize the hints which would otherwise be 0
causing a division by 0

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3572
Fixes: 377455402 ("core/window: Guard some x11 calls")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3894>
2024-07-25 22:24:25 +02:00
Jonas Ådahl
a68385a179 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-07-25 19:56:20 +02:00
Jonas Ådahl
93d1eb01a6 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-07-25 19:56:19 +02:00
Jonas Ådahl
2e2dfc0bf5 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-07-25 19:56:19 +02:00
Jonas Ådahl
f3a33e9bd1 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-07-25 19:56:19 +02:00
Sebastian Wick
788409e094 tools/debug-control: Handle the service not being exported
This is the default case and we want to tell people how to export it
when they use the script instead of having a python stack trace.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Sebastian Wick
682935fefa core/debug-control: Introspect it to export the dbus service with lg
by executing `global.context.get_debug_control().exported = true`.

This makes it possible to get access to the debug service without having
to start with `--enable-debug`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Sebastian Wick
c974bcf4b2 core/debug-control: Enable HDR only via DebugControl and META_DEBUG_
This removes the experimental HDR property from the monitor manager and
unifies all the debug features in DebugControl.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Sebastian Wick
2693cac83a clutter/color-manager: Add a method to get the default color state
This avoids re-creating new color states objects to the default state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
b1370a483e clutter/color-state: Add a way to query if fp16 is needed for storage
Some color states, currently only the ones with linear transfer
characteristics, need at least half float formats for storing components
of that color state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
6a2ce066b0 clutter/color-state: Add a helper to print the color state
And use it in MetaRendererNative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
58cb44186d clutter/color-state: Adds an ID to ColorStates
The ID is required for the wayland protocol. In the future we might want
to spend a bit more effort to re-use existing color states when a new
one is requested and also try to re-use IDs instead of just counting up.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
75baecb3d9 clutter/pipeline-cache: Unify color state transform key hashing
This us re-using the hashing of color state transforms which is used for
the snippet cache.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
1223f8df68 clutter/pipeline-cache: Return a copy of the pipeline
This means the pipeline can be manipulated after retrieving. This also
fixes a leak when adding pipelines to the cache, as we the pipeline
would take a ref, but when adding, we wouldn't clean up our own ref.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
3359b67686 clutter/color-state: Handle adding snippet to pipeline
While no functional changes right now, this allows us to add extra hooks
like adding uniforms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
045f114fbe clutter/color-state: Move snippet cache to color manager
This gets rid of the GQuark and g_object_get_qdata() lookups.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
cd2bf776b1 clutter: Add color manager type
This type is intended to carry color related state that is "global",
without having to add more and more things to ClutterContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Bilal Elmoussaoui
f78948a1de cogl: Remove unused List macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3901>
2024-07-24 21:18:10 +02:00
Bilal Elmoussaoui
90e0acf11a cogl/clip-stack: Remove unused primitive type
Detected by going through code coverage

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3901>
2024-07-24 21:18:10 +02:00
Bilal Elmoussaoui
c65bb3b9ce cogl: Remove poll renderer
As it is only composed of idle callbacks now, replace
those functions where they are used

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Bilal Elmoussaoui
24c338cc0e cogl: Simplify poll_renderer_get_info
As the only info we can pass now is whether we have any idle
closures. Removes the timeout handling which is now is always set to
either 0 or -1 based on whether we have idle closures

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Bilal Elmoussaoui
1ceb206897 cogl: Remove no longer used poll renderer API
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Bilal Elmoussaoui
1d0680471e cogl/renderer: Never try to enable X11 event retrieval
It is always disabled as we always set a foreign display
when creating the renderer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Bilal Elmoussaoui
a7b87f250f cogl/renderer: Always try to use GLX_NV_robustness_video_memory_purge
It was always set to TRUE and mutter is the only user.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3887>
2024-07-24 14:33:29 +00:00
Ivan Kuzmenko
2c5f874eaa orientation-manager: Expose MetaOrientationManager to introspection
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3880>
2024-07-23 17:49:11 +00:00
Sebastian Wick
6d78ff9373 tests/kvm: Update the kernel repo remote to gitlab.freedesktop.org
The drm subsystem has been moving over to gitlab for some time now and
the old anongit.freedesktop.org remote is becoming unusable. Contains
the same repo with the same tags, so this shouldn't result in any
differences.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3896>
2024-07-23 11:10:04 +00:00
Daniel van Vugt
55209cfb13 clutter/deform-effect: Hide G_STATIC_ASSERT from the g-ir-scanner
According to gmacros.h, G_STATIC_ASSERT is undefined for __GI_SCANNER__
because it causes confusion. Which is understandable, and so is the
complaint about the lingering G_STATIC_ASSERT after preprocessing.

This problem seems to be unique to just clutter-deform-effect.h because
it's the only header file containing a top-level G_STATIC_ASSERT. The
rest are all in C files.

Fixes: 138e5d4f54
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3591
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3898>
2024-07-23 14:08:52 +08:00
Jonas Ådahl
eb786b749c window: Add simpler meta_window_move_resize()
This one hides the place flags and gravity, which is irrelevant in many
places.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:37 +02:00
Jonas Ådahl
c7ddc839f1 window: Only deny focus if mostly overlapped with always-on-top window
Having an always-on-top window affects focus granting logic if the
to be showing window overlaps with any of them. Instead of triggering
the focus denying logic if a new window ever so slightly touches an
always-on-top window to only triggering if it's covered more than 60% by
always-on-top windows.

This is intended to make using always-on-top windows a bit less annoying
and not cause as many unintended focus-on-map denials.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:28 +02:00
Jonas Ådahl
74f58674e7 window: Don't check always-on-top overlap before placing
When we show a window, we'll check if it overlaps with an existing
always-on-top window with the intention to deny focus. However, we did
this potentially before having placed the window, meaning we effectively
checked as if it was placed at (0, 0), which created unexpected results.

Instead check the overlap state after placing. A window placement test
case is added to verify this works as expected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 21:25:24 +02:00
Jonas Ådahl
c68d6c4958 window: Fix minor coding style issue
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
5e36e5aae1 window: Clarify expression for deciding whether to auto-maximize
Calculate areas and store them in descriptively named variables, and
then compare them, instead of doing it all in one go.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
d7daf50d62 window: Move required condition into main if statement in show()
No logical changes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
9ebbf83e95 window: Add place flags
Replace a boolean argument and a temporary MetaWindow struct field with
a `MetaPlaceFlag` passed where relevant. This includes
`meta_window_move_resize_internal()` and `meta_window_constrain()`, as
placement may happen during constraining, and also
`meta_window_force_placement()`.

The struct field (denied_focus_and_not_transient) was only ever set in
meta_window_show(), before meta_window_force_placement(), and
immediately unset as a side effect of that. In .._show() we'll always
force placement if the window wasn't already placed, and in
meta_window_constrain(), we'd only ever call meta_window_place() if the
window wasn't already placed, meaning the variable would only ever be
relevant during `meta_window_show()`. Having it as a flag makes that
relationship and temporary state clearer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
f4b79441fa tests/test-runner: Allow tweaking 'center-new-windows' pref
This will allow tests to test placement algorithms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
d8cdc56ec4 place: Remove a couple of comments about X11 roundtrips
It's not relevant in the context where the comment is, and don't need to
be reminded of X11 quirks here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
22533f8454 place: Move and clean up finding relevant windows
Split up the condition a bit, use an auto pointer for a list, and use
current convention for list iteration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
463c7ab989 window: Clean up formatting and naming of stacking adjustment condition
The function checking whether a 'always-on-top' window covers the
showing window now has that in the name, to make it more obvious. That
function was also changed to use the more common way of iterating a
list, and now uses auto cleanup pointers for the list.

The condition itself was updated to follow the current coding style.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Jonas Ådahl
76e044c39d window: Include window title in debug description
Useful to reason about MUTTER_DEBUG=stack logs when using metatests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
2024-07-22 20:59:18 +02:00
Bilal Elmoussaoui
fe60ee8b90 cogl: Replace custom static assertions with glib one
The displayed message is kept as a comment in the codebase
which is good enough

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
2024-07-22 18:08:17 +02:00
Bilal Elmoussaoui
1acfa6def3 cogl: Move Color struct definition where it belongs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
2024-07-22 18:08:17 +02:00
Bilal Elmoussaoui
028df43012 cogl: Remove duplicated *_BIT defines
They are already defined in cogl-pixel-format header

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
2024-07-22 17:36:10 +02:00