1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 20:15:22 +02:00

RESOLVED - bug 240098: [terminal] The cursor should not blink when the terminal is disconnected

https://bugs.eclipse.org/bugs/show_bug.cgi?id=240098

use async exec
This commit is contained in:
Michael Scharf 2008-12-04 19:37:11 +00:00
parent 2b3fd9cab7
commit 9aa73afcd1

View file

@ -953,7 +953,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
fState=state; fState=state;
fTerminalListener.setState(state); fTerminalListener.setState(state);
// enable the (blinking) cursor if the terminal is connected // enable the (blinking) cursor if the terminal is connected
runInDisplayThread(new Runnable() { runAsyncInDisplayThread(new Runnable() {
public void run() { public void run() {
if(fCtlText!=null && !fCtlText.isDisposed()) if(fCtlText!=null && !fCtlText.isDisposed())
fCtlText.setCursorEnabled(isConnected()); fCtlText.setCursorEnabled(isConnected());
@ -962,11 +962,11 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
/** /**
* @param runnable run in display thread * @param runnable run in display thread
*/ */
private void runInDisplayThread(Runnable runnable) { private void runAsyncInDisplayThread(Runnable runnable) {
if(Display.findDisplay(Thread.currentThread())!=null) if(Display.findDisplay(Thread.currentThread())!=null)
runnable.run(); runnable.run();
else if(PlatformUI.isWorkbenchRunning()) else if(PlatformUI.isWorkbenchRunning())
PlatformUI.getWorkbench().getDisplay().syncExec(runnable); PlatformUI.getWorkbench().getDisplay().asyncExec(runnable);
// else should not happen and we ignore it... // else should not happen and we ignore it...
} }