GithubHelp home page GithubHelp logo

Comments (5)

asweigart avatar asweigart commented on August 20, 2024

What's the version of OS X you have? (The specific version, like Mavericks 10.0.4 or such.)

from pyautogui.

dsiah avatar dsiah commented on August 20, 2024

Yosemite version 10.10.1

from pyautogui.

jeremygray avatar jeremygray commented on August 20, 2024

Related, not sure if you'd like a separate issue for this: On Mac 10.9.5 with a retina display 1440 x 900, I get screenshot() sizes that are exactly twice as large as expected. This appears to carry through to the locate() family of functions, and return coordinates that are off by a factor of 2.

>>>> pyautogui.screenshot()
<PIL.PngImagePlugin.PngImageFile image mode=RGB size=2880x1800 at 0x106CFCF80>

from pyautogui.

faurehu avatar faurehu commented on August 20, 2024

I ran a tracer to follow the interpretation of pyautogui and apparently it gets stuck here:
pyautogui/__init__.py:122 line return platformModule._size()

platformModule being pyautogui._pyautogui_osx I looked into it and the _size() method makes use of Quartz.CGDisplayPixelsWide(0). Tracing that function gave me this:

        Quartz/__init__.py:79    return            mod.QuickLookUI = m
                                 ...       return value: None
        Quartz/__init__.py:83    return    _load()
                                 ...       return value: None

Looking at the init file, m is supposed to be QuickLookUI, also in the Quartz folder. I can't tell why the return value is None.

from pyautogui.

aaruff avatar aaruff commented on August 20, 2024

I also experienced the same issue (MacBook Pro 10.10.3 (Retina, 13-inch, Late 2013)). Though I remedied the issue by replace 0 with Quartz.CGMainDisplayID() in the _size function. Further investigation is required to determine why exactly this issue arose in the first place.

def _size():
    return Quartz.CGDisplayPixelsWide(Quartz.CGMainDisplayID()), Quartz.CGDisplayPixelsHigh(Quartz.CGMainDisplayID())

from pyautogui.

Related Issues (20)

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.