changeset 963:ea356c38f7b6

Fixed a coordinate system issue with the button press handler on OS/2. Also fixed some formatting issues.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 02 May 2011 17:24:58 +0000
parents e3425875a03a
children 6c6b5bbd3a26
files os2/dw.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Mon May 02 17:04:58 2011 +0000
+++ b/os2/dw.c	Mon May 02 17:24:58 2011 +0000
@@ -361,7 +361,7 @@
    {
       Box *box = (Box *)WinQueryWindowPtr(child, QWP_USER);
 
-      if(box)
+      if(box && !dw_window_get_data(handle, "_dw_box"))
       {
          if(box->count && box->items)
             free(box->items);
@@ -2319,7 +2319,7 @@
                      break;
                   }
 
-                  result = buttonfunc(tmp->window, pts.x, _get_frame_height(tmp->window) - pts.y, button, tmp->data);
+                  result = buttonfunc(tmp->window, pts.x, WinQueryWindow(tmp->window, QW_PARENT) == HWND_DESKTOP ? dw_screen_height() - pts.y : _get_height(tmp->window) - pts.y, button, tmp->data);
                   tmp = NULL;
                }
             }
@@ -3574,7 +3574,7 @@
    case WM_BUTTON2DOWN:
    case WM_BUTTON3DOWN:
       if(res == -1)
-		  WinSetFocus(HWND_DESKTOP, hwnd);
+          WinSetFocus(HWND_DESKTOP, hwnd);
       else if(res)
          return (MPARAM)TRUE;
    }
@@ -8686,17 +8686,17 @@
    {
        IMAGEBUNDLE newIb, oldIb;
        /* Transparent color is put into the background color */
-	   GpiSetBackColor(hpsdest, srcp->transcolor);
-	   GpiQueryAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, (PBUNDLE)&oldIb);
-	   newIb.usBackMixMode = BM_SRCTRANSPARENT;
-	   GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&newIb);
-	   GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
+       GpiSetBackColor(hpsdest, srcp->transcolor);
+       GpiQueryAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, (PBUNDLE)&oldIb);
+       newIb.usBackMixMode = BM_SRCTRANSPARENT;
+       GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&newIb);
+       GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
        GpiSetAttrs(hpsdest, PRIM_IMAGE, IBB_BACK_MIX_MODE, 0, (PBUNDLE)&oldIb);
    }
    else
    {
        /* Otherwise use the regular BitBlt call */
-	   GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
+       GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
    }
 
    if(!destp)