diff --git a/core/ui/src/main/java/org/phoebus/ui/docking/DockStage.java b/core/ui/src/main/java/org/phoebus/ui/docking/DockStage.java index d3b6da046f..5aa70fb99e 100644 --- a/core/ui/src/main/java/org/phoebus/ui/docking/DockStage.java +++ b/core/ui/src/main/java/org/phoebus/ui/docking/DockStage.java @@ -22,6 +22,7 @@ import java.util.logging.Level; import java.util.stream.Collectors; +import javafx.scene.input.MouseEvent; import org.phoebus.framework.jobs.JobManager; import org.phoebus.framework.workbench.Locations; import org.phoebus.ui.application.Messages; @@ -131,6 +132,15 @@ public static DockPane configureStage(final Stage stage, final DockItem... tabs) */ public static DockPane configureStage(final Stage stage, final Geometry geometry, final DockItem... tabs) { + stage.addEventFilter(MouseEvent.MOUSE_MOVED, mouseEvent -> { + // Filtering MOUSE_MOVED events from unfocused windows prevents tooltips + // from displaying in unfocused windows. This, in turn, prevents unfocused + // windows from receiving the focus as a consequence on Windows and Mac OS. + if (!stage.focusedProperty().get()) { + mouseEvent.consume(); + } + }); + stage.getProperties().put(KEY_ID, createID("DockStage")); final DockPane pane = new DockPane(tabs);