Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 578929 - Control.setFocus brings windows to front
Change-Id: I8c7644e81e67995fb5259eb1cecf5c6862a33307
  • Loading branch information
Thomas Singer committed Aug 10, 2022
1 parent 02fb68c commit 8ffb9ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Expand Up @@ -1444,7 +1444,7 @@ public boolean forceFocus () {
if (display.focusEvent == SWT.FocusOut) return false;
Decorations shell = menuShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible () || !isActive ()) return false;
if (!isEnabled () || !isVisible () || !isActive () || display.getActiveShell() != getShell()) return false;
if (isFocusControl ()) return true;
shell.setSavedFocus (null);
NSView focusView = focusView ();
Expand Down
Expand Up @@ -2913,7 +2913,7 @@ public boolean forceFocus () {
if (display.focusEvent == SWT.FocusOut) return false;
Shell shell = getShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible ()) return false;
if (!isEnabled () || !isVisible () || display.getActiveShell() != getShell()) return false;
shell.bringToTop (false);
return forceFocus (focusHandle ());
}
Expand Down
Expand Up @@ -1603,6 +1603,7 @@ long gtk_focus_in_event (long widget, long event) {
display.activePending = false;
if (!ignoreFocusIn) {
sendEvent (SWT.Activate);
restoreFocus();
} else {
ignoreFocusIn = false;
}
Expand Down
Expand Up @@ -1072,7 +1072,7 @@ public boolean forceFocus () {
if (display.focusEvent == SWT.FocusOut) return false;
Decorations shell = menuShell ();
shell.setSavedFocus (this);
if (!isEnabled () || !isVisible () || !isActive ()) return false;
if (!isEnabled () || !isVisible () || !isActive () || display.getActiveShell() != getShell()) return false;
if (isFocusControl ()) return true;
shell.setSavedFocus (null);
/*
Expand Down

0 comments on commit 8ffb9ef

Please sign in to comment.