[mutter] window: Move UI frame event handler to a separate function



commit ad62a659eb08701be561e71a6a7a9f419f5558b1
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Thu Jul 25 08:57:05 2019 +0200

    window: Move UI frame event handler to a separate function
    
    In order to tell whether an event has been handled by the frame UI, move
    the UI frame handler to a specific helper function.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/88

 src/core/window-private.h |  3 +++
 src/core/window.c         | 12 +++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 0c71152a4..916827119 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -782,6 +782,9 @@ void meta_window_handle_enter (MetaWindow  *window,
                                guint        root_y);
 void meta_window_handle_leave (MetaWindow  *window);
 
+gboolean meta_window_handle_ui_frame_event (MetaWindow         *window,
+                                            const ClutterEvent *event);
+
 void meta_window_handle_ungrabbed_event (MetaWindow         *window,
                                          const ClutterEvent *event);
 
diff --git a/src/core/window.c b/src/core/window.c
index 43240e5c0..80588c7e9 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8243,6 +8243,16 @@ meta_window_handle_leave (MetaWindow *window)
     meta_window_lower (window);
 }
 
+gboolean
+meta_window_handle_ui_frame_event (MetaWindow         *window,
+                                   const ClutterEvent *event)
+{
+  if (!window->frame)
+    return FALSE;
+
+  return meta_ui_frame_handle_event (window->frame->ui_frame, event);
+}
+
 void
 meta_window_handle_ungrabbed_event (MetaWindow         *window,
                                     const ClutterEvent *event)
@@ -8256,7 +8266,7 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
   gfloat x, y;
   guint button;
 
-  if (window->frame && meta_ui_frame_handle_event (window->frame->ui_frame, event))
+  if (meta_window_handle_ui_frame_event (window, event))
     return;
 
   if (event->type != CLUTTER_BUTTON_PRESS &&


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