After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740123 - Add the style context provider with FALLBACK priority
Add the style context provider with FALLBACK priority
Status: RESOLVED WONTFIX
Product: vte
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 778431 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-11-14 16:07 UTC by Iain Lane
Modified: 2021-03-23 20:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add the style context provider with FALLBACK priority (1.03 KB, patch)
2014-11-14 16:07 UTC, Iain Lane
none Details | Review
Add the style context provider with FALLBACK priority (2.97 KB, patch)
2015-07-16 09:48 UTC, Iain Lane
none Details | Review
Allow themes to set a bg and fg color for vte-terminal (2.52 KB, patch)
2017-02-11 07:42 UTC, Wolfgang Ulbrich
none Details | Review

Description Iain Lane 2014-11-14 16:07:09 UTC
We shouldn't use a higher priority than the theme. Since Adwaita doesn't set
this, it'll still be used, and themes can override it.
Comment 1 Iain Lane 2014-11-14 16:07:12 UTC
Created attachment 290719 [details] [review]
Add the style context provider with FALLBACK priority

Adwaita doesn't set these properties any more, but other themes might
want to. Set a lower priority than the theme.
Comment 2 Christian Persch 2014-12-11 20:25:02 UTC
Last time I checked (when I wrote this code), FALLBACK prio didn't work. Does it now?
Comment 3 Iain Lane 2014-12-12 09:19:27 UTC
I can override the colour in my theme, and using Adwaita both the light and dark variants set the bg as theme_base_color in gnome-terminal.

Any other check required?
Comment 4 Iain Lane 2015-04-14 13:40:36 UTC
Cheers, please push
Comment 5 Lars Karlitski 2015-04-21 14:45:27 UTC
Pushed as a264918ad22973c69897c559260e77cb14018235.
Comment 6 Christian Persch 2015-07-15 16:57:08 UTC
Reverted since this caused bug 740123.
Comment 7 Christian Persch 2015-07-15 16:58:02 UTC
... bug 750559 I mean.
Comment 8 Iain Lane 2015-07-16 08:00:34 UTC
Let's repoen the bug then.

Did anybody look into *why* that might happen?
Comment 9 Iain Lane 2015-07-16 09:48:14 UTC
Created attachment 307535 [details] [review]
Add the style context provider with FALLBACK priority

Let's try again. This time we have two style providers. One of them is at
APPLICATION priority and cannot be overridden by the theme. It sets the padding
on VteTerminal widgets. The other one is at FALLBACK priority and is for
colours. This can be overridden by the theme.

This reverts commit bd86e7637d89a55941674756e3e223c82aee2305.

---

I can't reliably reproduce this. It doesn't seem to happen ever with
gnome-terminal 3.16.2 or even every time with 3.14.2-1, using affected vte
versions. I got it maybe 1 in 10 times. After applying this patch (to always
set padding on VteTerminal), I didn't get it at all.

Can others who do know how to reproduce please try?
Comment 10 Ian Abbott 2015-07-16 10:52:01 UTC
The patch in attachment 307535 [details] [review] seems to fix it for me, although I've only been using the Adwaita theme so far.  Any recommendations for other themes to test it with?

With the old style context provider patch, the first gnome-terminal window would have the wrong size most of the time (occasionally it would have the correct size) and subsequent gnome-terminal windows would always have the wrong size.

With the new style context provider patch, I have tested opening Debian's gnome-terminal 3.16.2-1 twenty times and the initial window and subsequent windows both opened with the correct size.  I repeated the test another ten times with a "nearly git master" gnome-terminal (I reverted commit ba2ef8e000e2 for testing because it was incompatible with the Debian-installed  "org.gnome.Terminal.gschema.xml") and again the initial and subsequent terminal windows opened with the correct size (which they didn't with the old patch).
Comment 11 Ian Abbott 2015-07-16 11:08:43 UTC
Further to comment #10:
With the old style context provider patch (for either vte master or Debian's libvte-2.91-0) and Debian's gnome-terminal 3.16.2-1, I can't reproduce the bug at all with the Albatross, Blackbird, Bluebird and Greybird themes, but could reproduce it very reliably with the Adwaita theme.  For vte master with the new style context provider patch, I can't reproduce the bug with any of those themes.
Comment 12 Christian Persch 2015-07-19 07:43:27 UTC
I don't see why you need to split the css. It's using theme colours (@theme_{base,fg}_color) already, so doesn't that get taken from the theme?
Comment 13 Iain Lane 2015-07-19 16:21:43 UTC
If you want to use a colour other than those for the terminal then you can't.

We style TerminalScreen and set background-color and color. Without a patch like this then the theme cannot do that since it is hardcoded in a way that themes can't override to use @theme_foo_color.
Comment 14 Iain Lane 2015-09-01 15:16:43 UTC
Can I commit this new patch?
Comment 15 Christian Persch 2015-09-01 18:28:36 UTC
If you want to change the terminal colours, you can already do this by installing a gsettings override for gnome-terminal. Why is it necessary to provide another way? (Also, have you analysed why the original patch failed to set the border, and why the same probelm wouldn't happen for the colours, with the new patch?)
Comment 16 Iain Lane 2015-09-02 08:13:47 UTC
How? And why is it good for theme authors to have to provide a special method for the terminal instead of theming it like they can do with everything else?

I would guess that vte is relying on the padding being 1, 1, 1, 1 somehow and so it doesn't support themes setting this to anything else. So here we don't make the padding overridable, but just the colours.
Comment 17 Christian Persch 2017-02-10 23:35:28 UTC
*** Bug 778431 has been marked as a duplicate of this bug. ***
Comment 18 Wolfgang Ulbrich 2017-02-11 07:40:18 UTC
Ok, here is my suggestion from #778431
Using GTK_STYLE_PROVIDER_PRIORITY_APPLICATION for the padding and
GTK_STYLE_PROVIDER_PRIORITY_THEME for bg and fg color.
In result gnome-terminal or mate-terminal use your proposed colors if nothing is set in gtk+ theme or can use a theme setting if available in themes.
Ie.
https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/Blue-Submarine/gtk-3.0/mate-applications.css#L897
And many other themes.
It looks like that Ubuntu already patched vte to allow that as there or in linuxmint theme settings will used.
Please allow this for other distros too.
I do not maintain vte in fedora so i can't patch it as upstream.
And with current version in fedora your proposed colors are used if i mark the checkbox 'use theme settings' in gnome or mate-terminal.
Comment 19 Wolfgang Ulbrich 2017-02-11 07:42:17 UTC
Created attachment 345511 [details] [review]
Allow themes to set a bg and fg color for vte-terminal
Comment 20 Wolfgang Ulbrich 2017-02-11 07:44:22 UTC
err typo...i meant
I do not maintain vte in fedora so i can't patch it as downstream.
Comment 21 Christian Persch 2017-02-11 18:50:54 UTC
Any response to the technical issue in comment 15 ?
Comment 22 Wolfgang Ulbrich 2017-03-07 10:08:06 UTC
Any news?
Patch is in ubuntu-16.10 so i am in doubt that anyone will test it more.
And i can't reproduce https://bugzilla.gnome.org/show_bug.cgi?id=750559
with fedora-24/25/26.
Comment 23 Christian Persch 2017-08-15 19:18:33 UTC
(In reply to Christian Persch from comment #21)
> Any response to the technical issue in comment 15 ?

Well?
Comment 24 Wolfgang Ulbrich 2017-08-15 20:07:58 UTC
It's confirmed here.
https://bugzilla.gnome.org/show_bug.cgi?id=750559#c17
Comment 25 Christian Persch 2017-08-15 20:40:21 UTC
I don't see it?

> (Also, have you analysed why the original patch failed to set the border, and 
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> why the same probelm wouldn't happen for the colours, with the new patch?)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Comment 26 Wolfgang Ulbrich 2017-08-15 20:51:13 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=750559#c17

(In reply to Iain Lane from comment #13)
> Can people who were able to reproduce reliably (I couldn't...) try the new
> patch on bug #740123?

I have this problem on Ubuntu Gnome, which still includes the old version of the patch.  Replacing it with the new version of the patch fixes it for me.




This is a confirmation for me.
But do what you want, i am given up to wait for a simple fix which doesn't hurt.