40 : associatedPointer ([&]() ->
void*
42 if (associatedIn ==
nullptr)
46 const auto display = XWindowSystem::getInstance()->getDisplay();
47 jassert (! getAssociatedPointer (display, windowIn).has_value());
49 if (X11Symbols::getInstance()->xSaveContext (display,
50 static_cast<XID
> (windowIn),
52 unalignedPointerCast<XPointer> (associatedIn)) != 0)
60 window (
static_cast<XID
> (windowIn)) {}
66 : associatedPointer (
std::exchange (other.associatedPointer,
nullptr)), window (other.window) {}
76 if (associatedPointer ==
nullptr)
79 const auto display = XWindowSystem::getInstance()->getDisplay();
80 const auto ptr = getAssociatedPointer (display, window);
82 if (! ptr.has_value())
89 jassert (unalignedPointerCast<XPointer> (associatedPointer) == *ptr);
91 if (X11Symbols::getInstance()->xDeleteContext (display, window, windowHandleXContext) != 0)
95 bool isValid()
const {
return associatedPointer !=
nullptr; }
102 if (X11Symbols::getInstance()->xFindContext (display, window, windowHandleXContext, &ptr) != 0)
110 std::swap (other.associatedPointer, associatedPointer);
114 void* associatedPointer =
nullptr;