summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-util.h
Commit message (Collapse)AuthorAgeFilesLines
* Use GResource for loading ui filesFabiano Fidêncio2016-03-031-0/+1
| | | | | | | | | | 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>
* Port to GtkApplication API'sEduardo Lima (Etrunko)2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of this patch consists in code being shuffled around to fit the expected flow while using the new APIs. I tried my best to make this patch the less intrusive as possible. Main changes are: - Updated build requirements * glib version 2.38 * gtk+ version 3.10 * gio - VirtViewerApp is now a subclass of GtkApplication. Some mainloop calls were replaced: * gtk_main() -> g_application_run() * gtk_quit() -> g_application_quit() - Unified command line option handling. The logic has moved from the main functions and split in common options, and specific ones for each application. With this, the main functions were highly simplified, and now basically responsible for instantiating the App object and running the main loop. - All Window objects must be associated with the Application. With this, there is no need to emit our own 'window-added'/'window- removed' signals, as those will be emited by GtkApplication whenever gtk_application_add_window() and gtk_application_remove_window() are called. Also, 'window-removed' was not being used anywhere. Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
* Use the display ID to configure fullscreen monitorsJonathon Jongsma2015-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When starting virt-viewer in fullscreen mode, we generally try to arrange guest displays exactly the same as client monitors. So if a client machine has two monitors, we'll try to enable display 0 and 1 on the guest (in that order). However, when using the configuration file to map fullscreen displays to different monitors, the guest displays may not be sequential, or there may be displays missing. For example, consider the following configuration: monitor-mapping=1:2;2:1 In virt_viewer_session_spice_fullscreen_auto_conf(), we were building an array of GdkRectangles for the initial monitors that we want to enable on the guest. We then configured the guest displays using the index of the array for the as the id of the guest display. But when displays are sparse or are out-of-sequence, the array index will not match the >ntended display ID. This created problems where displays were arranged incorrectly. By changing the simple array into a GHashTable, we can keep the display ID together with the GdkRectangle until we need to use it, and things will be configured correctly. This regression was introduced by c586dc8c. Fixes: rhbz#1267184
* util: Replace virt_viewer_compare_version with _compare_buildidChristophe Fergeau2015-06-091-1/+1
| | | | | | This allows us to do a more accurate version check if the .vv file producer wants to allow builds newer than x.y-z because they contain an important bug fix.
* Exit normally when canceling dialogPavel Grunt2015-03-231-0/+1
| | | | | | | | | This applies for: libvirt authentication dialog (e.g. virt-viewer --attach guest) 'recent connection' dialog (e.g. remote-viewer) 'vm choose' dialog when connecting without specifying the vm name This is done by using a new GError VIRT_VIEWER_ERROR_CANCELLED.
* Remove VIRT_VIEWER_VM_CHOOSE_DIALOG_CANCELLEDMarc-André Lureau2014-11-251-1/+0
| | | | | | This error type isn't really an error, it is used to skip error report code. The functions can simply return FALSE on failure, without GError set, to indicate that program should quit normally.
* Shift top-left display to originJonathon Jongsma2014-10-271-0/+1
| | | | | | | | | | | | | | When using a custom fullscreen display configuration, it's possible to specify that e.g. a single screen should be fullscreen on client monitor #4. Since we send down absolute positions and disable alignment when all windows are in fullscreen, we can send configurations with a very large offset to the top-left corner. This could result in the guest trying to create a screen that was much larger than necessary. For example when sending a configuration of 1280x1024+4240+0, the guest would need to allocate a screen of size 5520x1024, which might fail if video memory was too low. To avoid this issue, we shift all displays so that the minimum X coordinate for all screens is at x=0, and the minimum y coordinate is at y=0.
* Move monitor alignment function to util headerJonathon Jongsma2014-10-241-0/+3
|
* Show VM chooser dialog when oVirt VM name is missingPavel Grunt2014-10-101-0/+1
| | | | | | | When a user tries to connect to ovirt without specifying VM name (remote-viewer ovirt://ovirt.example.com) or with wrong VM name a list of available virtual machines is shown, and the user may pick a machine he wants to connect to.
* util: get rid of ARRAY_CARDINALITYMarc-André Lureau2014-06-101-2/+0
|
* Replace DEBUG_LOG with g_debugMarc-André Lureau2014-06-101-1/+0
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1107518
* Add virt_viewer_compare_version()Marc-André Lureau2013-03-081-0/+1
|
* Add VIRT_VIEWER_ERROR GErrorMarc-André Lureau2013-03-081-0/+7
|
* Move spice_hotkey_to_gtk_accelerator() to utilMarc-André Lureau2012-11-271-0/+2
| | | | | To be compatible with RHEVM, VirtViewerFile hotkey format will use the Spice Controller format.
* Use a common early init() functionMarc-André Lureau2012-10-231-0/+2
| | | | | There is a number of things both virt-viewer and remote-viewer need to do early during execution. Do it only in one place.
* spice: disconnect signal handlers when either object is destroyedMarc-André Lureau2012-07-231-0/+6
| | | | | | | | | | | Use virt_viewer_signal_connect_object(), a copy of telepathy utility function tp_g_signal_connect_object(). This function will take care of removing signal handler if any of emitter or attached object are destroyed. The following patches will have this condition met, since there is no longer 1-1 relation between channel and display. The channels can continue to be around when some of the display are removed.
* Update copyright headersDaniel P. Berrange2012-02-061-2/+2
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-0/+8
|
* Inherit from VirtViewerApp for VirtViewerMarc-André Lureau2011-07-221-0/+6
| | | | | | Make it a real GObject. The parts specific to virt should go in virt-viewer.c
* Turn VirtViewerDisplay into a proper Gtk widgetDaniel P. Berrange2011-07-111-1/+1
| | | | | Turn VirtViewerDisplay into a Gtk widget instead of just a GObject, by merging the functionality from VirtViewerAlign
* Introduce standard naming convention to files & methodsDaniel P. Berrange2011-07-011-0/+37
All source files must be named virt-viewer-XXXX All methods named virt_viewer_XXX