aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwindow.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-01 16:49:54 +0200
committermarha <marha@users.sourceforge.net>2011-07-01 16:49:54 +0200
commit3bbcbc59b6d98f09b26f39d6208faec76cc6aa3e (patch)
tree3e798726828ac0fa7153e841f77f8d4cf52855db /xorg-server/hw/xwin/winmultiwindowwindow.c
parent83cb62fe8002927ba95861a4fd21cc44c48bfcf7 (diff)
parentd9f970a847e1af706f07560ef163b229bb592307 (diff)
downloadvcxsrv-3bbcbc59b6d98f09b26f39d6208faec76cc6aa3e.tar.gz
vcxsrv-3bbcbc59b6d98f09b26f39d6208faec76cc6aa3e.tar.bz2
vcxsrv-3bbcbc59b6d98f09b26f39d6208faec76cc6aa3e.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/configure.ac libX11/configure.ac mesalib/src/glsl/ast_function.cpp mesalib/src/glsl/ast_to_hir.cpp mesalib/src/glsl/glsl_parser_extras.cpp mesalib/src/glsl/glsl_parser_extras.h mesalib/src/glsl/ir.cpp mesalib/src/glsl/ir.h mesalib/src/glsl/ir_constant_expression.cpp mesalib/src/glsl/ir_validate.cpp mesalib/src/glsl/lower_mat_op_to_vec.cpp mesalib/src/mesa/program/ir_to_mesa.cpp mesalib/src/mesa/state_tracker/st_cb_drawpixels.c mesalib/src/mesa/state_tracker/st_cb_texture.c mesalib/src/mesa/state_tracker/st_context.h mesalib/src/mesa/state_tracker/st_format.h mkfontscale/configure.ac xorg-server/Xext/xvmc.c xorg-server/configure.ac xorg-server/dix/Makefile.am xorg-server/fb/fbarc.c xorg-server/fb/fbgc.c xorg-server/glx/glapi_gentable.c xorg-server/glx/glxdri2.c xorg-server/glx/glxscreens.c xorg-server/hw/xfree86/Makefile.am xorg-server/hw/xfree86/loader/Makefile.am xorg-server/hw/xquartz/X11Application.m xorg-server/hw/xquartz/mach-startup/Makefile.am xorg-server/hw/xwin/XWin.rc xorg-server/hw/xwin/winmultiwindowwindow.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/os/Makefile.am xorg-server/test/Makefile.am xorg-server/xfixes/region.c xorg-server/xkeyboard-config/symbols/ma
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwindow.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index ceb8dff04..600c21ab3 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -433,8 +433,7 @@ winCreateWindowsWindow (WindowPtr pWin)
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
WindowPtr pDaddy;
- DWORD dwStyle;
- DWORD dwExStyle;
+ DWORD dwStyle, dwExStyle;
RECT rc;
winInitMultiWindowClass();
@@ -509,29 +508,35 @@ winCreateWindowsWindow (WindowPtr pWin)
}
}
- /* Create the window */
- /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
+ /* Make it WS_OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
-
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
dwExStyle = WS_EX_TOOLWINDOW;
- rc.top = 0;
- rc.left = 0;
- rc.bottom = iHeight;
- rc.right = iWidth;
+
+ /*
+ Calculate the window coordinates containing the requested client area,
+ being careful to preseve CW_USEDEFAULT
+ */
+ rc.top = (iY != CW_USEDEFAULT) ? iY : 0;
+ rc.left = (iX != CW_USEDEFAULT) ? iX : 0;
+ rc.bottom = rc.top + iHeight;
+ rc.right = rc.left + iWidth;
AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+ if (iY != CW_USEDEFAULT) iY = rc.top;
+ if (iX != CW_USEDEFAULT) iX = rc.left;
iHeight = rc.bottom - rc.top;
iWidth = rc.right - rc.left;
- winDebug("winCreateWindowsWindow - window size %dx%d\n", iWidth, iHeight);
+ winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
- hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
+ /* Create the window */
+ hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
WINDOW_CLASS_X, /* Class name */
WINDOW_TITLE_X, /* Window name */
dwStyle, /* Styles */
iX, /* Horizontal position */
iY, /* Vertical position */
- iWidth, /* Right edge */
+ iWidth, /* Right edge */
iHeight, /* Bottom edge */
hFore, /* Null or Parent window if transient*/
(HMENU) NULL, /* No menu */
@@ -549,14 +554,15 @@ winCreateWindowsWindow (WindowPtr pWin)
if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
- /* If we asked the native WM to place the window, synchronize the X window position */
- if (iX == CW_USEDEFAULT)
- winAdjustXWindow(pWin, hWnd);
-
/* Change style back to popup, already placed... */
SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowPos (hWnd, 0, 0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
+ /* If we asked the native WM to place the window, synchronize the X window position */
+ if (iX == CW_USEDEFAULT)
+ winAdjustXWindow(pWin, hWnd);
+
/* Make sure it gets the proper system menu for a WS_POPUP, too */
GetSystemMenu (hWnd, TRUE);