-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add mouse_passthrough_rectangles #8568
Comments
Oooh, that's clever! I was slightly concerned about what we would do to the poly API. Still, I wonder, should we mark it as deprecated? |
Considering Linux distributions are starting to move away from X11 as a default, it makes sense to deprecate this API when Wayland is merged. |
@Calinou note that poly regions are also available on Windows and MacOS, it's not an X11 only thing. |
I think changing the documentation under that polygon that the rectangle one is recommended for wider support is enough. Like if someone wants to use polygon regions for more accurate passthrough it'd be pretty hard to accurately do it with rectangles. This is a very niche property not used by games and mostly tools anyways and it's not worth it to deprecate that imo. |
@arlo-phoenix great point. Count me as favorable to this idea :D |
Since I don't see anyone against it I plan to work on this in the near future (since polygon passthrough already exists seems like an easy change). Just a quick question: Should the property/functions be called |
@arlo-phoenix I just grepped the code for Also note that the method/property name is pretty long, so I'd also choose |
Describe the project you are working on
A transparent overlay with many widgets spread out on the screen.
Describe the problem or limitation you are having in your project
It is not straightforward to add multiple mouse passthrough regions. On X11 it is possible to make a polygon out of several rectangles (4 points each in the array), but that doesn't always work like when there are overlaps and I doubt this functionality was really intended in the first place.
With people slowly moving on from X11 and polygons not being supported in Wayland's wl_region this would bring back an API working on all major desktop display servers.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a new window property which contains a list of rectangles which works the same as the current mouse_passthrough_polygon. I think mouse_passthrough_rectangles is a fitting name.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
For this to work:
Window
needs the new propertymouse_passthrough_rectangles
of typeTypedArray<Rect2i>
window_set_mouse_passthrough_rectangles
(similar to window_set_mouse_passthrough for polygons)I already implemented a quick prototype for X11 and Wayland.
The idea there is to not remove mouse passthrough polygon support on the display servers that currently have it, but instead create a combined Region with the specific API's. So first create a region based on the passthrough polygon and then combine/union it with every rectangle.
so you can just use it same as I did in the X11 implementation.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No. Passthrough is handled within the different DisplayServers.
Is there a reason why this should be core and not an add-on in the asset library?
Not possible with an add-on.
The text was updated successfully, but these errors were encountered: