From: <ne...@se...> - 2006-11-19 20:00:58
|
Author: dsilvers Date: Sun Nov 19 20:00:45 2006 New Revision: 3066 URL: http://svn.semichrome.net?rev=3D3066&view=3Drev Log: More tidying, still not got scrolling or allocation quite right Modified: branches/dsilvers/gtk-frames/gtk/gtk_scaffolding.c branches/dsilvers/gtk-frames/gtk/gtk_window.c branches/dsilvers/gtk-frames/gtk/gtk_window.h Modified: branches/dsilvers/gtk-frames/gtk/gtk_scaffolding.c URL: http://svn.semichrome.net/branches/dsilvers/gtk-frames/gtk/gtk_scaffol= ding.c?rev=3D3066&r1=3D3065&r2=3D3066&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- branches/dsilvers/gtk-frames/gtk/gtk_scaffolding.c (original) +++ branches/dsilvers/gtk-frames/gtk/gtk_scaffolding.c Sun Nov 19 20:00:45 = 2006 @@ -767,6 +767,7 @@ =20 gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[0]); // Issue a final reflow so that the content object reports its siz= e correctly + nsgtk_gui_window_update_targets(_g); schedule(5, (gtk_callback)(nsgtk_window_reflow_content), _g); } =20 Modified: branches/dsilvers/gtk-frames/gtk/gtk_window.c URL: http://svn.semichrome.net/branches/dsilvers/gtk-frames/gtk/gtk_window.= c?rev=3D3066&r1=3D3065&r2=3D3066&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- branches/dsilvers/gtk-frames/gtk/gtk_window.c (original) +++ branches/dsilvers/gtk-frames/gtk/gtk_window.c Sun Nov 19 20:00:45 2006 @@ -240,6 +240,7 @@ GtkFixed *f =3D g->bw->parent->window->fixed; assert(w); assert(f); + LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2)); gtk_fixed_move(f, w, x0, y0); gtk_widget_set_size_request(w, x1 - x0 + 2, y1 - y0 + 2); } @@ -363,14 +364,32 @@ return TRUE; } =20 +int nsgtk_gui_window_update_targets(struct gui_window *g) +{ + GtkWidget *widget =3D GTK_WIDGET(g->viewport); + int new_width, new_height; + int changed =3D 0; + new_width =3D widget->allocation.width - 2; + new_height =3D widget->allocation.height; + if( new_width !=3D g->target_width || + new_height !=3D g->target_height ) { + changed =3D 1; + g->target_width =3D new_width; + g->target_height =3D new_height; + } + return changed; +} + + gboolean nsgtk_window_size_allocate_event(GtkWidget *widget, GtkAllocation *allocation, gpoin= ter data) { struct gui_window *g =3D data; =20 - g->target_width =3D widget->allocation.width - 2; - g->target_height =3D widget->allocation.height; - + nsgtk_gui_window_update_targets(g); + =20 + LOG(("Size allocate for %s =3D> %d x %d\n", g->bw->name, g->target= _width, g->target_height)); + =20 /* schedule a callback to perform the resize for 1/10s from now */ schedule(5, (gtk_callback)(nsgtk_window_reflow_content), g); =20 @@ -379,6 +398,8 @@ =20 void nsgtk_window_reflow_content(struct gui_window *g) { + int updated =3D nsgtk_gui_window_update_targets(g); + if (gui_in_multitask) return; =20 @@ -389,11 +410,13 @@ g->bw->current_content->status !=3D CONTENT_STATUS_DONE) return; =20 + LOG(("Doing reformat")); + =20 content_reformat(g->bw->current_content, g->target_width, g->target_height); =20 - if (nsgtk_scaffolding_is_busy(g->scaffold)) - schedule(100,=20 + if (nsgtk_scaffolding_is_busy(g->scaffold) || updated) + schedule((updated?1:100),=20 (gtk_callback)(nsgtk_window_reflow_content), g); } =20 @@ -501,10 +524,6 @@ =20 gtk_widget_set_size_request(GTK_WIDGET(g->viewport), 0, 0); =20 - if (g->bw->children) { // We have children. - LOG(("%p: Recalculate children", g)); - browser_window_recalculate_frameset(g->bw); - } } =20 void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) Modified: branches/dsilvers/gtk-frames/gtk/gtk_window.h URL: http://svn.semichrome.net/branches/dsilvers/gtk-frames/gtk/gtk_window.= h?rev=3D3066&r1=3D3065&r2=3D3066&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- branches/dsilvers/gtk-frames/gtk/gtk_window.h (original) +++ branches/dsilvers/gtk-frames/gtk/gtk_window.h Sun Nov 19 20:00:45 2006 @@ -18,5 +18,6 @@ struct browser_window *nsgtk_get_browser_for_gui(struct gui_window *g); =20 float nsgtk_get_scale_for_gui(struct gui_window *g); +int nsgtk_gui_window_update_targets(struct gui_window *g); =20 #endif /* NETSURF_GTK_WINDOW_H */ |