mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-15 07:48:29 -04:00
Mouse actions are aborted if the window loses focus.
This commit is contained in:
parent
157bcd2636
commit
92863b76eb
@ -264,6 +264,15 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
|||||||
|
|
||||||
mouseNormal.activate();
|
mouseNormal.activate();
|
||||||
|
|
||||||
|
if (parent != null) {
|
||||||
|
parent.addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowDeactivated(WindowEvent e) {
|
||||||
|
activeMouseController.escapePressed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setToolTipText("");
|
setToolTipText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,12 +486,15 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
|||||||
* redo last undo
|
* redo last undo
|
||||||
*/
|
*/
|
||||||
private void redo() {
|
private void redo() {
|
||||||
if (!isLocked() && undoManager.redoAvailable()) {
|
if (activeMouseController != mouseNormal)
|
||||||
activeMouseController.escapePressed();
|
activeMouseController.escapePressed();
|
||||||
try {
|
else {
|
||||||
undoManager.redo();
|
if (!isLocked() && undoManager.redoAvailable()) {
|
||||||
} catch (ModifyException e) {
|
try {
|
||||||
throw new RuntimeException("internal error in redo", e);
|
undoManager.redo();
|
||||||
|
} catch (ModifyException e) {
|
||||||
|
throw new RuntimeException("internal error in redo", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user