# KDE on Genode OS

**URL:** <https://genode.discourse.group/t/kde-on-genode-os/441>\
**Category:** General\
**Created:** [November 11, 2026, 10:22pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441 "2026-11-11T22:22:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 11, 2026, 10:22pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/1 "2026-11-11T22:22:43Z")

</div>

Blueprint: Porting KDE Plasma’s Window Management to Genode

Context:  
While building a custom GUI compositor and window manager in Genode 26.08, I found that standard window management often relies on simple or hardcoded logic. To achieve a mature, desktop-class experience without reinventing the wheel, I spent some time analyzing how mature Linux desktops handle window geometry, snapping, and panels.

Specifically, I dug into the implementation of KDE Plasma (plasmashell / kwin). I am sharing these mathematical blueprints so other developers building custom GUI roots, layouters, or improving Sculpt OS can implement these patterns natively in C++.

1. The “Work Area” (Maximize Logic)

The Trap: A naive implementation of “Maximize” fills the entire raw framebuffer, covering the panels.  
The Solution: Maximized geometry must derive from the clientArea() (the work area). This is the raw screen minus the reserved rectangles of panels, docks, or sidebars.

Implementation Math:

```cpp
// Instead of using raw screen bounds:
int max_x = 0;
int max_y = 0;
int max_w = screen_width - sidebar_width;
int max_h = screen_height - dock_height;

```

1. Normalized Snap Slots (Quick Tiling)

The Trap: Hardcoding pixel coordinates for snapping (e.g., “Left Half”). If the resolution changes or a sidebar appears, the snapped window overlaps boundaries.  
The Solution: KDE stores its 8 pre-built snap slots in a normalized 0.0 to 1.0 space. It only multiplies these by the current work-area dimensions at the exact moment the layout is calculated.

Implementation Math:

```cpp
// Normalized slot definition (can be stored in a config or Report):
// Left Half: { x: 0.0, y: 0.0, w: 0.5, h: 1.0 }
// Right Half: { x: 0.5, y: 0.0, w: 0.5, h: 1.0 }

// At layout time, multiply by the Work Area:
int final_x = work_area.x + (slot.x * work_area.w);
int final_y = work_area.y + (slot.y * work_area.h);
int final_w = slot.w * work_area.w;
int final_h = slot.h * work_area.h;

```

Genode Note: This pattern maps perfectly to Genode’s Report/ROM architecture. The Layout policy can publish normalized percentages, and the compositor applies them to the current framebuffer size.

1. Resize Clamps (Preventing Geometry Breakage)

The Trap: Letting the user resize a window to 1x1 pixels, which breaks custom mathematical shapes (like chamfered corners) and causes rendering artifacts.  
The Solution: Hard clamping against the Work Area and absolute minimums.

Implementation Math:

```cpp
int min_w = 150; // Hard floor
int min_h = 100;

// Don't let the window overlap the right edge or bottom edge
int max_w = work_area.w - window.x;
int max_h = work_area.h - window.y;

// Clamp the user's raw drag delta
window.w = std::max(min_w, std::min(raw_new_w, max_w));
window.h = std::max(min_h, std::min(raw_new_h, max_h));

```

1. Dock Auto-Hide Distance

The Trap: Triggering the auto-hide animation based on raw edge collision, causing flickering.  
The Solution: A strict distance formula combined with a single-shot debounce timer (e.g., 500ms).  
In Genode: The dock component should handle the debounce timer natively, publishing a Report. The compositor then interpolates the slide animation based on that state change.

* * *

A Genode-Specific Gotcha (Bonus):  
While implementing this in a custom compositor that also uses libc for VFS file access (themes, fonts), I hit a hard Libc::suspend() deadlock. If you mix libc with the base entrypoint (env.ep()), ensure the libc thread does not return and suspend. Ending the Libc::with\_libc block with Genode::sleep\_forever() prevents the runtime from aborting.

I hope these blueprints save other developers the debugging time it took to extract them!

---

<div class="post-metadata">

**Author:** ![ttcoder](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/ttcoder/32/9_2.png) [@ttcoder](https://genode.discourse.group/u/ttcoder)\
**Post date:** [November 12, 2026, 1:22pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/2 "2026-11-12T13:22:01Z")

</div>

Hi Shiro, from your profile :

> I am building a new operating system based on Genode and I share my journey with the best community in the subject. This is how we grow

Interesting. Is the source available somewhere ? Wouldn’t it be more appropriate to gather all the progress reports in one thread so that they’re not spread out in multiple threads ?

Thanks

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 13, 2026, 1:33pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/3 "2026-11-13T13:33:04Z")

</div>

Hello ttcoder, I post here some solutions not the whole process of the OS. I see you are interested on this subject, ok it will be very soon posted somewhere and it will be open source. What I can tell you now is that I had to get rid of nitpicker and create a new desktop builder and few more components to get it properly working. Once it’s uploaded somewhere I’ll PM you with the link. Thank you for your interest.

Shiro

---

<div class="post-metadata">

**Author:** ![G0retZ](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/g0retz/32/232_2.png) [@G0retZ](https://genode.discourse.group/u/G0retZ)\
**Post date:** [November 13, 2026, 1:53pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/4 "2026-11-13T13:53:09Z")

</div>

Hi Shiro, this looks like an interesting project.

Though the `nitpicker` is the base block of the system providing a secure window management with a proper isolation between different windowed components and with protected copy-paste buffer.

In fact it predates even the Genode itself and was a starting point for it.  
If you are going to throw it way I’m curious what are you going to use instead? 🤔

---

<div class="post-metadata">

**Author:** ![ttcoder](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/ttcoder/32/9_2.png) [@ttcoder](https://genode.discourse.group/u/ttcoder)\
**Post date:** [November 13, 2026, 2:09pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/5 "2026-11-13T14:09:33Z")

</div>

Back when I was working on my own Genode-based OS project I briefly considered two competing approaches : 1) targetting nitpicker, or 2) targetting something called app\_server – the latter meant refactoring app\_server so that it would ‘talk’ to the Genode video card drivers, whereas the former just meant refactoring libbe.so (the API applications were programmed against) to use the nitpicker API, and leaving it up to nitpicker to talk to the video card. That choice was more simple and straight-forward with the limited means and limited time I had back then, so I went that way.

I can see how someone could have the same dilemma with Wayland… And these days with “vibe coding” it removes lots of barrier-to-entry friction, compared to just a few years ago (though I’m not sure I would trust vibe-coded code, even if thoroughly reviewed by skilled humans).

And if you take nitpicker out of the picture, you remove a significant part of the Genode appeal, too : stability and security depend not only on the drivers, and the ‘kernel’, but also on the GUI stack being simple and trusted. It’s all a matter of priorities I guess.

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 13, 2026, 2:55pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/6 "2026-11-13T14:55:43Z")

</div>

I build a desktop _builder component that works as nitpicker but eliminates the restrictions of it. Further more I build a theme_ \_ manager to facilitate new desktop designs so users can create their own desktop. Both components are in the source code, the OS is basically ready but need some polish. As I work Monday to Friday on this project I only work on weekends so I might be able to release v0.18 Sunday. Will paste link if all goes well

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 13, 2026, 3:18pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/7 "2026-11-13T15:18:48Z")

</div>

By the way I am not literally porting KDE in genode, I use the math’s of KDE to create the new desktop experience. KDE is just a donor but don’t expect KDE desktop.

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 15, 2026, 12:32pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/8 "2026-11-15T12:32:18Z")

</div>

![1000007863](https://europe1.discourse-cdn.com/flex006/uploads/genode/original/1X/cfdf8d248a2b6a27112d38b76891fde715168c15.jpeg)left is aimed, right is current state of HermOS. If you are interested I am uploading it to GitHub right now, just say so and I add the link. What I did in general is replace nitpicker, clone Hermes Agent built new file manager to open edit and SSH it in one peace of software and few more extras. It is still secure Genode

---

<div class="post-metadata">

**Author:** ![ttcoder](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/ttcoder/32/9_2.png) [@ttcoder](https://genode.discourse.group/u/ttcoder)\
**Post date:** [November 15, 2026, 2:18pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/9 "2026-11-15T14:18:34Z")

</div>

Please do. Speaking personally for me, despite being careful about LLM-generated code I wonder if there could be a way for it to help human-coded projects, using a “clean room” approach. If I’m not mistaken (it’s been long since I heard that term), a programming team that replicates (part of) another’s work without looking at their actual code is called “clean room” replication. That might alleviate copyright and security concerns. I won’t be able to test that theory on my own project as it’s discontinued (and I was just the one, whereas by definition a clean-room approach requires at least two persons), but I guess others might.

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 16, 2026, 6:07pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/10 "2026-11-16T18:07:52Z")

</div>

Uploaded it to GitHub. Need to clean some private keys and y ready to test

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 17, 2026, 7:10pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/12 "2026-11-17T19:10:31Z")

</div>

I’ll take your Clean Room idea and see what could be done. It’s a nice approach, Merci

---

<div class="post-metadata">

**Author:** ![Shiro](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Shiro](https://genode.discourse.group/u/Shiro)\
**Post date:** [November 17, 2026, 7:22pm UTC](https://genode.discourse.group/t/kde-on-genode-os/441/13 "2026-11-17T19:22:46Z")

</div>

I’ll build it as a component, called Chinese Wall inside the OS. Elegant solution for many legal issues. Thanks you
