Fix dragging on move/resize grabs

We need to use the grab_window for incoming events if we have an active grab.
This commit is contained in:
Jasper St. Pierre 2013-11-18 18:36:39 -05:00
parent 1a88176cc0
commit 1f569bef76
2 changed files with 13 additions and 23 deletions

View File

@ -397,9 +397,7 @@ meta_window_actor_constructed (GObject *object)
priv->actor = meta_shaped_texture_new_with_xwindow (xwindow); priv->actor = meta_shaped_texture_new_with_xwindow (xwindow);
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor); clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor);
clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
if (meta_is_wayland_compositor ())
clutter_actor_set_reactive (priv->actor, TRUE);
/* /*
* Since we are holding a pointer to this actor independently of the * Since we are holding a pointer to this actor independently of the

View File

@ -1690,27 +1690,17 @@ handle_net_restack_window (MetaDisplay* display,
#endif #endif
static MetaWindow * static MetaWindow *
get_window_for_actor (ClutterActor *actor, get_window_for_event (MetaDisplay *display,
gboolean *frame_was_receiver) const ClutterEvent *event)
{ {
/* Look for any ancestor that is a MetaWindowActor to determine ClutterActor *source;
which window the actor's event belongs to */
*frame_was_receiver = TRUE; if (display->grab_window)
return display->grab_window;
while (actor) source = clutter_event_get_source (event);
{ if (META_IS_WINDOW_ACTOR (source))
if (META_IS_WINDOW_ACTOR (actor)) return meta_window_actor_get_meta_window (META_WINDOW_ACTOR (source));
return meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor));
/* If the frame is the receiver then the source will directly be
the MetaWindowActor, otherwise it will be a child of a
MetaWindowActor so if we make it here then the event isn't
referring to the frame. */
*frame_was_receiver = FALSE;
actor = clutter_actor_get_parent (actor);
}
return NULL; return NULL;
} }
@ -2047,7 +2037,9 @@ meta_display_handle_event (MetaDisplay *display,
const ClutterEvent *event) const ClutterEvent *event)
{ {
MetaWindow *window; MetaWindow *window;
gboolean frame_was_receiver;
/* XXX -- we need to fill this in properly at some point... */
gboolean frame_was_receiver = FALSE;
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
MetaWaylandCompositor *compositor; MetaWaylandCompositor *compositor;
@ -2058,7 +2050,7 @@ meta_display_handle_event (MetaDisplay *display,
} }
#endif /* HAVE_WAYLAND */ #endif /* HAVE_WAYLAND */
window = get_window_for_actor (event->any.source, &frame_was_receiver); window = get_window_for_event (display, event);
display->current_time = event->any.time; display->current_time = event->any.time;