Xlibe: an Xlib/X11 compatibility layer for Haiku

I was trying to port xine-lib a few days ago when i stumbled up on shmctl() and friends , which are defined in the shm.h header file, so i set it aside for now because i don’t know what are their equivalents in haiku and how much work it would require to use the native ones.

1 Like

Haiku inherits the concept of areas from BeOS for shared memory and the API is pretty nice, in my opinion much nicer than the XSI shared memory API. I don’t know how they come up with these terrible short names in these APIs (shmat, shmctl, shmdt, shmget), but I guess that is just the hideous Unix C style.

It probably would not be that hard to implement the XSI shared memory (SHM) in terms of areas but the kernel would probably still need some SHM specific bookkeeping and the associated syscalls.

Though maybe it could all be done with an API wrapper user-land side. That might be worth looking into to avoid adding more clutter to the kernel. Maybe the shmid_ds structures could be maintained in a special area (since they need to be shared across processes too) and then of course any shared memory created with this API would still be areas underneath. It might be worth trying and someone outside the Haiku team could give it a try.

3 Likes

We need kernel-side support for this due to the permissions system (which incidentally is something Haiku areas lack, and we really should add, though probably not quite the way XSI does it.)

There is an old patch for XSI shared memory on Gerrit, but it uses low-level VM primitives (incorrectly, to boot, so it’s in no shape to be merged); indeed it should be reworked to just use areas.

8 Likes

I want to know the steps to install that xlibe, i want to learn how. Thanks for your excellent work.

It should work by cloning the Git repository and compiling it from source,but I didn’t try it myself and it’s not yet finished,so you should expect much stuff not to work.

git clone https://github.com/waddlesplash/xlibe
cd xlibe
cmake .
make
make install

If it’s automatically installed into a directory where the program you want to compile with it finds it (it should,but I’m not sure),then you should be able to compile programs depending on XLib afterwards.

1 Like

It work until make, but dont install, that part was what i did. now i now what should do later of make (i get the ansewr on the telegram group thanks to x512 and others) then create links to libX11.so.6, libXext.so.6 in /boot/home/config/non-packaged/lib

And now include the header paths(i dont know how yet).

I know this is not a stable work but can be funny to try to build some opensource

I installed devel packages of regular Xlib for headers.

2 Likes

Here’s a fresh screenshot of GTK, now with an open menu:

image

The menus still have some glitches and do not always work the first time, however. More work still to be done … but the TODO list is getting much shorter.

27 Likes

I understand the discussions of native applications vs external toolkits, but for me these developments are going to enable me to make the switch to Haiku permanently.
Being able to run Inkscape through Xlib, some Windows applications/games through Wine and hopefully running virtual machines with virtualization in the future, would bring a non-hostile and sane UI to my daily workflow.

I’m so excited by the recent progress. :slight_smile:

4 Likes

I think this moment is still a ways off for me. My big concerns are (in no particular order):

  • User passwords (and disk encryption)
  • Multi-display setups.
  • Native GPU rendering with 3D and 2D acceleration.
  • Remote desktop support (as in, connecting TO an existing Haiku session).

And I’m pretty sure none of those are coming soon. But, people have long thought about the first three, and the last one is kind of obscure despite how much I use it.

But, Xlibe, Wine, GTK are very cool and promising developments for improving quality-of-life for daily drivers, and discussions of us being close to R1 are also exciting.

@mo-g Did you see that GPU 3D rendering is being worked on and even working quite well for radeon cards (though not yet merged/in testable state)? Vulkan lavapipe software rendering is working on Haiku - #356 by X512

There is also progress with multi-head setup. And I think Axel (or someone else?) was working on a secure keystore, but I may be wrong there.

Also: I think there is a working VNC server for haiku already.

1 Like

$~ sway --my-next-gpu-wont-be-nvidia

:grimacing:

1 Like

We have a remote_app_server built in every Haiku install. You don’t even need a specific client for it: it can act as an http server and render your desktop using an html5 canvas. So you just need a web browser. Connection is established with ssh and port forwarding. All it needs is a bit of UI in the network preferences to configure it (and bugfixes in places where it doesn’t render things the same as the native display system).

6 Likes

Thanks @PulkoMandy - I had mentioned this elsewhere, and Leavengood and Waddlesplash pointed me this way. :slight_smile:

2022-01-22_22-40

27 Likes

The shortcuts (S) looks so hilariously bad…

Not sure where to mention this but a “LOT” of x libs are broken atm: https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/report.txt (same for x86_gcc2)

1 Like

@3dEyes, I built and was testing with it locally, it seems to work pretty well. Feel free to post a recipe if you want, I just did not get around to that.

This is actually intentional. Most of those libraries need a real X server and are thus disabled so Xlibe can be used instead.

2 Likes

Ah, I see you already have, though you disabled custom cursors. Doesn’t that make things much more annoying to use…?

2 Likes

Couldn’t the unix calls for memory be out into a accelerant and trabslated there ?

1 Like