Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] setVisible(true) from a worker thread

I know that it throws, and that it must be called from the UI thread
that instantiated the window, but i'm trying to understand why this
restriction exists. Doesn't this method send a message like WM_SHOWWINDOW
on Windows to the thread that created the window behind the scenes? Or
does it change the window state and the message loop is notified of
the change that has already been processed (is this synchronous or
asynchronous?), while the window state change is processed
synchronously on the calling thread?

Given that there is no restriction on which thread calls ShowWindow on
Windows, why does setVisible have to be called on the UI thread in SWT?

I'm just trying to understand the implementation a little better.

Thanks.



Back to the top