1284 Commits

Author SHA1 Message Date
Fabiano Fidêncio
df403f5aba m4: Use -Wdeprecated-declarations
Let's enable deprecated-declarations warnings as we want to:
1) Avoid insert/maintain deprecated widgets/methods
2) Avoid adding widgets/methods that are too new, what could cause
problems like virt-viewer not being able to build in a specific distro.

Patches for making these two items possible are coming, introducing
_VERSION_MAX_ALLOWED for both GLIB and GDK and removing (as much as
possible) deprecated widgets/methods/structures.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:56:51 +01:00
Fabiano Fidêncio
2c712a0525 mingw: Bump msitools version
Since commit 5d98df3 we depend on msitools 0.95-2.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 08:27:08 +01:00
Fabiano Fidêncio
80ac4d5774 app: Don't leave a window opened in case of connection error
Since commit ed9b3f3 the main window is not hidden when disconnecting.
But it also is not hidden when a connection error occurs, leaving a
black display with a not so accurate message to the users in case they
try to connect to a non-valid address from the remote-viewer connection
window and in this case the main window (display #1) shuldn't be shown.

The impetus for this chance is the following:
- user runs remote-viewer without any argument
- the remote-viewer connection window shows up
- user attempts to connect to a non-valid address
- a dialog pops up indicating a failure connecting to the graphic server
- the main window shows up saying "Connecting to the graphic server"
- user clicks 'Ok'
- the main window stays there with the same message

As a user, I expect the program to not show the main window in
connecting failure cases. This patch accomplishes that.
2016-02-24 07:21:06 +01:00
Fabiano Fidêncio
5d98df3ef1 nsis: update nettle to 3.2.1
Use version 3.2.1, matching what currently is in f23.
2016-02-24 07:20:10 +01:00
Eduardo Lima (Etrunko)
76d2e483d5 Drop old compatibility code
With glib requirements now being 2.38, these functions do not make sense anymore.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
3270ce61af remote-viewer: Remove unused properties
The reason for using properties to access those members was to ensure
that they would only be set during the creation of the object. Now that
we removed that restriction, we set private members directly.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
a9ce19f848 Port to GtkApplication API's
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>
2016-02-18 21:45:56 +01:00
Uri Lublin
7a54b96dbe spice: vv-file: do not ignore usb-filter
Fixes rhbz#1309634

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-18 16:23:34 +01:00
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