This is a GTK2 question rather than a nim question. I hope some NIXER will disregard that and lend a hand. I have returned to a cross-platform GUI nim project after 6 months in the Javascript Wilderness. I discovered the GTK2 version of my module was exercising the check-resize callback many more times than necessary.
I have been unsuccessful in finding the documentation for the check-resize signal - such as when it is emitted and what is done to its window just prior to that.
where handle is the top level window reference.
The call back (placed up-source) is like this:
proc resizeReq(widget: gtk2.PWindow, data: Pgpointer) {.cdecl.} =
#steps not shown
var wid,hgt:gint
widget.get_size(wid.addr.Pgint,hgt.addr.Pgint)
#steps using wid and hgt to revise children in widget.
When the user expands the window, how is the new size communicated to the window? Does the expansion do a set_size prior to sending the signal? Are these issues discussed anywhere?
Maybe this can help you, should be still for old GTK2:
https://stackoverflow.com/questions/1060039/gtk-detecting-window-resize-from-the-user
I dont know for GTK2 -- if non of the suggested signals work properly, one solution is to save old window size in your application and do redraw only if new size is really different. I think I did something like that in GTK3, but can not remember if it was related to size or something different.