Commit Graph

400 Commits

Author SHA1 Message Date
Frediano Ziglio
9c573c9754 Execute tests for MSYS2 build
Avoid to run executables using Wine if system is not Linux.
Use relative paths for executables as bash otherwise won't find them.
Make build.sh script fail on intermediate errors.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2025-03-04 11:07:31 +00:00
Akihiko Odaki
f095b40ee7 CI: Build with MSYS2 on AppVeyor
MSYS2 is an alternative build environment.

MSYS2 has the following advantage compared to Microsoft Visual C++
that is already employed on AppVeyor:
- MSYS2 can pack MSI using autotools

MSYS2 has the following disadvantages compared to Microsoft Visual C++:
- MSYS2 cannot run tests because the autotools scripts currently require
  Wine.
- MSYS2 no longer supports UCRT on the 32-bit platform.

MSYS2 has the following advantages compared to Fedora that is already
employed on GitLab CI:
- The build completely fails on Fedora because libpng tries to link
  the __intrinsic_setjmpex function, which is not available.
- MSYS2 can employ UCRT instead of MSVCRT. For details of UCRT and
  MSVCRT, see: https://www.msys2.org/docs/environments/#msvcrt-vs-ucrt
  Fedora

MSYS2 has the following disadvantage compared to Fedora:
- MSYS2 cannot run tests.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-03-04 14:13:18 +09:00
Akihiko Odaki
966e492225 Fix a syntax error in test-png
Frediano Ziglio pointed out I introduced a syntax error with commit
34787ba0b7.

The syntax error made the test ineffective so it always passed. Fix
it to make it functional again.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-03-03 13:42:38 +09:00
Akihiko Odaki
34787ba0b7 Fix test-png compatibility with ImageMagick
ImageMagick uses the format "%.*g (%.*g)" since 7.1.1-44:
d85a7583f9

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-02-28 20:24:39 +09:00
Benjamin Höglinger-Stelzer
d7405ee085 Fixed issue with multiple GPUs causing mouse to not work (see https://www.spinics.net/lists/spice-devel/msg42936.html) 2024-08-30 01:07:55 +02:00
Frediano Ziglio
5017510709 Add support for additional buttons (side and extra)
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-11-08 08:00:45 +00:00
Frediano Ziglio
2c5e197fba ci: Fix autoconf AX_CXX_COMPILE_STDCXX_11 missing macro
This fixes the issue during CI build:

  ./configure: line 5219: AX_CXX_COMPILE_STDCXX_11: command not found

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-16 17:43:13 +01:00
Frediano Ziglio
fbcbd9a10c Remove warning compiling
Remove an alignment warning

vdagent/vdagent.cpp: In member function 'bool VDAgent::handle_announce_capabilities(const VDAgentAnnounceCapabilities*, uint32_t)':
vdagent/vdagent.cpp:1048:48: warning: taking address of packed member of 'VDAgentAnnounceCapabilities' may result in an unaligned pointer value [-Waddress-of-packed-member]
 1048 |     _client_caps.assign(announce_capabilities->caps, announce_capabilities->caps + caps_size);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~^~~~

Not a real issue, just annoying.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-16 10:23:24 +01:00
Frediano Ziglio
ccb53f5dfe CI: Use different image to avoid vcpkg update
vcpkg update is time consuming, just use a more recent version.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-15 14:01:37 +01:00
Frediano Ziglio
e9d487c75b Do not force library prefix for MSVC
Do not use Unix suffix under MSVC (for MingW is fine, not for
Microsoft standards where .lib is used).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-15 14:01:37 +01:00
Frediano Ziglio
c84f9942d7 Better error reporting if zlib or libpng are not static
Tell the specific library which is not static.
Previously any would be reported as libpng.

This fixes https://gitlab.freedesktop.org/spice/win32/vd_agent/-/issues/17

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
2021-01-20 06:45:59 +00:00
Frediano Ziglio
a737a2b6f6 Use a different Chocolatey tool for ImageMagick
imagemagick.tool is currently broken, use imagemagick.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-11-04 12:55:04 +00:00
Frediano Ziglio
b845051dbb Update spice-common submodule
This brings in the following changes:

Frediano Ziglio (4):
      build: Do not use mingw_ninja_install macro in spec file
      Release 0.14.3
      build-sys: post-release version bump to 0.14.4
      protocol: Fix enumeration deprecation for Visual Studio

Marc-André Lureau (1):
      vdagent: add a MonitorsMM field to VDAgentMonitorsConfig

SimonP (1):
      protocol: Add support for side mouse buttons

This update allow to fix an issue with Microsoft compiler.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-11-04 12:55:04 +00:00
Frediano Ziglio
d61abf6106 Enable some security options on output executables
Enable NX (prevent data to be executable) and ASLR (address
randomisation).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-10-25 19:18:36 +00:00
Jakub Janků
630da73bf8 clipboard: enable copying files from client using webdav
When the user wants to copy files, new spice-gtk can share those
files using the existing phodav server. In that case, it advertises
the VD_AGENT_CLIPBOARD_FILE_LIST type in the clipboard grab message.

Upon request of the clipboard data in the mentioned type, spice-gtk
provides a list of absolute paths in the phodav server - these are
the files that are supposed to be copied/moved.

The role of the vdagent is to adjust this data given the drive
letter of the mapped webdav share.

Files can be both copied and moved, although move was tested
only with Windows' File Explorer.

Copying files from the vdagnet side to the client is not
supported yet.

Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-31 12:48:28 +01:00
Frediano Ziglio
6fea9f59a7 desktop_layout: Update container iteration syntax
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
2020-07-03 16:51:03 +01:00
Frediano Ziglio
ab6a4a0e18 Move set_display_depth from VDAgent to DesktopLayout
The function only change DesktopLayout.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
2020-07-03 16:51:02 +01:00
Frediano Ziglio
645aadd34d Minor style update
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
2020-07-03 16:50:56 +01:00
Frediano Ziglio
65e8edcf97 desktop_layout: Ignore Citrix Workspace displays
Citrix Workspace add 8 additional displays for off-line usage.
Ignore them like for mirrored displays.

This fixes https://gitlab.freedesktop.org/spice/win32/vd_agent/-/issues/8.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
2020-06-15 12:23:54 +01:00
Frediano Ziglio
c76999df28 desktop_layout: Factor out a function to enumerate displays
Reduce code duplication, the enumeration happens 3 times.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
2020-06-15 12:23:48 +01:00
Frediano Ziglio
d8d23f36a2 display_configuration: Update log strings
For other strings resolution is reported as "WxH", no spaces
around "x".

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-05-29 11:22:50 +01:00
Frediano Ziglio
2d6bcd9181 file_xfer: Return detailed error for invalid filename
A literal constant is used for error type as the project is not
dependent on glib2 and that Visual Studio and CMake are supported
so it would make the compilation on some environment more complicated
than actually is just for a constant.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-05-25 15:29:49 +01:00
Frediano Ziglio
d9aeb42bce desktop_layout: Use MutexLocker for lock/unlock
Reduce code and avoids to forget to unlock() in the future.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-05-22 19:34:00 +01:00
Frediano Ziglio
fa2e3371c8 vdagent: Reset properly state of pending large messages upon disconnection
If the client closes the connection while having pending large messages
(split into multiple chunks) the state is not correctly reset causing
next client messages to be not correctly handled.

This can occur for instance if the client is closed (or killed) while
transferring a large file.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1548419.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-05-15 15:22:52 +01:00
Frediano Ziglio
0fe97cc05a Use final capabilities to check client messages
The client is sending messages that are compatible with agent
capabilities but also encoded with capabilities it knows of so to
check them we need to consider final capabilities, not client ones.

This fixes a regression introduced with
"vdagent: Reuse agent_check_message" where some messages were wrongly
interpreted as wrong (particularly some clipboard messages).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
2020-05-15 11:50:08 +01:00
Frediano Ziglio
f2ef1094f2 cmake: Force static libraries
Add some settings to both MingW and MSVC to more strongly force
static libraries linking.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-04-28 18:17:47 +01:00
Frediano Ziglio
721cd5a1ef ci: Use magick.exe executable under Windows
On Windows beside the various single executables like Linux there's
a single "magick" executable you can use specifying what you want
to do.
Having a single executable avoids the trick to fix "convert" problem
and is easier to port, you just have to copy the single executable.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-04-28 17:14:04 +01:00
Frediano Ziglio
9de1492446 vdagent: Reuse agent_check_message
That function does also more checks on the message.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
2020-04-28 16:50:13 +01:00
Frediano Ziglio
dd05463f9b Use SPICE_N_ELEMENTS instead of a constant for file_path size
Allows to easily change the size if needed

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-24 11:22:37 +01:00
Frediano Ziglio
b4776f4291 file_xfer: Return detailed error for no space
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-24 10:33:34 +01:00
Frediano Ziglio
ab3353b579 vdagent: Return better error if locked
Use specific VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED error.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-24 10:33:34 +01:00
Frediano Ziglio
a914784295 vdagent: Allow to return detailed message for file transfer
Reuse AgentFileXferStatusMessageFull and agent_prepare_filexfer_status

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-24 10:33:34 +01:00
Frediano Ziglio
3cad1e7570 Compile in agent utilities from spice-common
Allows these utilities to be used in the code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-24 10:33:34 +01:00
Frediano Ziglio
5ed23e95ec spice-protocol: Update to get new message definitions
The EXTRA_DIST part in Makefile.am is needed as spice-protocol
removed support for Autoconf.
We don't need anymore "ignore=untracked" in the submodule as
we are not going to add or modify files anymore.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-01 12:30:38 +01:00
Frediano Ziglio
cf5a336d9b ci: Use a single job
Reduce CI resource usage using a single job instead of 2.
The project is pretty small and the setup of the 2 jobs is pretty
long compared to the build so using a single job (we used the same
container image for both) reduce CI resource usage.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-04-01 10:25:25 +01:00
Frediano Ziglio
0d0df5681b ci: Fix repositories updates
Force sync and update of all git submodules.
Do not install packaged spice-protocol, we are using submodule.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-04-01 10:25:20 +01:00
Frediano Ziglio
5988f86a75 Revert 3 last patches
Revert "try to remove other bugs", commit
57266085b9.
Revert "try to fix previous", commit
8e40377068.
Revert "attempt to fix more warnings!", commit
66b6933a38.

I put by mistake on the MR due to some automatic scripts.
Their state are pretty experimental.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-30 15:11:22 +01:00
Frediano Ziglio
57266085b9 try to remove other bugs 2020-03-23 14:13:48 +00:00
Frediano Ziglio
8e40377068 try to fix previous 2020-03-23 13:57:06 +00:00
Frediano Ziglio
66b6933a38 attempt to fix more warnings! 2020-03-23 13:38:40 +00:00
Frediano Ziglio
c8fd498b7f display_setting: Remove a warning
Avoids:

warning C4267: 'initializing': conversion from 'size_t' to 'DWORD', possible loss of data

Value won't never be that huge to cause overflow (we are reading a string
in a static buffer, we don't expect an encyclopedia).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-23 12:36:59 +00:00
Frediano Ziglio
f920c23e2e file_xfer: Remove a warning
Avoids:

warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-23 12:36:55 +00:00
Frediano Ziglio
f00eb1f7b3 build: Add missing file to distribution
test-shell script is needed for "make check".

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-03-19 16:48:29 +00:00
Uri Lublin
383e88cadb spec file: add msi installers
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-19 16:41:21 +00:00
Uri Lublin
07f4992d59 Ignore spice-protocol untracked files
This will help with making a release.

spice-protocol's .gitignore is generated and not committed,
so after running ./autogen.sh (autoreconf) git thinks
spice-protocol is dirty (just because of generated files).

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-19 16:41:21 +00:00
Uri Lublin
3dfcc04435 MSI: Make SourceDir the path to executables
Make it possible to not put the executables under bin/

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-19 16:41:21 +00:00
Uri Lublin
638a49aafe MSI: Package: only allow perMachine installation
When building on Windows with Wix, also add Platform to Package
as follows (wixl warns about it):

   Platform="$(var.Arch)"

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-19 16:39:46 +00:00
Frediano Ziglio
0ad43eed50 Constification, does not make sense to change the messages processing them
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-01-10 12:56:25 +00:00
Frediano Ziglio
e03d347850 build: Remove unneeded library from linking
GetFileVersion* functions are not used.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-12-16 10:22:13 +00:00
Frediano Ziglio
125387b286 build: Install binaries in CMake
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-12-16 08:29:02 +00:00