Fix KDE X Error: BadDrawable

Quick Fix One of KDE’s Most Common Xorg Errors – X Error: BadDrawable

X Error: BadDrawable (invalid Pixmap or Window parameter) # [random number here] is one of KDE’s most common xorg errors which may cause grey windows, no buttons, etc… luckily it can be easily fixed, this is how.

Updated Oct 7, 2016Quick Fix

If your KDE desktop suffers from any of the symptoms mentioned above or similar ones, there’s a good chance it’s infected by the herein bug.

However, the good news are – it’s pretty simple to fix, but before you do anything, let’s begin with how to diagnose whether your desktop has the bug?

Does My Desktop Has BadDrawable?

In order to find out whether your KDE is sick with BadDrawable, all you need to do is open your file manager, e.g. Dolphin, press Alt+. to show hidden files then open up .xsession-errors with a text editor.

Now scroll down, if you see some lines similar to the one at the top of the article (or see following image), then your KDE could use the fix below.

X Error: BadDrawable

Fixing X Error: BadDrawable

To fix the bug, open up /etc/environment in a text editor as root like this: (this will fix it for all users of this machine)

sudo kwrite /etc/environment
[enter password]

Insert the following then save and close the editor: QT_X11_NO_MITSHM=1

That’s it, next time you’ll boot into KDE, you’ll see that the bug has been fixed and symptoms along it.


But wait, what does it do? I don’t like to mess with my system and config files… and I certainly agree with you that in most cases you really shouldn’t, however, you might want to make this an exception, here’s why:

[Warning! it’s a bit tech savvy]

“AIUI, the MIT-SHM extension uses shared memory (between X and the application) for the graphics buffer, which should make things faster, because the graphics data doesn’t have to be copied around. (

QT_X11_NO_MITSHM=1 tells Qt to _not_ use MIT-SHM (shared memory), so should be safer security-wise in any case.”   from KDE forums

COMMENTS (beta 3)

Add your comment here...

More In