patch 9.2.0532: GTK: preedit font size is wrong for fractional point sizes

Commit: 
https://github.com/vim/vim/commit/e323740b568e14f87fb29f123556cec69d30f80b
Author: Muraoka Taro <[email protected]>
Date:   Mon May 25 15:26:08 2026 +0000

    patch 9.2.0532: GTK: preedit font size is wrong for fractional point sizes
    
    Problem:  GTK: preedit font size is wrong for fractional point sizes
    Solution: Compute the font size as a double and round to the nearest
              integer (Muraoka Taro).
    
    closes: #20316
    
    Co-authored-by: Christian Brabandt <[email protected]>
    Signed-off-by: Muraoka Taro <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/gui_xim.c b/src/gui_xim.c
index a04667e2d..0700ce41a 100644
--- a/src/gui_xim.c
+++ b/src/gui_xim.c
@@ -474,8 +474,10 @@ im_preedit_window_open(void)
        gchar              *css = NULL;
        const char * const fontname
                           = pango_font_description_get_family(gui.norm_font);
-       gint    fontsize
-               = pango_font_description_get_size(gui.norm_font) / PANGO_SCALE;
+       // Since font sizes can be specified as non-integer values like 10.5,
+       // they must be handled as floating-point (gdouble).
+       gdouble fontsize
+               = (gdouble)pango_font_description_get_size(gui.norm_font) / 
PANGO_SCALE;
        gchar   *fontsize_propval = NULL;
 
        if (!pango_font_description_get_size_is_absolute(gui.norm_font))
@@ -488,7 +490,7 @@ im_preedit_window_open(void)
            fontsize = dpi * fontsize / 72;
        }
        if (fontsize > 0)
-           fontsize_propval = g_strdup_printf("%dpx", fontsize);
+           fontsize_propval = g_strdup_printf("%dpx", (gint)(fontsize + 0.5));
        else
            fontsize_propval = g_strdup_printf("inherit");
 
diff --git a/src/version.c b/src/version.c
index 4db22e069..69f0ef22b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    532,
 /**/
     531,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wRXUF-0060aY-Gm%40256bit.org.

Raspunde prin e-mail lui