56 |
XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); |
XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); |
57 |
} |
} |
58 |
|
|
59 |
static void |
void |
60 |
xclip_handle_SelectionNotify(XSelectionEvent * event) |
xclip_handle_SelectionNotify(XSelectionEvent * event) |
61 |
{ |
{ |
62 |
unsigned long nitems, bytes_left; |
unsigned long nitems, bytes_left; |
129 |
cliprdr_send_data(NULL, 0); |
cliprdr_send_data(NULL, 0); |
130 |
} |
} |
131 |
|
|
132 |
static void |
void |
133 |
xclip_handle_SelectionRequest(XSelectionRequestEvent * event) |
xclip_handle_SelectionRequest(XSelectionRequestEvent * event) |
134 |
{ |
{ |
135 |
unsigned long nitems, bytes_left; |
unsigned long nitems, bytes_left; |
136 |
|
unsigned char *prop_return; |
137 |
uint32 *wanted_format; |
uint32 *wanted_format; |
138 |
int format, res; |
int format, res; |
139 |
Atom type; |
Atom type; |
158 |
res = XGetWindowProperty(g_display, event->requestor, |
res = XGetWindowProperty(g_display, event->requestor, |
159 |
rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER, |
rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER, |
160 |
&type, &format, &nitems, &bytes_left, |
&type, &format, &nitems, &bytes_left, |
161 |
(unsigned char **) &wanted_format); |
&prop_return); |
162 |
|
wanted_format = (uint32 *) prop_return; |
163 |
format = (res == Success) ? *wanted_format : CF_TEXT; |
format = (res == Success) ? *wanted_format : CF_TEXT; |
164 |
|
/* FIXME: Need to free returned data? */ |
165 |
} |
} |
166 |
else |
else |
167 |
{ |
{ |
173 |
/* wait for data */ |
/* wait for data */ |
174 |
} |
} |
175 |
|
|
176 |
static void |
void |
177 |
xclip_handle_SelectionClear(void) |
xclip_handle_SelectionClear(void) |
178 |
{ |
{ |
179 |
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n")); |
DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n")); |
182 |
cliprdr_send_text_format_announce(); |
cliprdr_send_text_format_announce(); |
183 |
} |
} |
184 |
|
|
185 |
static void |
void |
186 |
xclip_handle_PropertyNotify(XPropertyEvent * event) |
xclip_handle_PropertyNotify(XPropertyEvent * event) |
187 |
{ |
{ |
188 |
unsigned long nitems, bytes_left; |
unsigned long nitems, bytes_left; |