diff --git a/README.md b/README.md index b71b19f5..4041f936 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ This README is being written.
## Announcements +* **widget, &a); - g_print("%-14s| window width %d height %d\n", prefix, a.width, a.height); - gtk_widget_get_allocation(w->childHolderWidget, &a); - g_print("%-14s| client width %d height %d\n", prefix, a.width, a.height); - gtk_window_get_size(w->window, &ww, &wh); - g_print("%-14s| winsiz width %d height %d\n", prefix, ww, wh); -#else -#error forgot to remove dbgPrintSizes() (TODO) -#endif -} - static gboolean onClosing(GtkWidget *win, GdkEvent *e, gpointer data) { uiWindow *w = uiWindow(data); @@ -60,12 +42,8 @@ static void onSizeAllocate(GtkWidget *widget, GdkRectangle *allocation, gpointer { uiWindow *w = uiWindow(data); - dbgPrintSizes(w, "SIZE-ALLOCATE"); - - if (w->changingSize) - w->changingSize = FALSE; - else - (*(w->onContentSizeChanged))(w, w->onContentSizeChangedData); + // TODO deal with spurious size-allocates + (*(w->onContentSizeChanged))(w, w->onContentSizeChangedData); } static int defaultOnClosing(uiWindow *w, void *data) @@ -151,13 +129,9 @@ void uiWindowContentSize(uiWindow *w, int *width, int *height) { GtkAllocation allocation; - dbgPrintSizes(w, "BEFORE GET"); - gtk_widget_get_allocation(w->childHolderWidget, &allocation); *width = allocation.width; *height = allocation.height; - - dbgPrintSizes(w, "AFTER GET"); } void uiWindowSetContentSize(uiWindow *w, int width, int height) @@ -165,8 +139,6 @@ void uiWindowSetContentSize(uiWindow *w, int width, int height) GtkAllocation childAlloc; gint winWidth, winHeight; - dbgPrintSizes(w, "BEFORE SET"); - // we need to resize the child holder widget to the given size // we can't resize that without running the event loop // but we can do gtk_window_set_size() @@ -191,8 +163,6 @@ void uiWindowSetContentSize(uiWindow *w, int width, int height) // and set it // this will not move the window in my tests, so we're good gtk_window_resize(w->window, winWidth, winHeight); - - dbgPrintSizes(w, "AFTER SET"); } int uiWindowFullscreen(uiWindow *w) @@ -259,16 +229,6 @@ void uiWindowSetMargined(uiWindow *w, int margined) setMargined(w->childHolderContainer, w->margined); } -static gboolean TODO_REMOVE(GtkWidget *win, GdkEvent *e, gpointer data) -{ - uiWindow *w = uiWindow(data); - - dbgPrintSizes(w, "CONFIGURE"); - - // always continue handling - return FALSE; -} - uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) { uiWindow *w; @@ -315,7 +275,5 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) // TODO we really need to clean this up, especially since see uiWindowDestroy() above g_object_ref(w->widget); - g_signal_connect(w->widget, "configure-event", G_CALLBACK(TODO_REMOVE), w); - return w; }