[3/3] comctl32: forward more header notifications to parent window
Daniel Jelinski
djelinski1 at gmail.com
Sat Dec 8 08:09:13 CST 2012
-------------- next part --------------
From 83663f70c6b00d013f91df545ceed1ecb58fb93a Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Sat, 8 Dec 2012 15:02:41 +0100
Subject: comctl32: forward more header notifications to parent window
As a side effect, these notifications are changed to their ANSI version.
This fixes bug 31527.
There's something more to forwarding the notifications - when I added
forwarding of HDN_ITEMCHANGING and HDN_ITEMCHANGED, other tests started failing.
I'll investigate that later if I find that apps depend on it.
---
dlls/comctl32/listview.c | 26 +++++++++++---------------
dlls/comctl32/tests/listview.c | 8 +++-----
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index c85470e..1d72c68 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10270,26 +10270,25 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
LISTVIEW_GetOrigin(infoPtr, &ptOrigin);
infoPtr->xTrackLine = x + ptOrigin.x;
LISTVIEW_DrawTrackLine(infoPtr);
- break;
+ return notify_forward_header(infoPtr, lpnmh);
}
-
+
case HDN_ENDTRACKA:
case HDN_ENDTRACKW:
/* remove the track line (if any) */
LISTVIEW_DrawTrackLine(infoPtr);
infoPtr->xTrackLine = -1;
- break;
+ return notify_forward_header(infoPtr, lpnmh);
case HDN_BEGINDRAG:
- notify_forward_header(infoPtr, lpnmh);
- return (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) == 0;
+ if ((infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) == 0) return 1;
+ return notify_forward_header(infoPtr, lpnmh);
case HDN_ENDDRAG:
infoPtr->colRectsDirty = TRUE;
LISTVIEW_InvalidateList(infoPtr);
- notify_forward_header(infoPtr, lpnmh);
- return FALSE;
-
+ return notify_forward_header(infoPtr, lpnmh);
+
case HDN_ITEMCHANGEDW:
case HDN_ITEMCHANGEDA:
{
@@ -10369,8 +10368,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
LISTVIEW_InvalidateRect(infoPtr, &rcCol);
}
}
- }
- break;
+ break;
+ }
case HDN_ITEMCLICKW:
case HDN_ITEMCLICKA:
@@ -10382,9 +10381,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
nmlv.iItem = -1;
nmlv.iSubItem = lpnmh->iItem;
notify_listview(infoPtr, LVN_COLUMNCLICK, &nmlv);
- notify_forward_header(infoPtr, lpnmh);
+ return notify_forward_header(infoPtr, lpnmh);
}
- break;
case HDN_DIVIDERDBLCLICKW:
case HDN_DIVIDERDBLCLICKA:
@@ -10392,10 +10390,8 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
we should use LVSCW_AUTOSIZE_USEHEADER, helper rework or
split needed for that */
LISTVIEW_SetColumnWidth(infoPtr, lpnmh->iItem, LVSCW_AUTOSIZE);
- notify_forward_header(infoPtr, lpnmh);
- break;
+ return notify_forward_header(infoPtr, lpnmh);
}
-
return 0;
}
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index fd31eb8..88dbdd9 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -5011,22 +5011,20 @@ static void test_header_notification2(void)
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
parent_header_notify_seq[0].id = HDN_ENDTRACKA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
- "header notify, parent", TRUE);
- todo_wine
+ "header notify, parent", FALSE);
ok(nmhdr.hdr.code == HDN_ENDTRACKA, "Expected ANSI notification code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_TRACKW;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
parent_header_notify_seq[0].id = HDN_TRACKA;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq,
- "header notify, parent", TRUE);
- todo_wine
+ "header notify, parent", FALSE);
ok(nmhdr.hdr.code == HDN_TRACKA, "Expected ANSI notification code\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_BEGINDRAG;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
- "header notify, parent", TRUE);
+ "header notify, parent", FALSE);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
nmhdr.hdr.code = HDN_ENDDRAG;
ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr);
--
1.7.5.4
More information about the wine-patches
mailing list