Store the time when we acquired the selection so that we can correctly

report it when queried.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1209 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Pierre Ossman 2006-03-27 11:31:10 +00:00
parent 2661541740
commit 0732aaa60a

10
xclip.c
View File

@ -114,6 +114,8 @@ static int have_primary = 0;
/* Denotes that an rdesktop (not this rdesktop) is owning the selection, /* Denotes that an rdesktop (not this rdesktop) is owning the selection,
allowing us to interchange Windows native clipboard data directly. */ allowing us to interchange Windows native clipboard data directly. */
static int rdesktop_is_selection_owner = 0; static int rdesktop_is_selection_owner = 0;
/* Time when we acquired the selection. */
static Time acquire_time = 0;
/* Denotes that an INCR ("chunked") transfer is in progress. */ /* Denotes that an INCR ("chunked") transfer is in progress. */
static int g_waiting_for_INCR = 0; static int g_waiting_for_INCR = 0;
@ -614,7 +616,7 @@ xclip_handle_SelectionRequest(XSelectionRequestEvent * event)
} }
else if (event->target == timestamp_atom) else if (event->target == timestamp_atom)
{ {
xclip_provide_selection(event, XA_INTEGER, 32, (uint8 *) & g_last_gesturetime, 1); xclip_provide_selection(event, XA_INTEGER, 32, (uint8 *) & acquire_time, 1);
return; return;
} }
else else
@ -798,7 +800,9 @@ xclip_handle_PropertyNotify(XPropertyEvent * event)
void void
ui_clip_format_announce(uint8 * data, uint32 length) ui_clip_format_announce(uint8 * data, uint32 length)
{ {
XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime); acquire_time = g_last_gesturetime;
XSetSelectionOwner(g_display, primary_atom, g_wnd, acquire_time);
if (XGetSelectionOwner(g_display, primary_atom) != g_wnd) if (XGetSelectionOwner(g_display, primary_atom) != g_wnd)
{ {
warning("Failed to aquire ownership of PRIMARY clipboard\n"); warning("Failed to aquire ownership of PRIMARY clipboard\n");
@ -810,7 +814,7 @@ ui_clip_format_announce(uint8 * data, uint32 length)
rdesktop_clipboard_formats_atom, XA_STRING, 8, PropModeReplace, data, rdesktop_clipboard_formats_atom, XA_STRING, 8, PropModeReplace, data,
length); length);
XSetSelectionOwner(g_display, clipboard_atom, g_wnd, g_last_gesturetime); XSetSelectionOwner(g_display, clipboard_atom, g_wnd, acquire_time);
if (XGetSelectionOwner(g_display, clipboard_atom) != g_wnd) if (XGetSelectionOwner(g_display, clipboard_atom) != g_wnd)
warning("Failed to aquire ownership of CLIPBOARD clipboard\n"); warning("Failed to aquire ownership of CLIPBOARD clipboard\n");
} }