Bug 566335 - [GTK] Cannot transfer focus back to original Shell after opening a new Shell with SWT.ON_TOP
Summary: [GTK] Cannot transfer focus back to original Shell after opening a new Shell ...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-24 14:45 EDT by Benjamin Moser CLA
Modified: 2020-08-25 10:17 EDT (History)
2 users (show)

See Also:


Attachments
Minimal working example that illustrates the problem. (2.55 KB, application/octet-stream)
2020-08-24 14:45 EDT, Benjamin Moser CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Moser CLA 2020-08-24 14:45:13 EDT
Created attachment 283957 [details]
Minimal working example that illustrates the problem.

The basic motivation is to have an always-on-top toolbar that appears but does not take focus. Since seemingly, one cannot create a Shell without it receiving focus, one would like to manually transfer focus back to the main (original) Shell.

Steps to reproduce (please also consider the attached example):

1) In some Shell, open() another Shell with the SWT.ON_TOP flag.
2) In some callback that should trigger after the new Shell was openened, call setFocus on an element in the original Shell.

Actual results: The focus is not given back to the original Shell.

Expected results: The focus should be given to the element in the original shell that .setFocus() was called on.

This seems to be specific to GTK and the current version of SWT:

* Works on Linux/GTK and SWT 4.7.3
* Does not work with Linux/GTK and SWT 4.16
* Works on Win10 and SWT 4.7.3
* Works on Win10 and SWT 4.16

A potential workaround for Linux/GTK is using only the SWT.TOOL flag since that seems to provide always-on-top behaviour -- but not on Windows.
Comment 1 Andrey Loskutov CLA 2020-08-24 15:06:29 EDT
Could you please try also with 4.17 M3?
Comment 2 Benjamin Moser CLA 2020-08-25 03:44:19 EDT
(In reply to Andrey Loskutov from comment #1)
> Could you please try also with 4.17 M3?

Also does not work with 4.17M3.
Comment 3 Andrey Loskutov CLA 2020-08-25 03:55:30 EDT
(In reply to Benjamin Moser from comment #2)
> Also does not work with 4.17M3.

Thanks for confirmation. Note: the version field in bugzilla is for the fist version the bug appeared on, not for the last.