Closed dkondor closed 3 years ago
I like that idea:
The first two hunks need to be adjusted to current master the recent labdachanges changed that code, see https://github.com/damianatorrpm/wayfire-plugin_dbus_interface/commit/db16021653bf9cc41b1d61fe9361e8437ed5d77d
You'll want to put everything after g_variant_get() inside a [=] lamda. When it applies I'll test it :)
Hi,
I've rebased on master and adapted to the changes to use wl_idle_call and lambdas.
At the same time, I'm wondering if it is safe to re-use the same idle_call for all methods. I feel that if multiple requests come in in a short time, the later one could "overwrite" the previous which will not be executed in this case. Also, is wl_idle_call thread-safe in this manner? (What if the new run_once() is called while the previous call is running in the main thread?) Although I don't know how easy it would be to create a test case for these (since this matters only if multiple dbus methods are called in very short intervals).
So far, it's working nicely in my tests though.
feel that if multiple requests come in in a short time, the later one could "overwrite" the previous which will not be executed in this case.
You're absolutely right. I will merge this and later solve this by moving to individual lamdas (or one that go out of scope)
Also, is wl_idle_call thread-safe in this manner?
It's the same thing that the wl_event_loop_add _idle thing did https://github.com/WayfireWM/wayfire/commit/e5a1f83c33954e38cc305b196c79887cc37c7ae9
Tested it, works great.
For multiple monitor another function could be done that calls this for each output, and even using custom data close all scal'es when one scale exits, but the real problem is that the scale plugin (in non-iteractive mode) can't move views.
Otherwise LGTM, thanks!
Empty filter will match all views. Otherwise, the given app_id should be an exact, case-insensitive match.
Note: there could be multiple options / variations for different matches (e.g. substrings, based on title, based on a group of app_ids). I could extend the matching procedure for this.
Untested on multiple outputs -- it should work based on identifying the active output and registering an instance of the filter class for each output when needed.