Skip to content

Commit

Permalink
fix: avoid returning 1 from HandleDoubleClick
Browse files Browse the repository at this point in the history
Previously, `HandleDoubleClick` would return 1, which could cause the keep_tab to fail or trigger double-click operations consecutively when the user double-clicks on the tab page rapidly and repeatedly. This commit removes the return statement to avoid these issues.
  • Loading branch information
Bush2021 committed May 5, 2024
1 parent ae71b9e commit 8baa434
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/tabbookmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam) {
}

if (HandleDoubleClick(wParam, pmouse) != 0) {
return 1;
// Do not return 1. Returning 1 could cause the keep_tab to fail
// or trigger double-click operations consecutively when the user
// double-clicks on the tab page rapidly and repeatedly.
}

if (HandleRightClick(wParam, pmouse) != 0) {
Expand Down Expand Up @@ -350,13 +352,13 @@ int HandleOpenUrlNewTab(WPARAM wParam) {

NodePtr top_container_view = GetTopContainerView(GetForegroundWindow());
if (IsOmniboxFocus(top_container_view) && !IsOnNewTab(top_container_view)) {
if (config.is_open_url_new_tab == "foreground") {
SendKeys(VK_MENU, VK_RETURN);
} else if (config.is_open_url_new_tab == "background") {
SendKeys(VK_SHIFT, VK_MENU, VK_RETURN);
}
return 1;
if (config.is_open_url_new_tab == "foreground") {
SendKeys(VK_MENU, VK_RETURN);
} else if (config.is_open_url_new_tab == "background") {
SendKeys(VK_SHIFT, VK_MENU, VK_RETURN);
}
return 1;
}
return 0;
}

Expand Down

0 comments on commit 8baa434

Please sign in to comment.