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

Not compatible with pyglet.window.Window #166

Open
skjerns opened this issue Apr 25, 2022 · 2 comments
Open

Not compatible with pyglet.window.Window #166

skjerns opened this issue Apr 25, 2022 · 2 comments

Comments

@skjerns
Copy link

skjerns commented Apr 25, 2022

Great tool!

I discovered a bug that appears when using monitortool together with pyglet:

import monitorcontrol
from pyglet.window import Window

monitorcontrol.get_monitors()

# ArgumentError: argument 2: <class 'TypeError'>: expected LP_RECT instance instead of int
# TypeError: catching classes that do not inherit from BaseException is not allowed

image

Do you think there is any way to repair that?

  • Operating system: Win 10
  • Python version: 3.9.7
  • monitorcontrol version (monitorcontrol --version): 3.0.0 (dev)
@newAM
Copy link
Owner

newAM commented Apr 26, 2022

It's using 0 instead of a null pointer for that one, which is valid as far as I know. Maybe it wants something along the lines of POINTER(LP_RECT)()? Feel free to open a pull-request if you find something that passes the type check.

@skjerns
Copy link
Author

skjerns commented Apr 26, 2022

My workaround for now was just starting the function via subprocess. It works, so I'm satisfied with that workaround for now. Even has the advantage of being non-blocking (the library can take a few seconds to load sometimes).

    subprocess.Popen('monitorcontrol --set-luminance 0 --monitor 1', shell=True)

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

2 participants