display: Call meta_window_grab_op_ended after everything else is reset

This properly sends the resizing state to the correct Wayland surface.
This commit is contained in:
Jasper St. Pierre 2014-07-17 15:51:42 -04:00
parent 9316256e10
commit 679844f791

View File

@ -1863,18 +1863,19 @@ void
meta_display_end_grab_op (MetaDisplay *display, meta_display_end_grab_op (MetaDisplay *display,
guint32 timestamp) guint32 timestamp)
{ {
MetaWindow *grab_window = display->grab_window;
MetaGrabOp grab_op = display->grab_op;
meta_topic (META_DEBUG_WINDOW_OPS, meta_topic (META_DEBUG_WINDOW_OPS,
"Ending grab op %u at time %u\n", display->grab_op, timestamp); "Ending grab op %u at time %u\n", grab_op, timestamp);
if (display->grab_op == META_GRAB_OP_NONE) if (display->grab_op == META_GRAB_OP_NONE)
return; return;
g_signal_emit (display, display_signals[GRAB_OP_END], 0, g_signal_emit (display, display_signals[GRAB_OP_END], 0,
display->screen, display->grab_window, display->grab_op); display->screen, grab_window, grab_op);
meta_window_grab_op_ended (display->grab_window, display->grab_op); if (meta_grab_op_is_moving_or_resizing (grab_op))
if (meta_grab_op_is_moving_or_resizing (display->grab_op))
{ {
/* Clear out the edge cache */ /* Clear out the edge cache */
meta_display_cleanup_edges (display); meta_display_cleanup_edges (display);
@ -1900,7 +1901,7 @@ meta_display_end_grab_op (MetaDisplay *display,
{ {
meta_topic (META_DEBUG_WINDOW_OPS, meta_topic (META_DEBUG_WINDOW_OPS,
"Ungrabbing all keys timestamp %u\n", timestamp); "Ungrabbing all keys timestamp %u\n", timestamp);
meta_window_ungrab_all_keys (display->grab_window, timestamp); meta_window_ungrab_all_keys (grab_window, timestamp);
} }
display->grab_timestamp = 0; display->grab_timestamp = 0;
@ -1917,6 +1918,8 @@ meta_display_end_grab_op (MetaDisplay *display,
display->grab_resize_timeout_id = 0; display->grab_resize_timeout_id = 0;
} }
meta_window_grab_op_ended (grab_window, grab_op);
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
meta_display_sync_wayland_input_focus (display); meta_display_sync_wayland_input_focus (display);
} }