-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
river-options: create protocol #202
Conversation
We definitely want them. Things such as main amount should be per output,. What we also need to think about is how to trigger layouts if layout relevant values change. Currently we just issue a layout demand if one of the values change. However with the value store river looses the concept of things such as main views. Maybe we need a way for clients to trigger a layout and then let them just subscribe to changes of these values. |
IRC dump:
|
Counter proposal, which I think would be nicer to work with from a clients PoV. Especially having multiple different events for the different value types only works nice with zig-waylands kind of even handlers, while that would be pretty annoying to use in C. And there really needs to be a way for a client 1) to know of what type the option it retrieved is to allow clients to safely handle the case where an option has an unexpected type and 2) to know when an option has not been populated, which is important to clients which may only want to use river-config as an override for their own internal defaults and/or configuration mechanism (consider that 0 and NULL, the default values of options when unpopulated, are ambiguous as they might be otherwise correct values for this option).
|
I think it would make sense to first finish #112, removing the main view related values from the protocol and river and rivertile and contrib/layout.c (the latter two keeping placeholders). Then when river-config is implemented, the only layout related changes would be implementing river-control in rivertile and contrib/layout.c and to set some default values for the main views in the default init. |
One could use the same function to handle all the undesired cases in C, similar to the noop function used here. The big disadvantage to having only a single event/request type as you propose is that it makes the protocol considerably less efficient as 12 useless bytes are sent with every event/request.
The client is guaranteed to receive a
hmm, this could be solved in a couple ways:
I'm pretty confident that this idea of a key-value store is a good one so yeah we should definitely remove the main area related values from the protocol. |
c6770db
to
b9efe66
Compare
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
</copyright> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a global <description ...>
would be nice.
We also need to explain the life-time of the list and I think that would be a good place for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does "Options may never be unset once set." not cover that?
ff20575
to
2953f7c
Compare
Merging this as the sever side implementation is complete and has been tested with a (crappy) example client. Implementation in riverctl and migration of current options to this system can happen in a future PR. |
The idea with this protocol is to expose a key value store allowing clients to set and retrieve arbitrary configuration options as well as watch for changes in options. This would provide a simple mechanism to configure layout generators in an extensible way.
It is also planned to move any of river's simpler configuration options such as border width or background color over to this
protocol.
TODO:
See also this discussion on IRC: https://freenode.irclog.whitequark.org/river/2021-01-14#1610623485-1610638349;
cc @Leon-Plickat