]>
Dogcows Code - chaz/openbox/blob - otk/eventdispatcher.cc
75a06ea1489aec97ef8ac7203cfb21c670576fc8
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "eventdispatcher.hh"
13 OtkEventDispatcher::OtkEventDispatcher()
18 OtkEventDispatcher::~OtkEventDispatcher()
22 void OtkEventDispatcher::clearAllHandlers(void)
27 void OtkEventDispatcher::registerHandler(Window id
, OtkEventHandler
*handler
)
29 _map
.insert(std::pair
<Window
, OtkEventHandler
*>(id
, handler
));
32 void OtkEventDispatcher::clearHandler(Window id
)
37 void OtkEventDispatcher::dispatchEvents(void)
40 OtkEventHandler
*handler
;
41 OtkEventMap::iterator it
;
43 while (XPending(OBDisplay::display
)) {
44 XNextEvent(OBDisplay::display
, &e
);
46 it
= _map
.find(e
.xany
.window
);
56 // some events have to be handled anyways!
57 if (e
.type
== ConfigureRequest
) {
60 xwc
.x
= e
.xconfigurerequest
.x
;
61 xwc
.y
= e
.xconfigurerequest
.y
;
62 xwc
.width
= e
.xconfigurerequest
.width
;
63 xwc
.height
= e
.xconfigurerequest
.height
;
64 xwc
.border_width
= e
.xconfigurerequest
.border_width
;
65 xwc
.sibling
= e
.xconfigurerequest
.above
;
66 xwc
.stack_mode
= e
.xconfigurerequest
.detail
;
68 XConfigureWindow(OBDisplay::display
, e
.xconfigurerequest
.window
,
69 e
.xconfigurerequest
.value_mask
, &xwc
);
This page took 0.041354 seconds and 4 git commands to generate.