# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324393514 0 # Node ID 26dbd11399d6e56b2cb870ec7c566b7210ef1fbc # Parent a317c2ec1d4ca06bc34288678a46b682a2facf51 Don't attempt to set windows to an invalid size on GTK when a very small or 0 size is requested. diff -r a317c2ec1d4c -r 26dbd11399d6 gtk/dw.c --- a/gtk/dw.c Tue Dec 20 14:30:10 2011 +0000 +++ b/gtk/dw.c Tue Dec 20 15:05:14 2011 +0000 @@ -10251,8 +10251,11 @@ gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", GINT_TO_POINTER(height)); } /* Resize minus the border size */ - gdk_window_resize(handle->window, width - cx , height - cy ); - gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy ); + if(width > cx && height > cy) + { + gdk_window_resize(handle->window, width - cx , height - cy ); + gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy ); + } } else gtk_widget_set_usize(handle, width, height); diff -r a317c2ec1d4c -r 26dbd11399d6 gtk3/dw.c --- a/gtk3/dw.c Tue Dec 20 14:30:10 2011 +0000 +++ b/gtk3/dw.c Tue Dec 20 15:05:14 2011 +0000 @@ -8618,7 +8618,7 @@ { /* Check if we have cached frame size values */ if(!((cx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(handle), "_dw_frame_width"))) | - (cy = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(handle), "_dw_frame_height"))))) + (cy = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(handle), "_dw_frame_height"))))) { /* If not try to ask the window manager for the estimated size... * and finally if all else fails, guess. @@ -8633,8 +8633,11 @@ g_object_set_data(G_OBJECT(handle), "_dw_height", GINT_TO_POINTER(height)); } /* Resize minus the border size */ - gtk_window_resize(GTK_WINDOW(handle), width - cx , height - cy ); - gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy); + if(width > cx && height > cy) + { + gtk_window_resize(GTK_WINDOW(handle), width - cx , height - cy ); + gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy); + } } else gtk_widget_set_size_request(handle, width, height);