Random, Empty Notification Pop-Ups in Ubuntu, and How I Fixed That

Brian Terczynski
6 min readJul 26, 2020

I am running Ubuntu 18.04 on a Lenovo Yoga 720 laptop. I installed it as a dual-boot along with Windows 10 (which was OEM installed). And it was running fine for a while. But as I continued to use it, some funny things started happening.

First, the notification drop down — the one that appears right under the clock indicator at the top of the screen (typically the top of the screen unless the user changed their desktop layout) — started randomly popping up. Typically it will come up only if there is an actual notification. But as you can see, there was none.

Ubuntu notification popup.
Notification popup in Ubuntu

I did an internet search to see if others were experiencing this problem, and could not find anything. Not even in askubuntu.com.

I figured maybe it was a bug with my particular version of Ubuntu. I ensured that all of my software was updated. But I still had this problem.

I then decided to aggressively kill notifications by going to settings (the wrench-like icon on the bottom-left):

Desktop Corner Pop-up Menu
Desktop Corner Pop-up Menu

Then I turned off notifications for everything, just to be safe:

Notification Settings
Notification Settings

Well . . . that did not work either.

Then another weird thing started happening. I noticed that after the random notification window popped up, my code editor in IntelliJ (which is software that some people use for writing code) started randomly selecting text whenever I would hover my mouse over it, even though I did not click-and-drag to do it. And it was doing it out of my control. I would click in the window to stop it, but it would just start doing it again. At first I thought it was a bug in IntelliJ, but with this and the random notifications popping up, I was thinking it was a problem either with my version of Ubuntu, or my laptop.

Random text selection in IDE, even though I was not clicking-and-dragging at all.
Random text selection in IDE, even though I was not clicking-and-dragging at all.

My laptop . . .

It dawned on me that my Lenovo Yoga 720’s display was a touchscreen. So I tried tapping my touchscreen. That fixed the problem.

But the random notifications kept popping up. And the uncontrollable text selection would start happening again. True, I now knew how to fix the issue, but it was annoying that this kept happening. I wanted this to stop for good.

It occurred to me that perhaps if I turned off my touchscreen, it might fix the problem. At least it was worth a try. After all, I never used the touchscreen anyways. I mean, it is nice to have, but I just do not use it. So I could go without it.

I tried to find the settings for the touchscreen. I could not see them anywhere in the Settings Panel for Ubuntu. There was something about a Wacom Tablet, but there were no settings displayed for it. And the “Displays” option had no mention of a touchscreen.

Settings Panel. Touchscreen settings were not present for my system.
Settings Panel. Touchscreen settings were not present for my system.

So I did a good ‘ole Internet search, and found this great question/answer on AskUbuntu on how to disable a touchscreen. It involved using the xinput command to find which device is your touchscreen, followed by the xinput disable command to disable it.

Here was the output of xinput for my system:

$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ELAN0651:00 04F3:3052 Touchpad id=13 [slave pointer (2)]
⎜ ↳ Wacom HID 50FD Pen stylus id=11 [slave pointer (2)]
⎜ ↳ Wacom HID 50FD Pen eraser id=16 [slave pointer (2)]
⎜ ↳ Wacom HID 50FD Finger touch id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Ideapad extra buttons id=14 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ EasyCamera: EasyCamera id=10 [slave keyboard (3)]

The Wacom HID 50FB Finger touch device looked like it might be it. So I tried disabling it (via it’s id ):

$ xinput disable 12

And that worked. The touchscreen was no longer responsive. (I also tested re-enabling it with xinput enable 12 and that also worked, although reenabling it caused some temporary chaos like the soft keyboard popping up suddenly. But I got things back to normal and then re-disabled the touchscreen.)

Ever since I disabled the touchscreen, I have had no further issues with the notifications popping up, nor the weirdness with the text selection in IntelliJ. So by disabling the touchscreen on my Lenovo Yoga laptop, I was able to fix the notification pop-up issue in Ubuntu.

As a last step, I did not want the touchscreen to get re-enabled whenever I would restart my laptop. The command I ran above only disabled it temporarily. Upon reboot, the touchscreen would be reenabled. The Askubuntu article I linked above has suggestions (and links to suggestions) on different ways to turn off your touchscreen upon restarting your computer. For my case, I decided to simply have it disabled after logging in. That was fine for my purposes; I did not mind if the touchscreen was on at first. I just wanted it disabled once I logged in after reboot.

So what I did is add another script to /etc/profile.d , and named it disable-touchscreen.sh :

sudo vi /etc/profile.d/disable-touchscreen.sh

Since I did not want to assume that the ID of the touchscreen device would always be the same, I instead decided to rely on the name of the device (which I did not think was likely to change), and use a little grep and sed magic to pull the ID. Thus, the content of my disable-touchscreen.sh script was:

#!/bin/bashTOUCHSCREEN_ID=`xinput | grep "Wacom HID 50FD Finger touch" | sed 's/.*id=\([0-9]*\).*/\1/'`
xinput disable $TOUCHSCREEN_ID
if [ $? -eq 0 ]
then
echo "Touchscreen disabled."
else
echo "Could not disable touch screen."
fi

So now, when I reboot my laptop and login after reboot, the touchscreen is disabled:

$ xinput list 12
Wacom HID 50FD Finger touch id=12 [slave pointer (2)]
This device is disabled
[...]

And I can see the message Touchscreen disabled. in the system logs (using the “GNOME Logs” application):

GNOME Logs
GNOME Logs

Note the following, however:

  1. This only works after you log in. This was acceptable in my case. But if you need to disable your touchscreen when the system comes up (before anyone logs in), this technique will not be sufficient. The article linked above has pointers to some suggestions to address that.
  2. Be very careful when adding a script to /etc/profile.d . If there are any syntax errors in it, or if there are any other problems with the script that cause it to error-out, it could prevent anyone from ever being able to log in to your system. (I ran into that very problem at one point, and ended up having to start my system up in “safe mode” from grub. It involved me opening a root shell and editing the errant script. Fortunately, that fixed the problem, but it was pretty unnerving.) So be careful when doing this! To be safe, you may want to avoid editing any startup scripts until you are absolutely certain you need/want to do this. And even then, make sure you know what you are doing!

--

--

Brian Terczynski

Documenting my learnings on my journey as a software engineer.