Bug fix: Re-size images in GTK3
authorColin Clark <colin.clark@cclark.uk>
Thu, 4 May 2017 18:06:48 +0000 (19:06 +0100)
committerColin Clark <colin.clark@cclark.uk>
Thu, 4 May 2017 18:06:48 +0000 (19:06 +0100)
When compiled with GTK3 if an image is opened with "View in new window"
the minimum window size is determined by the image size and screen size
etc. If a file selection is opened, the minimum window size is set by
the first image displayed.
This feature is determined by a call to gtk_widget_set_size_request().

When compiled with GTK2, the call to gtk_widget_set_size_request() seems
to be ignored, and the window can be resized at will.

The GTK2 style is much more practical, so the call to
gtk_widget_set_size_request() is ignored in GTK3.

src/img-view.c

index d31853c..00aff7e 100644 (file)
@@ -906,7 +906,9 @@ static ViewWindow *real_view_window_new(FileData *fd, GList *list, CollectionDat
        req_size.height = h;
        gtk_widget_size_allocate(GTK_WIDGET(vw->window), &req_size);
 
+#if !GTK_CHECK_VERSION(3,0,0)
        gtk_widget_set_size_request(vw->imd->pr, w, h);
+#endif
 
        gtk_widget_show(vw->window);