From 2b14977eeda7f835aaf1c75ea8ccee9e97defb81 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 30 Dec 2019 05:34:01 +0100 Subject: [PATCH] source/Platform/Unix/X11Display.cpp: register with X11WindowEventHandler --- source/Platform/Unix/X11Display.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Platform/Unix/X11Display.cpp b/source/Platform/Unix/X11Display.cpp index 217c21c..21308a1 100644 --- a/source/Platform/Unix/X11Display.cpp +++ b/source/Platform/Unix/X11Display.cpp @@ -1,6 +1,7 @@ #include // Prevents conflict with X.h defining "None" #include +#include "X11WindowEventHandler.h" #include "X11SharedDisplay.h" #include "GLXContext.h" #include "X11Display.h" @@ -45,6 +46,9 @@ bool X11Display::create(DisplayDescription description) InputOutput, DefaultVisual(m_disp, m_screen), CWBackPixel | CWColormap | CWBorderPixel | CWEventMask, &attr); + // Register event handler + X11WindowEventHandler::registerHandler(m_disp, m_win, this); + // X11 does not handle pressing the X button on a window. // that is the job of the window manager. // Here we can request the WM to send us a delete event so we can handle it ourself. @@ -66,6 +70,10 @@ bool X11Display::create(DisplayDescription description) void X11Display::destroy() { + if (m_win) { + X11WindowEventHandler::unregisterHandler(m_disp, m_win); + } + if (m_disp) { XReleaseDisplay(); m_disp = NULL;