Skip to content

Commit 8bcdc8b

Browse files
committed
Simulation Experiment view: close the interactive run popovers when the window loses focus.
1 parent 02713e9 commit 8bcdc8b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/renderer/src/components/views/SimulationExperimentView.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ vue.onMounted(() => {
792792
// Various things that need to be done once we are is mounted.
793793
794794
const crtInstance = vue.getCurrentInstance();
795+
const windowIsFocused = vueusecore.useWindowFocus();
795796
796797
vue.onMounted(() => {
797798
// Customise our IDs.
@@ -839,6 +840,21 @@ vue.onMounted(() => {
839840
840841
mutationObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['style'] });
841842
843+
// Close popovers when the window loses focus.
844+
845+
vue.watch(
846+
() => windowIsFocused.value,
847+
(isFocused) => {
848+
if (!isFocused) {
849+
interactiveLiveRunColorPopover.value?.hide();
850+
851+
if (interactiveRunColorPopoverIndex.value !== -1) {
852+
closeRunColorPopover(interactiveRunColorPopoverIndex.value);
853+
}
854+
}
855+
}
856+
);
857+
842858
// Disconnect our observers when unmounting.
843859
844860
vue.onUnmounted(() => {

0 commit comments

Comments
 (0)