window_manager icon indicating copy to clipboard operation
window_manager copied to clipboard

[Linux] WindowManager.focus() does not focus the window. Ubuntu.

Open diasnrg opened this issue 1 year ago • 1 comments

Tried to use together with: show() setAlwaysOnTop(true) waitUntilReadyToShow() Nothing helps, any ideas that could help?

diasnrg avatar Sep 12 '22 10:09 diasnrg

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.

phil3pi avatar Sep 28 '22 11:09 phil3pi