[Date Prev][Date Next] [Thread Prev][Thread Next]
Re: [virt-tools-list] [PATCHWORK] [virt-manager] fullscreen behaviour
- From: Cole Robinson <crobinso redhat com>
- To: Jon Nordby <jononor gmail com>
- Cc: virt-tools-list redhat com
- Subject: Re: [virt-tools-list] [PATCHWORK] [virt-manager] fullscreen behaviour
- Date: Thu, 12 Nov 2009 11:59:59 -0500
On 11/11/2009 09:04 PM, Jon Nordby wrote:
> Here is something showing the behaviour I had in mind. Basically the regular
> menubar is tossed into its own window in fullscreen mode.
> It is minimized by default, but will pop up on hovering over it. There are
> some known unsolved issues that I want feedback on. In particular (quoting
> the patch):
> #FIXME: spawned windows (eg manager/help from menu) end up behind the
> # Not entirely unexpected but. Anything we can do? Gray out these entries?
> Graying out the entries seems easy enough to do, but gives a loss of
> functionality (for a non-obvious reason seen from user POV).
> Another alternative is to go out of fullscreen mode if any of these entries
> are activated. Is that feasible and wanted?
I think the latter would be the better way, though I don't see it as a
priority issue since the existing code has the same deficiency.
> I intend to fix all of these before requesting merge:
> #TODO: don't close menu if we got a new show_menu before timeout
You can probably just keep the object timer id around, and unregister it
> #TODO: kill details window on destruction
What does this mean exactly?
> #TODO: actually not centered?
> Not neccesary imo, but nice to have (especially the first):
> #NICE: add a button for getting out of fullscreen
Where would the button go? A separate window, or just a top level menu
> #NICE: ability to have this "pinned"
> And possibly a keyboard shortcut.
All the above should probably be done as separate patches though. I
think just getting the autohide behavior correct should be it's own
piece, then we can tweak and increment from there.
> And the class should be called vmmFullScreenMenu I guess. Should it reside
> in a separate file?
I think it's best to keep it in console.py.
> Thoughts, comments?
I tried it out, I like the direction its going in! I know the comments
above indicate that the alignment isn't quite right, but is this what
you are seeing?
Particularly the distance from the top of the screen. Is that
intentional? I'm running on fedora rawhide FYI.
Out of curiousity, what does virtual box do here? (you indicated you
were familiar with it). I'll try to take some time to set up vmware
workstation and vbox to play with it. There seems like several ways we
could possibly tweak this behavior, and I'm interested what the
A few small comments inline:
> # HG changeset patch
> # User Jon Nordby <jononor gmail com>
> # Date 1257990842 -3600
> # Node ID fbb0c9b65e9e287ca1aae4c4f75fd2457fe54766
> # Parent 7449fa221c45069b120871cfb02ed26eab2fbc54
> fullscreen: Put menubar in its own window
> diff -r 7449fa221c45 -r fbb0c9b65e9e src/virtManager/console.py
> --- a/src/virtManager/console.py Wed Nov 11 11:02:57 2009 -0500
> +++ b/src/virtManager/console.py Thu Nov 12 02:54:02 2009 +0100
> @@ -62,6 +62,8 @@
> self.title = vm.get_name() + " " + self.topwin.get_title()
> + self.fullscreen_menu = FullScreenMenu(self)
> # State for disabling modifiers when keyboard is grabbed
> self.accel_groups = gtk.accel_groups_from_object(self.topwin)
> self.gtk_settings_accel = None
> @@ -76,6 +78,9 @@
> self.vncViewer = gtkvnc.Display()
> + self.vncViewer.add_events(gtk.gdk.ENTER_NOTIFY_MASK)
> + self.vncViewer.connect("enter-notify-event", self.fullscreen_menu.hide_menu_delayed)
Long line here.
> self.notifyID = None
> @@ -260,7 +265,8 @@
> def toggle_fullscreen(self, src):
> if src.get_active():
> + # Fullscreen enabled
> + self.fullscreen_menu.activate()
> # if scaling is enabled make sure we fit onto the root window
> if self.vncViewer.get_scaling():
> ignore, h = self.window.get_widget("menubar3").size_request()
> @@ -277,6 +283,9 @@
> + # Fullscreen disabled
> + self.fullscreen_menu.deactivate()
> if self.config.get_console_keygrab() == 1:
> @@ -638,3 +647,73 @@
> +class FullScreenMenu(object):
> + def __init__(self, console):
> + self.orig_menu_container = console.window.get_widget("vbox2")
> + self.menubar = console.window.get_widget("menubar3")
We should probably give these widgets better names in vmm-details, since
we use them in a few spots now.
> + self.activated = False
> + # Make sure we get wanted window behaviour
> + # gtk.WINDOW_POPUP is too sticky
> + self.menuwin = gtk.Window()
> + self.menuwin.set_transient_for(console.topwin)
> + self.menuwin.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_MENU)
> + self.menuwin.set_decorated(False)
> + self.menuwin.set_resizable(False)
> + #NICE: ability to have this "pinned"
> + #NICE: add a button for getting out of fullscreen
> + #TODO: don't close menu if we got a new show_menu before timeout
> + #TODO: kill details window on destruction
> + #FIXME: spawned windows (eg manager/help from menu) end up behind the fullscreened window.
> + # Not entirely unexpected but. Anything we can do? Gray out these entries?
> + w, _ = self.menubar.size_request()
'_' is the gettext function, so overwriting it could cause issues if
this code ever included translated messages in the future. You can use
'ignore' which pylint won't complain about.
Thanks a bunch!
[Date Prev][Date Next] [Thread Prev][Thread Next]