Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: views/widget/tooltip_manager_views.cc

Issue 7464027: Wayland support for views. views_desktop on Wayland. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated native_widget_wayland.cc to match compositor changes Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/tooltip_manager_views.h ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/tooltip_manager_views.cc
diff --git a/views/widget/tooltip_manager_views.cc b/views/widget/tooltip_manager_views.cc
index 4c0a7282abe4d947250d3f405bf759053f5462e1..b952b093bb092e4014561e165e36474f22c547ac 100644
--- a/views/widget/tooltip_manager_views.cc
+++ b/views/widget/tooltip_manager_views.cc
@@ -21,6 +21,10 @@
#include "views/widget/native_widget.h"
#include "views/widget/root_view.h"
+#if defined(USE_WAYLAND)
+#include "ui/wayland/events/wayland_event.h"
+#endif
+
namespace {
SkColor kTooltipBackground = 0xFF7F7F00;
int kTooltipTimeoutMs = 500;
@@ -100,6 +104,21 @@ void TooltipManagerViews::HideKeyboardTooltip() {
NOTREACHED();
}
+#if defined(USE_WAYLAND)
+base::MessagePumpObserver::EventStatus TooltipManagerViews::WillProcessEvent(
+ ui::WaylandEvent* event) {
+ if (event->type == ui::WAYLAND_MOTION) {
+ if (tooltip_timer_.IsRunning())
+ tooltip_timer_.Reset();
+ curr_mouse_pos_.SetPoint(event->motion.x, event->motion.y);
+
+ // If tooltip is visible, we may want to hide it. If it is not, we are ok.
+ if (tooltip_widget_->IsVisible())
+ UpdateIfRequired(curr_mouse_pos_.x(), curr_mouse_pos_.y(), false);
+ }
+ return base::MessagePumpObserver::EVENT_CONTINUE;
+}
+#else
base::MessagePumpObserver::EventStatus TooltipManagerViews::WillProcessXEvent(
XEvent* xevent) {
XGenericEventCookie* cookie = &xevent->xcookie;
@@ -115,6 +134,7 @@ base::MessagePumpObserver::EventStatus TooltipManagerViews::WillProcessXEvent(
}
return base::MessagePumpObserver::EVENT_CONTINUE;
}
+#endif
void TooltipManagerViews::TooltipTimerFired() {
if (tooltip_widget_->IsVisible()) {
« no previous file with comments | « views/widget/tooltip_manager_views.h ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698