summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-window.c
Commit message (Collapse)AuthorAgeFilesLines
* Use GResource for loading ui filesFabiano Fidêncio2016-03-031-4/+16
| | | | | | | | | | Let's take advantage of GResource for loading ui files in a better and cleaner way than virt_viewer_util_load_ui() was doing. It also brings the benefit, at least for developers, of being able to test ui changes without having to "make install" virt-viewer. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
* cleanup: Don't use gtk_widget_modify_{fg,bg}()Fabiano Fidêncio2016-02-241-3/+10
| | | | | | | | | | | These function have been deprecated since Gtk 3.0 and is recommended to use _override_color() and _override_background_color() instead. As these new functions take a GdkRGBA as parameter, let's use gdk_rgba_parse() instead of gdk_color_parse(). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
* cleanup: Don't use GtkStockFabiano Fidêncio2016-02-241-4/+6
| | | | | | | | | | | | It has been deprecated since Gtk 3.10. New strings have been added as the GTK_STOCK_* defines had their translations done inside Gtk itself, but now the translations of the new added labels must be done by virt-viewer translators. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
* Drop support to gtk2Fabiano Fidêncio2016-02-151-35/+24
| | | | | | | | The 3.0 release was the last one that still supports GTK2. For the Windows builds the support to GTK2 was dropped in the previous release. Let's do the same for the entire project now. Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
* Add new functions to enable/disable a displayJonathon Jongsma2015-09-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there was a single function for controlling the enabled state of a display: virt_viewer_display_set_enabled(). Unfortunately, this function is used for two slightly different things: A. It informs the local display widget that the display has become disabled or enabled on the server. In other words, it tries to synchronize the 'enabled' state of the local widget with the actual state of the remote display. OR B. It tries to actively enable a currently-disabled display (or vice versa) due to some action by the user in the client application. This causes the client to send a new configuration down to the server. In other words, it tries to change the state of the remote display. There is some conflict between these two scenarios. If the change is due to a notification from the server, there is no need to send a new configuration back down to the server, so this results in unnecessary monitor configuration messages and can in fact cause issues that are a little bit hard to track down. Because of this, I decided that it was really necessary to have two separate functions for these two different scenarios. so the existing _set_enabled() function will be used for scenario A mentioned above. I added two new functions (_enable() and _disable()) that are used to send new configurations down to the server.
* virt-viewer-window: Change zoom with respect to real zoomPavel Grunt2015-07-291-3/+17
| | | | | | | | | The zoom can be changed by resizing the window (VNC / Spice without the agent). It is necessary to recalculate the zoom level before changing it, otherwise zoom operations will not work correctly. Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=90582
* Show window after its default and preferred sizes are setPavel Grunt2015-07-291-2/+2
| | | | | | | | | | | | | Under some circumstances (Xfce desktop environment, gtk3 client, RHEL6 guest having two monitors running locally) it is possible to create a loop of resizing windows. It is caused by size request like 1x1 sent to the guest. These request are created because _window_queue_resize() is called when the window is being shown. To avoid the problem, call gtk_widget_show() after its preferred and default sizes are set. Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=91405
* virt-viewer-window: Allow to resize window to any sizePavel Grunt2015-07-221-76/+3
| | | | | | | | | | | | | | | The function virt_viewer_window_resize restricts window to be bigger than a client's screen. It avoids extending the window to more client's screens, it causes changes of the zoom level if the guest does not fit into a screen. Lets remove virt_viewer_window_resize (its behaviour was introduced by the commit 6acb3856b6d8007752388f22f97aa8aaffdb7a5e). It will let the window managers to handle resizing of the window. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1221501 https://bugzilla.redhat.com/show_bug.cgi?id=1205804
* Remove unnecessary parameter from virt_viewer_window_resize()Pavel Grunt2015-07-221-6/+5
| | | | | Since c3cbdef888cc823e92140027d38378f40ccd4174 virt_viewer_window_resize is always called with keep_win_size = FALSE.
* Fix syntax-checkMichal Privoznik2015-04-291-1/+1
| | | | | | | | | | | | Commit c45a30e9 broke syntax-check: trailing_blank src/virt-viewer-window.c:1478: maint.mk: found trailing blank(s) maint.mk:700: recipe for target 'sc_trailing_blank' failed make: *** [sc_trailing_blank] Error 1 Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virt-viewer-window: Set initial zoom only oncePavel Grunt2015-04-221-1/+3
| | | | | | | It is not needed to do it more times as it may cause unnecessary resize events especially when leaving the fullscreen mode related: rhbz#1206460
* virt-viewer-window: Make sure that minimum zoom level is lower than ↵Pavel Grunt2015-04-221-1/+2
| | | | | | | | | NORMAL_ZOOM_LEVEL The minimum size of the desktop is 100x100 if the minimum window size is greater than this, the zoom level is greater than NORMAL_ZOOM_LEVEL related: rhbz#1206460
* virt-viewer: Set toolbar buttons not sensitive when neededLukas Venhoda2015-04-221-0/+27
| | | | | | | | | | | | | | File->Screenshot, File->Preferences, View->Zoom and Send keys are now sensitive only while quest is connected. Changed behaviour of zoom: Previously, zoom could be set while quest wasn't connected. The zoom would then be set on connection. There was no indication of current zoom level while not connected to guest. Now, the menu is not sensitive while not connected to guest. Zoom can now be only modified while connected to guest, or from the command line.
* app/window: Set display menu not sensitive when neededLukas Venhoda2015-04-221-0/+13
| | | | | Displays menu must be sensitive only when at least one display is enabled.
* virt-viewer-window: Return early when zoom of window and zoom of display are ↵Pavel Grunt2015-04-091-3/+2
| | | | | | | | | | | same The zoom level should be changed when zoom levels of the window and the display are different. It is wrong to check the previous value of the window because it could be set just for the window and not for the display (e.g. when setting zoom level using the command line). Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
* virt-viewer-window: Set zoom when display is enabled and ready.Pavel Grunt2015-04-091-1/+4
| | | | | | | | | | | The display has default dimensions (100x100) when it is disabled. Calculating the minimal zoom for the display will give wrong value for the newly opened display. It is better to wait for setting the zoom level to the moment when the display is enabled and ready. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
* virt-viewer-window: Change zoom of the display only when it is possiblePavel Grunt2015-04-021-1/+71
| | | | | | | | Do not allow to zoom out if it is not possible due to the width of the top menu. It avoids emitting size allocation events that will change the display resolution of the spice guest. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
* virt-viewer-window: Return NULL instead of FALSE for displayPavel Grunt2015-04-021-1/+1
|
* Use ZOOM constants instead of numbersPavel Grunt2015-04-021-13/+13
|
* 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>