mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Linux: Remove embedded OpenGL window events from event queue when destroying
This fixes BadWindow errors from Expose events that may be processed after the window is destroyed.
This commit is contained in:
parent
3dc97ec71c
commit
22777e5480
1 changed files with 12 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ public:
|
|||
XSetWindowAttributes swa;
|
||||
swa.colormap = colourMap;
|
||||
swa.border_pixel = 0;
|
||||
swa.event_mask = ExposureMask | StructureNotifyMask;
|
||||
swa.event_mask = embeddedWindowEventMask;
|
||||
|
||||
auto glBounds = component.getTopLevelComponent()
|
||||
->getLocalArea (&component, component.getLocalBounds());
|
||||
|
|
@ -133,9 +133,18 @@ public:
|
|||
if (embeddedWindow != 0)
|
||||
{
|
||||
XWindowSystemUtilities::ScopedXLock xLock;
|
||||
|
||||
X11Symbols::getInstance()->xUnmapWindow (display, embeddedWindow);
|
||||
X11Symbols::getInstance()->xDestroyWindow (display, embeddedWindow);
|
||||
X11Symbols::getInstance()->xSync (display, False);
|
||||
|
||||
XEvent event;
|
||||
while (X11Symbols::getInstance()->xCheckWindowEvent (display,
|
||||
embeddedWindow,
|
||||
embeddedWindowEventMask,
|
||||
&event) == True)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -233,6 +242,8 @@ public:
|
|||
struct Locker { Locker (NativeContext&) {} };
|
||||
|
||||
private:
|
||||
static constexpr int embeddedWindowEventMask = ExposureMask | StructureNotifyMask;
|
||||
|
||||
Component& component;
|
||||
GLXContext renderContext = {};
|
||||
Window embeddedWindow = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue