winhlp32: Links are clicked on WM_LBUTTONDOWN not WM_LBUTTONUP.
Dylan Smith
dylan.ah.smith at gmail.com
Thu Mar 12 00:35:33 CDT 2009
This behaviour was tested against native winhlp32 by pressing down the
left mouse button and holding it while over the link to avoid having
WM_LBUTTONUP sent. I noticed that the action for clicking the link
happened right away, without waiting for me to release the mouse button.
---
programs/winhlp32/winhelp.c | 12 +++---------
programs/winhlp32/winhelp.h | 1 -
2 files changed, 3 insertions(+), 10 deletions(-)
-------------- next part --------------
diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c
index db9769a..b042a5a 100644
--- a/programs/winhlp32/winhelp.c
+++ b/programs/winhlp32/winhelp.c
@@ -842,12 +842,7 @@ static BOOL WINHELP_HandleTextMouse(WINHELP_WINDOW* win, UINT msg, LPARAM lParam
switch (msg)
{
case WM_LBUTTONDOWN:
- if ((win->current_link = WINHELP_FindLink(win, lParam)))
- ret = TRUE;
- break;
-
- case WM_LBUTTONUP:
- if ((link = WINHELP_FindLink(win, lParam)) && link == win->current_link)
+ if ((link = WINHELP_FindLink(win, lParam)))
{
HLPFILE_WINDOWINFO* wi;
@@ -882,7 +877,6 @@ static BOOL WINHELP_HandleTextMouse(WINHELP_WINDOW* win, UINT msg, LPARAM lParam
}
ret = TRUE;
}
- win->current_link = NULL;
break;
}
return ret;
@@ -917,11 +911,11 @@ static BOOL WINHELP_CheckPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
(HWND)lParam == Globals.active_popup->hMainWnd ||
GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd)
break;
- case WM_LBUTTONUP:
case WM_LBUTTONDOWN:
- if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN)
+ if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam))
return FALSE;
/* fall through */
+ case WM_LBUTTONUP:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_NCLBUTTONDOWN:
diff --git a/programs/winhlp32/winhelp.h b/programs/winhlp32/winhelp.h
index 407089e..994547b 100644
--- a/programs/winhlp32/winhelp.h
+++ b/programs/winhlp32/winhelp.h
@@ -90,7 +90,6 @@ typedef struct tagWinHelp
HBRUSH hBrush;
HLPFILE_WINDOWINFO* info;
- HLPFILE_LINK* current_link;
WINHELP_PAGESET back;
unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */
More information about the wine-patches
mailing list