Commit b8774f95 authored by Alexandre Julliard's avatar Alexandre Julliard

Serge Ivanov

SetParent: call SetWindowPos with SWP_NOACTIVATE flag set.
parent 7f30083b
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "winproc.h" #include "winproc.h"
#include "task.h" #include "task.h"
#include "thread.h" #include "thread.h"
#include "process.h"
#include "winerror.h" #include "winerror.h"
#include "mdi.h" #include "mdi.h"
#include "local.h" #include "local.h"
...@@ -36,8 +35,8 @@ ...@@ -36,8 +35,8 @@
#include "stackframe.h" #include "stackframe.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win) DEFAULT_DEBUG_CHANNEL(win);
DECLARE_DEBUG_CHANNEL(msg) DECLARE_DEBUG_CHANNEL(msg);
/**********************************************************************/ /**********************************************************************/
...@@ -699,10 +698,15 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -699,10 +698,15 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
/* Fix the coordinates */ /* Fix the coordinates */
if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16) if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16 ||
cs->cx == CW_USEDEFAULT || cs->cx == CW_USEDEFAULT16)
{ {
PDB *pdb = PROCESS_Current(); STARTUPINFOA info;
info.dwFlags = 0;
if (!(cs->style & (WS_CHILD | WS_POPUP))) GetStartupInfoA( &info );
if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16)
{
/* Never believe Microsoft's documentation... CreateWindowEx doc says /* Never believe Microsoft's documentation... CreateWindowEx doc says
* that if an overlapped window is created with WS_VISIBLE style bit * that if an overlapped window is created with WS_VISIBLE style bit
* set and the x parameter is set to CW_USEDEFAULT, the system ignores * set and the x parameter is set to CW_USEDEFAULT, the system ignores
...@@ -720,33 +724,13 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, ...@@ -720,33 +724,13 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
* the one that comes with Win95 and NT) * the one that comes with Win95 and NT)
*/ */
if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) sw = cs->y; if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) sw = cs->y;
cs->x = (info.dwFlags & STARTF_USEPOSITION) ? info.dwX : 0;
/* We have saved cs->y, now we can trash it */ cs->y = (info.dwFlags & STARTF_USEPOSITION) ? info.dwY : 0;
if ( !(cs->style & (WS_CHILD | WS_POPUP))
&& (pdb->env_db->startup_info->dwFlags & STARTF_USEPOSITION) )
{
cs->x = pdb->env_db->startup_info->dwX;
cs->y = pdb->env_db->startup_info->dwY;
}
else
{
cs->x = 0;
cs->y = 0;
}
} }
if (cs->cx == CW_USEDEFAULT || cs->cx == CW_USEDEFAULT16) if (cs->cx == CW_USEDEFAULT || cs->cx == CW_USEDEFAULT16)
{ {
PDB *pdb = PROCESS_Current(); cs->cx = (info.dwFlags & STARTF_USESIZE) ? info.dwXSize : 0;
if ( !(cs->style & (WS_CHILD | WS_POPUP)) cs->cy = (info.dwFlags & STARTF_USESIZE) ? info.dwYSize : 0;
&& (pdb->env_db->startup_info->dwFlags & STARTF_USESIZE) )
{
cs->cx = pdb->env_db->startup_info->dwXSize;
cs->cy = pdb->env_db->startup_info->dwYSize;
}
else
{
cs->cx = 600; /* FIXME */
cs->cy = 400;
} }
} }
...@@ -2409,7 +2393,7 @@ HWND WINAPI SetParent( HWND hwndChild, HWND hwndNewParent ) ...@@ -2409,7 +2393,7 @@ HWND WINAPI SetParent( HWND hwndChild, HWND hwndNewParent )
WM_WINDOWPOSCHANGED notification messages. WM_WINDOWPOSCHANGED notification messages.
*/ */
SetWindowPos( hwndChild, HWND_TOPMOST, 0, 0, 0, 0, SetWindowPos( hwndChild, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE|SWP_NOSIZE|((dwStyle & WS_VISIBLE)?SWP_SHOWWINDOW:0)); SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|((dwStyle & WS_VISIBLE)?SWP_SHOWWINDOW:0));
/* FIXME: a WM_MOVE is also generated (in the DefWindowProc handler /* FIXME: a WM_MOVE is also generated (in the DefWindowProc handler
* for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE */ * for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment