window_manager
window_manager copied to clipboard
[Linux] WindowManager.focus() does not focus the window. Ubuntu.
Tried to use together with: show() setAlwaysOnTop(true) waitUntilReadyToShow() Nothing helps, any ideas that could help?
I think I had the same problem. Initialized the application like stated in the window_manager docs, but the application does not stay in focus when applying windowManager.focus(). I created a window listener and overrided onWindowBlur():
@override
void onWindowBlur() {
setState(() async {
await windowManager.hide();
await windowManager.focus();
});
}
In combination with hide and focus the application stays in focus/foreground. This solution doesn't seem very professional, but at least fixed the issue for me.