Suppress issues with < 1x1 (i)frames for now in GTK frontend

svn path=/trunk/netsurf/; revision=10383
This commit is contained in:
Daniel Silverstone 2010-04-12 09:48:36 +00:00
parent f58fa3b2ac
commit 2a0b0dab5b

View File

@ -344,9 +344,16 @@ void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int
/* g is a child frame, we need to place it relative to its parent */ /* g is a child frame, we need to place it relative to its parent */
GtkWidget *w = GTK_WIDGET(g->scrolledwindow); GtkWidget *w = GTK_WIDGET(g->scrolledwindow);
GtkLayout *f = g->bw->parent->window->layout; GtkLayout *f = g->bw->parent->window->layout;
int width = x1 - x0 + 2, height = y1 - y0 + 2;
assert(w); assert(w);
assert(f); assert(f);
LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2));
if (width < 1)
width = 1;
if (height < 1)
height = 1;
LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, width, height));
/* if the window has not changed position or size, do not bother /* if the window has not changed position or size, do not bother
* moving/resising it. * moving/resising it.
@ -357,11 +364,11 @@ void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int
w->allocation.width, w->allocation.height)); w->allocation.width, w->allocation.height));
if (w->allocation.x != x0 || w->allocation.y != y0 || if (w->allocation.x != x0 || w->allocation.y != y0 ||
w->allocation.width != x1 - x0 + 2 || w->allocation.width != width ||
w->allocation.height != y1 - y0 + 2) { w->allocation.height != height) {
LOG((" frame has moved/resized.")); LOG((" frame has moved/resized."));
gtk_layout_move(f, w, x0, y0); gtk_layout_move(f, w, x0, y0);
gtk_widget_set_size_request(w, x1 - x0 + 2, y1 - y0 + 2); gtk_widget_set_size_request(w, width, height);
} }
} }