]> Pileus Git - ~andy/gtk/commitdiff
In case BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
authorTor Lillqvist <tml@novell.com>
Fri, 30 Sep 2005 23:56:42 +0000 (23:56 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 30 Sep 2005 23:56:42 +0000 (23:56 +0000)
2005-10-01  Tor Lillqvist  <tml@novell.com>

* gdk/win32/gdkdrawable-win32.c (blit_from_pixmap): In case
BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
is that the the desktop isn't visible because the session has been
switched, the screen is locked, or a terminal server session
disconnected, so no error message necessary. (#137796)

It is of course remotely possible that BitBlt() failing with
ERROR_INVALID_HANDLE might also be caused by some other
problem. We could strive for perfection and track whether the
desktop is visible by using WTSRegisterSessionNotification() and
handling WM_WTSESSION_CHANGE. I think that's overdoing it just for
this issue, though. If we would track desktop visibility, we
should then avoid even trying to update the display at all while
the desktop isn't visible.

ChangeLog
ChangeLog.pre-2-10
gdk/win32/gdkdrawable-win32.c

index f68025db0c4e0f3ea8363faec2e36e2277934295..ec8e67ee219a814c65d595c158f5fb0357b48658 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-10-01  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkdrawable-win32.c (blit_from_pixmap): In case
+       BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
+       is that the the desktop isn't visible because the session has been
+       switched, the screen is locked, or a terminal server session
+       disconnected, so no error message necessary. (#137796)
+
+       It is of course remotely possible that BitBlt() failing with
+       ERROR_INVALID_HANDLE might also be caused by some other
+       problem. We could strive for perfection and track whether the
+       desktop is visible by using WTSRegisterSessionNotification() and
+       handling WM_WTSESSION_CHANGE. I think that's overdoing it just for
+       this issue, though. If we would track desktop visibility, we
+       should then avoid even trying to update the display at all while
+       the desktop isn't visible.
+
 2005-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkcalendar.c (gtk_calendar_init): Another attempt
index f68025db0c4e0f3ea8363faec2e36e2277934295..ec8e67ee219a814c65d595c158f5fb0357b48658 100644 (file)
@@ -1,3 +1,20 @@
+2005-10-01  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkdrawable-win32.c (blit_from_pixmap): In case
+       BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
+       is that the the desktop isn't visible because the session has been
+       switched, the screen is locked, or a terminal server session
+       disconnected, so no error message necessary. (#137796)
+
+       It is of course remotely possible that BitBlt() failing with
+       ERROR_INVALID_HANDLE might also be caused by some other
+       problem. We could strive for perfection and track whether the
+       desktop is visible by using WTSRegisterSessionNotification() and
+       handling WM_WTSESSION_CHANGE. I think that's overdoing it just for
+       this issue, though. If we would track desktop visibility, we
+       should then avoid even trying to update the display at all while
+       the desktop isn't visible.
+
 2005-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkcalendar.c (gtk_calendar_init): Another attempt
index 31d6a4195752e11333a5862862647aca79173540..88a236df427673c97c77cc6d5f7c725bdcd2c21b 100644 (file)
@@ -1592,8 +1592,10 @@ blit_from_pixmap (gboolean              use_fg_bg,
        }
       
       if (ok)
-       GDI_CALL (BitBlt, (hdc, xdest, ydest, width, height,
-                          srcdc, xsrc, ysrc, rop2_to_rop3 (gcwin32->rop2)));
+       if (!BitBlt (hdc, xdest, ydest, width, height,
+                    srcdc, xsrc, ysrc, rop2_to_rop3 (gcwin32->rop2)) &&
+           GetLastError () != ERROR_INVALID_HANDLE)
+         WIN32_GDI_FAILED ("BitBlt");
       
       /* Restore source's color table if necessary */
       if (ok && newtable_size > 0 && oldtable_size > 0)