1
0
Fork 0
Commit graph

24473 commits

Author SHA1 Message Date
Florian Müllner
06a7c22bcd ci: Test building without native backend support
Nobody from the core team tests that configuration, so some non-guarded
includes regularly sneak in. Avoid those build breakages by adding a
corresponding job to the CI pipeline.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/637
2019-06-27 15:50:11 +00:00
Florian Müllner
ca88826ce9 remote-desktop-session: Remove unnecessary include
The class doesn't actually use the native backend, so remove it
to avoid build errors when the backend is disabled.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/637
2019-06-27 15:50:11 +00:00
Jonas Ådahl
7229a07b6c window-actor: Remove left-over parent field
The commit

commit 60f7ff3a69
Author: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date:   Fri Dec 21 18:12:49 2018 -0200

    window-actor: Turn into a derivable class

made the previous instance struct a instance private struct, but didn't
remove the parent field. Since it's unused, there is no point in keeping
it around, so lets drop it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/658
2019-06-27 15:07:47 +02:00
Olivier Fourdan
85f4772a4f backend/native: Fix compiler warning w/out EGL device
When building without EGL device support, the following compiler warning
is seen:

```
  src/backends/native/meta-renderer-native.c:2637:20: warning: unused
  variable ‘cogl_renderer_egl’ [-Wunused-variable]
```

Fix the warning by placing the relevant variable declarations within the
`#ifdef HAVE_EGL_DEVICE/#endif` statement.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/656
2019-06-27 10:21:26 +02:00
Robert Mader
f2fb3945d1 wayland/surface: Post error on invalid scale
To follow the spec and make faulty clients fail hard.

https://gitlab.freedesktop.org/wayland/wayland/blob/master/protocol/wayland.xml#L1618

https://gitlab.gnome.org/GNOME/mutter/merge_requests/647
2019-06-26 21:02:46 +02:00
Daniel van Vugt
d7d75dd8e7 cogl-trace: Include cogl-trace.h even when not tracing
Public functions in C should be declared before they are defined, and
often compilers warn you if you haven't:

```
../cogl/cogl/cogl-trace.c:237:1: warning: no previous prototype for
‘cogl_set_tracing_enabled_on_thread_with_fd’ [-Wmissing-prototypes]
 cogl_set_tracing_enabled_on_thread_with_fd (void       *data,
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cogl/cogl/cogl-trace.c:245:1: warning: no previous prototype for
‘cogl_set_tracing_enabled_on_thread’ [-Wmissing-prototypes]
 cogl_set_tracing_enabled_on_thread (void       *data,
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cogl/cogl/cogl-trace.c:253:1: warning: no previous prototype for
‘cogl_set_tracing_disabled_on_thread’ [-Wmissing-prototypes]
 cogl_set_tracing_disabled_on_thread (void *data)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

In this case the function declarations were not included because
`HAVE_TRACING` isn't defined. But we should still include `cogl-trace.h`
because it handles the case of `HAVE_TRACING` not being defined and
correctly still declares the functions defined in `cogl-trace.c`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/650
2019-06-26 16:36:05 +00:00
Jonas Ådahl
54fe0d311d ci/Dockerfile: Add mesa crash fix
This applies 'egl/x11: calloc dri2_surf so it's properly zeroed' to
mesa-19.0.7, as it fixes a crash introduced by 'egl/dri: flesh out and
use dri2_create_drawable()' included in 19.0.6.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/648
2019-06-26 18:26:52 +02:00
Jonas Ådahl
fefac75e96 ci/Dockerfile: Add commands for regenerating
Instead of either figuring out themself, or looking at the commit that
added the file, just make life easier by providing the commands for
rebuilding and pushing as a comment in the Dockerfile itself.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/648
2019-06-26 18:26:50 +02:00
Florian Müllner
5e46940332 ci: Drop old gsettings-desktop-schemas package versions
Since we switched to F30, the base system provides newer versions than
the ones specified (although since 3.33.3 not new enough).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/648
2019-06-25 17:43:34 +02:00
Florian Müllner
1767672375 Bump version to 3.33.3
Update NEWS.
2019-06-24 19:37:43 +02:00
Florian Müllner
6fc4cd3c0c build: Bump gsettings-desktop-schemas requirement 2019-06-24 19:33:30 +02:00
Florian Müllner
feb9d129db window-x11: Fix typo 2019-06-24 19:33:30 +02:00
Carlos Garnacho
2b519cba36 backends: Move numlock persistence handling here
We used to have wayland-specific paths for this in src/wayland, now we
have ClutterKeymap that we can rely on in order to do state tracking,
and can do this all on src/backend domain.

This accomodates the feature in common code, so will work on both
Wayland and X11.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/590
2019-06-24 18:24:57 +02:00
Carlos Garnacho
832fc798d5 backends: Add missing code to restore NumLock state on X11
It's not be called to any practical effect yet in this backend, but will
do soon.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/590
2019-06-24 17:12:14 +02:00
Florian Müllner
bd0743a421 ci: Install sysprof dependency from copr
The currently used package links are outdated. Instead of updating them
to the current release number, rely on copr repos having a higher priority
than system repos and simply specify the package name.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/644
2019-06-24 14:35:46 +00:00
Jonas Ådahl
20731887f2 monitor-manager/dummy: Fix name of mode debug env var
It provides ways to configure the modes, not the actual monitors.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/529
2019-06-24 13:49:52 +00:00
Jonas Ådahl
980d9b1042 monitor-manager/dummy: Make modes env var override the defaults
So that one can effectively change the default resolution.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/529
2019-06-24 13:49:52 +00:00
Corentin Noël
bd7704f9e1 meta: Make MetaBackgroundGroup derivable
https://gitlab.gnome.org/GNOME/mutter/merge_requests/640
2019-06-24 13:49:31 +00:00
Jonas Ådahl
68f18f1fe9 monitor-manager/kms: Use KMS abstraction to get and set CRTC gamma
Still doesn't synchronize with frame drawing, but no point in doing that
until gamma is managed by mutter itself and not gnome-settings-daemon.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/634
2019-06-24 13:36:10 +00:00
Jonas Ådahl
c655166398 kms-impl/simple: Removing extra semi colon
https://gitlab.gnome.org/GNOME/mutter/merge_requests/634
2019-06-24 13:36:10 +00:00
Marco Trevisan (Treviño)
e14613e74e window: Warn if try to focus unmanaging windows
https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
f71151a5dd window-x11: Focus the default window with delay while waiting for take-focus
When requesting to a take-focus window to acquire the input, the client may or
may not respond with a SetInputFocus (this doesn't happen for no-input gtk
windows in fact [to be fixed there too]), in such case we were unsetting the
focus while waiting the reply.

In case the client won't respond, we wait for a small delay (set to 250 ms) for
the take-focus window to grab the input focus before setting it to the default
window.

Added a test for this behavior and for the case in which a window takes the
focus meanwhile we're waiting to focus the default window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
6022b23923 test-runner: Add 'dispatch' command
This will only wait for events to be dispatched and processed by the server
without waiting for client processing.

Reuse the code for the wait command too.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
d08763c18c test-runner: Add 'sleep' command
This allows to sleep for a given timeout in milliseconds.

Rename test_case_before_redraw to test_case_loop_quit since it's a generic
function and use it for the timeout too.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
fcb408ad5d 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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
51f9e04ef1 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.

It's possible to assert the case where there's no focused window using
"NONE" as parameter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
2fc7760cee 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 ended up in not changing the current_focus
window, causing a crash.

Added test cases that verify this situation.

Related to https://gitlab.gnome.org/GNOME/mutter/issues/308
https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
f2d2d473b7 tests: Add 'can_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.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
e1f839f48f tests: Add 'accept_focus' command to runner and client
Under the hood, calls gtk_window_set_accept_focus in the client

https://gitlab.gnome.org/GNOME/mutter/merge_requests/307
2019-06-24 09:42:07 +00:00
Marco Trevisan (Treviño)
eccc791f3b workspace: Focus only ancestors that are focusable
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 default focus window instead of trying to request focus for a window
that can't get focus anyways.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/308
2019-06-24 09:42:07 +00:00
Ting-Wei Lan
6055f04814 display: Remove _XOPEN_SOURCE definition
There is no gethostname call in this file.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/638
2019-06-24 09:35:02 +00:00
Ting-Wei Lan
0185909ee3 window-x11: Fix _XOPEN_SOURCE usage for gethostname on FreeBSD
On FreeBSD, gethostname is guarded by '__POSIX_VISIBLE >= 200112', which
requires either '_POSIX_C_SOURCE >= 200112' or '_XOPEN_SOURCE >= 600'.
Defining _XOPEN_SOURCE to 500 does not break the build because of
implicit declaration, but it defeats the purpose of defining the macro.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/638
2019-06-24 09:35:02 +00:00
Ting-Wei Lan
c35e56196a xwayland: Use g_get_host_name instead of gethostname
Since the xauth file is never going to be changed after it is generated,
it is safe to use g_get_host_name here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/626
https://gitlab.gnome.org/GNOME/mutter/merge_requests/638
2019-06-24 09:35:02 +00:00
Carlos Garnacho
181c7cab32 wayland: Use right sign for workspace ID
We get a signed integer (-1 meaning "no workspace specified"), store it in
an unsigned integer, check for >= 0 (of course it is!) and set as the window
workspace (signed integer, -1 meaning "show on all workspaces"). What could
possibly go wrong?

https://gitlab.gnome.org/GNOME/mutter/merge_requests/639
2019-06-24 09:21:49 +00:00
Ting-Wei Lan
740a62044e wayland/pointer-constraints: Fix build when native backend is disabled
https://gitlab.gnome.org/GNOME/mutter/merge_requests/636
2019-06-22 16:12:42 +00:00
Goran Vidović
0bf0366933 Update Croatian translation 2019-06-22 16:01:11 +00:00
Niels De Graef
70bacb9402 cogl: Remove CoglError wrapper
CoglError was added at a certain point to remove the hard dependency on
GLib, but since this can't be avoided inside mutter, let's remove this
whole abstraction.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/631
2019-06-20 18:25:04 +02:00
Jonas Ådahl
57dfe4696d kms-update: Seal updates when posting them
This makes sure that we won't accidentally change KMS transaction
updates after they have been posted.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
22a91f23ad backends/native: Add some KMS debug logging
Using the g_debug() macro. Set G_DEBUG_MESSAGES to "mutter" to activate
log.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
6aa1026600 kms: Add high level code documentation
Document the high level components of the KMS abstraction.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
75dff3e7c9 backend/native: Add and use transactional KMS API
This commit introduces, and makes use of, a transactional API used for
setting up KMS state, later to be applied, potentially atomically. From
an API point of view, so is always the case, but in the current
implementation, it still uses legacy drmMode* API to apply the state
non-atomically.

The API consists of various buliding blocks:

 * MetaKmsUpdate - a set of configuration changes, the higher level
handle for handing over configuration to the impl backend. It's used to
set mode, assign framebuffers to planes, queue page flips and set
connector properties.
 * MetaKmsPlaneAssignment - the assignment of a framebuffer to a plane.
Currently used to map a framebuffer to the primary plane of a CRTC. In
the legacy KMS implementation, the plane assignment is used to derive
the framebuffer used for mode setting and page flipping.

This also means various high level changes:

State, excluding configuring the cursor plane and creating/destroying
DRM framebuffer handles, are applied in the end of a clutter frame, in
one go. From an API point of view, this is done atomically, but as
mentioned, only the non-atomic implementation exists so far.

From MetaRendererNative's point of view, a page flip now initially
always succeeds; the handling of EBUSY errors are done asynchronously in
the MetaKmsImpl backend (still by retrying at refresh rate, but
postponing flip callbacks instead of manipulating the frame clock).
Handling of falling back to mode setting instead of page flipping is
notified after the fact by a more precise page flip feedback API.

EGLStream based page flipping relies on the impl backend not being
atomic, as the page flipping is done in the EGLStream backend (e.g.
nvidia driver). It uses a 'custom' page flip queueing method, keeping
the EGLStream logic inside meta-renderer-native.c.

Page flip handling is moved to meta-kms-impl-device.c from
meta-gpu-kms.c. It goes via an extra idle callback before reaching
meta-renderer-native.c to make sure callbacks are invoked outside of the
impl context.

While dummy power save page flipping is kept in meta-renderer-native.c, the
EBUSY handling is moved to meta-kms-impl-simple.c. Instead of freezing the
frame clock, actual page flip callbacks are postponed until all EBUSY retries
have either succeeded or failed due to some other error than EBUSY. This
effectively inhibits new frames to be drawn, meaning we won't stall waiting on
the file descriptor for pending page flips.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
bea7600471 logical-monitor: Pass output when iterating over CRTCs
While not currently used by any users, it'll be useful in future
commits.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
8932388dda backend/native: Move some KMS utilities to its own file
They are not strictly related to any of the KMS objects, and should be
reusable without adding a dependency on the non-meta-kms-* files in
meta-kms-*.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
2238c9f180 kms: Add API to register impl file descriptors
To let the MetaKmsImpl implementation register file descriptor GSource
where the invoke function is ensured to be executed in the impl context.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
ca21ca6745 kms: Add API to add a GSource that'll be invoked in the impl context
The MetaKmsImpl implementation may need to add a GSource that should be
invoked in the right context; e.g. a idle callback, timeout etc. It
cannot just add it itself, since it's the responsibility of MetaKms to
determine what is the impl context and what is the main context, so add
API to MetaKms to ensure the callback is invoked correctly.

It's the responsibility of the caller to eventually remove and destroy
the GSource.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
2bbd2e5563 kms: Add API to post callbacks out of the impl context
While the current impl context is in the same thread as the main
context, the separation still exists, and to post callbacks from the
impl context, it must pass MetaKms to make sure the callback is invoked
in the right context.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
691d58e69b gpu/kms: Remove unused typedef
https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
d84c7269b2 crtc/kms: Use MetaKmsPlane to check supported rotations and formats
Instead of manually retrieving supported transforms and formats from the
primary plane of the CRTC, use the MetaKmsPlane abstraction to find the
primary plane of the CRTC and check compatibility using the
MetaKmsPlane API. This removes the last user of direct KMS API usage
except for applying configuration.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
aba689312f gpu/kms: Init global mode list from MetaKmsConnectors
Instead of iterating over the available drmModeConnector objects to
construct a GPU wide mode list, use the state managed by
MetaKmsConnector. This also removes the last user of drmModeRes from
MetaGpuKms.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00
Jonas Ådahl
f2d9a11013 output/kms: Outsource connector state fetching to MetaKmsConnector
As with CRTC state, variable connector state is now fetched via the
MetaKmsConnector. The existance of a connector state is equivalent of
the connector being connected. MetaOutputKms is changed to fetch
variable connector state via MetaKmsConnector intsead of KMS directly.
The drmModeConnector is still used for constructing the MetaOutputKms to
find properties used for applying configuration.

https://gitlab.gnome.org/GNOME/mutter/issues/548
https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
2019-06-20 13:31:56 +00:00