Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow focus on window when file opened #601

Open
ghost opened this issue Nov 17, 2022 · 1 comment
Open

Allow focus on window when file opened #601

ghost opened this issue Nov 17, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 17, 2022

In most applications where opening a file creates a new tab in an existing window (e.g. Chrome, Firefox) the window is brought to focus. Using retext 8.0.0 with Linux Mint 21 Cinnamon, when Retext is already open in a window that does not have focus, opening a Markdown file results in its being opened in a new tab in the Retext window, and the Retext icon in the desktop panel is highlighted, but the window is not brought to focus.

I would request that there be an item in the preferences dialog allowing the user to specify the Retext window should be brought to focus whenever a file is opened.

@mitya57
Copy link
Member

mitya57 commented Dec 18, 2022

We do have this line, which is supposed to raise the window to the top of the window manager's stack.

qWidgetIface.call('raise')

However, for some reason this does not happen. Maybe the window manager protects you from the aggressive windows and only highlights them, instead of actually raising.

I tried other Qt's methods such as activateWindow() and setWindowState() but none of them or their combinations has the needed effect with my window manger (Metacity). I also read about some hacks such as marking the window as top-level (and unmarking again), or showing and hiding a message box, but such methods look too ugly for me.

Advices how to better implement it are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant