summaryrefslogtreecommitdiffstats
path: root/ui/aura/root_window_host_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/aura/root_window_host_win.cc')
-rw-r--r--ui/aura/root_window_host_win.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/ui/aura/root_window_host_win.cc b/ui/aura/root_window_host_win.cc
index 705cf9a..a4f60b6 100644
--- a/ui/aura/root_window_host_win.cc
+++ b/ui/aura/root_window_host_win.cc
@@ -115,6 +115,7 @@ gfx::Size RootWindowHost::GetNativeScreenSize() {
RootWindowHostWin::RootWindowHostWin(const gfx::Rect& bounds)
: root_window_(NULL),
fullscreen_(false),
+ has_capture_(false),
saved_window_style_(0),
saved_window_ex_style_(0) {
Init(NULL, bounds);
@@ -223,6 +224,20 @@ void RootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) {
::SetCursor(LoadCursor(NULL, cursor_id));
}
+void RootWindowHostWin::SetCapture() {
+ if (!has_capture_) {
+ has_capture_ = true;
+ ::SetCapture(hwnd());
+ }
+}
+
+void RootWindowHostWin::ReleaseCapture() {
+ if (has_capture_) {
+ has_capture_ = false;
+ ::ReleaseCapture();
+ }
+}
+
void RootWindowHostWin::ShowCursor(bool show) {
// NOTIMPLEMENTED();
}
@@ -284,6 +299,16 @@ LRESULT RootWindowHostWin::OnMouseRange(UINT message,
return 0;
}
+LRESULT RootWindowHostWin::OnCaptureChanged(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ if (has_capture_) {
+ has_capture_ = false;
+ root_window_->SetCapture(NULL);
+ }
+ return 0;
+}
+
void RootWindowHostWin::OnPaint(HDC dc) {
root_window_->Draw();
ValidateRect(hwnd(), NULL);