winex11: Create the whole window at window creation time.
This commit is contained in:
parent
a76f60d14e
commit
ea07c310ec
|
@ -1176,8 +1176,7 @@ BOOL set_win_format( HWND hwnd, XID fbconfig_id )
|
||||||
|
|
||||||
if (!(format = pixelformat_from_fbconfig_id( fbconfig_id ))) return FALSE;
|
if (!(format = pixelformat_from_fbconfig_id( fbconfig_id ))) return FALSE;
|
||||||
|
|
||||||
if (!(data = X11DRV_get_win_data(hwnd)) &&
|
if (!(data = X11DRV_get_win_data(hwnd))) return FALSE;
|
||||||
!(data = X11DRV_create_win_data(hwnd))) return FALSE;
|
|
||||||
|
|
||||||
gl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*gl) );
|
gl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*gl) );
|
||||||
gl->pixel_format = format;
|
gl->pixel_format = format;
|
||||||
|
|
|
@ -517,10 +517,7 @@ static void dock_systray_icon( Display *display, struct tray_icon *icon, Window
|
||||||
icon->window = CreateWindowW( icon_classname, NULL, WS_CLIPSIBLINGS | WS_POPUP,
|
icon->window = CreateWindowW( icon_classname, NULL, WS_CLIPSIBLINGS | WS_POPUP,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, icon_cx, icon_cy,
|
CW_USEDEFAULT, CW_USEDEFAULT, icon_cx, icon_cy,
|
||||||
NULL, NULL, NULL, icon );
|
NULL, NULL, NULL, icon );
|
||||||
if (!icon->window) return;
|
if (!(data = X11DRV_get_win_data( icon->window ))) return;
|
||||||
|
|
||||||
if (!(data = X11DRV_get_win_data( icon->window )) &&
|
|
||||||
!(data = X11DRV_create_win_data( icon->window ))) return;
|
|
||||||
|
|
||||||
TRACE( "icon window %p/%lx managed %u\n", data->hwnd, data->whole_window, data->managed );
|
TRACE( "icon window %p/%lx managed %u\n", data->hwnd, data->whole_window, data->managed );
|
||||||
|
|
||||||
|
|
|
@ -911,12 +911,9 @@ static Window get_owner_whole_window( HWND owner, BOOL force_managed )
|
||||||
|
|
||||||
if (!owner) return 0;
|
if (!owner) return 0;
|
||||||
|
|
||||||
if (!(data = X11DRV_get_win_data( owner )))
|
if (!(data = X11DRV_get_win_data( owner ))) return (Window)GetPropA( owner, whole_window_prop );
|
||||||
{
|
|
||||||
if (!(data = X11DRV_create_win_data( owner )))
|
if (!data->managed && force_managed) /* make it managed */
|
||||||
return (Window)GetPropA( owner, whole_window_prop );
|
|
||||||
}
|
|
||||||
else if (!data->managed && force_managed) /* make it managed */
|
|
||||||
{
|
{
|
||||||
SetWindowPos( owner, 0, 0, 0, 0, 0,
|
SetWindowPos( owner, 0, 0, 0, 0, 0,
|
||||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE |
|
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE |
|
||||||
|
@ -1722,7 +1719,8 @@ struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd )
|
||||||
*
|
*
|
||||||
* Create an X11 data window structure for an existing window.
|
* Create an X11 data window structure for an existing window.
|
||||||
*/
|
*/
|
||||||
struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd )
|
static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *window_rect,
|
||||||
|
const RECT *client_rect )
|
||||||
{
|
{
|
||||||
Display *display;
|
Display *display;
|
||||||
struct x11drv_win_data *data;
|
struct x11drv_win_data *data;
|
||||||
|
@ -1733,16 +1731,11 @@ struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd )
|
||||||
/* don't create win data for HWND_MESSAGE windows */
|
/* don't create win data for HWND_MESSAGE windows */
|
||||||
if (parent != GetDesktopWindow() && !GetAncestor( parent, GA_PARENT )) return NULL;
|
if (parent != GetDesktopWindow() && !GetAncestor( parent, GA_PARENT )) return NULL;
|
||||||
|
|
||||||
if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) return NULL;
|
|
||||||
|
|
||||||
display = thread_init_display();
|
display = thread_init_display();
|
||||||
if (!(data = alloc_win_data( display, hwnd ))) return NULL;
|
if (!(data = alloc_win_data( display, hwnd ))) return NULL;
|
||||||
|
|
||||||
GetWindowRect( hwnd, &data->window_rect );
|
data->whole_rect = data->window_rect = *window_rect;
|
||||||
MapWindowPoints( 0, parent, (POINT *)&data->window_rect, 2 );
|
data->client_rect = *client_rect;
|
||||||
data->whole_rect = data->window_rect;
|
|
||||||
GetClientRect( hwnd, &data->client_rect );
|
|
||||||
MapWindowPoints( hwnd, parent, (POINT *)&data->client_rect, 2 );
|
|
||||||
|
|
||||||
if (parent == GetDesktopWindow())
|
if (parent == GetDesktopWindow())
|
||||||
{
|
{
|
||||||
|
@ -2076,14 +2069,8 @@ void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flag
|
||||||
const RECT *window_rect, const RECT *client_rect, RECT *visible_rect )
|
const RECT *window_rect, const RECT *client_rect, RECT *visible_rect )
|
||||||
{
|
{
|
||||||
struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
|
struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
|
||||||
DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
|
|
||||||
|
|
||||||
if (!data)
|
if (!data && !(data = X11DRV_create_win_data( hwnd, window_rect, client_rect ))) return;
|
||||||
{
|
|
||||||
/* create the win data if the window is being made visible */
|
|
||||||
if (!(style & WS_VISIBLE) && !(swp_flags & SWP_SHOWWINDOW)) return;
|
|
||||||
if (!(data = X11DRV_create_win_data( hwnd ))) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if we need to switch the window to managed */
|
/* check if we need to switch the window to managed */
|
||||||
if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, window_rect ))
|
if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, window_rect ))
|
||||||
|
|
|
@ -551,7 +551,6 @@ struct x11drv_win_data
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
|
extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
|
||||||
extern struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
||||||
extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN;
|
||||||
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
|
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue