Bug 276518

Summary: running 2 pen tablet on the same system problems
Product: [Applications] krita Reporter: David REVOY <info>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cberger, dimula73, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screen with mapped zone in green of the second tablet running on the system

Description David REVOY 2011-06-26 11:40:19 UTC
Version:           svn trunk
OS:                Linux

Context : I have 2 devices connected to my computer ; one is a regular pen tablet , and other one is a Cintiq pen tablet display, but behaves exactly as 2 separated device , a intuos type of tablet + a dvi screen. So, I guess this can be reproduced with 2 regular pen tablet. 

Problem : While in Gimp and Mypaint, I can switch from one to other one without any problem, In Krita I have the Cintiq one that work ok as expected , and the regular Intuos that map only to a portion of the workspace ( around 1/4 top left of it )but the GUI around the workspace is still correctly mapped. I attached a picture to illustrate the problem ( in green, mapped surface of the regular tablet ) . 
 


Reproducible: Didn't try


Actual Results:  
 

Expected Results:
Comment 1 David REVOY 2011-06-26 11:48:28 UTC
Created attachment 61340 [details]
screen with mapped zone in green of the second tablet running on the system
Comment 2 David REVOY 2011-06-26 12:38:44 UTC
I also noted the calibration infos I written on my auto-launch script for Wacom like this , was not taken into account by the Krita workspace ( zone to draw ). But for the GUI the calibration is ok. 
This result by a fringe around the workspace of around visually 15px/20px ( bottom and right )  where my pointer can't access ( it directly jump to the GUI )

xsetwacom --set "Wacom Cintiq 21UX stylus" TopX 327
xsetwacom --set "Wacom Cintiq 21UX stylus" TopY 374
xsetwacom --set "Wacom Cintiq 21UX stylus" BottomX 86436
xsetwacom --set "Wacom Cintiq 21UX stylus" BottomY 65171
Comment 3 Cyrille Berger 2011-06-26 19:38:32 UTC
I am not sure if I understand what you mean by "but the GUI around the workspace is still correctly mapped", does that means you can access the layer box (or any other dockers) with your intuos A5 ?
Comment 4 David REVOY 2011-06-26 19:49:37 UTC
Hey Cyrille,

Yes, that exact : For the Intuos4 M I can access with a normal behavior the top toolbar , the layer, the toolbox ; all GUI elements around the canvas/workspace. ( all the green zone of the picture in attachement ). 
The part of the canvas/workspace is streched on the tablet to 1/4 top left of the canvas/workspace

For the Cintiq 21UX, the bug is more subtle. The GUI is OK and the workspace don't take into acount the calibration made with Xsetwacom ( I did the calibration using the GUI of xinput_calibrator , a broken calibrator for HAL/X but who return if executed in a terminal the 2 X and Y values I need ). 

In Gimp and Mypaint ( and other apps as far I tested ) no problem, I can switch from one tablet to the other one.
Comment 5 David REVOY 2011-06-28 17:39:24 UTC
New behavior, depending the (re)boot ( compiled : Tuesday, June 28 2011 19:00 )

*Intuos 4 A5 is correctly working
*Cintiq 21UX doesn't work on all the surface of the workspace/canvas, but only on the 1/4 top-left of it. Only GUI around the workspace/canvas work fine displaying the mouse arrow when I fly over with the stylus. The 1/4 top-left of workspace/canvas is mapped to a surface like 2 time bigger. It mean when pointing the stylus at the center , the outliner of the brush appear on the corner of bottom-right. 

Workaround solution : Deconnect the USB of the not desired tablet and relaunch Krita. With only 1 tablet connected, the behavior is always good.
Comment 6 Halla Rempt 2011-06-29 08:10:17 UTC
Maybe I can actually try to reproduce this locally... I've got an intuos and a graphire, but I never tried to connect both of them at the same time. Chances are we're running into a Qt issue here, though.
Comment 7 Cyrille Berger 2011-06-29 08:25:22 UTC
the weird thing is that "Xsetwacom" parameters are handled inside the X11 driver (or that is how I understand things). So I am a bit confused at how it affects qt.
Comment 8 David REVOY 2011-06-29 10:24:05 UTC
I will also try here to connect to my other computer running Krita ( laptop ), and other tablets to see if it's not a local problem . 

I'm also aware connecting multi-tablet to a system is not something 'regular' , but it can be more and more frequent for tablet-pc or touch-pc + a pen-tablet connected. It's for this case ( for me with a Cintiq ) I try to report.
Comment 9 Halla Rempt 2011-06-29 10:39:21 UTC
Now you mention it -- I actually used to have the situation of a tablet laptop with built-in wacom + external tablet, and Cyrille still has that setup, afaik.
Comment 10 David REVOY 2011-08-04 11:47:48 UTC
Ok, following the solution I found for the neightbours bug about tablet calibration 'https://bugs.kde.org/show_bug.cgi?id=277201' ; I tried to give a try to solve this one. Without success. Here what I tried :

With Cintiq ( wacom internal ) and a Bamboo FunA5 connected to my system.
1. First I get the tablet ID name ; with :
xinput -list

2. Then I grab and copy all the default existing value from both tablet into Wacominfo temp filename :
xsetwacom -s --get "Wacom Cintiq 21UX stylus" all > Wacominfo1
xsetwacom -s --get "Wacom BambooFun 6x8 stylus" all > Wacominfo2
Like this I can extract the default calibration value (BottomX/BottomY/TopX/TopY).

3. Then I edit in admin the Xorg snipet for Wacom tablets :
sudo gedit /usr/share/X11/xorg.conf.d/50-wacom.conf
and I paste in this related to the data I get on my Wacominfo files :
Section "InputClass"
	Identifier	"calibration"
	MatchProduct "Wacom Cintiq 21UX"
	Option "TopX" "327"
	Option "TopY" "374"
	Option "BottomX" "86436"
	Option "BottomY" "65171"
EndSection

Section "InputClass"
	Identifier	"calibration"
	MatchProduct "Wacom BambooFun 6x8"
	Option "TopX" "0"
	Option "TopY" "0"
	Option "BottomX" "21648"
	Option "BottomY" "13530"
EndSection

4. After reboot and re-run Krita;  it seams to not solve the problem. Cintiq is correctly mapped and calibrated ; but the bamboo fun have cursor mapped over the GUI element correctly ; but most of the part of the surface is mapped to a tiny upper left rectangle area of the painting workspace. So, as in the first post ; the bug persist.
Comment 11 Halla Rempt 2011-08-04 11:55:48 UTC
Argh...
Comment 12 Halla Rempt 2012-02-29 12:51:40 UTC
I'm afraid that this is Qt/Wacom driver/X11 issue -- not something we can do anything about ourselves :-(
Comment 13 Dmitry Kazakov 2013-04-02 13:13:22 UTC
Git commit 6fc08ccb4884cb193a9044a71c7a419fed53075a by Dmitry Kazakov.
Committed on 02/04/2013 at 15:11.
Pushed by dkazakov into branch 'master'.

Added a workaround for a bug in Qt in 2 monitors + 2 tablets setup

This patch effectively rescales the hiResGlobalPos() when sees it jumps
to insane values.

M  +39   -1    krita/ui/input/kis_input_manager.cpp

http://commits.kde.org/calligra/6fc08ccb4884cb193a9044a71c7a419fed53075a