1
0
Fork 0
Commit graph

252 commits

Author SHA1 Message Date
Ivan Kuzmenko
2c5f874eaa orientation-manager: Expose MetaOrientationManager to introspection
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3880>
2024-07-23 17:49:11 +00:00
Peter Hutterer
d65c89d8b9 core: Add a MetaToolActionMapper for tablet tools
This mapper hooks into CLUTTER_BUTTON_PRESS/RELEASE events with a
clutter button of zero but a nonzero evcode (e.g. BTN_STYLUS).
It then looks up the available button actions and implements
switch-monitor and keybindings using the MetaTabletActionMapper parent
class.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Peter Hutterer
6c77af1493 core: Add a MetaTabletActionMapper as parent of the MetaPadActionMapper
This is prep work for using the same functionality for tablet tools as
well. The new MetaTabletActionMapper takes care of the event bubbling
via the device-added/removed and input-event signals and provides the
helper functions to cycle outputs and/or emulate keybindings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3649>
2024-07-16 09:33:29 +00:00
Bilal Elmoussaoui
bfd7f9d549 build: Split X11 server & client dependencies
Allows xwayland=true x11=false to be built with less dependencies
Also removes some unused x11 dependencies on the frame client & cogl

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:09:00 +02:00
Bilal Elmoussaoui
820a7ad813 build: Allow building xwayland without x11
Co-authored-by: Jonas Ådahl <jadahl@gmail.com>
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/3553

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3853>
2024-06-30 15:08:55 +02:00
Bilal Elmoussaoui
fd9957b81a keybindings: Move X11 bits to a separate header
Reduces the noise in terms of ifdef and makes it much easier
to spot which X11 bits are still mixed in the generic
keybindings file

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
beae45a060 build: Expose some features as variables in pkgconfig
Allows gnome-shell or other compositors to detect which features
were built when building libmutter automatically without having to
expose various build options themselves

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
5a6b0fcee3 build: Conditionally include xlib libraries for Meta gir file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Bilal Elmoussaoui
08a3c57aad build: Only install group.h header when built with x11
Also rename the header to file to be consistent with other x11-only
headers

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3776>
2024-06-27 16:31:56 +02:00
Jonas Ådahl
465af4b2d3 build: Make native backend mandatory for all tests
This allows us one less level of indentation of all the tests. It is not
entirely true, the X11 backend test case script can run without it, but
it isn't valuable enough to run without the native backend being enabled
to complicate building.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3812>
2024-06-21 17:22:20 +00:00
Jonas Ådahl
536c52bdb1 wayland/drm-lease: Advertise initial devices
Advertise one wp_drm_lease_device_v1 global for each DRM node.

Co-authored-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3746>
2024-06-20 09:31:02 +00:00
Sebastian Wick
4a5fcef38d native/kms-lease: Implement leasing out a set of connectors
The manager keeps track of which connectors are leasable in general,
which connectors and resources are already part of a lease, and keeps
track of when leases get revoked.

When leasing out connectors, the required drm resources to drive the
connectors are included in the lease as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3746>
2024-06-20 09:31:02 +00:00
Bilal Elmoussaoui
b4b896d4db core: Move frame related types to x11
Also rename the files to meta-x11-frame* for consistency

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
2024-05-27 12:50:26 +00:00
Bilal Elmoussaoui
0a46ca67ec core: Include a small subset of xcursor in-tree
For a Wayland only build, we would like to avoid linking against
libXcursor which on it turn, links back to some of the X11 deps.
In order to achieve that, we include a small subset of xcursor.

In case Mutter is built with X11 or with both Wayland & X11, we link
against libXcursor and don't make use of the in-tree implementation.

This patch mimics what GTK 4 do by shipping an in-tree copy of xcursor.
Especially that libwayland-cursor does not provide an alternative to
xcursor itself.

Helps #2272

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3607>
2024-05-24 13:02:42 +00:00
Carlos Garnacho
69e791cda1 wayland: Implement the XDG dialog protocol
This protocol takes over some of our homegrown GTK Shell
protocol, allowing to specify hints on surfaces such as
dialog modality.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3557>
2024-05-22 10:42:20 +00:00
Mart Raudsepp
669d21daa2 x11: Drop obsolete libXrender dependency
It seems only the iconcache used to use it, but this is gone since
commit d16ddc42ce.
Even before that, the Xrender usage was removed in commit 556e7694de,
albeit leaving a redundant include <X11/extensions/Xrender.h> in its
place then, which comes from libXrender.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3716>
2024-04-22 10:16:31 +00:00
Jonas Ådahl
0b91d22848 common/cogl-drm-formats: Split out format to string helper
It means it can be included in places that assume cogl and everything it
involves shouldn't be included, e.g. meta-renderer-native-gles3.c.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3304>
2024-04-16 21:05:09 +00:00
Austin Shafer
e8b890ab53 wayland: Implement linux-drm-syncobj-v1
This implements the explicit sync protocol linux-drm-syncobj-v1. This
works by importing a DRM syncobj timeline and importing/exporting fds
to/from the sync points on the timeline corresponding to buffer acquire
and release. We take fds for sync points provided during a surface
commit and use them to delay transaction application, and fetch fds
from Cogl to signal when we are done using a particular buffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:28:08 -04:00
Austin Shafer
7ca01867f7 wayland: Add linux-drm-syncobj v1 to build
This adds the explicit sync wayland protocol to the list of build
dependencies.

This adds a copy of the linux-drm-syncobj protocol that we will use
privately for builds. This avoids the pain of requiring wayland-protocols
1.34 for distros. This commit can be reverted once we want to use
linux-drm-syncobj from the system wayland-protocols.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:27:42 -04:00
Austin Shafer
8e9f01d1ce wayland: Add MetaDrmTimeline
This abstracts away directly dealing with DRM syncobjs. Explicit
sync code can simply create a MetaDrmTimeline and request an fd at
a particular sync point.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3300>
2024-03-28 13:27:42 -04:00
Zander Brown
6a445d2eef build: Make exported package in gir consistent
Additionally Cogl was missing xlib as an include

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1918>
2024-03-13 12:52:41 +00:00
Marco Trevisan (Treviño)
839158ffd5 build/meta: Add explicit dependency on Gio-2.0 gir
We depend on Gio for many introspection features (GSettings, GFile...)
without this we'd end up not having many symbols being exposed.

And errors such as
  Warning: Meta: meta_display_add_keybinding: argument settings:
    Unresolved type: 'GSettings*'

As per previous commit we now have this dependency implicitly, but still
it's better to make it clearer in case Clutter would drop it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3620>
2024-02-27 10:35:06 +01:00
Carlos Garnacho
a2c11f0e87 wayland: Introduce MetaWaylandInput/MetaWaylandEventInterface
MetaWaylandInput is an object that will become in charge of handling
input events on their way to the Wayland socket. It keeps a stack
of event handlers, and propagates events and changes across them in
order to have them emit Wayland events, or change focus.

Each of these event handlers has a MetaWaylandEventInterface, this
is a vtable meant to replace MetaWaylandPointerGrabInterface and
MetaWaylandKeyboardGrabInterface in an unified manner, with the
following methods:

- get_focus_surface: to return the focus surface for a device/sequence.
  Since several handlers will want to delegate logic on previous
  handlers, it is optional to chain up with
  meta_wayland_event_handler_chain_up_get_focus_surface().
- focus: To trigger a focus change for a device/sequence, since
  event handlers are daisy chained by default, it is mandatory to
  chain up with meta_wayland_event_handler_chain_up_focus(), either
  with the given surface, or passing NULL to let later handlers
  unset their state.
- press/motion/release: Unified handlers for pointer/touch/stylus
  input, they chain up like event handlers do.
- key: Key event handler, propagates like event handlers do.
- other: Fallthrough for other events (pad, scroll, ...), propagates
  like event handlers do.

Since there is a variety of expected behaviors, and the possibility
of stacking for some of the existing Wayland "grabs", this provides
the mechanism for that to happen.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
2024-02-13 01:01:48 +01:00
Bilal Elmoussaoui
a2397e6b80 clutter: Prefer using ClutterTextDirection
In various public APIs, Clutter used to return a PangoDirection
while we have a text direction enum defined in Clutter.

This allows us to drop pango dependency from meta making it specific
to cogl-pango & clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3531>
2024-01-22 15:02:33 +00:00
Robert Mader
8b1015a5c7 wayland: Switch to stable linux-dmabuf protocol
It is the first protocol to keep the `-vN-` despite being declared
stable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3450>
2024-01-22 14:20:30 +00:00
Sebastian Wick
41a7e8e3e0 build: Make g-ir-scanner warnings fatal when -werror is set
This should help catching problems with introspection in CI.

This also pulls out some common arguments to the gnome.generate_gir
call.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3528>
2024-01-17 09:26:00 +00:00
Bilal Elmoussaoui
94f9d88371 x11: Drop error trap helpers
They are no longer that useful as they end up calling
mtk functions nowadays

Followup of https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3230

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3483>
2024-01-10 13:58:18 +00:00
Bilal Elmoussaoui
2a75661883 region: Move RegionBuilder to Mtk
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3501>
2024-01-09 18:47:34 +00:00
Bilal Elmoussaoui
ad49ecccf7 compositor: Drop unused private functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3492>
2024-01-09 13:14:35 +00:00
Peter Hutterer
414357a70f backends/native: Restore the ClutterBezier code to here
The ClutterBezier code was removed in
    580d62b9b clutter: Remove unused Path related types
because it wasn't used anywhere. We do need a bezier curve for the
tablet tool pressure curve calculation though so let's move it
to the native backend and rename it to MetaBezier in the process.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3399>
2024-01-05 10:21:42 +00:00
Florian Müllner
d16ddc42ce x11: Remove icon cache
We stopped reading window icons, so there's nothing to cache
anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3452>
2023-12-15 14:14:33 +00:00
Jonas Ådahl
adc5489ba7 Add debug controller
The debug controller can optionally, when passing --debug-control,
enable manipulating debug state, so far enabling/disabling HDR, via
D-Bus.

It's always created, in order to have a place to store debug state and
emit signals etc when it changes, but so far, it doesn't have its own
state it tracks, it just mirrors that of the monitor manager.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3432>
2023-12-01 14:25:08 +00:00
Jonas Ådahl
d5253b1385 build: Make input-capture use declarative D-Bus code generation
This was cleaned up, but a input capture rebased didn't port to the new
way of declaring what D-Bus protocol files that should go through code
generation.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3432>
2023-12-01 14:25:08 +00:00
Bilal Elmoussaoui
371d28a766 cleanup: Stop allowing deprecated Cogl API usage
Allow only specific files to use those deprecated APIs making
it easier to find where deprecated APIs are still in use
and avoid introducing new usages without being noticed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3400>
2023-11-15 13:13:00 +01:00
Bilal Elmoussaoui
7de0707dfa clutter/cleanup: Stop disabling deprecated API usage warnings
As we have stopped using the deprecated APIs all over clutter, so let us
enforce that newly introduced code doesn't use code that gets depreccated
in the future

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3400>
2023-11-15 13:12:13 +01:00
Bilal Elmoussaoui
8a3181f741 clutter: Make json-glib a debug only dependency
Currently, json-glib is used for two things:
- For loading scripts, nothing seems to use that in real life other
than some tests
- For debugging paint nodes

For now, the PR drops the first use case and only require json-glib
if it is a debug build

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3354>
2023-11-14 16:13:18 +01:00
Corentin Noël
a772c709aa wayland/surface: Make MetaWaylandSurface public
Only expose the method to get the associated MetaWindow.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3340>
2023-11-04 01:12:11 +00:00
Bilal Elmoussaoui
c79332a5f8 build: Remove no longer existing config options
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3349>
2023-11-03 11:36:07 +00:00
Bilal Elmoussaoui
7a6a821ed0 cogl: Drop unnused experimental API config
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3349>
2023-11-03 11:36:07 +00:00
Bilal Elmoussaoui
8ae7ec08b4 mutter: Explicitly depend on gdk-pixbuf
As it is used by MetaBackgroundImageCache

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3097>
2023-10-23 16:32:35 +00:00
Jonas Ådahl
271fb86b15 eis: Add "viewport" interface
A MetaEisViewport represents an absolute region backend by e.g. a
pointer device. There are two kinds: a standalone viewport, which
corresponds to a viewport that has no neighbours, and a non-standalone,
which represents a region of a global coordinate space.

The reason for having non-standalone viewports is to allow to mirror the
logical monitor layout of a desktop, while the standalone are meant to
represent things that are not part of the logical monitor layout.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3228>
2023-09-01 10:43:26 +00:00
Bilal Elmoussaoui
918ae0f4d4 mutter: Replace cairo_rectangle_int_t with MtkRectangle
Note: the various helpers in boxes.c were not ported yet, see the next
commit. This was intentionally done to simplify the porting process

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
2023-08-30 16:46:13 +02:00
Charbel Assaad
388b534062 wayland: Implement idle inhibit protocol
This is based on the original work done by:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/111

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/20
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3145>
2023-08-26 20:19:22 +02:00
Jonas Ådahl
9a2c8b2592 window: Add suspend state
The 'suspend state' is meant to track whether a window is likely to be
visible any time soon. The hueristics for this are as follows:

 * If a window is hidden, it will enter the 'hidden' state.
 * If a window is visible, and unobscured, it will enter the 'active'
   state.
 * If a window is visible, but obscured by another window, it will enter
   the 'hidden' state.
 * If there is a mapped clone of a window, it will enter the 'active'
   state.
 * If the window has been in the 'hidden' state for 3 seconds, it will
   enter the 'suspended' state.

This will eventually be communicated to Wayland clients so that they can
change their behaviour to e.g. save power.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3019>
2023-08-24 19:57:58 +00:00
Bilal Elmoussaoui
f2f9e63568 build/gi: Set header & pkgconfig names
So that the docs generated by gi-docgen contains them

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3087>
2023-08-12 19:34:20 +00:00
Niels De Graef
5181a826d1 compositor: Add MetaMultiTexture class
In future commits, we want to be able to handle more complex textures,
such as video frames which are encoded in a YUV-pixel format and have
multiple planes (which each map to a separate texture).

To accomplish this, we introduce a new object `MetaMultiTexture`: this
object can deal with more complex formats by handling multiple
`CoglTexture`s.

It supports shaders for pixel format conversion from YUV to RGBA, as
well as blending. While custom bleding is currently only required for
YUV formats, we also implement it for RGB ones. This allows us to
simplify code in other places and will be needed in the future once
we want to support blending between different color spaces.

Co-Authored-By: Robert Mader <robert.mader@collabora.com>
Co-Authored-By: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2191>
2023-07-25 21:24:35 +00:00
Jonas Ådahl
e96475bb8d build: Use correct variable for gathering built headers
We added things unused variable, which is a bit useless.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3131>
2023-07-21 07:59:54 +00:00
Robert Mader
192d6686cf backend/cogl-utils: Move, rename to cogl-drm-formats and clean up
1. Move into the new 'common' folder and build for Wayland as well
   so we will be able to share the code in follow-up commits.

2. Rename to cogl-drm-formats to make it more obvious that the format
   map is more than an utility these days.

3. Drop the unused CoglTextureComponents part (see also previous
   commit).

4. Move the map to the header, simplifying some future use-cases.

5. Sync formats with MetaWaylandBuffer and MetaWaylandDmaBufBuffer and
   also use newly introduced opaque formats where appropriate.
   This avoids duplicated code, ensures that new drm-formats added to
   the dmabuf protocol have an adequate representation in Cogl from which
   information like alpha support can be easily derived and finally
   ensures we don't crash if the mappings got out of sync.

6. Remove some likely untested formats. In case some of these are
   actually needed on certain hardware, we can test whether we got
   the correct mapping by also adding support for the corresponding
   wl_shm_format in MetaWaylandBuffer by extending the gradient test in
   https://gitlab.freedesktop.org/jadahl/wayland-test-clients

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3065>
2023-07-19 10:39:55 +00:00
Jonas Ådahl
6d873036e0 Add KMS cursor manager
This new manager object intends to take over management of the cursor
plane from the native cursor renderer. It's API is intended to be used
from the main thread, except for the _in_input() function, but mainly
operates in the KMS context, i.e. the KMS thread.

It makes use of an "update filter" that is called before each
MetaKmsUpdate is turned into a atomic KMS commit or a set of legacy
drmMode*() API calls. When the cursor position has been invalidated,
it'll assign the cursor plane in the filter callback, using an as up to
date as possible pointer position as the source for the cursor plane
position.

Cursor updates from the input thread schedules updates for the affected
CRTCs which will cause the filter to be run, potentially for cursor-only
commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-18 23:51:34 +02:00
Jonas Ådahl
8b612a6150 thread: Introduce kernel thread support
This commit makes it possible to create a MetaThread where the
MetaThreadImpl side runs in a real thread, instead of a artificially
separated impl context.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
2023-07-17 12:51:36 +02:00