Bug 368929 - SWT Slider widget does not appear in Ubuntu with Overlay Scrollbars enabled
Summary: SWT Slider widget does not appear in Ubuntu with Overlay Scrollbars enabled
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
: 399564 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-18 05:19 EST by Paul Gibbons CLA
Modified: 2015-08-10 13:31 EDT (History)
9 users (show)

See Also:


Attachments
Screenshot of snippet window (7.97 KB, image/png)
2013-01-23 08:32 EST, Elfi Heck CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Gibbons CLA 2012-01-18 05:19:27 EST
Build Identifier:  20110916-0149

The Slider  widget in the example program for SWt Slider( copied below) is not visible in Ubuntu 11.10 with Overlay Scrollbars enabled.

A workaround is to disable the Overlay Scrollbars by following the steps in http://www.webupd8.org/2011/04/how-to-disable-overlay-scrollbars-in.html :

sudo su
echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars

SWT Slider Example code copied from http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTSliders.htm


/*
 * Created on Nov 17, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Slider;
import org.eclipse.swt.widgets.Text;

/**
 * @author Steven Holzner
 * 
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */

public class SWTSliders {

  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display, SWT.RESIZE);
    shell.setText("Sliders");
    shell.setSize(300, 200);

    final Label label = new Label(shell, SWT.NONE);
    label.setText("Move the slider");
    label.setBounds(0, 20, 150, 15);

    final Slider slider = new Slider(shell, SWT.HORIZONTAL);
    slider.setBounds(0, 40, 200, 20);

    final Text text = new Text(shell, SWT.BORDER);
    text.setBounds(0, 100, 200, 25);

    slider.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String outString = "Event: SWT.NONE";
        switch (event.detail) {
        case SWT.ARROW_DOWN:
          outString = "Event: SWT.ARROW_DOWN";
          break;
        case SWT.ARROW_UP:
          outString = "Event: SWT.ARROW_UP";
          break;
        case SWT.DRAG:
          outString = "Event: SWT.DRAG";
          break;
        case SWT.END:
          outString = "Event: SWT.END";
          break;
        case SWT.HOME:
          outString = "Event: SWT.HOME";
          break;
        case SWT.PAGE_DOWN:
          outString = "Event: SWT.PAGE_DOWN";
          break;
        case SWT.PAGE_UP:
          outString = "Event: SWT.PAGE_UP";
          break;
        }
        outString += " Position: " + slider.getSelection();
        text.setText(outString);
      }
    });

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    display.dispose();
  }
}



Reproducible: Always

Steps to Reproduce:
1.Run the SWt Slider program listed at http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTSliders.htm on Ubuntu 11.10 with Overlay Scrollbars enabled (default)
2. Slider is not visible
3.
Comment 1 Felipe Heidrich CLA 2012-01-30 12:44:37 EST
Arun, please try this.
Comment 2 Arun Thondapu CLA 2012-01-31 04:56:41 EST
I tested the example with Eclipse 3.8 M3 build I20110912-2126 and 4.2 M5 build I20120127-1145 on Ubuntu 11.04 which has overlay scrollbars enabled and it worked as expected for me.

Are you using Unity or GNOME desktop on Ubuntu 11.10? Can you check whether the behavior differs between the two?
Comment 3 Paul Gibbons CLA 2012-02-01 09:28:11 EST
I am using Gnome 3 shell rather than Unity
Comment 4 Elfi Heck CLA 2013-01-23 08:32:46 EST
Created attachment 225979 [details]
Screenshot of snippet window

Attaching screenshot of how the window looks on my system. This is Ubuntu 12.04 with Unity on a standard VMware guest. Instead of sliders I get two large empty areas. (Setting LIBOVERLAY_SCROLLBAR=0 helps on this system)
Comment 5 Arun Thondapu CLA 2013-01-31 06:26:53 EST
*** Bug 399564 has been marked as a duplicate of this bug. ***
Comment 6 Carolyn MacLeod CLA 2013-04-30 15:15:53 EDT
Confirmed on Ubuntu 12.04 with latest SWT and SWT's Snippet17.
Perhaps we should reconsided using GtkScrollbar for a slider?
Does this work better in GTK3? Is there an alternative control that might be a more natural choice in GTK3?
Comment 7 Marc-André Laperle CLA 2013-06-07 17:56:00 EDT
I have a proposed patch for a bug with overlay scrollbars in TMF (bug 384763) and it looks like it fixes this bug too:

https://bugs.launchpad.net/bugs/1188831
Comment 8 Marc-André Laperle CLA 2015-08-10 13:31:04 EDT
Ubuntu is moving away from their own overlay scrollbars and Eclipse disables them by default nice Eclipse 4.4. Additionally, the right fix would be done on the Ubuntu side, see https://bugs.launchpad.net/bugs/1188831.