Making your own Application Manager (Linux / Wayland)
-
I'd like to create a simple "App Manager" on an embedded Linux system that supports Wayland. Like a Windows Desktop, where you can launch & see multiple programs next to each other / minimize / toggle between them, et cetera.
With a "program", I mean a stand-alone executable, just like Windows can launch any EXE. The application could be QML, could be a native OpenGL app, could be QWidgets, could be anything really.
Now I've read small bits about the Wayland compositor, and it seems there plenty of Qt examples, explaining how to do it... but it's all QML.
Honestly I have zero experience with Wayland compositors, nor QML. My mindset is rusted back in the good old C++ (and QWidget / OpenGL apps) days, just writing a single APP. So I'm not so sure if these examples are putting me on the right track. In the ideal world, this "App Manager" should be capable to launch anything, just as long it has some kind of window. QWidget, QML, it shouldn't matter.
Note I'm not (yet) looking for fancy interoperatability between APPs. Just placing them at position XY, maximizing/minimizing, maybe dragging, that would be enough for now. Eventual communication between the apps could be socket based, and would be very minimal anyway.
Are there specific terms/words to search for, or a nice starters tutorial on this specific matter?
Thanks!
-
I'd like to create a simple "App Manager" on an embedded Linux system that supports Wayland. Like a Windows Desktop, where you can launch & see multiple programs next to each other / minimize / toggle between them, et cetera.
With a "program", I mean a stand-alone executable, just like Windows can launch any EXE. The application could be QML, could be a native OpenGL app, could be QWidgets, could be anything really.
Now I've read small bits about the Wayland compositor, and it seems there plenty of Qt examples, explaining how to do it... but it's all QML.
Honestly I have zero experience with Wayland compositors, nor QML. My mindset is rusted back in the good old C++ (and QWidget / OpenGL apps) days, just writing a single APP. So I'm not so sure if these examples are putting me on the right track. In the ideal world, this "App Manager" should be capable to launch anything, just as long it has some kind of window. QWidget, QML, it shouldn't matter.
Note I'm not (yet) looking for fancy interoperatability between APPs. Just placing them at position XY, maximizing/minimizing, maybe dragging, that would be enough for now. Eventual communication between the apps could be socket based, and would be very minimal anyway.
Are there specific terms/words to search for, or a nice starters tutorial on this specific matter?
Thanks!
@Rick16bit
I might be off in what you are looking for, but isn't KDE Plasma Desktop written in/with Qt, and open source, and does what you want?Oh, I see https://en.wikipedia.org/wiki/KDE_Plasma_5 says
The graphical interface was fully migrated to QML,
so maybe that means it is not what you want to look at?
-
Thanks for the pointers JonB
I don't have a specific preference for (non)QML, and that's perhaps the main thing: I'm trying to figure out how to write such a "App Manager" (or Compositor?) that can both launch/manage QML and non QML (widget, native OpenGL, ...something else) programs. The point is that I may not be writing all these APPs mayself, so who knows what's inside the code.
I did some more digging in the meanwhile. Seems QT itself has a /Examples/Wayland/ folder, which also includes examples on how to make a C++ wayland compositor. I * think * that is the direction I'm looking for... but I can't tell for sure since I cannot compile the example :p
https://doc.qt.io/qt-5/qtwaylandcompositor-qwindow-compositor-example.html
"cannot find -lwayland-server" and "cannot find -lxkbcommon", QT tells me. I'm guessing some of the deeper libraries are missing. Though strange enough, some of the QML examples work fine.
-
Thanks for the pointers JonB
I don't have a specific preference for (non)QML, and that's perhaps the main thing: I'm trying to figure out how to write such a "App Manager" (or Compositor?) that can both launch/manage QML and non QML (widget, native OpenGL, ...something else) programs. The point is that I may not be writing all these APPs mayself, so who knows what's inside the code.
I did some more digging in the meanwhile. Seems QT itself has a /Examples/Wayland/ folder, which also includes examples on how to make a C++ wayland compositor. I * think * that is the direction I'm looking for... but I can't tell for sure since I cannot compile the example :p
https://doc.qt.io/qt-5/qtwaylandcompositor-qwindow-compositor-example.html
"cannot find -lwayland-server" and "cannot find -lxkbcommon", QT tells me. I'm guessing some of the deeper libraries are missing. Though strange enough, some of the QML examples work fine.
@Rick16bit
I think I am not following what you are looking for/expecting, as this and embedded is not my area. My (limited) understanding is that Wayland, like X/X11/Xorg, is just a display manager, and that is all the term "compositor" means. That in itself has nothing to do with "launching/managing applications", which is just something the OS, or a desktop manager (like GNOME or the KDE-Plasma I referenced), supports. But you probably know better than I, so I'll leave it at that.... -
The question is a bit vague (because I don't really know how to put a very specific question, being new in this domain). Hopefully the picture below does a better job explaining what I'm trying to achieve.
So on en embedded system - not sure yet which specific Linux, but it will be pretty "bare bones"- I have a bunch of small stand-alone applications. With a window/UI (fixed size). That could be anything really, a calculator, the weather forecast, and so on - I don't know (I won't be writing them).
Since the embedded system doesn't have any visual desktop by itself, I would like to create one. One with 2 or 4 sections (see picture), so multiple programs can run side-to-side.
Just using QProcess to launch whatever app is probably not doing the trick though. As far as I know, you can't simply set the XY/width/height of a window. At least not on this embedded device, using Wayland. Also, if you want to do some fancy tricks like dragging/dropping APPs, there are some things to be done by this "Manager". I believe you can create your own Compositor for exactly these kind of purposes, but from what I read, you're supposed to use QML (which I'm not sure of if these APPs will).