void image_attach_window(ImageWindow *imd, GtkWidget *window,
const gchar *title, const gchar *title_right, gboolean show_zoom)
{
+ LayoutWindow *lw;
+
imd->top_window = window;
g_free(imd->title);
imd->title = g_strdup(title);
imd->title_right = g_strdup(title_right);
imd->title_show_zoom = show_zoom;
- if (!options->image.fit_window_to_image) window = NULL;
+ lw = layout_find_by_image(imd);
+
+ if (!(options->image.fit_window_to_image && lw && lw->options.tools_float)) window = NULL;
pixbuf_renderer_set_parent((PixbufRenderer *)imd->pr, (GtkWindow *)window);
#include "filedata.h"
#include "fullscreen.h"
#include "image.h"
+#include "image-load.h"
#include "image-overlay.h"
#include "layout.h"
#include "layout_image.h"
}
/* Wait until image is loaded otherwise size is not defined */
- int count;
- for (count = 10; count && !w && !h; count++)
- {
- image_get_image_size(vw->imd, &w, &h);
- usleep(100000);
- }
+ image_load_dimensions(fd, &w, &h);
- if (image_zoom_get(vw->imd) == 0.0)
- {
- image_get_image_size(vw->imd, &w, &h);
- }
- else
- {
- pixbuf_renderer_get_scaled_size(PIXBUF_RENDERER(vw->imd->pr), &w, &h);
- }
if (options->image.limit_window_size)
{
gint mw = gdk_screen_width() * options->image.max_window_size / 100;