Call ReleaseDC() on DCs acquired with GetDC() (for windows), and

2006-06-09  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
	Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
	DeleteDC() on DCs acquired with CreateCompatibleDC() (for
	bitmaps). According to MSDN, this is the correct thing to do, even
	if always using DeleteDC() seems to have worked fine in
	practice. (#337491)
This commit is contained in:
Tor Lillqvist 2006-06-09 09:17:47 +00:00 committed by Tor Lillqvist
parent ada7aa635e
commit 225d9caf7c
3 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2006-06-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
DeleteDC() on DCs acquired with CreateCompatibleDC() (for
bitmaps). According to MSDN, this is the correct thing to do, even
if always using DeleteDC() seems to have worked fine in
practice. (#337491)
2006-06-08 Matthias Clasen <mclasen@redhat.com> 2006-06-08 Matthias Clasen <mclasen@redhat.com>
* tests/testprint.c: Update for api changes. * tests/testprint.c: Update for api changes.

View File

@ -1,3 +1,12 @@
2006-06-09 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
DeleteDC() on DCs acquired with CreateCompatibleDC() (for
bitmaps). According to MSDN, this is the correct thing to do, even
if always using DeleteDC() seems to have worked fine in
practice. (#337491)
2006-06-08 Matthias Clasen <mclasen@redhat.com> 2006-06-08 Matthias Clasen <mclasen@redhat.com>
* tests/testprint.c: Update for api changes. * tests/testprint.c: Update for api changes.

View File

@ -1889,7 +1889,10 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
if (impl->hdc) if (impl->hdc)
{ {
GDI_CALL (DeleteDC, (impl->hdc)); if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
GDI_CALL (DeleteDC, (impl->hdc));
else
GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
impl->hdc = NULL; impl->hdc = NULL;
} }
} }