Skip to content

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

Closed as not planned

Description

@diasnrg

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

Activity

  1. phil3pi commented on Sep 28, 2022

    @phil3pi

    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.

  2. lijy91 commented on Sep 21, 2026

    @lijy91
    Member

    window_manager 0.5.x is no longer maintained: from 0.6.0 window_manager is rebuilt on nativeapi (Flutter package: nativeapi), and its platform code moves there.

    nativeapi doesn't handle this yet either, so it's now tracked in libnativeapi/nativeapi#69. Please follow it and add details there; once it's fixed there, it reaches window_manager through nativeapi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions