[gtk+/gtk-2-24-quartz] win32: fix pasting screenshots taken with PrintScreen or Alt+PrintScreen
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] win32: fix pasting screenshots taken with PrintScreen or Alt+PrintScreen
- Date: Wed, 23 Nov 2011 23:02:14 +0000 (UTC)
commit bcf24879342fa0a3dbed342d307db5808eb388e0
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Fri Nov 4 09:44:35 2011 +0100
win32: fix pasting screenshots taken with PrintScreen or Alt+PrintScreen
These are found on the clipboard in the biCompression == BI_BITFIELDS &&
biBitCount >= 16 format. In this case the BITMAPINFOHEADER is followed
by three DWORD specifying the masks of the red green and blue components,
but bfOffBits was not being adjusted accordingly.
Based on Massimo's comment on bug 631384 and verified on
http://msdn.microsoft.com/en-us/library/dd183386%28v=VS.85%29.aspx
https://bugzilla.gnome.org/show_bug.cgi?id=631384
gdk/win32/gdkselection-win32.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c
index 3fb46b9..86f42b2 100644
--- a/gdk/win32/gdkselection-win32.c
+++ b/gdk/win32/gdkselection-win32.c
@@ -718,6 +718,17 @@ gdk_selection_convert (GdkWindow *requestor,
bi->biSize +
bi->biClrUsed * sizeof (RGBQUAD));
+ if (bi->biCompression == BI_BITFIELDS && bi->biBitCount >= 16)
+ {
+ /* Screenshots taken with PrintScreen or
+ * Alt + PrintScreen are found on the clipboard in
+ * this format. In this case the BITMAPINFOHEADER is
+ * followed by three DWORD specifying the masks of the
+ * red green and blue components, so adjust the offset
+ * accordingly. */
+ bf->bfOffBits += (3 * sizeof (DWORD));
+ }
+
memcpy ((char *) data + sizeof (BITMAPFILEHEADER),
bi,
data_length);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]