diff --git a/window/goWindow.h b/window/goWindow.h index 5c0d135..c70795b 100644 --- a/window/goWindow.h +++ b/window/goWindow.h @@ -11,6 +11,7 @@ #include "alert_c.h" #include "window.h" #include "win32.h" +#include "win_sys.h" int show_alert(const char *title, const char *msg, const char *defaultButton, const char *cancelButton){ diff --git a/window/pub.h b/window/pub.h index f3a2c0d..47689bf 100644 --- a/window/pub.h +++ b/window/pub.h @@ -255,6 +255,30 @@ MData mData; } } + static Bounds GetFrame(MData win){ + Bounds frame; + // Retrieve frame bounds + if (WM_EXTENTS != None) { + long* result; uint32 nItems = 0; + // Get the window extents property + result = (long*) GetWindowProperty(win, WM_EXTENTS, &nItems); + + // Verify the results + if (result != NULL) { + if (nItems == 4) { + frame.X = (int32) result[0]; + frame.Y = (int32) result[2] + frame.W = (int32) result[0] + (int32) result[1]; + frame.H = (int32) result[2] + (int32) result[3]; + } + + XFree(result); + } + } + + return frame; + } + #elif defined(IS_WINDOWS) //