Add DPMS extension#169
Conversation
Based on the documentation found here: https://www.x.org/releases/X11R7.7/doc/xextproto/dpms.html It basically works, however there are some known issues: - Any rq.Request call (dpms_enable(), dpms_set_timeouts(), dpms_force_level()) only works if you call another rq.ReplyRequest function (dpms_get_version(), for example) afterwards. I tried to change them to use rq.ReplyRequest, but since they don't return anything they got stucked waiting for a response from X11. - DPMSInfo doesn't work. I don't have a clue why, I receive the following error when trying to call dpms_info(): ``` $ cat playground.py from Xlib import display d = display.Display() print(d.dpms_info()) $ python3 playground.py Traceback (most recent call last): File "playground.py", line 4, in <module> print(d.dpms_info()) File "Xlib/display.py", line 225, in __getattr__ return types.MethodType(function, self) TypeError: first argument must be callable ``` So I decided to comment this function for now.
Codecov Report
@@ Coverage Diff @@
## master #169 +/- ##
==========================================
- Coverage 81.98% 81.97% -0.02%
==========================================
Files 40 42 +2
Lines 4746 4854 +108
==========================================
+ Hits 3891 3979 +88
- Misses 855 875 +20 |
BTW, I actually had the same behavior using So maybe this is an actual issue with the X protocol, I don't know 🤔. |
|
Hi @thiagokokada the code looks good to me. Good job done! I'd suggest to file the mentioned problems as an issue so we don't miss them in the future. I'm going to merge this PR soon. |
Based on the documentation found here: https://www.x.org/releases/X11R7.7/doc/xextproto/dpms.html
It basically works, however there are some known issues:
Any
rq.Requestcall (dpms_enable(),dpms_set_timeouts(),dpms_force_level()) only works if you call anotherrq.ReplyRequestfunction (dpms_get_version(), for example) afterwards. I tried to change them to userq.ReplyRequest, this worked but since they don't return anything they got stucked waiting for a response from X11. Maybe I am missing some call to another function?DPMSInfodoesn't work. I don't have a clue why, but it doesn't seem to be an issue with X11. I receive the following error when trying to calldpms_info():So I decided to comment this function for now.
Since I am not familiar with the X11 protocol there may be something wrong, but I did some tests and it seems to work fine.
I only tested on Python 3.8, but I think it should work in Python 2 too since I didn't use anything incompatible.