+2004-06-26 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+ (init_dpi_conversion_factor): Check for int_dpi < 0 in case gtk-xft-dpi
+ can not calculate the right value.
+ (dpi_changed_cb): Likewise. Mark *pspec as unused.
+
2004-06-24 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.jacks/jacks.xfail: Remove
{
int int_dpi;
g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+ /* If int_dpi == -1 gtk-xft-dpi returns the default value. So we
+ have to do approximate calculation here. */
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+
g_signal_connect (settings, "notify::gtk-xft-dpi",
- G_CALLBACK (dpi_changed_cb), NULL);
+ G_CALLBACK (dpi_changed_cb), NULL);
}
else
/* Approximate. */
static void
dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec)
+ GParamSpec *pspec __attribute__((unused)))
{
int int_dpi;
g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
}