I am implementing a Window derived from Gtk.ApplicaitonWindow. The reason I want to make this Window is to allow me to create “custom headerbars” like in Mac OS. This is what I have so far:
(the overflow is intended, it is in fact one of the features I planned)
To make this frameless (not decorated) Window be resizable I had to manually handle the click event on the borders (also had to set the cursors manually), and that is where my Window differs from GTK’s. I can only resize the Window from the inside (x <= 4 for example), but GTK’s handles appear on the outside:
I dug up GDK files on Gitlab and couldn’t find anything, I did however find something on Adwaita’s files (GTK default theme). In _common.scss#L4541 there is a
10px margin in
window decoration and the comment above that line suggests that that area is used to resize the window. So my question is: how can I handle mouse events 10px outside (around) my Window?
I just realized setting the margin via CSS does nothing, but doing it by setting the margin property kinda works, the issue now is that setting the margin via property only works for bottom and right, left and top don’t seem to respect that.
If I set a 100px margin on all sides, bottom and right will get 200px, the window gets the margin but it isn’t drawn in the center of the margin.