Commit Graph

26718 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
3cf11f77b3 clutter/pick-stack: Move triangle check to else block
Just to improve the legibility of this part of the code. We
go either through box, or triangle, but never both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1599>
2020-11-23 13:34:28 -03:00
Georges Basile Stavracas Neto
d2feaa8d67 clutter/pick-stack: Use graphene_box_t for axis-aligned rectangles
The most common case for Clutter is 2D axis-aligned actors, which
maintain these properties even after projecting to eye coordinates.
In those cases, we can use a simpler hit test by checking against
boxes.

Not only this is simpler, but this maintains an important aspect
of picking that is a requirement for Clutter: watertightness. Even
though the triangles checks do work on x86_64, they do not guarantee
watertightness. This breaks tests on ARM.

Use graphene_box_t to hit-test axis-aligned 2D actors.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1599>
2020-11-23 13:34:28 -03:00
Jonas Ådahl
aa186193b5 ci: Bump ci-templates to include ci-fairy fix
This should avoid ci-fairy crashing when checking merge requests on the
same repo as the target branch.

See
https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/66.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1587>
2020-11-23 14:27:38 +00:00
Jonas Ådahl
6e27cc0548 ci: Generate junit report if project doesn't enable the registry
The image registry must be enabled for the CI to work, as the container
image from the upstream registry is placed (as a reference, more or
less) in the local registry.

Recently, ci-templates got a bit more helpful if this happened, and will
fail up front and generate a JUnit report with a message describing the
issue.

Update to this version.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1587>
2020-11-23 14:27:38 +00:00
Jonas Dreßler
b5a7fe4b23 clutter/actor: Handle clips correctly when building paint volume
clutter_actor_paint() implements a clear preference for custom clips
over clip_to_allocation: If a custom clip is set, clip_to_allocation is
ignored.

Since the paint volume reflects what Clutter is going to paint, we
should handle it the same when putting together our paint volume: So
first handle custom clips, and if one is set, use that. Then handle
clip_to_allocation, and if that's set, use that. And finally, if both
aren't set, union our allocation with the children paint volumes to get
the building volume.

clutter_actor_paint() also doesn't check whether the custom clip is
empty: If that's the case, it will simply not paint anything. Given that
that's allowed by clutter_actor_paint(), the paint volume should also
follow here and return an empty paint volume in case the custom clip is
empty.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1592>
2020-11-23 14:06:13 +00:00
Jonas Dreßler
44563d2932 clutter/actor: Don't union child paint volumes if clip is set
When a custom clip is set for an actor, this actor is not going to allow
any painting outside that clip. That includes the children, which may
also not paint outside that clip.

Now in case clip_to_allocation is set to TRUE, we already already do the
right thing and simply use the allocation as our paint volume, ignoring
the volumes of our children. The same should be done for the custom
clip, so also stop the process of building the paint volume once we see
that a custom clip is set and simply use that clip.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1592>
2020-11-23 14:06:13 +00:00
Robert Mader
3b7137cb35 surface-actor-wayland: Optimize get_current_primary_view for single view
In case we only have a single view (or there's only one view left to
check and the actor is visible on previous views) we can take a short-
cut, saving a region allocation and some calculations.

While on it, declare float numbers in '.f' style to make them more
recognizable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1596>
2020-11-23 14:49:42 +01:00
Olivier Fourdan
27131198c7 window: Fix size hints with CSD
Commit 03c69ed8 ("Do not go past size hints on resize") was meant to
ensure the size hints set by the client would be honored during resize,
as going past those values could cause the window to move on resize.

However, it did so by calling ensure_size_hints_satisfied() which works
with the frame rect rather than the client rect. As a result, the
minimum size enforced would end up being larger than expected with
client-side decorations.

Use meta_window_maybe_apply_size_hints() instead which automatically
adjusts for client size.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1542
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1594>
2020-11-23 10:17:55 +01:00
Jonas Dreßler
3843293e40 clutter/text: Use new pango API to compare attribute lists
Use the new API provided by Pango to compare two PangoAttrLists, this
means we can also detect equal lists that were newly created and avoid
the expensive relayout of the ClutterText a lot more often.

Depends on https://gitlab.gnome.org/GNOME/pango/merge_requests/172

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1411

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1050>
2020-11-22 14:57:05 +01:00
Jonas Dreßler
aedbe037e4 build: Bump pango version to 1.46.0
We're going to use new APIs from Pango like pango_attr_list_equal(), so
bump the version requirement to 1.46.0.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1050>
2020-11-22 14:57:02 +01:00
Jonas Ådahl
78f43baa93 ci: Guard pipeline on review stage
The first step is now review, as they use the tiny ci-fairy image, not
our custom ones, so the guards should be on those, not the build step.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1588>
2020-11-20 23:19:49 +00:00
Jonas Ådahl
6b220c9c37 ci: Rename only_default to pipeline_guard
It's the rules that guard the pipelines, deciding when they are allowed
to run or not. The 'only_default' comes from the fact that in the past
they set the only: field.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1588>
2020-11-20 23:19:49 +00:00
Florian Müllner
abd8032fe5 ci: Include gdm in image
gnome-shell depends on gdm's client library at runtime, but the
new pipeline-built image no longer provides it.

Add it back, but built it from source instead of using the Fedora
package, so we don't draw in all of gdm's runtime dependencies
(which includes a full GNOME session including gnome-shell).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1590>
2020-11-20 20:19:50 +01:00
Florian Müllner
bfeec27435 ci: Include development files for accountsservice
... needed to build GDM, which we'll do in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1590>
2020-11-20 20:19:50 +01:00
Jonas Ådahl
ce1e7a5afe ci: Check that allow-collaboration is checked for merge requests
This required for merging to be possible, so make the lack of this check
box being checked a discoverable error.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Jonas Ådahl
07c64ded78 ci: Use ci-fairy image in review and run first
This image is much smaller than the one with all the build dependencies,
thus will finish much faster.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Jonas Ådahl
efbb798309 ci: Use non-string like list for "need" relationships
Looks more natural, since it refers to another entity, not an arbitrary
string.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1586>
2020-11-20 17:44:59 +00:00
Daniel van Vugt
a793b4eef5 cogl: Add new 'sync-{primitive,frame}' options for COGL_DEBUG
This allows profilers to trace the callers of whatever is spending the
most time on the GPU, and to measure render times more accurately.
Previously such information was hidden as it completed in the
background (asynchronously) after we call swap buffers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1327>
2020-11-20 17:30:55 +00:00
Daniel van Vugt
f78cfc0c80 clutter/stage-cogl: Don't paint the blue debug region where it's also red
When using CLUTTER_DEBUG_PAINT_DAMAGE_REGION, the blue swap region is
always a superset of the red redraw region. So painting both in full (since
the previous commit) just meant the red region was overdrawn and came out
purple. That doesn't provide enough visual contrast, changes the user
experience unexpectedly and reduces performance.

So just subtract the redraw region from the swap region. This way the
red redraw region is always red, not purple.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1571>
2020-11-20 17:14:26 +00:00
Daniel van Vugt
96a185d8bc clutter/stage-cogl: Colour fb_clip_region in CLUTTER_DEBUG_PAINT_DAMAGE_REGION
Previously when CLUTTER_DEBUG_PAINT_DAMAGE_REGION was set, that would lead
to has_buffer_age==FALSE, which would lead to use_clipped_redraw==FALSE
which would mean swap_region was always empty. And so the blue region of
CLUTTER_DEBUG_PAINT_DAMAGE_REGION was always empty, *and* fb_clip_region
was always the full view rectangle which is not useful for debugging.

Now when CLUTTER_DEBUG_PAINT_DAMAGE_REGION is set, we don't let that
affect use_clipped_redraw, which means fb_clip_region is calculated
realistically.

But that's not enough. Calculating fb_clip_region properly with
CLUTTER_DEBUG_PAINT_DAMAGE_REGION would still lead to colouring artefacts
left on screen from previous frames that don't apply to the current frame.
So to fix that we also paint_stage for the whole screen every time when
using CLUTTER_DEBUG_PAINT_DAMAGE_REGION.

So now you will only ever see red and blue shading that's applicable to
the current frame, and no artefacts from the previous frames.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1535
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1571>
2020-11-20 17:14:26 +00:00
Daniel van Vugt
a0dbf3b84c clutter/stage-cogl: Scale and offset the swap region before debug painting
It was being painted without scaling and offsetting so would only look
right at scale 1.0 and only on the view with origin (0,0). Now we include
the framebuffer scale and view origin it will be painted in the correct
location.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1571>
2020-11-20 17:14:26 +00:00
Jonas Ådahl
4b32c92ec6 ci/check-commit-log: Fix test failure count value
It grepped for an older version of the failure XML tag.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1585>
2020-11-20 16:37:01 +01:00
Florian Müllner
abdf467ad9 ci: Include GTK4
... for https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1495.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1584>
2020-11-20 14:52:26 +01:00
Jonas Ådahl
e4db49d467 ci: Bump ci-templates to include registry path fix
ci-templates had a bug where it failed to find the ready-built container
images on the upstream repository due to invalid assumptions about the
relationship between upstream repository and image registry. This
resulted in the container image to be rebuilt, wasting valuable CPU
cycles and storage space. Bump the included ci-templates template to
include the fix for this.

See https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/22.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1583>
2020-11-20 11:24:46 +01:00
Jordan Petridis
83f5f7728f ci: Set some sensible defaults
* Allow for all jobs to be cancelled if a newer commit is pushed
* Automatically retry jobs if they fail due to some infrastructure issue

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1578>
2020-11-20 07:12:25 +00:00
Jordan Petridis
6f380114be ci: Replace only/except with rules
only/except keywords where deperecated in favor of rules.

Since we started using GNOME/mutter!1525 it introduced
a second pipeline being run for each commit.

Detached pipelines are the only way to access CI_MERGE_REQUEST_*
variables, and if we disable normal pipelines you will need to
create wip/spam MRs in order to run the tests.

This reworked rules makes it so, the normal pipeline needs manual
interaction to be started, and the detached/MR pipleines is always
run.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1578>
2020-11-20 07:12:25 +00:00
Robert Mader
c78b03bd50 wayland/compositor: Only emit frame callbacks for the primary stage view
Since we schedule frames for each stage view seperately now, surfaces receive
frame callbacks for each stage view they are visible on.

Only emit frame callbacks for the primary stage view.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1468>
2020-11-19 19:44:43 +01:00
Robert Mader
ff94ed0ebf surface-actor-wayland: Add API to pick a primary stage view
Add a simple heuristic how to choose the primary stage view to drive events
like frame callbacks for a given surface actor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1468>
2020-11-19 19:43:40 +01:00
Robert Mader
9db09e327c surface-actor: Add API to check obscuredness per stage view
Our main use case of `is_obscured()` is frame callback emission.
Since we now support stage views running at differt speeds, we
need to know whether an actor is visible on a specific stage view
in order to schedule frame callbacks accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1468>
2020-11-19 19:42:08 +01:00
Robert Mader
f7cef11515 clutter/stage-view: Make get_refresh_rate() public
We'll need it in a follow-up commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1468>
2020-11-19 19:41:40 +01:00
Jonas Ådahl
fddd18cdd2 ci: Use ci-templates
This changes from manual container image building using podman locally
to building the container images as part of the CI pipeline.

It uses the CI templates from
https://gitlab.freedesktop.org/freedesktop/ci-templates.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1525>
2020-11-19 13:24:35 +00:00
Olivier Fourdan
06e604cfef window-props: Also check for actual values change
Commit e28c1ab4 added a hints_have_changed() function to only
recalculate windows features when the WM_NORMAL_HINTS change.

That function hints_have_changed() however was merely checking whether
the various XSizeHints flags where flipped, which is not sufficient
because the hints may remain the same while the actual values are
changed.

Not checking for the actual value differences would prevent some windows
from being able to switch fullscreen.

Improve the helper function hints_have_changed() to check not only for
flags being flipped, but also for the values being changed for each
relevant XSizeHints flags being set currently.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1534
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1566>
2020-11-19 08:31:15 +00:00
Ian Douglas Scott
b2126fec92 gschema: Add missing summaries for toggle-tiled-left/toggle-tiled-right
Wording copied from `data/50-mutter-windows.xml`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1573>
2020-11-18 13:48:48 -08:00
Carlos Garnacho
23ae8b4519 clutter: Drop clutter_input_device_get_device_id()
Move the GObject property to MetaInputDeviceX11, and throw away the
rest. This is no longer public API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
20e6464087 backends/native: Don't fake device IDs
Stop making them up, they go nowhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
7738ce2a64 backends/x11: Move to backend-specific meta_input_device_x11_get_device_id()
Make this info part of the MetaInputDeviceX11, as it's actually just
relevant to that backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
045181f321 clutter/main: Drop usage of clutter_input_device_get_device_id()
Just print the name in those debug logs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
9e894b2e1d tests: Drop usage of clutter_input_device_get_device_id()
We already print device names there.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
7aa63d6b8b clutter/event: Drop clutter_event_get_device_id()
Drop this odd shortcut, it is now unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
7cc6457b9f core: Move away from clutter_event_get_device_id()
Fetch the device, and the ID from there.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
8dea73ce6c tests: Drop usage of clutter_event_get_device_id()
Use device names there instead. Doesn't seem to matter much.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Carlos Garnacho
287d9b6b6f clutter/click-action: Move away from device IDs
Store the press device itself, not its ID.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
2020-11-18 19:10:48 +00:00
Daniel van Vugt
32b68478ed clutter/stage-cogl: Avoid copying fb_clip_region
Because it gets destroyed (unreferenced) immediately after that.
This avoids a deep copy of potentially kilobytes of data.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1572>
2020-11-18 19:08:38 +08:00
Robert Mader
09b1bbb1cf region-utils: Always use FLT_EPSILON when comparing floating point values
As you should always do. Using the `float` variant even if `scale` is
a `double` as values passed in are potentially computed at `float`
precission.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1565>
2020-11-16 19:27:20 +01:00
Robert Mader
91c9416259 region-utils: Reduce temporary allocations
This applies the optimizations from 0c55e87d8f to serveral
similar places in region-utils.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1565>
2020-11-16 19:27:20 +01:00
Jonas Ådahl
a50a5944a7 gitlab-ci.yml: Removed unnecessary when:
It resulted in failed instead of skipped jobs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1567>
2020-11-16 16:28:45 +00:00
Jonas Ådahl
8da1c192e6 ci: Make check-commit-log run again
It needs 'only: merge_request' to get the necessary env variables.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1567>
2020-11-16 16:28:45 +00:00
Jonas Ådahl
d622960429 renderer/native: Add udev rule to select primary GPU
Sometimes the automatically selected primary GPU isn't suitable with no
way to make an well educated guess to do it better. To make it possible
for the user to override the automatically calculated default, make it
possible to override it using a udev rule.

E.g. to select /dev/dri/card1 as the primary GPU, add a file e.g.
/usr/lib/udev/rules.d/61-mutter-primary-gpu.rules (path my vary
depending on distribution) containing the fellowing line:

ENV{DEVNAME}=="/dev/dri/card1", TAG+="mutter-device-preferred-primary"

Reboot or manual triggering of udev rules to make it take effect may be
required.

Related: https://gitlab.gnome.org/GNOME/mutter/merge_requests/1057

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562>
2020-11-16 16:00:33 +00:00
Jonas Ådahl
83360a4aed cursor-sprite/xcursor: Fall back to gray square if missing theme
Instead of aborting with an error, display a half transparent gray
square instead of cursors and log a warning in the journal, allowing the
user to fix their system withotu having to rely on switching to a TTY.

It will be immediately obvious the cursor is silly looking, which will
be a better hint than just aborting.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1428
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1563>
2020-11-16 13:49:05 +00:00
Jonas Ådahl
815ed52ca1 ci: Wait for review stage before continuing
If review fails, it'll fail very early in the pipeline, but we won't see
the test case failure until the whole pipeline succeeds, which might be
10 minutes later.

To avoid sitting there wondering why it failed, let the time consuming
jobs wait until the review stage, which tends to take less than 20
seconds, succeeds. This way the review test result will be presented
earlier.

This changes the pipeline to run the check-commit-log job also for
non-merge requests, with the difference being that it will pass
immediately if it's not a merge request.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1549>
2020-11-16 14:13:07 +01:00