summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2014-02-21 01:21:17 +1100
committerwm4 <wm4@nowhere>2014-03-12 14:51:07 +0100
commit6402b9dc38729d76a5e4dbb81efd26ab136bc1c1 (patch)
tree67a2b71e4af3f3a26bd53f4d041576d1ef1cd3f1 /video
parentb05803c2e1ee910b33af75f80fbc849101f0eff0 (diff)
downloadmpv-6402b9dc38729d76a5e4dbb81efd26ab136bc1c1.tar.bz2
mpv-6402b9dc38729d76a5e4dbb81efd26ab136bc1c1.tar.xz
w32_common: capture mouse input
Mouse buttons can get stuck down if the button is pressed inside the video window and released outside. Avoid this by capturing mouse input when a button is pressed.
Diffstat (limited to 'video')
-rw-r--r--video/out/w32_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 5b8771fd82..d93592d61e 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -465,6 +465,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
return 0;
}
}
+
+ if (mouse_button & MP_KEY_STATE_DOWN)
+ SetCapture(w32->window);
+ else
+ ReleaseCapture();
}
return DefWindowProcW(hWnd, message, wParam, lParam);