On gtk3 (at least at some point) frame extents was drawn by the window manager and on X11 we could use the WM _NET_FRAME_EXTENTS extension.
So, afaik it was hard to size the window to it’s whole size, accounting decorations, unless using gtk_window_set_titlebar so it was possible to know the header size (dunno about the left, right and bottom extents).
It appears that Gtk4 headed to the titlebar solution. So, the questions are:
Does the WM still draw the decorations? Or Gtk draws it within the Surface?
Same solution for X11 or Wayland, or behaviour differs?
How would I set the whole window size (accounting decorations) with Gtk4, using the same solution for Wayland and X11?
on X11 when using a custom titlebar, GTK tries hard to convince the window manager to not add its own decorations
when not using a custom titlebar, GTK relies on the window manager to decorate the window under X11.
(*) except when running under a compositor that expresses a preference for server-side decorations. In that case the wayland backend behaves as the X11 one
Use gtk_window_set_titlebar() to use client-side decorations. As that means that decorations are part of the client window/surface, the actual window size matches GTK’s idea of the window size.
With Gtk 3.24.20 using this example below I was able to resize the window with gdk_window_resize. gtk_window_set_default_size seems to add the header bar size and shadow sizes, resulting in larger size than specified on gtk_window_set_default_size.
Is there a way to say “I want the final size to be total 800x600 (for example)”, when using header bar?
gdk_window_resize works as expected, but it’s a resize operation that needs to be done after.