diff options
-rw-r--r-- | psi/dxmain.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/psi/dxmain.c b/psi/dxmain.c index 72c060e18..250269aa0 100644 --- a/psi/dxmain.c +++ b/psi/dxmain.c | |||
@@ -354,17 +354,23 @@ static void window_resize(IMAGE *img) | |||
354 | #endif | 354 | #endif |
355 | 355 | ||
356 | if (!visible) { | 356 | if (!visible) { |
357 | guint width, height; | ||
358 | /* We haven't yet shown the window, so set a default size | 357 | /* We haven't yet shown the window, so set a default size |
359 | * which is smaller than the desktop to allow room for | 358 | * which is smaller than the desktop to allow room for |
360 | * desktop toolbars, and if possible a little larger than | 359 | * desktop toolbars, and if possible a little larger than |
361 | * the image to allow room for the scroll bars. | 360 | * the image to allow room for the scroll bars. |
362 | * We don't know the width of the scroll bars, so just guess. */ | 361 | * We don't know the width of the scroll bars, so just guess. */ |
362 | #if !GTK_CHECK_VERSION(3, 0, 0) | ||
363 | gtk_window_set_default_size(GTK_WINDOW(img->window), | ||
364 | min(gdk_screen_width()-96, img->width+24), | ||
365 | min(gdk_screen_height()-96, img->height+24)); | ||
366 | #else | ||
367 | guint width, height; | ||
363 | width = gtk_widget_get_allocated_width (img->window) - 96; | 368 | width = gtk_widget_get_allocated_width (img->window) - 96; |
364 | height = gtk_widget_get_allocated_height (img->window) - 96; | 369 | height = gtk_widget_get_allocated_height (img->window) - 96; |
365 | gtk_window_set_default_size(GTK_WINDOW(img->window), | 370 | gtk_window_set_default_size(GTK_WINDOW(img->window), |
366 | min(width, img->width+24), | 371 | min(width, img->width+24), |
367 | min(height, img->height+24)); | 372 | min(height, img->height+24)); |
373 | #endif | ||
368 | } | 374 | } |
369 | } | 375 | } |
370 | 376 | ||