mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[client] cosmetics/naming cleanup
This commit is contained in:
@@ -339,11 +339,11 @@ static void fileImportCallback(uint32_t events, void * opaque)
|
||||
wlCb.fileImport = NULL;
|
||||
LG_UNLOCK(wlCb.lock);
|
||||
if (current && (!complete ||
|
||||
!lgClipboardFiles_setLocal(import->mime,
|
||||
!clipboardFiles_setLocal(import->mime,
|
||||
import->data, import->size)))
|
||||
{
|
||||
lgClipboardFiles_clearLocal();
|
||||
lgClipboard_release();
|
||||
clipboardFiles_clearLocal();
|
||||
clipboard_release();
|
||||
}
|
||||
if (current)
|
||||
waylandPollUnregister(import->fd);
|
||||
@@ -536,7 +536,7 @@ static void dataDeviceHandleSelection(void * opaque,
|
||||
{
|
||||
const LG_ClipboardRequest request = read->request;
|
||||
clipboardReadRetire(read);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
}
|
||||
if (oldImport)
|
||||
waylandPollUnregister(oldImport->fd);
|
||||
@@ -548,12 +548,12 @@ static void dataDeviceHandleSelection(void * opaque,
|
||||
{
|
||||
if (!fileImportStart(offer, wlCb.mimetypes[LG_CLIPBOARD_DATA_FILES]))
|
||||
{
|
||||
lgClipboardFiles_clearLocal();
|
||||
lgClipboard_release();
|
||||
clipboardFiles_clearLocal();
|
||||
clipboard_release();
|
||||
}
|
||||
}
|
||||
else
|
||||
lgClipboard_notifyTypes(types, idx);
|
||||
clipboard_notifyTypes(types, idx);
|
||||
}
|
||||
|
||||
static void dataDeviceHandleEnter(void * data, struct wl_data_device * device,
|
||||
@@ -676,17 +676,17 @@ static enum ClipboardReadCallResult clipboardReadCall(
|
||||
switch (operation)
|
||||
{
|
||||
case CLIPBOARD_READ_BEGIN:
|
||||
result = lgClipboard_dataBegin(
|
||||
result = clipboard_dataBegin(
|
||||
request, type, LG_CLIPBOARD_SIZE_UNKNOWN);
|
||||
break;
|
||||
|
||||
case CLIPBOARD_READ_CHUNK:
|
||||
result = lgClipboard_dataChunk(
|
||||
result = clipboard_dataChunk(
|
||||
request, offset, data->buffer, pending);
|
||||
break;
|
||||
|
||||
case CLIPBOARD_READ_END:
|
||||
result = lgClipboard_dataEnd(request, offset);
|
||||
result = clipboard_dataEnd(request, offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -755,7 +755,7 @@ static void clipboardReadCallback(uint32_t events, void * opaque)
|
||||
if (events & EPOLLERR)
|
||||
{
|
||||
if (clipboardReadClaim(data))
|
||||
lgClipboard_abort(data->request);
|
||||
clipboard_abort(data->request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -810,7 +810,7 @@ static void clipboardReadCallback(uint32_t events, void * opaque)
|
||||
return;
|
||||
DEBUG_ERROR("Failed to read from clipboard: %s", strerror(readError));
|
||||
if (clipboardReadClaim(data))
|
||||
lgClipboard_abort(data->request);
|
||||
clipboard_abort(data->request);
|
||||
return;
|
||||
}
|
||||
if (!haveOperation)
|
||||
@@ -866,17 +866,17 @@ static void waylandCBInvalidateLocal(enum ClipboardInvalidateMode mode)
|
||||
if (notifyProvider)
|
||||
{
|
||||
if (read)
|
||||
lgClipboard_abort(request);
|
||||
lgClipboard_release();
|
||||
clipboard_abort(request);
|
||||
clipboard_release();
|
||||
}
|
||||
LG_UNLOCK(wlCb.lock);
|
||||
|
||||
if (import)
|
||||
waylandPollUnregister(import->fd);
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_clearLocal();
|
||||
|
||||
if (read && !notifyProvider)
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
|
||||
if (offer)
|
||||
wl_data_offer_destroy(offer);
|
||||
@@ -899,7 +899,7 @@ void waylandCBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
if (pipe(fds) < 0)
|
||||
{
|
||||
DEBUG_ERROR("Failed to get a clipboard pipe: %s", strerror(errno));
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
const int readFlags = fcntl(fds[0], F_GETFL);
|
||||
@@ -913,7 +913,7 @@ void waylandCBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
DEBUG_ERROR("Failed to configure clipboard pipe: %s", strerror(errno));
|
||||
close(fds[0]);
|
||||
close(fds[1]);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -923,7 +923,7 @@ void waylandCBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
DEBUG_ERROR("Failed to allocate memory to read clipboard");
|
||||
close(fds[0]);
|
||||
close(fds[1]);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -956,7 +956,7 @@ void waylandCBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
{
|
||||
const LG_ClipboardRequest oldRequest = old->request;
|
||||
clipboardReadRetire(old);
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
}
|
||||
if (!registered)
|
||||
{
|
||||
@@ -964,7 +964,7 @@ void waylandCBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
DEBUG_ERROR("Failed to register clipboard read into epoll: %s",
|
||||
strerror(errno));
|
||||
clipboardReadCleanup(data);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ void waylandCBRequestReady(LG_ClipboardRequest request)
|
||||
{
|
||||
const LG_ClipboardRequest id = failed->request;
|
||||
clipboardReadRetire(failed);
|
||||
lgClipboard_abort(id);
|
||||
clipboard_abort(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1192,7 +1192,7 @@ struct ClipboardFileWrite
|
||||
static void fileTransferDestroy(struct WCBTransfer * transfer)
|
||||
{
|
||||
if (transfer->filePresentation)
|
||||
lgClipboardFiles_remotePresentationRelease(transfer->filePresentation);
|
||||
clipboardFiles_remotePresentationRelease(transfer->filePresentation);
|
||||
free(transfer->fileUri);
|
||||
free(transfer->fileGnome);
|
||||
free(transfer->fileKde);
|
||||
@@ -1216,7 +1216,7 @@ static void clipboardFileWriteCleanup(void * opaque)
|
||||
{
|
||||
struct ClipboardFileWrite * write = opaque;
|
||||
if (write->complete && write->deliversUri)
|
||||
lgClipboardFiles_remotePresentationDelivered(
|
||||
clipboardFiles_remotePresentationDelivered(
|
||||
write->transfer->filePresentation);
|
||||
close(write->fd);
|
||||
free(write->data);
|
||||
@@ -1369,7 +1369,7 @@ static void clipboardWriteCallback(uint32_t events, void * opaque)
|
||||
const LG_ClipboardRequest request = data->request;
|
||||
LG_UNLOCK(data->lock);
|
||||
if (ready)
|
||||
lgClipboard_requestReady(request);
|
||||
clipboard_requestReady(request);
|
||||
return;
|
||||
|
||||
error:
|
||||
@@ -1391,7 +1391,7 @@ error:
|
||||
if (fd >= 0)
|
||||
waylandPollUnregister(fd);
|
||||
if (errorReady)
|
||||
lgClipboard_requestReady(errorRequest);
|
||||
clipboard_requestReady(errorRequest);
|
||||
}
|
||||
|
||||
static void dataSourceHandleTarget(void * data, struct wl_data_source * source,
|
||||
@@ -1451,7 +1451,7 @@ static void dataSourceHandleSend(void * data, struct wl_data_source * source,
|
||||
LG_LOCK(data->lock);
|
||||
data->requesting = true;
|
||||
LG_UNLOCK(data->lock);
|
||||
const bool result = lgClipboard_requestStream(transfer->type,
|
||||
const bool result = clipboard_requestStream(transfer->type,
|
||||
&clipboardWriteStream, data, &data->request);
|
||||
|
||||
int retireFd = -1;
|
||||
@@ -1529,16 +1529,16 @@ static bool waylandCBPublish(LG_ClipboardData type)
|
||||
transfer->next = NULL;
|
||||
if (type == LG_CLIPBOARD_DATA_FILES)
|
||||
transfer->filePresentation =
|
||||
lgClipboardFiles_remotePresentationAcquire();
|
||||
clipboardFiles_remotePresentationAcquire();
|
||||
if (type == LG_CLIPBOARD_DATA_FILES &&
|
||||
(!transfer->filePresentation ||
|
||||
!lgClipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
!clipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
"text/uri-list",
|
||||
&transfer->fileUri, &transfer->fileUriSize) ||
|
||||
!lgClipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
!clipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
"x-special/gnome-copied-files",
|
||||
&transfer->fileGnome, &transfer->fileGnomeSize) ||
|
||||
!lgClipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
!clipboardFiles_getRemotePresentation(transfer->filePresentation,
|
||||
"application/x-kde-cutselection",
|
||||
&transfer->fileKde, &transfer->fileKdeSize)))
|
||||
{
|
||||
@@ -1628,7 +1628,7 @@ void waylandCBFree(void)
|
||||
clipboardReadRetire(read);
|
||||
if (import)
|
||||
waylandPollUnregister(import->fd);
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_clearLocal();
|
||||
if (offer)
|
||||
wl_data_offer_destroy(offer);
|
||||
if (dndOffer && dndOffer != offer)
|
||||
|
||||
@@ -227,12 +227,12 @@ bool x11CBEventThread(const XEvent * xe)
|
||||
NULL, 0);
|
||||
XFlush(x11.display);
|
||||
if (write->event.xselection.target != x11cb.aFileKde)
|
||||
lgClipboardFiles_remotePresentationDelivered(
|
||||
clipboardFiles_remotePresentationDelivered(
|
||||
write->filePresentation);
|
||||
const uint64_t presentation = write->filePresentation;
|
||||
writeRemoveNL(write);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
free(write->fileData);
|
||||
free(write);
|
||||
return true;
|
||||
@@ -249,7 +249,7 @@ bool x11CBEventThread(const XEvent * xe)
|
||||
if (write)
|
||||
{
|
||||
if (request != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_requestReady(request);
|
||||
clipboard_requestReady(request);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -517,9 +517,9 @@ static void x11CBSelectionRequest(const XSelectionRequestEvent e)
|
||||
if (available)
|
||||
{
|
||||
writePresentation =
|
||||
lgClipboardFiles_remotePresentationAcquire();
|
||||
clipboardFiles_remotePresentationAcquire();
|
||||
available = writePresentation == presentation &&
|
||||
lgClipboardFiles_getRemotePresentation(writePresentation,
|
||||
clipboardFiles_getRemotePresentation(writePresentation,
|
||||
fileMime, &data, &size);
|
||||
}
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
@@ -527,7 +527,7 @@ static void x11CBSelectionRequest(const XSelectionRequestEvent e)
|
||||
{
|
||||
free(data);
|
||||
if (writePresentation)
|
||||
lgClipboardFiles_remotePresentationRelease(writePresentation);
|
||||
clipboardFiles_remotePresentationRelease(writePresentation);
|
||||
goto nodata;
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ static void x11CBSelectionRequest(const XSelectionRequestEvent e)
|
||||
if (!write)
|
||||
{
|
||||
free(data);
|
||||
lgClipboardFiles_remotePresentationRelease(writePresentation);
|
||||
clipboardFiles_remotePresentationRelease(writePresentation);
|
||||
DEBUG_ERROR("out of memory");
|
||||
goto nodata;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ static void x11CBSelectionRequest(const XSelectionRequestEvent e)
|
||||
if (duplicate)
|
||||
{
|
||||
free(write->fileData);
|
||||
lgClipboardFiles_remotePresentationRelease(
|
||||
clipboardFiles_remotePresentationRelease(
|
||||
write->filePresentation);
|
||||
free(write);
|
||||
goto nodata;
|
||||
@@ -627,7 +627,7 @@ static void x11CBSelectionRequest(const XSelectionRequestEvent e)
|
||||
goto nodata;
|
||||
}
|
||||
|
||||
const bool result = lgClipboard_requestStream(requestType,
|
||||
const bool result = clipboard_requestStream(requestType,
|
||||
&x11CBWriteStream, write, &write->request);
|
||||
LG_LOCK(x11cb.lock);
|
||||
const bool linked = writeLinkedNL(write);
|
||||
@@ -682,7 +682,7 @@ static void x11CBSelectionClear(const XSelectionClearEvent e)
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
|
||||
if (presentation)
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
}
|
||||
|
||||
/* x11cb.lock must be held. */
|
||||
@@ -817,7 +817,7 @@ static void cancelFileWrites(
|
||||
XChangeProperty(x11.display, writes->event.xselection.requestor,
|
||||
writes->event.xselection.property,
|
||||
writes->event.xselection.target, 8, PropModeReplace, NULL, 0);
|
||||
lgClipboardFiles_remotePresentationRelease(
|
||||
clipboardFiles_remotePresentationRelease(
|
||||
writes->filePresentation);
|
||||
free(writes->fileData);
|
||||
free(writes);
|
||||
@@ -889,10 +889,10 @@ static bool startFileImport(Atom target)
|
||||
static void finishFileImport(struct X11ClipboardFileImport import,
|
||||
const void * data, size_t size)
|
||||
{
|
||||
if (!lgClipboardFiles_setLocal(import.mime, data, size))
|
||||
if (!clipboardFiles_setLocal(import.mime, data, size))
|
||||
{
|
||||
lgClipboardFiles_clearLocal();
|
||||
lgClipboard_release();
|
||||
clipboardFiles_clearLocal();
|
||||
clipboard_release();
|
||||
}
|
||||
free(import.data);
|
||||
}
|
||||
@@ -923,7 +923,7 @@ static bool x11CBFileImportSelectionNotify(const XSelectionEvent e)
|
||||
if (data)
|
||||
XFree(data);
|
||||
free(failed.data);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ static bool x11CBFileImportSelectionNotify(const XSelectionEvent e)
|
||||
if (data)
|
||||
XFree(data);
|
||||
free(failed.data);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return true;
|
||||
}
|
||||
x11cb.fileImport.incremental = true;
|
||||
@@ -954,7 +954,7 @@ static bool x11CBFileImportSelectionNotify(const XSelectionEvent e)
|
||||
else
|
||||
{
|
||||
free(import.data);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
}
|
||||
if (data)
|
||||
XFree(data);
|
||||
@@ -993,7 +993,7 @@ readProperty:
|
||||
if (data)
|
||||
XFree(data);
|
||||
free(failed.data);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1019,7 +1019,7 @@ readProperty:
|
||||
const struct X11ClipboardFileImport failed = takeFileImportNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
free(failed.data);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
x11cb.fileImport.propertyOffset += (long)units;
|
||||
@@ -1069,15 +1069,15 @@ static enum X11ClipboardReadCallResult x11CBReadCallNL(
|
||||
switch (operation)
|
||||
{
|
||||
case X11_CLIPBOARD_READ_BEGIN:
|
||||
result = lgClipboard_dataBegin(request, type, sizeHint);
|
||||
result = clipboard_dataBegin(request, type, sizeHint);
|
||||
break;
|
||||
|
||||
case X11_CLIPBOARD_READ_CHUNK:
|
||||
result = lgClipboard_dataChunk(request, offset, data, size);
|
||||
result = clipboard_dataChunk(request, offset, data, size);
|
||||
break;
|
||||
|
||||
case X11_CLIPBOARD_READ_END:
|
||||
result = lgClipboard_dataEnd(request, offset);
|
||||
result = clipboard_dataEnd(request, offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1151,7 +1151,7 @@ readProperty:
|
||||
const struct X11ClipboardRead read = clearReadNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ readProperty:
|
||||
if (data)
|
||||
XFree(data);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1206,7 +1206,7 @@ readProperty:
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
XFree(data);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1217,7 +1217,7 @@ readProperty:
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
XFree(data);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
memcpy(copy, data, itemCount);
|
||||
@@ -1261,7 +1261,7 @@ readProperty:
|
||||
const struct X11ClipboardRead read = clearReadNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
goto readProperty;
|
||||
@@ -1300,11 +1300,11 @@ static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e)
|
||||
XFlush(x11.display);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
if (presentation)
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
lgClipboardFiles_clearLocal();
|
||||
lgClipboard_release();
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_clearLocal();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1319,11 +1319,11 @@ static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e)
|
||||
XFlush(x11.display);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
if (presentation)
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
lgClipboardFiles_clearLocal();
|
||||
lgClipboard_release();
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_clearLocal();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1339,10 +1339,10 @@ static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e)
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
if (presentation)
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_clearLocal();
|
||||
}
|
||||
|
||||
static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
@@ -1365,7 +1365,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
{
|
||||
clearTargetsNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1384,7 +1384,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
{
|
||||
clearTargetsNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
return;
|
||||
}
|
||||
clearTargetsNL();
|
||||
@@ -1395,7 +1395,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
// an array of padded 64-bit values
|
||||
if (!data || format != 32)
|
||||
{
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1421,9 +1421,9 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
|
||||
if (fileTarget != None)
|
||||
{
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_clearLocal();
|
||||
if (!startFileImport(fileTarget))
|
||||
lgClipboard_release();
|
||||
clipboard_release();
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1435,7 +1435,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
break;
|
||||
}
|
||||
|
||||
lgClipboard_notifyTypes(types, typeCount);
|
||||
clipboard_notifyTypes(types, typeCount);
|
||||
goto out;
|
||||
}
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
@@ -1451,7 +1451,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
{
|
||||
const LG_ClipboardRequest request = cancelReadNL(true);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1470,7 +1470,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
{
|
||||
const LG_ClipboardRequest request = cancelReadNL(true);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1482,7 +1482,7 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (data)
|
||||
XFree(data);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1543,11 +1543,11 @@ static void x11CBSelectionNotify(const XSelectionEvent e)
|
||||
if (!valid)
|
||||
{
|
||||
DEBUG_WARN("Invalid clipboard data");
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
goto out;
|
||||
}
|
||||
|
||||
lgClipboard_data(request, dataType, data, itemCount);
|
||||
clipboard_data(request, dataType, data, itemCount);
|
||||
|
||||
out:
|
||||
if (data)
|
||||
@@ -1557,7 +1557,7 @@ out:
|
||||
void x11CBNotice(LG_ClipboardData type)
|
||||
{
|
||||
const uint64_t nextPresentation = type == LG_CLIPBOARD_DATA_FILES ?
|
||||
lgClipboardFiles_remotePresentationAcquire() : 0;
|
||||
clipboardFiles_remotePresentationAcquire() : 0;
|
||||
LG_LOCK(x11cb.lock);
|
||||
const LG_ClipboardRequest oldRequest = x11cb.read.window ?
|
||||
cancelReadNL(true) : LG_CLIPBOARD_REQUEST_INVALID;
|
||||
@@ -1573,10 +1573,10 @@ void x11CBNotice(LG_ClipboardData type)
|
||||
XFlush(x11.display);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
if (oldPresentation)
|
||||
lgClipboardFiles_remotePresentationRelease(oldPresentation);
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_remotePresentationRelease(oldPresentation);
|
||||
clipboardFiles_clearLocal();
|
||||
}
|
||||
|
||||
void x11CBRelease(void)
|
||||
@@ -1593,7 +1593,7 @@ void x11CBRelease(void)
|
||||
XFlush(x11.display);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (presentation)
|
||||
lgClipboardFiles_remotePresentationRelease(presentation);
|
||||
clipboardFiles_remotePresentationRelease(presentation);
|
||||
}
|
||||
|
||||
void x11CBFree(void)
|
||||
@@ -1609,9 +1609,9 @@ void x11CBFree(void)
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
|
||||
if (request != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(request);
|
||||
cancelFileWrites(writes, true);
|
||||
lgClipboardFiles_clearLocal();
|
||||
clipboardFiles_clearLocal();
|
||||
}
|
||||
|
||||
void x11CBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
@@ -1627,8 +1627,8 @@ void x11CBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
{
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(oldRequest);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1638,8 +1638,8 @@ void x11CBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
{
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
lgClipboard_abort(request);
|
||||
clipboard_abort(oldRequest);
|
||||
clipboard_abort(request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1661,7 +1661,7 @@ void x11CBRequest(LG_ClipboardRequest request, LG_ClipboardData type)
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
|
||||
if (oldRequest != LG_CLIPBOARD_REQUEST_INVALID)
|
||||
lgClipboard_abort(oldRequest);
|
||||
clipboard_abort(oldRequest);
|
||||
}
|
||||
|
||||
void x11CBRequestReady(LG_ClipboardRequest request)
|
||||
@@ -1706,7 +1706,7 @@ void x11CBRequestReady(LG_ClipboardRequest request)
|
||||
{
|
||||
const LG_ClipboardRequest abort = cancelReadNL(true);
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
lgClipboard_abort(abort);
|
||||
clipboard_abort(abort);
|
||||
return;
|
||||
}
|
||||
memcpy(pending, x11cb.read.pending, pendingSize);
|
||||
@@ -1767,7 +1767,7 @@ void x11CBRequestReady(LG_ClipboardRequest request)
|
||||
const struct X11ClipboardRead read = clearReadNL();
|
||||
LG_UNLOCK(x11cb.lock);
|
||||
free(read.pending);
|
||||
lgClipboard_abort(read.request);
|
||||
clipboard_abort(read.request);
|
||||
return;
|
||||
}
|
||||
processProperty = true;
|
||||
|
||||
Reference in New Issue
Block a user