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

Clickthrough to underlying X windows #9

Closed
coderobe opened this issue Jan 18, 2018 · 4 comments
Closed

Clickthrough to underlying X windows #9

coderobe opened this issue Jan 18, 2018 · 4 comments

Comments

@coderobe
Copy link
Collaborator

A clickthrough feature would be nice, to be able to operate applications that glava might be overlaying (on purpose), or to be able to interact with desktop icons when the xwintype is "desktop" but seemingly on top of the filemanager rendering the icons

@jarcode-foss jarcode-foss changed the title Clickthrough Clickthrough to underlying X windows Jan 18, 2018
@jarcode-foss
Copy link
Owner

After some investigation, I need to use _NET_CLIENT_LIST (EWMH atom) to get a list of windows and then sort through which ones are under GLava, and then perform bounds-checking for the mouse cursor to pass mouse events.

There are some problems with this approach. The primary issue is that I would have to rely on whatever the WM is reporting as a client list, which reportedly omits things like widgets and desktop windows for some WMs, like KDE. This would make it so icons still wouldn't work anyway.

For key events, I simply will not implement any sort of passthrough. Deciding what window to pass key events to is an issue regarding input focus, and GLava should not be able to obtain input focus if it's behaving properly as a widget or desktop window.

For scenarios where a user may want GLava positioned on top of all (or some) windows, rather than the desktop windows and root window, proper and WM-portable mouse event passthrough is simply not possible. I can try to hack together a solution that works for some, but I'm not interested in wasting time on a feature that will break on major WMs.

The core problem here is that the WM should be implementing this behaviour, allowing windows to be classed in such a way that allows the window to ignore mouse input. Unfortunately this kind of behaviour or type isn't specified in EWMH (and even if it were, I'm sure it would only work half the time).

I think what I will attempt sometime is some sort of clickthrough 'bind', where mouse events from glava get forwarded to a specific window that can be configured (ie. identified by class or title). This way I don't have to rely on _NET_CLIENT_LIST.

@mmhobi7
Copy link
Contributor

mmhobi7 commented Mar 11, 2018

    Region region;

    region = XCreateRegion();
    if (region) {
      XShapeCombineRegion(display, window.window, ShapeInput, 0, 0, region,
                          ShapeSet);
      XDestroyRegion(region);
    }

and maybe
wmHint.input = false;

Another solution is to set focus to the window behind glava

mmhobi7 added a commit to mmhobi7/wallama-paper that referenced this issue Mar 11, 2018
@jarcode-foss
Copy link
Owner

jarcode-foss commented Mar 12, 2018

Reopening since @aaahh has brought up a fix that uses the X11 shape extension to implement this. I will just add this feature by default (no config option) since I can't imagine anyone actually wants GLava to eat input. This will also fix the issue with desktop icons being unclickable under GLava.

@jarcode-foss jarcode-foss reopened this Mar 12, 2018
@jarcode-foss jarcode-foss added this to the 1.5 milestone Mar 13, 2018
@jarcode-foss
Copy link
Owner

"desktop" windows on the current unstable branch have the attempted clickthrough fix. It appears the workaround using the shape extension only works on select WMs (probably has to do with how the WM reparents the window into its own frames).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants