diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-13 15:17:38 -0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-13 15:17:38 -0200 |
commit | f967d6fb26321d07bd61769ae3c793f97b203b94 (patch) | |
tree | 9602191e195ed60363c226a5417c57211a29a574 | |
parent | f826470d32c48b398a00fb6f7690877e46217927 (diff) | |
download | subsurface-f967d6fb26321d07bd61769ae3c793f97b203b94.tar.gz |
Fix the stupid gtk combo box text reset issue for real
Lubomir's solution to fill them with a newline doesn't work. Well, it
may work on some versions of gtk, but on mine it just results in an ugly
box for the control character '000a' that tries to show the newline.
So this is a third approach: if we reset the text to empty, first set it
to space (to clear it), and then set it to empty. That seems to work on
at least one version of gtk, and doesn't have the problem with the space
*remaining* when you cut-and-paste something into the combo box.
Let's see if it breaks anything else, but at worst it should be no worse
than the old "set it to space" approach - iow the combo box might
remember the space, but at least not some random data from the previous
dive that it happened to show.
Lovely gtk bugs.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | info.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -100,7 +100,7 @@ static void set_combo_box_entry_text(GtkComboBoxEntry *combo_box, const char *te GtkEntry *entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo_box))); gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), -1); if (!*text) - text = "\n"; + gtk_entry_set_text(entry, " "); gtk_entry_set_text(entry, text); } |