[PATCH v14 0/2] MR11400: winhlp32: MACRO_PopupContext for bug #56516
https://bugs.winehq.org/show_bug.cgi?id=56516#c1 -- v14: winhlp32: MACRO_PopupContext for bug #56516 https://gitlab.winehq.org/wine/wine/-/merge_requests/11400
From: Stian Low <wineryyyyy@gmail.com> --- dlls/riched20/wrap.c | 1 - programs/winhlp32/macro.c | 18 +++++++++++++++++- programs/winhlp32/winhelp.c | 7 ++++--- programs/winhlp32/winhelp.h | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index a4d638aec3d..dfe328e4803 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -1152,7 +1152,6 @@ ME_SendRequestResize(ME_TextEditor *editor, BOOL force) info.rc = rc; info.rc.right = editor->nTotalWidth; info.rc.bottom = editor->nTotalLength; - editor->nEventMask &= ~ENM_REQUESTRESIZE; ITextHost_TxNotify(editor->texthost, info.nmhdr.code, &info); editor->nEventMask |= ENM_REQUESTRESIZE; diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index 36bda654afd..967ccb10b4c 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -671,7 +671,23 @@ static void CALLBACK MACRO_NoShow(void) void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u) { - WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u); + HLPFILE_WINDOWINFO* wi; + HLPFILE *hlpfile; + POINT origin; + + WINE_TRACE("(%s, %lu)\n", debugstr_a(str), u); + + if (!(hlpfile = WINHELP_LookupHelpFile(str))) + { + WINE_ERR("Failed to load .hlp file.\n"); + return; + } + + if (!GetCursorPos(&origin)) + WINE_FIXME("GetCursorPos failed so popup context help may appear misplaced.\n"); + + wi = WINHELP_GetPopupWindowInfo(hlpfile, MACRO_CurrentWindow(), MAKELPARAM(origin.x, origin.y)); + WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, u, wi, SW_NORMAL); } static void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c index 1c112f08aaf..83f7e9919da 100644 --- a/programs/winhlp32/winhelp.c +++ b/programs/winhlp32/winhelp.c @@ -293,7 +293,7 @@ HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name) * * */ -static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, +HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, WINHELP_WINDOW* parent, LPARAM mouse) { static HLPFILE_WINDOWINFO wi; @@ -305,7 +305,6 @@ static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, /* Calculate horizontal size and position of a popup window */ GetWindowRect(parent->hMainWnd, &parent_rect); wi.size.cx = (parent_rect.right - parent_rect.left) / 2; - wi.size.cy = 10; /* need a non null value, so that borders are taken into account while computing */ wi.origin.x = (short)LOWORD(mouse); wi.origin.y = (short)HIWORD(mouse); @@ -316,7 +315,9 @@ static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, wi.style = SW_SHOW; wi.win_style = WS_POPUP | WS_BORDER; - if (parent->page->file->has_popup_color) + if (hlpfile->has_popup_color) + wi.sr_color = hlpfile->popup_color; + else if (parent->page && parent->page->file->has_popup_color) wi.sr_color = parent->page->file->popup_color; else wi.sr_color = parent->info->sr_color; diff --git a/programs/winhlp32/winhelp.h b/programs/winhlp32/winhelp.h index 519dec215a9..6d2f0ebc01f 100644 --- a/programs/winhlp32/winhelp.h +++ b/programs/winhlp32/winhelp.h @@ -170,6 +170,7 @@ BOOL WINHELP_CreateIndexWindow(BOOL); void WINHELP_DeleteBackSet(WINHELP_WINDOW*); HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); +HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, WINHELP_WINDOW* parent, LPARAM mouse); void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win); WINHELP_WINDOW* WINHELP_GrabWindow(WINHELP_WINDOW*); BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW*); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11400
From: Stian Low <wineryyyyy@gmail.com> --- dlls/riched20/wrap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index dfe328e4803..a4d638aec3d 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -1152,6 +1152,7 @@ ME_SendRequestResize(ME_TextEditor *editor, BOOL force) info.rc = rc; info.rc.right = editor->nTotalWidth; info.rc.bottom = editor->nTotalLength; + editor->nEventMask &= ~ENM_REQUESTRESIZE; ITextHost_TxNotify(editor->texthost, info.nmhdr.code, &info); editor->nEventMask |= ENM_REQUESTRESIZE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11400
participants (2)
-
Stian Low -
Stian Low (@stianlow)