monitorcontrol
monitorcontrol copied to clipboard
Not compatible with pyglet.window.Window
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
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)
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.
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)