tryone144 / compton

A compositor for X11.
Other
617 stars 235 forks source link

dbus server accepts parsing blur strength and added dbus example #16

Open mvrozanti opened 5 years ago

mvrozanti commented 5 years ago

This one doesn't bloat stuff up and solves #14

I'm still wondering though, can we omit the parse_blur_strength call?

tryone144 commented 5 years ago

Thanks for re-implementing in the dbus interface.

But I'm not quite shure how you want to change the parameters without a call to parse_blur_strength? Currently, the blur strength is tracked globally and directly set by said function.

mvrozanti commented 5 years ago

Yeah I don't know why I mentioned that actually

mvrozanti commented 5 years ago

Oops

I forgot to rename that. I was not sure if it had had conflicts with ps->o.blur_strength somehow

I'm also not sure how to add this to opts_set, I'm gonna try and find out

tryone144 commented 5 years ago

I'm also not sure how to add this to opts_set, I'm gonna try and find out

There should be a generic handler: https://github.com/tryone144/compton/blob/6dab09d90bcf4a62c8942119e5f0e37c08c83504/src/dbus.c#L1001

mvrozanti commented 5 years ago

Is that last commit right..?

I also wanted to have the possibility to increment/decrement by a factor.

tryone144 commented 5 years ago

Is that last commit right..?

Looks like you forgot to actually change the copied handler to update the blur-strength like the other one did... The old win_set handler is misleading and should be removed, I think.

I also wanted to have the possibility to increment/decrement by a factor though.

This is a bit more difficult, as there is currently no way to read the numeric blur-strength value back. But this could be stored in the ps->o.blur_strength item as well. Just update the corresponding struct definition and the parse method to include the numeric value as well like here: https://github.com/tryone144/compton/blob/0f86353e0357a20af380ac73c3e0d804861e30a5/src/common.h#L554-L559 https://github.com/tryone144/compton/blob/0f86353e0357a20af380ac73c3e0d804861e30a5/src/common.h#L1709-L1744 This value should be accessible via a new dbus handler in opts_get. Increment and decrement should then be possible via the dbus interface.

mvrozanti commented 5 years ago

Does this look right? this dbus thing is kinda weird

tryone144 commented 5 years ago

I guess it works... :smile: I'll take a look at it later.

mvrozanti commented 5 years ago

https://github.com/mvrozanti/compton/blob/05b5f30795fcb54a690b48e4ea112c82fdf58de5/src/dbus.c#L836

This looks pretty bad though x)