Commit Graph

1633 Commits

Author SHA1 Message Date
Daniel P. Berrangé
eb9dffbbd9 src: set min gtk to 3.18 to match glib 2.48 vintage
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
6c6af77fdd src: remove setting of resize grip property
This API is deprecated since GTK 3.14 as the concept has been removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
496f99f5da src: remove deprecations squash for g_strv_contains
We rely on new enough glib version, so don't need to squash warnings.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Jakub Janků
5a55d43796 vnc-session: use g_signal_connect_object
If the VncDisplay emits a signal and the VirtViewerSessionVnc
instance is no longer valid, using the pointer inside one of the
callbacks can lead to segfault.

To prevent that, use g_signal_connect_object instead of
g_signal_connect.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1911224

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:25 +01:00
Jakub Janků
8bc91ac80f session: remove "session-error" signal
This partially reverts commit de5cd71.

Problem with that commit is, that it practically renders
the "session-auth-*" signals from vnc session useless.
That's because gtk-vnc currently emits "vnc-error" before each
"vnc-auth-*" signal and the error callback in virt-viewer-app.c
calls virt_viewer_app_disconnected(), which in turn closes
the session.
As a consequence, virt-viewer never retries authentication
with vnc, it simply exits.

Since the last commit, vnc, similarly to spice, emits
"session-disconnected" with the appropriate error message. Thus
there's no need to maintain separate "session-error" signal
for now.

With vnc, this error message is shown to the user in a dialog,
if the disconnect happened during the init phase.
"session-auth-*" callbacks create their own dialogs, so
initialized must be set to TRUE to avoid having a dialog
displayed twice.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1911224

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:22 +01:00
Jakub Janků
11ec065ce2 vnc-session: save message from "vnc-error" for "vnc-disconnected"
"vnc-error" is always followed by "vnc-disconnected".
So save the error message and use it in "vnc-disconnected" callback.

"session-disconnected" already allows us to set a string
with details on why the disconnection happened.

This approach is also similar to the one in spice session
(GError is saved in virt_viewer_session_spice_channel_destroyed).

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:16:29 +01:00
Daniel P. Berrangé
942fc8c6fb src: remove G_BEGIN_DECLS / G_END_DECLS
None of our header files are installed for public use, so these macros
are not required.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
3ae426e926 src: switch to using "#pragma once" for headers
We can rely on GCC/CLang and thus use this more concise approach

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
25092c2122 src: centralize the editor indentation rules
Instead of repeating an emacs footer in every source file, use config
files in the root of the repository. This fixes the bug that several
source files are missing the indent rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
396f31cb4b tests: convert VirtViewerTest to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
aa8bb67972 src: convert OvirtForeignMenu to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
622d5c2e3e src: convert RemoteViewerISOListDialog to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
06b57ee1fe src: convert RemoteViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
5c8c6db41b src: convert VirtViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
080a6fefe2 src: convert VirtViewerFileTransferDialog to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
58a8e71404 src: convert VirtViewerTimedRevealer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
18322a9551 src: convert VirtViewerNotebook to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
4973411ed8 src: convert VirtViewerSessionVnc to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
1985713f78 src: convert VirtViewerSessionSpice to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
96c24fd9db src: convert VirtViewerSession to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
025fbb2470 src: convert VirtViewerFile to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
e382c931fd src: convert VirtViewerApp to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
99f6cd7f87 src: convert VirtViewerDisplayVnc to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
45b03df8b8 src: convert VirtViewerDisplaySpice to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
8519b2f737 src: convert VirtViewerDisplayVte to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
4e4bd0d67f src: convert VirtViewerDisplay to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
10b2850d70 src: convert VirtViewerWindow to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
7a71409028 build: bump min required glib to 2.48
All our targetted distros have this vintage glib letting us remove some
compat code, and introduce future use of new features.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
b5cf22481f build: fix formatting of build id parameter for wxs file
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
5400e86e4d rpm: fix passing of build-id parameter
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
253a14f754 build-aux: fix typo in ovirt conditional for MSI build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Daniel P. Berrangé
16a3d08d09 build: fix version in meson
The next version we're working on is going to be 10.0, not 3.0

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-15 00:12:34 +00:00
Shawn M. Chapla
bda6dbbecf Don't double attach accels on enable window mods
Check whether accels are currently attached to a window before attaching
them when enabling window modifiers.

This commit fixes an assert in _gtk_accel_group_attach introduced by
cfcac9fb, which erroneously assumed that is harmless to re-add accel
groups that have already been added to a window.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
2021-02-14 14:51:06 -05:00
玉堂白鹤
70b90370e2 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/zh_CN/

Signed-off-by: 玉堂白鹤 <yjwork@qq.com>
2021-02-05 14:40:12 +01:00
Daniel P. Berrangé
1f814df294 build: remove all traces of autotools build recipes
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
8eb7ff6688 gitlab: don't block container / build jobs on DCO check
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
f03e009eb7 gitlab: convert CI to use meson instead of autotools
A new 'codestyle' job is added for syntax-check, since that is not run
as part of the 'dist' target.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
ef2a679d69 build: convert release script over to use meson
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
1f701aae66 rpm: convert the RPM builds over to using meson
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
b2c072cf0b build: introduce meson build recipes
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-25 16:02:48 +00:00
Daniel P. Berrangé
f21cb3d233 icons: install svg files into the "scalable" directory
The USB SVG was mistakenly installed into a size specific dir, while the
main logo was not installed at all.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
3a57d746a6 src: ensure all spice channel types have enum cases
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
eb3641f347 src: simplify some conditionals related to features lacking on Windows
This avoids the need to probe for them prior to build.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
c78adca86f src: mark argc/argv unused in windows command line wrapper
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
0fdd3ed563 src: avoid warning about strncpy without trailing NUL
We know that the destination will already have a trailing NUL after the
three characters we're copying. The compiler can't see this though and
warns about lack of NUL termination.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
f6007cfad1 src: enable more format string validation at build time
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
24bf4c998d src: switch to use G_GNUC_FALLTHROUGH macros
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
45dd26ece2 src: add missing COMMON_CFLAGS to libvirt_viewer_util.la
This ensures that G_LOG_DOMAIN is used in all places, and in turns
highlights a bug in the test suite.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
0dab000823 src: remove use of 'volatile' from enum type decl
This avoids warnings with latest glib/gcc

src/virt-viewer-enums.c: In function ‘virt_viewer_display_show_hint_flags_get_type’:
/usr/include/glib-2.0/glib/gatomic.h:112:5: error: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Werror=incompatible-pointer-types]
  112 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
src/virt-viewer-enums.c:34:7: note: in expansion of macro ‘g_once_init_enter’
   34 |   if (g_once_init_enter (&g_define_type_id__volatile))
      |       ^~~~~~~~~~~~~~~~~

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00
Daniel P. Berrangé
041857e677 tests: ensure compiler knows the argv[0] is non-NULL
../tests/redirect-test.c
/usr/i686-w64-mingw32/sys-root/mingw/include/winbase.h: In function 'WinMain':
../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=]
  318 |     fprintf(log_f, "argc %d argv[0] %s \n", argc, argv[0]);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../tests/redirect-test.c:318:5: error: '%s' directive argument is null [-Werror=format-overflow=]

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-22 16:14:40 +00:00