summaryrefslogtreecommitdiff
path: root/gtk/gtk_window.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-04-12 09:48:36 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-04-12 09:48:36 +0000
commit2a0b0dab5b44c3cdafaf297199ffb8f246cd4d18 (patch)
treee4cb88b6a258185a3ce8e3154e040846429a3d2f /gtk/gtk_window.c
parentf58fa3b2ac2c7c0241821cc098cd59772ffb6ce4 (diff)
downloadnetsurf-2a0b0dab5b44c3cdafaf297199ffb8f246cd4d18.tar.gz
netsurf-2a0b0dab5b44c3cdafaf297199ffb8f246cd4d18.tar.bz2
Suppress issues with < 1x1 (i)frames for now in GTK frontend
svn path=/trunk/netsurf/; revision=10383
Diffstat (limited to 'gtk/gtk_window.c')
-rw-r--r--gtk/gtk_window.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c
index cf0991096..4c8ff6178 100644
--- a/gtk/gtk_window.c
+++ b/gtk/gtk_window.c
@@ -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 */
GtkWidget *w = GTK_WIDGET(g->scrolledwindow);
GtkLayout *f = g->bw->parent->window->layout;
+ int width = x1 - x0 + 2, height = y1 - y0 + 2;
assert(w);
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
* 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));
if (w->allocation.x != x0 || w->allocation.y != y0 ||
- w->allocation.width != x1 - x0 + 2 ||
- w->allocation.height != y1 - y0 + 2) {
+ w->allocation.width != width ||
+ w->allocation.height != height) {
LOG((" frame has moved/resized."));
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);
}
}