Fix for XCB error/Qt crash with Optimus setup

I've finally found out how to fix my display setup script issues.

Without these two commits, I can only use SDDM with auto login enabled because the greeter crashes every time my display setup script is ran due to a bug in Qt (see https://bugreports.qt-project.org/browse/QTBUG-39552).