diff --git a/src/core/events.c b/src/core/events.c index 6456d9c2f..58137787e 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -888,22 +888,17 @@ handle_input_xevent (MetaDisplay *display, enter_event->time, enter_event->root_x, enter_event->root_y); - - if (window->type == META_WINDOW_DOCK) - meta_window_raise (window); } break; case XI_Leave: if (display->grab_op == META_GRAB_OP_COMPOSITOR) break; - if (window != NULL) + if (window != NULL && + enter_event->mode != XINotifyGrab && + enter_event->mode != XINotifyUngrab) { - if (window->type == META_WINDOW_DOCK && - enter_event->mode != XINotifyGrab && - enter_event->mode != XINotifyUngrab && - !window->has_focus) - meta_window_lower (window); + meta_window_handle_leave (window); } break; case XI_FocusIn: diff --git a/src/core/window-private.h b/src/core/window-private.h index d6c82a6f4..d785cdc52 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -708,6 +708,7 @@ void meta_window_handle_enter (MetaWindow *window, guint32 timestamp, guint root_x, guint root_y); +void meta_window_handle_leave (MetaWindow *window); gboolean meta_window_handle_ungrabbed_event (MetaWindow *window, const ClutterEvent *event); diff --git a/src/core/window.c b/src/core/window.c index 47b9ceb4f..f21ad8b07 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -7983,6 +7983,16 @@ meta_window_handle_enter (MetaWindow *window, case G_DESKTOP_FOCUS_MODE_CLICK: break; } + + if (window->type == META_WINDOW_DOCK) + meta_window_raise (window); +} + +void +meta_window_handle_leave (MetaWindow *window) +{ + if (window->type == META_WINDOW_DOCK && !window->has_focus) + meta_window_lower (window); } gboolean