Backport all patches to git master for various fixes inc (#1809717)

This commit is contained in:
Adam Williamson 2020-03-24 14:14:24 -07:00
parent ba75e27d37
commit f02b5ddec4
49 changed files with 4272 additions and 7 deletions

View File

@ -0,0 +1,224 @@
From 1c1adb00369ab84edd4d2b08fce50b63fb5fa75b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=BA=D0=BE=20=D0=9A=D0=BE=D1=81=D1=82?=
=?UTF-8?q?=D0=B8=D1=9B?= <marko.m.kostic@gmail.com>
Date: Sun, 8 Mar 2020 20:20:38 +0000
Subject: [PATCH 01/48] Update Serbian translation
---
po/sr.po | 75 +++++++++++++++++++++++++++++++++-----------------------
1 file changed, 44 insertions(+), 31 deletions(-)
diff --git a/po/sr.po b/po/sr.po
index 81510891e..1fb3aec68 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
-"POT-Creation-Date: 2019-08-21 20:17+0000\n"
-"PO-Revision-Date: 2019-08-22 19:56+0200\n"
+"POT-Creation-Date: 2020-02-23 17:41+0000\n"
+"PO-Revision-Date: 2020-03-08 21:20+0100\n"
"Last-Translator: Марко М. Костић <marko.m.kostic@gmail.com>\n"
"Language-Team: српски <gnome-sr@googlegroups.org>\n"
"Language: sr\n"
@@ -21,7 +21,7 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : n"
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Project-Style: gnome\n"
-"X-Generator: Poedit 2.2.3\n"
+"X-Generator: Poedit 2.3\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -423,19 +423,32 @@ msgstr "Тастер који се користи за проналажење п
msgid "This key will initiate the “locate pointer” action."
msgstr "Овај тастер ће покренути „пронађи показивач“ радњу"
-#: data/org.gnome.mutter.gschema.xml.in:155
+#: data/org.gnome.mutter.gschema.xml.in:142
+msgid "Timeout for check-alive ping"
+msgstr "Време истицања провере живахности"
+
+#: data/org.gnome.mutter.gschema.xml.in:143
+msgid ""
+"Number of milliseconds a client has to respond to a ping request in order to "
+"not be detected as frozen. Using 0 will disable the alive check completely."
+msgstr ""
+"Број милисекунди за које клијент мора одговорити на пинг захтев да се не би "
+"сматрао замрзнутим. Унос броја 0 ће онемогућити проверу живахности у "
+"потпуности."
+
+#: data/org.gnome.mutter.gschema.xml.in:165
msgid "Select window from tab popup"
msgstr "Бира прозор из језичка искакања"
-#: data/org.gnome.mutter.gschema.xml.in:160
+#: data/org.gnome.mutter.gschema.xml.in:170
msgid "Cancel tab popup"
msgstr "Отказивање језичка искакања"
-#: data/org.gnome.mutter.gschema.xml.in:165
+#: data/org.gnome.mutter.gschema.xml.in:175
msgid "Switch monitor configurations"
msgstr "Мења подешавања монитора"
-#: data/org.gnome.mutter.gschema.xml.in:170
+#: data/org.gnome.mutter.gschema.xml.in:180
msgid "Rotates the built-in monitor configuration"
msgstr "Заокреће уграђена подешавања монитора"
@@ -549,7 +562,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
-#: src/backends/meta-input-settings.c:2531
+#: src/backends/meta-input-settings.c:2567
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Режим прекидача (група %d)"
@@ -557,11 +570,11 @@ msgstr "Режим прекидача (група %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
-#: src/backends/meta-input-settings.c:2554
+#: src/backends/meta-input-settings.c:2590
msgid "Switch monitor"
msgstr "Промени монитор"
-#: src/backends/meta-input-settings.c:2556
+#: src/backends/meta-input-settings.c:2592
msgid "Show on-screen help"
msgstr "Прикажи помоћ на екрану"
@@ -593,13 +606,13 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: this string will appear in Sysprof
-#: src/backends/meta-profiler.c:82
+#: src/backends/meta-profiler.c:79
msgid "Compositor"
msgstr "Састављач"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
-#: src/compositor/compositor.c:505
+#: src/compositor/compositor.c:533
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -610,47 +623,47 @@ msgstr ""
msgid "Bell event"
msgstr "Звонца"
-#: src/core/main.c:185
+#: src/core/main.c:190
msgid "Disable connection to session manager"
msgstr "Искључује везу са управником сесије"
-#: src/core/main.c:191
+#: src/core/main.c:196
msgid "Replace the running window manager"
msgstr "Мења текућег управника прозорима"
-#: src/core/main.c:197
+#: src/core/main.c:202
msgid "Specify session management ID"
msgstr "Наводи ИБ управника сесије"
-#: src/core/main.c:202
+#: src/core/main.c:207
msgid "X Display to use"
msgstr "Икс екран који ће бити коришћен"
-#: src/core/main.c:208
+#: src/core/main.c:213
msgid "Initialize session from savefile"
msgstr "Покреће сесију из датотеке чувања"
-#: src/core/main.c:214
+#: src/core/main.c:219
msgid "Make X calls synchronous"
msgstr "Чини Икс позиве усклађеним"
-#: src/core/main.c:221
+#: src/core/main.c:226
msgid "Run as a wayland compositor"
msgstr "Ради као вејлендов композитор"
-#: src/core/main.c:227
+#: src/core/main.c:232
msgid "Run as a nested compositor"
msgstr "Ради као угнежђени композитор"
-#: src/core/main.c:233
+#: src/core/main.c:238
msgid "Run wayland compositor without starting Xwayland"
msgstr "Ради као вејлендов композитор без покретања Икс-вејленда"
-#: src/core/main.c:241
+#: src/core/main.c:246
msgid "Run as a full display server, rather than nested"
msgstr "Ради као пуни сервер приказа, уместо као угнеждени"
-#: src/core/main.c:247
+#: src/core/main.c:252
msgid "Run with X11 backend"
msgstr "Покрени на Икс11 позадинцу"
@@ -703,21 +716,21 @@ msgstr "Исписује издање"
msgid "Mutter plugin to use"
msgstr "Прикључци Матера за коришћење"
-#: src/core/prefs.c:1849
+#: src/core/prefs.c:1911
#, c-format
msgid "Workspace %d"
msgstr "%d. радни простор"
-#: src/core/util.c:121
+#: src/core/util.c:122
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Матер је преведен без подршке за опширан режим\n"
-#: src/wayland/meta-wayland-tablet-pad.c:567
+#: src/wayland/meta-wayland-tablet-pad.c:568
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Режим прекидача: Режим %d"
-#: src/x11/meta-x11-display.c:678
+#: src/x11/meta-x11-display.c:676
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -726,21 +739,21 @@ msgstr ""
"Приказ „%s“ већ има управника прозора; пробајте да користите опцију „--"
"replace“ да замените тренутног управника прозора."
-#: src/x11/meta-x11-display.c:1039
+#: src/x11/meta-x11-display.c:1089
msgid "Failed to initialize GDK\n"
msgstr "Нисам успео да покренем ГДК\n"
-#: src/x11/meta-x11-display.c:1063
+#: src/x11/meta-x11-display.c:1113
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Нисам успео да отворим екран „%s“ Икс система прозора\n"
-#: src/x11/meta-x11-display.c:1146
+#: src/x11/meta-x11-display.c:1196
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Приказ „%d“ на екрану „%s“ није исправан\n"
-#: src/x11/meta-x11-selection-input-stream.c:445
+#: src/x11/meta-x11-selection-input-stream.c:460
#, c-format
msgid "Format %s not supported"
msgstr "Формат %s није подржан"
--
2.26.0.rc2

View File

@ -0,0 +1,34 @@
From 480e7d44bef3921ebdd9a4e14a2c0e9d112531bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Mon, 9 Mar 2020 17:43:54 +0100
Subject: [PATCH 02/48] screen-cast-stream-src: Don't complain when we can't
dequeue buffer
PipeWire will be unable to dequeue a buffer if all are already busy.
This can happen for valid reasons, e.g. the stream consumer not being
fast enough, so don't complain in the journal if it happens.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1115
---
src/backends/meta-screen-cast-stream-src.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index 9c3657c75..170f34043 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -456,10 +456,7 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
buffer = pw_stream_dequeue_buffer (priv->pipewire_stream);
if (!buffer)
- {
- g_warning ("Failed to dequeue at PipeWire buffer");
- return;
- }
+ return;
spa_buffer = buffer->buffer;
data = spa_buffer->datas[0].data;
--
2.26.0.rc2

View File

@ -0,0 +1,44 @@
From 26e1e495a05512a67a14fd23f4732670b582f3bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 5 Mar 2020 23:29:26 +0100
Subject: [PATCH 03/48] screen-cast-stream-src: Don't leak GSource
For every stream src, we created and attached a GSource. Upon stream
src destruction, we g_source_destroy():ed the GSource. What
g_source_destroy() does, hawever, is not really "destroy" it but only
detaches it from the main context removing the reference the context had
added for it via g_source_attach(). This caused the GSource to leak,
although in a detached state, as the reference taken on creation was
still held.
Fix this by also removing our own reference to it when finalizing.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1106
---
src/backends/meta-screen-cast-stream-src.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index 170f34043..4f3d821ef 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -885,7 +885,7 @@ create_pipewire_source (void)
pipewire_source->pipewire_loop = pw_loop_new (NULL);
if (!pipewire_source->pipewire_loop)
{
- g_source_destroy ((GSource *) pipewire_source);
+ g_source_unref ((GSource *) pipewire_source);
return NULL;
}
@@ -980,6 +980,7 @@ meta_screen_cast_stream_src_finalize (GObject *object)
g_clear_pointer (&priv->pipewire_core, pw_core_disconnect);
g_clear_pointer (&priv->pipewire_context, pw_context_destroy);
g_source_destroy (&priv->pipewire_source->base);
+ g_source_unref (&priv->pipewire_source->base);
G_OBJECT_CLASS (meta_screen_cast_stream_src_parent_class)->finalize (object);
}
--
2.26.0.rc2

View File

@ -0,0 +1,48 @@
From 50ff30bf2bc9789944737ab35936533a81990c95 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 2 Mar 2020 15:49:07 +0100
Subject: [PATCH 04/48] xwayland: Log actual error message if available
If X11 initialization fails, print the actual error message if the error
is set, to help with debugging.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1102
---
src/core/display.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/core/display.c b/src/core/display.c
index a9394ea82..6a7e75d55 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -701,7 +701,13 @@ meta_display_init_x11_finish (MetaDisplay *display,
g_assert (g_task_get_source_tag (G_TASK (result)) == meta_display_init_x11);
if (!g_task_propagate_boolean (G_TASK (result), error))
- return FALSE;
+ {
+ if (*error == NULL)
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Unknown error");
+
+ return FALSE;
+ }
+
if (display->x11_display)
return TRUE;
@@ -778,8 +784,10 @@ on_x11_initialized (MetaDisplay *display,
GAsyncResult *result,
gpointer user_data)
{
- if (!meta_display_init_x11_finish (display, result, NULL))
- g_critical ("Failed to init X11 display");
+ g_autoptr (GError) error = NULL;
+
+ if (!meta_display_init_x11_finish (display, result, &error))
+ g_critical ("Failed to init X11 display: %s", error->message);
}
#endif
--
2.26.0.rc2

View File

@ -0,0 +1,24 @@
From 121c5d2a927f168f4df9b95230d261d299b46299 Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Tue, 3 Mar 2020 17:40:11 +0200
Subject: [PATCH 05/48] meson: Expand on xwayland_initfd option description
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1104
---
meson_options.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson_options.txt b/meson_options.txt
index 097809a93..75a1961e4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -156,5 +156,5 @@ option('xwayland_grab_default_access_rules',
option('xwayland_initfd',
type: 'feature',
value: 'auto',
- description: 'Whether Xwayland -initfd argument is used'
+ description: 'Whether -initfd argument is passed to Xwayland to guarantee services (e.g. gsd-xsettings) startup before applications'
)
--
2.26.0.rc2

View File

@ -0,0 +1,82 @@
From 4cc29cfb619102a8e7cd32731205c8018d83544e Mon Sep 17 00:00:00 2001
From: Pekka Paalanen <pekka.paalanen@collabora.com>
Date: Mon, 24 Feb 2020 15:13:42 +0200
Subject: [PATCH 06/48] cursor-renderer/native: Refactor init to per-gpu
Extract the code to initialize a single GPU cursor support into its own
function. The new function will be used by GPU hotplug in the future.
This is a pure refactoring without any behavioral changes.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1097
---
.../native/meta-cursor-renderer-native.c | 45 +++++++++++--------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c
index 39ebe646f..cf500f07c 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -1601,6 +1601,31 @@ on_monitors_changed (MetaMonitorManager *monitors,
force_update_hw_cursor (native);
}
+static void
+init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms)
+{
+ MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms);
+ MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
+ struct gbm_device *gbm_device;
+ uint64_t width, height;
+
+ gbm_device = meta_gbm_device_from_gpu (gpu_kms);
+ if (!gbm_device)
+ return;
+
+ cursor_renderer_gpu_data =
+ meta_create_cursor_renderer_native_gpu_data (gpu_kms);
+
+ if (!meta_kms_device_get_cursor_size (kms_device, &width, &height))
+ {
+ width = 64;
+ height = 64;
+ }
+
+ cursor_renderer_gpu_data->cursor_width = width;
+ cursor_renderer_gpu_data->cursor_height = height;
+}
+
static void
init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
{
@@ -1613,26 +1638,8 @@ init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
- MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms);
- MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
- struct gbm_device *gbm_device;
- uint64_t width, height;
-
- gbm_device = meta_gbm_device_from_gpu (gpu_kms);
- if (!gbm_device)
- continue;
-
- cursor_renderer_gpu_data =
- meta_create_cursor_renderer_native_gpu_data (gpu_kms);
-
- if (!meta_kms_device_get_cursor_size (kms_device, &width, &height))
- {
- width = 64;
- height = 64;
- }
- cursor_renderer_gpu_data->cursor_width = width;
- cursor_renderer_gpu_data->cursor_height = height;
+ init_hw_cursor_support_for_gpu (gpu_kms);
}
}
--
2.26.0.rc2

View File

@ -0,0 +1,55 @@
From 8abdf16a3992e3332f2378ea7c65e6e251e418e0 Mon Sep 17 00:00:00 2001
From: Pekka Paalanen <pekka.paalanen@collabora.com>
Date: Mon, 24 Feb 2020 15:36:24 +0200
Subject: [PATCH 07/48] cursor-renderer/native: Handle GPU hotplug
Listen for GPU hotplug events to initialize their cursor support.
This fixes one reason for why DisplayLink devices may not be using a hardware
cursor. Particularly, when a DisplayLink device is hotplugged for the first
time such that EVDI creates a new DRM device node after gnome-shell has already
started, we used to forget to initialize the cursor support.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1097
---
src/backends/native/meta-cursor-renderer-native.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c
index cf500f07c..b400a8740 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -2,6 +2,7 @@
/*
* Copyright (C) 2014 Red Hat
+ * Copyright 2020 DisplayLink (UK) Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -1626,6 +1627,13 @@ init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms)
cursor_renderer_gpu_data->cursor_height = height;
}
+static void
+on_gpu_added_for_cursor (MetaBackend *backend,
+ MetaGpuKms *gpu_kms)
+{
+ init_hw_cursor_support_for_gpu (gpu_kms);
+}
+
static void
init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
{
@@ -1659,6 +1667,8 @@ meta_cursor_renderer_native_new (MetaBackend *backend)
g_signal_connect_object (monitor_manager, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed),
cursor_renderer_native, 0);
+ g_signal_connect (backend, "gpu-added",
+ G_CALLBACK (on_gpu_added_for_cursor), NULL);
priv->backend = backend;
priv->hw_state_invalidated = TRUE;
--
2.26.0.rc2

View File

@ -0,0 +1,33 @@
From adc38f902a8d2066b65df571aa21ed7de2a99b46 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Tue, 25 Feb 2020 00:14:40 +0100
Subject: [PATCH 08/48] window-actor/X11: Update shape, input and opaque region
in order
As they depend on each other to be correct, we should set all of them
in the correct order. As we do already have a function for that, use it.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/compositor/meta-window-actor-x11.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index ef50b1ada..04b0ab5c5 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -1138,10 +1138,7 @@ handle_updates (MetaWindowActorX11 *actor_x11)
* which causes the shadows to look bad.
*/
if (surface && meta_window_x11_always_update_shape (window))
- {
- update_opaque_region (actor_x11);
- update_shape_region (actor_x11);
- }
+ check_needs_reshape (actor_x11);
return;
}
--
2.26.0.rc2

View File

@ -0,0 +1,55 @@
From be11525b28da70ff60eb40925127d187a3f50672 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 26 Feb 2020 11:03:48 +0100
Subject: [PATCH 09/48] window/x11: Add function to convert the surface to
client area
Add a convenient function to get the client area rectangle from a given
surface rectangle.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/x11/window-x11.c | 16 ++++++++++++++++
src/x11/window-x11.h | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 2c745f4aa..49f7f1526 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -4092,3 +4092,19 @@ meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
frame_rect->width -= borders.invisible.left + borders.invisible.right;
frame_rect->height -= borders.invisible.top + borders.invisible.bottom;
}
+
+void
+meta_window_x11_surface_rect_to_client_rect (MetaWindow *window,
+ MetaRectangle *surface_rect,
+ MetaRectangle *client_rect)
+{
+ MetaFrameBorders borders;
+
+ meta_frame_calc_borders (window->frame, &borders);
+
+ *client_rect = *surface_rect;
+ client_rect->x += borders.total.left;
+ client_rect->y += borders.total.top;
+ client_rect->width -= borders.total.left + borders.total.right;
+ client_rect->height -= borders.total.top + borders.total.bottom;
+}
diff --git a/src/x11/window-x11.h b/src/x11/window-x11.h
index 03c52c5ab..7f4f96f6c 100644
--- a/src/x11/window-x11.h
+++ b/src/x11/window-x11.h
@@ -92,5 +92,7 @@ gboolean meta_window_x11_always_update_shape (MetaWindow *window);
void meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
MetaRectangle *buffer_rect,
MetaRectangle *frame_rect);
-
+void meta_window_x11_surface_rect_to_client_rect (MetaWindow *window,
+ MetaRectangle *surface_rect,
+ MetaRectangle *client_rect);
#endif
--
2.26.0.rc2

View File

@ -0,0 +1,170 @@
From 2d09e959344009563c9f4c7ffb026f6b98265d05 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 26 Feb 2020 11:09:30 +0100
Subject: [PATCH 10/48] window-actor/x11: Compute client area from surface size
Commit 7dbb4bc3 cached the client area when the client was frozen.
This is not sufficient though, because the buffer size might still be
lagging waiting for the buffer from Xwayland to be committed.
So instead of caching the client size from the expected size, deduce the
client area rectangle from the surface size, like we did for the frame
bounds in commit 1ce933e2.
This partly reverts commit 7dbb4bc3 - "window-actor/x11: Cache the
client area"
https://gitlab.gnome.org/GNOME/mutter/issues/1007
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/compositor/meta-window-actor-x11.c | 69 ++++++++++++++++++++------
1 file changed, 55 insertions(+), 14 deletions(-)
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 04b0ab5c5..5c0db02ce 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -99,8 +99,6 @@ struct _MetaWindowActorX11
gboolean recompute_focused_shadow;
gboolean recompute_unfocused_shadow;
gboolean is_frozen;
-
- cairo_rectangle_int_t client_area;
};
static MetaCullableInterface *cullable_parent_iface;
@@ -839,6 +837,41 @@ scan_visible_region (guchar *mask_data,
return meta_region_builder_finish (&builder);
}
+static void
+get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11,
+ MetaShapedTexture *shaped_texture,
+ cairo_rectangle_int_t *client_area)
+{
+ MetaWindow *window =
+ meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
+ cairo_rectangle_int_t surface_rect = { 0 };
+
+ surface_rect.width = meta_shaped_texture_get_width (shaped_texture);
+ surface_rect.height = meta_shaped_texture_get_height (shaped_texture);
+ meta_window_x11_surface_rect_to_client_rect (window,
+ &surface_rect,
+ client_area);
+}
+
+static void
+get_client_area_rect (MetaWindowActorX11 *actor_x11,
+ cairo_rectangle_int_t *client_area)
+{
+ MetaSurfaceActor *surface =
+ meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
+ MetaWindow *window =
+ meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
+ MetaShapedTexture *stex = meta_surface_actor_get_texture (surface);
+
+ if (!meta_window_x11_always_update_shape (window) || !stex)
+ {
+ meta_window_get_client_area_rect (window, client_area);
+ return;
+ }
+
+ get_client_area_rect_from_texture (actor_x11, stex, client_area);
+}
+
static void
build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
cairo_region_t *shape_region)
@@ -890,6 +923,7 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
{
cairo_region_t *frame_paint_region, *scanned_region;
cairo_rectangle_int_t rect = { 0, 0, tex_width, tex_height };
+ cairo_rectangle_int_t client_area;
cairo_rectangle_int_t frame_rect;
/* If we update the shape regardless of the frozen state of the actor,
@@ -899,14 +933,19 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
* point.
*/
if (meta_window_x11_always_update_shape (window))
- meta_window_x11_buffer_rect_to_frame_rect (window, &rect, &frame_rect);
+ {
+ meta_window_x11_buffer_rect_to_frame_rect (window, &rect, &frame_rect);
+ get_client_area_rect_from_texture (actor_x11, stex, &client_area);
+ }
else
- meta_window_get_frame_rect (window, &frame_rect);
+ {
+ meta_window_get_frame_rect (window, &frame_rect);
+ meta_window_get_client_area_rect (window, &client_area);
+ }
/* Make sure we don't paint the frame over the client window. */
frame_paint_region = cairo_region_create_rectangle (&rect);
- cairo_region_subtract_rectangle (frame_paint_region,
- &actor_x11->client_area);
+ cairo_region_subtract_rectangle (frame_paint_region, &client_area);
gdk_cairo_region (cr, frame_paint_region);
cairo_clip (cr);
@@ -964,13 +1003,14 @@ update_shape_region (MetaWindowActorX11 *actor_x11)
MetaWindow *window =
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
cairo_region_t *region = NULL;
+ cairo_rectangle_int_t client_area;
+
+ get_client_area_rect (actor_x11, &client_area);
if (window->frame && window->shape_region)
{
region = cairo_region_copy (window->shape_region);
- cairo_region_translate (region,
- actor_x11->client_area.x,
- actor_x11->client_area.y);
+ cairo_region_translate (region, client_area.x, client_area.y);
}
else if (window->shape_region != NULL)
{
@@ -981,7 +1021,7 @@ update_shape_region (MetaWindowActorX11 *actor_x11)
/* If we don't have a shape on the server, that means that
* we have an implicit shape of one rectangle covering the
* entire window. */
- region = cairo_region_create_rectangle (&actor_x11->client_area);
+ region = cairo_region_create_rectangle (&client_area);
}
if (window->shape_region || window->frame)
@@ -1059,6 +1099,10 @@ update_opaque_region (MetaWindowActorX11 *actor_x11)
is_maybe_transparent = is_actor_maybe_transparent (actor_x11);
if (is_maybe_transparent && window->opaque_region)
{
+ cairo_rectangle_int_t client_area;
+
+ get_client_area_rect (actor_x11, &client_area);
+
/* The opaque region is defined to be a part of the
* window which ARGB32 will always paint with opaque
* pixels. For these regions, we want to avoid painting
@@ -1070,9 +1114,7 @@ update_opaque_region (MetaWindowActorX11 *actor_x11)
* case, graphical glitches will occur.
*/
opaque_region = cairo_region_copy (window->opaque_region);
- cairo_region_translate (opaque_region,
- actor_x11->client_area.x,
- actor_x11->client_area.y);
+ cairo_region_translate (opaque_region, client_area.x, client_area.y);
cairo_region_intersect (opaque_region, actor_x11->shape_region);
}
else if (is_maybe_transparent)
@@ -1148,7 +1190,6 @@ handle_updates (MetaWindowActorX11 *actor_x11)
if (!meta_surface_actor_is_visible (surface))
return;
- meta_window_get_client_area_rect (window, &actor_x11->client_area);
check_needs_reshape (actor_x11);
check_needs_shadow (actor_x11);
}
--
2.26.0.rc2

View File

@ -0,0 +1,136 @@
From 304a103659def666388414f470fa5f0089cdff52 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 3 Mar 2020 10:26:54 +0100
Subject: [PATCH 11/48] window-actor: Add API to update regions
For X11 clients running on Xwayland, the opaque, input and shape regions
are processed from different properties and may occur at a different
time, before the actual buffer is eventually committed by Xwayland.
Add a new API `update_regions` to window actor to trigger the update of
those regions when needed.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/compositor/meta-window-actor-private.h | 3 +++
src/compositor/meta-window-actor-wayland.c | 6 ++++++
src/compositor/meta-window-actor-x11.c | 21 ++++++++++++++++++++-
src/compositor/meta-window-actor.c | 6 ++++++
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h
index 59dd641d4..31cc37702 100644
--- a/src/compositor/meta-window-actor-private.h
+++ b/src/compositor/meta-window-actor-private.h
@@ -28,6 +28,7 @@ struct _MetaWindowActorClass
void (*queue_destroy) (MetaWindowActor *actor);
void (*set_frozen) (MetaWindowActor *actor,
gboolean frozen);
+ void (*update_regions) (MetaWindowActor *actor);
};
typedef enum
@@ -88,4 +89,6 @@ gboolean meta_window_actor_is_frozen (MetaWindowActor *self);
gboolean meta_window_actor_is_opaque (MetaWindowActor *self);
+void meta_window_actor_update_regions (MetaWindowActor *self);
+
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c
index 4cdf8fe0e..bd890256c 100644
--- a/src/compositor/meta-window-actor-wayland.c
+++ b/src/compositor/meta-window-actor-wayland.c
@@ -162,6 +162,11 @@ meta_window_actor_wayland_get_paint_volume (ClutterActor *actor,
return TRUE;
}
+static void
+meta_window_actor_wayland_update_regions (MetaWindowActor *actor)
+{
+}
+
static void
meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
{
@@ -177,6 +182,7 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
window_actor_class->post_paint = meta_window_actor_wayland_post_paint;
window_actor_class->queue_destroy = meta_window_actor_wayland_queue_destroy;
window_actor_class->set_frozen = meta_window_actor_wayland_set_frozen;
+ window_actor_class->update_regions = meta_window_actor_wayland_update_regions;
}
static void
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 5c0db02ce..228d15e04 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -1132,7 +1132,7 @@ update_opaque_region (MetaWindowActorX11 *actor_x11)
}
static void
-check_needs_reshape (MetaWindowActorX11 *actor_x11)
+update_regions (MetaWindowActorX11 *actor_x11)
{
if (!actor_x11->needs_reshape)
return;
@@ -1144,6 +1144,18 @@ check_needs_reshape (MetaWindowActorX11 *actor_x11)
actor_x11->needs_reshape = FALSE;
}
+static void
+check_needs_reshape (MetaWindowActorX11 *actor_x11)
+{
+ MetaWindow *window =
+ meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
+
+ if (meta_window_x11_always_update_shape (window))
+ return;
+
+ update_regions (actor_x11);
+}
+
void
meta_window_actor_x11_update_shape (MetaWindowActorX11 *actor_x11)
{
@@ -1394,6 +1406,12 @@ meta_window_actor_x11_set_frozen (MetaWindowActor *actor,
meta_window_x11_thaw_commits (window);
}
+static void
+meta_window_actor_x11_update_regions (MetaWindowActor *actor)
+{
+ update_regions (META_WINDOW_ACTOR_X11 (actor));
+}
+
static void
meta_window_actor_x11_set_property (GObject *object,
guint prop_id,
@@ -1566,6 +1584,7 @@ meta_window_actor_x11_class_init (MetaWindowActorX11Class *klass)
window_actor_class->post_paint = meta_window_actor_x11_post_paint;
window_actor_class->queue_destroy = meta_window_actor_x11_queue_destroy;
window_actor_class->set_frozen = meta_window_actor_x11_set_frozen;
+ window_actor_class->update_regions = meta_window_actor_x11_update_regions;
actor_class->paint = meta_window_actor_x11_paint;
actor_class->get_paint_volume = meta_window_actor_x11_get_paint_volume;
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index c5ad8e1b0..32b85ed1f 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -251,6 +251,12 @@ meta_window_actor_is_frozen (MetaWindowActor *self)
return priv->surface == NULL || priv->freeze_count > 0;
}
+void
+meta_window_actor_update_regions (MetaWindowActor *self)
+{
+ META_WINDOW_ACTOR_GET_CLASS (self)->update_regions (self);
+}
+
static void
meta_window_actor_set_frozen (MetaWindowActor *self,
gboolean frozen)
--
2.26.0.rc2

View File

@ -0,0 +1,50 @@
From 0b102afb5392c1a8f9d1b9ed7f20aceb1fdf84b2 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 3 Mar 2020 10:31:51 +0100
Subject: [PATCH 12/48] xwayland: Update regions on texture updates
For X11 clients running on Wayland, the actual texture is set by
Xwayland.
The shape, input and opaque regions, however are driven by X11
properties meaning that those may come at a different time than the
actual update of the content.
This results in black areas being visible at times on resize with
Xwayland clients.
To make sure we update all the regions at the same time the buffer is
updated, update the shape, input and opaque regions when the texture is
committed from when the Xwayland surface state is synchronized.
That fixes the remaining black areas being sometimes visible when
resizing client-side decorations windows on Xwayland.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1007
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/wayland/meta-xwayland-surface.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/wayland/meta-xwayland-surface.c b/src/wayland/meta-xwayland-surface.c
index 3233dcc26..4a4615a2c 100644
--- a/src/wayland/meta-xwayland-surface.c
+++ b/src/wayland/meta-xwayland-surface.c
@@ -232,7 +232,13 @@ meta_xwayland_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
META_WAYLAND_ACTOR_SURFACE_CLASS (meta_xwayland_surface_parent_class);
if (xwayland_surface->window)
- actor_surface_class->sync_actor_state (actor_surface);
+ {
+ MetaWindowActor *window_actor =
+ meta_window_actor_from_window (xwayland_surface->window);
+
+ actor_surface_class->sync_actor_state (actor_surface);
+ meta_window_actor_update_regions (window_actor);
+ }
}
static void
--
2.26.0.rc2

View File

@ -0,0 +1,46 @@
From 267f7120683f52b67311119c508ad49643f52623 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 4 Mar 2020 11:08:01 +0100
Subject: [PATCH 13/48] window-actor/x11: Use the new MetaShapedTexture API
The code in `build_and_scan_frame_mask` predates the introduction of the
`MetaShapedTexture` API to get the texture width hand height.
Use the new `meta_shaped_texture_get_width/height` API instead of using
the CoGL paint texture.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/compositor/meta-window-actor-x11.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 228d15e04..851df7e57 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -885,7 +885,6 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
uint8_t *mask_data;
unsigned int tex_width, tex_height;
MetaShapedTexture *stex;
- CoglTexture *paint_tex;
CoglTexture2D *mask_texture;
int stride;
cairo_t *cr;
@@ -897,12 +896,8 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
meta_shaped_texture_set_mask_texture (stex, NULL);
- paint_tex = meta_shaped_texture_get_texture (stex);
- if (paint_tex == NULL)
- return;
-
- tex_width = cogl_texture_get_width (paint_tex);
- tex_height = cogl_texture_get_height (paint_tex);
+ tex_width = meta_shaped_texture_get_width (stex);
+ tex_height = meta_shaped_texture_get_height (stex);
stride = cairo_format_stride_for_width (CAIRO_FORMAT_A8, tex_width);
--
2.26.0.rc2

View File

@ -0,0 +1,77 @@
From 0743381573e4e4c50039aef33cf7404baa340c3d Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 10 Mar 2020 14:44:15 +0100
Subject: [PATCH 14/48] window/x11: Rename
`meta_window_x11_buffer_rect_to_frame_rect`
To keep consistent and avoid confusion, rename the function:
`meta_window_x11_buffer_rect_to_frame_rect()`
to:
`meta_window_x11_surface_rect_to_frame_rect()`
As this function doesn't deal with the `window->buffer_rect` at all.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
---
src/compositor/meta-window-actor-x11.c | 2 +-
src/x11/window-x11.c | 8 ++++----
src/x11/window-x11.h | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 851df7e57..a8d137316 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -929,7 +929,7 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
*/
if (meta_window_x11_always_update_shape (window))
{
- meta_window_x11_buffer_rect_to_frame_rect (window, &rect, &frame_rect);
+ meta_window_x11_surface_rect_to_frame_rect (window, &rect, &frame_rect);
get_client_area_rect_from_texture (actor_x11, stex, &client_area);
}
else
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 49f7f1526..ed56bca5f 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -4075,9 +4075,9 @@ meta_window_x11_always_update_shape (MetaWindow *window)
}
void
-meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
- MetaRectangle *buffer_rect,
- MetaRectangle *frame_rect)
+meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window,
+ MetaRectangle *surface_rect,
+ MetaRectangle *frame_rect)
{
MetaFrameBorders borders;
@@ -4086,7 +4086,7 @@ meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
meta_frame_calc_borders (window->frame, &borders);
- *frame_rect = *buffer_rect;
+ *frame_rect = *surface_rect;
frame_rect->x += borders.invisible.left;
frame_rect->y += borders.invisible.top;
frame_rect->width -= borders.invisible.left + borders.invisible.right;
diff --git a/src/x11/window-x11.h b/src/x11/window-x11.h
index 7f4f96f6c..d41d0d156 100644
--- a/src/x11/window-x11.h
+++ b/src/x11/window-x11.h
@@ -89,8 +89,8 @@ void meta_window_x11_set_thaw_after_paint (MetaWindow *window,
gboolean meta_window_x11_should_thaw_after_paint (MetaWindow *window);
gboolean meta_window_x11_always_update_shape (MetaWindow *window);
-void meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
- MetaRectangle *buffer_rect,
+void meta_window_x11_surface_rect_to_frame_rect (MetaWindow *window,
+ MetaRectangle *surface_rect,
MetaRectangle *frame_rect);
void meta_window_x11_surface_rect_to_client_rect (MetaWindow *window,
MetaRectangle *surface_rect,
--
2.26.0.rc2

View File

@ -0,0 +1,29 @@
From 509e9ca5a0009268faaa7373c984e2df710a48e2 Mon Sep 17 00:00:00 2001
From: Sebastian Keller <skeller@gnome.org>
Date: Tue, 10 Mar 2020 23:27:35 +0100
Subject: [PATCH 15/48] xwayland: Fix mime type atom list leak on DnD with more
than 3 types
Found using the clang static analyzer
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1117
---
src/wayland/meta-xwayland-dnd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c
index 9821f2dc3..6b75362ba 100644
--- a/src/wayland/meta-xwayland-dnd.c
+++ b/src/wayland/meta-xwayland-dnd.c
@@ -171,7 +171,7 @@ xdnd_send_enter (MetaXWaylandDnd *dnd,
/* We have more than 3 mimetypes, we must set up
* the mimetype list as a XdndTypeList property.
*/
- Atom *atomlist;
+ g_autofree Atom *atomlist = NULL;
gint i = 0;
xev.xclient.data.l[1] |= 1;
--
2.26.0.rc2

View File

@ -0,0 +1,106 @@
From 531a195cf184b3d81e333dedf83bc51c3f37e97b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 11 Mar 2020 09:53:17 +0100
Subject: [PATCH 16/48] monitor-config-manager: Respect layout mode when
calculating CRTC layout
The scale used when calculating the CRTC layout should only come from
the logical monitor scale if the layout mode of the corresponding
configuration is 'logical'.
This fixes an issue where the X11 screen size accidentally got set to a
size scaled down by the configured global UI scale.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1107
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1109
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1118
---
src/backends/meta-monitor-config-manager.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index 2107b7463..5739ca18b 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -152,6 +152,7 @@ find_unassigned_crtc (MetaOutput *output,
typedef struct
{
MetaMonitorManager *monitor_manager;
+ MetaMonitorsConfig *config;
MetaLogicalMonitorConfig *logical_monitor_config;
MetaMonitorConfig *monitor_config;
GPtrArray *crtc_infos;
@@ -173,7 +174,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
MetaMonitorTransform crtc_transform;
int crtc_x, crtc_y;
float x_offset, y_offset;
- float scale;
+ float scale = 0.0;
float width, height;
MetaCrtcMode *crtc_mode;
graphene_rect_t crtc_layout;
@@ -209,7 +210,17 @@ assign_monitor_crtc (MetaMonitor *monitor,
x_offset = data->logical_monitor_config->layout.x;
y_offset = data->logical_monitor_config->layout.y;
- scale = data->logical_monitor_config->scale;
+
+ switch (data->config->layout_mode)
+ {
+ case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
+ scale = data->logical_monitor_config->scale;
+ break;
+ case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
+ scale = 1.0;
+ break;
+ }
+
crtc_mode = monitor_crtc_mode->crtc_mode;
if (meta_monitor_transform_is_rotated (crtc_transform))
@@ -272,6 +283,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
static gboolean
assign_monitor_crtcs (MetaMonitorManager *manager,
+ MetaMonitorsConfig *config,
MetaLogicalMonitorConfig *logical_monitor_config,
MetaMonitorConfig *monitor_config,
GPtrArray *crtc_infos,
@@ -307,6 +319,7 @@ assign_monitor_crtcs (MetaMonitorManager *manager,
data = (MonitorAssignmentData) {
.monitor_manager = manager,
+ .config = config,
.logical_monitor_config = logical_monitor_config,
.monitor_config = monitor_config,
.crtc_infos = crtc_infos,
@@ -324,6 +337,7 @@ assign_monitor_crtcs (MetaMonitorManager *manager,
static gboolean
assign_logical_monitor_crtcs (MetaMonitorManager *manager,
+ MetaMonitorsConfig *config,
MetaLogicalMonitorConfig *logical_monitor_config,
GPtrArray *crtc_infos,
GPtrArray *output_infos,
@@ -337,6 +351,7 @@ assign_logical_monitor_crtcs (MetaMonitorManager *manager,
MetaMonitorConfig *monitor_config = l->data;
if (!assign_monitor_crtcs (manager,
+ config,
logical_monitor_config,
monitor_config,
crtc_infos, output_infos,
@@ -395,7 +410,8 @@ meta_monitor_config_manager_assign (MetaMonitorManager *manager,
{
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
- if (!assign_logical_monitor_crtcs (manager, logical_monitor_config,
+ if (!assign_logical_monitor_crtcs (manager,
+ config, logical_monitor_config,
crtc_infos, output_infos,
reserved_crtcs, error))
{
--
2.26.0.rc2

View File

@ -0,0 +1,32 @@
From d2a12ee0fabff9a7f0c71a025aba0a99c377c8b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 11 Mar 2020 11:06:00 +0100
Subject: [PATCH 17/48] crtc-xrandr: Compare right coordinate when checking
assignment
Compare x with x, and y with y, not y with x.
Fixes an issue where only changing the scale doesn't actually apply the
new scale.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1119
---
src/backends/x11/meta-crtc-xrandr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/x11/meta-crtc-xrandr.c b/src/backends/x11/meta-crtc-xrandr.c
index 3b9d90aa7..678e68a9b 100644
--- a/src/backends/x11/meta-crtc-xrandr.c
+++ b/src/backends/x11/meta-crtc-xrandr.c
@@ -195,7 +195,7 @@ meta_crtc_xrandr_is_assignment_changed (MetaCrtc *crtc,
if (crtc_xrandr->rect.x != (int) roundf (crtc_info->layout.origin.x))
return TRUE;
- if (crtc_xrandr->rect.y != (int) roundf (crtc_info->layout.origin.x))
+ if (crtc_xrandr->rect.y != (int) roundf (crtc_info->layout.origin.y))
return TRUE;
if (crtc_xrandr->transform != crtc_info->transform)
--
2.26.0.rc2

View File

@ -0,0 +1,45 @@
From 512bb7d1cd0836e6d110609a16fdbf9f9f5b30df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 11 Mar 2020 13:27:07 +0100
Subject: [PATCH 18/48] wayland: Don't crash when trying to fullscreen on inert
wl_output
There is a race where an output can be used as a fullscreen target, but
it has already been removed due to a hotplug. Handle this gracefully by
ignoring said output in such situations.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1120
---
src/wayland/meta-wayland-legacy-xdg-shell.c | 2 +-
src/wayland/meta-wayland-xdg-shell.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c
index e438f2460..eba802e0c 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -439,7 +439,7 @@ zxdg_toplevel_v6_set_fullscreen (struct wl_client *client,
if (output_resource)
{
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
- if (output)
+ if (output && output->logical_monitor)
meta_window_move_to_monitor (window, output->logical_monitor->number);
}
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index fefed4596..d8f639757 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -456,7 +456,7 @@ xdg_toplevel_set_fullscreen (struct wl_client *client,
{
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
- if (output)
+ if (output && output->logical_monitor)
{
meta_window_move_to_monitor (window,
output->logical_monitor->number);
--
2.26.0.rc2

View File

@ -0,0 +1,57 @@
From aba0b9ef643a14d6187c42c1733b6309332c1ed1 Mon Sep 17 00:00:00 2001
From: Alynx Zhou <alynx.zhou@gmail.com>
Date: Thu, 9 Jan 2020 10:12:41 +0800
Subject: [PATCH 19/48] keybindings: Move common window grab code out of X-only
if statement
`3c8d4171` moved some common codes into X11-only code blocks by mistake,
and it prevents keyboard window resize/move mode under Wayland because
those variables are unset. This commit fixed it via moving such common
codes out of X11-only code blocks.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/949
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/997
---
src/core/keybindings.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 64f392f07..ab1ace5ae 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1820,12 +1820,12 @@ meta_window_grab_all_keys (MetaWindow *window,
meta_topic (META_DEBUG_KEYBINDINGS,
"Grabbing all keys on window %s\n", window->desc);
retval = grab_keyboard (grabwindow, timestamp, XIGrabModeAsync);
- if (retval)
- {
- window->keys_grabbed = FALSE;
- window->all_keys_grabbed = TRUE;
- window->grab_on_frame = window->frame != NULL;
- }
+ }
+ if (retval)
+ {
+ window->keys_grabbed = FALSE;
+ window->all_keys_grabbed = TRUE;
+ window->grab_on_frame = window->frame != NULL;
}
return retval;
@@ -1835,9 +1835,10 @@ void
meta_window_ungrab_all_keys (MetaWindow *window,
guint32 timestamp)
{
- if (!meta_is_wayland_compositor () && window->all_keys_grabbed)
+ if (window->all_keys_grabbed)
{
- ungrab_keyboard (timestamp);
+ if (!meta_is_wayland_compositor())
+ ungrab_keyboard (timestamp);
window->grab_on_frame = FALSE;
window->all_keys_grabbed = FALSE;
--
2.26.0.rc2

View File

@ -0,0 +1,39 @@
From 5319949a45bb22f5c998b485e955c1ddd13810f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 11 Mar 2020 11:46:48 +0100
Subject: [PATCH 20/48] kms-impl-device: Clean up state if drm resources
disappear
It may happen that drmModeGetResources() starts returning NULL. Handle
this gracefully by removing all connectors, CRTCs and planes making the
device in practice defunct.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1121
---
src/backends/native/meta-kms-impl-device.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c
index e4f10d66e..80d7a8b01 100644
--- a/src/backends/native/meta-kms-impl-device.c
+++ b/src/backends/native/meta-kms-impl-device.c
@@ -365,6 +365,16 @@ meta_kms_impl_device_update_states (MetaKmsImplDevice *impl_device)
meta_assert_in_kms_impl (meta_kms_impl_get_kms (impl_device->impl));
drm_resources = drmModeGetResources (impl_device->fd);
+ if (!drm_resources)
+ {
+ g_list_free_full (impl_device->planes, g_object_unref);
+ g_list_free_full (impl_device->crtcs, g_object_unref);
+ g_list_free_full (impl_device->connectors, g_object_unref);
+ impl_device->planes = NULL;
+ impl_device->crtcs = NULL;
+ impl_device->connectors = NULL;
+ return;
+ }
update_connectors (impl_device, drm_resources);
--
2.26.0.rc2

View File

@ -0,0 +1,27 @@
From df332551623629eb5373bdc7a8fa125a128c4351 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Corentin=20No=C3=ABl?= <corentin@elementary.io>
Date: Mon, 2 Mar 2020 12:15:57 +0100
Subject: [PATCH 21/48] cogl: Add main header for Cogl
This allows bindings linking to the C header to actually have the right one.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1101
---
cogl/cogl/meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build
index 0297a2485..be93ba2f9 100644
--- a/cogl/cogl/meson.build
+++ b/cogl/cogl/meson.build
@@ -478,6 +478,7 @@ if have_introspection
'-D__COGL_GLX_H_INSIDE__',
'-DCOGL_GIR_SCANNING',
],
+ header: 'cogl/cogl.h',
install_dir_gir: pkglibdir,
install_dir_typelib: pkglibdir,
install: true
--
2.26.0.rc2

View File

@ -0,0 +1,34 @@
From 6989fea76717b54496da829aca7ca5591ff36a52 Mon Sep 17 00:00:00 2001
From: Andre Moreira Magalhaes <andre@endlessm.com>
Date: Thu, 12 Mar 2020 17:49:11 -0300
Subject: [PATCH 22/48] cogl: Fix build error when GL_ARB_sync is not defined
Commit 41992757e0 introduced a change to use CoglContext.glFenceSync
but this method is only available when GL_ARB_sync is defined (as
defined on gl-prototypes/cogl-all-functions.h).
This change fixes that.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1123
---
cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
index e0c8ca1fa..ca98823e8 100644
--- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -366,8 +366,10 @@ _cogl_driver_update_features (CoglContext *context,
_cogl_check_extension ("GL_OES_egl_sync", gl_extensions))
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_OES_EGL_SYNC, TRUE);
+#ifdef GL_ARB_sync
if (context->glFenceSync)
COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_FENCE, TRUE);
+#endif
if (_cogl_check_extension ("GL_EXT_texture_rg", gl_extensions))
COGL_FLAGS_SET (context->features,
--
2.26.0.rc2

View File

@ -0,0 +1,54 @@
From 67dd0b4fec6eecb6fa6c7ed6784820901a53e2bf Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 12 Mar 2020 19:26:37 +0100
Subject: [PATCH 23/48] keybindings: Avoid double calls to process_event() on
the same event
If you first press a key that triggers the "special modifier key" paths
(ctrl, super), and then press another key that doesn't match (yet?) any
keybindings (eg. ctrl+alt, super+x), the second key press goes twice
through process_event(), once in the processing of this so far special
combination and another while we let the event through.
In order to keep things consistent, handle it differently depending on
whether we are a wayland compositor or not. For X11, consider the event
handled after the call to process_event() in process_special_modifier_key().
For Wayland, as XIAllowEvents is not the mechanism that allows clients see
the key event, we can just fall through the regular paths, without this
special handling.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1014
---
src/core/keybindings.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index ab1ace5ae..2cf705598 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2037,6 +2037,13 @@ process_special_modifier_key (MetaDisplay *display,
{
*modifier_press_only = FALSE;
+ /* If this is a wayland session, we can avoid the shenanigans
+ * about passive grabs below, and let the event continue to
+ * be processed through the regular paths.
+ */
+ if (!xdisplay)
+ return FALSE;
+
/* OK, the user hit modifier+key rather than pressing and
* releasing the modifier key alone. We want to handle the key
* sequence "normally". Unfortunately, using
@@ -2069,8 +2076,6 @@ process_special_modifier_key (MetaDisplay *display,
XIAllowEvents (xdisplay,
clutter_input_device_get_device_id (event->device),
XIReplayDevice, event->time);
-
- return FALSE;
}
}
else if (event->type == CLUTTER_KEY_RELEASE)
--
2.26.0.rc2

View File

@ -0,0 +1,56 @@
From 23da6c2426932dcb2057849eec9e1d79c34fc405 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 12 Mar 2020 19:43:15 +0100
Subject: [PATCH 24/48] keybindings: Check the special modifiers specifically
Make sure it is only the special modifier (hardcoded to 1 currently)
which is being pressed (not counting locked modifiers) before notifying
that the special modifier is pressed, as we are interested in it being
pressed alone and not in combination with other modifier keys.
This helps in two ways:
- Pressing alt, then ctrl, then releasing both won't trigger the locate
pointer action.
- Pressing alt, then ctrl, then down/up to switch workspace won't interpret
the last up/down keypress as an additional key on top of the special ctrl
modifier, thus won't be forwarded down to the focused client in the last
second.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/812
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1014
---
src/core/keybindings.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 2cf705598..7f930874f 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -63,6 +63,15 @@
#define META_KEY_BINDING_PRIMARY_LAYOUT 0
#define META_KEY_BINDING_SECONDARY_LAYOUT 1
+/* Only for special modifier keys */
+#define IGNORED_MODIFIERS (CLUTTER_LOCK_MASK | \
+ CLUTTER_MOD2_MASK | \
+ CLUTTER_BUTTON1_MASK | \
+ CLUTTER_BUTTON2_MASK | \
+ CLUTTER_BUTTON3_MASK | \
+ CLUTTER_BUTTON4_MASK | \
+ CLUTTER_BUTTON5_MASK)
+
static gboolean add_builtin_keybinding (MetaDisplay *display,
const char *name,
GSettings *settings,
@@ -2120,6 +2129,7 @@ process_special_modifier_key (MetaDisplay *display,
return TRUE;
}
else if (event->type == CLUTTER_KEY_PRESS &&
+ (event->modifier_state & ~(IGNORED_MODIFIERS)) == 0 &&
resolved_key_combo_has_keycode (resolved_key_combo,
event->hardware_keycode))
{
--
2.26.0.rc2

View File

@ -0,0 +1,291 @@
From 0487e6f11fc9231214c03bd8eb5050a7e04a621d Mon Sep 17 00:00:00 2001
From: Andrew Gaul <andrew@gaul.org>
Date: Fri, 5 Oct 2018 17:06:58 -0700
Subject: [PATCH 25/48] input-settings: Wire up middle-emulation
This allows emulating middle click via simultaneous left and right
click. Fixes #238.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/256
---
src/backends/meta-input-settings-private.h | 11 ++++
src/backends/meta-input-settings.c | 43 ++++++++++++
.../native/meta-input-settings-native.c | 65 +++++++++++++++++++
src/backends/x11/meta-input-settings-x11.c | 53 +++++++++++++++
4 files changed, 172 insertions(+)
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index a035db78f..135b17f1a 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -114,6 +114,17 @@ struct _MetaInputSettingsClass
GDesktopStylusButtonAction primary,
GDesktopStylusButtonAction secondary,
GDesktopStylusButtonAction tertiary);
+
+ void (* set_mouse_middle_click_emulation) (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled);
+ void (* set_touchpad_middle_click_emulation) (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled);
+ void (* set_trackball_middle_click_emulation) (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled);
+
gboolean (* has_two_finger_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device);
gboolean (* is_trackball_device) (MetaInputSettings *settings,
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 08762ac72..67dfd82b2 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -418,6 +418,39 @@ get_settings_for_device_type (MetaInputSettings *input_settings,
}
}
+static void
+update_middle_click_emulation (MetaInputSettings *input_settings,
+ GSettings *settings,
+ ClutterInputDevice *device)
+{
+ ConfigBoolFunc func;
+ const gchar *key = "emulate-middle";
+ MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
+
+ if (!settings)
+ return;
+
+ if (settings == priv->mouse_settings)
+ func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_mouse_middle_click_emulation;
+ else if (settings == priv->touchpad_settings)
+ func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_touchpad_middle_click_emulation;
+ else if (settings == priv->trackball_settings)
+ func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_trackball_middle_click_emulation;
+ else
+ return;
+
+ if (device)
+ {
+ settings_device_set_bool_setting (input_settings, device, func,
+ g_settings_get_boolean (settings, key));
+ }
+ else
+ {
+ settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
+ g_settings_get_boolean (settings, key));
+ }
+}
+
static void
update_device_speed (MetaInputSettings *input_settings,
ClutterInputDevice *device)
@@ -1141,6 +1174,8 @@ meta_input_settings_changed_cb (GSettings *settings,
update_device_natural_scroll (input_settings, NULL);
else if (strcmp (key, "accel-profile") == 0)
update_pointer_accel_profile (input_settings, settings, NULL);
+ else if (strcmp (key, "middle-click-emulation") == 0)
+ update_middle_click_emulation (input_settings, settings, NULL);
}
else if (settings == priv->touchpad_settings)
{
@@ -1164,6 +1199,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, "middle-click-emulation") == 0)
+ update_middle_click_emulation (input_settings, settings, NULL);
}
else if (settings == priv->trackball_settings)
{
@@ -1171,6 +1208,8 @@ meta_input_settings_changed_cb (GSettings *settings,
update_trackball_scroll_button (input_settings, NULL);
else if (strcmp (key, "accel-profile") == 0)
update_pointer_accel_profile (input_settings, settings, NULL);
+ else if (strcmp (key, "middle-click-emulation") == 0)
+ update_middle_click_emulation (input_settings, settings, NULL);
}
else if (settings == priv->keyboard_settings)
{
@@ -1687,6 +1726,10 @@ apply_device_settings (MetaInputSettings *input_settings,
device);
load_keyboard_a11y_settings (input_settings, device);
load_pointer_a11y_settings (input_settings, device);
+
+ update_middle_click_emulation (input_settings, priv->mouse_settings, device);
+ update_middle_click_emulation (input_settings, priv->touchpad_settings, device);
+ update_middle_click_emulation (input_settings, priv->trackball_settings, device);
}
static void
diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c
index eb06911bf..fe82e8d1f 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -400,6 +400,13 @@ is_mouse_device (ClutterInputDevice *device)
!has_udev_property (device, "ID_INPUT_POINTINGSTICK"));
}
+static gboolean
+meta_input_settings_native_is_touchpad_device (MetaInputSettings *settings,
+ ClutterInputDevice *device)
+{
+ return has_udev_property (device, "ID_INPUT_TOUCHPAD");
+}
+
static gboolean
meta_input_settings_native_is_trackball_device (MetaInputSettings *settings,
ClutterInputDevice *device)
@@ -562,6 +569,60 @@ meta_input_settings_native_set_stylus_button_map (MetaInputSettings *se
action_to_evcode (tertiary));
}
+static void
+meta_input_settings_native_set_mouse_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ struct libinput_device *libinput_device;
+
+ if (!is_mouse_device (device))
+ return;
+
+ libinput_device = meta_input_device_native_get_libinput_device (device);
+ if (!libinput_device)
+ return;
+
+ if (libinput_device_config_middle_emulation_is_available (libinput_device))
+ libinput_device_config_middle_emulation_set_enabled (libinput_device, enabled);
+}
+
+static void
+meta_input_settings_native_set_touchpad_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ struct libinput_device *libinput_device;
+
+ if (!meta_input_settings_native_is_touchpad_device (settings, device))
+ return;
+
+ libinput_device = meta_input_device_native_get_libinput_device (device);
+ if (!libinput_device)
+ return;
+
+ if (libinput_device_config_middle_emulation_is_available (libinput_device))
+ libinput_device_config_middle_emulation_set_enabled (libinput_device, enabled);
+}
+
+static void
+meta_input_settings_native_set_trackball_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ struct libinput_device *libinput_device;
+
+ if (!meta_input_settings_native_is_trackball_device (settings, device))
+ return;
+
+ libinput_device = meta_input_device_native_get_libinput_device (device);
+ if (!libinput_device)
+ return;
+
+ if (libinput_device_config_middle_emulation_is_available (libinput_device))
+ libinput_device_config_middle_emulation_set_enabled (libinput_device, enabled);
+}
+
static void
meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
{
@@ -591,6 +652,10 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
input_settings_class->set_stylus_pressure = meta_input_settings_native_set_stylus_pressure;
input_settings_class->set_stylus_button_map = meta_input_settings_native_set_stylus_button_map;
+ input_settings_class->set_mouse_middle_click_emulation = meta_input_settings_native_set_mouse_middle_click_emulation;
+ input_settings_class->set_touchpad_middle_click_emulation = meta_input_settings_native_set_touchpad_middle_click_emulation;
+ input_settings_class->set_trackball_middle_click_emulation = meta_input_settings_native_set_trackball_middle_click_emulation;
+
input_settings_class->has_two_finger_scroll = meta_input_settings_native_has_two_finger_scroll;
input_settings_class->is_trackball_device = meta_input_settings_native_is_trackball_device;
}
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 05f932420..a9658e702 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -512,6 +512,13 @@ is_mouse (MetaInputSettings *settings,
!has_udev_property (settings, device, "ID_INPUT_POINTINGSTICK"));
}
+static gboolean
+meta_input_settings_x11_is_touchpad_device (MetaInputSettings *settings,
+ ClutterInputDevice *device)
+{
+ return has_udev_property (settings, device, "ID_INPUT_TOUCHPAD");
+}
+
static gboolean
meta_input_settings_x11_is_trackball_device (MetaInputSettings *settings,
ClutterInputDevice *device)
@@ -820,6 +827,48 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
}
}
+static void
+meta_input_settings_x11_set_mouse_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ guchar value = enabled ? 1 : 0;
+
+ if (!is_mouse (settings, device))
+ return;
+
+ change_property (device, "libinput Middle Click Emulation Enabled",
+ XA_INTEGER, 8, &value, 1);
+}
+
+static void
+meta_input_settings_x11_set_touchpad_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ guchar value = enabled ? 1 : 0;
+
+ if (!meta_input_settings_x11_is_touchpad_device (settings, device))
+ return;
+
+ change_property (device, "libinput Middle Click Emulation Enabled",
+ XA_INTEGER, 8, &value, 1);
+}
+
+static void
+meta_input_settings_x11_set_trackball_middle_click_emulation (MetaInputSettings *settings,
+ ClutterInputDevice *device,
+ gboolean enabled)
+{
+ guchar value = enabled ? 1 : 0;
+
+ if (!meta_input_settings_x11_is_trackball_device (settings, device))
+ return;
+
+ change_property (device, "libinput Middle Click Emulation Enabled",
+ XA_INTEGER, 8, &value, 1);
+}
+
static void
meta_input_settings_x11_set_stylus_pressure (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -864,6 +913,10 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
input_settings_class->set_stylus_pressure = meta_input_settings_x11_set_stylus_pressure;
input_settings_class->set_stylus_button_map = meta_input_settings_x11_set_stylus_button_map;
+ input_settings_class->set_mouse_middle_click_emulation = meta_input_settings_x11_set_mouse_middle_click_emulation;
+ input_settings_class->set_touchpad_middle_click_emulation = meta_input_settings_x11_set_touchpad_middle_click_emulation;
+ input_settings_class->set_trackball_middle_click_emulation = meta_input_settings_x11_set_trackball_middle_click_emulation;
+
input_settings_class->has_two_finger_scroll = meta_input_settings_x11_has_two_finger_scroll;
input_settings_class->is_trackball_device = meta_input_settings_x11_is_trackball_device;
}
--
2.26.0.rc2

View File

@ -0,0 +1,26 @@
From 0700f3749f7d469bd229866b1cd6b8acb7346f4c Mon Sep 17 00:00:00 2001
From: Andrew Gaul <andrew@gaul.org>
Date: Sun, 16 Jun 2019 16:57:50 -0700
Subject: [PATCH 26/48] input-settings/x11: Fix typo in has_udev_property
https://gitlab.gnome.org/GNOME/mutter/merge_requests/256
---
src/backends/x11/meta-input-settings-x11.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index a9658e702..40067770f 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -496,7 +496,7 @@ has_udev_property (MetaInputSettings *settings,
if (!warned_once)
{
- g_warning ("Failed to set acceleration profile: no udev support");
+ g_warning ("Failed to query property: no udev support");
warned_once = TRUE;
}
--
2.26.0.rc2

View File

@ -0,0 +1,28 @@
From 074f4974ddc6bf8d05914bded058fd131a3fdc8a Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Mon, 16 Mar 2020 15:09:00 +0800
Subject: [PATCH 27/48] input-settings: Specify middle-click-emulation key
Which exists, unlike `emulate-middle`.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1124
---
src/backends/meta-input-settings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 67dfd82b2..3bee36d41 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -424,7 +424,7 @@ update_middle_click_emulation (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
ConfigBoolFunc func;
- const gchar *key = "emulate-middle";
+ const gchar *key = "middle-click-emulation";
MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
if (!settings)
--
2.26.0.rc2

View File

@ -0,0 +1,114 @@
From 4133b736321adf8559f1ac80e7e5b9b55dd4f187 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Sat, 14 Mar 2020 15:52:38 +0100
Subject: [PATCH 28/48] cursor-renderer/native: Skip hw cursor upload if we
can't use it
If the CRTCs the cursor is visible on do not share a common scale
and transform, we can't use the cursor hardware plane as we only have one.
We therefore fall back to software / gl cursor.
The check for that currently happens after we tried to upload the cursor image
to the hardware plane though.
This is made worse by the fact that in the scaling step, where we scale the
cursor image to the desired size, until now we expected a valid common scale -
otherwise scaling the image by an uninitialized float.
Make sure we bail out early during the scale/upload step if we don't have common
scales and transforms - to avoid that bug and save some unnecessary work.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1125
---
.../native/meta-cursor-renderer-native.c | 56 ++++++++++++-------
1 file changed, 36 insertions(+), 20 deletions(-)
diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c
index b400a8740..cda4262d3 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -1393,6 +1393,26 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
MetaMonitorTransform relative_transform;
uint32_t gbm_format;
+ if (!get_common_crtc_sprite_scale_for_logical_monitors (renderer,
+ cursor_sprite,
+ &relative_scale))
+ {
+ unset_can_preprocess (cursor_sprite);
+ return;
+ }
+
+ if (!get_common_crtc_sprite_transform_for_logical_monitors (renderer,
+ cursor_sprite,
+ &relative_transform))
+ {
+ unset_can_preprocess (cursor_sprite);
+ return;
+ }
+
+ set_can_preprocess (cursor_sprite,
+ relative_scale,
+ relative_transform);
+
wl_shm_buffer_begin_access (shm_buffer);
buffer_data = wl_shm_buffer_get_data (shm_buffer);
@@ -1412,18 +1432,6 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
gbm_format = GBM_FORMAT_ARGB8888;
}
- get_common_crtc_sprite_scale_for_logical_monitors (renderer,
- cursor_sprite,
- &relative_scale);
-
- get_common_crtc_sprite_transform_for_logical_monitors (renderer,
- cursor_sprite,
- &relative_transform);
-
- set_can_preprocess (cursor_sprite,
- relative_scale,
- relative_transform);
-
load_scaled_and_transformed_cursor_sprite (native,
gpu_kms,
cursor_sprite,
@@ -1502,20 +1510,28 @@ realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
is_cursor_scale_and_transform_valid (renderer, cursor_sprite))
return;
- xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
-
- get_common_crtc_sprite_scale_for_logical_monitors (renderer,
- cursor_sprite,
- &relative_scale);
+ if (!get_common_crtc_sprite_scale_for_logical_monitors (renderer,
+ cursor_sprite,
+ &relative_scale))
+ {
+ unset_can_preprocess (cursor_sprite);
+ return;
+ }
- get_common_crtc_sprite_transform_for_logical_monitors (renderer,
- cursor_sprite,
- &relative_transform);
+ if (!get_common_crtc_sprite_transform_for_logical_monitors (renderer,
+ cursor_sprite,
+ &relative_transform))
+ {
+ unset_can_preprocess (cursor_sprite);
+ return;
+ }
set_can_preprocess (cursor_sprite,
relative_scale,
relative_transform);
+ xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
+
load_scaled_and_transformed_cursor_sprite (native,
gpu_kms,
cursor_sprite,
--
2.26.0.rc2

View File

@ -0,0 +1,62 @@
From 0053ef2e1633cf6f1be249a7b9fa83a35e8664f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Corentin=20No=C3=ABl?= <corentin@elementary.io>
Date: Tue, 17 Mar 2020 13:21:11 +0100
Subject: [PATCH 29/48] cogl-texture: Add some missing array annotations
This allows bindings to correctly understand that it is an array
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1130
---
cogl/cogl/cogl-texture.h | 8 ++++----
cogl/cogl/deprecated/cogl-auto-texture.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cogl/cogl/cogl-texture.h b/cogl/cogl/cogl-texture.h
index 924912d02..d9727dbbe 100644
--- a/cogl/cogl/cogl-texture.h
+++ b/cogl/cogl/cogl-texture.h
@@ -320,8 +320,8 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
* @rowstride: the rowstride of @data in bytes or pass 0 to calculate
* from the bytes-per-pixel of @format multiplied by the
* @texture width.
- * @data: memory location to write the @texture's contents, or %NULL
- * to only query the data size through the return value.
+ * @data: (array) (nullable): memory location to write the @texture's contents,
+ * or %NULL to only query the data size through the return value.
*
* Copies the pixel data from a cogl texture to system memory.
*
@@ -354,7 +354,7 @@ cogl_texture_get_data (CoglTexture *texture,
* @format: the #CoglPixelFormat used in the source buffer.
* @rowstride: rowstride of source buffer (computed from width if none
* specified)
- * @data: the actual pixel data.
+ * @data: (array): the actual pixel data.
*
* Sets the pixels in a rectangular subregion of @texture from an in-memory
* buffer containing pixel data.
@@ -384,7 +384,7 @@ cogl_texture_set_region (CoglTexture *texture,
* @format: the #CoglPixelFormat used in the source @data buffer.
* @rowstride: rowstride of the source @data buffer (computed from
* the texture width and @format if it equals 0)
- * @data: the source data, pointing to the first top-left pixel to set
+ * @data: (array): the source data, pointing to the first top-left pixel to set
* @level: The mipmap level to update (Normally 0 for the largest,
* base texture)
* @error: A #GError to return exceptional errors
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.h b/cogl/cogl/deprecated/cogl-auto-texture.h
index df2b1da29..afd5cf98c 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.h
+++ b/cogl/cogl/deprecated/cogl-auto-texture.h
@@ -104,7 +104,7 @@ cogl_texture_new_from_file (const char *filename,
* something other than straight blending.
* @rowstride: the memory offset in bytes between the starts of
* scanlines in @data
- * @data: pointer the memory region where the source buffer resides
+ * @data: (array): pointer the memory region where the source buffer resides
*
* Creates a new #CoglTexture based on data residing in memory.
*
--
2.26.0.rc2

View File

@ -0,0 +1,40 @@
From b310e1d9d7c9e20de957c4ea1ff1d2b819aeb0a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Corentin=20No=C3=ABl?= <corentin@elementary.io>
Date: Tue, 17 Mar 2020 13:37:49 +0100
Subject: [PATCH 30/48] clutter-stage: Add annotations to clutter_stage_capture
Especially document that out_captures is an array that is given as output.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1131
---
clutter/clutter/clutter-stage.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 80061bba7..a5d73e63f 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -4349,6 +4349,20 @@ capture_view (ClutterStage *stage,
cairo_surface_mark_dirty (capture->image);
}
+/**
+ * clutter_stage_capture:
+ * @stage: a #ClutterStage
+ * @paint: whether to pain the frame
+ * @rect: a #cairo_rectangle_int_t in stage coordinates
+ * @out_captures: (out) (array length=out_n_captures): an array of
+ * #ClutterCapture
+ * @out_n_captures: (out): the number of captures in @out_captures
+ *
+ * Captures the stage pixels of @rect into @captures. @rect is in stage
+ * coordinates.
+ *
+ * Returns: %TRUE if a #ClutterCapture has been created, %FALSE otherwise
+ */
gboolean
clutter_stage_capture (ClutterStage *stage,
gboolean paint,
--
2.26.0.rc2

View File

@ -0,0 +1,52 @@
From fa74da0039b848e3beaff5d0da44e6d3f2c46dc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 12 Mar 2020 19:34:03 +0100
Subject: [PATCH 31/48] wayland/window: Ignore state changes for popups
We send configure events for state changes e.g. for `appears-focused`,
etc. What we don't want to do is to do this for popup windows, as in
Wayland don't care about this state.
When the focus mode was configured to "sloppy focus" we'd get
`appears-focused` state changes for the popup window only by moving the
mouse cursor around, and while a popup may care about focus, it does not
care about related appearance, as there is no such state in xdg_popup.
What these state changes instead resulted in was absolute window
configuration events, intended for toplevel (xdg_toplevel) windows. In
the end this caused the popup to be positioned aginst at (0, 0) of the
parent window, as the assumptions when the configuration of the popup
was acknowledged is that it had received a relative position window
configuration.
Fix this by simply ignoring any state changes of the window if it is a
popup, meaning we won't send any configuration events intended for
toplevels for state changes. Currently we don't have any way to know
this other than checking whether it has a placement rule. Cleaning up
MetaWindow creation is left to be dealt with another day.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1103
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1122
---
src/wayland/meta-window-wayland.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index 86cdbf86e..b6b949e36 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -634,6 +634,10 @@ appears_focused_changed (GObject *object,
gpointer user_data)
{
MetaWindow *window = META_WINDOW (object);
+
+ if (window->placement.rule)
+ return;
+
surface_state_changed (window);
}
--
2.26.0.rc2

View File

@ -1,7 +1,8 @@
From db9b60cc6357539d0deefd9ded236b1dd302d4a2 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 17 Mar 2020 16:11:57 +0100
Subject: [PATCH] wayland: Represent preedit string cursor offset in bytes
Subject: [PATCH 32/48] wayland: Represent preedit string cursor offset in
bytes
Both IBus and ClutterInputFocus work in character offsets for the cursor
position in the preedit string. However the zwp_text_input protocol does
@ -38,5 +39,5 @@ index ee9b895cb..deff44c1b 100644
meta_wayland_text_input_focus_defer_done (focus);
--
2.25.1
2.26.0.rc2

View File

@ -0,0 +1,46 @@
From c9a5b2b22f4bbe53bae2008ffa12b7376ca68b01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 17 Jan 2020 08:28:17 +0100
Subject: [PATCH 33/48] kms-impl-simple: Handle lack of cached mode set in flip
fallback
When a page flip fails with a certain error code, we've treated this as
a hint that page flipping is broken and we should try to use mode
setting instead.
On some drivers, it seems that this error is also reported when there
was no mode set, which means we'll have no cached mode set to use in the
fallback. The lack of prior mode set tends to happen when we hit a race
when the DRM objects change before we have the time to process a hotplug
event.
Handle the lack a missing mode set in the flip fallback path, with the
assumption that we'll get a hotplug event that'll fix things up for us
eventually.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/917
---
src/backends/native/meta-kms-impl-simple.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/backends/native/meta-kms-impl-simple.c b/src/backends/native/meta-kms-impl-simple.c
index 1bb84538c..ddc31b938 100644
--- a/src/backends/native/meta-kms-impl-simple.c
+++ b/src/backends/native/meta-kms-impl-simple.c
@@ -567,7 +567,12 @@ mode_set_fallback (MetaKmsImplSimple *impl_simple,
cached_mode_set = g_hash_table_lookup (impl_simple->cached_mode_sets,
crtc);
- g_assert (cached_mode_set);
+ if (!cached_mode_set)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Missing mode set for page flip fallback");
+ return FALSE;
+ }
fill_connector_ids_array (cached_mode_set->connectors,
&connectors,
--
2.26.0.rc2

View File

@ -0,0 +1,172 @@
From 0a6034ef3a745c25ab63c2ca8d4ae08bc5e09d88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 28 Feb 2020 11:09:46 +0100
Subject: [PATCH 34/48] monitor-manager: Remove 'mirror' capability
With per-CRTC views, there is nothing stopping NVIDA EGLStream based
rendering to not support monitor mirroring, so lets remove that
restriction.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1098
---
src/backends/meta-monitor-manager-dummy.c | 2 --
src/backends/meta-monitor-manager-private.h | 5 ++--
src/backends/meta-monitor-manager.c | 6 ----
.../native/meta-monitor-manager-kms.c | 5 ----
src/backends/native/meta-renderer-native.c | 28 -------------------
src/backends/native/meta-renderer-native.h | 2 --
.../x11/meta-monitor-manager-xrandr.c | 3 +-
src/tests/meta-monitor-manager-test.c | 2 --
8 files changed, 3 insertions(+), 50 deletions(-)
diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c
index 470c327e5..2ddd826a8 100644
--- a/src/backends/meta-monitor-manager-dummy.c
+++ b/src/backends/meta-monitor-manager-dummy.c
@@ -714,8 +714,6 @@ meta_monitor_manager_dummy_get_capabilities (MetaMonitorManager *manager)
MetaMonitorManagerCapability capabilities =
META_MONITOR_MANAGER_CAPABILITY_NONE;
- capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING;
-
if (meta_settings_is_experimental_feature_enabled (
settings,
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER))
diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h
index 4dd0364a8..a0a28b6c2 100644
--- a/src/backends/meta-monitor-manager-private.h
+++ b/src/backends/meta-monitor-manager-private.h
@@ -43,9 +43,8 @@
typedef enum _MetaMonitorManagerCapability
{
META_MONITOR_MANAGER_CAPABILITY_NONE = 0,
- META_MONITOR_MANAGER_CAPABILITY_MIRRORING = (1 << 0),
- META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE = (1 << 1),
- META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED = (1 << 2)
+ META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE = (1 << 0),
+ META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED = (1 << 1)
} MetaMonitorManagerCapability;
/* Equivalent to the 'method' enum in org.gnome.Mutter.DisplayConfig */
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index b94967d79..3505573b8 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -1446,12 +1446,6 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
g_variant_builder_init (&properties_builder, G_VARIANT_TYPE ("a{sv}"));
capabilities = meta_monitor_manager_get_capabilities (manager);
- if ((capabilities & META_MONITOR_MANAGER_CAPABILITY_MIRRORING) == 0)
- {
- g_variant_builder_add (&properties_builder, "{sv}",
- "supports-mirroring",
- g_variant_new_boolean (FALSE));
- }
g_variant_builder_add (&properties_builder, "{sv}",
"layout-mode",
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index b7da048e2..6dcba6442 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -547,8 +547,6 @@ meta_monitor_manager_kms_get_capabilities (MetaMonitorManager *manager)
{
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
MetaSettings *settings = meta_backend_get_settings (backend);
- MetaRenderer *renderer = meta_backend_get_renderer (backend);
- MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaMonitorManagerCapability capabilities =
META_MONITOR_MANAGER_CAPABILITY_NONE;
@@ -557,9 +555,6 @@ meta_monitor_manager_kms_get_capabilities (MetaMonitorManager *manager)
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER))
capabilities |= META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;
- if (meta_renderer_native_supports_mirroring (renderer_native))
- capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING;
-
return capabilities;
}
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 6d9243716..1ebc761eb 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -2793,34 +2793,6 @@ _cogl_winsys_egl_vtable = {
.context_init = meta_renderer_native_init_egl_context
};
-gboolean
-meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native)
-{
- MetaRenderer *renderer = META_RENDERER (renderer_native);
- MetaBackend *backend = meta_renderer_get_backend (renderer);
- GList *l;
-
- for (l = meta_backend_get_gpus (backend); l; l = l->next)
- {
- MetaGpuKms *gpu_kms = META_GPU_KMS (l->data);
- MetaRendererNativeGpuData *renderer_gpu_data;
-
- renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
- gpu_kms);
- switch (renderer_gpu_data->mode)
- {
- case META_RENDERER_NATIVE_MODE_GBM:
- break;
-#ifdef HAVE_EGL_DEVICE
- case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
- return FALSE;
-#endif
- }
- }
-
- return TRUE;
-}
-
static void
meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
{
diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h
index 650968c57..7abe7c152 100644
--- a/src/backends/native/meta-renderer-native.h
+++ b/src/backends/native/meta-renderer-native.h
@@ -51,8 +51,6 @@ MetaRendererNative * meta_renderer_native_new (MetaBackendNative *backend_nativ
struct gbm_device * meta_gbm_device_from_gpu (MetaGpuKms *gpu_kms);
-gboolean meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native);
-
void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native);
int64_t meta_renderer_native_get_frame_counter (MetaRendererNative *renderer_native);
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index fd105c07a..5c161896f 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -959,8 +959,7 @@ meta_monitor_manager_xrandr_calculate_supported_scales (MetaMonitorManager
static MetaMonitorManagerCapability
meta_monitor_manager_xrandr_get_capabilities (MetaMonitorManager *manager)
{
- return (META_MONITOR_MANAGER_CAPABILITY_MIRRORING |
- META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED);
+ return META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED;
}
static gboolean
diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c
index 49ef6494d..42a57608e 100644
--- a/src/tests/meta-monitor-manager-test.c
+++ b/src/tests/meta-monitor-manager-test.c
@@ -371,8 +371,6 @@ meta_monitor_manager_test_get_capabilities (MetaMonitorManager *manager)
MetaMonitorManagerCapability capabilities =
META_MONITOR_MANAGER_CAPABILITY_NONE;
- capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING;
-
if (is_monitor_framebuffer_scaled ())
capabilities |= META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;
--
2.26.0.rc2

View File

@ -0,0 +1,30 @@
From ed4b80cee59c5dc96912b9d3d594b066c6275aeb Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Wed, 18 Mar 2020 02:43:47 +0100
Subject: [PATCH 35/48] clutter/stage: Rename parameters to match documentation
To silence warnings during GIR generation.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1133
---
clutter/clutter/clutter-stage.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clutter/clutter/clutter-stage.h b/clutter/clutter/clutter-stage.h
index f60bb3a8c..19de749b9 100644
--- a/clutter/clutter/clutter-stage.h
+++ b/clutter/clutter/clutter-stage.h
@@ -233,8 +233,8 @@ CLUTTER_EXPORT
gboolean clutter_stage_capture (ClutterStage *stage,
gboolean paint,
cairo_rectangle_int_t *rect,
- ClutterCapture **captures,
- int *n_captures);
+ ClutterCapture **out_captures,
+ int *out_n_captures);
CLUTTER_EXPORT
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
float x,
--
2.26.0.rc2

View File

@ -0,0 +1,226 @@
From a13d60aae5e60abc531bf8b70700db1d8ba88f65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20=C8=98erb=C4=83nescu?= <daniel@serbanescu.dk>
Date: Thu, 19 Mar 2020 10:59:57 +0000
Subject: [PATCH 36/48] Update Romanian translation
---
po/ro.po | 78 ++++++++++++++++++++++++++++++++------------------------
1 file changed, 45 insertions(+), 33 deletions(-)
diff --git a/po/ro.po b/po/ro.po
index fdd5fe654..7803c092a 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -9,10 +9,9 @@ msgid ""
msgstr ""
"Project-Id-Version: metacity.HEAD.ro\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
-"POT-Creation-Date: 2019-08-06 00:49+0000\n"
-"PO-Revision-Date: 2019-08-18 14:25+0300\n"
-"Last-Translator: Florentina Mușat <florentina.musat.28 [at] gmail [dot] "
-"com>\n"
+"POT-Creation-Date: 2020-02-23 17:41+0000\n"
+"PO-Revision-Date: 2020-03-19 11:58+0100\n"
+"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
"Language-Team: Gnome Romanian Translation Team <gnomero-list@lists."
"sourceforge.net>\n"
"Language: ro\n"
@@ -21,7 +20,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n==0 || (n!=1 && n%100>=1 && n"
"%100<=19) ? 1 : 2);\n"
-"X-Generator: Poedit 2.2.3\n"
+"X-Generator: Poedit 2.3\n"
"X-Project-Style: gnome\n"
"X-Poedit-SourceCharset: UTF-8\n"
@@ -433,19 +432,32 @@ msgstr "Modificator de utilizat pentru a localiza pointerul"
msgid "This key will initiate the “locate pointer” action."
msgstr "Această cheie va iniția acțiunea „localizează pointer”."
-#: data/org.gnome.mutter.gschema.xml.in:155
+#: data/org.gnome.mutter.gschema.xml.in:142
+msgid "Timeout for check-alive ping"
+msgstr "A expirat limita de timp pentru check-alive ping"
+
+#: data/org.gnome.mutter.gschema.xml.in:143
+msgid ""
+"Number of milliseconds a client has to respond to a ping request in order to "
+"not be detected as frozen. Using 0 will disable the alive check completely."
+msgstr ""
+"Număr de millisecunde în care un client trebuie să răspundă la o cerere de "
+"ping pentru a nu fi detectat ca înghețat. Utilizând 0 va dezactiva check-"
+"alive complet."
+
+#: data/org.gnome.mutter.gschema.xml.in:165
msgid "Select window from tab popup"
msgstr "Selectează fereastra din popup-ul tabului"
-#: data/org.gnome.mutter.gschema.xml.in:160
+#: data/org.gnome.mutter.gschema.xml.in:170
msgid "Cancel tab popup"
msgstr "Elimină popup-ul pentru tab"
-#: data/org.gnome.mutter.gschema.xml.in:165
+#: data/org.gnome.mutter.gschema.xml.in:175
msgid "Switch monitor configurations"
msgstr "Comută configurațiile de monitor"
-#: data/org.gnome.mutter.gschema.xml.in:170
+#: data/org.gnome.mutter.gschema.xml.in:180
msgid "Rotates the built-in monitor configuration"
msgstr "Rotește configurarea de monitor integrat"
@@ -561,7 +573,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
-#: src/backends/meta-input-settings.c:2531
+#: src/backends/meta-input-settings.c:2567
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Comutator de mod (grupul %d)"
@@ -569,11 +581,11 @@ msgstr "Comutator de mod (grupul %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
-#: src/backends/meta-input-settings.c:2554
+#: src/backends/meta-input-settings.c:2590
msgid "Switch monitor"
msgstr "Comută monitorul"
-#: src/backends/meta-input-settings.c:2556
+#: src/backends/meta-input-settings.c:2592
msgid "Show on-screen help"
msgstr "Arată ajutorul virtual"
@@ -605,13 +617,13 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: this string will appear in Sysprof
-#: src/backends/meta-profiler.c:82
+#: src/backends/meta-profiler.c:79
msgid "Compositor"
msgstr "Compunător"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
-#: src/compositor/compositor.c:510
+#: src/compositor/compositor.c:533
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -623,47 +635,47 @@ msgstr ""
msgid "Bell event"
msgstr "Eveniment sonor"
-#: src/core/main.c:185
+#: src/core/main.c:190
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
-#: src/core/main.c:191
+#: src/core/main.c:196
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
-#: src/core/main.c:197
+#: src/core/main.c:202
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
-#: src/core/main.c:202
+#: src/core/main.c:207
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
-#: src/core/main.c:208
+#: src/core/main.c:213
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
-#: src/core/main.c:214
+#: src/core/main.c:219
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
-#: src/core/main.c:221
+#: src/core/main.c:226
msgid "Run as a wayland compositor"
msgstr "Rulează ca un compunător wayland"
-#: src/core/main.c:227
+#: src/core/main.c:232
msgid "Run as a nested compositor"
msgstr "Rulează ca un compunător imbricat"
-#: src/core/main.c:233
+#: src/core/main.c:238
msgid "Run wayland compositor without starting Xwayland"
msgstr "Rulează compunătorul wayland fără a porni Xwayland"
-#: src/core/main.c:241
+#: src/core/main.c:246
msgid "Run as a full display server, rather than nested"
msgstr "Rulează ca server de afișare și nu ca server imbricat"
-#: src/core/main.c:247
+#: src/core/main.c:252
msgid "Run with X11 backend"
msgstr "Rulează cu backend X11"
@@ -717,21 +729,21 @@ msgstr "Afișează versiunea"
msgid "Mutter plugin to use"
msgstr "Modul Mutter de utilizat"
-#: src/core/prefs.c:1849
+#: src/core/prefs.c:1911
#, c-format
msgid "Workspace %d"
msgstr "Spațiu de lucru %d"
-#: src/core/util.c:121
+#: src/core/util.c:122
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter a fost compilat fără suport pentru modul detaliat\n"
-#: src/wayland/meta-wayland-tablet-pad.c:567
+#: src/wayland/meta-wayland-tablet-pad.c:568
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Comutator de mod: modul %d"
-#: src/x11/meta-x11-display.c:671
+#: src/x11/meta-x11-display.c:676
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -741,21 +753,21 @@ msgstr ""
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre curent."
-#: src/x11/meta-x11-display.c:1032
+#: src/x11/meta-x11-display.c:1089
msgid "Failed to initialize GDK\n"
msgstr "Nu s-a putut inițializa GDK\n"
-#: src/x11/meta-x11-display.c:1056
+#: src/x11/meta-x11-display.c:1113
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Nu s-a putut deschide afișajul sistemului de ferestre X „%s”\n"
-#: src/x11/meta-x11-display.c:1140
+#: src/x11/meta-x11-display.c:1196
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
-#: src/x11/meta-x11-selection-input-stream.c:445
+#: src/x11/meta-x11-selection-input-stream.c:460
#, c-format
msgid "Format %s not supported"
msgstr "Formatul %s nu este suportat"
--
2.26.0.rc2

View File

@ -0,0 +1,159 @@
From 2ecbf6d74637508203290c0e324d736de10a9174 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 24 Feb 2020 15:33:08 +0100
Subject: [PATCH 37/48] x11: Handle windowing errors while writing selection
INCR data
This error was just logged but not raised. Do as the code comment said
and raise a pipe error at that moment, and for subsequent operations
on the output stream (although none besides close() should be expected
after propagating the error properly).
Related: https://gitlab.gnome.org/GNOME/mutter/issues/1065
---
src/x11/meta-x11-selection-output-stream.c | 62 +++++++++++++++++++---
1 file changed, 56 insertions(+), 6 deletions(-)
diff --git a/src/x11/meta-x11-selection-output-stream.c b/src/x11/meta-x11-selection-output-stream.c
index 1883bc92a..f51dbc4c3 100644
--- a/src/x11/meta-x11-selection-output-stream.c
+++ b/src/x11/meta-x11-selection-output-stream.c
@@ -53,6 +53,7 @@ struct _MetaX11SelectionOutputStreamPrivate
guint incr : 1;
guint delete_pending : 1;
+ guint pipe_error : 1;
};
G_DEFINE_TYPE_WITH_PRIVATE (MetaX11SelectionOutputStream,
@@ -167,6 +168,25 @@ get_element_size (int format)
}
}
+static gboolean
+meta_x11_selection_output_stream_check_pipe (MetaX11SelectionOutputStream *stream,
+ GError **error)
+{
+ MetaX11SelectionOutputStreamPrivate *priv =
+ meta_x11_selection_output_stream_get_instance_private (stream);
+
+ if (priv->pipe_error)
+ {
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_BROKEN_PIPE,
+ "Connection with client was broken");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static void
meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *stream)
{
@@ -174,6 +194,7 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
meta_x11_selection_output_stream_get_instance_private (stream);
Display *xdisplay;
size_t element_size, n_elements;
+ int error_code;
g_assert (!priv->delete_pending);
@@ -230,18 +251,28 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
g_cond_broadcast (&priv->cond);
g_mutex_unlock (&priv->mutex);
- /* XXX: handle failure here and report EPIPE for future operations on the stream? */
- if (meta_x11_error_trap_pop_with_return (priv->x11_display))
- g_warning ("Failed to flush selection output stream");
+ error_code = meta_x11_error_trap_pop_with_return (priv->x11_display);
- if (priv->pending_task)
+ if (error_code != Success)
+ {
+ char error_str[100];
+
+ XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str));
+ g_task_return_new_error (priv->pending_task,
+ G_IO_ERROR,
+ G_IO_ERROR_BROKEN_PIPE,
+ "Failed to flush selection output stream: %s",
+ error_str);
+ g_clear_object (&priv->pending_task);
+ priv->pipe_error = TRUE;
+ }
+ else if (priv->pending_task)
{
size_t result;
result = GPOINTER_TO_SIZE (g_task_get_task_data (priv->pending_task));
g_task_return_int (priv->pending_task, result);
- g_object_unref (priv->pending_task);
- priv->pending_task = NULL;
+ g_clear_object (&priv->pending_task);
}
}
@@ -270,6 +301,9 @@ meta_x11_selection_output_stream_write (GOutputStream *output_stream,
MetaX11SelectionOutputStreamPrivate *priv =
meta_x11_selection_output_stream_get_instance_private (stream);
+ if (!meta_x11_selection_output_stream_check_pipe (stream, error))
+ return -1;
+
g_mutex_lock (&priv->mutex);
g_byte_array_append (priv->data, buffer, count);
g_mutex_unlock (&priv->mutex);
@@ -297,12 +331,19 @@ meta_x11_selection_output_stream_write_async (GOutputStream *output_stream
META_X11_SELECTION_OUTPUT_STREAM (output_stream);
MetaX11SelectionOutputStreamPrivate *priv =
meta_x11_selection_output_stream_get_instance_private (stream);
+ GError *error = NULL;
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, meta_x11_selection_output_stream_write_async);
g_task_set_priority (task, io_priority);
+ if (!meta_x11_selection_output_stream_check_pipe (stream, &error))
+ {
+ g_task_return_error (task, error);
+ return;
+ }
+
g_mutex_lock (&priv->mutex);
g_byte_array_append (priv->data, buffer, count);
g_mutex_unlock (&priv->mutex);
@@ -369,6 +410,8 @@ meta_x11_selection_output_stream_flush (GOutputStream *output_stream,
MetaX11SelectionOutputStreamPrivate *priv =
meta_x11_selection_output_stream_get_instance_private (stream);
+ if (!meta_x11_selection_output_stream_check_pipe (stream, error))
+ return FALSE;
if (!meta_x11_selection_output_request_flush (stream))
return TRUE;
@@ -394,12 +437,19 @@ meta_x11_selection_output_stream_flush_async (GOutputStream *output_stream
META_X11_SELECTION_OUTPUT_STREAM (output_stream);
MetaX11SelectionOutputStreamPrivate *priv =
meta_x11_selection_output_stream_get_instance_private (stream);
+ GError *error = NULL;
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, meta_x11_selection_output_stream_flush_async);
g_task_set_priority (task, io_priority);
+ if (!meta_x11_selection_output_stream_check_pipe (stream, &error))
+ {
+ g_task_return_error (task, error);
+ return;
+ }
+
if (!meta_x11_selection_output_stream_can_flush (stream))
{
if (meta_x11_selection_output_request_flush (stream))
--
2.26.0.rc2

View File

@ -0,0 +1,124 @@
From c131a9b7fa79e53b5ed008d0fe53cf2062d3663d Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 13 Dec 2019 14:22:12 +0100
Subject: [PATCH 38/48] backends/x11: Observe multiple pad mode switch buttons
in a group
Some tablets like the Cintiq 24HDT have several mode switch buttons
per group. Those are meant to jump straight to a given mode, however
we just handle cycling across modes (as most other tablets have a
single mode switch button per group).
So spice up the mode switch handling so we handle multiple mode
switch buttons, assigning each of them a mode. If the device only
has one mode switch button, we do the old-fashioned cycling.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/970
---
src/backends/x11/meta-input-device-x11.c | 75 ++++++++++++++++++++----
1 file changed, 63 insertions(+), 12 deletions(-)
diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c
index 26a40620f..af07c34f6 100644
--- a/src/backends/x11/meta-input-device-x11.c
+++ b/src/backends/x11/meta-input-device-x11.c
@@ -393,6 +393,57 @@ meta_input_device_x11_get_pad_group_mode (ClutterInputDevice *device,
return g_array_index (device_xi2->group_modes, uint32_t, group);
}
+static gboolean
+pad_switch_mode (ClutterInputDevice *device,
+ uint32_t button,
+ uint32_t group,
+ uint32_t *mode)
+{
+ MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (device);
+ uint32_t n_buttons, n_modes, button_group, next_mode, i;
+ GList *switch_buttons = NULL;
+
+ n_buttons = libwacom_get_num_buttons (device_x11->wacom_device);
+
+ for (i = 0; i < n_buttons; i++)
+ {
+ button_group = meta_input_device_x11_get_button_group (device, i);
+ if (button_group == group)
+ switch_buttons = g_list_prepend (switch_buttons, GINT_TO_POINTER (button));
+ }
+
+ switch_buttons = g_list_reverse (switch_buttons);
+ n_modes = clutter_input_device_get_group_n_modes (device, group);
+
+ if (g_list_length (switch_buttons) > 1)
+ {
+ /* If there's multiple switch buttons, we don't toggle but assign a mode
+ * to each of those buttons.
+ */
+ next_mode = g_list_index (switch_buttons, GINT_TO_POINTER (button));
+ }
+ else if (switch_buttons)
+ {
+ uint32_t cur_mode;
+
+ /* If there is a single button, have it toggle across modes */
+ cur_mode = g_array_index (device_x11->group_modes, uint32_t, group);
+ next_mode = (cur_mode + 1) % n_modes;
+ }
+ else
+ {
+ return FALSE;
+ }
+
+ g_list_free (switch_buttons);
+
+ if (next_mode < 0 || next_mode > n_modes)
+ return FALSE;
+
+ *mode = next_mode;
+ return TRUE;
+}
+
void
meta_input_device_x11_update_pad_state (ClutterInputDevice *device,
uint32_t button,
@@ -402,26 +453,26 @@ meta_input_device_x11_update_pad_state (ClutterInputDevice *device,
{
MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
uint32_t button_group, *group_mode;
- gboolean is_mode_switch = FALSE;
button_group = meta_input_device_x11_get_button_group (device, button);
- is_mode_switch = button_group >= 0;
- /* Assign all non-mode-switch buttons to group 0 so far */
- button_group = MAX (0, button_group);
-
- if (button_group >= device_xi2->group_modes->len)
- return;
+ if (button_group < 0 || button_group >= device_xi2->group_modes->len)
+ {
+ if (group)
+ *group = 0;
+ if (mode)
+ *mode = 0;
+ return;
+ }
group_mode = &g_array_index (device_xi2->group_modes, uint32_t, button_group);
- if (is_mode_switch && state)
+ if (state)
{
- uint32_t next, n_modes;
+ uint32_t next_mode;
- n_modes = clutter_input_device_get_group_n_modes (device, button_group);
- next = (*group_mode + 1) % n_modes;
- *group_mode = next;
+ if (pad_switch_mode (device, button, button_group, &next_mode))
+ *group_mode = next_mode;
}
if (group)
--
2.26.0.rc2

View File

@ -0,0 +1,56 @@
From 1d2004524728d337b0e98bedfc360549b9ee7d0e Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Tue, 17 Mar 2020 20:57:18 +0100
Subject: [PATCH 39/48] surface-actor: Fix memory leak
When we create a new region for an opaque texture we need to free it.
While on it, simplify the check slightly.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1108
---
src/compositor/meta-surface-actor.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index ff66f3c0a..41aa5a26d 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -285,8 +285,11 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
int geometry_scale = 1;
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
-
- if (!opaque_region && meta_shaped_texture_is_opaque (priv->texture))
+ if (opaque_region)
+ {
+ cairo_region_reference (opaque_region);
+ }
+ else if (meta_shaped_texture_is_opaque (priv->texture))
{
cairo_rectangle_int_t rect;
@@ -297,9 +300,10 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
opaque_region = cairo_region_create_rectangle (&rect);
}
-
- if (!opaque_region)
- return;
+ else
+ {
+ return;
+ }
window_actor =
meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
@@ -313,6 +317,7 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
if (clip_region)
cairo_region_subtract (clip_region, scaled_opaque_region);
+ cairo_region_destroy (opaque_region);
cairo_region_destroy (scaled_opaque_region);
}
}
--
2.26.0.rc2

View File

@ -0,0 +1,59 @@
From 41130b08eb104b8071833e0ee745b57cf6143795 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Fri, 6 Mar 2020 13:42:04 +0100
Subject: [PATCH 40/48] surface-actor: Add culling offset for geometry scale
This fixes a case that was overlooked in
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1036 - when we
have a geometry scale > 1 and Wayland subsurfaces that have an offset
to their parent surface (which is often the case when the toplevel surface
includes decoration/shadows etc.), we have to add extra offset to their
opaque regions so they match their 'visible' location.
This is necessary as `meta_cullable_cull_out_children` moves the coordinate
system during culling, but does not know about geometry scale.
Also, remove the redundant check for `window_actor` - we only hit this code
path if a `window_actor` culls out its children.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1108
---
src/compositor/meta-surface-actor.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 41aa5a26d..c328fab73 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -282,7 +282,8 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
MetaWindowActor *window_actor;
cairo_region_t *scaled_opaque_region;
cairo_region_t *opaque_region;
- int geometry_scale = 1;
+ int geometry_scale;
+ float x, y;
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
if (opaque_region)
@@ -305,12 +306,14 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
return;
}
- window_actor =
- meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
- if (window_actor)
- geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
+ window_actor = meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
+ geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
+ clutter_actor_get_position (CLUTTER_ACTOR (surface_actor), &x, &y);
+ cairo_region_translate (opaque_region, x, y);
scaled_opaque_region = meta_region_scale (opaque_region, geometry_scale);
+ cairo_region_translate (scaled_opaque_region, -x, -y);
+ cairo_region_translate (opaque_region, -x, -y);
if (unobscured_region)
cairo_region_subtract (unobscured_region, scaled_opaque_region);
--
2.26.0.rc2

View File

@ -0,0 +1,28 @@
From 7fa7c2aeb751d2408ebc39c31201f4e8bc736cf5 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 14 Nov 2019 12:22:27 +1000
Subject: [PATCH 41/48] backends: use the enum name instead of a literal 0
No functional change.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1144
---
src/backends/native/meta-keymap-native.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/native/meta-keymap-native.c b/src/backends/native/meta-keymap-native.c
index e34c4454a..622cfd354 100644
--- a/src/backends/native/meta-keymap-native.c
+++ b/src/backends/native/meta-keymap-native.c
@@ -111,7 +111,7 @@ meta_keymap_native_init (MetaKeymapNative *keymap)
names.variant = option_xkb_variant;
names.options = option_xkb_options;
- ctx = xkb_context_new (0);
+ ctx = xkb_context_new (XKB_CONTEXT_NO_FLAGS);
g_assert (ctx);
keymap->keymap = xkb_keymap_new_from_names (ctx, &names, 0);
xkb_context_unref (ctx);
--
2.26.0.rc2

View File

@ -0,0 +1,35 @@
From 8592a8591ba7334e2420ec5726a081a5e45f969b Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 24 Mar 2020 16:52:55 +0100
Subject: [PATCH 42/48] wayland: Handle NULL preedit text
The preedit text may be NULL (eg. when unsetting it). This started
causing crashes since commit db9b60cc635, duh.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1132
---
src/wayland/meta-wayland-text-input.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index deff44c1b..4e7d18b25 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -207,10 +207,12 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
{
MetaWaylandTextInput *text_input;
struct wl_resource *resource;
- gsize pos;
+ gsize pos = 0;
text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
- pos = g_utf8_offset_to_pointer (text, cursor) - text;
+
+ if (text)
+ pos = g_utf8_offset_to_pointer (text, cursor) - text;
wl_resource_for_each (resource, &text_input->focus_resource_list)
{
--
2.26.0.rc2

View File

@ -0,0 +1,147 @@
From 18b661cc936ae5b7e6f7751d419e063e9a6f255f Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 23 Mar 2020 18:42:11 +0100
Subject: [PATCH 43/48] backends: Add mapping function arg to
settings_set_bool_setting()
This will be useful to actually determine on a per-device basis the
setting being applied, while still doing changes on a per-device-type
basis.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1145
---
src/backends/meta-input-settings.c | 40 ++++++++++++++++++++----------
1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 3bee36d41..6d674bbea 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -103,6 +103,10 @@ struct _MetaInputSettingsPrivate
MetaInputMapper *input_mapper;
};
+typedef gboolean (* ConfigBoolMappingFunc) (MetaInputSettings *input_settings,
+ ClutterInputDevice *device,
+ gboolean value);
+
typedef void (*ConfigBoolFunc) (MetaInputSettings *input_settings,
ClutterInputDevice *device,
gboolean setting);
@@ -195,15 +199,22 @@ settings_device_set_bool_setting (MetaInputSettings *input_settings,
static void
settings_set_bool_setting (MetaInputSettings *input_settings,
ClutterInputDeviceType type,
+ ConfigBoolMappingFunc mapping_func,
ConfigBoolFunc func,
gboolean enabled)
{
- GSList *devices, *d;
+ GSList *devices, *l;
devices = meta_input_settings_get_devices (input_settings, type);
- for (d = devices; d; d = d->next)
- settings_device_set_bool_setting (input_settings, d->data, func, enabled);
+ for (l = devices; l; l = l->next)
+ {
+ gboolean value = enabled;
+
+ if (mapping_func)
+ value = mapping_func (input_settings, l->data, value);
+ settings_device_set_bool_setting (input_settings, l->data, func, value);
+ }
g_slist_free (devices);
}
@@ -298,7 +309,7 @@ update_touchpad_left_handed (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
input_settings_class->set_left_handed,
enabled);
}
@@ -330,7 +341,7 @@ update_mouse_left_handed (MetaInputSettings *input_settings,
{
GDesktopTouchpadHandedness touchpad_handedness;
- settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, NULL,
input_settings_class->set_left_handed,
enabled);
@@ -446,7 +457,8 @@ update_middle_click_emulation (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
+ settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE,
+ NULL, func,
g_settings_get_boolean (settings, key));
}
}
@@ -505,10 +517,12 @@ update_device_natural_scroll (MetaInputSettings *input_settings,
else
{
settings = get_settings_for_device_type (input_settings, CLUTTER_POINTER_DEVICE);
- settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
+ settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE,
+ NULL, func,
g_settings_get_boolean (settings, key));
settings = get_settings_for_device_type (input_settings, CLUTTER_TOUCHPAD_DEVICE);
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, func,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ NULL, func,
g_settings_get_boolean (settings, key));
}
}
@@ -545,7 +559,7 @@ update_touchpad_disable_while_typing (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
input_settings_class->set_disable_while_typing,
enabled);
}
@@ -603,7 +617,7 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
input_settings_class->set_tap_enabled,
enabled);
}
@@ -634,7 +648,7 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
input_settings_class->set_tap_and_drag_enabled,
enabled);
}
@@ -672,7 +686,7 @@ update_touchpad_edge_scroll (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
(ConfigBoolFunc) input_settings_class->set_edge_scroll,
edge_scroll_enabled);
}
@@ -706,7 +720,7 @@ update_touchpad_two_finger_scroll (MetaInputSettings *input_settings,
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
(ConfigBoolFunc) input_settings_class->set_two_finger_scroll,
two_finger_scroll_enabled);
}
--
2.26.0.rc2

View File

@ -0,0 +1,87 @@
From ec1195e3ff8db6f3888c42d278b3724ec2ca70c0 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 24 Mar 2020 13:16:11 +0100
Subject: [PATCH 44/48] backends: Fix configuration changes to tap[-and-drag]
Most people just see a harmless warning when applying this setting to
all touchpads (which this patch fixes). But tap[-and-drag] is supposed
to remain enabled for display-less Wacom tablets, despite configuration
changes.
Fix this by using the mapping function, so the setting is forced on for
wacom devices. This happens on a per-device basis, so the warning is
gone too.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1145
---
src/backends/meta-input-settings.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 6d674bbea..7c3afdaff 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -592,6 +592,14 @@ device_is_tablet_touchpad (MetaInputSettings *input_settings,
return FALSE;
}
+static gboolean
+force_enable_on_tablet (MetaInputSettings *input_settings,
+ ClutterInputDevice *device,
+ gboolean value)
+{
+ return device_is_tablet_touchpad (input_settings, device) || value;
+}
+
static void
update_touchpad_tap_enabled (MetaInputSettings *input_settings,
ClutterInputDevice *device)
@@ -606,18 +614,19 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- enabled = device_is_tablet_touchpad (input_settings, device) ||
- g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
+ enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
if (device)
{
+ enabled = force_enable_on_tablet (input_settings, device, enabled);
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_tap_enabled,
enabled);
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ force_enable_on_tablet,
input_settings_class->set_tap_enabled,
enabled);
}
@@ -637,18 +646,19 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings,
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- enabled = device_is_tablet_touchpad (input_settings, device) ||
- g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
+ enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
if (device)
{
+ enabled = force_enable_on_tablet (input_settings, device, enabled);
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_tap_and_drag_enabled,
enabled);
}
else
{
- settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, NULL,
+ settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
+ force_enable_on_tablet,
input_settings_class->set_tap_and_drag_enabled,
enabled);
}
--
2.26.0.rc2

View File

@ -0,0 +1,360 @@
From 1f00aba92c324ec501a775fe288af187f3c36910 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 6 Mar 2020 14:12:59 +0100
Subject: [PATCH 45/48] backends: Add MetaInputDevice derivable class
This class sits between ClutterInputDevice and the backend implementations,
it will be the despositary of features we need across both backends, but
don't need to offer through Clutter's API.
As a first thing to have there, add a getter for a WacomDevice. This is
something scattered across and somewhat inconsistent (eg. different places
of the code create wacom devices for different device types). Just make it
here for all devices, so users can pick.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
---
src/backends/meta-backend-private.h | 4 +
src/backends/meta-backend.c | 27 ++++
src/backends/meta-input-device-private.h | 48 ++++++
src/backends/meta-input-device.c | 137 ++++++++++++++++++
.../native/meta-input-device-native.c | 2 +-
.../native/meta-input-device-native.h | 1 +
src/backends/x11/meta-input-device-x11.c | 2 +-
src/backends/x11/meta-input-device-x11.h | 1 +
src/meson.build | 1 +
9 files changed, 221 insertions(+), 2 deletions(-)
create mode 100644 src/backends/meta-input-device-private.h
create mode 100644 src/backends/meta-input-device.c
diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h
index f5423c12b..4678f7768 100644
--- a/src/backends/meta-backend-private.h
+++ b/src/backends/meta-backend-private.h
@@ -182,4 +182,8 @@ void meta_backend_add_gpu (MetaBackend *backend,
META_EXPORT_TEST
GList * meta_backend_get_gpus (MetaBackend *backend);
+#ifdef HAVE_LIBWACOM
+WacomDeviceDatabase * meta_backend_get_wacom_database (MetaBackend *backend);
+#endif
+
#endif /* META_BACKEND_PRIVATE_H */
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 6295c8b7e..f75df806b 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -134,6 +134,10 @@ struct _MetaBackendPrivate
MetaProfiler *profiler;
#endif
+#ifdef HAVE_LIBWACOM
+ WacomDeviceDatabase *wacom_db;
+#endif
+
ClutterBackend *clutter_backend;
ClutterActor *stage;
@@ -199,6 +203,10 @@ meta_backend_finalize (GObject *object)
g_clear_object (&priv->remote_access_controller);
#endif
+#ifdef HAVE_LIBWACOM
+ g_clear_pointer (&priv->wacom_db, libwacom_database_destroy);
+#endif
+
if (priv->sleep_signal_id)
g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
if (priv->upower_watch_id)
@@ -715,6 +723,15 @@ meta_backend_constructed (GObject *object)
MetaBackendClass *backend_class =
META_BACKEND_GET_CLASS (backend);
+#ifdef HAVE_LIBWACOM
+ priv->wacom_db = libwacom_database_new ();
+ if (!priv->wacom_db)
+ {
+ g_warning ("Could not create database of Wacom devices, "
+ "expect tablets to misbehave");
+ }
+#endif
+
if (backend_class->is_lid_closed != meta_backend_real_is_lid_closed)
return;
@@ -1442,3 +1459,13 @@ meta_backend_get_gpus (MetaBackend *backend)
return priv->gpus;
}
+
+#ifdef HAVE_LIBWACOM
+WacomDeviceDatabase *
+meta_backend_get_wacom_database (MetaBackend *backend)
+{
+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
+
+ return priv->wacom_db;
+}
+#endif
diff --git a/src/backends/meta-input-device-private.h b/src/backends/meta-input-device-private.h
new file mode 100644
index 000000000..a2cbd4864
--- /dev/null
+++ b/src/backends/meta-input-device-private.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright © 2020 Red Hat Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Carlos Garnacho <carlosg@gnome.org>
+ */
+#ifndef META_INPUT_DEVICE_H
+#define META_INPUT_DEVICE_H
+
+#include <glib-object.h>
+
+#ifdef HAVE_LIBWACOM
+#include <libwacom/libwacom.h>
+#endif
+
+#include "clutter/clutter-mutter.h"
+
+typedef struct _MetaInputDeviceClass MetaInputDeviceClass;
+typedef struct _MetaInputDevice MetaInputDevice;
+
+struct _MetaInputDeviceClass
+{
+ ClutterInputDeviceClass parent_class;
+};
+
+#define META_TYPE_INPUT_DEVICE (meta_input_device_get_type ())
+G_DECLARE_DERIVABLE_TYPE (MetaInputDevice,
+ meta_input_device,
+ META, INPUT_DEVICE,
+ ClutterInputDevice)
+
+#ifdef HAVE_LIBWACOM
+WacomDevice * meta_input_device_get_wacom_device (MetaInputDevice *input_device);
+#endif
+
+#endif /* META_INPUT_DEVICE_H */
diff --git a/src/backends/meta-input-device.c b/src/backends/meta-input-device.c
new file mode 100644
index 000000000..e05c024e3
--- /dev/null
+++ b/src/backends/meta-input-device.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright © 2020 Red Hat Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Carlos Garnacho <carlosg@gnome.org>
+ */
+
+#include "config.h"
+
+#include "backends/meta-backend-private.h"
+#include "meta-input-device-private.h"
+
+typedef struct _MetaInputDevicePrivate MetaInputDevicePrivate;
+
+struct _MetaInputDevicePrivate
+{
+#ifdef HAVE_LIBWACOM
+ WacomDevice *wacom_device;
+#else
+ /* Just something to have non-zero sized struct otherwise */
+ gpointer wacom_device;
+#endif
+};
+
+enum
+{
+ PROP_WACOM_DEVICE = 1,
+ N_PROPS
+};
+
+static GParamSpec *props[N_PROPS] = { 0 };
+
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaInputDevice,
+ meta_input_device,
+ CLUTTER_TYPE_INPUT_DEVICE)
+
+static void
+meta_input_device_init (MetaInputDevice *input_device)
+{
+}
+
+static void
+meta_input_device_constructed (GObject *object)
+{
+ MetaInputDevice *input_device = META_INPUT_DEVICE (object);
+#ifdef HAVE_LIBWACOM
+ WacomDeviceDatabase *wacom_db;
+ MetaInputDevicePrivate *priv;
+ const char *node;
+#endif
+
+ G_OBJECT_CLASS (meta_input_device_parent_class)->constructed (object);
+
+#ifdef HAVE_LIBWACOM
+ priv = meta_input_device_get_instance_private (input_device);
+ wacom_db = meta_backend_get_wacom_database (meta_get_backend ());
+ node = clutter_input_device_get_device_node (CLUTTER_INPUT_DEVICE (input_device));
+ priv->wacom_device = libwacom_new_from_path (wacom_db, node,
+ WFALLBACK_NONE, NULL);
+#endif /* HAVE_LIBWACOM */
+}
+
+static void
+meta_input_device_finalize (GObject *object)
+{
+#ifdef HAVE_LIBWACOM
+ MetaInputDevicePrivate *priv;
+
+ priv = meta_input_device_get_instance_private (META_INPUT_DEVICE (object));
+
+ g_clear_pointer (&priv->wacom_device, libwacom_destroy);
+#endif /* HAVE_LIBWACOM */
+
+ G_OBJECT_CLASS (meta_input_device_parent_class)->finalize (object);
+}
+
+static void
+meta_input_device_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MetaInputDevicePrivate *priv;
+
+ priv = meta_input_device_get_instance_private (META_INPUT_DEVICE (object));
+
+ switch (prop_id)
+ {
+ case PROP_WACOM_DEVICE:
+ g_value_set_pointer (value, priv->wacom_device);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+meta_input_device_class_init (MetaInputDeviceClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->constructed = meta_input_device_constructed;
+ object_class->finalize = meta_input_device_finalize;
+ object_class->get_property = meta_input_device_get_property;
+
+ props[PROP_WACOM_DEVICE] =
+ g_param_spec_pointer ("wacom-device",
+ "Wacom device",
+ "Wacom device",
+ G_PARAM_READABLE);
+
+ g_object_class_install_properties (object_class, N_PROPS, props);
+}
+
+#ifdef HAVE_LIBWACOM
+WacomDevice *
+meta_input_device_get_wacom_device (MetaInputDevice *input_device)
+{
+ MetaInputDevicePrivate *priv;
+
+ priv = meta_input_device_get_instance_private (input_device);
+
+ return priv->wacom_device;
+}
+#endif /* HAVE_LIBWACOM */
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c
index 34054c5e9..4b87eb2a0 100644
--- a/src/backends/native/meta-input-device-native.c
+++ b/src/backends/native/meta-input-device-native.c
@@ -31,7 +31,7 @@
G_DEFINE_TYPE (MetaInputDeviceNative,
meta_input_device_native,
- CLUTTER_TYPE_INPUT_DEVICE)
+ META_TYPE_INPUT_DEVICE)
enum
{
diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h
index 9b3a21904..59cff51ef 100644
--- a/src/backends/native/meta-input-device-native.h
+++ b/src/backends/native/meta-input-device-native.h
@@ -28,6 +28,7 @@
#include <glib-object.h>
+#include "backends/meta-input-device-private.h"
#include "backends/native/meta-seat-native.h"
#include "clutter/clutter-mutter.h"
diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c
index af07c34f6..3d96c344e 100644
--- a/src/backends/x11/meta-input-device-x11.c
+++ b/src/backends/x11/meta-input-device-x11.c
@@ -52,7 +52,7 @@ struct _MetaInputDeviceX11Class
G_DEFINE_TYPE (MetaInputDeviceX11,
meta_input_device_x11,
- CLUTTER_TYPE_INPUT_DEVICE)
+ META_TYPE_INPUT_DEVICE)
static void
meta_input_device_x11_constructed (GObject *object)
diff --git a/src/backends/x11/meta-input-device-x11.h b/src/backends/x11/meta-input-device-x11.h
index eacef955a..1cbee031a 100644
--- a/src/backends/x11/meta-input-device-x11.h
+++ b/src/backends/x11/meta-input-device-x11.h
@@ -26,6 +26,7 @@
#include <libwacom/libwacom.h>
#endif
+#include "backends/meta-input-device-private.h"
#include "clutter/clutter.h"
G_BEGIN_DECLS
diff --git a/src/meson.build b/src/meson.build
index b882b5350..bb1b48b44 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -190,6 +190,7 @@ mutter_sources = [
'backends/meta-idle-monitor-dbus.c',
'backends/meta-idle-monitor-dbus.h',
'backends/meta-idle-monitor-private.h',
+ 'backends/meta-input-device.c',
'backends/meta-input-mapper.c',
'backends/meta-input-mapper-private.h',
'backends/meta-input-settings.c',
--
2.26.0.rc2

View File

@ -0,0 +1,164 @@
From 3b88af94e328ca3064b8d4582349cc1904619755 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 6 Mar 2020 14:37:01 +0100
Subject: [PATCH 46/48] backends/x11: Drop internal WacomDevice lookups
Just use the ones from MetaInputDevice.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
---
src/backends/x11/meta-input-device-x11.c | 50 +++++++++---------------
src/backends/x11/meta-seat-x11.c | 17 --------
2 files changed, 19 insertions(+), 48 deletions(-)
diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c
index 3d96c344e..dc3b94f49 100644
--- a/src/backends/x11/meta-input-device-x11.c
+++ b/src/backends/x11/meta-input-device-x11.c
@@ -101,14 +101,11 @@ meta_input_device_x11_finalize (GObject *object)
#ifdef HAVE_LIBWACOM
MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (object);
- if (device_xi2->wacom_device)
- libwacom_destroy (device_xi2->wacom_device);
-
if (device_xi2->group_modes)
g_array_unref (device_xi2->group_modes);
+#endif
g_clear_handle_id (&device_xi2->inhibit_pointer_query_timer, g_source_remove);
-#endif
G_OBJECT_CLASS (meta_input_device_x11_parent_class)->finalize (object);
}
@@ -118,23 +115,25 @@ meta_input_device_x11_get_group_n_modes (ClutterInputDevice *device,
int group)
{
#ifdef HAVE_LIBWACOM
- MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
+ WacomDevice *wacom_device;
+
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
- if (device_xi2->wacom_device)
+ if (wacom_device)
{
if (group == 0)
{
- if (libwacom_has_ring (device_xi2->wacom_device))
- return libwacom_get_ring_num_modes (device_xi2->wacom_device);
- else if (libwacom_get_num_strips (device_xi2->wacom_device) >= 1)
- return libwacom_get_strips_num_modes (device_xi2->wacom_device);
+ if (libwacom_has_ring (wacom_device))
+ return libwacom_get_ring_num_modes (wacom_device);
+ else if (libwacom_get_num_strips (wacom_device) >= 1)
+ return libwacom_get_strips_num_modes (wacom_device);
}
else if (group == 1)
{
- if (libwacom_has_ring2 (device_xi2->wacom_device))
- return libwacom_get_ring2_num_modes (device_xi2->wacom_device);
- else if (libwacom_get_num_strips (device_xi2->wacom_device) >= 2)
- return libwacom_get_strips_num_modes (device_xi2->wacom_device);
+ if (libwacom_has_ring2 (wacom_device))
+ return libwacom_get_ring2_num_modes (wacom_device);
+ else if (libwacom_get_num_strips (wacom_device) >= 2)
+ return libwacom_get_strips_num_modes (wacom_device);
}
}
#endif
@@ -147,17 +146,18 @@ static int
meta_input_device_x11_get_button_group (ClutterInputDevice *device,
uint32_t button)
{
- MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
+ WacomDevice *wacom_device;
- if (device_xi2->wacom_device)
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
+ if (wacom_device)
{
WacomButtonFlags flags;
- if (button >= libwacom_get_num_buttons (device_xi2->wacom_device))
+ if (button >= libwacom_get_num_buttons (wacom_device))
return -1;
- flags = libwacom_get_button_flag (device_xi2->wacom_device,
- 'A' + button);
+ flags = libwacom_get_button_flag (wacom_device, 'A' + button);
if (flags &
(WACOM_BUTTON_RING_MODESWITCH |
@@ -369,18 +369,6 @@ meta_input_device_x11_get_pointer_location (ClutterInputDevice *device,
}
#ifdef HAVE_LIBWACOM
-void
-meta_input_device_x11_ensure_wacom_info (ClutterInputDevice *device,
- WacomDeviceDatabase *wacom_db)
-{
- MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
- const gchar *node_path;
-
- node_path = clutter_input_device_get_device_node (device);
- device_xi2->wacom_device = libwacom_new_from_path (wacom_db, node_path,
- WFALLBACK_NONE, NULL);
-}
-
uint32_t
meta_input_device_x11_get_pad_group_mode (ClutterInputDevice *device,
uint32_t group)
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index 8849cd3d8..e6e996803 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -54,10 +54,6 @@ struct _MetaSeatX11
int pointer_id;
int keyboard_id;
int opcode;
-
-#ifdef HAVE_LIBWACOM
- WacomDeviceDatabase *wacom_db;
-#endif
};
static GParamSpec *props[N_PROPS] = { 0 };
@@ -557,11 +553,6 @@ create_device (MetaSeatX11 *seat_x11,
info->classes,
info->num_classes);
-#ifdef HAVE_LIBWACOM
- if (source == CLUTTER_PAD_DEVICE)
- meta_input_device_x11_ensure_wacom_info (retval, seat_x11->wacom_db);
-#endif
-
g_free (vendor_id);
g_free (product_id);
g_free (node_path);
@@ -1410,10 +1401,6 @@ meta_seat_x11_finalize (GObject *object)
g_hash_table_unref (seat_x11->tools_by_serial);
g_list_free (seat_x11->devices);
-#ifdef HAVE_LIBWACOM
- libwacom_database_destroy (seat_x11->wacom_db);
-#endif
-
G_OBJECT_CLASS (meta_seat_x11_parent_class)->finalize (object);
}
@@ -1570,10 +1557,6 @@ meta_seat_x11_init (MetaSeatX11 *seat)
(GDestroyNotify) g_object_unref);
seat->tools_by_serial = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_object_unref);
-
-#ifdef HAVE_LIBWACOM
- seat->wacom_db = libwacom_database_new ();
-#endif
}
MetaSeatX11 *
--
2.26.0.rc2

View File

@ -0,0 +1,300 @@
From d052f9c07078f50e59b8d44a1db3b2aa8cf66eb6 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 6 Mar 2020 14:53:45 +0100
Subject: [PATCH 47/48] backends: Drop internal WacomDevice in
MetaInputSettings
Use the one from MetaInputDevice instead. Since we no longer try
to ask for WacomDevices that weren't first retrieved:
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1086
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
---
src/backends/meta-input-settings-private.h | 5 -
src/backends/meta-input-settings.c | 109 +++++----------------
src/core/display.c | 4 +-
3 files changed, 29 insertions(+), 89 deletions(-)
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index 135b17f1a..f89020884 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -150,11 +150,6 @@ gchar * meta_input_settings_get_pad_action_label (MetaIn
MetaPadActionType action,
guint number);
-#ifdef HAVE_LIBWACOM
-WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
- ClutterInputDevice *device);
-#endif
-
void meta_input_settings_maybe_save_numlock_state (MetaInputSettings *input_settings);
void meta_input_settings_maybe_restore_numlock_state (MetaInputSettings *input_settings);
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 7c3afdaff..73f4131fe 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -31,6 +31,7 @@
#include <string.h>
#include "backends/meta-backend-private.h"
+#include "backends/meta-input-device-private.h"
#include "backends/meta-input-settings-private.h"
#include "backends/meta-input-mapper-private.h"
#include "backends/meta-logical-monitor.h"
@@ -59,9 +60,6 @@ struct _DeviceMappingInfo
ClutterInputDevice *device;
GSettings *settings;
gulong changed_id;
-#ifdef HAVE_LIBWACOM
- WacomDevice *wacom_device;
-#endif
guint *group_modes;
};
@@ -85,10 +83,6 @@ struct _MetaInputSettingsPrivate
ClutterVirtualInputDevice *virtual_pad_keyboard;
-#ifdef HAVE_LIBWACOM
- WacomDeviceDatabase *wacom_db;
-#endif
-
GHashTable *two_finger_devices;
/* Pad ring/strip emission */
@@ -177,11 +171,6 @@ meta_input_settings_dispose (GObject *object)
g_clear_object (&priv->monitor_manager);
-#ifdef HAVE_LIBWACOM
- if (priv->wacom_db)
- libwacom_database_destroy (priv->wacom_db);
-#endif
-
g_clear_pointer (&priv->two_finger_devices, g_hash_table_destroy);
G_OBJECT_CLASS (meta_input_settings_parent_class)->dispose (object);
@@ -576,9 +565,8 @@ device_is_tablet_touchpad (MetaInputSettings *input_settings,
if (clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
return FALSE;
- wacom_device =
- meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
if (wacom_device)
{
flags = libwacom_get_integration_flags (wacom_device);
@@ -953,8 +941,7 @@ meta_input_settings_delegate_on_mapper (MetaInputSettings *input_settings,
WacomIntegrationFlags flags = 0;
wacom_device =
- meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
if (wacom_device)
{
@@ -991,8 +978,8 @@ update_tablet_keep_aspect (MetaInputSettings *input_settings,
{
WacomDevice *wacom_device;
- wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
/* Keep aspect only makes sense in external tablets */
if (wacom_device &&
libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)
@@ -1081,8 +1068,8 @@ update_tablet_mapping (MetaInputSettings *input_settings,
{
WacomDevice *wacom_device;
- wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
/* Tablet mapping only makes sense on external tablets */
if (wacom_device &&
(libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE))
@@ -1121,8 +1108,8 @@ update_tablet_area (MetaInputSettings *input_settings,
{
WacomDevice *wacom_device;
- wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
/* Tablet area only makes sense on system/display integrated tablets */
if (wacom_device &&
(libwacom_get_integration_flags (wacom_device) &
@@ -1163,8 +1150,8 @@ update_tablet_left_handed (MetaInputSettings *input_settings,
{
WacomDevice *wacom_device;
- wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
- device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
/* Left handed mode only makes sense on external tablets */
if (wacom_device &&
(libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE))
@@ -1643,10 +1630,6 @@ input_mapper_device_mapped_cb (MetaInputMapper *mapper,
static void
device_mapping_info_free (DeviceMappingInfo *info)
{
-#ifdef HAVE_LIBWACOM
- if (info->wacom_device)
- libwacom_destroy (info->wacom_device);
-#endif
g_clear_signal_handler (&info->changed_id, info->settings);
g_object_unref (info->settings);
g_free (info->group_modes);
@@ -1683,26 +1666,6 @@ check_add_mappable_device (MetaInputSettings *input_settings,
info->device = device;
info->settings = settings;
-#ifdef HAVE_LIBWACOM
- if (device_type == CLUTTER_TABLET_DEVICE ||
- device_type == CLUTTER_PAD_DEVICE)
- {
- WacomError *error = libwacom_error_new ();
-
- info->wacom_device = libwacom_new_from_path (priv->wacom_db,
- clutter_input_device_get_device_node (device),
- WFALLBACK_NONE, error);
- if (!info->wacom_device)
- {
- g_warning ("Could not get tablet information for '%s': %s",
- clutter_input_device_get_device_name (device),
- libwacom_error_get_message (error));
- }
-
- libwacom_error_free (&error);
- }
-#endif
-
if (device_type == CLUTTER_PAD_DEVICE)
{
info->group_modes =
@@ -2078,15 +2041,6 @@ meta_input_settings_init (MetaInputSettings *settings)
g_signal_connect (priv->monitor_manager, "power-save-mode-changed",
G_CALLBACK (power_save_mode_changed_cb), settings);
-#ifdef HAVE_LIBWACOM
- priv->wacom_db = libwacom_database_new ();
- if (!priv->wacom_db)
- {
- g_warning ("Could not create database of Wacom devices, "
- "expect tablets to misbehave");
- }
-#endif
-
priv->two_finger_devices = g_hash_table_new (NULL, NULL);
priv->input_mapper = meta_input_mapper_new ();
@@ -2171,25 +2125,6 @@ meta_input_settings_get_pad_button_action (MetaInputSettings *input_settings,
return action;
}
-#ifdef HAVE_LIBWACOM
-WacomDevice *
-meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
- ClutterInputDevice *device)
-{
- MetaInputSettingsPrivate *priv;
- DeviceMappingInfo *info;
-
- g_return_val_if_fail (META_IS_INPUT_SETTINGS (settings), NULL);
- g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
-
- priv = meta_input_settings_get_instance_private (settings);
- info = g_hash_table_lookup (priv->mappable_devices, device);
- g_return_val_if_fail (info != NULL, NULL);
-
- return info->wacom_device;
-}
-#endif /* HAVE_LIBWACOM */
-
static gboolean
cycle_logical_monitors (MetaInputSettings *settings,
MetaLogicalMonitor *current_logical_monitor,
@@ -2234,6 +2169,9 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings *input_settings,
DeviceMappingInfo *info;
MetaLogicalMonitor *logical_monitor = NULL;
const gchar *edid[4] = { 0 }, *pretty_name = NULL;
+#ifdef HAVE_LIBWACOM
+ WacomDevice *wacom_device;
+#endif
g_return_if_fail (META_IS_INPUT_SETTINGS (input_settings));
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
@@ -2245,13 +2183,15 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings *input_settings,
g_return_if_fail (info != NULL);
#ifdef HAVE_LIBWACOM
- if (info->wacom_device)
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (device));
+
+ if (wacom_device)
{
/* Output rotation only makes sense on external tablets */
- if (libwacom_get_integration_flags (info->wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)
+ if (libwacom_get_integration_flags (wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)
return;
- pretty_name = libwacom_get_name (info->wacom_device);
+ pretty_name = libwacom_get_name (wacom_device);
}
#endif
@@ -2393,13 +2333,18 @@ meta_input_settings_handle_pad_button (MetaInputSettings *input_settin
const gchar *pretty_name = NULL;
MetaInputSettingsPrivate *priv;
DeviceMappingInfo *info;
+#ifdef HAVE_LIBWACOM
+ WacomDevice *wacom_device;
+#endif
priv = meta_input_settings_get_instance_private (input_settings);
info = g_hash_table_lookup (priv->mappable_devices, pad);
#ifdef HAVE_LIBWACOM
- if (info && info->wacom_device)
- pretty_name = libwacom_get_name (info->wacom_device);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (pad));
+
+ if (wacom_device)
+ pretty_name = libwacom_get_name (wacom_device);
#endif
meta_display_notify_pad_group_switch (meta_get_display (), pad,
pretty_name, group, mode, n_modes);
diff --git a/src/core/display.c b/src/core/display.c
index 6a7e75d55..6377ed697 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -44,6 +44,7 @@
#include "backends/meta-cursor-sprite-xcursor.h"
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-idle-monitor-dbus.h"
+#include "backends/meta-input-device-private.h"
#include "backends/meta-input-settings-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-stage-private.h"
@@ -2988,8 +2989,7 @@ meta_display_request_pad_osd (MetaDisplay *display,
logical_monitor =
meta_input_settings_get_tablet_logical_monitor (input_settings, pad);
#ifdef HAVE_LIBWACOM
- wacom_device = meta_input_settings_get_tablet_wacom_device (input_settings,
- pad);
+ wacom_device = meta_input_device_get_wacom_device (META_INPUT_DEVICE (pad));
layout_path = libwacom_get_layout_filename (wacom_device);
#endif
}
--
2.26.0.rc2

View File

@ -0,0 +1,49 @@
From d4c070da88d94a8d6e3e96348b97ce46f93430ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Sat, 21 Mar 2020 18:24:52 +0100
Subject: [PATCH 48/48] window: Really propagate effective on-all-workspaces
setting to transients
Commit cda9579034b fixed a corner case when setting the initial workspace
state of transient windows, but it still missed a case:
should_be_on_all_workspaces() returns whether the window should be on all
workspaces according to its properties/placement, but it doesn't take
transient relations into account.
That means in case of nested transients, we can still fail the assert:
1. on-all-workspaces toplevel
2. should_be_on_all_workspaces() is TRUE for the first transient's parent,
as the window from (1) has on_all_workspaces_requested == TRUE
3. should_be_on_all_workspaces() is FALSE for the second transient's
parent, as the window from (2) is only on-all-workspace because
of its parent
We can fix this by either using the state from the root ancestor
instead of the direct transient parent, or by using the parent's
on_all_workspaces_state.
The latter is simpler, so go with that.
https://gitlab.gnome.org/GNOME/mutter/issues/1083
---
src/core/window.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/window.c b/src/core/window.c
index 5a9341578..06988dd1b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1319,7 +1319,7 @@ _meta_window_shared_new (MetaDisplay *display,
g_warn_if_fail (!window->transient_for->override_redirect);
set_workspace_state (window,
- should_be_on_all_workspaces (window->transient_for),
+ window->transient_for->on_all_workspaces,
window->transient_for->workspace);
}
else if (window->on_all_workspaces)
--
2.26.0.rc2

View File

@ -8,7 +8,7 @@
Name: mutter
Version: 3.36.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -18,11 +18,60 @@ Source0: http://download.gnome.org/sources/%{name}/3.36/%{name}-%{version}
# Work-around for OpenJDK's compliance test
Patch0: 0001-window-actor-Special-case-shaped-Java-windows.patch
# Fix preedit string cursor position bug
# https://gitlab.gnome.org/GNOME/gtk/issues/2517
# All patches from 3.36.0 to d4c070da88d94a8d6e3e96348b97ce46f93430ab
# Including fixes for preedit issue:
# https://bugzilla.redhat.com/show_bug.cgi?id=1812449
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1132
Patch1: 0001-wayland-Represent-preedit-string-cursor-offset-in-by.patch
# and output problems on X11 with 4k displays and/or scaling:
# https://bugzilla.redhat.com/show_bug.cgi?id=1809717
Patch0001: 0001-Update-Serbian-translation.patch
Patch0002: 0002-screen-cast-stream-src-Don-t-complain-when-we-can-t-.patch
Patch0003: 0003-screen-cast-stream-src-Don-t-leak-GSource.patch
Patch0004: 0004-xwayland-Log-actual-error-message-if-available.patch
Patch0005: 0005-meson-Expand-on-xwayland_initfd-option-description.patch
Patch0006: 0006-cursor-renderer-native-Refactor-init-to-per-gpu.patch
Patch0007: 0007-cursor-renderer-native-Handle-GPU-hotplug.patch
Patch0008: 0008-window-actor-X11-Update-shape-input-and-opaque-regio.patch
Patch0009: 0009-window-x11-Add-function-to-convert-the-surface-to-cl.patch
Patch0010: 0010-window-actor-x11-Compute-client-area-from-surface-si.patch
Patch0011: 0011-window-actor-Add-API-to-update-regions.patch
Patch0012: 0012-xwayland-Update-regions-on-texture-updates.patch
Patch0013: 0013-window-actor-x11-Use-the-new-MetaShapedTexture-API.patch
Patch0014: 0014-window-x11-Rename-meta_window_x11_buffer_rect_to_fra.patch
Patch0015: 0015-xwayland-Fix-mime-type-atom-list-leak-on-DnD-with-mo.patch
Patch0016: 0016-monitor-config-manager-Respect-layout-mode-when-calc.patch
Patch0017: 0017-crtc-xrandr-Compare-right-coordinate-when-checking-a.patch
Patch0018: 0018-wayland-Don-t-crash-when-trying-to-fullscreen-on-ine.patch
Patch0019: 0019-keybindings-Move-common-window-grab-code-out-of-X-on.patch
Patch0020: 0020-kms-impl-device-Clean-up-state-if-drm-resources-disa.patch
Patch0021: 0021-cogl-Add-main-header-for-Cogl.patch
Patch0022: 0022-cogl-Fix-build-error-when-GL_ARB_sync-is-not-defined.patch
Patch0023: 0023-keybindings-Avoid-double-calls-to-process_event-on-t.patch
Patch0024: 0024-keybindings-Check-the-special-modifiers-specifically.patch
Patch0025: 0025-input-settings-Wire-up-middle-emulation.patch
Patch0026: 0026-input-settings-x11-Fix-typo-in-has_udev_property.patch
Patch0027: 0027-input-settings-Specify-middle-click-emulation-key.patch
Patch0028: 0028-cursor-renderer-native-Skip-hw-cursor-upload-if-we-c.patch
Patch0029: 0029-cogl-texture-Add-some-missing-array-annotations.patch
Patch0030: 0030-clutter-stage-Add-annotations-to-clutter_stage_captu.patch
Patch0031: 0031-wayland-window-Ignore-state-changes-for-popups.patch
Patch0032: 0032-wayland-Represent-preedit-string-cursor-offset-in-by.patch
Patch0033: 0033-kms-impl-simple-Handle-lack-of-cached-mode-set-in-fl.patch
Patch0034: 0034-monitor-manager-Remove-mirror-capability.patch
Patch0035: 0035-clutter-stage-Rename-parameters-to-match-documentati.patch
Patch0036: 0036-Update-Romanian-translation.patch
Patch0037: 0037-x11-Handle-windowing-errors-while-writing-selection-.patch
Patch0038: 0038-backends-x11-Observe-multiple-pad-mode-switch-button.patch
Patch0039: 0039-surface-actor-Fix-memory-leak.patch
Patch0040: 0040-surface-actor-Add-culling-offset-for-geometry-scale.patch
Patch0041: 0041-backends-use-the-enum-name-instead-of-a-literal-0.patch
Patch0042: 0042-wayland-Handle-NULL-preedit-text.patch
Patch0043: 0043-backends-Add-mapping-function-arg-to-settings_set_bo.patch
Patch0044: 0044-backends-Fix-configuration-changes-to-tap-and-drag.patch
Patch0045: 0045-backends-Add-MetaInputDevice-derivable-class.patch
Patch0046: 0046-backends-x11-Drop-internal-WacomDevice-lookups.patch
Patch0047: 0047-backends-Drop-internal-WacomDevice-in-MetaInputSetti.patch
Patch0048: 0048-window-Really-propagate-effective-on-all-workspaces-.patch
BuildRequires: chrpath
BuildRequires: pango-devel
@ -168,6 +217,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Tue Mar 24 2020 Adam Williamson <awilliam@redhat.com> - 3.36.0-3
- Backport all patches to git master for various fixes inc (#1809717)
* Mon Mar 23 2020 Adam Williamson <awilliam@redhat.com> - 3.36.0-2
- Backport fix for preedit cursor position bug (#1812449)