From 694748d4887f8ffd866ae30c1660e86af2ceafed Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 22 Dec 2004 04:14:06 +0000 Subject: Redo size handling. Tue Dec 21 23:05:51 2004 Owen Taylor * backend/ev-document.{h,cc} pdf/xpdf/pdf-document.cc: Redo size handling. * shell/ev-view.c: Track the size from the document. --- (limited to 'shell') diff --git a/shell/ev-view.c b/shell/ev-view.c index 9fbc81a..f52b372 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -147,10 +147,19 @@ static void ev_view_size_request (GtkWidget *widget, GtkRequisition *requisition) { - /* EvView *view = EV_VIEW (widget); */ + EvView *view = EV_VIEW (widget); + + if (GTK_WIDGET_REALIZED (widget)) { + if (view->document) { + ev_document_get_page_size (view->document, + &requisition->width, + &requisition->height); + } else { + requisition->width = 10; + requisition->height = 10; + } + } - requisition->width = 500; - requisition->height = 500; } static void @@ -223,9 +232,17 @@ ev_view_realize (GtkWidget *widget) gdk_window_set_user_data (view->bin_window, widget); gdk_window_show (view->bin_window); - if (view->document) + if (view->document) { ev_document_set_target (view->document, view->bin_window); + /* We can't get page size without a target, so we have to + * queue a size request at realization. Could be fixed + * with EvDocument changes to allow setting a GdkScreen + * without setting a target. + */ + gtk_widget_queue_resize (widget); + } + update_window_backgrounds (view); } -- cgit v0.9.1