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 372743 - vte_terminal_set_colors doesn't work as advertised
vte_terminal_set_colors doesn't work as advertised
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.16.x
Other All
: Normal trivial
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 332606 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-08 23:55 UTC by Ethan Glasser-Camp
Modified: 2007-06-12 00:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ethan Glasser-Camp 2006-11-08 23:55:29 UTC
Please describe the problem:
The documentation for the VTE widget says, under set_colors:

"palette_size must be either 0, 8, 16, or 24."

However, on vte.c, line 6692, in vte_terminal_set_colors, you can see the assertion:

g_return_if_fail((palette_size == 0) ||
			 (palette_size == 8) ||
			 (palette_size == 16) ||
			 (palette_size == G_N_ELEMENTS(terminal->pvt->palette)));

if palette_size is 24, you get a warning:

CRITICAL **: vte_terminal_set_colors: assertion `(palette_size == 0) ||
(palette_size == 8) || (palette_size == 16) || (palette_size ==
G_N_ELEMENTS(terminal->pvt->palette))' failed

You can work around this, because if you know how VteTerminal stores its
palette, you can just create a 30-color palette with all the colors in the right
place, but this is a hack.

I think that the return_if_fail should have another condition added, which is
palette_size == 24.

Ethan

Steps to reproduce:


Actual results:


Expected results:
The function call should go through.

Does this happen every time?
Yes.

Other information:
Comment 1 Ethan Glasser-Camp 2007-06-11 21:21:21 UTC
Still present in 0.16.x..

Ethan
Comment 2 Behdad Esfahbod 2007-06-11 21:37:18 UTC
2007-06-11  Behdad Esfahbod  <behdad@gnome.org>

        Bug 372743 – vte_terminal_set_colors doesn't work as advertised

        * src/vte.c (vte_terminal_set_colors): Allow 24-color palettes.

Comment 3 Guilherme de Siqueira Pastore 2007-06-12 00:03:42 UTC
*** Bug 332606 has been marked as a duplicate of this bug. ***