Commit Graph

26495 Commits

Author SHA1 Message Date
Olivier Fourdan
935d594978 gschema/wayland: Do not disable the X Security extension
If Xwayland was built with the X Security extension enabled, it should
be safe to use, there is no need to disable it by default from mutter.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1485
2020-10-09 13:53:08 +00:00
Juliano de Souza Camargo
02bc10786d Update Portuguese translation
(cherry picked from commit 103d798775de27bce10fc8827b2b7b5f79fb2ff7)
2020-10-09 12:04:01 +00:00
Olivier Fourdan
58e2ac8671 gschema: really use line breaks in schema
The newline character `\n` in the schema does not produce a new line.
Use a newline instead.

fixes: dbe44f3a83
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1483
2020-10-08 14:54:45 +00:00
Jonas Ådahl
2c95e08998 Remove misplaced line break in g_* logging functions
They resulted in empty lines in the log.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Jonas Ådahl
7266e516a1 wayland: Don't include newline in client error events
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Jonas Ådahl
313e3e771c Make meta_* logging utilities not require line break
Unlike g_* logging utilities, the meta_* counterparts behave like odd
printf() functions. Lets change that so they fit better into how logging
is done everywhere else.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Björn Daase
dbe44f3a83 gschema: Force one bullet point per line
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-08 15:41:19 +02:00
Björn Daase
e923641573 gschema: list experimental dma-buf-screen-sharing feature
The key was added in af9df1e5b6
but not added to the list due to the string freeze.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-08 15:39:10 +02:00
Björn Daase
815583b534 gschema: Make "Requires a restart." strings consistent
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
2020-10-07 22:49:49 +02:00
Jonas Ådahl
8bdd2aa7db window/wayland: Offset position with size mismatch when resizing
When we resize a window we send it configure requests with size
suggestion. Some clients, e.g. gnome-terminal will limit its size to a
discrete set given the font size resulting in the size often not being
respected completely, but used as a hint to find a size as large as
possible but not larger than the configured size.

When doing an interactive resize dragging the right or top side of a
window, this caused issues with the configured window size not matching
the one used by the client, as the configured position wouldn't be
correct for the actual size. Fix this by offsetting the position given
the size mismatch offset, making the position again in sync with the
size.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1447

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1477
2020-10-07 16:49:35 +02:00
Georges Basile Stavracas Neto
c7ab5f3f03 clutter/offscreen-effect: Remove clutter_offscreen_effect_get_target_rect
Keeping track of the projected position is costly, and adds quite some complexity
to ClutterOffscreenEffect.pre_paint(). As far as research goes, there's not a
single consumer of this function that uses the position for anything - only size
is used.

Remove clutter_offscreen_effect_get_target_rect(), and drop the annoying position
field from ClutterOffscreenEffect as well. This allows us to stop projecting the
position on pre-paint, and simplify things.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:37 +00:00
Georges Basile Stavracas Neto
cce4d75a38 clutter/deform-effect: Use clutter_offscreen_effect_get_target_size()
We don't read the x/y position anyway.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:37 +00:00
Georges Basile Stavracas Neto
4435bec347 clutter/offscreen-effect: Undeprecate clutter_offscreen_effect_get_target_size()
clutter_offscreen_effect_get_target_rect() is going away soon.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:37 +00:00
Georges Basile Stavracas Neto
cef6534e44 clutter/offscreen-effect: Remove CoglMaterial from public API
Rename clutter_offscreen_effect_get_material() to get_pipeline() and
make it return (actually, stop casting to) a CoglMaterial.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:37 +00:00
Georges Basile Stavracas Neto
f6500042f1 clutter/paint-nodes: Don't skip pipeline node constructor
ClutterPipelineNode will be used by GNOME Shell in the future.
Fortunately for us, CoglPipeline is already usable from GJS,
so we don't need to skip the constructor for the pipeline node.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:37 +00:00
Georges Basile Stavracas Neto
de01dea93e clutter/offscreen-effect: Simplify paint
Simply chain up to get the pre and post paint methods,
instead of reimplementing ClutterEffect.paint()

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:36 +00:00
Georges Basile Stavracas Neto
f5c77df86c clutter/offscreen-effect: Unref framebuffer on pre_paint
Move unreffing the framebuffer to ClutterOffscreenEffect.pre_paint().
This will allow us to properly chain up ClutterOffscreenEffect.paint()
and not reimplement exactly what ClutterEffect does by default.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:36 +00:00
Georges Basile Stavracas Neto
67129c7757 clutter/effect: Don't expose pre and post paint helpers
They're not used outside ClutterEffect.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
2020-10-07 13:30:36 +00:00
Carlos Garnacho
0cab71ea52 clutter: Do not special case allocated events
All events should be allocated, stack allocation is avoided and should
be avoided in the future, probably by making ClutterEvent structs opaque.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
2020-10-06 21:33:19 +02:00
Carlos Garnacho
a3c95f6023 clutter: Drop clutter_event_peek()
Peeking doesn't seem such a good idea when we switch to async queues.
Luckily nobody seems to be using this.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
2020-10-06 21:33:16 +02:00
Carlos Garnacho
bbc4116f10 backends: Use graphene_point_t on meta_cursor_tracker_get_pointer()
It's nicer to propagate along.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
2020-10-06 21:33:10 +02:00
Carlos Garnacho
e0944b6097 backend: Don't pull generated headers (indirectly)
Use a typedef for MetaRemoteDesktop, so tests poking MetaBackend don't
indirectly depend upon generated headers. This is arguably a code fix
for a build system bug.

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

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1449
(or something...)
2020-10-06 16:16:21 +00:00
Jonas Ådahl
498248586a util: Remove now unused debug functions
They have been replaced with using debug string parsing and topics.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
2020-10-06 15:52:54 +00:00
Jonas Ådahl
b1ffd14d62 main: Parse MUTTER_DEBUG as debug string
This makes it possible to run e.g.

    env MUTTER_DEBUG=input:geometry gnome-shell

which will enable the 'META_DEBUG_INPUT' and 'META_DEBUG_GEOMETRY'
topics.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
2020-10-06 15:52:54 +00:00
Jonas Ådahl
24c374ffb2 util: Remove unused meta_debug_spew()
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
2020-10-06 15:52:54 +00:00
Jonas Ådahl
9a75de9309 util: Remove a bunch of unused debug topics
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
2020-10-06 15:52:54 +00:00
Jonas Ådahl
b536a531cb place: Use 'placement' topic for logging monitor rect
It was logged using the 'xinerama' topic during placement calculation,
which doesn't seem very relevant here since a handful of years.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
2020-10-06 15:52:54 +00:00
Olivier Fourdan
98df888f03 main: Release backend on teardown
This allows to call the backend finalize function on teardown.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1438
2020-10-06 15:45:43 +00:00
Olivier Fourdan
6db7d8f830 backend: Add a backend release function
Mutter still relies heavily on singletons such as its MetaBackend.

For that, the backend implementation has a meta_init_backend() function
which is called at startup from meta_init(), which creates the desired
backend and sets the singleton which is returned by meta_get_backend().

Unfortunately, that means that the backend is never actually freed, and
all the code from the backend finalize function never actually get
called.

Add a meta_release_backend() to free the backend singleton.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1438
2020-10-06 15:45:42 +00:00
Olivier Fourdan
c956193d09 input-settings: Disconnect device signals on dispose
The input settings constructor installs callback functions on device
added/remove and tool-changed.

However, on dispose, those signals are not disconnected, meaning that on
teardown, once the devices get removed eventually, the callback will
still fire and call the callback with freed data, causing a crash.

Make sure we clear the signals on devices on dispose, to avoid the crash
on teardown.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1438
2020-10-06 15:45:42 +00:00
Georges Basile Stavracas Neto
b5749a8b27 Remove CoglMatrix
Adios, amiga.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
77352c2d3a tests: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
090973e538 cogl/tests: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
a3cb1cabd3 texture-tower: Use graphene APIs
A boring one, with the exception that row and column needed to be
swapped. For the sake of consistency, the variable names were also
synchronized with the values they hold, so e.g. xy → yx, etc.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
f6998f87c2 src: Use graphene APIs
This commit encompasses the trivial ones.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
f676861054 renderer-view: Use graphene APIs
Yet another case of swapping operations order upside down.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
4376f59c1e shaped-texture: Use graphene APIs
This is a slightly delicate port; much like the ClutterActor port,
using graphene required swapping the order of operations upside down.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
182b51774e cogl: Use graphene APIs
These are the easy, trivial ones.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
9e1004da0c cogl/matrix-stack: Use graphene APIs
This one is a bit tricky. The tl;dr; is that switching from right-hand
multiplication to left-hand multiplication required applying the stack
from left to root. This actually allowed simplifying the code a bit,
since CoglMatrixEntry only stores a pointer to its parent, and that's
all we need to know for left-hand multiplication.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
d03ffe1e97 cogl/matrix-stack: Embed graphene matrices in entry structs
Instead of heap allocated graphene matrices, embed them into the
entries themselves. That makes the matrix magazine unused, and thus
also remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
3cb59050f3 clutter/util: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
462ade5afe clutter/scroll-actor: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
571bf5af6d clutter/pan-action: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
6aa29640d6 clutter/paint-volume: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
eff662f7d7 clutter/paint-nodes: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
aca2880c6a clutter/stage-view: Use graphene APIs
In this case, since we are building the entire matrix by ourselves,
reverse the order of operations (translate + scale → scale + translate)
and build it using graphene-specific APIs.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
dc8f875a8a clutter/offscreen-effect: Stop using CoglMatrix API
Switch to using CoglFramebuffer APIs, which use the modelview matrix
stack. CoglMatrixStack will be ported to graphene APIs later, but it
will be transparent to this change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
f9d1b7ca58 clutter/clone: Use graphene APIs
This is another instance of graphene reversing the order of operations (see
the commit notes of how ClutterActor was ported.) The tl;dr; here is that,
in the CoglMatrix past, we used to do:

  (actor transforms) → scale

and now, it's the other way round:

  scale → (actor transforms)

due to changing from right-handed multiplications (CoglMatrix) to left-handed
ones (graphene_matrix_t).

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:48 +00:00
Georges Basile Stavracas Neto
2406f225a9 clutter/actor: Use graphene APIs
ClutterActor is a particularly heavy user of matrices, and
switching to graphene_matrix_* APIs means we had to change
the order of operations due to left-hand vs right-hand
differences.

When applying the actor transform, there are 2 main branches
that can be followed: the default transforms, and when a
custom transform is set.

To facilitate review, here's the table that I've made to
guide myself:

+--------------- Case 1: Default Transforms --------------+
|        CoglMatrix          |      graphene_matrix_t     |
+----------------------------+----------------------------+
| multiply (child transform) | translate (-pivot)         |
| translate (allocation)¹    | rotate_x (angle)           |
| translate (pivot)¹         | rotate_y (angle)           |
| translate (translation)¹   | rotate_z (angle)           |
| scale (sx, sy, sz)         | scale (sx, sy, sz)         |
| rotate_z (angle)           | translate (translation)¹   |
| rotate_y (angle)           | translate (pivot)¹         |
| rotate_x (angle)           | translate (allocation)¹    |
| translate (-pivot)         | multiply (child transform) |
+----------------------------+----------------------------+

¹ - these 3 translations are simplified as a single call
    to translate(allocation + pivot + translation)

+---------------- Case 2: Custom Transform ---------------+
|        CoglMatrix          |      graphene_matrix_t     |
+----------------------------+----------------------------+
| multiply (child transform) | translate (-pivot)         |
| translate (allocation)²    | multiply (transform)       |
| translate (pivot)²         | translate (pivot)²         |
| multiply (transform)       | translate (allocation)²    |
| translate (-pivot)         | multiply (child transform) |
+----------------------------+----------------------------+

² - likewise, these 2 translations are simplified as a
    single call to translate(allocation + pivot)

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:47 +00:00
Georges Basile Stavracas Neto
cbcbe39f4d clutter/stage: Only use graphene_matrix_* APIs
Switch away from cogl_matrix_* APIs in favor of graphene_matrix_*
ones. Notice that cogl_matrix_get_value() swaps row and column,
which is reflected here.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
2020-10-06 15:34:47 +00:00