Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS implementation #10

Open
darth-veitcher opened this issue Jun 12, 2019 · 14 comments
Open

MacOS implementation #10

darth-veitcher opened this issue Jun 12, 2019 · 14 comments

Comments

@darth-veitcher
Copy link

Hi there, could you explain what's outstanding to implement for MacOS? Looking at the code quickly in _pygetwindow_macos.py it looks like some functions have been partially implemented.

Have done some work myself already using pyobjc-framework-Quartz so happy to try and port across if helpful?

@eclaassens
Copy link

@asweigart Could you please look at this PR?

@shenhong29
Copy link

any update to add implementations in _pygetwindows_macos.py?

@Kalmat
Copy link

Kalmat commented May 15, 2022

Hi! If you need multi-platform support, maybe you can give a try to this: https://github.com/Kalmat/PyWinCtl. It's a fork from PyGetWindow module, to which I added macOS and Linux support. I tried to PR the result with no success, so I decided to create a separate module. Any comment, suggestion or contribution is welcome.

@shenhong29
Copy link

shenhong29 commented May 16, 2022 via email

@Kalmat
Copy link

Kalmat commented May 17, 2022

Oh, I see. I'm not a pyautogui expert, sorry. I guess you mean pyautogui requires pygetwindow module, right? If so, it should be very easy to port it, since pywinctl uses same methods and behaviors than pygetwindow (it adds new methods, but the common ones are exactly the same). This refactor should be done by its author, anyway.

Can you make a "private" port? Yes. Clone pyautogui, replace all pygetwindow references in it by pywinctl, uninstall pygetwindow, and place the refactored src/pygetwindow folder in your src folder, so it will import your version instead of the "official" one, and will include that folder in your distributions. I can help you if you need to.

@Kalmat
Copy link

Kalmat commented May 17, 2022

Hi again! Taking a quick look to pyautogui code, I think (not sure) that it's not really using pygetwindow methods. I was able to find it only in init.py file. Besides, I did some quick tests on macOS and seem to run OK. Which error do you get?

@shenhong29
Copy link

shenhong29 commented May 18, 2022 via email

@shenhong29
Copy link

shenhong29 commented May 20, 2022 via email

@shenhong29
Copy link

shenhong29 commented May 20, 2022 via email

@Kalmat
Copy link

Kalmat commented May 20, 2022

Hi! Which error do you get?

Besides, these are the dependencies for pyscreeze module:

    install_requires=['Pillow >= 8.3.2; python_version == "3.8"',
                      'Pillow >= 8.3.2; python_version == "3.7"',
                      'Pillow >= 8.3.2; python_version == "3.6"',
                      'Pillow <= 7.2.0, >= 3.2.0; python_version == "3.5"',
                      'Pillow <= 5.4.1, >= 2.5.0; python_version == "3.4"',
                      'Pillow <= 4.3.0, >= 2.0.0; python_version == "3.3"',
                      'Pillow <= 3.4.2, >= 2.0.0; python_version == "3.2"',
                      'Pillow >= 2.0.0; python_version == "2.7"',
                      ],

So, maybe your guess is right!

Perhaps you can try to install pyautogui adding --force-reinstall option to pip command. Unless you need to stick to a specific version, this option will assure you are installing all required dependencies and versions. Otherwise (I mean, if you need to stick to a given version), then you can use a virtual environment (venv) for this specific setup.

@shenhong29
Copy link

shenhong29 commented May 21, 2022 via email

@Kalmat
Copy link

Kalmat commented May 22, 2022

So good to hear that!

Remember to help and share with others. Keep pushing, mate!

@shenhong29
Copy link

shenhong29 commented Oct 11, 2022 via email

@DataMower
Copy link

I am struggling with PYAutoGUI's window features that do not work on macOS.

iMac (Retina 5K, 27-inch, Late 2014), Screen Size: 2560 x 1440, resolution is set to standard for monitor
macOS Big Sur 11.7.10
MouseInfo 0.1.3
Pillow version 8.0.1
PyAutoGUI version 0.9.52

What do I have to do to make it work?

I have installed pygetwindow module separately, but gw.getAllWindows() does not work, for example (AttributeError: module 'pygetwindow' has no attribute 'getAllWindows'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants