Skip to content

Commit

Permalink
fix: update GetTopContainerView to use GetFocus()
Browse files Browse the repository at this point in the history
Instead of passing `hwnd` from `WindowFromPoint()` as an argument, it now uses `GetFocus()` to retrieve `top_container_view`. This change was made to fix #98.
  • Loading branch information
Bush2021 committed Aug 26, 2024
1 parent ac253f0 commit 9492f00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tabbookmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ bool HandleBookmark(WPARAM wParam, PMOUSEHOOKSTRUCT pmouse) {

POINT pt = pmouse->pt;
HWND hwnd = WindowFromPoint(pt);
NodePtr top_container_view = GetTopContainerView(hwnd);
NodePtr top_container_view = GetTopContainerView(
GetFocus()); // Must use `GetFocus()`, otherwise when opening bookmarks
// in a bookmark folder (and similar expanded menus),
// `top_container_view` cannot be obtained, making it
// impossible to correctly determine `is_on_new_tab`. See
// #98.

bool is_on_bookmark = IsOnBookmark(hwnd, pt);
bool is_on_new_tab = IsOnNewTab(top_container_view);
Expand Down

0 comments on commit 9492f00

Please sign in to comment.