Skip to content

Commit

Permalink
Explicitly activate shell for launchbar selector
Browse files Browse the repository at this point in the history
In eclipse-platform/eclipse.platform.swt#450
the behaviour was changed so that setFocus no longer activates the shell
by default. Therefore when creating the popup shell and setting the focus
the overall focus was still on a control in the main eclipse shell.

This affected Eclipse SWT/Platform 4.29 M1 and has been changed for
M3. However there is intention to (possibly) change the default back
to not activating in setFocus. If that happens this patch will be ready
for it, and in the meantime (until CDT changes to M3) it resolves this
test failure:

`createNewLaunchConfig (org.eclipse.launchbar.ui.tests.internal.CreateLaunchConfigTests) with error`

full trace:

```java
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find shell matching: with text 'Create Launch Configuration'
	at org.eclipse.launchbar.ui.tests.internal.CreateLaunchConfigTests.createNewLaunchConfig(CreateLaunchConfigTests.java:77)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 10000 ms.: Could not find shell matching: with text 'Create Launch Configuration'
	at org.eclipse.launchbar.ui.tests.internal.CreateLaunchConfigTests.createNewLaunchConfig(CreateLaunchConfigTests.java:77)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
```
  • Loading branch information
jonahgraham committed Aug 10, 2023
1 parent de012f4 commit 1e04efa
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ protected void openPopup() {
popup.setLocation(popupLocation.x, popupLocation.y + 5);
restoreShellSize();
popup.setVisible(true);
popup.setActive();
popup.setFocus();
getDisplay().addFilter(SWT.FocusIn, focusOutListener);
getDisplay().addFilter(SWT.FocusOut, focusOutListener);
Expand Down

0 comments on commit 1e04efa

Please sign in to comment.