XMCLIPBOARDLOCK(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmClipboardLock πŸ’–

okay bestie, welcome to the XmClipboardLock page β€” it's a library call, and it's literally the bouncer at the clipboard club 🫢


✨ NAME ✨

XmClipboardLock β€” a clipboard function that locks the clipboard πŸ”’πŸ’…


✨ SYNOPSIS ✨

#include <Xm/CutPaste.h>
int XmClipboardLock (display, window)
        Display * display;
        Window  window;
(void)

✨ DESCRIPTION ✨

okay so XmClipboardLock locks the clipboard so no other application can touch it until XmClipboardUnlock gets called. πŸŽ€

and like, all clipboard functions lock and unlock the clipboard, because we are not doing simultaneous access in this house. this function is the one that lets your application keep the clipboard data from changing between calls to Inquire and other clipboard functions. πŸ‘‘

but ngl, you do not need to lock the clipboard between calls to XmClipboardStartCopy and XmClipboardEndCopy, or between XmClipboardStartRetrieve and XmClipboardEndRetrieve. those are already handled, bestie, you can breathe. 😌

πŸ’€ if the clipboard is already locked by another application, XmClipboardLock returns an error status. and if the same application calls this function multiple times? that just increases the lock level. stacking locks, main character energy. 🧚
  • display β€” specifies a pointer to the Display structure that was returned in a previous call to XOpenDisplay or XtDisplay. ✨
  • window β€” specifies the window ID of a widget that relates the application window to the clipboard. you can get that widget's window ID through XtWindow. and listen β€” the same application instance should pass the same window ID to each of the clipboard functions that it calls. consistency is the vibe, fr fr. πŸ¦‹

✨ RETURN ✨

  • XmClipboardSuccess β€” slay πŸ’… the function was successful.
  • XmClipboardLocked β€” the function failed because the clipboard was locked by another application. 😭 the application can keep calling the function again with the same parameters until the lock goes away β€” and that's actually a feature, because it gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation. your call, babe. 🫢

the girlies you should also know about: XmClipboardEndCopy(3), XmClipboardEndRetrieve(3), XmClipboardStartCopy(3), XmClipboardStartRetrieve(3), and XmClipboardUnlock(3). go read them, iykyk πŸ“šπŸ’–


and that's the whole page, bestie!! this was XmClipboardLock(library call) β€” yes, same name up top and down at the bottom, she contains multitudes πŸ’œβœ¨ go lock that clipboard, you're doing amazing, periodt. πŸŽ€πŸŒΈ