Skip to content

Title context does not update sometimes (windows, firefox) #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codecat555 opened this issue Feb 28, 2022 · 3 comments
Closed

Title context does not update sometimes (windows, firefox) #492

codecat555 opened this issue Feb 28, 2022 · 3 comments

Comments

@codecat555
Copy link

codecat555 commented Feb 28, 2022

Talon version v0.2.0-347-ga925 (347)

I've seen some odd behavior the last couple of days. I'm reading slack using firefox and have a thread open in the right-hand sidebar. I use my 'step out' command to issue the ctrl-. key sequence which closes the sidebar, and it doesn't work.Turns out it's because the context title is not correct. That is the firefox tab shows the correct title but 'talon dump context' does not -

2022-02-24 12:17:40    IO 'talon dump context'
2022-02-24 12:17:40    IO [audio]=1530.000ms [compile]=0.016ms [emit]=52.770ms [decode]=6.444ms [total]=59.230ms
2022-02-24 12:17:40    IO Name: Firefox
Executable: C:\Program Files\Mozilla Firefox\firefox.exe
Bundle:
Title: Refactoring source code in Visual Studio Code — Mozilla Firefox
2022-02-24 12:17:40    IO

That title of the currently-focused tab was 'Slack | cursorless | Talon — Mozilla Firefox'.

Switching tabs or windows did not update the title either. Eventually, it seemed to just fix itself while I was investigating. Today, the title updated properly when I switched to a different slack channel.

@codecat555
Copy link
Author

codecat555 commented Feb 28, 2022

I think it's happening when I highlight some text in slack (in firefox) and then right click and select the 'Search google for...' option. That takes me to a new tab and when I switch back to my slack tab, the window title is not updated properly.Anyways, that's what I just did and then I used this debug code -

        result = actions.user.talon_get_active_context()
        print(result)

        w = ui.active_window()
        print(f'win_title_debug: talon active window title = {w.title}')
        
        win32_title = win32gui.GetWindowText(w.id)
        print(f'win_title_debug: win32 active window title = {win32_title}')

Here's the resulting output -

2022-02-27 20:22:46    IO 'win title debug'
2022-02-27 20:22:46    IO [audio]=1740.000ms [compile]=0.013ms [emit]=55.200ms [decode]=5.764ms [total]=60.978ms
2022-02-27 20:22:46    IO Name: Firefox
Executable: C:\Program Files\Mozilla Firefox\firefox.exe
Bundle:
Title: Meet people like Ryan Arias on MeetMe! — Mozilla Firefox
2022-02-27 20:22:46    IO
2022-02-27 20:22:46    IO win_title_debug: talon active window title = Meet people like Ryan Arias on MeetMe! — Mozilla Firefox
2022-02-27 20:22:46    IO win_title_debug: win32 active window title = Slack | help | Talon — Mozilla Firefox

@codecat555
Copy link
Author

I can't repro it at will simply by following those steps. That was just roughly the sequence of events which led to the situation in at least two or three instances recently.

Basically, I'm reading slack and pop open the sidebar to read a thread, then I navigate to another tab or window to check something out before coming back to continue reading. At that point, I try to close the sidebar but it doesn't work because the title has not been updated.

Also not sure why or when it starts working again...although one path might be following a link without opening a new tab (like moving to a different channel within my slack tab). I suppose this might fix it because it forces a title update for the current tab...but that's just a guess and I don't know if it works every time.

@lunixbochs
Copy link

lunixbochs commented Oct 25, 2022

I believe this is fixed on Talon 0.3.1-49-g8e47. If you encounter it on that version or later, before restarting Talon, please open the repl and run

debug.print_threads()

and post the output here, as well as your Talon version. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants