window: Complete moving enter/leave handling here

This commit is contained in:
Jasper St. Pierre 2014-05-15 16:20:41 -04:00
parent 91a6f42345
commit 550f1989ff
3 changed files with 15 additions and 9 deletions

View File

@ -888,22 +888,17 @@ handle_input_xevent (MetaDisplay *display,
enter_event->time, enter_event->time,
enter_event->root_x, enter_event->root_x,
enter_event->root_y); enter_event->root_y);
if (window->type == META_WINDOW_DOCK)
meta_window_raise (window);
} }
break; break;
case XI_Leave: case XI_Leave:
if (display->grab_op == META_GRAB_OP_COMPOSITOR) if (display->grab_op == META_GRAB_OP_COMPOSITOR)
break; break;
if (window != NULL) if (window != NULL &&
enter_event->mode != XINotifyGrab &&
enter_event->mode != XINotifyUngrab)
{ {
if (window->type == META_WINDOW_DOCK && meta_window_handle_leave (window);
enter_event->mode != XINotifyGrab &&
enter_event->mode != XINotifyUngrab &&
!window->has_focus)
meta_window_lower (window);
} }
break; break;
case XI_FocusIn: case XI_FocusIn:

View File

@ -708,6 +708,7 @@ void meta_window_handle_enter (MetaWindow *window,
guint32 timestamp, guint32 timestamp,
guint root_x, guint root_x,
guint root_y); guint root_y);
void meta_window_handle_leave (MetaWindow *window);
gboolean meta_window_handle_ungrabbed_event (MetaWindow *window, gboolean meta_window_handle_ungrabbed_event (MetaWindow *window,
const ClutterEvent *event); const ClutterEvent *event);

View File

@ -7983,6 +7983,16 @@ meta_window_handle_enter (MetaWindow *window,
case G_DESKTOP_FOCUS_MODE_CLICK: case G_DESKTOP_FOCUS_MODE_CLICK:
break; 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 gboolean