Author: fireball
Date: Fri Jan 7 21:53:30 2011
New Revision: 50316
URL:
http://svn.reactos.org/svn/reactos?rev=50316&view=rev
Log:
- Use updated SWM interface in winent.drv, and cleanup code.
Modified:
branches/arwinss/reactos/dll/win32/winent.drv/window.c
Modified: branches/arwinss/reactos/dll/win32/winent.drv/window.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/window.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/window.c [iso-8859-1] Fri Jan 7
21:53:30 2011
@@ -27,7 +27,7 @@
static const char whole_window_prop[] = "__arwin_nt_whole_window";
static const char client_window_prop[]= "__arwin_nt_client_window";
-GR_WINDOW_ID root_window = 2;
+GR_WINDOW_ID root_window = SWM_ROOT_WINDOW_ID;
/* FUNCTIONS **************************************************************/
@@ -153,7 +153,7 @@
{
WARN("RosDrv_CreateWindow(%x)\n", hwnd);
- if (hwnd == GetDesktopWindow() /*&& root_window != GR_ROOT_WINDOW_ID*/)
+ if (hwnd == GetDesktopWindow() /*&& root_window != SWM_ROOT_WINDOW_ID*/)
{
/* create desktop win data */
if (!NTDRV_create_desktop_win_data( hwnd )) return FALSE;
@@ -244,8 +244,7 @@
if (!data->whole_window) return;
TRACE( "win %p xwin %lx/%lx\n", data->hwnd, data->whole_window,
data->client_window );
- //if (!already_destroyed) GrDestroyWindow( data->whole_window );
- if (!already_destroyed) SwmRemoveWindow( data->hwnd );
+ if (!already_destroyed) SwmDestroyWindow( data->whole_window );
data->whole_window = data->client_window = 0;
//data->wm_state = WithdrawnState;
//data->net_wm_state = 0;
@@ -288,8 +287,7 @@
TRACE( "win %p/%lx\n", data->hwnd, data->whole_window );
//sync_window_style( display, data );
- //GrMapWindow( data->whole_window );
- SwmShowWindow( data->hwnd, TRUE, 0 );
+ SwmShowWindow( data->whole_window, TRUE, 0 );
data->mapped = TRUE;
data->iconic = (new_style & WS_MINIMIZE) != 0;
@@ -303,8 +301,7 @@
{
TRACE( "win %p/%lx\n", data->hwnd, data->whole_window );
- //GrUnmapWindow( data->whole_window );
- SwmShowWindow( data->hwnd, FALSE, 0 );
+ SwmShowWindow( data->whole_window, FALSE, 0 );
data->mapped = FALSE;
//data->net_wm_state = 0;
@@ -325,7 +322,7 @@
if (data->iconic) return;
- SwmPosChanged(data->hwnd, &data->whole_rect, old_whole_rect, NULL,
swp_flags);
+ SwmPosChanged(data->whole_window, &data->whole_rect, old_whole_rect, NULL,
swp_flags);
width = data->whole_rect.right - data->whole_rect.left;
height = data->whole_rect.bottom - data->whole_rect.top;
@@ -546,7 +543,7 @@
//DWORD layered_flags;
HRGN win_rgn;
//GR_WM_PROPERTIES props;
- DWORD style, ex_style;
+ DWORD ex_style;
if ((win_rgn = CreateRectRgn( 0, 0, 0, 0 )) &&
GetWindowRgn( data->hwnd, win_rgn ) == ERROR)
@@ -565,20 +562,12 @@
if (!(cy = data->whole_rect.bottom - data->whole_rect.top)) cy = 1;
else if (cy > 65535) cy = 65535;
- //data->whole_window = GrNewWindow( root_window,
- // data->whole_rect.left,
- // data->whole_rect.top,
- // cx, cy, 0, RGB(255,255,255), 0 );
- data->whole_window = (GR_WINDOW_ID)1;
-
- /* Inform window manager about window rect in screen coords */
- style = GetWindowLongW( data->hwnd, GWL_STYLE );
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
- SwmAddWindow(data->hwnd, &data->window_rect, style, ex_style);
+
+ data->whole_window = SwmNewWindow( root_window,
+ &data->whole_rect, data->hwnd, ex_style
);
//GrSelectEvents(data->whole_window, GR_EVENT_MASK_EXPOSURE);
-
- //if (data->whole_window) GrSetHwnd( data->whole_window, data->hwnd );
if (!data->whole_window) goto done;
@@ -589,7 +578,7 @@
if (!create_client_window( data ))
{
- //GrDestroyWindow( data->whole_window );
+ SwmDestroyWindow( data->whole_window );
data->whole_window = 0;
goto done;
}
@@ -820,8 +809,6 @@
if (!(data = NTDRV_create_win_data( hwnd ))) return;
}
- //SwmPosChanging(hwnd, window_rect);
-
//TRACE( "win %x pos is changing. vis rect %s, win rect %s\n",
// hwnd, wine_dbgstr_rect(visible_rect), wine_dbgstr_rect(window_rect) );