I have a GtkApplication
based program that must always be shown maximized. That is easily accomplished by using gtk_window_maximize
. The problem is you can still double click or drag the GtkHeaderBar
to disable the maximized state.
Is there a way to lock the maximized state or to disable the header behavior? Trying to use gtk_window_set_resizable
effectively locks the window size down but it also disallows the maximization effect.
I'm using xfwm4
, the default XFCE window manager.
gtk_application_add_window(application, window);
gtk_window_maximize(window);
// Resizing instead of maximizing does not change anything: resetting
// the resizable property shrinks the window to its original size
//gtk_window_set_default_size(window, 1024, 768);
//gtk_window_resize(window, 1024, 768);
//gtk_widget_set_size_request(GTK_WIDGET(window), 1024, 768);
// The following line "demaximizes" the window
//gtk_window_set_resizable(window, FALSE);
// Using a different window type, as suggested by theGtknerd, does
// not help either. The following line makes it behave properly but
// disables the app menu (like any type other than NORMAL).
//gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
gtk_widget_show_all(GTK_WIDGET(window));
Addendum
I asked on the GTK+ forum and the suggestion I got was to use a fullscreen window for kiosk applications. I tried this approach (I had to rewrite some part of my code because in fullscreen the application headerbar disappears) and it works well.
The original question still stands though.