summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 05:47:26 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-29 05:47:26 +0000
commit90a817189b38dd00dbf2dd166a6deac6f50f1286 (patch)
tree6ee8a4bde30c575bc914fc7445cf6947a58b67b9 /ui/base
parent3ef57580d094c6d7444ba39b0fa944115b901dd4 (diff)
downloadchromium_src-90a817189b38dd00dbf2dd166a6deac6f50f1286.zip
chromium_src-90a817189b38dd00dbf2dd166a6deac6f50f1286.tar.gz
chromium_src-90a817189b38dd00dbf2dd166a6deac6f50f1286.tar.bz2
When locking the screen via Ctrl-Shift-L from wrench menu,
login screen menus do not work, because wrench menu is not fully closed. Made Noop events always make it to inner loop in the nested_dispatcher such that the menu can fully close itself via noop event. Bug=113247 Testing=Manual Review URL: http://codereview.chromium.org/9381008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/cocoa/events_mac.mm4
-rw-r--r--ui/base/events.h3
-rw-r--r--ui/base/win/events_win.cc6
-rw-r--r--ui/base/x/events_x.cc22
4 files changed, 31 insertions, 4 deletions
diff --git a/ui/base/cocoa/events_mac.mm b/ui/base/cocoa/events_mac.mm
index f40d755..a3ae73b 100644
--- a/ui/base/cocoa/events_mac.mm
+++ b/ui/base/cocoa/events_mac.mm
@@ -179,6 +179,10 @@ bool GetScrollOffsets(const base::NativeEvent& native_event,
return false;
}
+bool IsNoopEvent(base::NativeEvent event) {
+ return ([event type] == NSApplicationDefined && [event subtype] == 0);
+}
+
base::NativeEvent CreateNoopEvent() {
return [NSEvent otherEventWithType:NSApplicationDefined
location:NSZeroPoint
diff --git a/ui/base/events.h b/ui/base/events.h
index 354c186..0334d10 100644
--- a/ui/base/events.h
+++ b/ui/base/events.h
@@ -169,6 +169,9 @@ UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event,
double* start_time,
double* end_time);
+// Returns true if event is noop.
+UI_EXPORT bool IsNoopEvent(base::NativeEvent event);
+
// Creates and returns no-op event.
UI_EXPORT base::NativeEvent CreateNoopEvent();
diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc
index d3557f2..0207e31 100644
--- a/ui/base/win/events_win.cc
+++ b/ui/base/win/events_win.cc
@@ -266,9 +266,13 @@ void UpdateDeviceList() {
NOTIMPLEMENTED();
}
+bool IsNoopEvent(base::NativeEvent event) {
+ return event.message == WM_USER + 310;
+}
+
base::NativeEvent CreateNoopEvent() {
MSG event = { NULL };
- event.message = WM_USER;
+ event.message = WM_USER + 310;
return event;
}
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index fc61637..23ebd51 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -388,6 +388,14 @@ float GetTouchParamFromXEvent(XEvent* xev,
return default_value;
}
+#if !defined(TOOLKIT_USES_GTK)
+Atom GetNoopEventAtom() {
+ return XInternAtom(
+ base::MessagePumpX::GetDefaultXDisplay(),
+ "noop", False);
+}
+#endif
+
} // namespace
namespace ui {
@@ -701,6 +709,16 @@ void UpdateDeviceList() {
TouchFactory::GetInstance()->UpdateDeviceList(display);
}
+bool IsNoopEvent(base::NativeEvent event) {
+#if defined(TOOLKIT_USES_GTK)
+ NOTREACHED();
+ return false;
+#else
+ return (event->type == ClientMessage &&
+ event->xclient.message_type == GetNoopEventAtom());
+#endif
+}
+
base::NativeEvent CreateNoopEvent() {
static XEvent* noop = NULL;
if (!noop) {
@@ -717,9 +735,7 @@ base::NativeEvent CreateNoopEvent() {
#else
// Make sure we use atom from current xdisplay, which may
// change during the test.
- noop->xclient.message_type = XInternAtom(
- base::MessagePumpX::GetDefaultXDisplay(),
- "noop", False);
+ noop->xclient.message_type = GetNoopEventAtom();
#endif
return noop;
}