Open leporel opened 1 year ago
Monitor1 and this if statement resulting false
Monitor2
win32con.DISPLAY_DEVICE_ATTACHED_TO_DESKTOP show as 1
actually i have 3 monitors, but one disabled in windows (Settings->Display->Disconnect this display), when activate him its seems all 3 display is showing
{'\\\\.\\DISPLAY1': {'system_name': '\\\\.\\DISPLAY1', 'id': 131130, 'is_primary': True, 'position': Point(x=0, y=0), 'size': Size(width=1920, height=1080), 'workarea': Rect(left=0, top=0, right=1920, bottom=1050), 'scale': (100, 100), 'dpi': (96, 96), 'orientation': 0, 'frequency': 144, 'colordepth': 32},
'\\\\.\\DISPLAY5': {'system_name': '\\\\.\\DISPLAY5', 'id': 131073, 'is_primary': False, 'position': Point(x=1920, y=0), 'size': Size(width=1920, height=1080), 'workarea': Rect(left=1920, top=0, right=3840, bottom=1050), 'scale': (100, 100), 'dpi': (96, 96), 'orientation': 0, 'frequency': 59, 'colordepth': 32},
'\\\\.\\DISPLAY2': {'system_name': '\\\\.\\DISPLAY2', 'id': 1878003877, 'is_primary': False, 'position': Point(x=127, y=-1080), 'size': Size(width=2560, height=1080), 'workarea': Rect(left=127, top=-1080, right=2687, bottom=-30), 'scale': (100, 100), 'dpi': (96, 96), 'orientation': 0, 'frequency': 59, 'colordepth': 32}}
i supposing here is some bug when get dev.StateFlags for DISPLAY1
Hi! Sorry for my late reply. I've been out these days with no access to my "stuff". Thank you a LOT for your feedback!
Let me ask if I properly understood the issue. You start the script with one of your monitors de-activated (detached). Then, at one point, you activate it, but somehow dev.StateFlags doesn't return proper updated value... is this the case?
First off, PyMonCtl is not intended to return non-active or detached monitors... If you need it, we can think of a new function or an input parameter to getMonitors() to force to return ALL monitors despite they are active/online/attached or not.
Please, let me know what you think.
Let me ask if I properly understood the issue. You start the script with one of your monitors de-activated (detached). Then, at one point, you activate it, but somehow dev.StateFlags doesn't return proper updated value... is this the case?
I apologise for my English, I might have expressed my thoughts incorrectly. No, these my state when i start script:
Windows | Script | dev.StateFlags |
---|---|---|
DISPLAY1 Active | processed but not returned | 2 |
DISPLAY5 Active | returned | 3 |
DISPLAY2 de-activated | empty? | - |
Note: win32api.EnumDisplayMonitors()
returned 2 monitors: DISPLAY1 and DISPLAY5 (but in device manager i see 3 monitors, i.e. DISPLAY2 not detached, he just deactivated in windows displays settings)
when i activate DISPLAY2 in windows: | Windows | Script | dev.StateFlags |
---|---|---|---|
DISPLAY1 Active | returned | 3 | |
DISPLAY5 Active | returned | 3 | |
DISPLAY2 Active | returned | 3 |
My problem, when DISPLAY2 de-activated, DISPLAY1 processed as non-active (DISPLAY1 is primary always)
something wrong with StateFlag, he think DISPLAY1 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
is 0 in bitmask
Oh, ok. Understood!! Really weird behavior in deed... Let me dig into it and will come back to you with my findings. We will solve it!!!
Thanks a lot for your feedback and help!!!
Hi again!
Solution found and will be solved in next version!
Checking dev.StateFlag
is not really required. It's a remnant from previous versions. Using win32api.EnumDisplayMonitors()
and win32api.GetMonitorInfo()
is enough to retrieve all required values. It is much simpler now as well.
Thank you for pointing it out!
pymonctl don't return all my monitors (one of them connected to nvidia card (display port, 144hz), other to motherboard integrated gpu (hdmi 60hz))
return: