summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-util.c
Commit message (Collapse)AuthorAgeFilesLines
* Use GResource for loading ui filesFabiano Fidêncio2016-03-031-43/+5
| | | | | | | | | | 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: Drop old compatibilty codeFabiano Fidêncio2016-02-241-4/+0
| | | | | | | | A few more pieces of old compatibility code can be dropped, as we already depend on GLib 2.38. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
* Remove GSLice usageFabiano Fidêncio2016-01-181-2/+2
| | | | | It's being slowly deprecated in glib https://bugzilla.gnome.org/show_bug.cgi?id=754687
* util: Fix the size of sorted_displays allocationFabiano Fidêncio2015-10-211-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As sorted_displays is a vector containing all displays' order, its allocation size must be the maximum display id + 1 instead of the maximum display id. Also, fix the size used for sorting and iterating the sorted_displays vector. Valgrind log: ==15946== Invalid write of size 4 ==15946== at 0x4169C0: virt_viewer_align_monitors_linear (virt-viewer-util.c:581) ==15946== by 0x42248B: virt_viewer_session_on_monitor_geometry_changed (virt-viewer-session.c:438) ==15946== by 0xBB41F03: _g_closure_invoke_va (gclosure.c:831) ==15946== by 0xBB5BC7C: g_signal_emit_valist (gsignal.c:3214) ==15946== by 0xBB5C764: g_signal_emit_by_name (gsignal.c:3401) ==15946== by 0x4328F3: virt_viewer_display_spice_monitor_geometry_changed (virt-viewer-display-spice.c:93) ==15946== by 0x432D60: virt_viewer_display_spice_size_allocate (virt-viewer-display-spice.c:224) ==15946== by 0xBB41CD4: g_closure_invoke (gclosure.c:768) ==15946== by 0xBB53538: signal_emit_unlocked_R (gsignal.c:3549) ==15946== by 0xBB5BEEF: g_signal_emit_valist (gsignal.c:3305) ==15946== by 0xBB5C29E: g_signal_emit (gsignal.c:3361) ==15946== by 0x637D6F6: gtk_widget_size_allocate_with_baseline (gtkwidget.c:6093) ==15946== Address 0x18c79d4c is 0 bytes after a block of size 12 alloc'd ==15946== at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==15946== by 0xBDD36D1: g_malloc0 (gmem.c:127) ==15946== by 0x41698D: virt_viewer_align_monitors_linear (virt-viewer-util.c:577) ==15946== by 0x42248B: virt_viewer_session_on_monitor_geometry_changed (virt-viewer-session.c:438) ==15946== by 0xBB41F03: _g_closure_invoke_va (gclosure.c:831) ==15946== by 0xBB5BC7C: g_signal_emit_valist (gsignal.c:3214) ==15946== by 0xBB5C764: g_signal_emit_by_name (gsignal.c:3401) ==15946== by 0x4328F3: virt_viewer_display_spice_monitor_geometry_changed (virt-viewer-display-spice.c:93) ==15946== by 0x432D60: virt_viewer_display_spice_size_allocate (virt-viewer-display-spice.c:224) ==15946== by 0xBB41CD4: g_closure_invoke (gclosure.c:768) ==15946== by 0xBB53538: signal_emit_unlocked_R (gsignal.c:3549) ==15946== by 0xBB5BEEF: g_signal_emit_valist (gsignal.c:3305) Resolves: rhbz#1272650 Related: rhbz#1267184
* Use the display ID to configure fullscreen monitorsJonathon Jongsma2015-10-091-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-16/+57
| | | | | | 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.
* Shift top-left display to originJonathon Jongsma2014-10-271-0/+42
| | | | | | | | | | | | | | 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/+50
|
* Don't check for NULL when it never can happenFabiano Fidêncio2014-08-191-1/+1
|
* Only filter virt-viewer debug messagesMarc-André Lureau2014-07-211-1/+1
| | | | | | Filter only our own debug messages. https://bugzilla.redhat.com/show_bug.cgi?id=1118365
* util: fix glib_check_version() conditionMarc-André Lureau2014-06-121-1/+1
| | | | glib_check_version() returns NULL if version is higher or equal.
* Use a custom log handler to silence debug messagesMarc-André Lureau2014-06-101-0/+14
| | | | | | | On RHEL6, with old glib, all g_log messages are printed. Filter the messages with a custom handler instead. https://bugzilla.redhat.com/show_bug.cgi?id=1107518
* Display warning if UI file failsJonathon Jongsma2014-02-111-1/+6
| | | | | | | | | | | When trying to load ui files, we try to find the file in several directories. If a file is not found in one directory, try to load it from the next directory. However, if a file is found in a directory but we are not able to load it (e.g. due to unsupported versions of glade used to generate it, etc), we should print a warning to the terminal to help the developer debug the issue. This is an unexpected failure (whereas not finding the file in that directory at all is an 'expected' failure).
* Load ui files first from installed locationJonathon Jongsma2014-01-201-11/+17
| | | | | | | virt_viewer_util_load_ui() looks first in the current directory, and then looks in the system data dirs for a ui file to load, but if you install virt-viewer in a different prefix, it will load the system UI file rather than the one from the install prefix. Try to load the ui file from pkgdatadir first.
* Add ability to use 'End' key in hotkeysJonathon Jongsma2013-09-101-1/+1
| | | | | | | | | | ctrl_key_to_gtk_key() capitalizes all key names not explicitly specified in the translation table. So 'end' becomes 'END', which is not a valid key name according to GTK+. Un-comment out the 'end' item from the table and set it to the properly capitalized key name ("End"). This allows users to specify e.g. "ctrl+alt+end" as a hotkey for sending the secure attention sequence.
* Add virt_viewer_compare_version()Marc-André Lureau2013-03-081-0/+49
|
* Add VIRT_VIEWER_ERROR GErrorMarc-André Lureau2013-03-081-0/+6
|
* Move spice_hotkey_to_gtk_accelerator() to utilMarc-André Lureau2012-11-271-0/+113
| | | | | To be compatible with RHEVM, VirtViewerFile hotkey format will use the Spice Controller format.
* Fix jenkins build failureMarc-André Lureau2012-10-231-0/+1
| | | | | | | | | virt-viewer-util.c: In function 'virt_viewer_util_init': virt-viewer-util.c:289: warning: implicit declaration of function 'setlocale' virt-viewer-util.c:289: warning: nested extern declaration of 'setlocale' virt-viewer-util.c:289: error: 'LC_ALL' undeclared (first use in this function) virt-viewer-util.c:289: error: (Each undeclared identifier is reported only once virt-viewer-util.c:289: error: for each function it appears in.)
* Use a mutex to check if VirtViewer runningMarc-André Lureau2012-10-231-0/+9
| | | | | | | We need to warn user that installer can't proceed if there is already a running instance of VirtViewer or of the installer. https://bugzilla.redhat.com/show_bug.cgi?id=864033
* Use a common early init() functionMarc-André Lureau2012-10-231-0/+32
| | | | | 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/+117
| | | | | | | | | | | 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.
* Add support for raw IPv6 addresses in VNC & libvirt URIsDaniel P. Berrange2012-04-231-3/+11
| | | | | | Support vnc://[x:y:z:]:5901/ for raw IPv6 addresses in URIs, and qemu+ssh://root@[x:y:x:]:22/ for raw IPv6 addresses in libvirt URIs
* Do not crash so easily when given invalid uriMarc-André Lureau2012-03-161-4/+5
| | | | 'remote-viewer foobar' shouldn't crash
* Update copyright headersDaniel P. Berrange2012-02-061-2/+2
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-83/+83
|
* build: replace deprecated functionsMarc-André Lureau2012-01-301-1/+1
|
* Return if xmlParseURI() failed, instead of crashingMarc-André Lureau2011-08-041-0/+2
|
* Lookup UI file correctly, to fix Windows supportMarc-André Lureau2011-08-041-4/+22
|
* Inherit from VirtViewerApp for VirtViewerMarc-André Lureau2011-07-221-0/+55
| | | | | | Make it a real GObject. The parts specific to virt should go in virt-viewer.c
* Introduce standard naming convention to files & methodsDaniel P. Berrange2011-07-011-0/+61
All source files must be named virt-viewer-XXXX All methods named virt_viewer_XXX