[mutter/gnome-41] backend: Get the default seat directly
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-41] backend: Get the default seat directly
- Date: Wed, 22 Dec 2021 20:28:47 +0000 (UTC)
commit 8a71523393c74e882587172c7820c46b9390208b
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Sep 16 11:12:08 2021 +0200
backend: Get the default seat directly
In various places we retrieved the default seat from the ClutterBackend.
All the clutter backends implement this by calling
meta_backend_get_default_seat() which will then return
MetaBackendPrivate::default_seat.
Lets avoid this by fetching the default seat directly.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2002>
src/backends/meta-backend.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 651cd592f7..f4fceeb4ee 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -286,7 +286,7 @@ reset_pointer_position (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
- ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+ ClutterSeat *seat = priv->default_seat;
MetaLogicalMonitor *primary;
primary =
@@ -321,7 +321,7 @@ static void
update_cursors (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
- ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+ ClutterSeat *seat = priv->default_seat;
MetaCursorRenderer *cursor_renderer;
ClutterInputDevice *pointer, *device;
GList *devices, *l;
@@ -352,7 +352,7 @@ meta_backend_monitors_changed (MetaBackend *backend)
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
- ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+ ClutterSeat *seat = priv->default_seat;
ClutterInputDevice *device = clutter_seat_get_pointer (seat);
graphene_point_t point;
@@ -509,7 +509,7 @@ static void
on_stage_shown_cb (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
- ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+ ClutterSeat *seat = priv->default_seat;
g_autoptr (GList) devices = NULL;
const GList *l;
@@ -535,7 +535,7 @@ static void
meta_backend_real_post_init (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
- ClutterSeat *seat = clutter_backend_get_default_seat (priv->clutter_backend);
+ ClutterSeat *seat = priv->default_seat;
MetaInputSettings *input_settings;
priv->stage = meta_stage_new (backend);
@@ -1225,10 +1225,8 @@ meta_backend_get_cursor_renderer (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
ClutterInputDevice *pointer;
- ClutterSeat *seat;
- seat = clutter_backend_get_default_seat (priv->clutter_backend);
- pointer = clutter_seat_get_pointer (seat);
+ pointer = clutter_seat_get_pointer (priv->default_seat);
return meta_backend_get_cursor_renderer_for_device (backend, pointer);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]