Improve error handling in C++ Skia Renderer API

- Don't try to create a GLX context when we only have an XCB window handle,
  XLib is required for that.
- Make it possible to create a NativeWindowHandle from Xlib data types.

Fixes #2978
This commit is contained in:
Simon Hausmann 2023-07-14 13:48:59 +02:00 committed by Simon Hausmann
parent 57e9b5b796
commit 3565023a15
4 changed files with 37 additions and 8 deletions

View file

@ -45,7 +45,7 @@ static slint_platform::NativeWindowHandle window_handle_for_qt_window(QWindow *w
native->nativeResourceForWindow(QByteArray("connection"), window));
auto screen = quintptr(native->nativeResourceForWindow(QByteArray("screen"), window));
return slint_platform::NativeWindowHandle::from_x11(wid, wid, connection, screen);
return slint_platform::NativeWindowHandle::from_x11_xcb(wid, wid, connection, screen);
#endif
}
@ -56,6 +56,7 @@ class MyWindow : public QWindow, public slint_platform::WindowAdapter
public:
MyWindow(QWindow *parentWindow = nullptr) : QWindow(parentWindow)
{
resize(640, 480);
m_renderer.emplace(window_handle_for_qt_window(this), physical_size());
}