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

Add support for null application. #668

Open
Penguin-Guru opened this issue Nov 25, 2024 · 2 comments
Open

Add support for null application. #668

Penguin-Guru opened this issue Nov 25, 2024 · 2 comments

Comments

@Penguin-Guru
Copy link

Is your feature request related to a problem? Please describe

I would like to define gestures specifically for areas of my screen that do not have a window. This is different from a global gesture, because I do not want the same gesture to apply to any windows.

Describe the solution you'd like

Perhaps a special "None" value could be added, similar to this ALL value. The down side is that some applications might actually have that name, but the logic already exists and this seems like the simplest approach.

Describe alternatives you've considered

I tried leaving the application value empty in my config file. This did not seem to work, but that syntax could probably be made to work. I think it would be more clear to have explicit syntax though.

Additional context

I might try to add this feature myself if I have time. If there's already a way of achieving the result, please let me know. 🙂

@JoseExposito
Copy link
Owner

What's your use case for this?

The first thing to check is if the areas without windows (desktop, panels, etc) have a WM_CLASS. You can check it running this command and clicking on them:

$ xprop | grep WM_CLASS

If they happen to have a class, then you should be able to configure actions for them without additional changes.

If not, check this piece of code:
https://github.com/JoseExposito/touchegg/blob/master/src/gesture-controller/gesture-controller.cpp#L57

There is already a method (runOnSystemWindows()) that indicates if an action can or cannot run on system windows (desktop, dock, panels, etc). The number of actions that work on system windows are limited.

I think that the most common use case is to have global actions and, maybe for some apps, have custom actions. I'd be open to include this if there is a reasonable use case for it. Otherwise, given the limited number of actions that can run in system windows, I'd prefer to avoid adding additional complexity here and add new UI in https://github.com/JoseExposito/touche

@Penguin-Guru
Copy link
Author

I would like to map certain gestures to do things like start an application only when they are performed on the desktop background, because I want to map some (but not necessarily all) of the same gestures to other functions when they are performed on top of application windows.

I think my desktop background is the root window and does not have a WM_CLASS assigned (by i3). Using the same gestures on all system windows would probably be fine for me. I will take a look at that code and experiment a bit. Thank you. 🙂

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

No branches or pull requests

2 participants