Commit Graph

1826 Commits

Author SHA1 Message Date
Eduardo Lima (Etrunko)
40ebfbadee Minor code cleanups
- Reuse #ifdef HAVE_SPICE_GTK block for include.
- Move declaration of vfunc together with others of the same class.
- Move variable declaration to the top of the function.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-15 21:50:19 +01:00
Fabiano Fidêncio
4235ef3453 Drop support to gtk2
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>
2016-02-15 21:49:57 +01:00
Pavel Grunt
c86a4dfa41 display: Use correct variable name
Fix gtk2 build
2016-02-15 17:59:32 +01:00
Pavel Grunt
fd4c721551 display: Remove zoom property
It is possible to get the same info from the "zoom-level" property.
virt_viewer_display_get_zoom() now returns TRUE if zoom level != 100
2016-02-15 14:01:50 +01:00
Pavel Grunt
ca1ad884bd display: Use common code to get preferred size 2016-02-15 14:01:42 +01:00
Pavel Grunt
724744ca20 app: Compute monitor mapping only in fullscreen 2016-02-15 13:51:13 +01:00
Pavel Grunt
529980e8d3 app: Do not show usbredir button without session
The button is visible in the fullscreen toolbar when waiting for a guest.
Clicking on it causes the runtime warning:
virt-viewer-CRITICAL **: virt_viewer_session_usb_device_selection: assertion 'VIRT_VIEWER_IS_SESSION(self)' failed
2016-02-15 10:05:16 +01:00
Pavel Grunt
8c9a968561 app: Add comment only when config file has VM group
Avoid the debug message on close:
virt-viewer-DEBUG: Unable to get comment from key file: Key file does not have group '39cd210d-5d45-478a-91fe-b3680307f2df'
2016-02-15 10:04:42 +01:00
Pavel Grunt
fcb200e3d4 app: Return early on empty monitor mapping
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1304648
2016-02-15 10:04:32 +01:00
Pavel Grunt
422cbb6ea6 display: Set value of desktop width and height property directly
Avoid calling gtk_widget_queue_resize() and emiting
the "display-desktop-resize" signal.
The only user of the properties is virt_viewer_display_spice_set_desktop()
which will call the function and emit the signal after setting both
"desktop-width" and "desktop-height" properties.

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
045174f483 display: Return early and remove a block
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
c2f6412e7a display: Remove unnecessary VIRT_VIEWER_DISPLAY cast
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Fabiano Fidêncio
5fd23329c4 Remove GSLice usage
It's being slowly deprecated in glib
https://bugzilla.gnome.org/show_bug.cgi?id=754687
2016-01-18 11:27:07 +01:00
Jonathon Jongsma
c2046a2992 display: Set useful values for MIN_DISPLAY_{WIDTH, HEIGHT}
Nowadays the value for MIN_DISPLAY_{WIDTH,HEIGHT} is 50. This arbitrary
value doesn't bring any benefit, doesn't provide a useful size for a
desktop to be usable and can actually trigger some undefined behavior
when reaching resolutions that are lower than the ones provided by the
video drivers (as in rhbz#1296878).

In order to avoid these issues and provide a minimum resolution that can
still be useful for our users, let's use the same values for minimum
width and height used by the linux QXL drivers (320x200).

This also requires us to adjust the minimum requested widget size when
zoom is enabled so that we don't accidentally request a size smaller
than the driver can support.

Related: rhbz#1296878
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-01-13 10:36:55 -06:00
Fabiano Fidêncio
907f8c5d33 display: set min value for desktop-{width,height} props as MIN_DISPLAY_{WIDTH,HEIGHT}
Otherwise we can have warnings when resizing the virt-viewer window to
the smallest possible size, like:

(virt-viewer:11187): GLib-GObject-WARNING **: value "50" of type `gint'
is invalid or out of range for property `desktop-height' of type `gint'

Related: rhbz#1296878
2016-01-08 12:38:22 +01:00
Daniel P. Berrange
992df28142 Refresh translations from zanata
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-12-07 14:33:58 +00:00
Daniel P. Berrange
386ceb7778 Update NEWS for release 3.0
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-12-03 13:41:56 +00:00
Daniel P. Berrange
9734cbb8e5 Bump spice-gtk dep to 0.30.0 to avoid dep on git snapshot release 2015-12-03 13:41:56 +00:00
Daniel P. Berrange
d71bb09046 s/mingw62/mingw64/ in RPM spec file 2015-12-03 13:34:55 +00:00
Daniel P. Berrange
0de42b746e Avoid macro in RPM comment 2015-12-03 13:34:55 +00:00
Fabiano Fidêncio
15c97c42a1 autobuild: gtk2 has been dropped for windows
0a7fa73f is the commit that dropped support for gtk2 for the nsis
installer.
03c014cb is the commit that dropped support for gtk2 for the msi
installer.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
f345d27724 specs: add remote-viewer-connect.xml
The file was introduced in commit 0571843d but never added to the spec
files.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
cf228ad54d nsis: add libbz2-1.dll
mingw-bzip2 seems to be a mingw-freetype dependency.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
730a50a67a nsis: update nettle to 3.1.1
Use version 3.1.1, matching what currently is in f23.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
632d9369bc nsis: update libgnutls to 3.4.7
Use version 3.4.7, matching what currently is in f23.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
65aa7e08a5 nsis: update pango to 1.38.1
Use version 1.38.1, matching what is in f23.
An important note is that the removed files were removed in
mingw-pango-1.37.1.
2015-12-01 16:46:07 +01:00
Fabiano Fidêncio
4b3d30683d docs: fix "make syntaxcheck" 2015-12-01 16:46:07 +01:00
Jonathon Jongsma
428c3e3fdb Add some multimonitor documentation
These two files describe some of the behavior and requirements for
virt-viewer in fullscreen multimonitor mode
2015-12-01 09:00:59 -06:00
Daniel P. Berrange
fdf55b6ce3 autogen: Ensure m4 directory exists
We're telling autoconf to look in the m4/ directory for
files, but this directory doesn't exist in a clean checkout
until libtoolize has run. Older versions of autoconf consider
this to be a fatal error.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-05 14:24:23 +00:00
Daniel P. Berrange
a7861f975b git.mk: fix copyright line and remove use of -o / -a
Any copyright line must use 'Copyright (C) <year> Red Hat'
per the syntax-check rule.

Use of -a / -o args to "test" is non-portable and should
instead be done with 'test ... || test ...'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-05 14:22:35 +00:00
Eduardo Lima (Etrunko)
8684961d2d Remove useless {get,set}_property functions
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
95773ca5e1 Move declaration to the beginning of the file
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
69e0476314 Update MAINTAINERCLEANFILES variables
Makefile.am: Use helper variables from git.mk
man/Makefile.am: This should be $(dist_man_MANS) instead of $(man_MANS)

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
173a8cff4e Update git.mk from latest upstream version
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:16 -02:00
Eduardo Lima (Etrunko)
03ec5a69d2 Call intltoolize after autoreconf
After removing m4/.gitignore file in previous patch, I started getting
the following error when running autogen.sh.

ln: failed to create symbolic link ‘m4/intltool.m4’: No such file or directory
cp: cannot create regular file ‘m4/intltool.m4’: No such file or directory
intltoolize: cannot copy '/usr/share/aclocal/intltool.m4' to 'm4/intltool.m4'

The problem is that intltoolize requires te m4/ directory to be present,
and this directory is actually created by running autoreconf, so it
should be called before intltoolize.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:17:15 -02:00
Eduardo Lima (Etrunko)
fbce89dd7f Remove m4/.gitignore file
All .gitignore files are handled by git.mk and should not be part of the
repository.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2015-11-04 12:16:50 -02:00
Pavel Grunt
7870ea5eff session-spice: Disable extra displays in fullscreen mode
When running in fullscreen it is possible to end up in a situation
where we have more displays enabled than monitors. This can happen
if displays that were enabled in the previous connection to the guest
doesn't match displays requested when entering the fullscreen mode.

This commit solves the problem by disabling displays that should not be
enabled in the fullscreen mode.

Resolves: rhbz#1212802
2015-11-04 14:03:32 +01:00
Pavel Grunt
1f2ef0e9de app: Do not map display to non-existent monitor 2015-11-04 14:03:26 +01:00
Pavel Grunt
4d6f730fce app: Add helper for number of client monitors 2015-11-04 14:03:20 +01:00
Fabiano Fidêncio
96413a6266 util: Fix the size of sorted_displays allocation
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
2015-10-21 16:04:01 +02:00
Fabiano Fidêncio
73b55b3e1b session: Only create a hashtable if apply_monitor_geometry vfunc exists
Creating the monitors hashtable only after checking for the existence of
apply_monitor_geometry vfunc avoids leaking the hashtable in the case
where the vfunc doesn't exist.

Related: rhbz#1267184
2015-10-21 15:43:15 +02:00
Pavel Grunt
50f7d3dff8 app: Use display id instead of 'this' in debug 2015-10-21 08:09:21 +02:00
Christophe Fergeau
c1e72c1be1 Stop polling after reconnecting to libvirtd
When the connection to libvirtd is lost, virt-viewer starts polling for
libvirtd to come back. The polling mechanism is also used when
connecting to very old libvirtd which don't support
virConnectDomainEventDeregisterAny().

Currently, once we could reconnect to libvirtd, virt-viewer will keep
polling, thus behaving as if the libvirtd connection does not support
virConnectDomainEventDeregisterAny(). This commit makes sure we stop
polling once the new libvirtd connection is established.

This has the side-effect of preventing
https://bugzilla.redhat.com/show_bug.cgi?id=1271519 from occurring with
recent libvirt as it's caused by some race occurring when using the
polling code.
2015-10-20 10:20:23 +02:00
Jonathon Jongsma
aff6c79ae0 Use the display ID to configure fullscreen monitors
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
2015-10-09 09:17:52 -05:00
Jonathon Jongsma
6331757164 SessionSpice: make main-window a property
Make "main-window" a construct-only property of VirtViewerSessionSpice.
This allows us to set it in the constructor and encapsulate all of the
setup within the gobject constructor rather than doing extra work in the
_new() function.
2015-10-09 09:17:52 -05:00
Fabiano Fidêncio
69e29aca56 msi: use the correct id for remote-viewer.exe
As, in theory, file ids are stables, seems that we have been using the
wrong id for remote-viewer.exe (not sure if since forever or if the path
changed).
That's what msidump shows:

ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "fil808B4A5BAB4ACD727D3823632E798743" File.idt
ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "fil808B4A5BAB4ACD727D3823632E798743" Registry.idt
reg29E29C5608128A0192FB9DC3C18562A6 0
VirtViewer.vvfile\shell\open\command
"[#fil808B4A5BAB4ACD727D3823632E798743]" "%1"   CProgIds
ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "remote-viewer.exe" File.idt
fil610DF9E49759B1DEC646290195F96F8A cmp7677A8696936707272DCA43B1BF26760
remote-viewer.exe   855735          512 837

So, let's use the correct id (fil610DF9E49759B1DEC646290195F96F8A) from
now on.

Related: rhbz#1146016
2015-10-08 16:43:16 +02:00
Fabiano Fidêncio
097e1f6c51 msi: {virt,remote}-viewer depends on libxml2
Currently libxml2 is pulled as an indirect dependency when virt-viewer
is built with support to ovirt or libvirt (pulled by rest or libvirt,
respectively). However, {virt,remote}-viewer itself depends on libxml2
and not having it as an explicit dependency will cause errors on opening
remote-viewer when it is built without support to ovirt/libvirt.
2015-10-06 23:06:23 +02:00
Jonathon Jongsma
9c77a78af2 Add new functions to enable/disable a display
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.
2015-09-10 16:02:13 -05:00
Jonathon Jongsma
344eb9a685 Set enabled status of all displays when we get a monitor update
Previously, when we received a new monitors update from the server, we
only called virt_viewer_display_set_enabled() for the displays that were
enabled. We simply assumed that those that were not enabled were already
set to disabled. This assumption is currently valid, but I have some
changes in the pipeline where this is not true. This change ensures that
we update the enabled state of all monitors when we get an updated
monitors conifguration.
2015-09-08 15:14:35 -05:00
Jonathon Jongsma
6413b645ff Don't emit 'monitor-geometry-changed' for disabled displays
When a display widget receives a new size allocation, we generally emit
a monitor-geometry-changed signal so that we can reconfigure the
displays. But if the widget for a *disabled* display is allocated,
there's no reason to send down a new configuration. We don't need to
emit this signal. This doesn't currently cause any problems, but I ran
into issues while testing some other uncommitted changes.
2015-09-08 15:14:35 -05:00