Hacker News new | past | comments | ask | show | jobs | submit login

Never programmed with Wayland (or X) before but this doesn't look so terrible. Let's say I want to do something only slightly more complicated than this article, e.g. have a few static rectangles on the screen showing images and text, without any window decorations, like for a status bar or a clock or something. If I don't want to roll my own protocol-handling code as in this article, what libraries are good? In say Rust or Go or something? Every time I've looked into Gtk or Qt they seemed way too complicated, doing far more than I want and introducing too many abstractions and dependencies. Conceptually all I want to do is:

    window = make_stupid_simple_undecorated_window(x, y, w, h);
    paint_window(window, some_image_buffer);
    block_forever();



Unless your "application" is the only thing in the screen, you need some protocol. At a minimum, repainting after your windows has been obscured by others, reacting to commands like closing the window or the session, shutting down, etc.

The main difference from CLI is that GUI works reacting to messages, even for (re)painting. Once you get that, the rest falls into place. This is usually implemented with object-oriented libraries, because it's the kind of application where OOP shines. But it's not mandatory.

Oh, and your app should also respond to move, change workspace, minimize... messages.


I've toyed around with Smithay Client Toolkit [1] for Rust and I think it offers just the right abstraction for writing simple Wayland clients.

[1] - https://github.com/Smithay/client-toolkit




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: