diff options
Diffstat (limited to 'sources/pyside6/PySide6')
5 files changed, 39 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/QtGui/CMakeLists.txt b/sources/pyside6/PySide6/QtGui/CMakeLists.txt index 7b4097ee6..64e5f1f8b 100644 --- a/sources/pyside6/PySide6/QtGui/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtGui/CMakeLists.txt @@ -294,7 +294,14 @@ get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui if("xcb" IN_LIST QtGui_enabled_features) list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qnativeinterface_qx11application_wrapper.cpp) -elseif(WIN32) +endif() + +if("wayland" IN_LIST QtGui_enabled_features) + list(APPEND QtGui_SRC + ${QtGui_GEN_DIR}/qnativeinterface_qwaylandapplication_wrapper.cpp) +endif() + +if(WIN32) list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qnativeinterface_qwindowsscreen_wrapper.cpp) endif() diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui.xml index 2038f9677..74f298cd8 100644 --- a/sources/pyside6/PySide6/QtGui/typesystem_gui.xml +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui.xml @@ -14,6 +14,7 @@ <?endif?> <?if unix !darwin?> <load-typesystem name="QtGui/typesystem_gui_x11.xml" generate="yes"/> + <load-typesystem name="QtGui/typesystem_gui_wayland.xml" generate="yes"/> <?endif?> <load-typesystem name="QtGui/typesystem_gui_nativeinterface.xml" generate="yes"/> <load-typesystem name="QtGui/typesystem_gui_common.xml" generate="yes"/> diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_nativeinterface.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_nativeinterface.xml index 3965c72b6..ba83d0f11 100644 --- a/sources/pyside6/PySide6/QtGui/typesystem_gui_nativeinterface.xml +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_nativeinterface.xml @@ -9,6 +9,16 @@ known for the code snippets of QGuiApplication::nativeInterface() and similar. <typesystem package="PySide6.QtGui"> <namespace-type name="QNativeInterface" private="yes" since="6.7"> + <object-type name="QWaylandApplication" private="yes" disable-wrapper="yes"> + <configuration condition="QT_CONFIG(wayland)"/> + <modify-function signature="^(compositor|display|keyboard|pointer|seat|touch|lastInputSeat)\(\)const$"> + <modify-argument index="return"> + <replace-type modified-type="int"/> + </modify-argument> + <inject-code class="target" position="end" file="../glue/qtgui.cpp" + snippet="native-resource-ptr"/> + </modify-function> + </object-type> <object-type name="QX11Application" private="yes" disable-wrapper="yes" force-abstract="yes"> <configuration condition="QT_CONFIG(xcb)"/> diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_wayland.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_wayland.xml new file mode 100644 index 000000000..5b822d4f5 --- /dev/null +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_wayland.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +--> +<typesystem package="PySide6.QtGui"> + <custom-type name="wl_compositor"/> + <custom-type name="wl_display"/> + <custom-type name="wl_keyboard"/> + <custom-type name="wl_pointer"/> + <custom-type name="wl_seat"/> + <custom-type name="wl_touch"/> +</typesystem> diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index b394c4ad0..71b102d3b 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -907,7 +907,13 @@ if (auto *x11App = %CPPSELF.nativeInterface<QNativeInterface::QX11Application>() hasNativeApp = true; %PYARG_0 = %CONVERTTOPYTHON[QNativeInterface::QX11Application*](x11App); } -#endif +#endif // xcb +#if QT_CONFIG(wayland) +if (auto *waylandApp = %CPPSELF.nativeInterface<QNativeInterface::QWaylandApplication>()) { + hasNativeApp = true; + %PYARG_0 = %CONVERTTOPYTHON[QNativeInterface::QWaylandApplication*](waylandApp); +} +#endif // wayland if (!hasNativeApp) { Py_INCREF(Py_None); %PYARG_0 = Py_None; |
