[mutter/wip/carlosg/input-thread: 57/96] backends: Make MetaHwCursorInhibitor less about sprites




commit b22c9bb743d95a975c953a6f1c16993adef3eacb
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 13 17:29:51 2020 +0200

    backends: Make MetaHwCursorInhibitor less about sprites
    
    Remove the sprite argument from the vfunc, it's used in no implementations
    and conceptually gets a bit in the middle.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403

 src/backends/meta-cursor-renderer.c                | 11 ++++-------
 src/backends/meta-cursor-renderer.h                |  6 ++----
 src/backends/meta-screen-cast-area-stream-src.c    |  7 +++----
 src/backends/meta-screen-cast-monitor-stream-src.c |  7 +++----
 src/backends/native/meta-cursor-renderer-native.c  |  3 +--
 5 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index b80081774a..7d4228a35c 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -82,13 +82,12 @@ static guint signals[LAST_SIGNAL];
 G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRenderer, meta_cursor_renderer, G_TYPE_OBJECT);
 
 static gboolean
-meta_hw_cursor_inhibitor_is_cursor_sprite_inhibited (MetaHwCursorInhibitor *inhibitor,
-                                                     MetaCursorSprite      *cursor_sprite)
+meta_hw_cursor_inhibitor_is_cursor_inhibited (MetaHwCursorInhibitor *inhibitor)
 {
   MetaHwCursorInhibitorInterface *iface =
     META_HW_CURSOR_INHIBITOR_GET_IFACE (inhibitor);
 
-  return iface->is_cursor_sprite_inhibited (inhibitor, cursor_sprite);
+  return iface->is_cursor_inhibited (inhibitor);
 }
 
 static void
@@ -499,8 +498,7 @@ meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer    *renderer
 }
 
 gboolean
-meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
-                                              MetaCursorSprite   *cursor_sprite)
+meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer)
 {
   MetaCursorRendererPrivate *priv =
     meta_cursor_renderer_get_instance_private (renderer);
@@ -510,8 +508,7 @@ meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
     {
       MetaHwCursorInhibitor *inhibitor = l->data;
 
-      if (meta_hw_cursor_inhibitor_is_cursor_sprite_inhibited (inhibitor,
-                                                               cursor_sprite))
+      if (meta_hw_cursor_inhibitor_is_cursor_inhibited (inhibitor))
         return TRUE;
     }
 
diff --git a/src/backends/meta-cursor-renderer.h b/src/backends/meta-cursor-renderer.h
index 37ddb9100d..b16d5cbe2e 100644
--- a/src/backends/meta-cursor-renderer.h
+++ b/src/backends/meta-cursor-renderer.h
@@ -38,8 +38,7 @@ struct _MetaHwCursorInhibitorInterface
 {
   GTypeInterface parent_iface;
 
-  gboolean (* is_cursor_sprite_inhibited) (MetaHwCursorInhibitor *inhibitor,
-                                           MetaCursorSprite      *cursor_sprite);
+  gboolean (* is_cursor_inhibited) (MetaHwCursorInhibitor *inhibitor);
 };
 
 #define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
@@ -73,8 +72,7 @@ void meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer    *render
 void meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer    *renderer,
                                                       MetaHwCursorInhibitor *inhibitor);
 
-gboolean meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
-                                                       MetaCursorSprite   *cursor_sprite);
+gboolean meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer);
 
 graphene_rect_t meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
                                                      MetaCursorSprite   *cursor_sprite);
diff --git a/src/backends/meta-screen-cast-area-stream-src.c b/src/backends/meta-screen-cast-area-stream-src.c
index b69c26ac44..a76352bce1 100644
--- a/src/backends/meta-screen-cast-area-stream-src.c
+++ b/src/backends/meta-screen-cast-area-stream-src.c
@@ -568,8 +568,7 @@ meta_screen_cast_area_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *s
 }
 
 static gboolean
-meta_screen_cast_area_stream_src_is_cursor_sprite_inhibited (MetaHwCursorInhibitor *inhibitor,
-                                                             MetaCursorSprite      *cursor_sprite)
+meta_screen_cast_area_stream_src_is_cursor_inhibited (MetaHwCursorInhibitor *inhibitor)
 {
   MetaScreenCastAreaStreamSrc *area_src =
     META_SCREEN_CAST_AREA_STREAM_SRC (inhibitor);
@@ -580,8 +579,8 @@ meta_screen_cast_area_stream_src_is_cursor_sprite_inhibited (MetaHwCursorInhibit
 static void
 hw_cursor_inhibitor_iface_init (MetaHwCursorInhibitorInterface *iface)
 {
-  iface->is_cursor_sprite_inhibited =
-    meta_screen_cast_area_stream_src_is_cursor_sprite_inhibited;
+  iface->is_cursor_inhibited =
+    meta_screen_cast_area_stream_src_is_cursor_inhibited;
 }
 
 MetaScreenCastAreaStreamSrc *
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c 
b/src/backends/meta-screen-cast-monitor-stream-src.c
index 2986c0af3e..8ff40f24a4 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -706,8 +706,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
 }
 
 static gboolean
-meta_screen_cast_monitor_stream_src_is_cursor_sprite_inhibited (MetaHwCursorInhibitor *inhibitor,
-                                                                MetaCursorSprite      *cursor_sprite)
+meta_screen_cast_monitor_stream_src_is_cursor_inhibited (MetaHwCursorInhibitor *inhibitor)
 {
   MetaScreenCastMonitorStreamSrc *monitor_src =
     META_SCREEN_CAST_MONITOR_STREAM_SRC (inhibitor);
@@ -718,8 +717,8 @@ meta_screen_cast_monitor_stream_src_is_cursor_sprite_inhibited (MetaHwCursorInhi
 static void
 hw_cursor_inhibitor_iface_init (MetaHwCursorInhibitorInterface *iface)
 {
-  iface->is_cursor_sprite_inhibited =
-    meta_screen_cast_monitor_stream_src_is_cursor_sprite_inhibited;
+  iface->is_cursor_inhibited =
+    meta_screen_cast_monitor_stream_src_is_cursor_inhibited;
 }
 
 MetaScreenCastMonitorStreamSrc *
diff --git a/src/backends/native/meta-cursor-renderer-native.c 
b/src/backends/native/meta-cursor-renderer-native.c
index 84aa32bce1..f37f84cc19 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -880,8 +880,7 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
   if (!cursor_sprite)
     return FALSE;
 
-  if (meta_cursor_renderer_is_hw_cursors_inhibited (renderer,
-                                                    cursor_sprite))
+  if (meta_cursor_renderer_is_hw_cursors_inhibited (renderer))
     return FALSE;
 
   for (l = gpus; l; l = l->next)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]