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

Proposal for significant overhaul and potential integration of herbstluftwm #1569

Open
ghost opened this issue Nov 24, 2023 · 18 comments
Open

Comments

@ghost
Copy link

ghost commented Nov 24, 2023

I wanted to discuss the current state of herbstluftwm development and gather some insights. After reviewing previous issues (#79), it appears that a significant overhaul of the codebase may be necessary, given the asynchronous nature of Wlroots compared to the synchronous nature of xlib.

Considering this, I am contemplating forking the project and dedicating my efforts to address these challenges. However, before proceeding, I wanted to assess the potential interest and practicality of integrating this fork into the main branch. Otherwise, it could be an alternative option similar to i3's existing i3-gaps and i3.

My primary concern lies in ensuring that the work I contribute serves a purpose within the community. If there is a genuine demand for such modifications and if it aligns with the vision of the project's contributors, I am more than willing to invest my time and efforts.

@t-wissmann
Copy link
Member

Hi, my vision is to have a single code-base that works for both xlib and wlroots, and I'm happy about help! I'm reluctant to fork the project because I fear that we can never merge the two again. This would imply that I have either double the maintainance work or one of the branches will die.

In the past, I tried to separate general hlwm concepts from xlib-specific code parts, but there is also still much work to be done. I accomplish the separation using signals: instead of the hlwm algorithm calling xlib-functions, the xlib-specific parts listen for signals from a self-contained hlwm that indicate some change.
For example:

  • 'the keybindings have changed' (see e.g. the KeyManager class).
  • there's a (simplified) css engine that defines visuals and so the actual x11 rendering is only 250 LOC (x11-widgetrender.cpp)

@ghost
Copy link
Author

ghost commented Nov 24, 2023

To make sure I understand you correctly. Do you mean the code has been modularized where specific pieces could be rewritten to be drop in? i.e the keymanager class? If so first thing to do would be to modularize the codebase further? Otherwise begin doing that? Make it independent on X, then implement separate classes for wlroots?

@t-wissmann
Copy link
Member

Yes, you're absolutely correct :-). And my vision is that the 'drop in' can happen at run-time when starting hlwm :-)

@ghost
Copy link
Author

ghost commented Nov 24, 2023

I'd be more than willing to help out with decoupling the wm from xlib. I could start a branch today and begin doing that. I'm unfamiliar with your codebase so it'd take a bit of time.

@t-wissmann
Copy link
Member

In order to keep things mergable, I highly recommend to start with only small changes. E.g. what I wanted to do soon is to create subdirectories (hlwm/, hlx/ and then hlway/) in order to divide the source files into the parts that are generally hlwm and the parts that are specific to X.

@ghost
Copy link
Author

ghost commented Nov 24, 2023

For the first change, would creating hlwm. hlx and organizing everything be a good start? Then make a bunch of small changes over time? Or start with small changes and organize later?

@ghost
Copy link
Author

ghost commented Nov 24, 2023

Yes, you're absolutely correct :-). And my vision is that the 'drop in' can happen at run-time when starting hlwm :-)

Would you want it to be compile time switchable too?

@t-wissmann
Copy link
Member

For the first change, would creating hlwm. hlx and organizing everything be a good start? Then make a bunch of small changes over time? Or start with small changes and organize later?

yes, the smaller the PRs the better. E.g. just moving a couple files and adjusting the #include-directives is a good start

Yes, you're absolutely correct :-). And my vision is that the 'drop in' can happen at run-time when starting hlwm :-)

Would you want it to be compile time switchable too?

instead of a compile time switch, two executables are probably easier to use (with two main() functions).

@ghost
Copy link
Author

ghost commented Nov 26, 2023

I am going to work on reading your source code to begin doing this, keep a lookout for new PRs. I have absolutely zero understanding though of the wm. Let me know if you have any tips for understanding it better.

@ghost
Copy link
Author

ghost commented Jan 24, 2024

@t-wissmann Apologies for the delay. After looking over the project briefly I've determined that we will need to at some point overhaul the IPC since it's dependent on X11. I'd be willing to do the work, but what would you want to replace it with? I think supporting multiple IPC solutions would be unnecessary.

@t-wissmann
Copy link
Member

It's better to start with small changes. Even though the IPC isn't a very big change, one needs to be very careful when designing it, because one needs to be aware of the concurrency and avoid blocking (e.g. hlwm must not freeze even if 'hc' sends an incomplete request). I'm not familiar with wayland, but maybe they support some way of message interchange.

@ghost
Copy link
Author

ghost commented Jan 25, 2024

Of course could start sorting the sources out to hlwm and xorg first. Wlroots implements an IPC solution we could use that or use something like dbus to avoid maintaining two implementations of the IPC.

@ypnos
Copy link
Member

ypnos commented Mar 10, 2024

Compositor Modules should be considered as a backend for porting HLWM to Wayland instead of Wlroots.

Advantages:

  1. Works both with X11 and Wayland, can port the whole codebase of HLWM once instead of introducing a new divergency in the code
  2. Provides high-level abstraction which should significantly reduce amount of new code to be written and might even reduce HLWM codebase by a bit
  3. Is a C++ library

Drawbacks:

  1. Although the code base is old and battle tested (KWin), the library by itself is very young
  2. It is a one-man project so far (a similar thing might be said about wlroots, but Como depends on wlroots, so it only adds an uncertainty)

@gyreas
Copy link

gyreas commented Apr 10, 2024

What's the current state of this effort? (That person's account is deleted.)

@t-wissmann
Copy link
Member

Beside the messages in this thread, I have never received any kinds of contributions from this person. (I already found it quite suspicious that the person's github profile was almost empty...)

The current state of the effort is unfortunately rather unchanged, because I have essentially no time for hlwm at the moment because of family and my job.

@gyreas
Copy link

gyreas commented Apr 12, 2024

I'd like to contribute to this effort esp their suggestion about incremental separation of concerns; however, I can't promise anything tho mostly because I'm not familiar with C++ (but C) and the codebase.
I'm going work on those and submit a draft PR when I get a basic understanding of both.

How does that sound?

PS: Was there a time when hlwm considered itself the wm for hackers by specifying so on the homepage? Do you have idea which wm did at some point? I kinda vaguely remember some wm did but don't which

@ypnos
Copy link
Member

ypnos commented Apr 12, 2024 via email

@gyreas
Copy link

gyreas commented Apr 12, 2024

@ypnos

while I'm not too sure about that, I think it's fitting for dwm.

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

3 participants