Mercurial > dwindows
comparison gtk/dw.c @ 1471:26dbd11399d6
Don't attempt to set windows to an invalid size on GTK when
a very small or 0 size is requested.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 20 Dec 2011 15:05:14 +0000 |
parents | a317c2ec1d4c |
children | 1794caee0758 |
comparison
equal
deleted
inserted
replaced
1470:a317c2ec1d4c | 1471:26dbd11399d6 |
---|---|
10249 /* Save the size for when it is shown */ | 10249 /* Save the size for when it is shown */ |
10250 gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", GINT_TO_POINTER(width)); | 10250 gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", GINT_TO_POINTER(width)); |
10251 gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", GINT_TO_POINTER(height)); | 10251 gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", GINT_TO_POINTER(height)); |
10252 } | 10252 } |
10253 /* Resize minus the border size */ | 10253 /* Resize minus the border size */ |
10254 gdk_window_resize(handle->window, width - cx , height - cy ); | 10254 if(width > cx && height > cy) |
10255 gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy ); | 10255 { |
10256 gdk_window_resize(handle->window, width - cx , height - cy ); | |
10257 gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy ); | |
10258 } | |
10256 } | 10259 } |
10257 else | 10260 else |
10258 gtk_widget_set_usize(handle, width, height); | 10261 gtk_widget_set_usize(handle, width, height); |
10259 DW_MUTEX_UNLOCK; | 10262 DW_MUTEX_UNLOCK; |
10260 } | 10263 } |