Onboard focus with KWin

Bug #1470825 reported by marmuta on 2015-07-02
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Onboard
High
Unassigned
onboard (Ubuntu)
Undecided
Unassigned

Bug Description

Customized Ubuntu 15.04, running KWin via an .xsession call. Using Onboard for on-screen keyboard. The keyboard won't get focus unless I tap on it twice (or unless I drag into the keyboard, and then tap it). In my previous environment I used Compiz and didn't have this behaviour, nor do I see it with any other window type.

Turning debugging on for Onboard it seems to be getting the touch events so I am not sure why its not getting focus. Its output for example would be:

Code: Select all
19:23:08.392 EVENT TouchInput Source device: XIDevice(id=13 attachment=2 use=3 touch_mode=1 source=GDK_SOURCE_TOUCHSCREEN name=SYNA7500:00 06CB:3AF0 vendor=0x06cb product=0x3af0 enabled=1)
19:23:08.392 EVENT TouchInput _on_device_event1
19:23:08.393 EVENT TouchInput _on_device_event2 2 2
19:23:08.393 EVENT TouchInput _on_device_event7 1
19:23:08.393 EVENT TouchInput _on_device_event8 True
19:23:08.393 EVENT TouchInput _on_device_event10 20971528 20971707
19:23:08.393 EVENT TouchInput _on_device_event11
19:23:08.394 EVENT TouchInput Device event: dev_id=2 src_id=2 xi_type=7 xid_event=20971528(20971707) x=171.0 y=45.0 x_root=1642.0 y_root=405.0 button=0 state=0 sequence=0

A little lost and looking for any suggestions!

marmuta (marmuta) wrote :

Hmm, there's no touch visible in your log. The last line is an Enter event (xi_type=7) from the master pointer (dev_id=2). A touch would start with TouchBegin (xi_type=18) and would come from your touch screen slave device (dev_id=13). Could you attach a longer log, up until the point when you get the first reaction from Onboard?
$ onboard -d all &>onboard-kwin.log

> The keyboard won't get focus unless I tap on it twice
To be sure I understand, is that once after starting Onboard or each time you switch between some application and the keyboard?

Jackson Wiegman (jackson-e) wrote :

I have a full log attached, here were my actions:

- Start onboard with debugging
- Touch 'a' key (no effect)
- Touch 'a' key again (a key registered)
- Touch 's' key (s key registered)
- Touch away from keyboard
- Touch 'a' key (no effect)
- Touch 'a' key again (a key registered)
- Touch 's' key (s key registered)
- Touch away from keyboard
- drag into keyboard
- Touch 'a' key (a key registered)
- Mouse press away from keyboard
- Mouse press 'a' key (a key registered)

marmuta (marmuta) wrote :

Great log file, thank you. Here's what happens:
...
12:43:42.951 Enter
12:43:42.952 TouchBegin (master, dev_id=2)
12:43:43.066 ButtonRelease (slave, dev_id=13)
12:43:43.067 TouchEnd (master, dev_id=2)
...

Two observations:
1) There are indeed touch events coming in, but only from the master pointer, none directly from the touch screen device 13. That's new, I haven't seen that happening before. Onboard sticks with mouse events (ButtonPress/ButtonRelease) in that case (meaning multi-touch won't be available).
2) The first ButtonPress event is missing, there's only a ButtonRelease. That's why there's no reaction to the first touch. When you use the mouse the initial ButtonPress event is there.

I've looked into 1) a bit. The screen seems to be USB connected and probably uses the hid-multitouch kernel driver and the evdev X driver. Support for the SYNA7500 seems relatively sensitive to the kernel version. This thread reports mixed results with various kernels and failures in particular with Vivid's kernel 3.19:
http://ubuntuforums.org/showthread.php?t=2187204&page=14&s=34cfa4caf159096f7cce745988b1ab59
If everything else fails, trying different kernels may make sense.

No idea what could cause 2) yet. I'm working on some way to reproduce it. Is there anything I should know about your setup? Is this plain KWin without any other bits of KDE?

Things you could try:
Set Preferences->Keyboard->Advanced->"Touch input" to "none". If there's no change (likely) set Preferences->Keyboard->Advanced->"Input event source" to "GTK".

Jackson Wiegman (jackson-e) wrote :

This combination worked (for single press only, no multitouch obviously):

Preferences->Keyboard->Advanced->"Touch input"="none"
Preferences->Keyboard->Advanced->"Input event source"="GTK"

Setting "Touch Input" back to "Multitouch" I get this error:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/Onboard/TouchInput.py", line 538, in _on_button_press_event
    self._can_handle_pointer_event(event),
  File "/usr/lib/python3/dist-packages/Onboard/TouchInput.py", line 526, in _can_handle_pointer_event
    not device.touch_active
AttributeError: 'X11DeviceXI2' object has no attribute 'touch_active'

For KWin vs KDE, I meant to edit my original statement, I tried it with KDE and then Gnome and had the same behaviour. My setup is KWin standalone.

I am also very familiar with that SYNA7500 thread haha. The SYNA7500 is an i2c device, not USB. I have to use this kernel for the moment because I do have another device which uses a different touchscreen (ELAN), that has the same behaviour. However I know that this device worked fine in the past, so I think this points to something that changed in the touchscreen driver for the kernel build that I am using.

Thanks for the quick feedback, I think I need to look at the touch driver as well.

marmuta (marmuta) wrote :

> Thanks for the quick feedback, I think I need to look at the touch driver as well.
You're welcome. I think you won't need to do this anymore. Screens/kernel/drivers are probably fine.

I could eventually reproduce both issues in KWin and 1) was an Onboard thing. Wrong order of initialization, that apparently had no ill effect in compiz, where I did most of the touch testing. Trunk has a fix and I don't get the fall-back mouse-events mode anymore in KWin, meaning you'd likely have multi-touch available too. It works with either XInput or GTK event source here, but I'd suggest you return to "XInput", because a few of Onboard's features require/work better with this.

Still working on 2), though I expect you won't hit this anymore with default settings. Others might, wacom touch-screen people in particular (on KWin).

> AttributeError: 'X11DeviceXI2' object has no attribute 'touch_active'
Thank you, should be fixed too now.

Changed in onboard:
status: New → Confirmed
Changed in onboard (Ubuntu):
status: New → Confirmed
Changed in onboard:
importance: Undecided → High
Jackson Wiegman (jackson-e) wrote :

Working great, thanks much!!

marmuta (marmuta) on 2016-08-17
Changed in onboard:
status: Confirmed → Fix Released
Changed in onboard (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments