xournalpp icon indicating copy to clipboard operation
xournalpp copied to clipboard

sometimes xournalpp draws without a pen touching the screen or a mouse press

Open petergthatsme opened this issue 5 years ago • 22 comments

(Please complete the following information, and then delete this line)

  • ubuntu 18.04 (happens with different kernels)
  • Version of Xournal++: latest master

Describe the bug

every now and then the xournapp starts to draw without the pen touching the screen. I captured a video of this here: https://streamable.com/h8i1n so here I'm moving the mouse (the pen is nowhere near the screen). After some time, I press the mouse1 button and the curve that was drawn disappears. I should stress, however, that sometimes the drawn curve does not disappear and instead has to be deleted manually.

To Reproduce

it seems random

Expected behavior

drawing should happen only when the pen touches the screen (or when one is holding the mouse button when drawing with the mouse).

Additional context I first started noticing it some months back - probably 4 months or something like that.

Also, I have the 'new input' system enabled. Here are the settings I use: screenshot_1

petergthatsme avatar Sep 28 '19 03:09 petergthatsme

Please provide input logs. See the wiki for how to do that. This sounds a lot like a device sending faulty events.

LittleHuba avatar Sep 30 '19 19:09 LittleHuba

i'll try to do that, although here the 'device' can also just be the mouse and not necessarily the pen (as in the attached video) - the pen was nowhere near the screen. I haven't noticed this problem elsewhere.

petergthatsme avatar Oct 02 '19 16:10 petergthatsme

Same issue here. The issue exists since original xournal. Switching to xournalpp seams to be no solution for me either, sadly.

OS: LM 19.2 Device: ThinkPad X1 Yoga 2nd Gen.

I also mentioned that the tool switches for a short amount of time when getting the pen closer to the screen.

Since the issue appears randomly there is no way to reproduce it. The issue appears also on similar X1 devices.

I also tested a variety of settings in xournal and xournalpp but soon or later the issue appears.

daholzfeind avatar Nov 09 '19 15:11 daholzfeind

Same thing as for the original poster. Please provide input logs. And the approximate timestamp of the bug. We can then start searching for the issue.

LittleHuba avatar Nov 09 '19 20:11 LittleHuba

debug_gdk_input.log debug_input.log xinput.log

There you go. The Bug appears directly at the start, so the first events/dots are the points of interest.

During the dot issue, also the desktop environment isn't working correctly, i.e. if the pen gets nearby the screen, it doesn't hit it, a "klick" will be performed. E.g. xournal/xournalpp changes the tool if you get near by a button. This issue also exits since xournal.

daholzfeind avatar Nov 09 '19 20:11 daholzfeind

Could it be that you use kde and the system is caching a lot? In those scenarios KDE is known to drop some events.

LittleHuba avatar Nov 09 '19 21:11 LittleHuba

This really sounds like a DE problem and not a X++ issue.

LittleHuba avatar Nov 09 '19 22:11 LittleHuba

KDE? I'm using cinnamon as desktop environment.

Which Linux distro do you use for xournalpp? I could try to run xournalpp in a live desktop with my x1 and check if the issues still there. Maybe there are some issues with xsetwacom or the stuff behind that, alredy read a lot about it, but no solution so far. In general issues wirth wacom pen only appear when xournal or xournalpp are running.

daholzfeind avatar Nov 09 '19 22:11 daholzfeind

I'm currently unable to check the input logs. But when your DE freezes up it is quite common for GTK apps to not get all events if you are using X11. KDE solved that for Wayland. Could you try other GTK apps?

LittleHuba avatar Nov 09 '19 23:11 LittleHuba

i'm using fvwm. I don't see this kind of behavior in any other apps, only xournalpp. Also, for whatever it's worh, i'm using yoga X1 (1st edition) and run ubuntu 18.04 at the moment. Recently i switched to kernel 5.2.16 and that fixed this issue (unrleated to xournalpp): https://github.com/linuxwacom/input-wacom/issues/66

will try to get some logs uploaded once i have a chance.

edit: one more point - this behaviour/problem was not present when I first started using xournalpp, which would have been in ~march 2019.

petergthatsme avatar Nov 10 '19 00:11 petergthatsme

This Video from @petergthatsme linked issue perfectly describes my problem with xournal / xournalpp.

https://streamable.com/y6ldi

One of the main reason why i bought the yoga version from X1 was the opportunity to write notes via xournal / xournalpp. And since I own this ThinkPad back in October '17, the issue with the screen appears through several Linux Mint Distros and a variety of Kernels.

daholzfeind avatar Nov 10 '19 05:11 daholzfeind

Could you try giving all desktop environment processes higher scheduler priorities? For me that fixes the problem if it occurs. If that does not help I might have an idea how to fix it internally.

LittleHuba avatar Nov 10 '19 17:11 LittleHuba

Could you please provide an short guide how to do that.

Remark: Beside the dot issue sometimes the CPU usage "explodes" while using xournalpp (scrolling and page navigation). Hence loud fan noises are the result. With xournal this issue never happens before. I think this can be discussed in a separate issue.

But overall this seems no comfortable solution for this problem at all.

I recently switched back to xournal, due to the clicking and dotting issue, and tested the configuration "Touchscreen as hand tool". With this setting no more random dots appear and also the annoying "click when pen gets nearby the screen" issue seems to be solved. @petergthatsme Maybe you can try this with your Yoga X1 (1st gen) :+1:

daholzfeind avatar Nov 11 '19 12:11 daholzfeind

Update: sadly this workaround does not fix the xournal erase issue see: https://streamable.com/oknlr . One can easily reproduce the bug by erase something with the erase button on your wacom stylus, afterwards it will erase every time the pen gets close towards the screen. Beside that it will click if you get close to an button (e.g. save, close, also UI elements outside from xournal!) What in the journal itself happens depends on your bounded pen buttons, e.g. highlighter would highlight the spot.

In xournalpp this issue also exists but it seems to be solved via a coded solution. One can see, with the same steps as I mentioned above, that the tool would change to the eraser, like in the video, but it doesn't erase anything. Luckily this issue got already fixed here :+1:

daholzfeind avatar Nov 11 '19 13:11 daholzfeind

Have you tried out the option to merge pen button events with tip events?

LittleHuba avatar Nov 12 '19 09:11 LittleHuba

@LittleHuba finally it works. At least for some testing. Once, after turning the Screen in "Yoga" position, the issue as seen in the first video above appeared.

What left over is the random high CPU usage, which is according to top caused by Xorg.

I was also able to fix the xournal eraser issue, by configuring the second stylus button to "vertical space" instead of eraser like the first one.

I will try now switching, again, back to xournalpp. Hopefully there is a fix for the high CPU ussage bug. Since it's really strange when writing notes and the laptop produces loud noises like he is compiling software.

daholzfeind avatar Nov 19 '19 19:11 daholzfeind

I don't think Xournal++ causes these spikes of Xorg. Xorg is decoupled from our code so any CPU usage would not be caused by us and recorded as usage by Xorg.

LittleHuba avatar Nov 19 '19 20:11 LittleHuba

I understand, thank you for your support.

Fyi: I don't know why but today I tried using Xournal++ and the random draw bug appeared. I used an own compiled version of Xournal++. Due to this bug I am going to switch back to xournal, till this issue and the heavy CPU usage got fixed.

I'm really looking forward to finally run Xournal++ without any issues on my X1 :+1:

daholzfeind avatar Nov 20 '19 12:11 daholzfeind

I just reviewed your logs and they are indeed sound. So i have two ideas what may cause the issue.

  1. A device is configured incorrectly in X11 and thus is reported as a wrong device which then leads to some very boguous input.
  2. Gtk does not handle one of your devices correctly

You can check if it is 2 by trying out GIMP and checking for that kind of bug. Keep in mind that this is not really a failsafe test as GIMP might catch that bug in some way we do not know of. Maybe also do a Google search if that problem is known for your device and a workaround is known.

Yoga devices are unfortunately known to need some workarounds for Linux. There are a lot of scripts out there that solve all kinds of small problems.

For the CPU issue you can check back once we have implemented our new rendering system. It should solve some spikes in CPU usage but that might not influence your issue at all. The usage is reported as being in Xorg. So as mentioned before we are not really influencing that as things are decoupled.

LittleHuba avatar Nov 20 '19 12:11 LittleHuba

This may have potentially been fixed by #1854.

Technius avatar May 08 '20 03:05 Technius

Hi; It's not fixed yet! and enabling the "Ignore the first ... events" does nothing for it.

But I want to add some info: To Reproduce SOMETIMES in the middle of drawing, when you select a drop down menu from toolbar, or interact with the Taskbar or System tray of Windows or even open an app with smaller window, It happens :) when you move the mouse OR stylus back to writing area, it starts to draw/erase/pan according to the selected tool. and It happens with mouse and stylus!!

https://user-images.githubusercontent.com/83906672/181491285-1c7e42ea-8616-4960-a8c3-223bf8c7d16e.mp4

hamidbhm avatar Jul 28 '22 11:07 hamidbhm

Hi; It's not fixed yet! and enabling the "Ignore the first ... events" does nothing for it.

But I want to add some info: To Reproduce SOMETIMES in the middle of drawing, when you select a drop down menu from toolbar, or interact with the Taskbar or System tray of Windows or even open an app with smaller window, It happens :) when you move the mouse OR stylus back to writing area, it starts to draw/erase/pan according to the selected tool. and It happens with mouse and stylus!!

Rec.0085.2.mp4

@Technius Hi! would you please take attention to this bug? it's really annoying 🤦‍♂️

hamidbhm avatar Aug 04 '22 15:08 hamidbhm