[SOLVED] BadWindow error on Linux Mint 19 XFCE

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

[SOLVED] BadWindow error on Linux Mint 19 XFCE

Post by milon »

Solved! Turns out the culprit was a newer version of Mesa, which broken OpenGL 2 compatibility with Intel 3rd Gen GPU's. Solution is here: viewtopic.php?f=4&t=85719&p=223077#p223077

====

I have an old Intel Atom PC system that I play around with. Until recently, I had Linux Mint 18 Cinnamon installed on it, and Love worked great with it - I just had to install the PPA and then find Love in the Software Manager. Easy!

However, Linux Mint 19 just recently came out and I decided to try XFCE (because old hardware is old, lol). I did a fresh install (including wiping the HDD) and did a typical XFCE install of LM19. Everything works great so far - except Love. :( I'm getting a vague BadWindow error when I try to do anything involving the Love executable: double-click a .love file, use the "love" command, call a .love file using "love", etc. I have no idea what to try next. I'm still newish to Linux, so I don't know how to look into driver issues, etc. Any help would be greatly appreciated. Here's a copy/paste of some terminal stuff to show the current state:

Code: Select all

cooper@Shuttle:~$ love
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  4 (X_DestroyWindow)
  Resource id in failed request:  0x4600014
  Serial number of failed request:  299
  Current serial number in output stream:  304

cooper@Shuttle:~$ love --version
LOVE 11.1 (Mysterious Mysteries)

cooper@Shuttle:~$ sudo apt-get install libgl1-mesa-dev
[sudo] password for cooper: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgl1-mesa-dev is already the newest version (18.0.5-0ubuntu0~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

cooper@Shuttle:~$ sudo apt-get install libgl1-mesa-glx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgl1-mesa-glx is already the newest version (18.0.5-0ubuntu0~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

cooper@Shuttle:~$ sudo apt-get install libsdl2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libsdl2-dev is already the newest version (2.0.8+dfsg1-1ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

cooper@Shuttle:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	LinuxMint
Description:	Linux Mint 19 Tara
Release:	19
Codename:	tara
Last edited by milon on Thu Sep 13, 2018 6:12 pm, edited 1 time in total.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by pgimeno »

Could you paste the output of this? (glxinfo is in package mesa-utils, so install that first if you don't have it)

Code: Select all

glxinfo | grep OpenGL
Also, what's your graphics card (if not obvious from the above output)?
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by milon »

Thanks for the quick reply!

Code: Select all

cooper@Shuttle:~$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Pineview 
OpenGL version string: 1.4 Mesa 18.0.5
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
Onboard video, Intel GMA 3150. Here's the spec sheet:
http://global.shuttle.com/main/products ... uctId=1515
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by pgimeno »

Hm, I'm not very familiar with drivers and requirements. That reads to me as supporting OpenGL 1.4, which is old, but also OpenGLES 2.0, which I think is OK but I'm not sure. Funnily, I can't find LÖVE's OpenGL requirements in the places I consider more obvious: the front page, the Wiki front page, the Wiki Getting Started page, and the 11.0 release notes. I think there was an environment setting to force it to use OpenGL ES, but I can't recall which.

But does "Mesa DRI" mean it's using/requiring DRI drivers instead of GLX? Do you have libgl1-mesa-dri installed?

- If not, try to install it and perhaps uninstall libgl1-mesa-glx.
- If you do, try uninstalling it to see if that forces it to use GLX.

These are basically shots in the dark because I have no idea whether libgl1-mesa-dri is capable on itself of rendering accelerated OpenGL, or whether GLX is required for LÖVE. At worst, you just revert everything and you'd be like you're now.

Edit: Also see here: https://bugs.launchpad.net/ubuntu/+sour ... bug/696190 for how to enable OpenGL 2.0 for that card, which I don't know if it will help.
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by milon »

I'll try what you suggested when I have time, but for now this is really confusing. I followed the link you gave, and installed driconf. Here's what I get:

Code: Select all

cooper@Shuttle:~$ driconf
Screen "0" is not direct rendering capable.
Driver "vmwgfx" is not installed or does not support configuration.
Driver "vmwgfx" is not installed or does not support configuration.
Driver "radeonsi" is not installed or does not support configuration.
Driver "radeonsi" is not installed or does not support configuration.
Driver "radeonsi" is not installed or does not support configuration.
Driver "vmwgfx" is not installed or does not support configuration.
Driver "radeonsi" is not installed or does not support configuration.
Driver "vmwgfx" is not installed or does not support configuration.
Driver "radeonsi" is not installed or does not support configuration.
Driver "vmwgfx" is not installed or does not support configuration.

cooper@Shuttle:~$ glxinfo | grep render
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) Pineview 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 
Yes, the glxinfo output ends with a comma. I tried twice to make sure. The glxinfo command says it *is* direct render capable. Driconf thinks otherwise, and I couldn't seem to add/edit any of the settings as a result. Head scratching intensifies.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by grump »

milon wrote: Wed Sep 12, 2018 3:50 pm Driver "vmwgfx" is not installed or does not support configuration.
Are you trying this in a VMWare VM? Try installing open-vm-tools or VMWare tools.
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by milon »

No, I'm not using VMWare. Not sure why that was listed in driconf.

I tried installing libgl1-mesa-dri, but it reported as being already installed. So I tried uninstalling it, and it said that would remove 110 packages and free up over 300MB of space. I thought it was strange, but proceeded anyway. 'Cause I'm smart that way! ;)

I'm posting this from my phone, as it seems to have removed my entire GUI, and now only boots to CLI and gives occasional vague error messages like "switch case 0x5e not processed". :shock:

Oops! Good thing this is just my screwing around system (mostly). When I have more time, I think I'll just reinstall Linux and go with Cinnamon again. It didn't give me any trouble like this before.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by pgimeno »

Sorry :(

Yeah, if removing something means to remove a big bunch of packages with it, don't accept, at least not without being positive you want all of these packages removed.

I've now checked that in my system, the xorg package depends on libgl1-mesa-dri, and I wouldn't be surprised if your display manager depends on xorg (I don't use a display manager so I can't tell).

You probably have the list of packages it uninstalled in the apt log /var/log/apt/term.log file, so you could install them again, but it's going to be a bit tedious. I imagine there must be some easier way to reinstall a desktop; maybe tasksel.
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: BadWindow error on Linux Mint 19 XFCE

Post by milon »

No worries, really. I caused the problem and it's not the first time I've b0rked it. It's a big part of how I've been learning Linux - break it, learn why it broke, fix it, carry on. That's what makes it my screwing around system! :)

And I'll have to look into tasksel. Thanks for the tip.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

[SOLVED] Re: BadWindow error on Linux Mint 19 XFCE

Post by milon »

LOL, so removing libgl1-mesa-dri didn't just break the display manager, but it also somehow prevented apt-get from being able to acquire a lock, which meant no (easy) updates. I didn't already have taskel, so I couldn't install it easily. So, yeah, I wiped the drive and started fresh with Linux 19 Cinnamon. I keep everything of value backed up, and I have good notes about how to setup & configure everything I use, so it's not that much of a pain.

Then I installed Love and gave it a go:

Code: Select all

cooper@shuttle:~$ love
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  4 (X_DestroyWindow)
  Resource id in failed request:  0x5400014
  Serial number of failed request:  299
  Current serial number in output stream:  304
So I was back to the original problem, and it appeared to be a Linux Mint 19 issue, rather than an XFCE one. I did a bunch more googling, and solved it!

This link explains the issue, but the summary is that a newer version of Mesa (presumably bundled with Mint 19) breaks support for OpenGL 2.1 on 3rd generation Intel GPU's. This can be gotten around with driconf, except driconf wasn't working for me (I still have no idea why). But that same page, and a link from it, explained how to manually edit the dri file to add an application-specific exception. For me, this meant editing /etc/drirc (as root) and after the initial <device>, I added the following:

Code: Select all

        <application name="love">
            <option name="stub_occlusion_query" value="true" />
            <option name="fragment_shader" value="true" />
        </application>
Worked like magic, and didn't even have to restart! :D
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 53 guests