summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-app.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure all windows obey initial --zoom settingJonathon Jongsma2013-11-211-6/+4
| | | | | | | | | | | | | | There are cases where multiple VirtViewerWindow objects are created before the VirtViewerApp constructor has a chance to run. Since the constructor has not yet run, priv->main_window will still be NULL, the test in virt_viewer_app_window_new() will fail, and they will not get their initial zoom level set. When the constructor finally runs, it set the zoom level of the main window to the value set on the command line, but all other windows that had already been created retained the default 100% zoom level. By creating the main_window in the instance init function, we ensure that the main window is created before we get any 'session-display-added' signals and all displays will start out with consistent zoom levels.
* Remove non-functional VIRT_VIEWER_HIDE env behaviorJonathon Jongsma2013-11-211-3/+0
| | | | | | | VIRT_VIEWER_HIDE could be set as an environment variable to (theoretically) hide displays whenever they were not ready. Unfortunately, this bit of functionality appears bitrotten and doesn't work anymore (it prevents windows from opening when you click 'view > displays > display 2', for instance).
* Add ability to define custom display->monitor mapping per vmJonathon Jongsma2013-11-201-16/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix leak of VirtViewerApp::windows hash table keyChristophe Fergeau2013-11-201-1/+2
| | | | | | | | | | | | | The VirtViewerApp::windows hash table owns the memory for both the keys and values it stores. virt_viewer_app_remove_nth_window() uses g_hash_table_steal() which does not call the 'free' function neither for the key nor for the value. This method takes care of releasing the reference for the value it extracted from the hash table, but not for the key. This commit fixes by explicitly taking a reference on the value rather than stealing the one held by the hash table. We can then replace the use of g_hash_table_steal() with g_hash_table_remove() which will take care of freeing the removed key.
* Hide all windows on disconnectionChristophe Fergeau2013-11-131-0/+14
| | | | | | | | | | | | | | | When starting remote-viewer without argument, we are showing a window where the user can enter connection details. We then go on to try and connect to the URI the user specified, and if the connection fails, we disconnect from the remote server, and then we show again the connection window so that the user can correct the URI if he entered it wrong. However, when this happens, the window for the previous connection will still be visible even if connection failed. To avoid this, this commit makes sure we hide all windows when we get a disconnection event. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
* Drop basic fullscreen modeJonathon Jongsma2013-11-131-53/+3
| | | | | | Remove the distinction between --full-screen and --full-screen=auto-conf. Just make --full-screen behave like auto-conf did. There's really no advantage to having two slightly different fullscreen startup modes.
* Unify configured hotkey behaviourMarc-André Lureau2013-11-071-7/+13
| | | | | | | | | | | Whether the hotkeys are set through command line, controller or file, we should get the same keybinding result (clear unspecified, and enable global bindings) However, when started from command line arguments, without --hotkey argument, it will have basic non-global default bindings. https://bugzilla.redhat.com/show_bug.cgi?id=1023447
* Rename internal toggle-fullscreen menu accel nameMarc-André Lureau2013-11-071-3/+3
| | | | This avoid confusion with other fullscreen state property
* Fix 'quiting' typo in VirtViewerApp private memberChristophe Fergeau2013-10-291-3/+3
|
* Don't disable fullscreen if kiosk mode is offJonathon Jongsma2013-10-181-1/+2
| | | | | | This conflicts with the --full-screen switch, because if kiosk mode is disabled, it sets disables fullscreen mode, which overrides the earlier call to enable fullscreen.
* Make 'Cancel' the default action in exit dialogChristophe Fergeau2013-10-161-0/+1
| | | | | | | | | In the 'Do you want to close the session dialog?', the default focus is currently on the 'Do not ask me again' checkbox. The purpose of this dialog is to make sure that the user does not inadvertantly exit remote-viewer, this commit changes the default action in this dialog to be 'cancel' rather than switching the 'Do not ask me again 'checkbox.
* Add ability to send Secure attention sequence via keyboardJonathon Jongsma2013-09-101-0/+4
| | | | | | | | 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: don't open extra monitorsMarc-André Lureau2013-08-201-2/+11
| | | | | In kiosk mode, we don't want new monitors windows that wouldn't fit on the client monitors to come up.
* kiosk: add --kiosk-quit optionMarc-André Lureau2013-08-201-1/+43
| | | | | | In kiosk mode, it's useful to keep the app alive, even if the remote session ended for example. Ie, we want to prevent the app from quiting itself, even if the remote end closed, lost network, or crashed etc.
* kiosk: use less verbose window/display statusMarc-André Lureau2013-08-201-2/+7
| | | | | | | | | We want extra windows to remain blank after connection. For example, if the remote has a single monitor, and client has more, we don't want extra client monitors to say "Connected to graphic server" all the time on other monitors. Instead, we leave them empty/black in kiosk mode.
* kiosk: open a window on each client monitorMarc-André Lureau2013-08-201-0/+15
| | | | | | | Open a window on each client monitor in fullscreen. If the remote display has less monitors than the client, the extra client monitors will still be used to prevent the user from accessing the windows or desktop below, and also to show some status messages when necessary.
* kiosk: add app kiosk option, pass it down to windowMarc-André Lureau2013-08-201-0/+37
| | | | See man page update for details.
* Return existing window in app_window_new()Marc-André Lureau2013-08-201-0/+4
| | | | | | | | Since the returned window is weak, it can already returns existing windows (instead of creating one and failing to insert). This allows the following set_kiosk() function to create a main window before the app constructor is called.
* Define the min/max zoom levels, so all values are syncMarc-André Lureau2013-08-201-2/+2
|
* Try to share more GOption code between r-v and v-vMarc-André Lureau2013-08-201-0/+61
|
* Enable smartcard shortcuts when a software reader is presentChristophe Fergeau2013-07-311-6/+74
| | | | | | | At the moment, smartcard keyboard accelerators are always enabled when specified, even if no software smartcard reader is in use. This commit only enables the smartcard keyboard accelerators when a smartcard reader has been found. This fixes rhbz#866944
* Make zoom-reset a global key bindingMarc-André Lureau2013-07-301-0/+1
|
* Hide extra monitors that don't fit in auto-confMarc-André Lureau2013-07-301-1/+4
| | | | | | | | | | Virt-viewer sometimes opens one too many windows if the guest is configured with more monitors than the client (the spice monitor configuration request and the current config aren't related, so there is some race). Instead, let's hide extra monitors that wouldn't fit in auto-conf. https://bugzilla.redhat.com/show_bug.cgi?id=985898
* Disable auto-conf when user toggle displayMarc-André Lureau2013-07-301-0/+2
| | | | Let's get out of auto-conf mode whenever user tricks display visibility.
* 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
* usbredir: Don't depend on channel orderingHans de Goede2013-07-061-5/+13
| | | | | | | | | | | | | Before this patch-set virt-viewer was calling spice_session_has_channel_type( session, SPICE_CHANNEL_USBREDIR) from the session-initialized signal handler, So as soon as the display channel gets added to the session, the check was done. This causes the check to return FALSE for usbredir capable vms if the usbredir channel(s) get added to the session after the display channed. This patch refactors things to not depend on channel creation order. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* app: move display on client monitors with --full-screenMarc-André Lureau2013-05-221-7/+3
| | | | | | | | | | | There used to be a check to fullscreen the only visible display on current monitor, by checking the number of visible monitors. Now that fullscreen is independant for each display, and goes on current monitor, it's useless. However, this code path is still used for the app --full-screen, at startup time. And it is still nicer to open the display on respective client monitors, rather than all on current monitor.
* Show connect dialog again if connection from dialog failedMarc-André Lureau2013-05-171-15/+19
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=864026
* Move connect dialog to remote-viewer.cMarc-André Lureau2013-05-171-3/+1
|
* Remove the "container" logic used by legacy browser pluginMarc-André Lureau2013-05-161-39/+4
|
* Only fullscreen the new windowMarc-André Lureau2013-05-161-14/+26
| | | | | The current code will forcefully reset fullscreen all windows when a new window is created
* Exit virt-viewer when trying to close any windowChristophe Fergeau2013-04-251-42/+47
| | | | | | | | 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.
* Remove redundant check, g_strdup(NULL) is allowedChristophe Fergeau2013-04-131-1/+1
| | | | This also makes the code consistent with its surroundings.
* Fix memory leak on remote-viewer exitChristophe Fergeau2013-04-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When exiting remote-viewer, VirtViewepApp::dispose() calls virt_viewer_app_set_connect_info() with NULL parameters to free all internal fields. However, _set_connect_info() calls virt_viewer_app_update_pretty_address() which will always allocate a new string even if the fields it's using to fill the string are NULL. This commit fixes the leak by checking if the fields have non-NULL values before creating the newly-allocated string. ==24180== 14 bytes in 1 blocks are definitely lost in loss record 540 of 8,671 ==24180== at 0x4A0887C: malloc (vg_replace_malloc.c:270) ==24180== by 0x32D2B0A187: __vasprintf_chk (vasprintf_chk.c:80) ==24180== by 0x32D52845AA: g_vasprintf (stdio2.h:210) ==24180== by 0x32D52640DC: g_strdup_vprintf (gstrfuncs.c:517) ==24180== by 0x32D526417B: g_strdup_printf (gstrfuncs.c:543) ==24180== by 0x4136E6: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1681) ==24180== by 0x414100: virt_viewer_app_set_connect_info (virt-viewer-app.c:1902) ==24180== by 0x4141D0: virt_viewer_app_free_connect_info (virt-viewer-app.c:1910) ==24180== by 0x4127C6: virt_viewer_app_dispose (virt-viewer-app.c:1353) ==24180== by 0x425488: remote_viewer_dispose (remote-viewer.c:131) ==24180== by 0x32D5E14787: g_object_unref (gobject.c:2986) ==24180== by 0x4280AF: main (remote-viewer-main.c:323)
* virt-viewer-app: Always allow users to close displays from the displays menuHans de Goede2013-04-051-2/+2
| | | | | | | | | | | | Marking display menu items as non sensitive for shown displays make no sense, since the user can always close them through the window-manager. Having a window for a display shown when the display is not selectable nor ready, can happen when the agent goes away. This happens for example when using a dual monitor config with a Linux guest and then switching to a text console inside the guest. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Make display menu item sensitive againMarc-André Lureau2013-03-281-2/+1
| | | | | | | | Even if the display has not been explicitely disabled, as long as the display is "selectable" Fix regression introduced with "Do not disable extra client monitors" 3b981d953f270662360e5b0c78183924276a18ed
* Remove gtk_window_present() callMarc-André Lureau2013-03-261-1/+0
| | | | | | | | | | | | | | | | | | gtk_window_present() may forcefully call gdk_window_show(), which will call ShowWindow(). Although gdk call is not supposed to move the window if it's already visible, it does restore the window position on Vista+. For example, a snapped window will be moved back to its previous position. Gtk+ ShowWindow() is currently using SW_SHOWNOACTIVATE, it should probably use SW_SHOWNA instead, but that didn't help anyway for a snapped window. Since virt_viewer_window_show() already ensure the window is visible, I am not sure why gtk_window_present() is there in the first place, so just remove it. https://bugzilla.redhat.com/show_bug.cgi?id=912713
* app: add get_fullscreen_auto_conf()Marc-André Lureau2013-03-251-1/+9
|
* Reuse existing 'displays' submenu rather than recreating itChristophe Fergeau2013-03-251-4/+32
| | | | | | | | | | | Because of what apparently is a gtk+2 bug , we cannot recreate the submenu every time we need to refresh it, otherwise the application may get frozen with the keyboard and mouse grabbed if gtk_menu_item_set_submenu is called while the menu is displayed. Reusing the same menu every time works around this issue. https://bugzilla.redhat.com/show_bug.cgi?id=922712
* virt-viewer-app: Call virt_viewer_app_update_menu_displays on show_hint changeHans de Goede2013-03-211-0/+1
| | | | | | | | | | | | | | | Since the sensitivity of the display menu-check-items depends on show_hint, we need to call virt_viewer_app_update_menu_displays on show_hint change. This fixes the following scenario: 1) Linux guest with upto 4 displays on a single qxl dev 2) Configure it for 2 displays 3) Switch to a text-console in the guest (ie send ctrl+alt+F3) 4) All displays except for disp 1 are now not sensitve in the menu 5) Switch back to X 6) The second display in the view->displays menu is still not sensitive Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* virt_viewer_window_enter_fullscreen: Pass in monitor for fullscreen windowHans de Goede2013-03-201-3/+1
| | | | | | | | | | Rather then passing in a move boolean + coordinates to move the window to for fullscreen mode, simply pass in the monitor, so that the underlying objects can also use the monitors size to determine the display size. Note: pass in -1 to use the monitor the window is currently on. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Don't override G_LOG_DOMAIN=allMarc-André Lureau2013-03-131-1/+2
| | | | | If the string is different, the GLib log handler will not log all messages.
* Allow app_initial_connect() to raise an errorMarc-André Lureau2013-03-081-23/+23
|
* Fix "Do not ask me again" checkbox settings savingMarc-André Lureau2013-02-071-17/+22
| | | | | | | | | | | | | | | | | Based on bug report by Hans: The code block for saving was below this check: if (priv->session) { virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session)); if (priv->connected) { priv->quiting = TRUE; return; } } Which means it never executes when quiting virt-viewer while conneced, causing the "Do not ask me again" checkbox settings to not be saved.
* usbredir: Fix usbredir menu always being grayed out on monitor 2+Hans de Goede2013-02-061-0/+4
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Add a "Do not ask me again" checkbox when closing appMarc-André Lureau2013-01-311-2/+62
|
* Always ask user about closing sessionMarc-André Lureau2013-01-311-11/+2
| | | | | | | | Currently, virt-viewer doesn't ask for user confirmation when closing a single monitor session. Always ask before closing, as requested by user. https://bugzilla.redhat.com/show_bug.cgi?id=803912
* vnc: add connection by fileMarc-André Lureau2013-01-181-1/+1
| | | | | | | | | | | | | | | Learn to connect to a VNC server with the connection details file, ex: [virt-viewer] type=vnc host=localhost port=2356 password=foobar v2: - add username/password support https://bugzilla.redhat.com/show_bug.cgi?id=843410
* Add a virt_viewer_app_set_hotkeys() helper functionHans de Goede2012-12-211-0/+53
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* "Unable to connect to the graphic server" error on guest shutdownMarc-André Lureau2012-11-201-4/+6
| | | | | | | | | | In virt_viewer_app_activate(), priv->connected is set to FALSE when the connect/active is successfull. However, we rely on it to know whether the virt_viewer_app_disconnected() is an error, so only set it to FALSE when connection failed. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=875697