[ros-diffs] [fireball] 44114: [SWM] - Start implementing window hide/show support.

fireball at svn.reactos.org fireball at svn.reactos.org
Wed Nov 11 23:01:19 CET 2009


Author: fireball
Date: Wed Nov 11 23:01:19 2009
New Revision: 44114

URL: http://svn.reactos.org/svn/reactos?rev=44114&view=rev
Log:
[SWM]
- Start implementing window hide/show support.

Modified:
    branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c
    branches/arwinss/reactos/include/reactos/win32k/rosuser.h
    branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h
    branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c
    branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db

Modified: branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] Wed Nov 11 23:01:19 2009
@@ -876,6 +876,13 @@
             FIXME("change2\n");
         }
     }
+
+    /* Pass show/hide information to the window manager */
+    if (swp_flags & SWP_SHOWWINDOW)
+        SwmShowWindow(hwnd, TRUE);
+    else if (swp_flags & SWP_HIDEWINDOW)
+        SwmShowWindow(hwnd, FALSE);
+
 // visible: 0x1843, hide: 0x1883. 1843 = 1 + 2 + 64 + 2048 + 4096
     //RosDrv_UpdateZOrder(hwnd, (RECT*)visible_rect);
 }

Modified: branches/arwinss/reactos/include/reactos/win32k/rosuser.h
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos/win32k/rosuser.h?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- branches/arwinss/reactos/include/reactos/win32k/rosuser.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/include/reactos/win32k/rosuser.h [iso-8859-1] Wed Nov 11 23:01:19 2009
@@ -157,5 +157,7 @@
 HWND NTAPI
 SwmGetWindowFromPoint(LONG x, LONG y);
 
+VOID NTAPI
+SwmShowWindow(HWND hWnd, BOOLEAN Show);
 
 #endif /* __WIN32K_NTUSER_H */

Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h [iso-8859-1] Wed Nov 11 23:01:19 2009
@@ -6,6 +6,7 @@
     HWND hwnd;
     rectangle_t Window;
     struct region *Visible;
+    BOOLEAN Hidden;
 
     LIST_ENTRY Entry;
 } SWM_WINDOW, *PSWM_WINDOW;

Modified: branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] Wed Nov 11 23:01:19 2009
@@ -124,6 +124,14 @@
     {
         Window = CONTAINING_RECORD(Current, SWM_WINDOW, Entry);
 
+        /* Skip hidden windows */
+        if (Window->Hidden)
+        {
+            /* Advance to the next window */
+            Current = Current->Flink;
+            continue;
+        }
+
         /* Get window's region */
         WindowRegion = create_empty_region();
         set_region_rect(WindowRegion, &Window->Window);
@@ -178,6 +186,14 @@
     {
         Window = CONTAINING_RECORD(Current, SWM_WINDOW, Entry);
 
+        /* Skip hidden windows */
+        if (Window->Hidden)
+        {
+            /* Advance to the next window */
+            Current = Current->Flink;
+            continue;
+        }
+
         /* Get window's region */
         WindowRegion = create_empty_region();
         set_region_rect(WindowRegion, &Window->Window);
@@ -231,6 +247,14 @@
     while(Current != &SwmWindows)
     {
         Window = CONTAINING_RECORD(Current, SWM_WINDOW, Entry);
+
+        /* Skip hidden windows */
+        if (Window->Hidden)
+        {
+            /* Advance to the next window */
+            Current = Current->Blink;
+            continue;
+        }
 
         union_region(Region, Region, Window->Visible);
 
@@ -525,6 +549,48 @@
     SwmRelease();
 }
 
+VOID
+NTAPI
+SwmShowWindow(HWND hWnd, BOOLEAN Show)
+{
+    PSWM_WINDOW Win;
+
+    /* Acquire the lock */
+    SwmAcquire();
+
+    DPRINT1("SwmShowWindow %x, Show %d\n", hWnd, Show);
+
+    /* Allocate entry */
+    Win = SwmFindByHwnd(hWnd);
+    if (!Win)
+    {
+        /* Release the lock */
+        SwmRelease();
+        return;
+    }
+
+    if (Show && Win->Hidden)
+    {
+        /* Change state from hidden to visible */
+        Win->Hidden = FALSE;
+    }
+    else if (!Show && !Win->Hidden)
+    {
+        /* Change state from visible to hidden */
+        Win->Hidden = TRUE;
+
+        /* Mark its region as visible */
+        SwmMarkVisible(Win->Visible);
+
+        /* Its visible region is now empty */
+        free_region(Win->Visible);
+        Win->Visible = create_empty_region();
+    }
+
+    /* Release the lock */
+    SwmRelease();
+}
+
 HWND
 NTAPI
 SwmGetWindowFromPoint(LONG x, LONG y)
@@ -540,6 +606,14 @@
     while(Current != &SwmWindows)
     {
         Window = CONTAINING_RECORD(Current, SWM_WINDOW, Entry);
+
+        /* Skip hidden windows */
+        if (Window->Hidden)
+        {
+            /* Advance to the next window */
+            Current = Current->Flink;
+            continue;
+        }
 
         if (point_in_region(Window->Visible, x, y))
         {

Modified: branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db?rev=44114&r1=44113&r2=44114&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Wed Nov 11 23:01:19 2009
@@ -90,4 +90,5 @@
 SwmSetForeground                   1
 SwmPosChanging                     2
 SwmPosChanged                      3
-SwmGetWindowFromPoint              2
+SwmGetWindowFromPoint              2
+SwmShowWindow                      2




More information about the Ros-diffs mailing list