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
This commit is contained in:
Olivier Fourdan 2019-07-25 08:57:05 +02:00
parent 15c9458e92
commit ad62a659eb
2 changed files with 14 additions and 1 deletions

View File

@ -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);

View File

@ -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 &&