Zim

focus on windows doesn't always switch when you open a new window

Bug #283417 reported by Rui Nibau on 2008-10-14
2
Affects Status Importance Assigned to Milestone
Zim
Status tracked in Pyzim
Pyzim
Medium
Jaap Karssenberg

Bug Description

Zim version :
--------------------------------------------------

Zim :

# locale: fr_FR.UTF-8
# Loading translation from: /usr/local/bin/../share/zim/lingua/fr.pl
# This is zim 0.26
# Gtk2 version is 1.161
# compiled against gtk+ 2.12.0
# linked against gtk+ 2.12.9

OS : Ubuntu 8.04

Use case 1 :
---------------------------------------

- you're working with a notebook and need to take a look at another one.
- you go to the file menu and click "open another notebook..." (or type
CTRL+o)
- the "open notebook" dialog pops up. In fact, it **pops under** : the
main window (notebook) still have the focus and you have to manualy
switch to the dialog window.
- you select a notebook and click "open" : again, the new window pops
under and you have to manually switch to it.

Use case 2 :
-------------------------------------

- you have a notebook opened but reduced in the systray
- you're working in another application and need to pick up some info
from this notebook
- you click the Zim icon in the toolbar : the notebook window also pops
under the application window where you're working in.

Comments
----------------------------------------

- It doesn't always happen (7-8/10), but i'm not able to specify a clear actions sequence that reproduce the behaviour consistently.
- Don't know if the behaviour is due to zim or to gtk. This kind of "no-focus" on opening window also appears on gtk apps under Windows (like Geany).

Tags: gui Edit Tag help

What window manager are you using ?

I just realize that in both cases you describe the window that "pops-under" is not a dialog but the toplevel window of a different process (open notebook starts a new application instance). Do you use a window manager setting that prevents applications "stealing focus" or something like that ?

Rui Nibau (ruinibau) wrote :

> What window manager are you using ?

Default window manager on Ubuntu : metacity

> I just realize that in both cases you describe the window that "pops-under" is not a dialog but the toplevel window of a different process (open notebook starts a new application instance). Do you use a window manager setting that prevents applications "stealing focus" or something like that ?

Well, i never tweak the manager properties this way. I took a look at GConf Editor and didn't see any specific key related to focus, except a "focus_new_windows" which is set to "smart", the normal value.

description: updated

Further investigation is needed; will try to reproduce.

Changed in zim:
assignee: nobody → pardus-cpan
importance: Undecided → Medium
status: New → Incomplete

I now think this issue is caused be a design issue where all dialogs are transient for the parent window while in fact in some cases they should have another dialog as parent. This is only a hint for the WM, so different WM handle this differently. Will make sure the re-factored design sets the right parent window.

Changed in zim:
assignee: pardus-cpan → nobody
Rui Nibau (ruinibau) wrote :

It seems that you found a lead Jaap. Great.

Thanks.

Implemented in the python branch - Dialog base class better tracks parent window and makes sure to pop over it

Rui Nibau (ruinibau) wrote :

Hi Jaap, hi all.

I've checked out the last commit of pyzim branch. A quick run shows that there's no more "pop under" problem with dialog windows. Great.

Thanks.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers