It seems that in Wayland, KWin forces borderless windows to have a border.
Is there any workaround?
I am using Plasma 6.6.0 in EndeavourOS
It seems that in Wayland, KWin forces borderless windows to have a border.
Is there any workaround?
I am using Plasma 6.6.0 in EndeavourOS
╰─❯ kinfo ─╯
Operating System: EndeavourOS
KDE Plasma Version: 6.6.0
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2
Kernel Version: 6.18.9-zen1-2-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8700K CPU @ 3.70GHz
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3060 Ti
That is not an in-app solution that I can enforce programmatically for an widget like app
Can you please share a code snippet? Also, can you drag this GTK window?
GTK4 wasn’t working for me, I ended up porting my old gtk3 app to Qt6, which does support borderless windows in plasma where I can drag certain parts.
#include <gtk/gtk.h>
#include <stdbool.h>
static void TestActivate(GtkApplication *Application, gpointer Data) {
GtkWidget *Window = gtk_application_window_new(Application);
gtk_window_set_decorated(GTK_WINDOW(Window), false);
//gtk_window_set_titlebar(GTK_WINDOW(Window), gtk_grid_new());
gtk_window_present(GTK_WINDOW(Window));
}
int main(int argc, char **argv) {
GtkApplication *Application = gtk_application_new(
"a.a.a", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect(Application, "activate", G_CALLBACK(TestActivate), NULL);
int Status = g_application_run(G_APPLICATION(Application), argc, argv);
g_object_unref(Application);
return Status;
}
You can drag it with meta + click, the KDE shortcut, not on it’s own, unless you implement that yourself, which can be done, at least on GTK3 I did do that (not sure about GTK4).
Interestingly, on GTK3 just setting decorated does not work, but setting a widget for the titlebar does.
That wouldn’t work for me. The same goes for resizing.
In GTK3 you could do a lot of things which do not seem to be possible in GTK4.
As a result I ended up switching to Qt6 as my app needs to have its own window controls and I need to drag it without a native titlebar.

Thanks for sharing the code.
From the right click menu resizing works as well, Unless you disallow that from the GTK side. Of course if the window has no decoration, then you cannot resize from the border