[UFO-devel] Events and layered panes
Status: Beta
Brought to you by:
schmidtjf
From: Andreas B. <b_...@gm...> - 2005-11-30 23:00:55
|
Hi attached is a patch that I have sent before, I believe (or at least mentioned). It implements layered pane compatible event handling. Umm, well, this patch has been used in Boson for quite some time, here the comment in my README about this patch: - Patch to uabstractcontext.hpp, uabstractcontext.cpp and uwidget.cpp to improve events for our needs: Instead of delivering a mouse event to root->getVisibleWidgetAt(), we implement a getVisibleWidgetsDFS() function, that starts at the root and finds all currently visible widgets (at the relevant point) using a depth first search and returns them in a stack. We then dispatch it to every widget on the stack until one widget consumes the event (in that case we stop then). This especially fixes layered panes: previously an event was delivered to the topmost layer only and to the layered pane itself, if the widget was not interested in that event. Now the event is first delivered to the topmost layer, then to the layers below it, then to the layered pane. This patch makes pretty much the difference between "libufo is usable" and "libufo is unusable" for us: it is extremely important that a click on a button is dispatched to the button and clicks on everything else is delivered to the stuff below that. (yeah, that was the simple version) I have been maintaining this patch for 2 or 3 libufo updates already and it starts to go on my nerves. I know that my (non-trivial) patches are not very liked here, so is there any chance this every makes it to official cvs? If not I'll investigate whether it is possible to subclass ufo::UAbstractContext instead and achieve the same in our extension library, so that I don't have to re-apply the patches every time (well - at least not all of them. The ufo::UWidget::dispatchEvent() part cannot be done outside of libufo). CU Andi |