summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2011-10-28 12:39:43 +0200
committerwm4 <wm4@mplayer2.org>2012-03-17 20:58:16 +0100
commit32de5df90cfa6102dc339410bb85a0784ecec61e (patch)
tree13652c46ced1f2dbcc9b9582d91747fd45819c49
parent2449cbde2c31e1429fd8507880d68721cf95efe1 (diff)
downloadmpv-32de5df90cfa6102dc339410bb85a0784ecec61e.tar.bz2
mpv-32de5df90cfa6102dc339410bb85a0784ecec61e.tar.xz
win32, vo_directx: don't use vo_dx/dy, directly query window position
This should be a bit robuster than trying to maintain vo_dx/dy. vo_dy/dy are now completely unused on win32, except for initialization.
-rw-r--r--libvo/vo_directx.c7
-rw-r--r--libvo/w32_common.c11
2 files changed, 9 insertions, 9 deletions
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c
index 1c8519048b..1c23d15f95 100644
--- a/libvo/vo_directx.c
+++ b/libvo/vo_directx.c
@@ -458,8 +458,11 @@ static uint32_t Directx_ManageDisplay(void)
DWORD dwUpdateFlags = 0;
int width, height;
- rd.left = vo_dx - xinerama_x;
- rd.top = vo_dy - xinerama_y;
+ POINT origin = { 0, 0 };
+ ClientToScreen(vo_w32_window, &origin);
+
+ rd.left = origin.x - xinerama_x;
+ rd.top = origin.y - xinerama_y;
width = vo_dwidth;
height = vo_dheight;
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index a1565efde0..563fedeafa 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -117,9 +117,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
p.x = 0;
p.y = 0;
ClientToScreen(vo_window, &p);
- vo_dx = window_x = p.x;
- vo_dy = window_y = p.y;
- mp_msg(MSGT_VO, MSGL_V, "[vo] move window: %d:%d\n", vo_dx, vo_dy);
+ window_x = p.x;
+ window_y = p.y;
+ mp_msg(MSGT_VO, MSGL_V, "[vo] move window: %d:%d\n",
+ window_x, window_y);
break;
case WM_SIZE:
event_flags |= VO_EVENT_RESIZE;
@@ -493,10 +494,6 @@ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) {
GetClientRect(vo_window, &r);
vo_dwidth = r.right;
vo_dheight = r.bottom;
- // restore these as well, xxx change vo_directx instead to query
- // the window bounds instead of using this
- vo_dx = window_x;
- vo_dy = window_y;
} else {
// first vo_config call; vo_config() will always set vo_dx/dy so
// that the window is centered on the screen, and this is the only