Cannot set Shell to full screen on Linux [message #827353] |
Fri, 23 March 2012 08:01 |
Albert Pikus Messages: 70 Registered: October 2009 |
Member |
|
|
Hi,
I have a problem with setting Shell to full screen mode on Linux. Please consider the following snippet:
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class FullScreenShell
{
public static void main(String[] args)
{
Display display = new Display();
Shell parentShell = new Shell(display);
parentShell.setText("Parent shell");
parentShell.setSize(400, 300);
final Shell childShell = new Shell(parentShell, SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CLOSE);
childShell.setSize(300, 200);
childShell.setText("Child shell");
childShell.addMouseListener(new MouseListener()
{
@Override
public void mouseUp(MouseEvent event)
{
}
@Override
public void mouseDown(MouseEvent event)
{
}
@Override
public void mouseDoubleClick(MouseEvent event)
{
// Toggle full screen mode: works on Mac and Windows, won't work on Linux
System.out.println("Full screen: " + childShell.getFullScreen());
childShell.setFullScreen(! childShell.getFullScreen());
System.out.println("Full screen: " + childShell.getFullScreen());
}
});
parentShell.open();
childShell.open();
while (! parentShell.isDisposed())
{
if (! display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
}
When this code is run on Mac or Windows, it correctly toggles full screen mode of child shell by double clicking on it. But when running on Linux (I tried this on Fedora 12 and Ubuntu 10.04), nothing happens when double clicking inside child shell. The confusing part is that Shell's getFullScreen() method returns true/false after double click, as if Shell would actually toggle full screen mode, although visually this is not the case. I tested this snippet using SWT 3.6.5 and SWT 3.7.2.
Am I seeing a bug here? Any suggestions would be greatly appreciated.
Best regards,
Albert
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02780 seconds