Browse Source

Fix for linux windows that don't respond to mouse events

tags/2021-05-28
jules 10 years ago
parent
commit
5fc2f24c97
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      modules/juce_gui_basics/native/juce_linux_Windowing.cpp

+ 10
- 5
modules/juce_gui_basics/native/juce_linux_Windowing.cpp View File

@@ -2964,9 +2964,13 @@ private:
CWBorderPixel | CWColormap | CWBackPixmap | CWEventMask | CWOverrideRedirect,
&swa);
unsigned int buttonMask = EnterWindowMask | LeaveWindowMask | PointerMotionMask;
if ((styleFlags & windowIgnoresMouseClicks) == 0)
buttonMask |= ButtonPressMask | ButtonReleaseMask;
XGrabButton (display, AnyButton, AnyModifier, windowH, False,
ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync, None, None);
buttonMask, GrabModeAsync, GrabModeAsync, None, None);
// Set the window context to identify the window handle object
if (XSaveContext (display, (XID) windowH, windowHandleXContext, (XPointer) this))
@@ -3036,11 +3040,12 @@ private:
{}
}
static int getAllEventsMask() noexcept
int getAllEventsMask() const noexcept
{
return NoEventMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask
return NoEventMask | KeyPressMask | KeyReleaseMask
| EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask
| ExposureMask | StructureNotifyMask | FocusChangeMask;
| ExposureMask | StructureNotifyMask | FocusChangeMask
| ((styleFlags & windowIgnoresMouseClicks) != 0 ? (ButtonPressMask | ButtonReleaseMask) : 0);
}
template <typename EventType>


Loading…
Cancel
Save