Skip to content

Commit

Permalink
chore: optimize handling of tab closure in find-in-page mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritchie1108 authored and Bush2021 committed Apr 15, 2024
1 parent eb851dc commit 4ab3a4b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/tabbookmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ int HandleDoubleClick(WPARAM wParam, PMOUSEHOOKSTRUCT pmouse) {
}

HWND hwnd = WindowFromPoint(pmouse->pt);
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
NodePtr top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
}
}

bool is_on_one_tab = IsOnOneTab(top_container_view, pmouse->pt);
Expand All @@ -134,10 +137,13 @@ int HandleRightClick(WPARAM wParam, PMOUSEHOOKSTRUCT pmouse) {
}

HWND hwnd = WindowFromPoint(pmouse->pt);
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
NodePtr top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
}
}

bool is_on_one_tab = IsOnOneTab(top_container_view, pmouse->pt);
Expand All @@ -162,10 +168,13 @@ int HandleMiddleClick(WPARAM wParam, PMOUSEHOOKSTRUCT pmouse) {
}

HWND hwnd = WindowFromPoint(pmouse->pt);
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
NodePtr top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
ExecuteCommand(IDC_CLOSE_FIND_OR_STOP, hwnd);
top_container_view = GetTopContainerView(hwnd);
if (!top_container_view) {
return 0;
}
}

bool is_on_one_tab = IsOnOneTab(top_container_view, pmouse->pt);
Expand Down

0 comments on commit 4ab3a4b

Please sign in to comment.