Skip to content

Commit

Permalink
fix: fix the misjudgement of new tab Bush2021#20
Browse files Browse the repository at this point in the history
  • Loading branch information
Bush2021 committed Dec 4, 2023
1 parent 8e4b7f8 commit 8c4f7a9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/TabBookmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ bool IsOnNewTab(NodePtr top)
if (GetAccessibleRole(child) == ROLE_SYSTEM_PUSHBUTTON)
{
GetAccessibleName(child, [&new_tab_name](BSTR bstr) {
new_tab_name = bstr;
// DebugLog(L"new_tab_name: %s", bstr);
new_tab_name = _wcsdup(bstr);
DebugLog(L"new_tab_name: %s", bstr);
});
}
return false;
Expand All @@ -575,18 +575,22 @@ bool IsOnNewTab(NodePtr top)
if (PageTabPane)
{
TraversalAccessible(PageTabPane, [&flag, &new_tab_name](NodePtr child) {
if (GetAccessibleRole(child) == ROLE_SYSTEM_PAGETAB)
{
GetAccessibleName(child, [&flag, &new_tab_name](BSTR bstr) {
if (_wcsicmp(bstr, new_tab_name) == 0)
{
DebugLog(L"Found PageTab with name: %s", bstr);
flag = true;
}
});
}
return flag;
if (GetAccessibleState(child) & STATE_SYSTEM_SELECTED)
{
GetAccessibleName(child, [&flag, &new_tab_name](BSTR bstr) {
if (_wcsnicmp(bstr, new_tab_name, wcslen(new_tab_name)) == 0)
{
flag = true;
}
else
{
flag = false;
}
});
}
return false;
});
free(new_tab_name);
}
}
}
Expand Down

0 comments on commit 8c4f7a9

Please sign in to comment.