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

Unified Diff: components/mus/ws/display_manager.cc

Issue 1677513002: mus Window Server: implement event capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « components/mus/ws/display_manager.h ('k') | components/mus/ws/display_manager_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/display_manager.cc
diff --git a/components/mus/ws/display_manager.cc b/components/mus/ws/display_manager.cc
index 9c1df7533fef0fe55e60b7107fdc8ca3a7c4b854..b658476618f5b65749d206c59e754d922ad2a767 100644
--- a/components/mus/ws/display_manager.cc
+++ b/components/mus/ws/display_manager.cc
@@ -235,6 +235,14 @@ void DefaultDisplayManager::SetTitle(const base::string16& title) {
platform_window_->SetTitle(title);
}
+void DefaultDisplayManager::SetCapture() {
+ platform_window_->SetCapture();
+}
+
+void DefaultDisplayManager::ReleaseCapture() {
+ platform_window_->ReleaseCapture();
+}
+
void DefaultDisplayManager::SetCursorById(int32_t cursor_id) {
#if !defined(OS_ANDROID)
// TODO(erg): This still isn't sufficient, and will only use native cursors
@@ -353,19 +361,6 @@ void DefaultDisplayManager::OnDamageRect(const gfx::Rect& damaged_region) {
void DefaultDisplayManager::DispatchEvent(ui::Event* event) {
delegate_->OnEvent(*event);
- switch (event->type()) {
- case ui::ET_MOUSE_PRESSED:
- case ui::ET_TOUCH_PRESSED:
- platform_window_->SetCapture();
- break;
- case ui::ET_MOUSE_RELEASED:
- case ui::ET_TOUCH_RELEASED:
- platform_window_->ReleaseCapture();
- break;
- default:
- break;
- }
-
#if defined(USE_X11)
// We want to emulate the WM_CHAR generation behaviour of Windows.
//
@@ -402,7 +397,9 @@ void DefaultDisplayManager::OnClosed() {
void DefaultDisplayManager::OnWindowStateChanged(
ui::PlatformWindowState new_state) {}
-void DefaultDisplayManager::OnLostCapture() {}
+void DefaultDisplayManager::OnLostCapture() {
+ delegate_->OnNativeCaptureLost();
+}
void DefaultDisplayManager::OnAcceleratedWidgetAvailable(
gfx::AcceleratedWidget widget,
« no previous file with comments | « components/mus/ws/display_manager.h ('k') | components/mus/ws/display_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698