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

For discussion, NO MERGE : Dispatcher v2 API 1st proposition #394

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

johnr14
Copy link

@johnr14 johnr14 commented Nov 12, 2023

The current API of dispatcher is not optimal, it's not uniform, uses too many types of different actions and has poor predictability for function's name.

Left unchanged, it is a irritant to new user and will get worse with time if the complexity of hyprland keeps growing in a far future. Those changes can be postponed, but having a API revision after release 1.0 wouldn't be the best.

As no names where kept and thus no collision with previous API occurs, this could be implemented without breaking anything.

Old API could be discouraged and eventually be deprecated and removed after a notice and appropriate elapsed time.

The term window is deprecated in favor of client as Wayland namely use clients. However Wayland does interchange the term window and client a lot in it's documentation but it says this about it's architecture : "is how clients actually render under wayland", "the rendering happens in the client, and the client just sends a request to the compositor to indicate the region that was updated ", "the compositor receives generic Wayland buffers from the clients". Could revert to windows if maintainers or users strongly wish for it.

This proposition is an attempt to consolidate the wording used in the dispatcher's functions name with a naming convention that :

    1. would help understand what a function does without having to read it's description.
    2. be uniform
         2.1 for the type of action it performs
         2.2 for the subject of the action
         2.3 for the target of the action
         2.4 for the passing of arguments, mandatory and optional

All names are in a format of : nounVerbVariation.

The number of dispatchers action verbs went down from 22 to 9.

Lots of param where defined. Params use the opt:param syntax, may or may not be kept depending on difficulty to implement.

A few examples are added for groups and special workspace.

Discussed in #3805

First proposition, please check for :

  1. if it makes any sens to change the API
  2. coherence and logic
  3. omissions
  4. ease of use
  5. efficiency
  6. orthography and syntax after first 3 :)

This is in no way implemented in bind or hyprctl and is used to illustrate how the API could be redesigned.

Thanks for your time in pondering on how to make hyprland even greater and please add your comments. I did try to finish in a rush and may have made a few "oops". I'll try to squash the request, hope it works.

@johnr14
Copy link
Author

johnr14 commented Nov 12, 2023

Please view as a wiki-page for now. Thanks

If you know how I could squash this, please tell.

fix a few typos
Param added fakefullscreen as it's in windows rules.

Added missing commas in examples
@TuxMC-sys
Copy link
Contributor

Please view as a wiki-page for now. Thanks

If you know how I could squash this, please tell.

Is this what you're looking for?

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

Successfully merging this pull request may close these issues.

2 participants