Commit f25da803 authored by Jonas Dreßler's avatar Jonas Dreßler
Browse files

window: add can_grab

parent 99a2a038
Pipeline #399435 waiting for manual action with stages
......@@ -1926,6 +1926,9 @@ meta_display_begin_grab_op (MetaDisplay *display,
return FALSE;
}
if (!grab_window->can_grab)
return FALSE;
/* Grab keys when beginning window ops; see #126497 */
if (event_route == META_EVENT_ROUTE_WINDOW_OP)
{
......
......@@ -427,6 +427,8 @@ struct _MetaWindow
/* Whether the window is alive */
guint is_alive : 1;
unsigned int can_grab : 1;
/* if non-NULL, the bounds of the window frame */
cairo_region_t *frame_bounds;
......
......@@ -1029,6 +1029,8 @@ _meta_window_shared_new (MetaDisplay *display,
meta_window_update_desc (window);
window->override_redirect = attrs->override_redirect;
if (window->override_redirect)
g_warning("WS: FFUUUUCK, it's an OR window");
/* avoid tons of stack updates */
meta_stack_freeze (window->display->stack);
......@@ -1173,6 +1175,8 @@ _meta_window_shared_new (MetaDisplay *display,
window->compositor_private = NULL;
window->can_grab = TRUE;
if (window->rect.width > 0 && window->rect.height > 0)
window->monitor = meta_window_calculate_main_logical_monitor (window);
else
......@@ -8622,3 +8626,16 @@ meta_window_calculate_bounds (MetaWindow *window,
return FALSE;
}
}
void
meta_window_set_can_grab (MetaWindow *window,
gboolean can_grab)
{
if (window->can_grab == can_grab)
return;
window->can_grab = can_grab;
if (!window->can_grab && window->display->grab_window == window)
meta_display_end_grab_op (window->display, meta_display_get_current_time_roundtrip (window->display));
}
......@@ -453,4 +453,8 @@ uint64_t meta_window_get_id (MetaWindow *window);
META_EXPORT
MetaWindowClientType meta_window_get_client_type (MetaWindow *window);
META_EXPORT
void meta_window_set_can_grab (MetaWindow *window,
gboolean can_grab);
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment