Currently with swt, I sometimes want a program to arbitrarily come to the foreground (like an alarm clock might).
Typically the following works (jruby):
@shell.setMinimized(false)
@shell.forceActive
This brings the shell to the front if it was minimized.
Creating a new shell at any time also brings the (new shell) to the front.
So far so good, however, if the shell is not minimized, the above code just flashes (blinks) the app's icon in the taskbar. Well actually the first time you run it, it brings it to the front. After that, it just blinks in the taskbar. That's windows. On Linux it appears to only blink in the taskbar (ubuntu default).
Does anybody know of a cross platform way of getting the app to come to the front, in swt?
It seems that no incantation of forceActive setActive setMinimized(false) setFocus forceFocus and setVisible can accomplish this thing.
I'm pretty sure it is possible (at least in windows), as the E Text Editor does it. Well, that's not swt, but at least some other apps have been known to do it.
I'm thinking maybe this is a swt bug one, two?
Many thanks.
Related:
http://stackoverflow.com/questions/309023/howto-bring-a-java-window-to-the-front
http://book.javanb.com/swt-the-standard-widget-toolkit/ch11lev1sec4.html
http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg35192.html
http://stackoverflow.com/questions/1576463/keep-window-in-foreground-even-if-it-loses-focus
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244597
http://stackoverflow.com/questions/204181/need-to-bring-application-to-foreground-on-windows