Hi. Mouse right click does not work for me on Linux after a0d4393, and worked with this patch. Why?
Unfortunately having the XShape stuff in main_loop() causes a crash in some cases. I wasn't able to find the correct magic incantation to make Xlib happy in that case.
If you want XShape functionality to reliably work under all window managers, it should be called after the application receives MapNotify. Also, some WMs (Openbox) have an invisible parent window even when _NET_WM_WINDOW_TYPE is set to _NET_WM_WINDOW_TYPE_DESKTOP, and thus should apply the same code to the parent. For example:
while (XPending(display) > 0) {
XEvent ev;
XNextEvent(display, &ev);
switch (ev.type) {
/* ... */
case MapNotify: {
Window root = DefaultRootWindow(display);
Window win = w->w;
while (win != None) {
Region region;
if ((region = XCreateRegion())) {
XShapeCombineRegion(display, w->w, ShapeInput, 0, 0, region, ShapeSet);
XDestroyRegion(region);
}
Window parent;
find_parent(win, &parent);
win = (parent == root ? None : parent);
}
XFlush(display);
break;
}
}
}
Sincerely, someone who spent far too long debugging this in a separate project.
@wacossusca34 good to know, thanks for the input.
@brndnmtthws is the suggestion made above good to merge? It seems like it should work
Most helpful comment
If you want XShape functionality to reliably work under all window managers, it should be called after the application receives
MapNotify. Also, some WMs (Openbox) have an invisible parent window even when_NET_WM_WINDOW_TYPEis set to_NET_WM_WINDOW_TYPE_DESKTOP, and thus should apply the same code to the parent. For example:Sincerely, someone who spent far too long debugging this in a separate project.