Skip to content
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

Remove hack to ensure that focus is set. #716

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

mattrose
Copy link
Member

@mattrose mattrose commented Mar 1, 2023

set_focus() should do the trick according to the docs, so let's just use that, and not go to extraordinary measures.

fixes #714 hopefully

set_focus() should do the trick according to the docs, so
let's just use that, and not go to extraordinary measures.
@mattrose mattrose merged commit 3d79ca5 into gnome-terminator:master Mar 9, 2023
@Vulcalien
Copy link
Member

Vulcalien commented Mar 11, 2023

I lost focus on start after this. I'm on X11, Gnome, Debian 12. I'll try to fix it.

Removing the line window.set_focus(), it then works fine for me.

@mattrose
Copy link
Member Author

mattrose commented Mar 11, 2023

Removing the line window.set_focus(), it then works fine for me.

Oo, can you send in a PR with that and I'll merge it?

If not, it's a simple change I can do if you want.

@mattrose
Copy link
Member Author

Days like this I love GTK. This function does the exact opposite of what the function says it does. 😛

@Vulcalien
Copy link
Member

Vulcalien commented Mar 11, 2023

I think the "restore focus" feature isn't working altogether.
That part of the code is meant to focus the last active terminal in a layout, right?

If that's so, then I believe that instead of focusing the last active window, we should focus the last window's last active terminal.

Edit: I think it wasn't working with the "awful workaround" code either.
And set_focus may be taking an argument. If it's None, it removes the focus.

@mattrose
Copy link
Member Author

@Vulcalien do you have a config that can reproduce the problem, or is it now fixed with the final change?

@Vulcalien
Copy link
Member

Vulcalien commented Mar 25, 2023

config.txt

Here there are two windows, each with one terminal.
From what I read in the config file, the terminal named "This terminal should be focused" should be.. well, focused. Instead, the focus goes to the unnamed window (at least in my machine).


config.txt

For some reason, having a notebook influences how the focus is chosen. In this case, it works as it should.
In other tests (config.txt), it doesn't.


What I think it's happening, is that the window that is written as last in the config file is the one that grabs the focus, every time.
I've tried looking for the cause, but found nothing.

Edit: very likely the behavior differs greatly between desktop environments. I'm on Gnome 43, X11.

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

Successfully merging this pull request may close these issues.

"Don't ask, don't tell" focus hack causes gnome-shell to freeze for seconds / Xwayland to crash
2 participants