Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cannot set Shell to full screen on Linux(Problem with Shell's setFullScreen(boolean fullScreen) method on Linux)
Cannot set Shell to full screen on Linux [message #827353] Fri, 23 March 2012 04:01 Go to next message
Albert Pikus is currently offline 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

Re: Cannot set Shell to full screen on Linux [message #829419 is a reply to message #827353] Mon, 26 March 2012 04:58 Go to previous messageGo to next message
Arun Thondapu is currently offline Arun Thondapu
Messages: 11
Registered: April 2011
Junior Member
I am able to reproduce the behavior on Ubuntu 11.04 with the latest SWT and GTK 2.x versions.
Please file a bug.

Thanks,
Arun
Re: Cannot set Shell to full screen on Linux [message #830116 is a reply to message #829419] Tue, 27 March 2012 04:00 Go to previous message
Albert Pikus is currently offline Albert Pikus
Messages: 70
Registered: October 2009
Member
Hi,

thank you for your reply, I reported a bug today: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375385


Best regards,

Albert
Previous Topic:Browser IE not open link in a tab
Next Topic:Java SWT Image and Transparency
Goto Forum:
  


Current Time: Tue Jul 22 11:39:18 EDT 2014

Powered by FUDForum. Page generated in 0.02406 seconds