Browse Source

XWindowSystem: Specify mouse coordinates for resize in terms of the root window rather than the application window

v7.0.12
reuk 2 years ago
parent
commit
810e348ff7
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
3 changed files with 5 additions and 7 deletions
  1. +2
    -3
      modules/juce_gui_basics/native/juce_Windowing_linux.cpp
  2. +3
    -3
      modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp
  3. +0
    -1
      modules/juce_gui_basics/native/juce_XWindowSystem_linux.h

+ 2
- 3
modules/juce_gui_basics/native/juce_Windowing_linux.cpp View File

@@ -399,10 +399,9 @@ public:
void clearWindowAssociation() { association = {}; }
void startHostManagedResize (Point<int> mouseDownPosition,
ResizableBorderComponent::Zone zone) override
void startHostManagedResize (Point<int>, ResizableBorderComponent::Zone zone) override
{
XWindowSystem::getInstance()->startHostManagedResize (windowH, mouseDownPosition, zone);
XWindowSystem::getInstance()->startHostManagedResize (windowH, zone);
}
//==============================================================================


+ 3
- 3
modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp View File

@@ -1790,7 +1790,6 @@ void XWindowSystem::setBounds (::Window windowH, Rectangle<int> newBounds, bool
}
void XWindowSystem::startHostManagedResize (::Window windowH,
Point<int> mouseDown,
ResizableBorderComponent::Zone zone)
{
const auto moveResize = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_MOVERESIZE");
@@ -1803,6 +1802,7 @@ void XWindowSystem::startHostManagedResize (::Window windowH,
X11Symbols::getInstance()->xUngrabPointer (display, CurrentTime);
const auto root = X11Symbols::getInstance()->xRootWindow (display, X11Symbols::getInstance()->xDefaultScreen (display));
const auto mouseDown = getCurrentMousePosition();
XClientMessageEvent clientMsg;
clientMsg.display = display;
@@ -1810,8 +1810,8 @@ void XWindowSystem::startHostManagedResize (::Window windowH,
clientMsg.type = ClientMessage;
clientMsg.format = 32;
clientMsg.message_type = moveResize;
clientMsg.data.l[0] = mouseDown.getX();
clientMsg.data.l[1] = mouseDown.getY();
clientMsg.data.l[0] = (long) mouseDown.x;
clientMsg.data.l[1] = (long) mouseDown.y;
clientMsg.data.l[2] = [&]
{
// It's unclear which header is supposed to contain these


+ 0
- 1
modules/juce_gui_basics/native/juce_XWindowSystem_linux.h View File

@@ -242,7 +242,6 @@ public:
bool isX11Available() const noexcept { return xIsAvailable; }
void startHostManagedResize (::Window window,
Point<int> mouseDown,
ResizableBorderComponent::Zone zone);
static String getWindowScalingFactorSettingName() { return "Gdk/WindowScalingFactor"; }


Loading…
Cancel
Save