Giter Club home page Giter Club logo

dispwatch's People

Contributors

jcs090218 avatar mnp avatar zenspider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dispwatch's Issues

display-pixel-* from emacs is a lie?

I've seen this on 2 macbooks & an HP monitor... the values that come back from display-pixel-* (which uses x-display-pixel-*) seems to be a lie. Specifically, switching from one resolution to another seems to generate a myriad of values... I'm trying to get my lookup table working for OSX's 5 scaling factors, but I've gone through 7-8 by now by going up and down. I've seen similar screwups when I change font size and then ask for frame-width... it often takes a while for the values to change or they're just inconsistent.

What IS consistent is the geometry values that you're using to detect changes. When you call display-monitor-attributes-list it calls a different C function based on os (ns-display-monitor-attributes in my case) and that seems to be more consistent.

Here's what I'm currently using as my hook:

(defun rwd/display-change (_disp)       ; ignore this incoming var
  (interactive)
  (when window-system
    (let* ((attr (frame-monitor-attributes))
           (geom (assoc 'geometry attr))
           (w (nth 3 geom))
           (h (nth 4 geom))
           (disp (format "%sx%s" w h))  ; calculated from actual geometry
           (args (assoc disp rwd/displays))
           (default (assoc "default" rwd/displays)))
      (message "rwd/display-change %s" disp)
      (unless args
        (find-variable 'rwd/displays)
        (insert (format "%S\n" (list disp 'w 'h "Font" 16)))
        (message "Please extend rwd/displays with %S" disp)
        (setq args default))
      (apply 'rwd/display-setup (cdr args))
      (rwd-fix-fullscreen)
      (sleep-for 0.25)
      (rwd-split-smart))))

I'm good for now, but you might want to consider having a geometry-change hook. Happy to send a patch if you want.

MELPA

Hi,

Thanks for this package - I've been looking for something like this for awhile. It would be good to see on MELPA, so there's my vote!

Consider using display-monitor-attributes-list instead of frame-monitor-attributes?

Currently, the package tracks changes in (frame-monitor-attributes) output, but this provides only partial information in the case of connecting/disconnecting multiple monitors, as it returns changes only for the monitor the main Emacs frame is on. How about using (display-monitor-attributes-list), which would return info for all monitors, instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.