Bug 907014 - virt-manager doesn't correctly restore its position
Summary: virt-manager doesn't correctly restore its position
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: xfwm4
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-02 16:57 UTC by Corinna Vinschen
Modified: 2015-02-18 13:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-18 13:49:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Corinna Vinschen 2013-02-02 16:57:45 UTC
Description of problem:

  This is kind of related to an older bug report #605842, but the effect
  is different these days.  I'm running XFCE4 under F18 and F17.  Either
  way, when minimizing virt-manager into the systray, after restoring
  it, it does not stick to its former position.  In fact, with each restore
  operation it slowly "wanders" up and left from it's former position. 

Version-Release number of selected component (if applicable):

  0.9.4-4.fc18
  0.9.4-3.fc17

Steps to Reproduce:

  I don't know if this only occurs under XFCE4, but let's assume so:

  1. Start XFCE4 desktop environment.
  2. Run virt-manager.
  3. Open "Preferences" and "enable system tray icon".
  4. Move virt-manager window to lower right corner of the workspace.
  5. Minimize into tray and maximize again.
  6. Observe how the position changes every time repeating step 5.

  Here's the output of `xwininfo | grep geometry', doing step 5 three times
  in a row:

  -geometry 550x828-3-30
  -geometry 550x828-6-53
  -geometry 550x828-9-76
 
Actual results:

  Window moves up and left after restoring from systray.

Expected results:

  Windows is restored at the exact position as it was before minimizing it
  into the systray.


Thanks in advance,
Corinna

Comment 1 Cole Robinson 2013-05-15 19:23:11 UTC
Sorry for lack of response. This is indeed a bug and should be easy enough to fix

Comment 2 Corinna Vinschen 2013-06-06 08:27:13 UTC
Hi Cole,

thanks for your reply.  The problem is still present in the current
virt-manager-0.9.5-1 packages in F17 and F18.  Do you have any update
on this?


Thanks,
Corinna

Comment 3 Cole Robinson 2013-06-13 19:38:56 UTC
So this bug is specific to XFCE, I can't reproduce on F19 gnome shell or kde. With some debugging inserted, this is what's happening with three hide/show cycles:

closing, saving position as (889, 284)
loading previous position of (889, 284)
idle cb: topwin is now at (890, 297)

closing, saving position as (888, 262)
loading previous position of (888, 262)
idle cb: topwin is now at (887, 240)

closing, saving position as (887, 240)
loading previous position of (887, 240)
idle cb: topwin is now at (888, 253)

We are saving the previous position correctly, but the window manager isn't abiding the request. This is using gtk_window_get_position and gtk_window_move. virt-manager code is show() and close() here:

https://git.fedorahosted.org/cgit/virt-manager.git/tree/virtManager/manager.py#n197

Reassigning to xfce window manager

Comment 4 Kevin Fenzi 2013-06-13 20:07:37 UTC
If you go to settings->window manager tweaks -> placement

what do you have set for min size of windows to trigger smart placement? 
If you adjust this does the problem go away? 

Does the problem happen on a desktop with no other windows on it?

Comment 5 Corinna Vinschen 2013-06-14 08:12:39 UTC
Hi Kevin,

the effect is independent of the "smart placement" setting.  I tried
all settings from min to max with no changes in the behaviour.

I also tested this with no other Window on the desktop and the behaviour
stays the same, also independently from the "smart placement" setting,
under XFCE 4.8 as well as 4.10.

The effect is also independent of the position of the panel.  I moved it
to from the display bottom to the top, but virt-manager still changes its
position the same way on each unhiding from the tray.


Corinna

Comment 6 Kevin Fenzi 2013-06-14 21:49:04 UTC
Is the application maximized or shaded?

Comment 7 Corinna Vinschen 2013-06-14 21:54:59 UTC
Hi Kevin,

neither maximized nor shaded.


Corinna

Comment 8 Kevin Fenzi 2013-06-14 21:55:55 UTC
ok. Would you be willing to file this upstream at bugzilla.xfce.org or would you prefer I do so?

Comment 9 Corinna Vinschen 2013-06-17 07:55:46 UTC
Hi Kevin,

I'd prefer if you could file this upstream.  Your input as distro maintainer
will have more weight than mine.


Thanks,
Corinna

Comment 10 Corinna Vinschen 2013-06-17 08:39:13 UTC
Oh, btw.

Are you really sure this is a bug in xfce and not in virt-manager?

I'm asking because I have other applications minimized to the
tray, namely xchat and twinkle, and both are restored from the tray
to the correct former display position.  Only virt-manager shows this
weird behaviour.


Corinna

Comment 11 Cole Robinson 2013-06-17 15:25:22 UTC
(In reply to Corinna Vinschen from comment #10)
> Oh, btw.
> 
> Are you really sure this is a bug in xfce and not in virt-manager?
> 

I don't think anyone is sure, but as I detailed above virt-manager really isn't doing anything complex here.

I just tried to generate a simple reproducer but it seems to work fine on XFCE:

from gi.repository import Gtk

def delete_cb(*args, **kwargs):
    Gtk.main_quit()

window = Gtk.Window()
window.connect("delete-event", delete_cb)
window.show_all()
lastpos = None

def toggle_window(*args, **kwargs):
    if window.is_visible():
        global lastpos
        lastpos = window.get_position()
        window.hide()
    else:
        window.show()
        window.move(*lastpos)

systray = Gtk.StatusIcon()
systray.set_visible(True)
systray.set_property("icon-name", "gtk-cdrom")
systray.connect("activate", toggle_window)

Gtk.main()


Maybe the xfwm devs can poke at it and provide more insight. I'm sure it will be easier for them to isolate it to xfwm, gtk, virt-manager, or something inbetween.

Comment 12 poma 2014-07-29 23:09:42 UTC
This problem can be associated not only with the 'xfwm4' but also with the 'xfce4-panel', particularly with the 'libsystray.so'.
And or perhaps with the 'virt-manager' and or 'gtk3'. :)
Also this is still present in Fedora 20, Fedora 21 and Fedora Rawhide i.e. Fedora 22.
Even with my local builds, 
- xfwm4-4.11.1-1.fc21.x86_64
- xfce4-panel-4.11.0-1.fc21.x86_64
  /usr/lib64/xfce4/panel/plugins/libsystray.so

To see it is specifically related to the "systray" - notification area where notification icons appear:
- start the "Virtual Machine Manager" i.e. 'virt-manager'
- choose Edit -> Preferences -> tab General -> General -> uncheck "Enable system tray icon"
- try several times with "Minimize" & "Unminimize".
Application window should appear in the same position. :)

Switch version at least to 21!

Comment 13 Fedora End Of Life 2015-01-09 22:03:46 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 14 Fedora End Of Life 2015-02-18 13:49:39 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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.