diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-01-24 00:47:50 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-01-24 00:47:50 +0900 |
commit | e9608601e5d5f45be36a8f833a98230086e628a8 (patch) | |
tree | b8906520d70bdc75ba6d1b2ebe49eb9f775c464b /src | |
parent | f7fa39fbda29d80930d6be97a4ad2f2818b590ff (diff) | |
download | emacs-e9608601e5d5f45be36a8f833a98230086e628a8.tar.gz emacs-e9608601e5d5f45be36a8f833a98230086e628a8.tar.bz2 emacs-e9608601e5d5f45be36a8f833a98230086e628a8.zip |
Add scale factor in display-monitor-attributes-list.
* lisp/frame.el (display-monitor-attributes-list): Add the comment.
* src/frame.c (make_monitor_attribute_list): Include the scale factor value.
(syms_of_frame): Declare intern'ed scale-factor.
* src/frame.h (struct MonitorInfo): Add scale_factor member.
* src/pgtkfns.c (Fpgtk_display_monitor_attributes_list): Set the value.
Diffstat (limited to 'src')
-rw-r--r-- | src/frame.c | 7 | ||||
-rw-r--r-- | src/frame.h | 3 | ||||
-rw-r--r-- | src/pgtkfns.c | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index daaba2abfec..998ddaabb39 100644 --- a/src/frame.c +++ b/src/frame.c @@ -5826,6 +5826,10 @@ make_monitor_attribute_list (struct MonitorInfo *monitors, attributes); attributes = Fcons (Fcons (Qframes, AREF (monitor_frames, i)), attributes); +#ifdef HAVE_PGTK + attributes = Fcons (Fcons (Qscale_factor, make_float (mi->scale_factor)), + attributes); +#endif attributes = Fcons (Fcons (Qmm_size, list2i (mi->mm_width, mi->mm_height)), attributes); @@ -5938,6 +5942,9 @@ syms_of_frame (void) DEFSYM (Qworkarea, "workarea"); DEFSYM (Qmm_size, "mm-size"); +#ifdef HAVE_PGTK + DEFSYM (Qscale_factor, "scale-factor"); +#endif DEFSYM (Qframes, "frames"); DEFSYM (Qsource, "source"); diff --git a/src/frame.h b/src/frame.h index 10cb3f52e5e..7372e74cfef 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1746,6 +1746,9 @@ struct MonitorInfo { Emacs_Rectangle geom, work; int mm_width, mm_height; char *name; +#ifdef HAVE_PGTK + double scale_factor; +#endif }; extern void free_monitors (struct MonitorInfo *monitors, int n_monitors); diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 63e121f1180..620680fbdaa 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -2647,6 +2647,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) mi->work.height = work.height; mi->mm_width = width_mm; mi->mm_height = height_mm; + mi->scale_factor = scale; dupstring (&mi->name, (gdk_monitor_get_model (monitor))); } |