Bug 479394 - Zenity doesn't give a focus to a dialog that creates/there is no option to give a focus
Zenity doesn't give a focus to a dialog that creates/there is no option to gi...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: zenity (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Matthias Clasen
Fedora Extras Quality Assurance
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-09 04:41 EST by Sasa Babic
Modified: 2013-02-09 20:44 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-28 07:04:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sasa Babic 2009-01-09 04:41:25 EST
Description of problem:
Some types of dialogs created by zenity do not take a focus, like list dialog. 

Version-Release number of selected component (if applicable):
zenity-2.24.0-2.fc10.i386

How reproducible:
zenity --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges

Steps to Reproduce:
1.open gnome-terminal
2.zenity --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges
3.
  
Actual results:
List dialog is minimized, gnome-terminal still has a focus.

Expected results:
List dialog takes a focus.

Additional info:
Comment 1 Ian Mortimer 2009-01-11 18:25:08 EST
This is changed from previous releases where interactive zenity windows grabbed the focus (e.g. 2.22.1 on F9).  Here's a similar bug report against ubuntu intrepid:

https://bugs.launchpad.net/zenity/+bug/272083

with a link to a patch for zenity glade:

http://launchpadlibrarian.net/18653141/zenity-2.24.0-focus.patch
Comment 2 Matthias Clasen 2009-01-16 18:39:41 EST
I can't reproduce this problem here.
Which window manager are you using ?
Comment 3 Ian Mortimer 2009-01-18 17:30:06 EST
I'm using gnome.  With the default /usr/share/zenity/zenity.glade shipped with Fedora 10 (zenity-2.24.0-2.fc10.x86_64) if I run this command the window opens behind other windows (making it useless for my purposes):

zenity --info --text="Testing" &

After applying the patch linked in comment #1, the window pops up in the foreground.  The patch just sets the focus_on_map property to True for all widgets in /usr/share/zenity/zenity.glade.  In Fedora 9 (zenity-2.22.1-1.fc9.x86_64) True was the default for focus_on_map for all widgets.


--
Ian
Comment 4 Matthias Clasen 2009-01-18 18:06:05 EST
You didn't say which window manager you are using. Assuming it is metacity, I still cannot reproduce. 
Where are you running that command, in a fullscreen terminal ?
Comment 5 Matthias Clasen 2009-01-18 18:07:04 EST
And yes, the zenity window is not focused, but it does get raised over other windows in my testing.
Comment 6 Ian Mortimer 2009-01-18 19:00:04 EST
Yes - metacity.  In normal use, zenity commands would be launched by a script running in the background with no terminal.  However in testing it makes no difference what size terminal: the zenity window opens behind the active window 
(The zenity popup sometimes partly shows from behind the terminal window but not reliably.)

This is obviously a result of the change in /usr/share/zenity/zenity.glade between 2.22 (F9) and 2.24 (F10).  That was an upstream change apparently but it changes the behaviour of scripts that worked reliably in F9 but now frequently pop up a hidden window which is useless for alerts.

It's easily changed by patching zenity.glade but that won't be preserved through upgrades to zenity since it's not a config file - maybe it should be.

By the way:  I normally have "Select windows when the mouse moves over them" set but it made no difference to the test whether that was on or off.


Thanks
---
Ian
Comment 7 Matthias Clasen 2009-01-18 19:19:46 EST
Note that metacity treats terminal windows specially, so yes, it may well make a difference.
Comment 8 Ian Mortimer 2009-01-18 19:58:55 EST
Yes.  I just ran another test and the zenity window does open behind terminal windows only - not behind firefox, evolution or other gui windows.  The problem for me is I often have many terminal windows open.  

Having zenity popup windows not grab focus is good and I would prefer that behaviour except having them pop up hidden behind terminal windows is worse for my purpose.

Since there's an easy workaround, I'd say this isn't worth pursuing.  More command line control of zenity window behaviour would be good (but that's a feature request for upstream).
Comment 9 Sasa Babic 2009-01-20 03:46:46 EST
Yes, it is metacity window manager that I use. 

I don't run the command from the fullscreen, behaviour is the same for maximized as well as not maximized gnome-terminal.
Comment 10 Han Pingtian 2009-06-10 02:44:56 EDT
Why not a bug? I think this is a bug. The zenity dailog should get focus when it run.
Comment 11 Ian Mortimer 2009-06-10 18:45:00 EDT
If you want zenity windows to always get focus, you can change the defaults in /usr/share/zenity/zenity.glade for focus_on_map from false to true.  (Unfortunately however any changes you make there will be lost on upgrades.)

The problem I reported is not really a bug in zenity, it's a feature of metacity that it gives priority to gnome-terminal windows.
Comment 13 Gilboa Davara 2009-10-26 16:50:38 EDT
Any chance of getting the default glade configuration changed?
It seem kinda weird - especially given the fact that zenity is supposed to be executed from a terminal...

- Gilboa
Comment 14 Ian Mortimer 2009-10-27 21:04:45 EDT
There are a few ways of working around this:

Restore the previous zenity defaults:
sed -i '/<property name="focus_on_map">False</s/False/True/' /usr/share/zenity/zenity.glade

Use a different window manager.  The problem of zenity windows hidden by terminal windows only happens with metacity because it gives priority to terminal windows.

Patch zenity to make focus_on_map configurable from the command line.
Comment 15 Bug Zapper 2009-11-18 05:42:32 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 16 Bug Zapper 2009-12-18 02:33:23 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 17 Gilboa Davara 2009-12-18 02:59:59 EST
Same problem in F11.
Comment 18 Bug Zapper 2010-04-27 08:42:11 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 19 Gilboa Davara 2010-04-28 15:35:13 EDT
Seems to be OK in F12. Please close.

Thanks.
Gilboa
Comment 20 Bug Zapper 2010-06-28 07:04:59 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.