[ros-diffs] [khornicek] 48911: Fixes for bugs: 5591, 5482, 5517, 5472, 5554 and 5567 These issues are either already fixed in the yarotows branch or will be solved with next sync of corresponding libs. Merging...

khornicek at svn.reactos.org khornicek at svn.reactos.org
Mon Sep 27 21:12:10 UTC 2010


Author: khornicek
Date: Mon Sep 27 21:12:09 2010
New Revision: 48911

URL: http://svn.reactos.org/svn/reactos?rev=48911&view=rev
Log:
Fixes for bugs: 5591, 5482, 5517, 5472, 5554 and 5567
These issues are either already fixed in the yarotows branch or will be solved with next sync of corresponding libs. Merging or doing full syncs before release could cause more troubles so I hope these (hack)fixes are justified.

Modified:
    branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c
    branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/main/getstring.c
    branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/propsheet.c
    branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/treeview.c
    branches/ros-branch-0_3_12/reactos/dll/win32/user32/windows/cursoricon.c
    branches/ros-branch-0_3_12/reactos/subsystems/win32/win32k/objects/device.c

Modified: branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -119,6 +119,7 @@
 
     /* Only 16 and 32 bit targets are supported now */
     assert(pwfb->cColorBits == 0 ||
+       pwfb->cColorBits == 8 ||
 	   pwfb->cColorBits == 16 || 
 	   pwfb->cColorBits == 24 || 
 	   pwfb->cColorBits == 32);

Modified: branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/main/getstring.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/main/getstring.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/main/getstring.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/dll/3rdparty/mesa32/src/main/getstring.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -126,7 +126,7 @@
 _mesa_GetString( GLenum name )
 {
    GET_CURRENT_CONTEXT(ctx);
-   static const char *vendor = "Brian Paul";
+   static const char *vendor = "Mesa";
    static const char *renderer = "Mesa";
 
    if (!ctx)

Modified: branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/propsheet.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/propsheet.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -2421,6 +2421,27 @@
   return FALSE;
 }
 
+#ifndef DISABLE_USER32_HACKS
+BOOL CALLBACK
+EnumChildProc(HWND hwnd, LPARAM lParam)
+{
+    WCHAR szType[20];
+
+    RealGetWindowClassW(hwnd, szType, 20);
+
+    if (strcmpW(szType, WC_EDITW) == 0)
+    {
+        if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
+        {
+            *(PLONG)lParam = TRUE;
+            return FALSE;
+        }
+    }
+
+    return TRUE;
+}
+#endif
+
 /******************************************************************************
  *            PROPSHEET_SetWizButtons
  *
@@ -2436,12 +2457,17 @@
   HWND hwndNext   = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
   HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
 
+#ifndef DISABLE_USER32_HACKS
+  LONG Found = FALSE;
+#endif
+
   TRACE("%d\n", dwFlags);
 
   EnableWindow(hwndBack, FALSE);
   EnableWindow(hwndNext, FALSE);
   EnableWindow(hwndFinish, FALSE);
 
+#ifdef DISABLE_USER32_HACKS
   /* set the default pushbutton to an enabled button */
   if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
     SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
@@ -2451,6 +2477,7 @@
     SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
   else
     SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
+#endif
 
 
   if (dwFlags & PSWIZB_BACK)
@@ -2482,6 +2509,39 @@
   }
   else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
     EnableWindow(hwndFinish, TRUE);
+
+#ifndef DISABLE_USER32_HACKS
+
+  /* try to find an edit control that deserves focus */
+   EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, (LPARAM)&Found);
+
+  /* set the default pushbutton to an enabled button and give it focus if we didn't find any edit control*/
+  if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
+  {
+    SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
+    if(!Found)
+        SetFocus(hwndFinish);
+  }
+  else if (dwFlags & PSWIZB_NEXT)
+  {
+    SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
+    if(!Found)
+        SetFocus(hwndNext);
+  }
+  else if (dwFlags & PSWIZB_BACK)
+  {
+    SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
+    if(!Found)
+        SetFocus(hwndBack);
+  }
+  else
+  {
+    SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
+    if(!Found)
+        SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
+  }
+
+#endif
 }
 
 /******************************************************************************

Modified: branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/treeview.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/treeview.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -33,7 +33,8 @@
  *
  *   missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
  *
- *   missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL
+ *   missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL, TVIS_EX_FLAT,
+ *      TVIS_EX_DISABLED
  *
  *   Make the insertion mark look right.
  *   Scroll (instead of repaint) as much as possible.
@@ -1005,7 +1006,7 @@
      * inc/dec to toggle the images. */
     newItem->iImage = 0;
     newItem->iSelectedImage = 0;
-    newItem->iExpandedImage = 0;
+    newItem->iExpandedImage = (WORD)I_IMAGENONE;
 
     if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1)
     {
@@ -2142,6 +2143,13 @@
             }
         }
     }
+
+    if (tvItem->mask & TVIF_STATEEX)
+    {
+        FIXME("Extended item state not supported, returning 0.\n");
+        tvItem->uStateEx = 0;
+    }
+
     TRACE("item <%p>, txt %p, img %p, mask %x\n",
 	  wineItem, tvItem->pszText, &tvItem->iImage, tvItem->mask);
 
@@ -2575,7 +2583,7 @@
 	    /* The item is currently selected */
 	    imageIndex = wineItem->iSelectedImage;
 	}
-	else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage >= 0))
+	else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage != (WORD)I_IMAGENONE))
 	{
 	    /* The item is currently not selected but expanded */
 	    imageIndex = wineItem->iExpandedImage;
@@ -2917,6 +2925,7 @@
     {
         hdc = hdc_ref;
         GetClientRect(infoPtr->hwnd, &rc);
+        TREEVIEW_FillBkgnd(infoPtr, hdc, &rc);
     }
     else
     {
@@ -3309,7 +3318,7 @@
 
 static BOOL
 TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
-		BOOL bExpandPartial, BOOL bUser)
+		BOOL partial, BOOL user)
 {
     LONG scrollDist;
     LONG orgNextTop = 0;
@@ -3317,7 +3326,7 @@
     TREEVIEW_ITEM *nextItem, *tmpItem;
     BOOL sendsNotifications;
 
-    TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, bExpandPartial, bUser);
+    TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, partial, user);
 
     if (wineItem->state & TVIS_EXPANDED)
        return TRUE;
@@ -3338,7 +3347,7 @@
 
     TRACE("TVE_EXPAND %p %s\n", wineItem, TREEVIEW_ItemName(wineItem));
 
-    sendsNotifications = bUser || ((wineItem->cChildren != 0) &&
+    sendsNotifications = user || ((wineItem->cChildren != 0) &&
                                     !(wineItem->state & TVIS_EXPANDEDONCE));
     if (sendsNotifications)
     {
@@ -3353,7 +3362,7 @@
 
     wineItem->state |= TVIS_EXPANDED;
 
-    if (bExpandPartial)
+    if (partial)
 	FIXME("TVE_EXPANDPARTIAL not implemented\n");
 
     if (ISVISIBLE(wineItem))
@@ -3417,6 +3426,58 @@
     }
 
     return TRUE;
+}
+
+/* Handler for TVS_SINGLEEXPAND behaviour. Used on response
+   to mouse messages and TVM_SELECTITEM.
+
+   selection - previously selected item, used to collapse a part of a tree
+   item - new selected item
+*/
+static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
+    HTREEITEM selection, HTREEITEM item)
+{
+    TREEVIEW_ITEM *SelItem;
+
+    if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return;
+
+    TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0);
+
+    /*
+     * Close the previous selection all the way to the root
+     * as long as the new selection is not a child
+     */
+    if(selection && (selection != item))
+    {
+        BOOL closeit = TRUE;
+        SelItem = item;
+
+        /* determine if the hitItem is a child of the currently selected item */
+        while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) &&
+              (SelItem->parent != infoPtr->root))
+        {
+            closeit = (SelItem != selection);
+            SelItem = SelItem->parent;
+        }
+
+        if(closeit)
+        {
+            if(TREEVIEW_ValidItem(infoPtr, selection))
+                SelItem = selection;
+
+            while(SelItem && (SelItem != item) && TREEVIEW_ValidItem(infoPtr, SelItem) &&
+                  SelItem->parent != infoPtr->root)
+            {
+                TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE);
+                SelItem = SelItem->parent;
+            }
+        }
+    }
+
+    /*
+     * Expand the current item
+     */
+    TREEVIEW_Expand(infoPtr, item, FALSE, FALSE);
 }
 
 static BOOL
@@ -4136,58 +4197,11 @@
     }
     else if (ht.flags & (TVHT_ONITEMICON|TVHT_ONITEMLABEL)) /* select the item if the hit was inside of the icon or text */
     {
-        /*
-         * if we are TVS_SINGLEEXPAND then we want this single click to
-         * do a bunch of things.
-         */
-        if((infoPtr->dwStyle & TVS_SINGLEEXPAND) &&
-          (infoPtr->hwndEdit == 0))
-        {
-            TREEVIEW_ITEM *SelItem;
-
-            /*
-             * Send the notification
-             */
-            TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, ht.hItem, 0);
-
-            /*
-             * Close the previous selection all the way to the root
-             * as long as the new selection is not a child
-             */
-            if((infoPtr->selectedItem)
-                && (infoPtr->selectedItem != ht.hItem))
-            {
-                BOOL closeit = TRUE;
-                SelItem = ht.hItem;
-
-                /* determine if the hitItem is a child of the currently selected item */
-                while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root))
-                {
-                    closeit = (SelItem != infoPtr->selectedItem);
-                    SelItem = SelItem->parent;
-                }
-
-                if(closeit)
-                {
-                    if(TREEVIEW_ValidItem(infoPtr, infoPtr->selectedItem))
-                        SelItem = infoPtr->selectedItem;
-
-                    while(SelItem && (SelItem != ht.hItem) && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root))
-                    {
-                        TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE);
-                        SelItem = SelItem->parent;
-                    }
-                }
-            }
-
-            /*
-             * Expand the current item
-             */
-            TREEVIEW_Expand(infoPtr, ht.hItem, TVE_TOGGLE, FALSE);
-        }
+        TREEVIEW_ITEM *selection = infoPtr->selectedItem;
 
         /* Select the current item */
         TREEVIEW_DoSelectItem(infoPtr, TVGN_CARET, ht.hItem, TVC_BYMOUSE);
+        TREEVIEW_SingleExpand(infoPtr, selection, ht.hItem);
     }
     else if (ht.flags & TVHT_ONITEMSTATEICON)
     {
@@ -4350,6 +4364,9 @@
 
     switch (action)
     {
+    case TVGN_CARET|TVSI_NOSINGLEEXPAND:
+        FIXME("TVSI_NOSINGLEEXPAND specified.\n");
+        /* Fall through */
     case TVGN_CARET:
 	prevSelect = infoPtr->selectedItem;
 
@@ -4419,13 +4436,17 @@
 static LRESULT
 TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item)
 {
-    if (item != NULL && !TREEVIEW_ValidItem(infoPtr, item))
+    TREEVIEW_ITEM *selection = infoPtr->selectedItem;
+
+    if (item && !TREEVIEW_ValidItem(infoPtr, item))
 	return FALSE;
 
     TRACE("%p (%s) %d\n", item, TREEVIEW_ItemName(item), wParam);
 
     if (!TREEVIEW_DoSelectItem(infoPtr, wParam, item, TVC_UNKNOWN))
 	return FALSE;
+
+    TREEVIEW_SingleExpand(infoPtr, selection, item);
 
     return TRUE;
 }
@@ -5824,10 +5845,10 @@
 /* Tree Verification ****************************************************/
 
 static inline void
-TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item);
+TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item);
 
 static inline void TREEVIEW_VerifyItemCommon(TREEVIEW_INFO *infoPtr,
-					     TREEVIEW_ITEM *item)
+					     const TREEVIEW_ITEM *item)
 {
     assert(infoPtr != NULL);
     assert(item != NULL);
@@ -5866,7 +5887,7 @@
 }
 
 static inline void
-TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
 {
     assert(item != NULL);
 
@@ -5882,9 +5903,9 @@
 }
 
 static inline void
-TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
-{
-    TREEVIEW_ITEM *child;
+TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
+{
+    const TREEVIEW_ITEM *child;
     assert(item != NULL);
 
     for (child = item->firstChild; child != NULL; child = child->nextSibling)

Modified: branches/ros-branch-0_3_12/reactos/dll/win32/user32/windows/cursoricon.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/win32/user32/windows/cursoricon.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/dll/win32/user32/windows/cursoricon.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/dll/win32/user32/windows/cursoricon.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -485,8 +485,8 @@
     else
     {
         if (!(*mask = CreateBitmap( width, height, 1, 1, NULL ))) goto done;
-        if (!(*color = CreateBitmap( width, height, bmi->bmiHeader.biPlanes,
-                                     bmi->bmiHeader.biBitCount, NULL )))
+        if (!(*color = CreateBitmap( width, height, GetDeviceCaps( screen_dc, PLANES ),
+                                     GetDeviceCaps( screen_dc, BITSPIXEL ), NULL )))
         {
             DeleteObject( *mask );
             goto done;

Modified: branches/ros-branch-0_3_12/reactos/subsystems/win32/win32k/objects/device.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/subsystems/win32/win32k/objects/device.c?rev=48911&r1=48910&r2=48911&view=diff
==============================================================================
--- branches/ros-branch-0_3_12/reactos/subsystems/win32/win32k/objects/device.c [iso-8859-1] (original)
+++ branches/ros-branch-0_3_12/reactos/subsystems/win32/win32k/objects/device.c [iso-8859-1] Mon Sep 27 21:12:09 2010
@@ -486,6 +486,12 @@
             RtlZeroMemory( PrimarySurface.pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL));
             ret = TRUE;
         }
+
+        gpsi->aiSysMet[SM_CXSCREEN] = PrimarySurface.gdiinfo.ulHorzRes;
+        gpsi->aiSysMet[SM_CYSCREEN] = PrimarySurface.gdiinfo.ulVertRes;
+        gpsi->aiSysMet[SM_CXVIRTUALSCREEN] = PrimarySurface.gdiinfo.ulHorzRes;
+        gpsi->aiSysMet[SM_CYVIRTUALSCREEN] = PrimarySurface.gdiinfo.ulVertRes;
+
         goto cleanup;
     }
 




More information about the Ros-diffs mailing list