Commit Graph

387 Commits

Author SHA1 Message Date
Christophe Fergeau
9535546e3b gtk: fix "set but not used" gcc 4.6 warnings
Since we are compiling with -Werror, this was breaking compilation.
2011-04-11 11:30:49 +02:00
Alon Levy
a8adff78c1 python_modules/codegen.py: fix indent error in an unused function 2011-04-11 11:07:32 +02:00
Alon Levy
57d8b3fa4f demarshaller/marshaller fix gcc 4.6.0
python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
warning about set but unused variables. The fixes disable creating
of variables mem_size when they are not used (demarshall) and
declaring a src variable when the message doesn't use it (marshal).

You need to touch *.proto after applying this (should add a Makefile
dependency).
2011-04-11 11:07:32 +02:00
Alon Levy
d63d274fde codegen: avoid creating out if not used (fix gcc 4.6.0 warning) 2011-04-11 11:07:32 +02:00
Alon Levy
9cba559dc3 mingw32 build: python_modules/marshal: use unsigned for for_loop index variable 2011-04-11 11:07:32 +02:00
Marc-André Lureau
bf9a6d8432 gtk/spicy: do not show again toolbar when going full-screen, if mark received 2011-04-10 17:03:21 +02:00
Marc-André Lureau
b6470a7168 gtk: calling connect() on a connecting channel is fine
This avoid problems where different display shares the same input
channel and try to connect two times.
2011-04-10 03:15:42 +02:00
Marc-André Lureau
ba4d885d6a gtk: allow to drag-and-drop between displays / windows 2011-04-10 02:40:43 +02:00
Marc-André Lureau
0d37f141a1 gtk/controller: install spice-controller library 2011-04-10 00:46:52 +02:00
Marc-André Lureau
a7be61afff common: fix build error of used uninitialized
CC     sw_canvas.lo
cc1: warnings being treated as errors
../common/sw_canvas.c: In function 'canvas_draw_text':
../common/sw_canvas.c:1037:16: error: 'pos.x' may be used uninitialized in this function
../common/sw_canvas.c:1037:16: error: 'pos.y' may be used uninitialized in this function
make[4]: *** [sw_canvas.lo] Error 1
2011-04-09 17:38:06 +02:00
Marc-André Lureau
ac9d6ae262 TODO: update 2011-04-08 16:44:24 +02:00
Marc-André Lureau
028e38da8a build: fix gtk/controller/Makefile valac line which had custom.vapi 2011-04-08 16:40:02 +02:00
Marc-André Lureau
7a28bd1b71 Merge commit 'refs/merge-requests/5' of git://gitorious.org/spice-gtk/spice-gtk into merge-requests/5 2011-04-08 16:06:17 +02:00
Marc-André Lureau
2fcd74bbe8 gtk: don't send MonitorConfig after agent start
We don't know yet what will be the guest previous configuration.

Ie, what should we send otherwise? Current hardware configuration?
This works badly with windowed mode, where we expect the same windows
to be displayed on reconnection.
2011-04-08 15:56:12 +02:00
Marc-André Lureau
5b6513e99f gtk: introduce more complete spice_main_send_monitor_config()
Since it's unclear yet how MonitorConfig should be used depending on
use case (full-screen vs windowed) we prefer to make a public api so
that the client implementation can send it when it is the most
appropriate time.
2011-04-08 15:53:41 +02:00
Marc-André Lureau
6840841f20 gtk: add disable-display-position 2011-04-08 13:31:02 +02:00
Marc-André Lureau
0eb90ab119 gtk: remove unnecessary invalidate mark signal 2011-04-08 13:30:00 +02:00
Marc-André Lureau
a968d12742 gtk: send FALSE mark when destroying the primary surface after 1s...
This is similar to what is done in spicec.
2011-04-08 13:30:00 +02:00
Marc-André Lureau
363cdfdaad gtk: hide the cursor after setting it
So that when we move the cursor again, we can show the right one
2011-04-08 13:29:59 +02:00
Marc-André Lureau
27a64d3149 gtk/spicy: hide the display if mark is FALSE 2011-04-08 13:29:59 +02:00
Marc-André Lureau
eb16fc2f69 gtk/spicy: update status of all windows 2011-04-08 13:29:59 +02:00
Marc-André Lureau
33a8beb089 gtk/spicy: only show window when we receive the mark 2011-04-08 13:29:59 +02:00
Marc-André Lureau
30c7b085d0 gtk: not having a window is not critical, if the widget is not yet shown 2011-04-08 13:29:59 +02:00
Hans de Goede
c354b0a234 gtk: fixup clipboard_by_guest tracking
clipboard_by_guest tracking was used more or less for 2 things, to keep track
if the agent has clipboard data ready to send, and to see if we have done a
clipboard_set_with_data on behalf of the guest agent.

This patch splits the tracking of the 2, fixing several issues:
1) spice_display_paste_from_guest would not work if since receiving
   the grab from the agent some other app has copied something to
   the client clipboard.
2) We would do a clipboard_clear unconditionally even if we were
   not the clipboard owner in the client (iow some other app has
   done a clipboard_set_with_data since out last one).

This patch changes the meaning of the clipboard_by_guest boolean to just
track if we've done a clipboard_set_with_data on behalf of the guest
and are the last one to have a done a clipboard_set_with_data (iow we are the
client os' clipboard owner). It adds a checks to clipboard_release to
only call clipboard_clear if we are the current ownerm fixing 1).

This patch uses nclip_targets to keep track of the agent having data
available which we could paste, fixing 2).
2011-04-08 13:29:59 +02:00
Hans de Goede
288f843568 gtk: Clear hasdata when we do a clipboard_set_with_data
When we call gtk_clipboard_set_with_data to set the client clipboard
to the targets reported as available by the agent, the clipboard no
longer has data in the sense that it has data which is interesting
for spice_display_copy_to_guest, so clear clip_hasdata whenever we
call gtk_clipboard_set_with_data,
2011-04-08 13:29:59 +02:00
Hans de Goede
2bed1666a2 gtk: receiving a grab from the agent implies releasing our own
By setting d->clip_grabbed[selection] to FALSE when we receive a grab from
the agent, we can remove the weird "if (!d->clipboard_by_guest[selection])"
check from clipboard_owner_change, and we fix spice_display_copy_to_guest not
working in the following case:
1) autoclipboard share disabled
2) Copy something to the clipboard in the client
3) Send it to the guest by calling spice_display_copy_to_guest
4) Copy something to the clipboard in the guest
5) Tried to send the client clipboard to the guest again by calling
   spice_display_copy_to_guest (again).

5) would not work because d->clip_grabbed[selection] would still be true in
spice-gtk's view, where as the agent no longer sees the clipboard as grabbed
by the client since it send a grab itself.
2011-04-08 13:29:59 +02:00
Hans de Goede
38f8fab508 gtk: use a separate var to keep track of self caused new clipboard owner events
Also change 0/1 to FALSE/TRUE in touched code. spice-widget seems to be
using all 3 of: 0/1 false/true and FALSE/TRUE for booleans. The glib convention
is FALSE/TRUE.
2011-04-08 13:29:55 +02:00
Hans de Goede
e15ca100b9 gtk: take selection into account in clipboard_release 2011-04-05 16:56:25 +02:00
Marc-André Lureau
ed95a3ccba gtk: only release clipboard when neither guest nor client own it
08:55 < hansg> elmarco, this is from vdagent.log with debugging enabled. What is happening is that the last thing done was a primary
               selection in the client, so vdagent owns the clipboard in the guest (on behalf of spice-gtk), then something gets selected
               inside the guest, the agent sends a grab to spice-gtk, which then does a gtk_clipboard_set_with_data, this triggers an
               clipboard_owner_change which sends a release message to the agent
08:56 < hansg> To which the agent then responds by dropping it, and logging:
08:56 < hansg> primary: received release while not owning client clipboard
09:11 < elmarco> hansg: but this bug we are talking about is not related to multi-clipboard right?
09:11 < elmarco> and it's only a warning in vdagent, things works as expected otherwise, right?
09:11 < elmarco> the bug was thee before I suppose
09:12 < hansg> right, they work because vdagent is diligent and sees the client sends a release while it is not owning the clipboard. The
               diligence is mainly there in case things race though (release on client racing with a grab on guest), not to make things
               work with buggy clients :)
09:13 < hansg> wrt: <elmarco> hansg: d->clip_grabbed is only for client-side grab, iirc
09:13 < elmarco> ok, I think it's just an obscure area of the spec, where basically, we don't define exactly the "state machine"
09:13 < elmarco> so the client is releasing his last client-side grab, because he had one before, but now, it is a guest grab
09:13 < hansg> True (not exactly definging the state machine)
09:14 < hansg> So to try again wrt the  d->clip_grabbed, what happens there (which has the same cause) is:
09:14 < elmarco> so, what it should do is just don't release the clipboard if it is switching from client-side to guest
09:15 < hansg> gtk/spice-widget.c: clipboard_grab gets called, and does:
09:15 < hansg> Hmm, hold on, I see what you mean wrt d->clip_grabbed now
09:16 < elmarco> to me, it looks like the client made a grab and to complete it's cycle, it should release his grab
09:16 < elmarco> but the order of things confuse vdagent and we should agree on something and document it
09:18 < hansg> elmarco, I need some time to take a somewhat closer look at the spice-gtk code in this area, give me 1/2 an hour and I'l
               get back to you
09:20 < elmarco> from client 1. grab -> 2. grab <- 3. release -> or 1. grab -> 2. grab <- 3. no release
09:21 < elmarco> I think state should not be mixed between client grab / release -> and guest grab/release <-
09:22 < elmarco> so, overriding client grab by guest grab should release client grab
09:23 < hansg> spicec and the linux agent both assume that after sending a grab they won't get back a release (for that selection). The
               purpose of the release is to tell the OS that the agent resp,  client no longer own the clipboard (by setting the owner to
               None under X11), so that other apps can disable their paste menu item, etc. There is no need to do that (and actually
               doing so would be a bug) if an other app now owns the clipboard. So if the other side claim
09:23 < hansg> s ownership of the clipboard there is no need to tell it you're releasing your side, since it already assume you have
09:24 < hansg> Scenarios to keep in mind are:
09:24 < hansg> Seen from the client side:
09:28 < hansg> client grabs clipboard
09:28 < hansg> some app on guest becomes owner, guest sends grab, assume client release
09:29 < hansg> some app on guest asks agent for clipboard data -> tells it to go away since the client no longer the owner
09:29 < hansg> If it would not assume the release, there would be a window where it would think the client still owns the clipboard and
               forward potential request to the client, even though the client no longer owns the clipboard
09:30 < hansg> The thing to keep in mind is that the delivery of messages is not instant, so there is some window where the 2 sides are
               out of sync.
09:30 < hansg> I can see the logic in how you're advocating to do things, but that is not how they are currently done and I'm reluctant
               to change this
09:33 < elmarco> hansg: yeah, I don't think one solution or the other affect user experience, for me there is no gap if the client and
                 agent agrees, it's only protocol/implementation details
09:33 < elmarco> since there was prior implementation, we can decide to follow it
2011-04-05 16:53:17 +02:00
Marc-André Lureau
8258da3abe gtk: fix multi-head support by sync the display cache
An image may come later from a different channel, even if it is referenced by another image.
2011-04-04 13:11:23 +02:00
Marc-André Lureau
9844e3e3bd gtk: add some debugging in glz decoder and avoid crashes 2011-04-04 13:09:39 +02:00
Marc-André Lureau
d68c7653f2 gtk: display now use the cache from the session 2011-04-04 13:07:06 +02:00
Marc-André Lureau
c805c17fa0 gtk: the caches are shared with the session 2011-04-03 16:42:56 +02:00
Marc-André Lureau
3c9a6f7822 common: get rid of abort() in canvases 2011-04-03 15:49:36 +02:00
Marc-André Lureau
a96278aed1 common: remove unnecessary outdated c++ debug 2011-04-03 02:29:19 +02:00
Christophe Fergeau
75f64a8f40 configure.ac: remove detection of WARN_UNUSED_RESULT
spice-gtk configure.ac has some code to detect if the compiler has
a special attribute to tag some functions so that they generate a
warning when their return value isn't checked. However, this test
is broken (the gcc attribute name is "warn_unused_result", not
"__warn_unused_result__" and WARN_UNUSED_RESULT is unused anyway
since spice-protocol provides SPICE_GNUC_WARN_UNUSED_RESULT. Thus
we can just drop that block of code from configure.ac
2011-04-01 16:54:16 +02:00
Marc-André Lureau
0c8de86cd3 adding THANKS 2011-04-01 16:11:03 +02:00
Christophe Fergeau
f02b2a924f configure.ac: remove unused tests
configure.ac had -fvisibility detection, but it's not used by
spice-gtk. It also has a --enable-static-linkage flag which isn't
used anywhere apart from in configure.ac, so remote this too. I
think the same effect as --enable-static-linkage can be achieved
using make LDFLAGS="-all-static" since we are using libtool.
2011-04-01 15:57:24 +02:00
Marc-André Lureau
a35743f299 gtk: correct CLIPBOARD_LAST so that array are sized correctly 2011-03-31 21:51:49 +02:00
Marc-André Lureau
818f3fded3 gtk: show cursor when cursor-move 2011-03-31 20:15:54 +02:00
Marc-André Lureau
cf7b7bfdf5 gtk: fix handling of incoming large clipboard data
The main fix was probably the agent_msg_pos guin8 -> guint, although I
modified the code for more clarity
2011-03-31 20:15:07 +02:00
Marc-André Lureau
7ce7221a73 gtk: multi-clipboard improvements 2011-03-31 14:02:05 +02:00
Marc-André Lureau
9add4076d2 build: fix make dist 2011-03-30 19:14:53 +02:00
Marc-André Lureau
3271ebe9bc gtk/controller: add XPI controller code 2011-03-30 18:17:35 +02:00
Marc-André Lureau
9237548d9a build: provide a conditional for WIN32 2011-03-30 17:29:56 +02:00
Marc-André Lureau
3f54948390 build fixup 2011-03-30 17:29:42 +02:00
Marc-André Lureau
9e4438ca0e build: install spice-protocol.vapi 2011-03-30 17:07:47 +02:00
Marc-André Lureau
0f41969fc1 build: check for vala if necessary 2011-03-30 17:07:47 +02:00
Marc-André Lureau
692b0b5b1e gtk: remove some debugging, update TODO 2011-03-28 17:24:37 +02:00
Marc-André Lureau
6f66127094 Revert "gtk/display: remove unused mode name"
This reverts commit 33ef5a9368.
2011-03-27 22:42:24 +02:00