From 8d372ff663a9cb514126ccdfc14950f3e04daf00 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 29 Jan 2012 11:16:25 +0000 Subject: Cherry-pick upstream GDL patch 31886 (2011-08-08). Avoid a crash when the pane width is smaller than a button Fixed bugs: - https://launchpad.net/bugs/923241 (bzr r10923) --- src/libgdl/gdl-switcher.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c index fa52aa714..78ba1168d 100644 --- a/src/libgdl/gdl-switcher.c +++ b/src/libgdl/gdl-switcher.c @@ -301,6 +301,8 @@ layout_buttons (GdlSwitcher *switcher) /* Figure out how many rows and columns we'll use. */ btns_per_row = allocation.width / (max_btn_width + H_PADDING); + /* Use at least one column */ + if (btns_per_row == 0) btns_per_row = 1; /* If all the buttons could fit in the single row, have it so */ if (allocation.width >= optimal_layout_width) -- cgit v1.2.3