Skip to content

Commit

Permalink
CSSTUDIO-2070 Prevent tool-tips from being displayed using an event-f…
Browse files Browse the repository at this point in the history
…ilter.
  • Loading branch information
abrahamwolk committed Nov 14, 2023
1 parent 3768f68 commit 43ed72e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/ui/src/main/java/org/phoebus/ui/docking/DockStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 43ed72e

Please sign in to comment.