diff options
Diffstat (limited to 'unix/tx/TXWindow.cxx')
-rw-r--r-- | unix/tx/TXWindow.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unix/tx/TXWindow.cxx b/unix/tx/TXWindow.cxx index 12e6ebad..1f69702a 100644 --- a/unix/tx/TXWindow.cxx +++ b/unix/tx/TXWindow.cxx @@ -46,6 +46,8 @@ Pixmap TXWindow::dot = 0, TXWindow::tick = 0; const int TXWindow::dotSize = 4, TXWindow::tickSize = 8; char* TXWindow::defaultWindowClass; +TXGlobalEventHandler* TXWindow::globalEventHandler = NULL; + void TXWindow::init(Display* dpy, const char* defaultWindowClass_) { cmap = DefaultColormap(dpy,DefaultScreen(dpy)); @@ -101,6 +103,10 @@ void TXWindow::handleXEvents(Display* dpy) while (XPending(dpy)) { XEvent ev; XNextEvent(dpy, &ev); + if (globalEventHandler) { + if (globalEventHandler->handleGlobalEvent(&ev)) + continue; + } if (ev.type == MappingNotify) { XRefreshKeyboardMapping(&ev.xmapping); } else if (ev.type == PropertyNotify && @@ -117,6 +123,13 @@ void TXWindow::handleXEvents(Display* dpy) } } +TXGlobalEventHandler* TXWindow::setGlobalEventHandler(TXGlobalEventHandler* h) +{ + TXGlobalEventHandler* old = globalEventHandler; + globalEventHandler = h; + return old; +} + void TXWindow::getColours(Display* dpy, XColor* cols, int nCols) { bool* got = new bool[nCols]; |