summaryrefslogtreecommitdiff
path: root/otk
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-18 11:34:29 +0000
committerDana Jansens <danakj@orodu.net>2002-12-18 11:34:29 +0000
commit77a8e11660edd66279f2d3def6de3768874ba780 (patch)
treec384644ec055df2dc0a8954d09b7a2f523044b38 /otk
parentdb23fe0584b9d7ece147ef74c7ad6d45ff7ba6fd (diff)
can tell where events are coming from!
Diffstat (limited to 'otk')
-rw-r--r--otk/eventdispatcher.cc12
-rw-r--r--otk/eventdispatcher.hh2
2 files changed, 11 insertions, 3 deletions
diff --git a/otk/eventdispatcher.cc b/otk/eventdispatcher.cc
index a6d25624..33d8ba2d 100644
--- a/otk/eventdispatcher.cc
+++ b/otk/eventdispatcher.cc
@@ -34,8 +34,6 @@ void OtkEventDispatcher::clearHandler(Window id)
_map.erase(id);
}
-//#include <stdio.h>
-#include <stdio.h>
void OtkEventDispatcher::dispatchEvents(void)
{
XEvent e;
@@ -45,7 +43,7 @@ void OtkEventDispatcher::dispatchEvents(void)
while (XPending(OBDisplay::display)) {
XNextEvent(OBDisplay::display, &e);
-#if defined(DEBUG) && 0
+#if 0
printf("Event %d window %lx\n", e.type, e.xany.window);
#endif
@@ -91,4 +89,12 @@ void OtkEventDispatcher::dispatchEvents(void)
}
}
+OtkEventHandler *OtkEventDispatcher::findHandler(Window win)
+{
+ OtkEventMap::iterator it = _map.find(win);
+ if (it != _map.end())
+ return it->second;
+ return 0;
+}
+
}
diff --git a/otk/eventdispatcher.hh b/otk/eventdispatcher.hh
index b56445a4..9f7fb865 100644
--- a/otk/eventdispatcher.hh
+++ b/otk/eventdispatcher.hh
@@ -29,6 +29,8 @@ public:
inline void setMasterHandler(OtkEventHandler *master)
{ _master = master; }
OtkEventHandler *getMasterHandler(void) const { return _master; }
+
+ OtkEventHandler *findHandler(Window win);
private:
OtkEventMap _map;