/* Scale factor of frame F. */
#if defined HAVE_NS
# define FRAME_SCALE_FACTOR(f) (FRAME_NS_P (f) ? ns_frame_scale_factor (f) : 1)
+#elif defined HAVE_PGTK
+# define FRAME_SCALE_FACTOR(f) (FRAME_PGTK_P (f) ? pgtk_frame_scale_factor (f) : 1)
#else
# define FRAME_SCALE_FACTOR(f) 1
#endif
return attributes_list;
}
+double
+pgtk_frame_scale_factor (struct frame *f)
+{
+ struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
+ GdkDisplay *gdpy = dpyinfo->gdpy;
+
+ block_input ();
+
+ GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
+ GdkMonitor *gmon = gdk_display_get_monitor_at_window (gdpy, gwin);
+
+ /* GTK returns scaled sizes for the workareas. */
+ double scale = pgtk_get_monitor_scale_factor (gdk_monitor_get_model (gmon));
+ if (scale == 0.0)
+ scale = gdk_monitor_get_scale_factor (gmon);
+
+ unblock_input ();
+
+ return scale;
+}
DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 0, 1, 0,
doc: /* Return the number of bitplanes of the display TERMINAL.