Commit Graph

36 Commits

Author SHA1 Message Date
John Citizen
218045dc42 spicy: add command line option to hide menu bar
Signed-off-by: WebOfNakedFancies <arshuni@gmx.com>
2023-02-15 18:54:59 +01:00
Joel Rangsmo
9992bdb921
spicy: Add keyboard shortcuts for copy/paste sync
This simple change adds keyboard shortcuts for manual synchronization of
copy/paste buffers. These come in handy when automatic clipboard sharing
is disabled, which may be desirable to prevent a semi-trusted server
from reading sensitive data populated by password managers and similar.

Shift+F5/F6 ain't the most comfortable shortcuts, but it sticks with the
current theme.
2022-07-06 22:17:48 +00:00
Jakub Janků
5f65dccb1a spicy: destroy all windows on disconnection
SpiceWidget holds a strong reference on the SpiceSession.
If the windows are not destroyed, the session isn't freed either.

session_disconnect() does destroy all the channels, but other
objects aren't released until the session's dispose
(audio manager, usb manager, webdav).

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-19 12:37:52 +01:00
Jakub Janků
09580733f3 spicy-connect: unref GMainLoop
Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-17 15:07:47 +01:00
Marc-André Lureau
ae55e75590 spicy: use the scale factor to get the display preferred dimension
Since commit b30598293b ("spice-widget:
fix widget size request on HiDPI when scaling is disabled"), the
widget requested size is divided by the scale factor.

Multiply it back to get the guest display size (a more precise version
would retrive the associated channel and get the "width" and "height"
property from it)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-12-01 16:53:58 +04:00
Marc-André Lureau
b0651e424a Revert "spice-widget: add an API to get guest display size"
This reverts commit 18dfbb9e79.

The motivation behind the new API isn't clear enough.

The guest display size can be retrieved through the "width" and "height"
properties of the associated display channel.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-12-01 16:40:30 +04:00
Haochen Tong
18dfbb9e79 spice-widget: add an API to get guest display size
Signed-off-by: Haochen Tong <i@hexchain.org>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-08-19 10:46:14 +01:00
Frediano Ziglio
b8f2255904 spicy: Do not call gst_init directly
GStreamer is already initialized using gst_init_get_option_group and
gst_init_get_option_group.

From gst_init documentation:
   WARNING: This function does not work in the same way as
   corresponding functions in other glib-style libraries,
   such as gtk_init(). In particular, unknown command line options
   cause this function to abort program execution.

This luckily is not true (program won't abort if you pass --gst-foo
for instance) but better to stick to documentation.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-09-23 16:13:59 +01:00
Kevin Pouget
71511c376d spicy: send ordered list of preferred video codecs
Instead of sending only the preferred video codec (selected), spicy
now sends an ordered list. When a video codec is selected in the radio
box, this codec is moved to beginning of the list.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
2019-07-11 11:01:47 +02:00
Marc-André Lureau
9837f974cc Drop autotools
Maintaining 1 build system is hard. Maintaining 2 is even harder.

It seems the meson build system is now in good shape to replace
autotools. Like many desktop projects, let's move entirely to meson
and drop autotools support.

Known changes:
- generating changelog files in the dist tarball. This is not strictly
  required, and can be added back later.
- generated files are not included in the dist tarball. In some ways,
  this can be considered a good thing.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-07-09 11:05:29 +01:00
Marc-André Lureau
61d87779eb spicy-screenshot: use G_BIG_ENDIAN
WORDS_BIGENDIAN is defined by autoconf macro.
meson doesn't define it. Let's use the GLib defines instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-01-17 12:36:33 +04:00
Marc-André Lureau
6a23198951 spicy: use SpiceSession::disconnected signal
Let's not track channels ourself, but rely on the disconnected signal
instead.

This solves spicy hanging, when gstaudio is recording and the main
loop is gone, so record channel is not finalized, and GStreamer
locks.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-01-14 14:33:49 +04:00
Marc-André Lureau
ac0e50f5e2 build-sys: drop gstaudio option, make GStreamer a requirement
GStreamer is being increasingly used by spice-gtk. Let's make it a
core requirement.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-01-14 14:28:20 +04:00
Marc-André Lureau
c01599b5d2 build-sys: drop support for libcacard < 2.5.1
v2.5.1 was released the 2015-11-24.

According to repology, from the distro we care about, CentOS 6,
openSUSE Leap 42.3 have too old version (0.1.2).

SPICE_CHECK_SMARTCARD is updated with spice-common.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-01-08 15:43:21 +04:00
Frediano Ziglio
ae2422d796 spicy-screenshot: Make some variables static
Not used outside this module.
Also update indentation.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2018-12-20 08:29:06 +00:00
Frediano Ziglio
e64b221a3e spicy-screenshot: Returns success only if image is grabbed
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2018-12-20 08:29:03 +00:00
Frediano Ziglio
dfd4c48531 spicy-screenshot: Open output file as binary
On Windows this prevents LFs to be written as CR+LF.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2018-12-20 08:28:59 +00:00
Frediano Ziglio
075439576d spicy-screenshot: Fix indentation
Replace tabs with spaces

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2018-12-20 08:28:46 +00:00
Eduardo Lima (Etrunko)
7a87356bd2 Add support for building with meson/ninja
In a comparison with current autotools build system, meson/ninja
provides a huge improvement in build speed, while keeping the same
functionalities currently available and being considered more user
friendly.

The new system coexists within the same repository with the current one,
so we can do more extensive testing of its functionality before deciding
if the old system can be removed, or for some reason, has to stay for
good.

- Meson: https://mesonbuild.com

  This is the equivalent of autogen/configure step in autotools. It
  generates the files that will be used by ninja to actually build the
  source code.

  The project has received lots of traction recently, with many GNOME
  projects willing to move to this new build system. The following wiki
  page has more details of the status of the many projects being ported:

    https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting

  Meson has a python-like syntax, easy to read, and the documentation
  on the project is very complete, with a dedicated page on how to port
  from autotools, explaining how most common use cases can be
  implemented using meson.

    http://mesonbuild.com/Porting-from-autotools.html

  Other important sources of information:

    http://mesonbuild.com/howtox.html
    http://mesonbuild.com/Syntax.html
    http://mesonbuild.com/Reference-manual.html

- Ninja: https://ninja-build.org

  Ninja is the equivalent of make in an autotools setup, which actually
  builds the source code. It has being used by large and complex
  projects such as Google Chrome, Android and LLVM. There is not much to
  say about ninja (other than it is much faster than make) because we
  won't interact directly with it as much, as meson does the middle man
  job here. The reasoning for creating ninja in the first place is
  explained on the following post:

    http://neugierig.org/software/chromium/notes/2011/02/ninja.html

  Also its manual provides more in-depth information about the design
  principles:

    https://ninja-build.org/manual.html

- Basic workflow:

  Meson package is available for most if not all distros, so, taking
  Fedora as an example, we only need to run:

    # dnf -y install meson ninja-build.

  With Meson, building in-tree is not possible at all, so we need to
  pass a directory as argument to meson where we want the build to be
  done. This has the advantage of creating builds with different options
  under the same parent directory, e.g.:

    $ meson ./build --prefix=/usr
    $ meson ./build-extra -Dextra-checks=true -Dalignment-checks=true

  After configuration is done, we call ninja to actually do the build.

    $ ninja -C ./build
    $ ninja -C ./build install

  Ninja defaults to parallel builds, and this can be changed with the -j
  flag.

    $ ninja -j 10 -C ./build

- Hacking:

  * meson.build: Mandatory for the project root and usually found under
                 each directory you want something to be built.

  * meson_options.txt: Options that can interfere with the result of the
                       build.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-08-30 11:13:00 -03:00
Victor Toso
741ef98fe9 Remove simicolon from G_DEFINE_TYPE_ macros
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-08-02 15:53:01 +02:00
Christophe de Dinechin
0381e62141 spicy: Add call of gst_deinit at program exit
This is useful for some instrumentation, e.g. the leaks tracer,
that perform some of their operations within gst_deinit.

Without this patch, if you run spicy with
	GST_DEBUG="GST_TRACER:7" GST_TRACERS="leaks" spicy ...
the leak tracer does not show any output, because it runs in gst_deinit.

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-10-20 16:17:20 +01:00
Matthew Francis
284c1f2d7e MainChannel: Fix introspection method bindings
Signed-off-by: Matthew Francis <mjay.francis@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1505831641-28134-6-git-send-email-mjay.francis@gmail.com>
2017-09-25 12:36:02 +02:00
Matthew Francis
d593569f21 DisplayChannel: Fix introspection method bindings
Signed-off-by: Matthew Francis <mjay.francis@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1505831641-28134-3-git-send-email-mjay.francis@gmail.com>
2017-09-25 12:35:48 +02:00
Matthew Francis
00c4ab5eb6 PortChannel: Fix introspection method bindings
Signed-off-by: Matthew Francis <mjay.francis@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1505831641-28134-2-git-send-email-mjay.francis@gmail.com>
2017-09-25 12:35:40 +02:00
Marc-André Lureau
fdba1a9bc5 Use g_free() appropriately
g_free() should be used in pair with g_malloc/new().

There is only free() calls remaining for usbredir rules now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-08-10 15:32:13 +02:00
Victor Toso
a3dd27e0ef spicy: add gstreamer options to command line
So we can see all available options with spicy --help-gst and set them
as command line argument.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-23 15:36:53 +02:00
Victor Toso
a12a815127 Revert "spicy: improve status label with stream information"
This reverts commit 9a7ae78aa9.

As we are going to revert 00f56647a9 "channel-display: new
stream-video-codec-type property"

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Marc-André Lureau <mlureau@redhat.com>
2017-03-13 13:33:27 +01:00
Victor Toso
9a7ae78aa9 spicy: improve status label with stream information
By using stream-video-codec-type property, we can display which
video-codec is being used.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-13 11:33:34 +01:00
Victor Toso
d4fb0faf1b spicy: keep status of mouse/agent on server mode
So we can still check the agent status even in server mode.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-13 11:33:29 +01:00
Victor Toso
ecb4de2705 spicy: use gboolean for GtkSettings properties
As gboolean is 4 bytes long while bool is 1 byte, valgrind will complain
about it.

Invalid write of size 4
   at 0xAE9F4FB: value_lcopy_boolean (gvaluetypes.c:78)
   by 0xAE7CFD3: g_object_get_valist (gobject.c:2236)
   by 0xAE7D40B: g_object_get (gobject.c:2324)
   by 0x40758F: keyboard_grab_cb (spicy.c:566)
   by 0xAE753E4: g_closure_invoke (gclosure.c:804)
   by 0xAE87431: signal_emit_unlocked_R (gsignal.c:3635)
   by 0xAE9005E: g_signal_emit_valist (gsignal.c:3391)
   by 0xAE9043E: g_signal_emit (gsignal.c:3447)
   by 0x4E4A6FB: try_keyboard_grab (spice-widget.c:889)
   by 0x4E4CAB1: focus_in_event (spice-widget.c:1834)
   by 0x9325E70: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:131)
   by 0xAE75561: _g_closure_invoke_va (gclosure.c:867)

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-06 17:12:15 +01:00
Pavel Grunt
9c133dcde4 spicy: Add dialog for precise resizing
It helps when testing whether the guest resizes to requested resolution

Acked-by: Victor Toso <victortoso@redhat.com>
2017-03-06 09:49:30 +01:00
Francois Gouget
fa73ff2783 spicy: Spicy uses GTK+ and must link with it
This avoids having the linker complain that gtk_toggle_action_get_type()
or some other GTK+ API is undefined.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-27 09:33:41 +01:00
Francois Gouget
0c6a871b08 spicy-stats: spicy-stats uses libgobject so link with it
This avoids having the linker complain that g_signal_connect_data() or
some other GObject API is undefined.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-27 09:33:41 +01:00
Jonathon Jongsma
4d3e78993c Spicy: cancel file transfer when dialog is closed
Clicking the 'X' to close the file transfer dialog did not actually
cancel the ongoing file transfer, and resulted in a bunch of critical
warnings on the terminal. Make the delete-event explicitly cancel all
ongoing file transfers.
2017-02-08 09:25:51 -06:00
Victor Toso
44f195206f spicy: implement preferred video codec type
Similar to preferred video compression, a radio button showing mjpeg,
vp8, vp9 and h264 in case server has the proper [0] capability

[0] SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-02-08 11:46:20 +01:00
Victor Toso
47e37e7c9d Move spicy tools to its own folder
So we can have the tools and the libraries in different folders.

In the src/Makefile.am I've only removed the lines related to the
tools but not all lines were copied into tools/Makefile.am as we
don't really need them. Other lines were adjusted to have the paths
correctly;

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-01-23 09:30:47 +01:00