Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50654 - The highlighting prefrences in gedit 2.6.1 get confused (w/patch)
Summary: The highlighting prefrences in gedit 2.6.1 get confused (w/patch)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-10 11:07 UTC by Travis Snoozy
Modified: 2004-07-07 14:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Travis Snoozy 2004-05-10 11:07:58 UTC
In gedit, while the user is viewing the highlighting styles for specific syntax languages, the styles will get `confused' in that entries will start switching values with one another, and display incorrect information about the currently selected highlighting class. The included patch has been submitted upstream to the Gnome bug tracking system, in addition to this submission. Thier bug number is included in the patch.

Reproducible: Always
Steps to Reproduce:
1. Edit -> Preferences (Syntax Highlighting tab)
2. Switch between the various entries in the list (between bold and non-bold entries is one instance which will show this bug)

Actual Results:  
The entries get mixed up, the highlighting proporties switching places between
the various entries in the list.

Expected Results:  
The software should be accessing the highlight settings in a read-only fashion
while switching between entries.

### Patch ###

*** ./gedit/dialogs/gedit-preferences-dialog.c	Sun May  9 12:02:12 2004
--- ./gedit/dialogs/gedit-preferences-dialog.c	Mon May 10 06:40:51 2004
***************
*** 866,871 ****
--- 866,882 ----
  	return style;
  }
  
+ /*
+ FIXME: Put these in a better place. We need these prototypes to come before
+ styles_cb().
+ */
+ static void
+ style_button_toggled (GtkToggleButton        *button,
+ 		      GeditPreferencesDialog *dlg);
+ static void
+ style_color_set (GtkColorButton         *button,
+ 		 GeditPreferencesDialog *dlg);
+ 
  static void
  styles_cb (GtkWidget              *treeview,
  	   GeditPreferencesDialog *dlg)
***************
*** 875,880 ****
--- 886,912 ----
  	style = get_selected_style (dlg);
  	g_return_if_fail (style != NULL);
  
+     /* 
+     Temporarily turn off the callbacks for the highlighting buttons while we set
+     them up to reflect the new selection. (bug #141741)
+     */
+     g_signal_handlers_block_matched(G_OBJECT (dlg->bold_togglebutton),
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->italic_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->underline_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->strikethrough_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->foreground_checkbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->background_checkbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->foreground_colorbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_color_set), NULL);
+     g_signal_handlers_block_matched(G_OBJECT (dlg->background_colorbutton_2), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_color_set), NULL);
+     
  	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->bold_togglebutton),
  				      style->bold);
  	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->italic_togglebutton),
***************
*** 927,932 ****
--- 959,983 ----
  	gtk_widget_set_sensitive (dlg->reset_button, !style->is_default);
  
  	gtk_source_tag_style_free (style);
+     
+     /* Our setup is complete; re-enable the button callbacks. */
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->bold_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->italic_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->underline_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->strikethrough_togglebutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->foreground_checkbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->background_checkbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_button_toggled),
NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->foreground_colorbutton), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_color_set), NULL);
+     g_signal_handlers_unblock_matched(G_OBJECT (dlg->background_colorbutton_2), 
+             G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(style_color_set), NULL);
+     
  }
  
  static void

### emerge --info ###

Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040420-r0,
2.6.5-gentoo)
=================================================================
System uname: 2.6.5-gentoo i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.10
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/root/portage_overlay/"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib acpi alsa apache2 avi berkdb bonobo crypt cscope cups curl dga doc
dvd encode esd fbcon flash foomaticdb gdbm gif gnome gpm gstreamer gtk gtk2
gtkhtml guile imlib java jikes jpeg libg++ libwww mad maildir mikmod mmx motif
mpeg ncurses nls offensive oggvorbis pam pcmcia pdflib perl png pnp python
quicktime readline scanner sdl slang slp spell sse ssl svga tcpd tetex tiff
truetype unicode usb wmf wxwindows x86 xml2 xmms xosd xv zlib"
Comment 1 Leonardo Boshell (RETIRED) gentoo-dev 2004-07-07 14:03:17 UTC
The patch from Gnome's CVS is applied to gedit-2.6.1-r1.

Thank you for your report.