From e199c3a38e21db763c429cc79e4a47f3dfdcc2a5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 7 Oct 2014 18:53:50 +0200 Subject: [PATCH] Fix clipping of board GTK ResizeBoardWindow now measures the with of the window dressing by brute force, interrogating GTK both for the width of the top-level window and the board widget, and subtracting the two. --- gtk/xboard.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index 78fa0f6..b1f7103 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -639,7 +639,12 @@ void ResizeBoardWindow (int w, int h, int inhibit) { GtkAllocation a; + int bw; // if(clockKludge) return; // ignore as long as clock does not have final height + gtk_widget_get_allocation(optList[W_BOARD].handle, &a); + bw = a.width; + gtk_widget_get_allocation(shellWidget, &a); + marginW = a.width - bw; gtk_widget_get_allocation(optList[W_WHITE].handle, &a); w += marginW + 1; // [HGM] not sure why the +1 is (sometimes) needed... h += marginH + a.height + 1; @@ -1179,7 +1184,7 @@ main (int argc, char **argv) gtk_widget_get_allocation(optList[W_WHITE].handle, &a); clockKludge = hc = a.height; gtk_widget_get_allocation(boardWidget, &a); - marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board +// marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board marginH = h - a.height - hc; // subtract current clock height, so it can be added back dynamically } -- 1.7.0.4