movetotop.diff
src/com/goldencode/p2j/ui/client/gui/driver/swing/SwingEmulatedWindow.java 2016-07-25 16:36:21 +0000 | ||
---|---|---|
121 | 121 |
import com.goldencode.p2j.ui.client.driver.swing.*; |
122 | 122 |
import com.goldencode.p2j.ui.client.gui.*; |
123 | 123 |
import com.goldencode.p2j.ui.client.gui.driver.*; |
124 |
import com.goldencode.util.*; |
|
124 | 125 | |
125 | 126 |
/** |
126 | 127 |
* The core GUI renderer. Because the painting results should be permanent a BufferedImage is |
... | ... | |
1036 | 1037 |
*/ |
1037 | 1038 |
void moveToTop(boolean focus) |
1038 | 1039 |
{ |
1040 |
System.out.println("SEW.focus() windowId=" + windowId); |
|
1041 |
LogHelper.dumpStackTrace(10); |
|
1039 | 1042 |
// execute the delay inside the Swing UI thread to make the move-to-top |
1040 | 1043 |
// requests serialized |
1041 | 1044 |
SwingUtilities.invokeLater(() -> |
... | ... | |
1048 | 1051 |
// The delay should be small enough not to introduce a visible UI lag but |
1049 | 1052 |
// long enough to give Swing/XServer(?) enough time to "stabilize" the state |
1050 | 1053 |
// of the window being shown. |
1051 |
activationExecutor.execute(() -> |
|
1052 |
{ |
|
1053 |
try |
|
1054 |
{ |
|
1055 |
Thread.sleep(ACTIVATION_DELAY); |
|
1056 |
} |
|
1057 |
catch (Exception e) |
|
1058 |
{ |
|
1059 |
// ignore |
|
1060 |
} |
|
1054 |
// activationExecutor.execute(() ->
|
|
1055 |
// {
|
|
1056 |
// try
|
|
1057 |
// {
|
|
1058 |
// Thread.sleep(ACTIVATION_DELAY);
|
|
1059 |
// }
|
|
1060 |
// catch (Exception e)
|
|
1061 |
// {
|
|
1062 |
// // ignore
|
|
1063 |
// }
|
|
1061 | 1064 |
|
1062 | 1065 |
window.setAlwaysOnTop(true); |
1063 | 1066 |
window.toFront(); |
... | ... | |
1068 | 1071 |
} |
1069 | 1072 |
|
1070 | 1073 |
window.setAlwaysOnTop(false); |
1071 |
}); |
|
1074 |
// });
|
|
1072 | 1075 |
}); |
1073 | 1076 |
} |
1074 | 1077 |
|