X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea258ad3489638fbcf504a674f8793b1362bd2b5..31e39e3c51f0a14a49ba86a5326e1461ad60dfee:/src/xpm/simx.c?ds=inline diff --git a/src/xpm/simx.c b/src/xpm/simx.c index 04714849bf..267c419576 100644 --- a/src/xpm/simx.c +++ b/src/xpm/simx.c @@ -38,7 +38,7 @@ #ifdef FOR_MSW -#include "xpmi.h" /* for XpmMalloc */ +#include "XpmI.h" /* for XpmMalloc */ /* * On DOS size_t is only 2 bytes, thus malloc(size_t s) can only malloc @@ -137,6 +137,7 @@ XDefaultDepth(Display *display, Screen *screen) DevQueryCaps(hdcScreen, CAPS_COLOR_PLANES, 1L, &lPlanes); DevQueryCaps(hdcScreen, CAPS_COLOR_BITCOUNT, 1L, &lBitsPerPixel); b = (int)lBitsPerPixel; + WinReleasePS(hpsScreen); #else b = GetDeviceCaps(*display, BITSPIXEL); d = GetDeviceCaps(*display, PLANES); @@ -273,10 +274,8 @@ XCreateImage(Display *d, Visual *v, { XImage *img = (XImage *) XpmMalloc(sizeof(XImage)); #ifdef __OS2__ - HPS hps; BITMAPINFOHEADER2 bmih; - hps = WinGetScreenPS(HWND_DESKTOP); memset(&bmih, 0, sizeof(BITMAPINFOHEADER2)); bmih.cbFix = sizeof(BITMAPINFOHEADER2); bmih.cx = width; @@ -294,7 +293,8 @@ XCreateImage(Display *d, Visual *v, img->bitmap = CreateCompatibleBitmap(*d, width, height); } else*/ { #ifdef __OS2__ - img->bitmap = GpiCreateBitmap(hps, &bmih, 0L, NULL, NULL); + img->bitmap = GpiCreateBitmap(*d, &bmih, 0L, NULL, NULL); + WinReleasePS(*d); #else img->bitmap = CreateBitmap(width, height, 1 /* plane */ , depth /* bits per pixel */ , NULL);