diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 20:50:00 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 20:50:00 +0000 |
commit | 5040dfab473eff732a7fd5ae0572d64f4f42626d (patch) | |
tree | 99d2625c35553f60dc8b59a4f89c8ab68b9be2da /base/message_pump_glib_x.h | |
parent | 22c071b9f2fac7cb6bb75bb4054f9acd440b43e1 (diff) | |
download | chromium_src-5040dfab473eff732a7fd5ae0572d64f4f42626d.zip chromium_src-5040dfab473eff732a7fd5ae0572d64f4f42626d.tar.gz chromium_src-5040dfab473eff732a7fd5ae0572d64f4f42626d.tar.bz2 |
X message pump: Allow adding observers for XEvents.
These observers are slightly different from the normal observers, as in they can
return a value to indicate if the XEvent should be dispatched or not. This will
allow the event observers to act on an event (e.g. SystemKeyEventListener) and
stop the event to be dispatched any farther. This is currently done using
gdk_window_event_filter, but since the X message pump dispatches the X events
before the event reaches GDK, that technique does not work. This is a fix for
that. A future CL will add that support in SystemKeyEventListener using this
observer.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7013003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_glib_x.h')
-rw-r--r-- | base/message_pump_glib_x.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/message_pump_glib_x.h b/base/message_pump_glib_x.h index 60e3b5d..6bd29c9 100644 --- a/base/message_pump_glib_x.h +++ b/base/message_pump_glib_x.h @@ -14,6 +14,8 @@ #include <gtk/gtk.h> #include <X11/X.h> +typedef union _XEvent XEvent; + namespace base { class MessagePumpGlibX : public MessagePumpForUI { @@ -31,6 +33,11 @@ class MessagePumpGlibX : public MessagePumpForUI { private: static void EventDispatcherX(GdkEvent* event, gpointer data); + // Sends the event to the observers. If an observer returns true, then it does + // not send the event to any other observers and returns true. Returns false + // if no observer returns true. + bool WillProcessXEvent(XEvent* xevent); + // Update the lookup table and flag the events that should be captured and // processed so that GDK doesn't get to them. void InitializeEventsToCapture(void); |