diff options
author | Po Lu <luangruo@yahoo.com> | 2022-05-23 11:13:45 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-05-23 11:13:45 +0800 |
commit | 5346b67fc27f50abeec3c4f72252a8d9a36f2e6b (patch) | |
tree | 3d0d97bf14696172990508e3329461ba1df58245 /src/nsfns.m | |
parent | 20662ecd214fbe2a9f200085b9194a6f7677d447 (diff) | |
download | emacs-5346b67fc27f50abeec3c4f72252a8d9a36f2e6b.tar.gz emacs-5346b67fc27f50abeec3c4f72252a8d9a36f2e6b.tar.bz2 emacs-5346b67fc27f50abeec3c4f72252a8d9a36f2e6b.zip |
Implement monitor change functions on GNUstep
* src/nsfns.m (Fns_display_monitor_attributes_list): Fix coding
style.
* src/nsterm.m (nstrace_leave, nstrace_restore_global_trace_state)
(nstrace_fullscreen_type_name): Fix coding style.
(ns_displays_reconfigured, ns_term_init): Make a record of the
previous display attributes list and avoid storing duplicate
events.
([EmacsApp init]): Listen for
NSApplicationDidChangeScreenParametersNotification.
([EmacsApp updateMonitors:]): New method.
(syms_of_nsterm): New staticpro.
Diffstat (limited to 'src/nsfns.m')
-rw-r--r-- | src/nsfns.m | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 818ba6f40f1..20c36209eb5 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2769,7 +2769,8 @@ Internal use only, use `display-monitor-attributes-list' instead. */) } else { - // Flip y coordinate as NS has y starting from the bottom. + /* Flip y coordinate as NS screen coordinates originate from + the bottom. */ y = (short) (primary_display_height - fr.size.height - fr.origin.y); vy = (short) (primary_display_height - vfr.size.height - vfr.origin.y); @@ -2781,11 +2782,12 @@ Internal use only, use `display-monitor-attributes-list' instead. */) m->geom.height = (unsigned short) fr.size.height; m->work.x = (short) vfr.origin.x; - // y is flipped on NS, so vy - y are pixels missing at the bottom, - // and fr.size.height - vfr.size.height are pixels missing in total. - // Pixels missing at top are - // fr.size.height - vfr.size.height - vy + y. - // work.y is then pixels missing at top + y. + /* y is flipped on NS, so vy - y are pixels missing at the + bottom, and fr.size.height - vfr.size.height are pixels + missing in total. + + Pixels missing at top are fr.size.height - vfr.size.height - + vy + y. work.y is then pixels missing at top + y. */ m->work.y = (short) (fr.size.height - vfr.size.height) - vy + y + y; m->work.width = (unsigned short) vfr.size.width; m->work.height = (unsigned short) vfr.size.height; @@ -2800,13 +2802,14 @@ Internal use only, use `display-monitor-attributes-list' instead. */) } #else - // Assume 92 dpi as x-display-mm-height/x-display-mm-width does. + /* Assume 92 dpi as x-display-mm-height and x-display-mm-width + do. */ m->mm_width = (int) (25.4 * fr.size.width / 92.0); m->mm_height = (int) (25.4 * fr.size.height / 92.0); #endif } - // Primary monitor is always first for NS. + /* Primary monitor is always ordered first for NS. */ attributes_list = ns_make_monitor_attribute_list (monitors, n_monitors, 0, "NS"); |