terminator icon indicating copy to clipboard operation
terminator copied to clipboard

Reimplement "unfocused dim" using overpainting

Open egmontkob opened this issue 4 years ago • 10 comments

Currently Terminator dims unfocused panels by temporarily setting a different color palette.

This has the following drawbacks:

  • Doesn't affect the 16M truecolors.
  • Doesn't affect a palette color if it was overridden using the OSC 4 escape sequence, because in VTE the OSC values take precedence over the API ones.
  • As per https://gitlab.gnome.org/GNOME/vte/-/issues/242, in a future VTE release it'll probably stop working for the 256-color palette too, and will only work for the first 16 colors.

As recommended in the linked bug, dimming should be done by overpainting with a mostly-transparent white or black (or whatever-the-background-color-is) in the ::draw handler, as done in the VTE test app.

egmontkob avatar May 13 '20 14:05 egmontkob

TBH I didn't even notice terminator does this until now.

The idea of the feature is nice, but it definitely needs a better implementation!

lazyfrosch avatar May 13 '20 15:05 lazyfrosch

Oddly enough this might tie into the background image work as well.

mattrose avatar May 14 '20 15:05 mattrose

@egmontkob can you take a look at #223 and see if this is what you mean? It works really well on my Mac but it has weird inexplicable effects on my Fedora box. There is some code in the vte-2.91 test app that I'm not sure why it's there.

mattrose avatar Oct 09 '20 16:10 mattrose

@mattrose Sorry for not notifying you about this, but I no longer work on terminals. See https://gitlab.gnome.org/GNOME/vte/-/issues/259.

Wishing you all the best, egmont

egmontkob avatar Oct 09 '20 17:10 egmontkob

@egmontkob Understandable. The politics and sheer stubborn-ness have frustrated me quite a bit too, when I can't just ignore it. I'm already running my own fork of vte on my mac laptop just to get the emacs keybindings to work (Ctrl-A, Ctrl-E, etc.), and am thinking of merging the fedora patchset in and distributing that with the snap and flatpak versions of terminator. There are so many different patches from Ubuntu and Fedora that implement functionality that the GTK and/or VTE teams have refused to implement, that it seems the lesser of 2 evils at this point.

Sorry to hear you're not involved anymore, and I wish you the best.

mattrose avatar Oct 09 '20 18:10 mattrose

This is broken in my config. The last terminal in each tab becomes completely white when dimmed (see screenshot). There needs to be at least two tabs open. It doesn't happen if I show the scrollbar (hidden by default in my config). I have white on black on my profile, with a solid background. The shade background is set to 0.50, but is unused (grayed out) because I have the solid background color option set.

Steps to reproduce:

  • set white on black

  • set background to transparent, 0.50

  • now set background to solid

  • disable scrollbars

  • restart terminator

  • open terminator

  • open a second tab

  • split the terminal in two (doesn't matter if horizontally or vertically)

  • the newly created terminal is selected. selecting the other one will make this one white and unreadable

  • note that if you enable the scrollbar on that last terminal, it doesn't become white when selecting the other

It also happens if you open a terminal, open a new tab, then go to GNOME's activity overview.

This is under GNOME 3.38, GTK+ 3.24.24 terminator-white-terminals

epozuelo avatar Jan 15 '21 12:01 epozuelo

Can you paste the config that this set of steps generates?

I'm wondering if this generates a conflicting set of directives in the config that confuses terminator

mattrose avatar Jan 15 '21 14:01 mattrose

Sure, here it is:

[keybindings]
[profiles]
  [[default]]
    cursor_color = "#aaaaaa"
    font = Monospace 14
    foreground_color = "#ffffff"
    show_titlebar = False
    scrollbar_position = hidden
    scrollback_infinite = True
    use_system_font = False
    copy_on_selection = True
[layouts]
  [[default]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[child1]]]
      type = Terminal
      parent = window0
[plugins]

epozuelo avatar Jan 16 '21 08:01 epozuelo

@mattrose got a chance to look at this?

epozuelo avatar Feb 09 '21 08:02 epozuelo

sigh yes, and I think I figured out what's going on, but I really can't figure out how to stop it. When I'm getting the size of the terminal window in a notebook without a scrollbar or titlebar, for some reason, the window size gets bigger to encompass the notebook tabs as well, and that seems to make the opacity of the terminal stronger.

What I haven't figured out is how to stop this behaviour. When I get a chance I'm going to try to talk to some pyGTK devs to see if I can figure out how to prevent this from happening, and possibly open up a GTK bug for it. If it is a bug in GTK I'll have to go back to the old way of doing things and wait for the bug to be fixed. :(

Later edit. I honestly can't promise to look at this very soon, as I started a new job and that's taking up most of my mental energy these days. I will poke as soon as I'm able.

mattrose avatar Feb 09 '21 12:02 mattrose