mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Resolved: a few PR issues reported by coderabbitai
This commit is contained in:
parent
f9018368ab
commit
c75cb1acec
2 changed files with 21 additions and 14 deletions
|
|
@ -123,10 +123,10 @@ public class TabsCache
|
|||
_indexToElement[newIndex] = tabToAdd;
|
||||
}
|
||||
|
||||
foreach (var tabtoRevive in tabsToRevive)
|
||||
foreach (var tabToRevive in tabsToRevive)
|
||||
{
|
||||
Context.API.LogDebug(ClassName, $"TABS:Reset age of {TryName(tabtoRevive.Key)} as it appeared again");
|
||||
_elementToInfo[tabtoRevive.Key].Age = 0;
|
||||
Context.API.LogDebug(ClassName, $"TABS:Reset age of {TryName(tabToRevive.Key)} as it appeared again");
|
||||
_elementToInfo[tabToRevive.Key].Age = 0;
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
|
|
|
|||
|
|
@ -144,20 +144,27 @@ public class TabsReservationService : IDisposable
|
|||
{
|
||||
lock (_sync)
|
||||
{
|
||||
var currentTab = new BrowserTab
|
||||
try
|
||||
{
|
||||
Title = tab.Current.Name,
|
||||
BrowserName = trackingInfo.ProcessName,
|
||||
Hwnd = trackingInfo.ProcessMainWindowHandle,
|
||||
AutomationElement = tab
|
||||
};
|
||||
var currentTab = new BrowserTab
|
||||
{
|
||||
Title = tab.Current.Name,
|
||||
BrowserName = trackingInfo.ProcessName,
|
||||
Hwnd = trackingInfo.ProcessMainWindowHandle,
|
||||
AutomationElement = tab
|
||||
};
|
||||
|
||||
Context.API.LogDebug(ClassName, $"TABS:{RuntimeIdToKey(currentTab.AutomationElement)}:Registering {url} as tab: {currentTab.Title}");
|
||||
_urlToBrowserTab[url] = currentTab;
|
||||
_automationElementToUrl[currentTab.AutomationElement] = url;
|
||||
Context.API.LogDebug(ClassName, $"TABS:{RuntimeIdToKey(currentTab.AutomationElement)}:Registering {url} as tab: {currentTab.Title}");
|
||||
_urlToBrowserTab[url] = currentTab;
|
||||
_automationElementToUrl[currentTab.AutomationElement] = url;
|
||||
|
||||
// required to take the tab into account by Flow Launcher main UI search window
|
||||
Context.API.ReQuery();
|
||||
// required to take the tab into account by Flow Launcher main UI search window
|
||||
Context.API.ReQuery();
|
||||
}
|
||||
catch (ElementNotAvailableException)
|
||||
{
|
||||
Context.API.LogDebug(ClassName, $"TABS:Tab became unavailable before registration for {url}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue