diff options
author | Tor Lillqvist <tml@novell.com> | 2005-09-30 23:51:49 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-09-30 23:51:49 +0000 |
commit | eed718e4e67739a192fe4135e5dd9148f6abc1e3 (patch) | |
tree | 800da9d801357d86447a48699625050e09dbb657 | |
parent | db1593b8be62c8a81bd0954be2dd9008f5e5b4cd (diff) | |
download | gdk-pixbuf-eed718e4e67739a192fe4135e5dd9148f6abc1e3.tar.gz |
In case BitBlt() fails with ERROR_INVALID_HANDLE, the most probable cause
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.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 17 | ||||
-rw-r--r-- | gdk/win32/gdkdrawable-win32.c | 6 |
3 files changed, 38 insertions, 2 deletions
@@ -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 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 081356a1a..cb3547aec 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -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 diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c index 31d6a4195..88a236df4 100644 --- a/gdk/win32/gdkdrawable-win32.c +++ b/gdk/win32/gdkdrawable-win32.c @@ -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) |