Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 63481 - Clipboard getAvailableTypes runs the event loop on Motif
Summary: Clipboard getAvailableTypes runs the event loop on Motif
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-Motif
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-21 15:28 EDT by Billy Biggs CLA
Modified: 2004-11-22 18:05 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Billy Biggs CLA 2004-05-21 15:28:50 EDT
Here is a small program which creates a window with a button and then spins
forever asking for the available types.  When run, you can still click on the
button, even though we never run the event loop.  Regarding bug 44915, it seems
that implementing a synchronous clipboard retrieval under X is challenging.


import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.dnd.*;

public class main {
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);

        shell.setText("Event loopy?");
        shell.setLayout(new FillLayout());
        
        Button b = new Button(shell, SWT.PUSH);
        b.setText("yum yum");
        Clipboard c = new Clipboard(display);

        shell.open();
        
        int foo = 1;
        while(foo > 0) {
            c.getAvailableTypes();
            System.out.println("i eat cheese");
            try {
                Thread.sleep(500);
            } catch( Exception e) {
            }
        }
        
        while( !shell.isDisposed() ) {
                if( !display.readAndDispatch()) display.sleep();
        }

        display.dispose();
    }
}
Comment 1 Veronika Irvine CLA 2004-11-22 18:05:12 EST
Not any more.  New implementation of Clipboard has our own control over event 
loop.