]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Remove a mysterious GTK size-request tweak.
authorSimon Tatham <anakin@pobox.com>
Tue, 25 Aug 2015 18:55:38 +0000 (19:55 +0100)
committerSimon Tatham <anakin@pobox.com>
Tue, 25 Aug 2015 19:00:55 +0000 (20:00 +0100)
In shortcut_add(), when we add an underlined letter to a GtkLabel, we
were fetching the label's height before changing its text, and
restoring it afterwards. I've no idea why - I can see no difference
with and without the code.

That code's been there since 2003 without explanation. My best guess
is that it was working around a GTK bug of the day, but since no
difference is visible even in current GTK1, I think I'm just going to
remove it. If any problems show up later, I can put it back, with an
actual comment!

unix/gtkdlg.c

index 0db347d8ba182f8a5c40aaf029cef76b68e819f4..c044c0623347d1435e641edcb45a28b358501514 100644 (file)
@@ -2841,14 +2841,8 @@ static void shortcut_highlight(GtkWidget *labelw, int chr)
 
     for (i = 0; currstr[i]; i++)
        if (tolower((unsigned char)currstr[i]) == chr) {
-           GtkRequisition req;
-
            pattern = dupprintf("%*s_", i, "");
-
-           gtk_widget_size_request(GTK_WIDGET(label), &req);
            gtk_label_set_pattern(label, pattern);
-           gtk_widget_set_size_request(GTK_WIDGET(label), -1, req.height);
-
            sfree(pattern);
            break;
        }