Closed dgod closed 2 months ago
Fedora 40 wlroots 0.17.3 labwc 0.7.2 gtk-layer-shell 0.8.2
#include <gtk/gtk.h> #include <gtk-layer-shell.h> int main(int argc,char **argv) { gtk_init(&argc,&argv); GtkWindow *w = (GtkWindow*)gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_layer_init_for_window(w); gtk_layer_set_layer (w, GTK_LAYER_SHELL_LAYER_TOP); gtk_layer_set_anchor(w,GTK_LAYER_SHELL_EDGE_LEFT,TRUE); gtk_layer_set_anchor(w,GTK_LAYER_SHELL_EDGE_RIGHT,FALSE); gtk_layer_set_anchor(w,GTK_LAYER_SHELL_EDGE_TOP,TRUE); gtk_layer_set_anchor(w,GTK_LAYER_SHELL_EDGE_BOTTOM,FALSE); gtk_window_resize(w,400,400); gtk_widget_show_all(GTK_WIDGET(w)); gtk_main(); return 0; }
If the window doesn't have any content (and so is naturally 0-sized) you need to call gtk_widget_set_size_request(), as per the docs.
gtk_widget_set_size_request()
Fedora 40 wlroots 0.17.3 labwc 0.7.2 gtk-layer-shell 0.8.2