# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304357098 0 # Node ID ea356c38f7b6bcab35940dd4c0b5847eecb9e218 # Parent e3425875a03a9dcd1510fbd9dfa71082a50eeea4 Fixed a coordinate system issue with the button press handler on OS/2. Also fixed some formatting issues. diff -r e3425875a03a -r ea356c38f7b6 os2/dw.c --- 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)