[plugins/qpa] Properly clean up the created KWayland::Client::Outputs
On build.kde.org the autotests started to crash on tear down due to a newer Wayland library. The reason is that the KWayland::Client::Outputs are destroyed after the internal Wayland connection is destroyed. This change parents the created Outputs to the Registry like the other objects. To ensure that the KWin::QPA::Screen doesn't have a problem with that, it is changed to a QPointer - nullptr checks are already in place. Hopefully that will fix the crashes on build.kde.org, but there is a chance that more errors are hidden.
This commit is contained in:
parent
19147f5f85
commit
acb4336932
3 changed files with 5 additions and 3 deletions
|
@ -226,7 +226,7 @@ void Integration::createWaylandOutput(quint32 name, quint32 version)
|
||||||
m_dummyScreen = nullptr;
|
m_dummyScreen = nullptr;
|
||||||
}
|
}
|
||||||
using namespace KWayland::Client;
|
using namespace KWayland::Client;
|
||||||
auto o = m_registry->createOutput(name, version, this);
|
auto o = m_registry->createOutput(name, version, m_registry);
|
||||||
connect(o, &Output::changed, this,
|
connect(o, &Output::changed, this,
|
||||||
[this, o] {
|
[this, o] {
|
||||||
disconnect(o, &Output::changed, nullptr, nullptr);
|
disconnect(o, &Output::changed, nullptr, nullptr);
|
||||||
|
|
|
@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "platformcursor.h"
|
#include "platformcursor.h"
|
||||||
|
#include "wayland_server.h"
|
||||||
|
|
||||||
#include <KWayland/Client/output.h>
|
#include <KWayland/Client/output.h>
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ namespace QPA
|
||||||
|
|
||||||
Screen::Screen(KWayland::Client::Output *o)
|
Screen::Screen(KWayland::Client::Output *o)
|
||||||
: QPlatformScreen()
|
: QPlatformScreen()
|
||||||
, m_output(o)
|
, m_output(QPointer<KWayland::Client::Output>(o))
|
||||||
, m_cursor(new PlatformCursor)
|
, m_cursor(new PlatformCursor)
|
||||||
{
|
{
|
||||||
// TODO: connect to resolution changes
|
// TODO: connect to resolution changes
|
||||||
|
|
|
@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define KWIN_QPA_SCREEN_H
|
#define KWIN_QPA_SCREEN_H
|
||||||
|
|
||||||
#include <qpa/qplatformscreen.h>
|
#include <qpa/qplatformscreen.h>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
namespace KWayland
|
namespace KWayland
|
||||||
{
|
{
|
||||||
|
@ -50,7 +51,7 @@ public:
|
||||||
QDpi logicalDpi() const override;
|
QDpi logicalDpi() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KWayland::Client::Output *m_output;
|
QPointer<KWayland::Client::Output> m_output;
|
||||||
QScopedPointer<PlatformCursor> m_cursor;
|
QScopedPointer<PlatformCursor> m_cursor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue