mirror of
https://github.com/brl/mutter.git
synced 2025-08-10 10:24:47 +00:00
Track the X Shape input region and use it for picking
We now track whether a window has an input shape specified via the X Shape extension. Intersecting that with the bounding shape (as required by the X Shape extension) we use the resulting rectangles to paint window silhouettes when picking. As well as improving the correctness of picking this should also be much more efficient because typically when only picking solid rectangles then the need to actually render and issue a read_pixels request can be optimized away and instead the picking is done on the cpu.
This commit is contained in:

committed by
Jasper St. Pierre

parent
f0c503b5a9
commit
531be6c413
@@ -2283,6 +2283,33 @@ event_callback (XEvent *event,
|
||||
window->desc);
|
||||
}
|
||||
|
||||
if (display->compositor)
|
||||
meta_compositor_window_shape_changed (display->compositor,
|
||||
window);
|
||||
}
|
||||
else if (sev->kind == ShapeInput)
|
||||
{
|
||||
if (sev->shaped && !window->has_input_shape)
|
||||
{
|
||||
window->has_input_shape = TRUE;
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Window %s now has an input shape\n",
|
||||
window->desc);
|
||||
}
|
||||
else if (!sev->shaped && window->has_input_shape)
|
||||
{
|
||||
window->has_input_shape = FALSE;
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Window %s no longer has an input shape\n",
|
||||
window->desc);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Window %s input shape changed\n",
|
||||
window->desc);
|
||||
}
|
||||
|
||||
if (display->compositor)
|
||||
meta_compositor_window_shape_changed (display->compositor,
|
||||
window);
|
||||
|
Reference in New Issue
Block a user