view_surface_at: skip shaded windows in pointer hit-testing
When a window is shaded (rolled up to titlebar only), the client surface is hidden but view_surface_at would still return it for points over the frame decorations. This caused two symptoms: 1. Pointer focus stayed on the client surface, showing I-beam cursor instead of default arrow over the titlebar. 2. Button events routed to the client surface instead of titlebar, preventing double-click-to-unshade from working. Fix: after matching a toplevel view via scene graph, check whether the associated WWindow has flags.shaded set and skip it if so.
This commit is contained in:
parent
6a37107716
commit
69903b23a7
|
|
@ -64,6 +64,19 @@ view_surface_at(int px, int py, double *sx_out, double *sy_out,
|
|||
}
|
||||
if (!match) continue;
|
||||
|
||||
/* If the window is shaded, the client surface is hidden;
|
||||
* do not route pointer events to it. The pointer is over
|
||||
* frame decorations (titlebar) regardless of what the scene
|
||||
* graph or xdg geometry says. */
|
||||
{
|
||||
WObjDescriptor *_desc = wm_backend->context_find(v->id, WM_CTX_CLIENT_WIN);
|
||||
if (_desc && _desc->parent_type == WCLASS_WINDOW) {
|
||||
WWindow *_wwin = (WWindow *)_desc->parent;
|
||||
if (_wwin->flags.shaded)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (v->xw_surface && v->xw_surface->surface) {
|
||||
double sx = px - (double)v->x;
|
||||
double sy = py - (double)v->y;
|
||||
|
|
|
|||
Loading…
Reference in New Issue