Compare commits
10 Commits
39983bf50e
...
f40
| Author | SHA1 | Date | |
|---|---|---|---|
| 83a5d4f291 | |||
|
|
b7c11af27a | ||
|
|
8257e45aa4 | ||
|
|
644ecca570 | ||
|
|
10239b34d6 | ||
|
|
607dafd7fd | ||
|
|
ff18137761 | ||
|
|
f5f9e8294d | ||
|
|
701f786699 | ||
|
|
364be54ebb |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -218,3 +218,8 @@ mutter-2.31.5.tar.bz2
|
|||||||
/mutter-46.alpha.tar.xz
|
/mutter-46.alpha.tar.xz
|
||||||
/mutter-46.beta.tar.xz
|
/mutter-46.beta.tar.xz
|
||||||
/mutter-46.rc.tar.xz
|
/mutter-46.rc.tar.xz
|
||||||
|
/mutter-46.0.tar.xz
|
||||||
|
/mutter-46.1.tar.xz
|
||||||
|
/mutter-46.2.tar.xz
|
||||||
|
/mutter-46.3.tar.xz
|
||||||
|
/mutter-46.3.1.tar.xz
|
||||||
|
|||||||
@@ -1,8 +1,123 @@
|
|||||||
From 1d5c47f8970c2027de5f6fa49b84de73d55b419b Mon Sep 17 00:00:00 2001
|
From caca4ecbc4657998b4f9f3192afbd234f336402c Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||||
|
Date: Sun, 26 May 2024 00:43:37 +0200
|
||||||
|
Subject: [PATCH 1/3] Revert "x11/window: Compare input shape to client rect
|
||||||
|
when undecorating"
|
||||||
|
|
||||||
|
This reverts commit d8af06fe4993227c5059971effbe28527cd75412.
|
||||||
|
---
|
||||||
|
src/x11/window-x11.c | 16 +++++++++-------
|
||||||
|
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
|
||||||
|
index df5f955877..925c7549b7 100644
|
||||||
|
--- a/src/x11/window-x11.c
|
||||||
|
+++ b/src/x11/window-x11.c
|
||||||
|
@@ -2400,7 +2400,6 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
||||||
|
g_autoptr (MtkRegion) region = NULL;
|
||||||
|
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||||
|
MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
|
||||||
|
- MtkRectangle bounding_rect = { 0 };
|
||||||
|
Window xwindow;
|
||||||
|
|
||||||
|
if (window->decorated)
|
||||||
|
@@ -2412,14 +2411,10 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
xwindow = window->frame->xwindow;
|
||||||
|
- bounding_rect.width = window->buffer_rect.width;
|
||||||
|
- bounding_rect.height = window->buffer_rect.height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xwindow = priv->xwindow;
|
||||||
|
- bounding_rect.width = priv->client_rect.width;
|
||||||
|
- bounding_rect.height = priv->client_rect.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
|
||||||
|
@@ -2463,8 +2458,8 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
||||||
|
else if (n_rects == 1 &&
|
||||||
|
(rects[0].x == 0 &&
|
||||||
|
rects[0].y == 0 &&
|
||||||
|
- rects[0].width == bounding_rect.width &&
|
||||||
|
- rects[0].height == bounding_rect.height))
|
||||||
|
+ rects[0].width == window->buffer_rect.width &&
|
||||||
|
+ rects[0].height == window->buffer_rect.height))
|
||||||
|
{
|
||||||
|
/* This is the bounding region case. Keep the
|
||||||
|
* region as NULL. */
|
||||||
|
@@ -2481,6 +2476,13 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
||||||
|
|
||||||
|
if (region != NULL)
|
||||||
|
{
|
||||||
|
+ MtkRectangle bounding_rect;
|
||||||
|
+
|
||||||
|
+ bounding_rect.x = 0;
|
||||||
|
+ bounding_rect.y = 0;
|
||||||
|
+ bounding_rect.width = window->buffer_rect.width;
|
||||||
|
+ bounding_rect.height = window->buffer_rect.height;
|
||||||
|
+
|
||||||
|
/* The shape we get back from the client may have coordinates
|
||||||
|
* outside of the frame. The X SHAPE Extension requires that
|
||||||
|
* the overall shape the client provides never exceeds the
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
||||||
|
|
||||||
|
From 2b7161220cb95a1d531ef0cf8a8af911039cf194 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||||
|
Date: Sun, 21 Apr 2024 16:54:52 +0200
|
||||||
|
Subject: [PATCH 2/3] Revert "x11/window: Update comment and variable name to
|
||||||
|
reflect current behavior"
|
||||||
|
|
||||||
|
This reverts commit e4763d00e8512aeb408ae118597d753f12217487.
|
||||||
|
---
|
||||||
|
src/x11/window-x11.c | 15 ++++++++-------
|
||||||
|
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
|
||||||
|
index 925c7549b7..7f2c0a3fd2 100644
|
||||||
|
--- a/src/x11/window-x11.c
|
||||||
|
+++ b/src/x11/window-x11.c
|
||||||
|
@@ -2476,20 +2476,21 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
||||||
|
|
||||||
|
if (region != NULL)
|
||||||
|
{
|
||||||
|
- MtkRectangle bounding_rect;
|
||||||
|
+ MtkRectangle client_area;
|
||||||
|
|
||||||
|
- bounding_rect.x = 0;
|
||||||
|
- bounding_rect.y = 0;
|
||||||
|
- bounding_rect.width = window->buffer_rect.width;
|
||||||
|
- bounding_rect.height = window->buffer_rect.height;
|
||||||
|
+ client_area.x = 0;
|
||||||
|
+ client_area.y = 0;
|
||||||
|
+ client_area.width = window->buffer_rect.width;
|
||||||
|
+ client_area.height = window->buffer_rect.height;
|
||||||
|
|
||||||
|
/* The shape we get back from the client may have coordinates
|
||||||
|
* outside of the frame. The X SHAPE Extension requires that
|
||||||
|
* the overall shape the client provides never exceeds the
|
||||||
|
* "bounding rectangle" of the window -- the shape that the
|
||||||
|
- * window would have gotten if it was unshaped.
|
||||||
|
+ * window would have gotten if it was unshaped. In our case,
|
||||||
|
+ * this is simply the client area.
|
||||||
|
*/
|
||||||
|
- mtk_region_intersect_rectangle (region, &bounding_rect);
|
||||||
|
+ mtk_region_intersect_rectangle (region, &client_area);
|
||||||
|
}
|
||||||
|
|
||||||
|
meta_window_set_input_region (window, region);
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
||||||
|
|
||||||
|
From 256a879b7e230e8e9826be6e0df69feb31cbdd52 Mon Sep 17 00:00:00 2001
|
||||||
From: Adam Williamson <awilliam@redhat.com>
|
From: Adam Williamson <awilliam@redhat.com>
|
||||||
Date: Thu, 5 Oct 2023 13:09:46 -0700
|
Date: Thu, 5 Oct 2023 13:09:46 -0700
|
||||||
Subject: [PATCH] Revert "x11: Use input region from frame window for decorated
|
Subject: [PATCH 3/3] Revert "x11: Use input region from frame window for
|
||||||
windows"
|
decorated windows"
|
||||||
|
|
||||||
This reverts commit d991961ae2a5c8cf2e58ff1072239f4902b0f767. It
|
This reverts commit d991961ae2a5c8cf2e58ff1072239f4902b0f767. It
|
||||||
seems to cause the broken mouse interaction bug reported in
|
seems to cause the broken mouse interaction bug reported in
|
||||||
@@ -15,28 +130,28 @@ Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3068
|
|||||||
2 files changed, 10 insertions(+), 26 deletions(-)
|
2 files changed, 10 insertions(+), 26 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/core/frame.c b/src/core/frame.c
|
diff --git a/src/core/frame.c b/src/core/frame.c
|
||||||
index 145f0b7bd7..1c90ce4231 100644
|
index 7a09f89f14..df489e441c 100644
|
||||||
--- a/src/core/frame.c
|
--- a/src/core/frame.c
|
||||||
+++ b/src/core/frame.c
|
+++ b/src/core/frame.c
|
||||||
@@ -35,7 +35,6 @@
|
@@ -36,7 +36,6 @@
|
||||||
#include "x11/window-props.h"
|
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
-#include <X11/extensions/shape.h>
|
-#include <X11/extensions/shape.h>
|
||||||
|
|
||||||
#define EVENT_MASK (SubstructureRedirectMask | \
|
#define EVENT_MASK (SubstructureRedirectMask | \
|
||||||
StructureNotifyMask | SubstructureNotifyMask | \
|
StructureNotifyMask | SubstructureNotifyMask | \
|
||||||
@@ -109,9 +108,6 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window,
|
@@ -118,9 +117,6 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window,
|
||||||
XChangeWindowAttributes (x11_display->xdisplay,
|
XChangeWindowAttributes (x11_display->xdisplay,
|
||||||
frame->xwindow, CWEventMask, &attrs);
|
frame->xwindow, CWEventMask, &attrs);
|
||||||
|
|
||||||
- if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
|
- if (META_X11_DISPLAY_HAS_SHAPE (x11_display))
|
||||||
- XShapeSelectInput (x11_display->xdisplay, frame->xwindow, ShapeNotifyMask);
|
- XShapeSelectInput (x11_display->xdisplay, frame->xwindow, ShapeNotifyMask);
|
||||||
-
|
-
|
||||||
meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
|
if (mtk_x11_error_trap_pop_with_return (x11_display->xdisplay))
|
||||||
|
{
|
||||||
if (window->mapped)
|
meta_topic (META_DEBUG_WINDOW_STATE,
|
||||||
@@ -220,9 +216,6 @@ meta_window_destroy_frame (MetaWindow *window)
|
@@ -254,9 +250,6 @@ meta_window_destroy_frame (MetaWindow *window)
|
||||||
window->reparents_pending += 1;
|
window->reparents_pending += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +162,7 @@ index 145f0b7bd7..1c90ce4231 100644
|
|||||||
meta_window_x11_get_xwindow (window),
|
meta_window_x11_get_xwindow (window),
|
||||||
x11_display->atom__MUTTER_NEEDS_FRAME);
|
x11_display->atom__MUTTER_NEEDS_FRAME);
|
||||||
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
|
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
|
||||||
index 745c45db18..8edff883c9 100644
|
index 7f2c0a3fd2..ace1f8f5bc 100644
|
||||||
--- a/src/x11/window-x11.c
|
--- a/src/x11/window-x11.c
|
||||||
+++ b/src/x11/window-x11.c
|
+++ b/src/x11/window-x11.c
|
||||||
@@ -2082,10 +2082,6 @@ meta_window_x11_constructed (GObject *object)
|
@@ -2082,10 +2082,6 @@ meta_window_x11_constructed (GObject *object)
|
||||||
@@ -111,5 +226,5 @@ index 745c45db18..8edff883c9 100644
|
|||||||
/* The shape we get back from the client may have coordinates
|
/* The shape we get back from the client may have coordinates
|
||||||
* outside of the frame. The X SHAPE Extension requires that
|
* outside of the frame. The X SHAPE Extension requires that
|
||||||
--
|
--
|
||||||
2.43.2
|
2.45.2
|
||||||
|
|
||||||
|
|||||||
424
3642.patch
424
3642.patch
@@ -1,424 +0,0 @@
|
|||||||
From 7aebc9e63d6551a3e12cf6da1d9da4253c116e71 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Carlos Garnacho <carlosg@gnome.org>
|
|
||||||
Date: Tue, 5 Mar 2024 12:51:30 +0100
|
|
||||||
Subject: [PATCH 1/4] clutter: Pass scroll source to discrete events
|
|
||||||
|
|
||||||
This piece of information was lost, always returning
|
|
||||||
"unknown". We can do better on the native backend.
|
|
||||||
|
|
||||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
|
|
||||||
---
|
|
||||||
clutter/clutter/clutter-event-private.h | 1 +
|
|
||||||
clutter/clutter/clutter-event.c | 2 ++
|
|
||||||
src/backends/native/meta-seat-impl.c | 1 +
|
|
||||||
src/backends/x11/meta-seat-x11.c | 1 +
|
|
||||||
4 files changed, 5 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/clutter/clutter/clutter-event-private.h b/clutter/clutter/clutter-event-private.h
|
|
||||||
index 35740c9b7ee..52c45163851 100644
|
|
||||||
--- a/clutter/clutter/clutter-event-private.h
|
|
||||||
+++ b/clutter/clutter/clutter-event-private.h
|
|
||||||
@@ -64,6 +64,7 @@ ClutterEvent * clutter_event_scroll_discrete_new (ClutterEventFlags flags,
|
|
||||||
ClutterInputDeviceTool *tool,
|
|
||||||
ClutterModifierType modifiers,
|
|
||||||
graphene_point_t coords,
|
|
||||||
+ ClutterScrollSource scroll_source,
|
|
||||||
ClutterScrollDirection direction);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
ClutterEvent * clutter_event_crossing_new (ClutterEventType type,
|
|
||||||
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
|
|
||||||
index 7723c85048b..d204574d0b9 100644
|
|
||||||
--- a/clutter/clutter/clutter-event.c
|
|
||||||
+++ b/clutter/clutter/clutter-event.c
|
|
||||||
@@ -2017,6 +2017,7 @@ clutter_event_scroll_discrete_new (ClutterEventFlags flags,
|
|
||||||
ClutterInputDeviceTool *tool,
|
|
||||||
ClutterModifierType modifiers,
|
|
||||||
graphene_point_t coords,
|
|
||||||
+ ClutterScrollSource scroll_source,
|
|
||||||
ClutterScrollDirection direction)
|
|
||||||
{
|
|
||||||
ClutterEvent *event;
|
|
||||||
@@ -2031,6 +2032,7 @@ clutter_event_scroll_discrete_new (ClutterEventFlags flags,
|
|
||||||
event->scroll.x = coords.x;
|
|
||||||
event->scroll.y = coords.y;
|
|
||||||
event->scroll.direction = direction;
|
|
||||||
+ event->scroll.scroll_source = scroll_source;
|
|
||||||
event->scroll.modifier_state = modifiers;
|
|
||||||
event->scroll.tool = tool;
|
|
||||||
|
|
||||||
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
|
|
||||||
index 87bf15c7b42..8bb9bd05eb2 100644
|
|
||||||
--- a/src/backends/native/meta-seat-impl.c
|
|
||||||
+++ b/src/backends/native/meta-seat-impl.c
|
|
||||||
@@ -990,6 +990,7 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
|
|
||||||
NULL,
|
|
||||||
modifiers,
|
|
||||||
GRAPHENE_POINT_INIT (x, y),
|
|
||||||
+ scroll_source,
|
|
||||||
direction);
|
|
||||||
|
|
||||||
queue_event (seat_impl, event);
|
|
||||||
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
|
|
||||||
index 0560a0d77d3..e76a9d0467a 100644
|
|
||||||
--- a/src/backends/x11/meta-seat-x11.c
|
|
||||||
+++ b/src/backends/x11/meta-seat-x11.c
|
|
||||||
@@ -2378,6 +2378,7 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
|
|
||||||
tool,
|
|
||||||
state,
|
|
||||||
GRAPHENE_POINT_INIT (x, y),
|
|
||||||
+ CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
|
||||||
scroll_direction);
|
|
||||||
|
|
||||||
g_debug ("scroll: win:0x%x, device:%d '%s', time:%d "
|
|
||||||
--
|
|
||||||
GitLab
|
|
||||||
|
|
||||||
|
|
||||||
From ddc76d878e937665f90a9a35c87229f9711a91b8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Carlos Garnacho <carlosg@gnome.org>
|
|
||||||
Date: Tue, 5 Mar 2024 13:30:24 +0100
|
|
||||||
Subject: [PATCH 2/4] wayland: Fix handling of non-v120 discrete events on
|
|
||||||
wl_seat >= v8
|
|
||||||
|
|
||||||
Unveiled by commit e0c4b2b241 ("backends/native: Mark the emulated smooth
|
|
||||||
scroll event as such"). The sudden "lack" of smooth scroll events (Used by
|
|
||||||
Clutter to forward v120 events) made it evident we silently ignore Clutter
|
|
||||||
discrete events, as we don't send wl_pointer.axis_value120 for these.
|
|
||||||
|
|
||||||
Fix this by assigning a value120 value to discrete scroll events. This
|
|
||||||
makes wl_pointer.axis_value120 events actually sent on non-v120 mice.
|
|
||||||
|
|
||||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
|
|
||||||
---
|
|
||||||
src/wayland/meta-wayland-pointer.c | 44 +++++++++++++++++++-----------
|
|
||||||
1 file changed, 28 insertions(+), 16 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
|
|
||||||
index bbff7e2565e..81db9e4f54b 100644
|
|
||||||
--- a/src/wayland/meta-wayland-pointer.c
|
|
||||||
+++ b/src/wayland/meta-wayland-pointer.c
|
|
||||||
@@ -748,24 +748,28 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
is_discrete_event = TRUE;
|
|
||||||
y_value = -DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
y_discrete = -1;
|
|
||||||
+ y_value120 = y_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_DOWN:
|
|
||||||
is_discrete_event = TRUE;
|
|
||||||
y_value = DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
y_discrete = 1;
|
|
||||||
+ y_value120 = y_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_LEFT:
|
|
||||||
is_discrete_event = TRUE;
|
|
||||||
x_value = -DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
x_discrete = -1;
|
|
||||||
+ x_value120 = x_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_RIGHT:
|
|
||||||
is_discrete_event = TRUE;
|
|
||||||
x_value = DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
x_discrete = 1;
|
|
||||||
+ x_value120 = x_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_SMOOTH:
|
|
||||||
@@ -805,19 +809,23 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
/* X axis */
|
|
||||||
if (client_version >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
- if (is_value120_event && x_value120 != 0)
|
|
||||||
- wl_pointer_send_axis_value120 (resource,
|
|
||||||
- WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
- x_value120);
|
|
||||||
+ if (x_value120 != 0)
|
|
||||||
+ {
|
|
||||||
+ wl_pointer_send_axis_value120 (resource,
|
|
||||||
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
+ x_value120);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
send_axis_x = !is_discrete_event;
|
|
||||||
}
|
|
||||||
else if (client_version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
- if (is_discrete_event && x_discrete != 0)
|
|
||||||
- wl_pointer_send_axis_discrete (resource,
|
|
||||||
- WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
- x_discrete);
|
|
||||||
+ if (x_discrete != 0)
|
|
||||||
+ {
|
|
||||||
+ wl_pointer_send_axis_discrete (resource,
|
|
||||||
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
+ x_discrete);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
send_axis_x = !is_value120_event;
|
|
||||||
}
|
|
||||||
@@ -834,19 +842,23 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
/* Y axis */
|
|
||||||
if (client_version >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
- if (is_value120_event && y_value120 != 0)
|
|
||||||
- wl_pointer_send_axis_value120 (resource,
|
|
||||||
- WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
- y_value120);
|
|
||||||
+ if (y_value120 != 0)
|
|
||||||
+ {
|
|
||||||
+ wl_pointer_send_axis_value120 (resource,
|
|
||||||
+ WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
+ y_value120);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
send_axis_y = !is_discrete_event;
|
|
||||||
}
|
|
||||||
else if (client_version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
- if (is_discrete_event && y_discrete != 0)
|
|
||||||
- wl_pointer_send_axis_discrete (resource,
|
|
||||||
- WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
- y_discrete);
|
|
||||||
+ if (y_discrete != 0)
|
|
||||||
+ {
|
|
||||||
+ wl_pointer_send_axis_discrete (resource,
|
|
||||||
+ WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
+ y_discrete);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
send_axis_y = !is_value120_event;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
GitLab
|
|
||||||
|
|
||||||
|
|
||||||
From 39d8e44f5e17ee1204fac3048de4743bec3aa5e4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Carlos Garnacho <carlosg@gnome.org>
|
|
||||||
Date: Tue, 5 Mar 2024 13:39:17 +0100
|
|
||||||
Subject: [PATCH 3/4] wayland: Always send wl_pointer.axis after
|
|
||||||
.axis_value120/discrete
|
|
||||||
|
|
||||||
The wl_pointer.axis_discrete axis (applicable to wl_seat <= v8) is
|
|
||||||
meant to be sent together with wl_pointer.axis events in the same
|
|
||||||
frame. And the wl_pointer.axis_value120 event replaces it in
|
|
||||||
wl_seat >= v9, but has the same relation with the other information
|
|
||||||
available in a frame.
|
|
||||||
|
|
||||||
This emission should not be conditional to anything, so drop the
|
|
||||||
various checks leading to maybe sending wl_pointer.axis or not.
|
|
||||||
|
|
||||||
This fixes emission of wl_pointer.axis in conjunction with discrete
|
|
||||||
events, for some combinations of versions and (non)value120 mice.
|
|
||||||
|
|
||||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
|
|
||||||
---
|
|
||||||
src/wayland/meta-wayland-pointer.c | 21 +++------------------
|
|
||||||
1 file changed, 3 insertions(+), 18 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
|
|
||||||
index 81db9e4f54b..4d1971c3474 100644
|
|
||||||
--- a/src/wayland/meta-wayland-pointer.c
|
|
||||||
+++ b/src/wayland/meta-wayland-pointer.c
|
|
||||||
@@ -716,7 +716,6 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
int32_t x_value120 = 0, y_value120 = 0;
|
|
||||||
enum wl_pointer_axis_source source = -1;
|
|
||||||
MetaWaylandPointerClient *client;
|
|
||||||
- gboolean is_discrete_event = FALSE, is_value120_event = FALSE;
|
|
||||||
ClutterScrollFinishFlags finish_flags;
|
|
||||||
|
|
||||||
if (clutter_event_get_flags (event) & CLUTTER_EVENT_FLAG_POINTER_EMULATED)
|
|
||||||
@@ -745,28 +744,24 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
switch (clutter_event_get_scroll_direction (event))
|
|
||||||
{
|
|
||||||
case CLUTTER_SCROLL_UP:
|
|
||||||
- is_discrete_event = TRUE;
|
|
||||||
y_value = -DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
y_discrete = -1;
|
|
||||||
y_value120 = y_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_DOWN:
|
|
||||||
- is_discrete_event = TRUE;
|
|
||||||
y_value = DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
y_discrete = 1;
|
|
||||||
y_value120 = y_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_LEFT:
|
|
||||||
- is_discrete_event = TRUE;
|
|
||||||
x_value = -DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
x_discrete = -1;
|
|
||||||
x_value120 = x_discrete * 120;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_SCROLL_RIGHT:
|
|
||||||
- is_discrete_event = TRUE;
|
|
||||||
x_value = DEFAULT_AXIS_STEP_DISTANCE;
|
|
||||||
x_discrete = 1;
|
|
||||||
x_value120 = x_discrete * 120;
|
|
||||||
@@ -783,8 +778,7 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
x_value = wl_fixed_from_double (dx) * factor;
|
|
||||||
y_value = wl_fixed_from_double (dy) * factor;
|
|
||||||
|
|
||||||
- is_value120_event = (source == WL_POINTER_AXIS_SOURCE_WHEEL);
|
|
||||||
- if (is_value120_event)
|
|
||||||
+ if (source == WL_POINTER_AXIS_SOURCE_WHEEL)
|
|
||||||
{
|
|
||||||
x_value120 = (int32_t) (dx * 120);
|
|
||||||
y_value120 = (int32_t) (dy * 120);
|
|
||||||
@@ -801,7 +795,6 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
wl_resource_for_each (resource, &client->pointer_resources)
|
|
||||||
{
|
|
||||||
int client_version = wl_resource_get_version (resource);
|
|
||||||
- gboolean send_axis_x = TRUE, send_axis_y = TRUE;
|
|
||||||
|
|
||||||
if (client_version >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
|
|
||||||
wl_pointer_send_axis_source (resource, source);
|
|
||||||
@@ -815,8 +808,6 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
x_value120);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- send_axis_x = !is_discrete_event;
|
|
||||||
}
|
|
||||||
else if (client_version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
@@ -826,11 +817,9 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
|
||||||
x_discrete);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- send_axis_x = !is_value120_event;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (x_value && send_axis_x)
|
|
||||||
+ if (x_value)
|
|
||||||
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
|
||||||
WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
|
|
||||||
|
|
||||||
@@ -848,8 +837,6 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
y_value120);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- send_axis_y = !is_discrete_event;
|
|
||||||
}
|
|
||||||
else if (client_version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION)
|
|
||||||
{
|
|
||||||
@@ -859,11 +846,9 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
WL_POINTER_AXIS_VERTICAL_SCROLL,
|
|
||||||
y_discrete);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- send_axis_y = !is_value120_event;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (y_value && send_axis_y)
|
|
||||||
+ if (y_value)
|
|
||||||
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
|
||||||
WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
|
|
||||||
|
|
||||||
--
|
|
||||||
GitLab
|
|
||||||
|
|
||||||
|
|
||||||
From ab8e145e25ae70024b9838856663a18a5aaf3ff1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Carlos Garnacho <carlosg@gnome.org>
|
|
||||||
Date: Tue, 5 Mar 2024 13:43:57 +0100
|
|
||||||
Subject: [PATCH 4/4] wayland: Filter scroll events based on source
|
|
||||||
|
|
||||||
The POINTER_EMULATED flag was a convenience to filter either
|
|
||||||
side of smooth/discrete events that we should ignore based on
|
|
||||||
the source.
|
|
||||||
|
|
||||||
This distinction was challenged, first by v120 mice that use
|
|
||||||
Clutter smooth events to deliver semi-discrete changes, second
|
|
||||||
by commit e0c4b2b241 ("backends/native: Mark the emulated smooth
|
|
||||||
scroll event as such") which made the smooth events be flagged
|
|
||||||
as emulated, and the discrete whole-step events marked as
|
|
||||||
real.
|
|
||||||
|
|
||||||
This distinction feels convenient for the time being, since
|
|
||||||
upper layers might be confused by real smooth scroll events
|
|
||||||
without finish flags. Adapt to this change at MetaWaylandPointer
|
|
||||||
so that we drop the POINTER_EMULATED check, and the events are
|
|
||||||
perhaps filtered based on their source and the preferred
|
|
||||||
wl_seat version of the client that we are talking to.
|
|
||||||
|
|
||||||
This handles the whole grid of combinations:
|
|
||||||
- wheel sources with wl_seat >=8 result in wl_pointer.axis_value120
|
|
||||||
from "emulated" smooth scroll events, with value120 information.
|
|
||||||
- wheel sources with wl_seat < 8 result in wl_pointer.axis_discrete
|
|
||||||
from "real" discrete scroll events.
|
|
||||||
- finger/continuous sources prefer smooth events. Previously, always
|
|
||||||
non-emulated for those.
|
|
||||||
|
|
||||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
|
|
||||||
---
|
|
||||||
src/wayland/meta-wayland-pointer.c | 34 +++++++++++++++++++++++++++---
|
|
||||||
1 file changed, 31 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
|
|
||||||
index 4d1971c3474..9d5a381cd4d 100644
|
|
||||||
--- a/src/wayland/meta-wayland-pointer.c
|
|
||||||
+++ b/src/wayland/meta-wayland-pointer.c
|
|
||||||
@@ -706,6 +706,34 @@ handle_button_event (MetaWaylandPointer *pointer,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+static gboolean
|
|
||||||
+maybe_filter_scroll_event (const ClutterEvent *event,
|
|
||||||
+ int client_version)
|
|
||||||
+{
|
|
||||||
+ ClutterScrollSource source;
|
|
||||||
+
|
|
||||||
+ source = clutter_event_get_scroll_source (event);
|
|
||||||
+
|
|
||||||
+ switch (clutter_event_get_scroll_direction (event))
|
|
||||||
+ {
|
|
||||||
+ case CLUTTER_SCROLL_UP:
|
|
||||||
+ case CLUTTER_SCROLL_DOWN:
|
|
||||||
+ case CLUTTER_SCROLL_LEFT:
|
|
||||||
+ case CLUTTER_SCROLL_RIGHT:
|
|
||||||
+ if (source == CLUTTER_SCROLL_SOURCE_WHEEL)
|
|
||||||
+ return client_version >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION;
|
|
||||||
+
|
|
||||||
+ return TRUE;
|
|
||||||
+ case CLUTTER_SCROLL_SMOOTH:
|
|
||||||
+ if (source == CLUTTER_SCROLL_SOURCE_WHEEL)
|
|
||||||
+ return client_version < WL_POINTER_AXIS_VALUE120_SINCE_VERSION;
|
|
||||||
+
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return TRUE;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static void
|
|
||||||
handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
const ClutterEvent *event)
|
|
||||||
@@ -718,9 +746,6 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
MetaWaylandPointerClient *client;
|
|
||||||
ClutterScrollFinishFlags finish_flags;
|
|
||||||
|
|
||||||
- if (clutter_event_get_flags (event) & CLUTTER_EVENT_FLAG_POINTER_EMULATED)
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
client = pointer->focus_client;
|
|
||||||
if (!client)
|
|
||||||
return;
|
|
||||||
@@ -796,6 +821,9 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|
||||||
{
|
|
||||||
int client_version = wl_resource_get_version (resource);
|
|
||||||
|
|
||||||
+ if (maybe_filter_scroll_event (event, client_version))
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
if (client_version >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
|
|
||||||
wl_pointer_send_axis_source (resource, source);
|
|
||||||
|
|
||||||
--
|
|
||||||
GitLab
|
|
||||||
|
|
||||||
13
mutter.spec
13
mutter.spec
@@ -13,8 +13,8 @@
|
|||||||
%global tarball_version %%(echo %{version} | tr '~' '.')
|
%global tarball_version %%(echo %{version} | tr '~' '.')
|
||||||
|
|
||||||
Name: mutter
|
Name: mutter
|
||||||
Version: 46~rc
|
Version: 46.3.1
|
||||||
Release: %autorelease
|
Release: %autorelease.mr1021
|
||||||
Summary: Window and compositing manager based on Clutter
|
Summary: Window and compositing manager based on Clutter
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@@ -42,9 +42,7 @@ Patch: 0001-Revert-x11-Use-input-region-from-frame-window-for-de.patch
|
|||||||
# which solves the problems reported with #3329 alone
|
# which solves the problems reported with #3329 alone
|
||||||
Patch: 0001-modified-3329.patch
|
Patch: 0001-modified-3329.patch
|
||||||
|
|
||||||
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642
|
Patch: three-finger-drag.patch
|
||||||
# Fix mouse wheel scrolling
|
|
||||||
Patch: 3642.patch
|
|
||||||
|
|
||||||
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
|
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
|
||||||
BuildRequires: pkgconfig(sm)
|
BuildRequires: pkgconfig(sm)
|
||||||
@@ -70,14 +68,15 @@ BuildRequires: mesa-libgbm-devel
|
|||||||
BuildRequires: pkgconfig(glesv2)
|
BuildRequires: pkgconfig(glesv2)
|
||||||
BuildRequires: pkgconfig(graphene-gobject-1.0)
|
BuildRequires: pkgconfig(graphene-gobject-1.0)
|
||||||
BuildRequires: pam-devel
|
BuildRequires: pam-devel
|
||||||
|
BuildRequires: pkgconfig(libdisplay-info)
|
||||||
BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_version}
|
BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_version}
|
||||||
BuildRequires: pkgconfig(sysprof-capture-4)
|
BuildRequires: pkgconfig(sysprof-capture-4)
|
||||||
BuildRequires: sysprof-devel
|
BuildRequires: sysprof-devel
|
||||||
BuildRequires: pkgconfig(libsystemd)
|
BuildRequires: pkgconfig(libsystemd)
|
||||||
BuildRequires: xorg-x11-server-Xorg
|
|
||||||
BuildRequires: xorg-x11-server-Xvfb
|
BuildRequires: xorg-x11-server-Xvfb
|
||||||
BuildRequires: pkgconfig(xkeyboard-config)
|
BuildRequires: pkgconfig(xkeyboard-config)
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
|
BuildRequires: cvt
|
||||||
# Bootstrap requirements
|
# Bootstrap requirements
|
||||||
BuildRequires: gettext-devel git-core
|
BuildRequires: gettext-devel git-core
|
||||||
BuildRequires: pkgconfig(libcanberra)
|
BuildRequires: pkgconfig(libcanberra)
|
||||||
@@ -175,7 +174,7 @@ the functionality of the installed %{name} package.
|
|||||||
%autosetup -S git -n %{name}-%{tarball_version}
|
%autosetup -S git -n %{name}-%{tarball_version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%meson -Degl_device=true -Dwayland_eglstream=true -Dlibdisplay_info=disabled
|
%meson -Degl_device=true -Dwayland_eglstream=true
|
||||||
%meson_build
|
%meson_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|||||||
2
sources
2
sources
@@ -1 +1 @@
|
|||||||
SHA512 (mutter-46.rc.tar.xz) = 3a37c73d51206adf70c7fba69643347694b4b8325f4eb18eb45a7845e71468c23ba0ffdcbc3e7c8618a21f399eabad48ee2b84b0471c2961662ea50268017999
|
SHA512 (mutter-46.3.1.tar.xz) = 12a594eb8ad4c62d7613dc0b21887c91d6534dbaf90a1d1393dc5f9bc5c683f7956135760b2c2d13169b349fcace5d33b719755fc9fb020dfe3b15ca4ebc5f4e
|
||||||
|
|||||||
197
three-finger-drag.patch
Normal file
197
three-finger-drag.patch
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
commit 605bfbf5c26adba7b19dcc4ebd836f211445614c
|
||||||
|
Author: Craig Cabrey <craigcabrey@gmail.com>
|
||||||
|
Date: Fri Jul 1 14:54:57 2022 -0500
|
||||||
|
|
||||||
|
backend/native: support for three finger drag
|
||||||
|
|
||||||
|
After initially looking at implementing this feature in libinput itself,
|
||||||
|
it was determined that it made more sense for the compositing layer to
|
||||||
|
emulate the functionality.
|
||||||
|
|
||||||
|
This patch adds the necessary emulation for the native/Wayland input
|
||||||
|
handling backend in Mutter.
|
||||||
|
|
||||||
|
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=768421
|
||||||
|
Supercedes: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1021
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
Note that this will only work on Wayland, the X11 implementation is left empty intentionally.
|
||||||
|
|
||||||
|
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
|
||||||
|
index 226b195bc..581ae0323 100644
|
||||||
|
--- a/src/backends/meta-input-settings-private.h
|
||||||
|
+++ b/src/backends/meta-input-settings-private.h
|
||||||
|
@@ -102,6 +102,10 @@ struct _MetaInputSettingsClass
|
||||||
|
ClutterInputDevice *device,
|
||||||
|
GDesktopTouchpadClickMethod mode);
|
||||||
|
|
||||||
|
+ void (* set_three_finger_drag) (MetaInputSettings *settings,
|
||||||
|
+ ClutterInputDevice *device,
|
||||||
|
+ gboolean enabled);
|
||||||
|
+
|
||||||
|
void (* set_keyboard_repeat) (MetaInputSettings *settings,
|
||||||
|
gboolean repeat,
|
||||||
|
guint delay,
|
||||||
|
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
|
||||||
|
index 1d98247b1..997666ceb 100644
|
||||||
|
--- a/src/backends/meta-input-settings.c
|
||||||
|
+++ b/src/backends/meta-input-settings.c
|
||||||
|
@@ -912,6 +912,39 @@ update_touchpad_click_method (MetaInputSettings *input_settings,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+update_touchpad_three_finger_drag (MetaInputSettings *input_settings,
|
||||||
|
+ ClutterInputDevice *device)
|
||||||
|
+{
|
||||||
|
+ MetaInputSettingsClass *input_settings_class;
|
||||||
|
+ MetaInputSettingsPrivate *priv;
|
||||||
|
+ gboolean enabled;
|
||||||
|
+
|
||||||
|
+ if (device && clutter_input_device_get_device_type(device) != CLUTTER_TOUCHPAD_DEVICE)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ priv = meta_input_settings_get_instance_private (input_settings);
|
||||||
|
+ input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||||
|
+ enabled = g_settings_get_boolean (priv->touchpad_settings,
|
||||||
|
+ "three-finger-drag");
|
||||||
|
+
|
||||||
|
+ if (device)
|
||||||
|
+ {
|
||||||
|
+ settings_device_set_bool_setting (input_settings, device,
|
||||||
|
+ input_settings_class->set_three_finger_drag,
|
||||||
|
+ enabled);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ settings_set_bool_setting (input_settings,
|
||||||
|
+ CLUTTER_INPUT_CAPABILITY_TOUCHPAD,
|
||||||
|
+ CLUTTER_INPUT_CAPABILITY_NONE,
|
||||||
|
+ NULL,
|
||||||
|
+ input_settings_class->set_three_finger_drag,
|
||||||
|
+ enabled);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
update_touchpad_send_events (MetaInputSettings *input_settings,
|
||||||
|
ClutterInputDevice *device)
|
||||||
|
@@ -1234,6 +1267,8 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||||
|
update_touchpad_two_finger_scroll (input_settings, NULL);
|
||||||
|
else if (strcmp (key, "click-method") == 0)
|
||||||
|
update_touchpad_click_method (input_settings, NULL);
|
||||||
|
+ else if (strcmp (key, "three-finger-drag") == 0)
|
||||||
|
+ update_touchpad_three_finger_drag (input_settings, NULL);
|
||||||
|
else if (strcmp (key, "middle-click-emulation") == 0)
|
||||||
|
update_middle_click_emulation (input_settings, settings, NULL);
|
||||||
|
}
|
||||||
|
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c
|
||||||
|
index 7dcaabe40..8cc3d55c8 100644
|
||||||
|
--- a/src/backends/native/meta-input-device-native.c
|
||||||
|
+++ b/src/backends/native/meta-input-device-native.c
|
||||||
|
@@ -1360,6 +1360,7 @@ meta_input_device_native_init (MetaInputDeviceNative *self)
|
||||||
|
self->output_ratio = 0;
|
||||||
|
self->width = -1;
|
||||||
|
self->height = -1;
|
||||||
|
+ self->three_finger_drag_enabled = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h
|
||||||
|
index 80a980491..3fb8ccd6a 100644
|
||||||
|
--- a/src/backends/native/meta-input-device-native.h
|
||||||
|
+++ b/src/backends/native/meta-input-device-native.h
|
||||||
|
@@ -85,6 +85,8 @@ struct _MetaInputDeviceNative
|
||||||
|
double output_ratio; /* w:h */
|
||||||
|
MetaInputDeviceMapping mapping_mode;
|
||||||
|
|
||||||
|
+ gboolean three_finger_drag_enabled;
|
||||||
|
+
|
||||||
|
/* Pointer position */
|
||||||
|
float pointer_x;
|
||||||
|
float pointer_y;
|
||||||
|
diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c
|
||||||
|
index 840272cab..2254d5e72 100644
|
||||||
|
--- a/src/backends/native/meta-input-settings-native.c
|
||||||
|
+++ b/src/backends/native/meta-input-settings-native.c
|
||||||
|
@@ -662,6 +662,15 @@ meta_input_settings_native_set_tablet_aspect_ratio (MetaInputSettings *settings
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+meta_input_settings_native_set_three_finger_drag (MetaInputSettings *settings,
|
||||||
|
+ ClutterInputDevice *device,
|
||||||
|
+ gboolean enabled)
|
||||||
|
+{
|
||||||
|
+ MetaInputDeviceNative *native_device = META_INPUT_DEVICE_NATIVE (device);
|
||||||
|
+ native_device->three_finger_drag_enabled = enabled;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
meta_input_settings_native_set_tablet_area (MetaInputSettings *settings,
|
||||||
|
ClutterInputDevice *device,
|
||||||
|
@@ -830,6 +839,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
|
||||||
|
input_settings_class->set_click_method = meta_input_settings_native_set_click_method;
|
||||||
|
input_settings_class->set_keyboard_repeat = meta_input_settings_native_set_keyboard_repeat;
|
||||||
|
input_settings_class->set_disable_while_typing = meta_input_settings_native_set_disable_while_typing;
|
||||||
|
+ input_settings_class->set_three_finger_drag = meta_input_settings_native_set_three_finger_drag;
|
||||||
|
|
||||||
|
input_settings_class->set_tablet_mapping = meta_input_settings_native_set_tablet_mapping;
|
||||||
|
input_settings_class->set_tablet_aspect_ratio = meta_input_settings_native_set_tablet_aspect_ratio;
|
||||||
|
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
|
||||||
|
index eb7b30872..e3ac3b255 100644
|
||||||
|
--- a/src/backends/native/meta-seat-impl.c
|
||||||
|
+++ b/src/backends/native/meta-seat-impl.c
|
||||||
|
@@ -1434,12 +1434,51 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
|
||||||
|
double dx_unaccel,
|
||||||
|
double dy_unaccel)
|
||||||
|
{
|
||||||
|
+ MetaInputDeviceNative *device_evdev;
|
||||||
|
MetaSeatImpl *seat_impl;
|
||||||
|
ClutterEvent *event = NULL;
|
||||||
|
float x, y;
|
||||||
|
|
||||||
|
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
|
||||||
|
seat_impl = seat_impl_from_device (input_device);
|
||||||
|
|
||||||
|
+ if (device_evdev->three_finger_drag_enabled)
|
||||||
|
+ {
|
||||||
|
+ if (n_fingers == 3)
|
||||||
|
+ {
|
||||||
|
+ switch (phase)
|
||||||
|
+ {
|
||||||
|
+ case CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN:
|
||||||
|
+ meta_seat_impl_notify_button_in_impl (seat_impl,
|
||||||
|
+ input_device,
|
||||||
|
+ time_us,
|
||||||
|
+ BTN_LEFT,
|
||||||
|
+ LIBINPUT_BUTTON_STATE_PRESSED);
|
||||||
|
+ return;
|
||||||
|
+ case CLUTTER_TOUCHPAD_GESTURE_PHASE_CANCEL:
|
||||||
|
+ case CLUTTER_TOUCHPAD_GESTURE_PHASE_END:
|
||||||
|
+ meta_seat_impl_notify_button_in_impl (seat_impl,
|
||||||
|
+ input_device,
|
||||||
|
+ time_us,
|
||||||
|
+ BTN_LEFT,
|
||||||
|
+ LIBINPUT_BUTTON_STATE_RELEASED);
|
||||||
|
+ return;
|
||||||
|
+ case CLUTTER_TOUCHPAD_GESTURE_PHASE_UPDATE:
|
||||||
|
+ meta_seat_impl_notify_relative_motion_in_impl (seat_impl,
|
||||||
|
+ input_device,
|
||||||
|
+ time_us,
|
||||||
|
+ dx, dy,
|
||||||
|
+ dx_unaccel, dy_unaccel,
|
||||||
|
+ NULL);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else if (n_fingers == 4)
|
||||||
|
+ {
|
||||||
|
+ n_fingers--;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
meta_input_device_native_get_coords_in_impl (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer),
|
||||||
|
&x, &y);
|
||||||
|
event =
|
||||||
Reference in New Issue
Block a user