summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-11-04 15:12:47 +0100
committerMichal Krol <[email protected]>2010-11-04 15:12:47 +0100
commit5d28d2f9d4eb783dbf738e36bf60c6c5275d1db9 (patch)
tree09f8bbd0d48487f2947e7f9d7e08d08167436378 /src/gallium/targets
parentc69979f243fe7ac15d638f9b2b5cf35b30b07939 (diff)
graw/gdi: Fix window dimensions.
The requested window size is of the client area, so account for surrounding borders and bars when creating the window.
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/graw-gdi/graw_gdi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/targets/graw-gdi/graw_gdi.c b/src/gallium/targets/graw-gdi/graw_gdi.c
index 018b1539843..52a4e3cb231 100644
--- a/src/gallium/targets/graw-gdi/graw_gdi.c
+++ b/src/gallium/targets/graw-gdi/graw_gdi.c
@@ -68,6 +68,8 @@ graw_create_window_and_screen(int x,
struct sw_winsys *winsys = NULL;
struct pipe_screen *screen = NULL;
WNDCLASSEX wc = {sizeof(wc)};
+ UINT style = WS_VISIBLE | WS_TILEDWINDOW;
+ RECT rect;
HWND hWnd = NULL;
HDC hDC = NULL;
@@ -91,14 +93,17 @@ graw_create_window_and_screen(int x,
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
RegisterClassEx(&wc);
+ SetRect(&rect, 0, 0, width, height);
+ AdjustWindowRectEx(&rect, style, FALSE, 0);
+
hWnd = CreateWindowEx(0,
wc.lpszClassName,
wc.lpszClassName,
- WS_VISIBLE | WS_TILEDWINDOW,
+ style,
x,
y,
- width,
- height,
+ rect.right - rect.left,
+ rect.bottom - rect.top,
NULL,
NULL,
wc.hInstance,