Commit Graph

23613 Commits

Author SHA1 Message Date
Olivier Fourdan
97230a2b64 clutter/evdev: Use clutter_event_set_device()
Use the relevant clutter device API `clutter_event_set_device()` instead
of setting the device directly in the event field.
2018-11-19 15:41:43 +00:00
Alan Coopersmith
791bec3cf7 display: Make lack of required X extensions a fatal error
https://gitlab.gnome.org/GNOME/mutter/issues/272  


Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19 15:17:51 +00:00
Emilio Pozuelo Monfort
fb8dc91893 output/kms: Make winsys_id unique
We were using the connector_id for the winsys_id, but different
devices could have connectors with the same id. Since we use
winsys_id to uniquely identify outputs, use both the connector
id and the device id to avoid having outputs with the same id.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
5e005316ef output: Turn winsys_id into a uint64_t
We need a 64 bit field to combine the device id and connector
id into the output id (winsys_id).
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
4bc6a64d47 backends/native: Use the connector_id rather than winsys_id
winsys_id needs to be a unique output identifier so it will have
to stop being the connector id.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
91d4f30ebd gpu/kms: Add identifier
We need a device unique id in order to uniquely identify an output,
which will use a (device, connector) pair.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
c585b214b8 gpu: Drop unused declaration 2018-11-19 14:58:48 +00:00
Georges Basile Stavracas Neto
0304433b20
clutter-rectangle: Remove cogl_rectangle()
A pretty regular removal.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
fcd1ff9c56
clutter-texture: Remove cogl_rectangle_with_texture_coords()
Mostly as expected, this port is also trivial. A small cleanup
accompanies this patch, making gen_texcoords_and_draw_cogl_rectangle()
receive the framebuffer that it should draw into.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
a227e4078b
clutter-wayland-surface: Remove cogl_rectangle()
This is a very straightforward port too: simply replacing
cogl_rectangle() by cogl_framebuffer_draw_rectangle().
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
cabcad1856
clutter-text: Replace cogl_rectangle()
Because ClutterText has a somewhat convoluted drawing routine,
replacing cogl_rectangle() here isn't as straightfoward as the
effects were.

A new CoglPipeline is now part of the ClutterText struct, and
is used to set the color of the  background or the selection.

Another change is paint_selection() now receives a framebuffer
to draw into. The check for NULL framebuffer does not make
sense here, since there is always a draw framebuffer set
when in the drawing function. Because of that, the check is
now gone.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
4c3d9fccc1
clutter-*-effect: Remove cogl_rectangle()
All those effects have the same basic pattern of setting a
color of a pipeline, then drawing a rect with cogl_rectangle().

Thus, replacing those was as easy as retrieving the draw
framebuffer and calling cogl_framebuffer_draw_rectangle() on it.
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
203725bfd3
clutter-actor: Remove cogl_rectangle from pick()
The default implementation of ClutterActor.pick() uses
cogl_rectangle() to draw the rectangle with the color
for picking.

Replace that by cogl_framebuffer_draw_rectangle(). A
static color pipeline had to be created in order to
hold the pick color.
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
c1b6184e0a
clutter-stage: Pass framebuffer to read pixels from
Instead of using cogl_read_pixels(), which is deprecated and
uses the implicit framebuffer, pass the current CoglFramebuffer
and use cogl_framebuffer_read_pixels().
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
dd82fbebf6
clutter-stage: Replace cogl_clear by cogl_framebuffer_clear
Another case of a simple and direct API translation. Instead of
using the deprecated cogl_clear() function, replace it by the
non-deprecated cogl_framebuffer_clear().
2018-11-18 20:28:37 -02:00
Georges Basile Stavracas Neto
605f35dd25
shadow-factory: Receive CoglFramebuffer
Following up last commit, this commit adds a CoglFramebuffer
argument to meta_shadow_paint(), and stops using the draw
framebuffer internally.

The only consumer of this API, MetaWindowActor, still passes
the draw framebuffer though.
2018-11-18 20:28:37 -02:00
Georges Basile Stavracas Neto
aecf588d8d
shadow-factory: Replace implicit API by explicit counterparts
MetaShadow.paint() uses Cogl implicit APIs (cogl_rectangle* ones, in
this case) to paint shadows with the shadow pipeline.

Replace those calls by cogl_framebuffer_draw_textured_rectangle()
calls, that achieve the exact same result but with the non-deprecated
API.
2018-11-18 20:28:34 -02:00
Ting-Wei Lan
740c2298c6 build: Don't hardcode the path of python3
Python is not guaranteed to be installed in /usr/bin. This is especially
true for *BSD systems which don't consider Python as an integral part of
their systems.
2018-11-18 14:25:35 +08:00
Jonas Ådahl
787bb4316d x11/window: Minor cleanup
Limit the scope of the 'monitor_rect' variable and break up a long line.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
2018-11-14 16:04:10 +01:00
Jonas Ådahl
563c5b0612 monitor-unit-tests: Try resizing clients while headless
Prior to 6dcce19932 this test would crash.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
2018-11-14 16:04:10 +01:00
Jonas Ådahl
c8a4e37e0c tests/test-client: Add "resize" command
The "resize" command resizes a window.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
2018-11-14 16:04:10 +01:00
Jonas Ådahl
1266c20d4c monitor-unit-tests: Also run a X11 client while testing
We already ran a Wayland client to test various Wayland paths. What was
missing to also run a X11 client was to hook in the X11 async waiter
wires, so do that and run both types of clients.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
2018-11-14 16:04:10 +01:00
Jonas Ådahl
76760bfd79 tests: Make all alarm filters use the same type
That'll make them more interchangable, would so ever be needed.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
2018-11-14 16:04:10 +01:00
Jonas Ådahl
18c1d9672a gitlab-ci: Add test stage
The test stage runs the whole meson test suite inside Xvfb inside a dbus
session. Running inside Xvfb is required as the cogl, clutter and mutter
tests require to run on top of X11; the dbus session is required to make
mutter succeed in owning names on the bus.

This also updates the Dockerfile to include packages needed for running
tests.

https://gitlab.gnome.org/GNOME/mutter/issues/193
2018-11-14 15:56:16 +01:00
Jonas Ådahl
bd624e4dfb tests: Override X11 display number
As with the Wayland display name, to avoid clashes with already an
running Xwayland or Xorg instance, override the X11 display name to
something less likely to cause a clash.

https://gitlab.gnome.org/GNOME/mutter/issues/193
2018-11-14 15:55:45 +01:00
Jonas Ådahl
fe1d9fb4a7 tests: Override Wayland display name in test_init()
It's overridden by all test cases, but they all also call test_init() so
do it there instead.

https://gitlab.gnome.org/GNOME/mutter/issues/193
2018-11-14 15:55:45 +01:00
Jonas Ådahl
e2cd9abf46 Dockerfile: Align comment with command 2018-11-14 15:55:45 +01:00
Jonas Ådahl
a892e7a6aa clutter/tests: Remove events-touch test
The events-touch test tested that clutter could properly process evdev
touch events. It used uinput to post evdev touch events, thus only ran
when runnig the test as root. Running as non-root it'd just silently
pass. As Clutter doesn't process evdev touch events anymore,
libinput does, so the test is fairly pointless, so remove it.
2018-11-14 15:55:45 +01:00
Jonas Ådahl
5b3e439c5d cogl/tests: Increase the conform test timeout to 120 s
Running it on CI runners can take bit more time, so let it be for a bit
more until bailing out.
2018-11-14 15:55:45 +01:00
Jonas Ådahl
626c3745e2 clutter/master-clock: Destroy source when paused
Pausing the master clock didn't actually pause it if there was already a
scheduled frame in progress. This is problematic if one actually expects
to see no new frame scheduling to happen after pausing, for example it
caused actor 'pre-paint' to be signalled on actors, but nothing was ever
painted.

Avoid this by destroying the master clock source when pausing, and then
recreating it when resuming.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/309
2018-11-14 14:37:04 +01:00
Olivier Fourdan
bda9c359af wayland/output: Rotate physical dimensions as well
For Wayland outputs, we do not expose the actual transformation because
mutter does not support wl_surface.set_buffer_transform yet, instead we
swap the logical width and height when the output is rotated.

However, a client wishing to use the physical size would get confused,
so if the output is rotated, rotate the physical dimensions as well for
consistency.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/369
2018-11-14 12:10:47 +01:00
Jānis Džeriņš
6c5baf89ed keybindings: Limit corner move to current monitor
Moving windows using `move-to-side-X` and `move-corner-XX` keybindings
should keep windows within the confines of current screen.

`move-to-monitor-XXX` keybindings can be used to move windows to other
monitors.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/320
2018-11-14 10:32:07 +02:00
Florian Müllner
9a12befd22 Bump version to 3.31.2
Update NEWS.
2018-11-14 02:01:25 +01:00
Florian Müllner
9f79cf8a60 Revert "clutter: Avoid redundant margin changes"
This reverts commit 59acb38951.
2018-11-14 01:56:47 +01:00
Daniel van Vugt
59acb38951 clutter: Avoid redundant margin changes
When profiling gnome-shell it was found that one of the main triggers
of `clutter_actor_queue_relayout` during animations was
`clutter_actor_set_margin_internal` continuously setting the same
zero margins. That's obviously pointless but also expensive since it
incurs full stage relayouts and reallocation. So just avoid redundant
margin changes.

Helps to further improve:
https://gitlab.gnome.org/GNOME/mutter/issues/233,
https://gitlab.gnome.org/GNOME/gnome-shell/issues/349
2018-11-13 14:21:31 +00:00
Olivier Fourdan
fa495286a1 window: Really force update monitor on hot plugs
Commit 8d3e05305 ("window: Force update monitor on hot plugs") added the
flag `META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE` passed to
`update_monitor()` from `update_for_monitors_changed()`.

However, `update_for_monitors_changed()` may choose to call another code
path to `move_between_rects()` and `meta_window_move_resize_internal()`
eventually.

As `meta_window_move_resize_internal()` does not use the "force" flag,
we may still end up in case where the window->monitor is left unchanged.

To avoid that problem, add a new `MetaMoveResizeFlags` that
`update_for_monitors_changed()` can use to force the monitor update from
`meta_window_move_resize_internal()`.

Fixes: 8d3e05305 ("window: Force update monitor on hot plugs")
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189
2018-11-13 10:10:30 +01:00
Niels De Graef
0b9404dcbe clutter/device-manager/evdev: Fix constraint cb
As pointed out by @jadahl, this shouldn't matter too much, as the
`constraint_callback` should always be set when initializing the mutter
backend.
2018-11-12 15:38:04 +01:00
Niels De Graef
9fb46cca55 clutter/keyframe-transition: Properly compare keys 2018-11-12 15:36:29 +01:00
Niels De Graef
2a4f1be81b clutter/actor: Don't forget va_end if using varargs 2018-11-12 15:36:27 +01:00
Alexander Mikhaylenko
1dff74e71c build: Fix libs and cflags in autotools .pc file
Similar to b86d87453d
2018-11-10 16:20:46 +00:00
Jonas Ådahl
25c53b2fb2 backend: Freeze frame clock when headless
Don't schedule redraws when being headless; there is nothing to draw so
don't attempt to draw. This also makes a flaky test become non-flaky, as
it previously spuriously got warnings due to windows being "painted"
when headless but lacking frame timings, as nothing was actually
painted.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
2018-11-09 11:16:30 +01:00
Jonas Ådahl
213ed80284 backends: Move clutter frame clock freeze/thaw API to ClutterSTage
It had nothing to do with EGL or the eglnative backend, and will be used
by non-native backends, so move it to a common place.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
2018-11-09 11:16:30 +01:00
Jonas Ådahl
9adf8826d2 backends/stage: Remove unused function declaration
https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
2018-11-09 11:16:30 +01:00
Jonas Ådahl
19930c6577 backends/stage: Remove MetaStagePrivate
The empty MetaStage was in meta-stage-private.h for no reason, so lets
move it to the C file. This makes it pointless to have a private
instance struct, so just move the fields to the private struct
_MetaStage.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
2018-11-09 11:16:30 +01:00
Jonas Ådahl
80d5f326e8 clutter: Assume XGE is available at build time
Almost a decade old, lets just assume it's there. This makes the button
on cally-atktext-example work again when building with meson, and
probably other things too.
2018-11-08 18:40:53 +00:00
Jonas Ådahl
15732851bc clutter-shader: Don't include unistd.h
It isn't needed.
2018-11-08 18:40:53 +00:00
Jonas Ådahl
996949806a
cogl: Silence some introspection warnings
Mostly skipping functions of non-introspected types, but also added a
missing callback scope.
2018-11-08 16:20:19 -02:00
Georges Basile Stavracas Neto
c5ac3d6217
theme: Drop gtk_css_provider_get_default()
Instead of using gtk_css_provider_get_default(), add a
static GtkCssProvider and fetch it instead. Creating
GtkCssProviders consume a bit more memory, so keeping
a single one alive is slightly more memory saving.
2018-11-08 16:20:19 -02:00
Georges Basile Stavracas Neto
3d23ecc456
clutter: Drop g_object_newv from ClutterScriptParser
Build an additional set of (GStrv, GValue[]) and pass it
to the non-deprecated g_object_new_with_properties().
2018-11-08 16:20:19 -02:00
Georges Basile Stavracas Neto
cbf6e74915 tests: Remove deprecated ATK functions 2018-11-08 18:08:57 +00:00