title: How to get a locked maximized window in GTK?
body: <p>I have a <a href="https://developer.gnome.org/gtk3/stable/GtkApplication.html" rel="nofollow noreferrer"><code>GtkApplication</code></a> based program that must always be shown maximized. That is easily accomplished by using <a href="https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-maximize" rel="nofollow noreferrer"><code>gtk_window_maximize</code></a>. The problem is you can still double click or drag the <a href="https://developer.gnome.org/gtk3/stable/GtkHeaderBar.html" rel="nofollow noreferrer"><code>GtkHeaderBar</code></a> to disable the maximized state.</p>
  
  <p>Is there a way to lock the <em>maximized</em> state or to disable the header behavior? Trying to use <a href="https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-resizable" rel="nofollow noreferrer"><code>gtk_window_set_resizable</code></a> effectively locks the window size down but it also disallows the maximization effect.</p>
  
  <p>I'm using <code>xfwm4</code>, the default XFCE window manager.</p>
  
  <pre><code>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));
  </code></pre>
  
  <h3>Addendum</h3>
  
  <p>I asked on the GTK+ forum and <a href="https://discourse.gnome.org/t/how-to-get-a-locked-maximized-window/1670/4" rel="nofollow noreferrer">the suggestion</a> 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.</p>
  
  <p>The original question still stands though.</p>