Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse right click does not work for me on Linux after a0d4393 #709

Closed
BytEvil opened this issue Dec 18, 2018 · 6 comments
Closed

Mouse right click does not work for me on Linux after a0d4393 #709

BytEvil opened this issue Dec 18, 2018 · 6 comments
Labels
bug Bug report or bug fix PR Stale Issue that requires attention because it hasn't been updated for over a year

Comments

@BytEvil
Copy link

BytEvil commented Dec 18, 2018

Hi. Mouse right click does not work for me on Linux after a0d4393, and worked with this patch. Why?

@brndnmtthws
Copy link
Owner

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.

@jarcode-foss
Copy link

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.

@brndnmtthws
Copy link
Owner

@wacossusca34 good to know, thanks for the input.

@smac89
Copy link

smac89 commented Feb 16, 2020

@brndnmtthws is the suggestion made above good to merge? It seems like it should work

@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale Issue that requires attention because it hasn't been updated for over a year label Aug 24, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR Stale Issue that requires attention because it hasn't been updated for over a year
Projects
None yet
Development

No branches or pull requests

5 participants