[FEATURE] window `:clickthrough` property
Description of the requested feature
The :clickthrough property would allow one to click through the window. This would be very useful for small, bar-like widgets with revealer elements; currently a window holding such a widget sets its dimensions as if the revealer is already open, blocking the portion of the screen it occupies from receiving any mouse events.
When this property is set to true, mouse events that don't occur to an eww element that accepts them (inputs, buttons, eventboxes, and the like) get passed to the window beneath the eww window. This allows eww widgets to remain interact-able, while also gaining the ability to support complex layouts without sacrificing the base functionality of the system.
Proposed configuration syntax
:clickthrough would accept a boolean argument. setting it to true would cause the eww window to pass mouse events that don't occur on a button, eventbox, or other interact-able element to the window underneath.
Additional context
No response
As of my knowledge, there is no way to accomplish this under Wayland, or any other way of manipulating window properties I know of (layer shell GTK_LAYER_SHELL_KEYBOARD_MODE_NONE does not work for mouse inputs). As I do not use X11, I do not know what the state there is, but it might be available there. Have not tested it, but you could set a custom CSS class if the widget is hidden, which limits the height of the widget.
I mean, as long as custom properties can be assigned to windows, what's to stop eww from handling click through rather than X11/Wayland?
An extremely janky solution would be to emulate the click under the window using something similar to xdotool.
But take my solution with a grain of salt, as I often have very little idea of what I'm actually talking about.
Well, that would theoretically be an option, however:
- It is not possible to just simulate the clicking on another window at an OS/Compositor level because Wayland did not implement this feature universally (However, I think it works on X11 universally)for security reasons. While some Compositors, e.g., sway have an API to get and set the cursor position (and click on windows etc.), others do not, like Hyprland. (So the solution with xdotool wouldn't work under most Wayland compositors)
- For it to work under Wayland, you would need a complete rewrite of the Mouse handling of GTK and then still, you could only click on underlying eww windows