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

zim --plugin quicknote sometimes opens its window in the background #124

Closed
rhertzog opened this issue Jun 16, 2017 · 11 comments
Closed

zim --plugin quicknote sometimes opens its window in the background #124

rhertzog opened this issue Jun 16, 2017 · 11 comments
Assignees

Comments

@rhertzog
Copy link
Collaborator

This is another regression of 0.67~rc2 compared to 0.65 for me. Again I run the command from a script in my mailer, and the newly opened window will often show up behind the terminal in which my mailer is running. With the previous version, it was always on top of it.

@jaap-karssenberg jaap-karssenberg self-assigned this Jun 16, 2017
@jaap-karssenberg
Copy link
Member

Will look into this one - probably need to ensure window.present() is called in all cases.

@jaap-karssenberg
Copy link
Member

Could it be that it pops behind the terminal if it is a new window and in front when it was an existing window?

@rhertzog
Copy link
Collaborator Author

What do you mean with new window? I always have a running zim instance. And it seems to always open the window in the background for me. I have a (GNOME) desktop-level keyboard shortcut to run the quicknote plugin... and it opens always behind the window which has the focus. Sometimes it's placed nearside and doesn't overlap, so I see the quicknote window. When the current window takes the full screen, then I don't see the quicknote window at all.

@jaap-karssenberg
Copy link
Member

What I mean is that the zim process already had a window for the specific notebook, "present" is called and the window should pop to the front. However if the specific notebook is not open yet or has been closed again, a new window is created and in this case it might not pop to the front.

But if you also observe the pop-under for windows that are already open, I don't have a hypothesis what causes it.

@jaap-karssenberg
Copy link
Member

@rhertzog Wait a second you mean that the quicknote dialog itself pops in the background? I interpreted that the main window after creating a new not appeared in the background, but reading your comment again I guess you mean the dialog itself, correct ?

@rhertzog
Copy link
Collaborator Author

@jaap-karssenberg I mean the dialog itself, that's right. I don't care about zim's main window. This one is always open in full screen in its own desktop in my case.

@jaap-karssenberg
Copy link
Member

Just tested with gnome keyboard shortcut under gnome3 (ubuntu-gnome) and for me the dialog shows correctly in front of any window that is open.

@jaap-karssenberg
Copy link
Member

Correction: it shows in front if no process was running yet, but if the window is shown from an already running process it indeed pop under the current window.

@jaap-karssenberg
Copy link
Member

Ensured that each window that is shown receives present() but it still pops-under. Not sure what else I can do to convince Gnome that it should bring this window to the front.

@rhertzog
Copy link
Collaborator Author

rhertzog commented Jun 27, 2017

I just double checked and downgrading to 0.65 fixes the problem. I also asked on #gnome-hackers on irc.gimp.net and got those comments that might help you:
14:43 <federico> buxy: right before https://github.com/jaap-karssenberg/zim-desktop-wiki/blob/master/zim/plugins/quicknote.py#L202 could you ensure that the passed window is not None?
14:43 <federico> buxy: also, I don't see https://github.com/jaap-karssenberg/zim-desktop-wiki/blob/master/zim/plugins/quicknote.py#L423 calling the parent class BoundQuickNoteDialog.init() - is this intended?

@jaap-karssenberg
Copy link
Member

@rhertzog it is purely due to which process spawns the window - Gnome does not allow already running processes capture the focus with a new window. So need to make sure the plugin dialog runs before calling the primary application process.

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

2 participants