gnome-shell-extension-ddterm icon indicating copy to clipboard operation
gnome-shell-extension-ddterm copied to clipboard

Tabs get focus

Open lfom opened this issue 4 years ago • 4 comments

Hello!

Thanks for ddterm, I have been using since a while ago and I really enjoy it. Thanks a lot for this useful extension!

Small glitch/bug: clicking on the tabs with the mouse a second time focus the tab switch label, so what is typed does not go to the terminal. What is even weirder is that if you do it when a new tab is created then I can see the dashed line showing the focus, but if I hide then show again the terminal it behaves the same way but the dashed line is gone. I have played with the .ui files trying to disable the focus but it did not work, maybe it is hard coded somewhere?

Regards

lfom avatar Oct 01 '21 04:10 lfom

These are two separate issues. Could you report them as such? i. e. "New issue" and move one of the two paragraphs there.

amezin avatar Oct 05 '21 23:10 amezin

Done, search glitch moved to #89.

lfom avatar Oct 06 '21 03:10 lfom

I'm not sure if it's a bug. GtkNotebook needs some form of keyboard navigation, after all. However, there are already keyboard shortcuts for the same purpose.

This is most likely implemented in GtkNotebook. I don't know whether it can be disabled.

amezin avatar Oct 06 '21 04:10 amezin

Yes, GTK notebook is a little weird but I am sure this can be done. Both Gnome Terminal and Terminal use it for tabs and in both the tabs are not focuses and clicked, although you can still click (of couse) and double-click and secondary-click. Maybe setting the GTK property has_focus/can_focus in the code with prevent this?

lfom avatar Oct 10 '21 05:10 lfom

Cracked it! Using the GTK inspector, I noticed the property can-focus changes from FALSE to TRUE when the tab bar gets displayed (this bug only happens when "Show tab bar" is set to "Automatic").

https://user-images.githubusercontent.com/65264536/223453717-3cd4fdef-6c37-443f-bf41-2decd1a883ec.mp4

We can solve this, by making sure we setting this property every time we insert a new page to the notebook:

insert_page(position) {
    // ...
    this.notebook.set_can_focus(false);
    // ...
}

I'll submit a PR with that change.

pesader avatar Mar 07 '23 14:03 pesader

Fix will be included in the next release

amezin avatar Mar 18 '23 08:03 amezin