On GTK+, the thumb fits entire width/height of a scroll bar when visible (see BasicScrollBarUI.layoutVScrollbar()). The fix detects such situations and resets thumb size, thus hiding the thumb when not needed.
*/
@Override
protected void setThumbBounds(int x, int y, int width, int height) {
+ if (width > 0 && height > 0 && UIManager.getBoolean("ScrollBar.alwaysShowThumb") && !alwaysShowTrack()) {
+ int w = scrollbar.getWidth(), h = scrollbar.getHeight();
+ if (w > h && w == width || w < h && h == height) {
+ x = y = width = height = 0;
+ }
+ }
+
if (myRepaintCallback == null) {
super.setThumbBounds(x, y, width, height);
}