diff --git a/modules/juce_gui_basics/native/x11/juce_linux_X11_DragAndDrop.cpp b/modules/juce_gui_basics/native/x11/juce_linux_X11_DragAndDrop.cpp index 5aa3a15052..da96498a44 100644 --- a/modules/juce_gui_basics/native/x11/juce_linux_X11_DragAndDrop.cpp +++ b/modules/juce_gui_basics/native/x11/juce_linux_X11_DragAndDrop.cpp @@ -222,7 +222,14 @@ public: if ((clientMsg.data.l[1] & 1) != 0) { XWindowSystemUtilities::ScopedXLock xLock; - XWindowSystemUtilities::GetXProperty prop (dragAndDropSourceWindow, atoms.XdndTypeList, 0, 0x8000000L, false, XA_ATOM); + + XWindowSystemUtilities::GetXProperty prop (getDisplay(), + dragAndDropSourceWindow, + atoms.XdndTypeList, + 0, + 0x8000000L, + false, + XA_ATOM); if (prop.success && prop.actualType == XA_ATOM && prop.actualFormat == 32 && prop.numItems != 0) { @@ -281,8 +288,13 @@ public: for (;;) { - XWindowSystemUtilities::GetXProperty prop (evt.xany.window, evt.xselection.property, - (long) (dropData.getSize() / 4), 65536, false, AnyPropertyType); + XWindowSystemUtilities::GetXProperty prop (getDisplay(), + evt.xany.window, + evt.xselection.property, + (long) (dropData.getSize() / 4), + 65536, + false, + AnyPropertyType); if (! prop.success) break; @@ -518,7 +530,13 @@ private: int getDnDVersionForWindow (::Window target) { - XWindowSystemUtilities::GetXProperty prop (target, getAtoms().XdndAware, 0, 2, false, AnyPropertyType); + XWindowSystemUtilities::GetXProperty prop (getDisplay(), + target, + getAtoms().XdndAware, + 0, + 2, + false, + AnyPropertyType); if (prop.success && prop.data != None && prop.actualFormat == 32 && prop.numItems == 1) return jmin ((int) prop.data[0], (int) XWindowSystemUtilities::Atoms::DndVersion); diff --git a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp index a4e01fd277..e98825cd9d 100644 --- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp +++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp @@ -163,11 +163,10 @@ bool XWindowSystemUtilities::Atoms::isMimeTypeFile (::Display* display, Atom ato } //============================================================================== -XWindowSystemUtilities::GetXProperty::GetXProperty (Window window, Atom atom, long offset, - long length, bool shouldDelete, Atom requestedType) +XWindowSystemUtilities::GetXProperty::GetXProperty (::Display* display, Window window, Atom atom, + long offset, long length, bool shouldDelete, Atom requestedType) { - success = (X11Symbols::getInstance()->xGetWindowProperty (XWindowSystem::getInstance()->getDisplay(), - window, atom, offset, length, + success = (X11Symbols::getInstance()->xGetWindowProperty (display, window, atom, offset, length, (Bool) shouldDelete, requestedType, &actualType, &actualFormat, &numItems, &bytesLeft, &data) == Success) && data != nullptr; @@ -1062,7 +1061,8 @@ namespace DisplayHelpers { const auto xsettingsSettingsAtom = Atoms::getCreating (display, "_XSETTINGS_SETTINGS"); - const GetXProperty prop { selectionWindow, + const GetXProperty prop { display, + selectionWindow, xsettingsSettingsAtom, 0L, std::numeric_limits::max(), @@ -1270,7 +1270,7 @@ namespace ClipboardHelpers { if (display != nullptr) { - XWindowSystemUtilities::GetXProperty prop (window, atom, 0L, 100000, false, AnyPropertyType); + XWindowSystemUtilities::GetXProperty prop (display, window, atom, 0L, 100000, false, AnyPropertyType); if (prop.success) { @@ -1777,7 +1777,7 @@ BorderSize XWindowSystem::getBorderSize (::Window windowH) const if (hints != None) { - XWindowSystemUtilities::GetXProperty prop (windowH, hints, 0, 4, false, XA_CARDINAL); + XWindowSystemUtilities::GetXProperty prop (display, windowH, hints, 0, 4, false, XA_CARDINAL); if (prop.success && prop.actualFormat == 32) { @@ -1859,7 +1859,7 @@ bool XWindowSystem::isMinimised (::Window windowH) const jassert (windowH != 0); XWindowSystemUtilities::ScopedXLock xLock; - XWindowSystemUtilities::GetXProperty prop (windowH, atoms.state, 0, 64, false, atoms.state); + XWindowSystemUtilities::GetXProperty prop (display, windowH, atoms.state, 0, 64, false, atoms.state); if (prop.success && prop.actualType == atoms.state && prop.actualFormat == 32 && prop.numItems > 0) @@ -2413,7 +2413,7 @@ Array XWindowSystem::findDisplays (float masterScale) const for (int i = 0; i < numMonitors; ++i) { auto rootWindow = X11Symbols::getInstance()->xRootWindow (display, i); - XWindowSystemUtilities::GetXProperty prop (rootWindow, workAreaHints, 0, 4, false, XA_CARDINAL); + XWindowSystemUtilities::GetXProperty prop (display, rootWindow, workAreaHints, 0, 4, false, XA_CARDINAL); if (! hasWorkAreaData (prop)) continue; @@ -2505,7 +2505,8 @@ Array XWindowSystem::findDisplays (float masterScale) const for (int i = 0; i < numMonitors; ++i) { - XWindowSystemUtilities::GetXProperty prop (X11Symbols::getInstance()->xRootWindow (display, i), + XWindowSystemUtilities::GetXProperty prop (display, + X11Symbols::getInstance()->xRootWindow (display, i), workAreaHints, 0, 4, false, XA_CARDINAL); auto workArea = getWorkArea (prop); @@ -2959,7 +2960,7 @@ long XWindowSystem::getUserTime (::Window windowH) const { jassert (windowH != 0); - XWindowSystemUtilities::GetXProperty prop (windowH, atoms.userTime, 0, 65536, false, XA_CARDINAL); + XWindowSystemUtilities::GetXProperty prop (display, windowH, atoms.userTime, 0, 65536, false, XA_CARDINAL); if (! prop.success) return 0; @@ -3588,7 +3589,7 @@ void XWindowSystem::propertyNotifyEvent (LinuxComponentPeer* peer, const XProper return false; XWindowSystemUtilities::ScopedXLock xLock; - XWindowSystemUtilities::GetXProperty prop (event.window, atoms.windowState, 0, 128, false, XA_ATOM); + XWindowSystemUtilities::GetXProperty prop (display, event.window, atoms.windowState, 0, 128, false, XA_ATOM); if (! (prop.success && prop.actualFormat == 32 && prop.actualType == XA_ATOM)) return false; diff --git a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.h b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.h index eefb4b753b..3a1eb4c203 100644 --- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.h +++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.h @@ -49,8 +49,8 @@ namespace XWindowSystemUtilities */ struct GetXProperty { - GetXProperty (::Window windowH, Atom property, long offset, - long length, bool shouldDelete, Atom requestedType); + GetXProperty (::Display* display, ::Window windowH, Atom property, + long offset, long length, bool shouldDelete, Atom requestedType); ~GetXProperty(); bool success = false; @@ -160,7 +160,7 @@ public: String getTextFromClipboard() const; String getLocalClipboardContent() const noexcept { return localClipboardContent; } - ::Display* getDisplay() noexcept { return display; } + ::Display* getDisplay() const noexcept { return display; } const XWindowSystemUtilities::Atoms& getAtoms() const noexcept { return atoms; } bool isX11Available() const noexcept { return xIsAvailable; } diff --git a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp index 05ff47d070..53f254bec5 100644 --- a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp @@ -384,7 +384,7 @@ private: //============================================================================== bool getXEmbedMappedFlag() { - XWindowSystemUtilities::GetXProperty embedInfo (client, infoAtom, 0, 2, false, infoAtom); + XWindowSystemUtilities::GetXProperty embedInfo (getDisplay(), client, infoAtom, 0, 2, false, infoAtom); if (embedInfo.success && embedInfo.actualFormat == 32 && embedInfo.numItems >= 2 && embedInfo.data != nullptr)