Cairo win32 fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/gnustep_testplant_branch@35373 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2012-08-08 22:27:23 +00:00
parent 643bedc834
commit c276a5d4d0

View file

@ -26,6 +26,7 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#include "config.h"
#include <AppKit/NSEvent.h> #include <AppKit/NSEvent.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
#include <Foundation/NSBundle.h> #include <Foundation/NSBundle.h>
@ -35,6 +36,7 @@
@implementation WIN32Server (w32_create) @implementation WIN32Server (w32_create)
- (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam - (LRESULT) decodeWM_NCCREATEParams: (WPARAM)wParam : (LPARAM)lParam
: (HWND)hwnd : (HWND)hwnd
{ {
@ -56,9 +58,10 @@
is stored in the extra fields for this window. Drawing operations is stored in the extra fields for this window. Drawing operations
work on this buffer. */ work on this buffer. */
win = malloc(sizeof(WIN_INTERN)); win = malloc(sizeof(WIN_INTERN));
memset(win, 0, sizeof(WIN_INTERN));
SetWindowLong(hwnd, GWL_USERDATA, (int)win); SetWindowLong(hwnd, GWL_USERDATA, (int)win);
if (type != NSBackingStoreNonretained) if ([self useHDC] && (type != NSBackingStoreNonretained))
{ {
HDC hdc, hdc2; HDC hdc, hdc2;
HBITMAP hbitmap; HBITMAP hbitmap;
@ -72,6 +75,7 @@
win->old = SelectObject(hdc2, hbitmap); win->old = SelectObject(hdc2, hbitmap);
win->hdc = hdc2; win->hdc = hdc2;
win->useHDC = YES; win->useHDC = YES;
ReleaseDC(hwnd, hdc); ReleaseDC(hwnd, hdc);