static BOOL xf_cliprdr_process_property_notify(xfClipboard* clipboard, XEvent* xevent) { xfCliprdrFormat* format; xfContext* xfc = clipboard->xfc; if (!clipboard) return TRUE; if (xevent->xproperty.atom != clipboard->property_atom) return FALSE; /* Not cliprdr-related */ if (xevent->xproperty.window == clipboard->root_window) { xf_cliprdr_send_client_format_list(clipboard); } else if ((xevent->xproperty.window == xfc->drawable) && (xevent->xproperty.state == PropertyNewValue) && clipboard->incr_starts) { format = xf_cliprdr_get_format_by_id(clipboard, clipboard->requestedFormatId); if (format) xf_cliprdr_get_requested_data(clipboard, format->atom); } return TRUE; }
static int xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) { xfClipboard* clipboard = (xfClipboard*) context->custom; xf_cliprdr_send_client_capabilities(clipboard); xf_cliprdr_send_client_format_list(clipboard); clipboard->sync = TRUE; return 1; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) { xfClipboard* clipboard = (xfClipboard*) context->custom; UINT ret; if ((ret = xf_cliprdr_send_client_capabilities(clipboard)) != CHANNEL_RC_OK) return ret; if ((ret = xf_cliprdr_send_client_format_list(clipboard)) != CHANNEL_RC_OK) return ret; clipboard->sync = TRUE; return CHANNEL_RC_OK; }
static void xf_cliprdr_check_owner(xfClipboard* clipboard) { Window owner; xfContext* xfc = clipboard->xfc; if (clipboard->sync) { owner = XGetSelectionOwner(xfc->display, clipboard->clipboard_atom); if (clipboard->owner != owner) { clipboard->owner = owner; xf_cliprdr_send_client_format_list(clipboard); } } }
static BOOL xf_cliprdr_process_selection_notify(xfClipboard* clipboard, XEvent* xevent) { if (xevent->xselection.target == clipboard->targets[1]) { if (xevent->xselection.property == None) { xf_cliprdr_send_client_format_list(clipboard); } else { xf_cliprdr_get_requested_targets(clipboard); } return TRUE; } else { return xf_cliprdr_get_requested_data(clipboard, xevent->xselection.target); } }