joseluis / huion-linux-drivers

Linux user-space drivers for Huion Graphic Tablets
MIT License
168 stars 95 forks source link

Multi-monitor setting is incompatible with using smaller resolution of Tablet-Display #87

Open yoanndaly opened 4 years ago

yoanndaly commented 4 years ago

Hello,

I have a Huion Kamvas 13 on ubuntu 18.04. I had the following issues with the script. The multimonitor settings work fine, say with the tablet being monitor 1, only if the

screen_1W == screen_width screen_1H == screen_height

Otherwise, the calibration is not correct. If one wants to mirror the Tablet Display, for instance with a video-projector not supporting FullHD, but WXGA or something else, one may not want these equalities. Moreover, when xrandr actually changes the display settings (for instance if I manually change resolution before applying the script), the calibration of the Pen with the new display wasn't correct at first execution of the script, but only after a second execution.

Hopefully, your script is in pyhon (and not in Rust yet, I couldn't have solved my issues so easily). Here are a modified script and config.ini:

HuionInstall.zip

The solutions were easy:

1/ I only added two new variables available in each monitor setting in config.ini tablet_screen_width, tablet_screen_height to declare which sizes among the monitor are the screen sizes of the tablet. In the script I use them (only if declared for compatibility) instead of the default FullHD resolutions to calibrate with xinput.

2/ I added a time.sleep(1) after execution of xrandr to let enough time for the display to change.

3/ Since the Kamvas 13 can be used as a PenTablet without display, I included an example [monitor_1SD+1HD_PenTablet] showing how to use this in order to answer question #59, I think.

4/ I also wanted to use my PenDisplay as a vertical monitor. I don't think your current script can do that. So I also included an extra option rotation, for instance illustrated in the examples [monitor_2SD+1bottomHD] [monitor_2SD+1topHD] [monitor_2SD+1flipHD]. These calibrate the display with xinput after rotation, following instructions here. I think this can also be used in combination with 3/ in order to solve #58 but I don't have an external monitor that I can use vertically so I didn't try.

I hope you can include variants of those changes soon.

Thanks again for this nice driver. Good luck for the bug resolutions.