• Christophe Fergeau's avatar
    fontchooserwidget: Don't invalidate priv->font_iter in load_fonts · 77487fef
    Christophe Fergeau authored
    When using GtkFontChooserButton, the same GtkFontChooserWidget can be
    hidden and shown multiple times. When doing that, the font that was
    chosen the previous time should be the selected one in the
    GtkFontChooserWidget, however this does not work as expected and a
    somehow 'random' font gets selected (or none) instead.
    
    Every time the font chooser widget is shown, its style will be updated,
    causing gtk_font_chooser_widget_style_updated and then
    gtk_font_chooser_widget_load_fonts to be called.
    
    gtk_font_chooser_widget_load_fonts starts by clearing the GtkListStore
    listing the available fonts, repopulates it, and then makes sure the
    current font is selected.
    
    However, this does not work as expected, as during the call to
    gtk_list_store_clear, the cursor_changed_cb will be invoked multiple
    times when the GtkTreeView cursor gets moved when the line where the
    cursor currently is gets removed. This will cause the 'current font'
    state (priv->font_desc) to be unexpectedly modified, and when
    gtk_font_chooser_widget_load_fonts tries to reposition the cursor to the
    'current font', we won't get the expect result.
    
    This commit avoids that by making sure cursor_changed_cb does not get
    called when we call gtk_list_store_clear in
    gtk_font_chooser_widget_load_fonts.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739111
    77487fef
Name
Last commit
Last update
build Loading commit data...
demos Loading commit data...
docs Loading commit data...
examples Loading commit data...
gdk Loading commit data...
gtk Loading commit data...
libgail-util Loading commit data...
m4 Loading commit data...
m4macros Loading commit data...
modules Loading commit data...
po Loading commit data...
po-properties Loading commit data...
tests Loading commit data...
testsuite Loading commit data...
util Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
HACKING Loading commit data...
INSTALL.in Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
Makefile.decl Loading commit data...
NEWS Loading commit data...
NEWS.pre-1-0 Loading commit data...
README.commits Loading commit data...
README.in Loading commit data...
README.win32 Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
config.h.win32.in Loading commit data...
configure.ac Loading commit data...
gail-3.0.pc.in Loading commit data...
gdk-3.0.pc.in Loading commit data...
git.mk Loading commit data...
gtk+-3.0.pc.in Loading commit data...
gtk+-unix-print-3.0.pc.in Loading commit data...
gtk+.doap Loading commit data...
gtk-zip.sh.in Loading commit data...
makefile.msc Loading commit data...
sanitize-la.sh Loading commit data...