+ gint slider_width;
+ int oldtop, oldleft, oldbottom;
+ GtkRequisition req;
+
+ /* Get old values. */
+ xg_find_top_left_in_fixed (wscroll, wfixed, &oldleft, &oldtop);
+ gtk_widget_size_request (wscroll, &req);
+ oldbottom = oldtop + req.height;
+
+ /* Scroll bars in GTK has a fixed width, so if we say width 16, it
+ will only be its fixed width (14 is default) anyway, the rest is
+ blank. We are drawing the mode line across scroll bars when
+ the frame is split:
+ |bar| |fringe|
+ ----------------
+ mode line
+ ----------------
+ |bar| |fringe|
+
+ When we "unsplit" the frame:
+
+ |bar| |fringe|
+ -| |-| |
+ m¦ |i| |
+ -| |-| |
+ | | | |
+
+
+ the remains of the mode line can be seen in these blank spaces.
+ So we must clear them explicitly.
+ GTK scroll bars should do that, but they don't.
+ Also, the scroll bar canonical width may be wider than the width
+ passed in here. */
+
+ if (oldtop != -1 && oldleft != -1)
+ {
+ int gtkextra;
+ int xl, xr, wblank;
+ int bottomdiff, topdiff;
+
+ gtk_widget_style_get (wscroll, "slider_width", &slider_width, NULL);
+ gtkextra = width > slider_width ? (width - slider_width) / 2 : 0;
+
+ xl = left - winextra;
+ wblank = gtkextra + winextra;
+ xr = left + gtkextra + slider_width;
+ bottomdiff = abs (oldbottom - bottom);
+ topdiff = abs (oldtop - top);
+
+ if (oldtop > top)
+ {
+ gdk_window_clear_area (wfixed->window, xl, top, wblank, topdiff);
+ gdk_window_clear_area (wfixed->window, xr, top, wblank, topdiff);
+ }
+ else if (oldtop < top)
+ {
+ gdk_window_clear_area (wfixed->window, xl, oldtop, wblank,
+ topdiff);
+ gdk_window_clear_area (wfixed->window, xr, oldtop, wblank,
+ topdiff);
+ }