Commit Graph

23593 Commits

Author SHA1 Message Date
dec20d13e1 meson, tests: Use suites for test cases
They allows to filter tests better and so we can just launch tests with:
  meson test --suite [mutter/stacking|cogl|clutter] [single-test-name]
2018-11-13 22:14:22 -06:00
0242c1a527 meson, tests: Add single stacking tests with suite
Don't launch the stacking tests in one single shot, to allow better debugging
and being able to launch just one single test using meson test.

Those tests can now be all launched with:
  meson test --suite stacking [single-test-name]
2018-11-13 22:14:22 -06:00
8652ec9ee2 window-x11: Focus the default window waiting for take focus
It's not guaranteed that a focus window will require the focus (this doesn't
happen for no-input gtk windows in fact [to be fixed there too]).
And in such case instead of unsetting the focus, while waiting the take focus
request to arrive, we should focus the current workspace default focus window
instead.
2018-11-13 22:14:22 -06:00
4c607164fd window: Add is_focusable class method
Implement is_focusable for both x11 and wayland and just use this check
so that we can abstract things more and be less dependent on window backend.
2018-11-13 22:14:22 -06:00
08f920606e tests: Verify focused window in closed-transient tests
Ensure that we have a focused window when closing transient windows with
no-focus or no-take-focus atoms
2018-11-13 22:14:22 -06:00
ef3ea0a59c test-runner: Add assert_focused command
This allows to verify which window should have the focus, which might not
be the same as the top of the stack.
2018-11-13 22:14:22 -06:00
a5f360cb9e workspace: Focus only ancestors who can be actually focused
When destroying a window that has a parent, we initially try to focus one of
its ancestors. However if no ancestor can be focused, then we should instead
focus the fault window instead of trying to request focus for a window
that can't get focus anyways.

Fixes #308
2018-11-13 22:14:22 -06:00
26cb0a5a75 tests, stacking: Add tests with no-input and no-take-focus windows
When a window with no frame, that doesn't accept focus and that has no take-focus
atom set is destroyed, we end up in not changing the current_focus window, causing
a crash.

Added test cases that verify this situation (expected to fail).

See #308
2018-11-13 22:14:22 -06:00
7c89167644 tests: Add take_focus command to runner and client
Allow to set/unset WM_TAKE_FOCUS from client window.
This is added by default by gtk, but this might not happen in other toolkits,
so add an ability to (un)set this.

So fetch the protocols with XGetWMProtocols and unset the atom.

test-client now needs to depend on Xlib directly in meson build.
2018-11-13 22:14:22 -06:00
984d27f050 tests: Add accept_focus command to client and runner
Under the hood, calls gtk_window_set_accept_focus in the client
2018-11-13 22:14:22 -06:00
5b13372fd4 meson, tests: Add missing stacking tests
Those .metatest where added to autotools and where missing in meson port.
2018-11-13 22:14:22 -06:00
4334534742 tests: Accept warnings when initializing mutter
Initializing mutter, might cause warning such as the `failed to bind to` when
another XServer is running. However these warnings are not critical, so we can
safely ignore them.
2018-11-13 22:14:22 -06:00
9a12befd22 Bump version to 3.31.2
Update NEWS.
3.31.2
2018-11-14 02:01:25 +01:00
9f79cf8a60 Revert "clutter: Avoid redundant margin changes"
This reverts commit 59acb38951.
2018-11-14 01:56:47 +01:00
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
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
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
9fb46cca55 clutter/keyframe-transition: Properly compare keys 2018-11-12 15:36:29 +01:00
2a4f1be81b clutter/actor: Don't forget va_end if using varargs 2018-11-12 15:36:27 +01:00
1dff74e71c build: Fix libs and cflags in autotools .pc file
Similar to b86d87453d
2018-11-10 16:20:46 +00:00
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
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
9adf8826d2 backends/stage: Remove unused function declaration
https://gitlab.gnome.org/GNOME/mutter/merge_requests/170
2018-11-09 11:16:30 +01:00
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
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
15732851bc clutter-shader: Don't include unistd.h
It isn't needed.
2018-11-08 18:40:53 +00:00
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
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
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
cbf6e74915 tests: Remove deprecated ATK functions 2018-11-08 18:08:57 +00:00
b5c4437287 tests: Remove extra const 2018-11-08 18:08:57 +00:00
426d7f3bdf tests: Enumerate all possible events 2018-11-08 18:08:57 +00:00
3483be8566 tests: Remove unused variables 2018-11-08 18:08:57 +00:00
4a7a803c34 README: Mention usage by Gala 2018-11-08 17:11:27 +01:00
4673eeaf5f wayland/xdg-shell: Add toplevel tile state support
The second version of xdg_wm_base added toplevel tile states (top,
right, bottom, left), so lets communicate that.
2018-11-08 13:21:53 +01:00
4f3de88b3d wayland/legacy-xdg-shell: Use helper to fill state array 2018-11-08 13:21:53 +01:00
180bb02fa5 wayland/gtk-shell: Use helper to fill state array 2018-11-08 13:21:53 +01:00
d59cf98690 wayland/gtk-shell: Fix signedness of resource version variable
wl_resource_get_version() returns an int, not an unsigned int.
2018-11-08 13:21:49 +01:00
27fee69ca4 wayland/xdg-shell: Add helper for adding state enum values 2018-11-08 13:21:21 +01:00
640a04d0e4 window: Make edge constraint code more readable
It relied on indices in arrays determining tile direction and
non-obvious bitmask logic to translate to _GTK_EDGE_CONSTRAINTS. Change
this to explicitly named edge constraints, and clear translation methods
that converts between mutters and GTK+s edge constraint formats.
2018-11-08 13:21:21 +01:00
5fc07fcc23 window: Store tile mode as MetaTileMode
An unnecessary memory optimization, storing the tile mode as a 2 bit
unsigned integer, was used. While saving a few bytes, it made debugging
harder. Remove the useless byte packing.
2018-11-08 13:21:21 +01:00
f31cf0c3ef clutter-offscreen-effect: Disable if no texture
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `update_fbo` would return `FALSE` but leaves `priv->offscreen`
as non-NULL. So the next paint will try to use the offscreen with a
`NULL` texture and crashes. The solution is simply to ensure that
`priv->offscreen` is NULL if there is no `priv->texture`, so the default
(non-offscreen) paint path gets used instead.

Bug reported and fix provided by Gert van de Kraats.

https://launchpad.net/bugs/1795774
2018-11-08 10:18:25 +00:00
d21478b0f0 cogl-auto-texture: Avoid a double-free crash
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `cogl_texture_new_with_size` was trying to use the same CoglError
twice. The second time was after it had already been freed.

Bug reported and fix provided by Gert van de Kraats.

https://launchpad.net/bugs/1790525
2018-11-08 10:18:25 +00:00
b86d87453d build: Fix include and lib paths in autotools .pc files
Some hadn't been updated after lib/mutter/ changed to lib/mutter-N/.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/382
2018-11-07 14:29:30 +01:00
cf7c39e2c1 build: Add soversion to shared libraries
It's easier to add it now, then adding it later would so be needed.
2018-11-07 13:00:47 +00:00
7c774ab53e build: Also build mutter-restart-helper executable
Was left out by mistake. Lets add it.
2018-11-07 13:00:47 +00:00
c03a401f4c clutter: Install x11 related header files when using autotools again
clutter-x11.h and x11/clutter-x11-texture-pixmap.h were not installed
any longer. Fix that.
2018-11-07 12:54:41 +00:00
c7e6cd4e27 plugins/Makefile.am: Install libdefault.so in plugin directory
It was incorrectly installed directly in $(libdir)/mutter-N/ while it
should be installed in $(libdir)/mutter-N/plugins/
2018-11-07 12:54:41 +00:00
fc5b94e077 clutter: Install cally headers again when using autotools
The install step was accidentally removed.
2018-11-07 12:54:41 +00:00
4ce4a2b134 cogl: Expose more headers for introspection
This will allow CoglFramebuffer and its implementations to be exposed
to GJS and other language bindings. This is a necessary part of the
bigger work to make framebuffer management explicit.
2018-11-07 11:27:51 +00:00