[mutter/wip/carlosg/no-scaled-views-check-in-thread] backends/native: Do not check for scaled views in the input thread
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/no-scaled-views-check-in-thread] backends/native: Do not check for scaled views in the input thread
- Date: Fri, 19 Mar 2021 11:22:14 +0000 (UTC)
commit 7fd2c26e9a962bbeee10bbc1a131b045fb686d10
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Mar 18 21:04:35 2021 +0100
backends/native: Do not check for scaled views in the input thread
Instead, make this check on the main thread, and pass a NULL viewport
information if views are not scaled.
src/backends/native/meta-backend-native.c | 8 +++++---
src/backends/native/meta-seat-impl.c | 7 +++----
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index dbbedceaeb..ad29ad71b0 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -199,11 +199,13 @@ update_viewports (MetaBackend *backend)
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
MetaSeatNative *seat =
META_SEAT_NATIVE (clutter_backend_get_default_seat (clutter_backend));
- MetaViewportInfo *viewports;
+ MetaViewportInfo *viewports = NULL;
+
+ if (!meta_is_stage_views_scaled ())
+ viewports = meta_monitor_manager_get_viewports (monitor_manager);
- viewports = meta_monitor_manager_get_viewports (monitor_manager);
meta_seat_native_set_viewports (seat, viewports);
- g_object_unref (viewports);
+ g_clear_object (&viewports);
}
static void
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index a2ba884b9c..5d3f30b514 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1182,9 +1182,6 @@ meta_seat_impl_filter_relative_motion (MetaSeatImpl *seat_impl,
int view = -1, dest_view;
float new_dx, new_dy, scale;
- if (meta_is_stage_views_scaled ())
- return;
-
if (seat_impl->viewports)
view = meta_viewport_info_get_view_at (seat_impl->viewports, x, y);
if (view < 0)
@@ -3495,7 +3492,9 @@ meta_seat_impl_set_viewports (MetaSeatImpl *seat_impl,
g_return_if_fail (META_IS_SEAT_IMPL (seat_impl));
task = g_task_new (seat_impl, NULL, NULL, NULL);
- g_task_set_task_data (task, g_object_ref (viewports), g_object_unref);
+ if (viewports)
+ g_task_set_task_data (task, g_object_ref (viewports), g_object_unref);
+
meta_seat_impl_run_input_task (seat_impl, task,
(GSourceFunc) set_viewports);
g_object_unref (task);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]