diff options
| author | Yuuki Harano | 2021-01-24 00:47:50 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-01-24 00:47:50 +0900 |
| commit | e9608601e5d5f45be36a8f833a98230086e628a8 (patch) | |
| tree | b8906520d70bdc75ba6d1b2ebe49eb9f775c464b /src | |
| parent | f7fa39fbda29d80930d6be97a4ad2f2818b590ff (diff) | |
| download | emacs-e9608601e5d5f45be36a8f833a98230086e628a8.tar.gz 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, | |||
| 5826 | attributes); | 5826 | attributes); |
| 5827 | attributes = Fcons (Fcons (Qframes, AREF (monitor_frames, i)), | 5827 | attributes = Fcons (Fcons (Qframes, AREF (monitor_frames, i)), |
| 5828 | attributes); | 5828 | attributes); |
| 5829 | #ifdef HAVE_PGTK | ||
| 5830 | attributes = Fcons (Fcons (Qscale_factor, make_float (mi->scale_factor)), | ||
| 5831 | attributes); | ||
| 5832 | #endif | ||
| 5829 | attributes = Fcons (Fcons (Qmm_size, | 5833 | attributes = Fcons (Fcons (Qmm_size, |
| 5830 | list2i (mi->mm_width, mi->mm_height)), | 5834 | list2i (mi->mm_width, mi->mm_height)), |
| 5831 | attributes); | 5835 | attributes); |
| @@ -5938,6 +5942,9 @@ syms_of_frame (void) | |||
| 5938 | 5942 | ||
| 5939 | DEFSYM (Qworkarea, "workarea"); | 5943 | DEFSYM (Qworkarea, "workarea"); |
| 5940 | DEFSYM (Qmm_size, "mm-size"); | 5944 | DEFSYM (Qmm_size, "mm-size"); |
| 5945 | #ifdef HAVE_PGTK | ||
| 5946 | DEFSYM (Qscale_factor, "scale-factor"); | ||
| 5947 | #endif | ||
| 5941 | DEFSYM (Qframes, "frames"); | 5948 | DEFSYM (Qframes, "frames"); |
| 5942 | DEFSYM (Qsource, "source"); | 5949 | DEFSYM (Qsource, "source"); |
| 5943 | 5950 | ||
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 { | |||
| 1746 | Emacs_Rectangle geom, work; | 1746 | Emacs_Rectangle geom, work; |
| 1747 | int mm_width, mm_height; | 1747 | int mm_width, mm_height; |
| 1748 | char *name; | 1748 | char *name; |
| 1749 | #ifdef HAVE_PGTK | ||
| 1750 | double scale_factor; | ||
| 1751 | #endif | ||
| 1749 | }; | 1752 | }; |
| 1750 | 1753 | ||
| 1751 | extern void free_monitors (struct MonitorInfo *monitors, int n_monitors); | 1754 | 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. */) | |||
| 2647 | mi->work.height = work.height; | 2647 | mi->work.height = work.height; |
| 2648 | mi->mm_width = width_mm; | 2648 | mi->mm_width = width_mm; |
| 2649 | mi->mm_height = height_mm; | 2649 | mi->mm_height = height_mm; |
| 2650 | mi->scale_factor = scale; | ||
| 2650 | 2651 | ||
| 2651 | dupstring (&mi->name, (gdk_monitor_get_model (monitor))); | 2652 | dupstring (&mi->name, (gdk_monitor_get_model (monitor))); |
| 2652 | } | 2653 | } |