summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-window.c
Commit message (Collapse)AuthorAgeFilesLines
* Show preferences dialogMarc-André Lureau2015-03-051-0/+9
| | | | Add a menu item Preferences under File and show the preferences dialog
* Don't disable "send key" menu when display isn't readyJonathon Jongsma2014-10-161-3/+4
| | | | | | | The ability to send a keystroke should not depend on whether a display is ready or not, it only depends on whether the display exists or not. See https://bugzilla.redhat.com/show_bug.cgi?id=1152574
* Force display_show_hint() when the display is setFabiano Fidêncio2014-10-151-0/+3
| | | | | | | | | | | | | Since a window is not created at startup for each display, the first display(s) set when the application is opened will never receive and treat the "notify::show-hint" signal on VirtViewerWindow, once the callback is only set when the display is set to the specific window. It causes problems like the "Send Key" menu not activated till an extra display is added. To avoid this problem, let's force a call to display_show_hint() everytime a display is set. Resolves: rhbz#1152468 https://bugzilla.redhat.com/show_bug.cgi?id=1152468
* Unset app 'fullscreen' when leaving fullscreenJonathon Jongsma2014-09-261-10/+18
| | | | | | | | | | | | | | Previously, the fullscreen floating toolbar and the "toggle-fullscreen" hotkey (which maps to the menu item action) had slightly different methods of exiting fullscreen. The floating toolbar method unset the 'fullscreen' property on the application (which causes all windows to simultaneously exit fullscreen), whereas the hotkey did not. This had a side-effect of preventing the display from auto re-sizing if it was fullscreened again. After this change, both the hotkey and the toolbar button will unset the application-level 'fullscreen' property when exiting fullscreen mode. Resolves: rhbz#1022608
* Set initial window size to display desktop sizeJonathon Jongsma2014-09-241-0/+2
| | | | | | | | | When setting the 'display' for a VirtViewerWindow, the initial size for that window should be the size of the remote display. So we synthesize a desktop resize event when setting a new display for a window. This is only done for enabled displays. Disabled displays generally have a size of 0x0, which would result in the window being at it's minimum size, so just allow the window to use its default size.
* Fix gcc warning (unused-parameter)Fabiano Fidêncio2014-08-191-1/+3
|
* Fix gcc warning (missing-prototypes)Fabiano Fidêncio2014-08-191-0/+1
|
* Add a dialog showing details of the current guestJonathon Jongsma2014-08-071-0/+45
| | | | | | This allows the user to obtain the GUID and vm name of the currently-connected guest. Obviously, this only works with spice. In the future, it will allow them to set guest-specific configuration options (using a GUID as a key)
* Chain up to parent's dispose at the end of VirtViewerWindow::disposeChristophe Fergeau2014-08-041-2/+2
| | | | | | glib documentation says this should be the last thing done in the dispose() call, which makes sense as this could invalidate still-needed data in the parent object.
* Make ctrl-[+-] zoom in/out in fullscreenMarc-André Lureau2014-07-081-0/+4
| | | | | | | Make ctrl-[+-] zoom in/out in fullscreen with mouse over the control bar. https://bugzilla.redhat.com/show_bug.cgi?id=987549
* window: take zoom-level into account for display limitsMarc-André Lureau2014-06-111-4/+9
| | | | | | Fixes guest can not be resized to expected window size after zoom out. https://bugzilla.redhat.com/show_bug.cgi?id=1105528
* Replace DEBUG_LOG with g_debugMarc-André Lureau2014-06-101-6/+6
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1107518
* Fix race with metacity in fullscreenMarc-André Lureau2014-04-171-2/+9
| | | | | To avoid some races with metacity, the window should be placed as early as possible, before it is (re)allocated & mapped (rhbz#809546).
* Fix broken 'release-cursor' accel when not specified in --hotkeysJonathon Jongsma2014-03-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | When the --hotkeys option is given, all hotkeys that are not explicitly specified are disabled. The method used to disable hotkeys is to change the accel map entry to key=0, mods=0. However, when we decide whether to set a grab sequence on the spice dispay widget, we simply use the return value for gtk_accel_map_lookup_entry and assume that a TRUE value returned from this function means that the hotkey is enabled. In reality, this function will return TRUE for disabled hotkeys, but the 'key' variable will be set to key=0, mods=0. The result is that if I start virt-viewer like this: virt-viewer --hotkeys secure-attention=ctrl+alt+end ... and the guest that I'm attached to uses server mouse mode, it will be impossible to release the grab on the spice widget. Because we will explicitly disable the grab keys in the spice widget and handle the 'release-cursor' hotkey in virt-viewer, but the hotkey is an empty accel key. Instead of simply checking the return value of gtk_accel_map_lookup_entry, we have to inspect the return value for 'key' and check whether any keys are actually assigned.
* Use a USB icon in the fullscreen toolbarMarc-André Lureau2014-03-131-1/+4
| | | | | | | | Replace the generic GTK_STOCK_PREFERENCES with a more appropriate USB icon. The icon was provided by Jakub Steiner <jsteiner@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=804184
* Remove "Automatically resize" menuMarc-André Lureau2014-03-131-25/+1
| | | | | | | Remove "Automatically resize" menu item (always enabled for Spice display now) https://bugzilla.redhat.com/show_bug.cgi?id=1007649
* Fix scaling of window upon resizeDaniel P. Berrange2014-03-121-9/+7
| | | | | | | | | The code to determine scaling of windows was incorrectly using the original desktop size instead of the host screen size. The 128 pixel fudge factor was also causing windows to be scaled when there was no need for them to be. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Enable the display before showing the windowJonathon Jongsma2013-12-161-2/+2
| | | | | | | | This ensures that the display is enabled when it gets its first Allocate event (which causes a display reconfiguration). If the display is not enabled at this point, it won't send down a new monitors_config message until the second allocation, which may result in the display being disabled until a window is resized.
* separate fullscreen_set_active into a separate functionJonathon Jongsma2013-11-201-8/+12
|
* Add ability to define custom display->monitor mapping per vmJonathon Jongsma2013-11-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fullscreen mode generally just assigns display 1 to monitor 1, display 2 to monitor 2, etc. For custom setups, you can define a monitor mapping in the settings keyfile per-vm. This requires a vm uuid (so only works in virt-viewer or on versions of spice-server that send the uuid over the wire). The format is pretty basic: [6485b20f-e9da-614c-72b0-60a7857e7886] monitor-mapping=2;3 The group name ("6485b20f-e9da-614c-72b0-60a7857e7886") is the uuid id of the vm. This group has a single key: monitor-mapping. This key is an array of integers describing the order in which to assign the monitors to a guest display. Any monitors that are not listed in this array will not be configured at startup. For instance: monitor-mapping=2;1 will attempt to configure 2 displays on the guest and assign the first display to monitor 2 and the second display to monitor 1. monitor-mapping=2 will only configure a single display on the guest and place it on the second monitor. Any monitor numbers listed in the keyfile are greater than the number of monitors that are physically present, they will be ignored.
* Disconnect fullscreen map-event handler when leaving fullscreenJonathon Jongsma2013-11-131-10/+14
| | | | | | | | | When we enter fullscreen mode before the window is shown, we set up a signal handler to enter fullscreen mode when the window is mapped. If we then leave fullscreen mode before the window is mapped, we don't disconnect this handler, so it will still enter fullscreen mode when it is shown. Fixes rhbz #1009513
* Make 'Send' menu items with defined accels work in fullscreenJonathon Jongsma2013-10-181-1/+4
|
* Set Spice display to fullscreen if owning window is pending fullscreenJonathon Jongsma2013-10-181-2/+2
| | | | | | | | | | When you call virt_viewer_window_enter_fullscreen() on a hidden window, it didn't actually change its fullscreen state. Instead, it sets up a map-event handler to enter fullscreen after it is shown. When _set_display() is called on a window that is pending fullscreen status, it initially sets the fullscreen state of the display to FALSE, which can cause an unwanted resize to be sent down to the guest. This patch changes the behavior to set its fullscreen state to TRUE even before the window is shown.
* hotkeys: send modifiers before non-modifier keyMarc-André Lureau2013-09-261-3/+5
| | | | | | | | This fixes the "send menu" for hotkeys set with non-modifiers keys. The current order of press events is wrong, as it sends first non-modifiers keys, and in general ctrl+t will work, t+ctrl will not. https://bugzilla.redhat.com/show_bug.cgi?id=846006
* Add ability to send Secure attention sequence via keyboardJonathon Jongsma2013-09-101-20/+24
| | | | | | | | On Windows, the OS doesn't allow applications to handle Ctrl+Alt+Del, because it's handled by the OS at a much lower level. Although we have a menu item to send this sequence to the guest, it's not possible to send via the keyboard (in the windows client). So add an alternative key sequence (defaulting to Ctrl+Alt+End) to send this sequence to the guest.
* kiosk: explicit resize window to fullscreen sizeMarc-André Lureau2013-08-201-6/+1
| | | | | | | | | | | Allow to run the client in kiosk mode with window-manager-less environment. This was a conditional workaroud on win32. I am making it non-conditional to make fullscreen work on non-wm environment. Hence I don't see the need to refer explicitely to the bug workaround, since it is no longer something that should be removed, even when bgo 652049 is fixed.
* kiosk: warn and prevent if app want to quit or window to hideMarc-André Lureau2013-08-201-0/+5
| | | | | These condition shouldn't happen, they are here for debugging purposes (ie file a bug if it happens).
* kiosk: teach a window to become kiosk-modeMarc-André Lureau2013-08-201-0/+25
| | | | Remove the toolbar, disable modifiers.
* kiosk: keep a reference on the toolbarMarc-André Lureau2013-08-201-1/+2
| | | | | We are going to change the container content dynamically, so we need a strong reference.
* kiosk: add app kiosk option, pass it down to windowMarc-André Lureau2013-08-201-0/+13
| | | | See man page update for details.
* Fix two type cast problemsDaniel P. Berrange2013-07-311-2/+2
| | | | | | | | | The g_array_free() return value is 'char *' rather than 'void *' so must be explicitly cast to 'uint8 *'. The accelerator menu callback data is a GtkMenu rather GtkWidget Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* window: auto-add hot key combos to "Send key" menuMarc-André Lureau2013-07-301-0/+73
| | | | | | | Auto-add hotkey combos to "Send key" menu. Because they are captured by virt-viewer, there is currently no way to pass them to the guest. https://bugzilla.redhat.com/show_bug.cgi?id=846006
* window: use dynamically generated menuMarc-André Lureau2013-07-301-2/+31
| | | | | Remove the static Glade menu in favour of the one generated dynamically already used for the toolbar.
* window: use a menu item property for key combosMarc-André Lureau2013-07-301-41/+53
| | | | | | | Allow to add dynamically generated key combos later on. This also removes the extra combo lookup, which used to be problematic due to translations etc.
* Remove restore window location codeMarc-André Lureau2013-07-301-14/+0
| | | | | | | | | It turns out gdk on win32 already restores properly the window size/positon when leaving fullscreen. On non-win32, the WM should do the job. This solves the first window having too small size after leaving fullscreen: https://bugzilla.redhat.com/show_bug.cgi?id=978362
* Make zoom-reset a global key bindingMarc-André Lureau2013-07-301-0/+2
|
* Realize the display when it's added to the windowMarc-André Lureau2013-07-301-0/+1
| | | | | Make sure the widget get some dimensions, so if the display is enabled before it is actually shown, it will have non-zero size
* Initialize fullscreen_monitor to invalid valueMarc-André Lureau2013-07-301-0/+1
| | | | This makes it easier to debug when a window has no associated monitor.
* app: always use maybe_quit()Marc-André Lureau2013-07-081-1/+1
| | | | | | | Now that closing a window is like quiting, there is no reason to ask or skip the confirm dialog depending on how you quit (menu/toolbar/window). https://bugzilla.redhat.com/show_bug.cgi?id=905684
* window: set display fullscreen stateMarc-André Lureau2013-07-051-2/+7
|
* Remove the "container" logic used by legacy browser pluginMarc-André Lureau2013-05-161-22/+0
|
* window: wait until mapped before fullscreenMarc-André Lureau2013-05-161-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | On RHEL6, when starting virt-viewer --full-screen, metacity will remaximize & force-fullscreen when leaving fullscreen, which prevents user from accessing window titlebar, and end up with an incorrect fullscreen state. Thanks Owen Taylor for help debugging this: <owen> elmarco: So the interesting thing here is that the "legacy" isn't triggered off a configure request to a particular size, mutter seems to constrain the window back to fullscreen size on its own when it sees a change to WM_NORMAL_HINTS <owen> commit 4943d79d6844af3f7fc0a15ceadb69d95c4c5c61 <owen> Author: Peter Bloomfield <PeterBloomfield@BellSouth.net> <owen> Date: Wed Jan 20 10:59:07 2010 -0500 <owen> prevent window self-maximisation <owen> Is not in rhel6 metacity <owen> So probably that's the main difference <owen> can you just make your program not fullscreen initially but wait until it's mapped? (gets map-event on the toplevel) <elmarco> owen that seems to work <owen> I don't have a better solution to offer - sorry for the ugliness (code and initial mapping appearance) https://bugzilla.redhat.com/show_bug.cgi?id=876445
* window: leave fullscreen on current windowMarc-André Lureau2013-05-141-1/+6
| | | | | | Since fdaa9b0ca, virt-viewer allows to fullscreen a single window. It feels more symetric to leave a single window from fullscreen as well, unless the application was started in fullscreen.
* window: fix send key menu popup positionMarc-André Lureau2013-05-141-3/+4
| | | | | | | | | Fix send key menu popup position. The current code wasn't correctly translating the menu coordinates based on the toplevel windows position, it was always using origin 0. https://bugzilla.redhat.com/show_bug.cgi?id=913601
* Allow to fullscreen and position display independentlyMarc-André Lureau2013-05-131-1/+4
| | | | | | | | | | Currently, going from window to fullscreen mode changes all display to fullscreen and realize automatic positionning on corresponding client monitor. However, it allows for much more flexibility to allow entering fullscreen on the current monitor each windows seperately. This way the user can decide on arbitrary monitor arrangement. https://bugzilla.redhat.com/show_bug.cgi?id=558241
* Do not restrict disabling display to != 0Marc-André Lureau2013-05-131-5/+1
| | | | | | | | | | | | | | | | Virt-viewer hides the display window 0, but doesn't disable the display. This is inconsistent with other displays, and prevent the guest OS from reconfiguring the main display. (for monitor 0 to be really disabled in multi-monitor guest, the agent need to support sparse monitor config. If not, the first display windows will be reopened to match the new un-sparse configuration) Note also the current Linux vdagent crashes when disabling 1st monitor, to be solved seperately. Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=958550
* Remove tab from source fileDaniel P. Berrange2013-05-011-1/+1
|
* Exit virt-viewer when trying to close any windowChristophe Fergeau2013-04-251-1/+1
| | | | | | | | Currently, in multi-screen scenarios, when closing one remote-viewer window, the corresponding screen gets disabled in the guest OS. This can be confusing as this behaves very differently from File/Quit. This commit will exit the whole application when the user tries to close one of virt-viewer window.
* gtk-3: Rework window size handlingHans de Goede2013-04-231-5/+21
| | | | | | | | | | | | | | | | With gtk-2 we have a special hack, where at first we make the virt-viewer-display request its actual size, and then once the window is mapped, we request a size of 50x50 to allow the user to resize the window to something smaller. With gtk-3 >= 3.8.1 this is broken, and the window gets resized to a smaller size as soon as we change the size request to 50x50. gtk-3 has a much better way of dealing with this in the form of widgets being able to specify both a minimal and a natural size. This patch changes virt-viewer to use this with gtk-3, instead of the gtk-2 hack. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt-viewer-window: cleanup zoom handlingHans de Goede2013-04-231-30/+18
| | | | | | | | We've 3 similar zoom function zoom in / out / reset. in / out do not schedule a window resize when there is no display, where as reset does, which is not consistent. Also there is some duplicate code between them. Signed-off-by: Hans de Goede <hdegoede@redhat.com>