1
0
Fork 0
Commit graph

28198 commits

Author SHA1 Message Date
Jonas Ådahl
d459df9a28 tests/test-client: Log to stderr
The test-client reports command results to stdout, so make sure to log
e.g. debug messages to stderr, so they don't interfere with the result
test-runner reads.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/450
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2095>
2021-12-07 18:15:06 +00:00
Carlos Garnacho
c07c50d189 wayland: Make the pointer leave non-alive surfaces
Listen to changes in MetaWindow::is-alive, so that the pointer
can logically leave the surface as soon as that happens. This
helps prevent flooding the client socket while it is stalled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2122>
2021-12-07 17:15:21 +00:00
Carlos Garnacho
26676a829e core: Change behavior of "application is alive" checks
Change some things in these "app is alive" checks:
- The dialog timeout is separated from the ping timeout, in order
  to show it again at a constant rate after dismissing, despite in
  flight pings. It still shows immediately after the first failed
  ping.
- As we want to tap further into is-alive logic, MetaWindow now
  made it a property, that other places in code can fetch and
  subscribe.
- Motion events trigger ping (as long as there was none other in
  flight for the same window), and are counted between ping and
  pong, in order to preemptively declare the window as not alive
  before there is trouble with event queues being overflown.

This results in a separate logic between "the application does
not respond" and "we are showing the close dialog" so that the
former may get triggered independently.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2122>
2021-12-07 17:15:21 +00:00
Jonas Ådahl
29141afd0f xwayland: Handle the died callback being cancelled more gracefully
If we were cancelled, it could mean we teared down, meaning fetching
manager instances will attempt to fetch past freed instances. Handle
this by waiting with the fetching until we know we weren't cancelled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2140>
2021-12-07 16:38:20 +00:00
Jonas Ådahl
ad0d70d5d5 wayland: Detach event source on tear down
No reason keeping it attached; would one continue using a main loop on
the default main context after tear down, we'd get callbacks causing
use-after-free issues.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2140>
2021-12-07 16:38:20 +00:00
Joan Torres
754c834590 Add method to show if in headless mode
MetaBackend can now show whether it is in headless mode or not
using a vfunc is_headless.

Fallback of is_headless returns FALSE.

MetaBackendNative implements is_headless returning its
is_headless property.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2130>
2021-12-07 16:03:10 +00:00
Fernando Monteiro
44aa6ab735 cogl: Remove cogl_texture_new_with_size
Replace the deprecated function with the suggested alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
612da58c72 cogl: Remove cogl_texture_new_from_sub_texture
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
0c5cf1ec58 tests: Rename 'material' variables to 'pipeline'
This should replace all usages of the material variable to
the pipeline variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
9f9e64f077 cogl: Remove cogl_material_new
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
6cd4489e55 cogl: Remove cogl_material_set_color
This is unused anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
edae2fff72 cogl: Remove cogl_material_set_color4ub
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
5a5f57d533 cogl: Remove cogl_material_set_alpha_test_function
This is unused anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
afdbb71926 cogl: Remove cogl_material_set_blend
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
f90f8f84c3 cogl: Remove cogl_material_set_blend_constant
This is unused anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
403f44e7b0 cogl: Remove cogl_material_set_user_program
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
06de4e241d cogl: Remove cogl_pipeline_set_point_size
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
a14d3d6e17 cogl: Remove cogl_pipeline_set_layer
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
68ec76e4ee cogl: Remove cogl_pipeline_set_layer_combine
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
a8cd59e029 cogl: Remove cogl_material_set_layer_combine_constant
This is unused anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
ca25c5543a cogl: Remove cogl_material_set_layer_matrix
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
29c62fabac cogl: Remove cogl_material_set_layer_point_sprite_coords_enabled
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
8285091585 cogl: Remove material_set_layer_filters
This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
913458381f cogl: Remove usages of framebuffer_draw_primitive
We were already returning cogl_primitive_draw in framebuffer_draw_primitive,
so replace all usages and remove it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
b8925ef3d4 cogl: Remove deprecated backface_culing API
They are unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Fernando Monteiro
74fe57b018 cogl: Remove deprecated depth_test API
They are unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
2021-12-07 15:32:21 +00:00
Carlos Garnacho
67a27a82d9 backends: Do not exclude devices from an output based on capability
This is a strange thing to do since MetaInputMapper also does take care of
devices with an output configured through settings, since we might have
devices that were configure through settings exclude other devices that
belong together with an output (e.g. a display-integrated tablet).

This was essentially here as a last resort to avoid matching two very
similar looking tablets to one of two very similar looking outputs. There
was a 50% chance already that the choice was wrong, and now these devices
can all be configured specifically through settings, so this shouldn't
be missed either.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2107>
2021-12-07 14:59:57 +00:00
Carlos Garnacho
e3702c8b9a backends: Only default to builtin panel on touchscreen devices
Non-display-attached tablets (e.g. Intuos) may find no match, which
should mean "use the span of all monitors", not "pick one for me".
Reserve this fallback to touchscreen devices, since these might
still benefit from it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2107>
2021-12-07 14:59:57 +00:00
Carlos Garnacho
04eda556e7 backends: Do not emit pointless signals remapping pad devices
The matrix and aspect ratio of the tablet is irrelevant on pads, and
it actually triggers warnings when trying change that on those devices:

gnome-shell:42536): mutter-CRITICAL **: 17:22:41.994: meta_input_device_native_get_mapping_mode_in_impl: assertion 'device_type == CLUTTER_TABLET_DEVICE || device_type == CLUTTER_PEN_DEVICE || device_type == CLUTTER_ERASER_DEVICE' failed

This is unnecessary to do on pad devices, these just need to be moved
together with their respective stylus.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2107>
2021-12-07 14:59:57 +00:00
Carlos Garnacho
f2154ceaad clutter: Always snoop key events for a11y
In the case a11y is required, the screen reader is very much
interested in getting an uninterrupted flow of key events. It attempts
so by setting a ::captured-event callback on the ClutterStage, but
that falls short with our MetaDisplay event handler, as clutter events
can be stopped before a11y gets a chance to see them.

This kind of selective amnesia wrt key events is not new, in X11 those
go unheard of by the WM as long as a client is focused and no grabs hold,
so it is clients' responsibility to talk with AT bridge.

This commit doesn't yet change that for X11, but we can do this right
away from the compositor on Wayland, and without any chance to be
tampered by clients.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1328>
2021-12-07 14:29:18 +00:00
Erik Massop
7bb0055acd plugins/default: Use local vars for refs
Since the completion callback (on_switch_workspace_effect_complete) sets
priv->tml_switch_workspace1 to NULL, the unref was trying to unref NULL,
and the reffed ClutterTimeline was not getting unreffed.

This could be triggered by rapidly switching workspaces, switching again
before the animation of the initial switch was done.

Found while working on #2038.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2120>
2021-12-07 13:57:58 +00:00
Pascal Nowack
d5f2ec6f1e backends/native: Stop freeing slow keys list twice
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1225
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2138>
2021-12-07 09:35:26 +01:00
Jonas Ådahl
65d8164833 backend: Expose get_monitor_manager() publicly
So that it can eventually replace the standalone singleton getter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2128>
2021-12-03 15:43:40 +00:00
Jonas Ådahl
5afe51b143 monitor-manager: Add 'has-builtin-panel' property
Will be TRUE if there are any built in panels. Can for example be used
to determine whether a machine is a laptop or a desktop computer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2128>
2021-12-03 15:43:40 +00:00
Jonas Ådahl
a6644adc28 mutter: Add missing newline in error messages
It's using g_printerr() which isn't like g_message()/g_warning() and
friends that expect no newline in the end.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2133>
2021-12-03 15:47:12 +01:00
JoseExposito
8d34b50918 wayland/pointer-gestures: Implement hold gesture
Update the pointer gestures protocol to version 3 and implement the new
hold gesture.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
c545ffac43 wayland/pointer-gestures: Update protocol to v2
Update the pointer gestures protocol to version 2 and implement the new
release method.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
d4ba16252b backends/native/meta-seat: Capture hold events
Receive hold gesture events from libinput and enqueue them as Clutter
events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
d6dd105cfb tests/clutter: Add hold event conform tests
Add tests to check that	the hold events recieved by actors have the
required properties.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
dca9d57eea tests/clutter: Add hold event to existing test
Add CLUTTER_TOUCHPAD_HOLD to existing interactive tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
af1f3304e4 clutter/event: Add ClutterEventType.CLUTTER_TOUCHPAD_HOLD
Add a enum for hold gestures in ClutterEventType as well as the
required functions to get information about the event: coordinates,
finger count, event phase, etc.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
JoseExposito
aa5569356e clutter/event: Add touchpad hold event definition
Add new Clutter event (ClutterTouchpadHoldEvent) with the required data to
represent a hold event.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
José Expósito
b241d32916 meson: Bump wayland-protocols to version 1.23
This release adds hold gestures to the pointer gesture protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
José Expósito
09a4fad33d meson: Bump libinput to version 1.19
libinput 1.19 includes hold gestures and high-resolution scroll wheel
support.

Required for !1830 and !1962.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
José Expósito
c3087dae7d ci: Install libinput and wayland-protocols from git
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1830>
2021-12-02 20:48:24 +00:00
Jonas Ådahl
7b83735aea wayland/output: Always set xdg_output interface implementation
This avoids the following crash, that could happen in certain rare race
conditions, e.g. in tests:

  0) wl_closure_invoke (closure=0x2fbf9e0, target=0x2e5b3d0, opcode=0)
     at ../src/connection.c:1014
  1) wl_client_connection_data () at ../src/wayland-server.c:432
  2) wl_event_loop_dispatch () at ../src/event-loop.c:1027
  3) wayland_event_source_dispatch () at ../src/wayland/meta-wayland.c:104
  4) g_main_dispatch () at ../glib/gmain.c:3381

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2127>
2021-12-02 20:07:49 +00:00
Jonas Ådahl
50ccab567f util: Add back topic prefix to meta_topic() messages
Was lost when changing to use g_message(); lets add it back.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2125>
2021-12-01 19:37:59 +00:00
Carlos Garnacho
fa31c97aec stack: Add prerequisites to some stack API
Passing a NULL workspace does not make sense, since it silently
returns no windows. Mandate that a workspace is explicitly requested,
and while at it check the other arguments as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2124>
2021-12-01 15:39:34 +01:00
Carlos Garnacho
e74e8061a4 wayland: Specify workspace when looking for Xdnd drop target
The meta_stack_get_default_focus_window_at_point() function started silently
requiring a workspace, returning always NULL otherwise. Specify the current
workspace here.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2042
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2124>
2021-12-01 15:39:08 +01:00
Corentin Noël
62ab4c09d9 clutter/actor: Add missing nullable annotations
Also change all the deprecated allow-none into optional or nullable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2108>
2021-11-26 17:30:35 +00:00