diff -Nru dwayland-5.57.0.23/.arcconfig dwayland-5.57.0.24+really5.24.3/.arcconfig --- dwayland-5.57.0.23/.arcconfig 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.arcconfig 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -{ - "phabricator.uri" : "https://phabricator.kde.org/" -} - diff -Nru dwayland-5.57.0.23/.arclint dwayland-5.57.0.24+really5.24.3/.arclint --- dwayland-5.57.0.23/.arclint 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.arclint 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -{ - "exclude": "(^test/)", - "linters": { - "spelling": { - "type": "spelling" - }, - "merge-conflict": { - "type": "merge-conflict" - }, - "xml": { - "type": "xml", - "include": "(\\.xml$)" - }, - "cppcheck": { - "type": "cppcheck", - "include": "(\\.(cpp|h|cxx|hpp)$)", - "flags": ["--language=c++", "--std=c++11"] - } - } -} diff -Nru dwayland-5.57.0.23/autotests/client/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/autotests/client/CMakeLists.txt --- dwayland-5.57.0.23/autotests/client/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,88 +1,39 @@ ######################################################## -# Test WaylandConnectionThread -######################################################## -set( testWaylandConnectionThread_SRCS - test_wayland_connection_thread.cpp - ) -add_executable(testWaylandConnectionThread ${testWaylandConnectionThread_SRCS}) -target_link_libraries( testWaylandConnectionThread Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) -add_test(NAME kwayland-testWaylandConnectionThread COMMAND testWaylandConnectionThread) -ecm_mark_as_test(testWaylandConnectionThread) - -######################################################## -# Test WaylandRegistry -######################################################## -set( testWaylandRegistry_SRCS - test_wayland_registry.cpp - ) -add_executable(testWaylandRegistry ${testWaylandRegistry_SRCS}) -target_link_libraries( testWaylandRegistry Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) -add_test(NAME kwayland-testWaylandRegistry COMMAND testWaylandRegistry) -ecm_mark_as_test(testWaylandRegistry) - -######################################################## -# Test WaylandFullscreenShell -######################################################## -if(Wayland_VERSION VERSION_GREATER "1.4.0") - find_program(WESTON_EXECUTABLE weston DOC "Path to the weston executable.") - if(WESTON_EXECUTABLE) - set( testWaylandFullscreenShell_SRCS - test_wayland_fullscreen_shell.cpp - ) - add_executable(testWaylandFullscreenShell ${testWaylandFullscreenShell_SRCS}) - target_link_libraries( testWaylandFullscreenShell Qt5::Test KF5::WaylandClient Wayland::Client) - add_test(NAME kwayland-testWaylandFullscreenShell COMMAND testWaylandFullscreenShell) - ecm_mark_as_test(testWaylandFullscreenShell) - else() - message(STATUS "The weston executable was not found. Some autotests will not be executed.") - endif() -endif() - -######################################################## # Test WaylandOutput ######################################################## set( testWaylandOutput_SRCS test_wayland_output.cpp ) add_executable(testWaylandOutput ${testWaylandOutput_SRCS}) -target_link_libraries( testWaylandOutput Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) +target_link_libraries( testWaylandOutput Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client Wayland::Server) add_test(NAME kwayland-testWaylandOutput COMMAND testWaylandOutput) ecm_mark_as_test(testWaylandOutput) ######################################################## -# Test WaylandShell -######################################################## -set( testWaylandShell_SRCS - test_wayland_shell.cpp - ) -add_executable(testWaylandShell ${testWaylandShell_SRCS}) -target_link_libraries( testWaylandShell Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) -add_test(NAME kwayland-testWaylandShell COMMAND testWaylandShell) -ecm_mark_as_test(testWaylandShell) - -######################################################## # Test WaylandSurface ######################################################## set( testWaylandSurface_SRCS test_wayland_surface.cpp ) add_executable(testWaylandSurface ${testWaylandSurface_SRCS}) -target_link_libraries( testWaylandSurface Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) +target_link_libraries( testWaylandSurface Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client Wayland::Server) add_test(NAME kwayland-testWaylandSurface COMMAND testWaylandSurface) ecm_mark_as_test(testWaylandSurface) ######################################################## # Test WaylandSeat ######################################################## -if (HAVE_LINUX_INPUT_H) - set( testWaylandSeat_SRCS - test_wayland_seat.cpp - ) - add_executable(testWaylandSeat ${testWaylandSeat_SRCS}) - target_link_libraries( testWaylandSeat Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) - add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat) - ecm_mark_as_test(testWaylandSeat) -endif() +set( testWaylandSeat_SRCS + test_wayland_seat.cpp + ) +ecm_add_qtwayland_client_protocol(testWaylandSeat_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml + BASENAME pointer-gestures-unstable-v1 +) +add_executable(testWaylandSeat ${testWaylandSeat_SRCS}) +target_link_libraries( testWaylandSeat Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client Wayland::Server) +add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat) +ecm_mark_as_test(testWaylandSeat) ######################################################## # Test ShmPool @@ -91,85 +42,29 @@ test_shm_pool.cpp ) add_executable(testShmPool ${testShmPool_SRCS}) -target_link_libraries( testShmPool Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testShmPool Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testShmPool COMMAND testShmPool) ecm_mark_as_test(testShmPool) ######################################################## -# Test KWin OutputManagement -######################################################## -set( test_wayland_outputmanagement_SRCS - test_wayland_outputmanagement.cpp - ) -add_executable(testWaylandOutputManagement ${test_wayland_outputmanagement_SRCS}) -target_link_libraries( testWaylandOutputManagement Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) -add_test(NAME kwayland-testWaylandOutputManagement COMMAND testWaylandOutputManagement) -ecm_mark_as_test(testWaylandOutputManagement) - -######################################################## -# Test KWin OutputDevice -######################################################## -set( test_wayland_outputdevice_SRCS - test_wayland_outputdevice.cpp - ) -add_executable(testWaylandOutputDevice ${test_wayland_outputdevice_SRCS}) -target_link_libraries( testWaylandOutputDevice Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) -add_test(NAME kwayland-testWaylandOutputDevice COMMAND testWaylandOutputDevice) -ecm_mark_as_test(testWaylandOutputDevice) - -######################################################## -# Test Compositor -######################################################## -set( testCompositor_SRCS - test_compositor.cpp - ) -add_executable(testCompositor ${testCompositor_SRCS}) -target_link_libraries( testCompositor Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) -add_test(NAME kwayland-testCompositor COMMAND testCompositor) -ecm_mark_as_test(testCompositor) - -######################################################## -# Test SubCompositor -######################################################## -set( testSubCompositor_SRCS - test_wayland_subcompositor.cpp - ) -add_executable(testSubCompositor ${testSubCompositor_SRCS}) -target_link_libraries( testSubCompositor Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) -add_test(NAME kwayland-testSubCompositor COMMAND testSubCompositor) -ecm_mark_as_test(testSubCompositor) - - -######################################################## # Test SubSurface ######################################################## set( testSubSurface_SRCS test_wayland_subsurface.cpp ) add_executable(testSubSurface ${testSubSurface_SRCS}) -target_link_libraries( testSubSurface Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testSubSurface Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testSubSurface COMMAND testSubSurface) ecm_mark_as_test(testSubSurface) ######################################################## -# Test Region -######################################################## -set( testRegion_SRCS - test_wayland_region.cpp - ) -add_executable(testRegion ${testRegion_SRCS}) -target_link_libraries( testRegion Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) -add_test(NAME kwayland-testRegion COMMAND testRegion) -ecm_mark_as_test(testRegion) - -######################################################## # Test Blur ######################################################## set( testBlur_SRCS test_wayland_blur.cpp ) add_executable(testBlur ${testBlur_SRCS}) -target_link_libraries( testBlur Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testBlur Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testBlur COMMAND testBlur) ecm_mark_as_test(testBlur) @@ -180,7 +75,7 @@ test_wayland_contrast.cpp ) add_executable(testContrast ${testContrast_SRCS}) -target_link_libraries( testContrast Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testContrast Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testContrast COMMAND testContrast) ecm_mark_as_test(testContrast) @@ -191,7 +86,7 @@ test_wayland_slide.cpp ) add_executable(testSlide ${testSlide_SRCS}) -target_link_libraries( testSlide Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testSlide Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testSlide COMMAND testSlide) ecm_mark_as_test(testSlide) @@ -202,7 +97,7 @@ test_wayland_windowmanagement.cpp ) add_executable(testWindowmanagement ${testWindowmanagement_SRCS}) -target_link_libraries( testWindowmanagement Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testWindowmanagement Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testWindowmanagement COMMAND testWindowmanagement) ecm_mark_as_test(testWindowmanagement) @@ -213,7 +108,7 @@ test_datasource.cpp ) add_executable(testDataSource ${testDataSource_SRCS}) -target_link_libraries( testDataSource Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testDataSource Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testDataSource COMMAND testDataSource) ecm_mark_as_test(testDataSource) @@ -224,7 +119,7 @@ test_datadevice.cpp ) add_executable(testDataDevice ${testDataDevice_SRCS}) -target_link_libraries( testDataDevice Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testDataDevice Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testDataDevice COMMAND testDataDevice) ecm_mark_as_test(testDataDevice) @@ -235,7 +130,7 @@ test_server_side_decoration.cpp ) add_executable(testServerSideDecoration ${testServerSideDecoration_SRCS}) -target_link_libraries( testServerSideDecoration Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testServerSideDecoration Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testServerSideDecoration COMMAND testServerSideDecoration) ecm_mark_as_test(testServerSideDecoration) @@ -246,7 +141,7 @@ test_drag_drop.cpp ) add_executable(testDragAndDrop ${testDragAndDrop_SRCS}) -target_link_libraries( testDragAndDrop Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testDragAndDrop Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testDragAndDrop COMMAND testDragAndDrop) ecm_mark_as_test(testDragAndDrop) @@ -257,7 +152,7 @@ test_plasmashell.cpp ) add_executable(testPlasmaShell ${testPlasmaShell_SRCS}) -target_link_libraries( testPlasmaShell Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testPlasmaShell Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testPlasmaShell COMMAND testPlasmaShell) ecm_mark_as_test(testPlasmaShell) @@ -268,7 +163,7 @@ test_idle.cpp ) add_executable(testIdle ${testIdle_SRCS}) -target_link_libraries( testIdle Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testIdle Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testIdle COMMAND testIdle) ecm_mark_as_test(testIdle) @@ -279,46 +174,31 @@ test_shadow.cpp ) add_executable(testShadow ${testShadow_SRCS}) -target_link_libraries( testShadow Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testShadow Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testShadow COMMAND testShadow) ecm_mark_as_test(testShadow) ######################################################## # Test FakeInput ######################################################## -if (HAVE_LINUX_INPUT_H) - set( testFakeInput_SRCS - test_fake_input.cpp - ) - add_executable(testFakeInput ${testFakeInput_SRCS}) - target_link_libraries( testFakeInput Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) - add_test(NAME kwayland-testFakeInput COMMAND testFakeInput) - ecm_mark_as_test(testFakeInput) -endif() - -######################################################## -# Test PlasmaWindowModel -######################################################## -if (HAVE_LINUX_INPUT_H) - set( testPlasmaWindowModel_SRCS - test_plasma_window_model.cpp - ) - add_executable(testPlasmaWindowModel ${testPlasmaWindowModel_SRCS}) - target_link_libraries( testPlasmaWindowModel Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) - add_test(NAME kwayland-testPlasmaWindowModel COMMAND testPlasmaWindowModel) - ecm_mark_as_test(testPlasmaWindowModel) -endif() - -######################################################## -# Test TextInput -######################################################## -set( testTextInput_SRCS - test_text_input.cpp - ) -add_executable(testTextInput ${testTextInput_SRCS}) -target_link_libraries( testTextInput Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) -add_test(NAME kwayland-testTextInput COMMAND testTextInput) -ecm_mark_as_test(testTextInput) +set( testFakeInput_SRCS + test_fake_input.cpp + ) +add_executable(testFakeInput ${testFakeInput_SRCS}) +target_link_libraries( testFakeInput Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) +add_test(NAME kwayland-testFakeInput COMMAND testFakeInput) +ecm_mark_as_test(testFakeInput) + +######################################################## +# Test TextInputV2 +######################################################## +set( testTextInputV2_SRCS + test_text_input_v2.cpp + ) +add_executable(testTextInputV2 ${testTextInputV2_SRCS}) +target_link_libraries( testTextInputV2 Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) +add_test(NAME kwayland-testTextInputV2 COMMAND testTextInputV2) +ecm_mark_as_test(testTextInputV2) ######################################################## # Test Error @@ -327,7 +207,7 @@ test_error.cpp ) add_executable(testError ${testError_SRCS}) -target_link_libraries( testError Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testError Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testError COMMAND testError) ecm_mark_as_test(testError) @@ -338,61 +218,35 @@ test_selection.cpp ) add_executable(testSelection ${testSelection_SRCS}) -target_link_libraries( testSelection Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) +target_link_libraries( testSelection Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client) add_test(NAME kwayland-testSelection COMMAND testSelection) ecm_mark_as_test(testSelection) ######################################################## -# Test XdgShellV5 -######################################################## -set( testXdgShellV5_SRCS - test_xdg_shell.cpp - test_xdg_shell_v5.cpp - ) -add_executable(testXdgShellV5 ${testXdgShellV5_SRCS}) -target_link_libraries( testXdgShellV5 Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) -add_test(NAME kwayland-testXdgShellV5 COMMAND testXdgShellV5) -ecm_mark_as_test(testXdgShellV5) - -######################################################## # Test XdgForeign ######################################################## set( testXdgForeign_SRCS test_xdg_foreign.cpp ) add_executable(testXdgForeign ${testXdgForeign_SRCS}) -target_link_libraries( testXdgForeign Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) +target_link_libraries( testXdgForeign Qt::Test Qt::Gui Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) add_test(NAME kwayland-testXdgForeign COMMAND testXdgForeign) ecm_mark_as_test(testXdgForeign) ######################################################## -# Test XdgShellV6 +# Test XdgShell ######################################################## -set( testXdgShellV6_SRCS - test_xdg_shell.cpp - test_xdg_shell_v6.cpp - ) -add_executable(testXdgShellV6 ${testXdgShellV6_SRCS}) -target_link_libraries( testXdgShellV6 Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) -add_test(NAME kwayland-testXdgShellV6 COMMAND testXdgShellV6) -ecm_mark_as_test(testXdgShellV6) -######################################################## -# Test XdgShellStable -######################################################## -set( testXdgShellStable_SRCS - test_xdg_shell.cpp - test_xdg_shell_stable.cpp - ) -add_executable(testXdgShellStable ${testXdgShellStable_SRCS}) -target_link_libraries( testXdgShellStable Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) -add_test(NAME kwayland-testXdgShellStable COMMAND testXdgShellStable) -ecm_mark_as_test(testXdgShellStable) +set(testXdgShell_SRCS test_xdg_shell.cpp) +add_executable(testXdgShell ${testXdgShell_SRCS}) +target_link_libraries( testXdgShell Qt::Test Qt::Gui Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testXdgShell COMMAND testXdgShell) +ecm_mark_as_test(testXdgShell) ######################################################## # Test Pointer Constraints ######################################################## add_executable(testPointerConstraints test_pointer_constraints.cpp) -target_link_libraries( testPointerConstraints Qt5::Test Qt5::Gui KF5::WaylandServer KF5::WaylandClient Wayland::Client) +target_link_libraries( testPointerConstraints Qt::Test Qt::Gui Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) add_test(NAME kwayland-testPointerConstraints COMMAND testPointerConstraints) ecm_mark_as_test(testPointerConstraints) @@ -404,7 +258,7 @@ test_wayland_filter.cpp ) add_executable(testFilter ${testFilter_SRCS}) -target_link_libraries( testFilter Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Server) +target_link_libraries( testFilter Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Server) add_test(NAME kwayland-testFilter COMMAND testFilter) ecm_mark_as_test(testFilter) @@ -415,7 +269,7 @@ test_wayland_appmenu.cpp ) add_executable(testAppmenu ${testAppmenu_SRCS}) -target_link_libraries( testAppmenu Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testAppmenu Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testAppmenu COMMAND testAppmenu) ecm_mark_as_test(testAppmenu) @@ -426,40 +280,40 @@ test_server_side_decoration_palette.cpp ) add_executable(testServerSideDecorationPalette ${testServerSideDecorationPalette_SRCS}) -target_link_libraries( testServerSideDecorationPalette Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testServerSideDecorationPalette Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testServerSideDecorationPalette COMMAND testServerSideDecorationPalette) ecm_mark_as_test(testServerSideDecorationPalette) ######################################################## -# Test RemoteAccess -######################################################## -set( testRemoteAccess_SRCS - test_remote_access.cpp - ) -add_executable(testRemoteAccess ${testRemoteAccess_SRCS}) -target_link_libraries( testRemoteAccess Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) -add_test(NAME kwayland-testRemoteAccess COMMAND testRemoteAccess) -ecm_mark_as_test(testRemoteAccess) - -######################################################## # Test VirtualDesktop ######################################################## set( testPlasmaVirtualDesktop_SRCS test_plasma_virtual_desktop.cpp ) add_executable(testPlasmaVirtualDesktop ${testPlasmaVirtualDesktop_SRCS}) -target_link_libraries( testPlasmaVirtualDesktop Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer) +target_link_libraries( testPlasmaVirtualDesktop Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) add_test(NAME kwayland-testPlasmaVirtualDesktop COMMAND testPlasmaVirtualDesktop) ecm_mark_as_test(testPlasmaVirtualDesktop) ######################################################## +# Test Activities +######################################################## +set( testPlasmaActivities_SRCS + test_plasma_activities.cpp + ) +add_executable(testPlasmaActivities ${testPlasmaActivities_SRCS}) +target_link_libraries( testPlasmaActivities Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer) +add_test(NAME kwayland-testPlasmaActivities COMMAND testPlasmaActivities) +ecm_mark_as_test(testPlasmaActivities) + +######################################################## # Test XDG Output ######################################################## set( testXdgOutput_SRCS test_xdg_output.cpp ) add_executable(testXdgOutput ${testXdgOutput_SRCS}) -target_link_libraries( testXdgOutput Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) +target_link_libraries( testXdgOutput Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client Wayland::Server) add_test(NAME kwayland-testXdgOutput COMMAND testXdgOutput) ecm_mark_as_test(testXdgOutput) @@ -470,30 +324,7 @@ test_xdg_decoration.cpp ) add_executable(testXdgDecoration ${testXdgdecoration_SRCS}) -target_link_libraries( testXdgDecoration Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) +target_link_libraries( testXdgDecoration Qt::Test Qt::Gui Deepin::WaylandClient Deepin::DWaylandServer Wayland::Client Wayland::Server) add_test(NAME kwayland-testXdgDecoration COMMAND testXdgDecoration) ecm_mark_as_test(testXdgDecoration) - -######################################################## -# Test PrimarySelect -######################################################## -set( testPrimarySelect_SRCS - test_primaryselect.cpp - ) -add_executable(testPrimarySelect ${testPrimarySelect_SRCS}) -target_link_libraries( testPrimarySelect Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) -add_test(NAME kwayland-testPrimarySelect COMMAND testPrimarySelect) -ecm_mark_as_test(testPrimarySelect) - - -######################################################## -# Test PrimarySelect -######################################################## -set( testDataControl_SRCS - test_datacontrol.cpp - ) -add_executable(testDataControl ${testDataControl_SRCS}) -target_link_libraries(testDataControl Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client) -add_test(NAME kwayland-testDataControl COMMAND testDataControl) -ecm_mark_as_test(testDataControl) diff -Nru dwayland-5.57.0.23/autotests/client/test_compositor.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_compositor.cpp --- dwayland-5.57.0.23/autotests/client/test_compositor.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_compositor.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/compositor.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/surface.h" -#include "../../src/client/registry.h" -#include "../../src/client/shm_pool.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/surface_interface.h" - -class TestCompositor : public QObject -{ - Q_OBJECT -public: - explicit TestCompositor(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testDestroy(); - void testCast(); - -private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Client::ConnectionThread *m_connection; - KWayland::Client::Compositor *m_compositor; - QThread *m_thread; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-wayland-compositor-0"); - -TestCompositor::TestCompositor(QObject *parent) - : QObject(parent) - , m_display(nullptr) - , m_compositorInterface(nullptr) - , m_connection(nullptr) - , m_compositor(nullptr) - , m_thread(nullptr) -{ -} - -void TestCompositor::init() -{ - using namespace KWayland::Server; - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - KWayland::Client::Registry registry; - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - // here we need a shm pool - m_compositorInterface = m_display->createCompositor(m_display); - QVERIFY(m_compositorInterface); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - QVERIFY(compositorSpy.wait()); - m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); -} - -void TestCompositor::cleanup() -{ - if (m_compositor) { - delete m_compositor; - m_compositor = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - delete m_connection; - m_connection = nullptr; - - delete m_display; - m_display = nullptr; -} - -void TestCompositor::testDestroy() -{ - using namespace KWayland::Client; - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - QVERIFY(m_compositor->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the pool should be destroyed; - QVERIFY(!m_compositor->isValid()); - - // calling destroy again should not fail - m_compositor->destroy(); -} - -void TestCompositor::testCast() -{ - using namespace KWayland::Client; - Registry registry; - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - QVERIFY(compositorSpy.wait()); - - Compositor c; - auto wlComp = registry.bindCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value()); - c.setup(wlComp); - QCOMPARE((wl_compositor*)c, wlComp); - - const Compositor &c2(c); - QCOMPARE((wl_compositor*)c2, wlComp); -} - -QTEST_GUILESS_MAIN(TestCompositor) -#include "test_compositor.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_datacontrol.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_datacontrol.cpp --- dwayland-5.57.0.23/autotests/client/test_datacontrol.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_datacontrol.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,422 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - SPDX-FileCopyrightText: 2021 David Redondo - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -// Qt -#include -#include -#include - -// WaylandServer -#include "../../src/server/compositor_interface.h" -#include "../../src/server/datacontroldevice_interface.h" -#include "../../src/server/datacontroldevicemanager_interface.h" -#include "../../src/server/datacontrolsource_interface.h" -#include "../../src/server/datadevice_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/abstract_data_source.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - - - -using namespace KWayland::Server; -// Faux-client API for tests - -Q_DECLARE_OPAQUE_POINTER(::zwlr_data_control_offer_v1 *) -Q_DECLARE_METATYPE(::zwlr_data_control_offer_v1 *) - - - -/* -class testDataControlDeviceManager : public DataControlDeviceManager -{ - Q_OBJECT -}; - -class MyDataControlOffer : public DataControlOfferV1 -{ - Q_OBJECT -public: - ~MyDataControlOffer() - { - destroy(); - } - QStringList receivedOffers() - { - return m_receivedOffers; - } - -protected: - virtual void zwlr_data_control_offer_v1_offer(const QString &mime_type) override - { - m_receivedOffers << mime_type; - } - -private: - QStringList m_receivedOffers; -}; - -class DataControlDevice : public QObject, public QtWayland::zwlr_data_control_device_v1 -{ - Q_OBJECT -public: - ~DataControlDevice() - { - destroy(); - } -Q_SIGNALS: - void dataControlOffer(DataControlOffer *offer); // our event receives a new ID, so we make a new object - void selection(struct ::zwlr_data_control_offer_v1 *id); - void primary_selection(struct ::zwlr_data_control_offer_v1 *id); - -protected: - void zwlr_data_control_device_v1_data_offer(struct ::zwlr_data_control_offer_v1 *id) override - { - auto offer = new DataControlOffer; - offer->init(id); - Q_EMIT dataControlOffer(offer); - } - - void zwlr_data_control_device_v1_selection(struct ::zwlr_data_control_offer_v1 *id) override - { - Q_EMIT selection(id); - } - - void zwlr_data_control_device_v1_primary_selection(struct ::zwlr_data_control_offer_v1 *id) override - { - Q_EMIT primary_selection(id); - } -}; - -class DataControlSource : public QObject, public QtWayland::zwlr_data_control_source_v1 -{ - Q_OBJECT -public: - ~DataControlSource() - { - destroy(); - } - -public: -}; -*/ - -class TestDataSource : public AbstractDataSource -{ - Q_OBJECT -public: - TestDataSource() - : AbstractDataSource(nullptr) - { - } - ~TestDataSource() override - { - Q_EMIT aboutToBeDestroyed(); - } - void requestData(const QString &mimeType, qint32 fd) override - { - Q_UNUSED(mimeType); - Q_UNUSED(fd); - } - void cancel() override{} - - QStringList mimeTypes() const override - { - return {"text/plain"}; - } -}; -// The test itself - -class DataControlInterfaceTest : public QObject -{ - Q_OBJECT - -private Q_SLOTS: - void init(); - void cleanup(); - void testCopyToControl(); - void testCopyToControlPrimarySelection(); - void testCopyFromControl(); - void testCopyFromControlPrimarySelection(); - void testKlipperCase(); - -private: - KWayland::Client::ConnectionThread *m_connection; - KWayland::Client::EventQueue *m_queue; - KWayland::Client::Compositor *m_clientCompositor; - KWayland::Client::Seat *m_clientSeat = nullptr; - - QThread *m_thread; - Display *m_display; - SeatInterface *m_seat; - CompositorInterface *m_serverCompositor; - - DataControlDeviceManagerInterface *m_dataControlDeviceManagerInterface; - - KWayland::Client::DataControlDeviceManager *m_dataControlDeviceManager; - - QVector m_surfaces; -}; - -static const QString s_socketName = QStringLiteral("kwin-wayland-datacontrol-test-0"); - - -void DataControlInterfaceTest::init() -{ - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - - - using namespace KWayland::Server; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new KWayland::Client::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); - - KWayland::Client::Registry registry; - QSignalSpy datacontrolDeviceManagerSpy(®istry, SIGNAL(dataControlDeviceManagerAnnounced(quint32,quint32))); - QVERIFY(datacontrolDeviceManagerSpy.isValid()); - QSignalSpy seatSpy(®istry, SIGNAL(seatAnnounced(quint32,quint32))); - QVERIFY(seatSpy.isValid()); - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QVERIFY(compositorSpy.isValid()); - QVERIFY(!registry.eventQueue()); - registry.setEventQueue(m_queue); - QCOMPARE(registry.eventQueue(), m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - m_dataControlDeviceManagerInterface = m_display->createDataControlDeviceManager(m_display); - m_dataControlDeviceManagerInterface->create(); - QVERIFY(m_dataControlDeviceManagerInterface->isValid()); - - QVERIFY(datacontrolDeviceManagerSpy.wait()); - m_dataControlDeviceManager = registry.createDataControlDeviceManager(datacontrolDeviceManagerSpy.first().first().value(), - datacontrolDeviceManagerSpy.first().last().value(), this); - - m_seat = m_display->createSeat(m_display); - m_seat->setHasPointer(true); - m_seat->create(); - QVERIFY(m_seat->isValid()); - - QVERIFY(seatSpy.wait()); - m_clientSeat = registry.createSeat(seatSpy.first().first().value(), - seatSpy.first().last().value(), this); - QVERIFY(m_clientSeat->isValid()); - QSignalSpy pointerChangedSpy(m_clientSeat, SIGNAL(hasPointerChanged(bool))); - QVERIFY(pointerChangedSpy.isValid()); - QVERIFY(pointerChangedSpy.wait()); - - m_serverCompositor = m_display->createCompositor(m_display); - m_serverCompositor->create(); - QVERIFY(m_serverCompositor->isValid()); - - QVERIFY(compositorSpy.wait()); - m_clientCompositor = registry.createCompositor(compositorSpy.first().first().value(), - compositorSpy.first().last().value(), this); - QVERIFY(m_clientCompositor->isValid()); -} - -void DataControlInterfaceTest::cleanup() -{ -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ - } - CLEANUP(m_dataControlDeviceManager) - CLEANUP(m_clientSeat) - CLEANUP(m_clientCompositor) - CLEANUP(m_queue) - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - CLEANUP(m_display) -#undef CLEANUP - - // these are the children of the display - m_seat = nullptr; - m_serverCompositor = nullptr; -} - -void DataControlInterfaceTest::testCopyToControl() -{ - // we set a dummy data source on the seat using abstract client directly - // then confirm we receive the offer despite not having a surface - - QScopedPointer dataControlDevice(new KWayland::Client::DataControlDeviceV1); - dataControlDevice.reset(m_dataControlDeviceManager->getDataDevice(m_clientSeat)); - - QSignalSpy selectionSpy(dataControlDevice.data(), &KWayland::Client::DataControlDeviceV1::dataOffered); - - QScopedPointer testSelection(new TestDataSource); - m_seat->setSelection(testSelection.data()); - - // selection will be sent after we've been sent a new offer object and the mimes have been sent to that object - selectionSpy.wait(); - - QCOMPARE(selectionSpy.count(), 1); - KWayland::Client::DataControlOfferV1* offer(selectionSpy.first().first().value()); - QCOMPARE(offer->offeredMimeTypes().count(), 1); - QCOMPARE(offer->offeredMimeTypes()[0], "text/plain"); - -} - -void DataControlInterfaceTest::testCopyToControlPrimarySelection() -{ - // we set a dummy data source on the seat using abstract client directly - // then confirm we receive the offer despite not having a surface - - QScopedPointer dataControlDevice(new KWayland::Client::DataControlDeviceV1); - dataControlDevice.reset(m_dataControlDeviceManager->getDataDevice(m_clientSeat)); - - QSignalSpy selectionSpy(dataControlDevice.data(), &KWayland::Client::DataControlDeviceV1::selectionOffered); - //QSignalSpy selectionSpy(dataControlDevice.data(), &KWayland::Client::DataControlDeviceV1::primary_selection); - - QSignalSpy dataDeviceCreated(m_dataControlDeviceManagerInterface, &KWayland::Server::DataControlDeviceManagerInterface::dataDeviceCreated); - dataDeviceCreated.wait(); - - QScopedPointer testSelection(new TestDataSource); - m_seat->setPrimarySelection(testSelection.data()); - - // selection will be sent after we've been sent a new offer object and the mimes have been sent to that object - selectionSpy.wait(); - - QCOMPARE(selectionSpy.count(), 1); - KWayland::Client::DataControlOfferV1* offer(selectionSpy.first().first().value()); - - QCOMPARE(offer->offeredMimeTypes().count(), 1); - QCOMPARE(offer->offeredMimeTypes()[0], "text/plain"); -} - -void DataControlInterfaceTest::testCopyFromControl() -{ - // we create a data device and set a selection - // then confirm the server sees the new selection - QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::selectionChanged); - - QScopedPointer dataControlDevice(new KWayland::Client::DataControlDeviceV1); - dataControlDevice.reset(m_dataControlDeviceManager->getDataDevice(m_clientSeat)); - - QScopedPointer source(new KWayland::Client::DataControlSourceV1); - source.reset(m_dataControlDeviceManager->createDataSource()); - source->offer("text/plain"); - - dataControlDevice->setSelection(0,source.data()); - - serverSelectionChangedSpy.wait(); - QVERIFY(m_seat->selection()); - QCOMPARE(m_seat->selection()->mimeTypes()[0], "text/plain"); -} - -void DataControlInterfaceTest::testCopyFromControlPrimarySelection() -{ - // we create a data device and set a selection - // then confirm the server sees the new selection - QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::primarySelectionChanged); - - QScopedPointer dataControlDevice(new KWayland::Client::DataControlDeviceV1); - dataControlDevice.reset(m_dataControlDeviceManager->getDataDevice(m_clientSeat)); - - QSignalSpy dataDeviceCreated(m_dataControlDeviceManagerInterface, &KWayland::Server::DataControlDeviceManagerInterface::dataDeviceCreated); - dataDeviceCreated.wait(); - - QScopedPointer source(new KWayland::Client::DataControlSourceV1); - source.reset(m_dataControlDeviceManager->createDataSource()); - source->offer("text/plain"); - - dataControlDevice->setSelection(0, source.data()); - - serverSelectionChangedSpy.wait(); - QVERIFY(m_seat->selection()); - QCOMPARE(m_seat->selection()->mimeTypes()[0], "text/plain"); -} - -void DataControlInterfaceTest::testKlipperCase() -{ - // This tests the setup of klipper's real world operation and a race with a common pattern seen between clients and klipper - // The client's behaviour is faked with direct access to the seat - - QScopedPointer dataControlDevice(new KWayland::Client::DataControlDeviceV1); - dataControlDevice.reset(m_dataControlDeviceManager->getDataDevice(m_clientSeat)); - - - QSignalSpy dataDeviceCreated(m_dataControlDeviceManagerInterface, &KWayland::Server::DataControlDeviceManagerInterface::dataDeviceCreated); - dataDeviceCreated.wait(); - - QSignalSpy newOfferSpy(dataControlDevice.data(), &KWayland::Client::DataControlDeviceV1::dataControlOffered); - //QSignalSpy selectionSpy(dataControlDevice.data(), &KWayland::Client::DataControlDeviceV1::selection); - QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::selectionChanged); - - // Client A has a data source - QScopedPointer testSelection(new KWayland::Client::DataControlSourceV1); - testSelection.reset(m_dataControlDeviceManager->createDataSource()); - dataControlDevice->setSelection(0,testSelection.data()); - // klipper gets it - newOfferSpy.wait(); - - // Client A deletes it - testSelection.reset(); - - - // Client A sets something else - QScopedPointer testSelection2(new KWayland::Client::DataControlSourceV1); - testSelection2.reset(m_dataControlDeviceManager->createDataSource()); - dataControlDevice->setSelection(0,testSelection2.data()); - // Meanwhile klipper updates with the old content - QScopedPointer source(new KWayland::Client::DataControlSourceV1); - source.reset(m_dataControlDeviceManager->createDataSource()); - source->offer("fromKlipper/test1"); - source->offer("application/x-kde-onlyReplaceEmpty"); - - dataControlDevice->setSelection(0,source.data()); - - serverSelectionChangedSpy.wait(); - QVERIFY(m_seat->selection()); -} - -QTEST_GUILESS_MAIN(DataControlInterfaceTest) - -#include "test_datacontrol.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_datadevice.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_datadevice.cpp --- dwayland-5.57.0.23/autotests/client/test_datadevice.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_datadevice.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,46 +1,34 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWayland +#include "../../src/server/compositor_interface.h" +#include "../../src/server/datadevicemanager_interface.h" +#include "../../src/server/datasource_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/pointer_interface.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/surface_interface.h" +#include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" #include "../../src/client/datadevice.h" #include "../../src/client/datadevicemanager.h" #include "../../src/client/datasource.h" -#include "../../src/client/compositor.h" +#include "../../src/client/event_queue.h" #include "../../src/client/keyboard.h" #include "../../src/client/pointer.h" #include "../../src/client/registry.h" #include "../../src/client/seat.h" #include "../../src/client/surface.h" -#include "../../src/server/display.h" -#include "../../src/server/datadevicemanager_interface.h" -#include "../../src/server/datasource_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/pointer_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/surface_interface.h" // Wayland #include +#include + class TestDataDevice : public QObject { Q_OBJECT @@ -56,13 +44,12 @@ void testSetSelection(); void testSendSelectionOnSeat(); void testReplaceSource(); - void testDestroy(); private: - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; - KWayland::Server::CompositorInterface *m_compositorInterface = nullptr; - KWayland::Server::SeatInterface *m_seatInterface = nullptr; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; + KWaylandServer::SeatInterface *m_seatInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; @@ -75,17 +62,17 @@ void TestDataDevice::init() { - qRegisterMetaType(); - using namespace KWayland::Server; + qRegisterMetaType(); + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -101,11 +88,11 @@ QVERIFY(m_queue->isValid()); KWayland::Client::Registry registry; - QSignalSpy dataDeviceManagerSpy(®istry, SIGNAL(dataDeviceManagerAnnounced(quint32,quint32))); + QSignalSpy dataDeviceManagerSpy(®istry, &KWayland::Client::Registry::dataDeviceManagerAnnounced); QVERIFY(dataDeviceManagerSpy.isValid()); - QSignalSpy seatSpy(®istry, SIGNAL(seatAnnounced(quint32,quint32))); + QSignalSpy seatSpy(®istry, &KWayland::Client::Registry::seatAnnounced); QVERIFY(seatSpy.isValid()); - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); + QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced); QVERIFY(compositorSpy.isValid()); QVERIFY(!registry.eventQueue()); registry.setEventQueue(m_queue); @@ -114,34 +101,25 @@ QVERIFY(registry.isValid()); registry.setup(); - m_dataDeviceManagerInterface = m_display->createDataDeviceManager(m_display); - m_dataDeviceManagerInterface->create(); - QVERIFY(m_dataDeviceManagerInterface->isValid()); + m_dataDeviceManagerInterface = new DataDeviceManagerInterface(m_display, m_display); QVERIFY(dataDeviceManagerSpy.wait()); - m_dataDeviceManager = registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), - dataDeviceManagerSpy.first().last().value(), this); + m_dataDeviceManager = + registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), dataDeviceManagerSpy.first().last().value(), this); - m_seatInterface = m_display->createSeat(m_display); + m_seatInterface = new SeatInterface(m_display, m_display); m_seatInterface->setHasPointer(true); - m_seatInterface->create(); - QVERIFY(m_seatInterface->isValid()); QVERIFY(seatSpy.wait()); - m_seat = registry.createSeat(seatSpy.first().first().value(), - seatSpy.first().last().value(), this); + m_seat = registry.createSeat(seatSpy.first().first().value(), seatSpy.first().last().value(), this); QVERIFY(m_seat->isValid()); - QSignalSpy pointerChangedSpy(m_seat, SIGNAL(hasPointerChanged(bool))); + QSignalSpy pointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); QVERIFY(pointerChangedSpy.isValid()); QVERIFY(pointerChangedSpy.wait()); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); - m_compositor = registry.createCompositor(compositorSpy.first().first().value(), - compositorSpy.first().last().value(), this); + m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); QVERIFY(m_compositor->isValid()); } @@ -179,9 +157,9 @@ void TestDataDevice::testCreate() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataDeviceCreated(KWayland::Server::DataDeviceInterface*))); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); @@ -189,15 +167,12 @@ QVERIFY(dataDeviceCreatedSpy.wait()); QCOMPARE(dataDeviceCreatedSpy.count(), 1); - auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); + auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); QCOMPARE(deviceInterface->seat(), m_seatInterface); - QVERIFY(!deviceInterface->dragSource()); - QVERIFY(!deviceInterface->origin()); - QVERIFY(!deviceInterface->icon()); QVERIFY(!deviceInterface->selection()); - QVERIFY(deviceInterface->parentResource()); + // this will probably fail, we need to make a selection client side QVERIFY(!m_seatInterface->selection()); m_seatInterface->setSelection(deviceInterface->selection()); QCOMPARE(m_seatInterface->selection(), deviceInterface->selection()); @@ -225,10 +200,10 @@ void TestDataDevice::testDrag() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataDeviceCreated(KWayland::Server::DataDeviceInterface*))); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); @@ -236,10 +211,10 @@ QVERIFY(dataDeviceCreatedSpy.wait()); QCOMPARE(dataDeviceCreatedSpy.count(), 1); - auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); + auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); @@ -247,10 +222,10 @@ QVERIFY(dataSourceCreatedSpy.wait()); QCOMPARE(dataSourceCreatedSpy.count(), 1); - auto sourceInterface = dataSourceCreatedSpy.first().first().value(); + auto sourceInterface = dataSourceCreatedSpy.first().first().value(); QVERIFY(sourceInterface); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); @@ -258,10 +233,10 @@ QVERIFY(surfaceCreatedSpy.wait()); QCOMPARE(surfaceCreatedSpy.count(), 1); - auto surfaceInterface = surfaceCreatedSpy.first().first().value(); + auto surfaceInterface = surfaceCreatedSpy.first().first().value(); // now we have all we need to start a drag operation - QSignalSpy dragStartedSpy(deviceInterface, SIGNAL(dragStarted())); + QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted); QVERIFY(dragStartedSpy.isValid()); // first we need to fake the pointer enter @@ -270,13 +245,15 @@ QFETCH(bool, success); if (!hasGrab) { // in case we don't have grab, still generate a pointer serial to make it more interesting - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + m_seatInterface->notifyPointerButton(Qt::LeftButton, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); } if (hasPointerFocus) { m_seatInterface->setFocusedPointerSurface(surfaceInterface); } if (hasGrab) { - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + m_seatInterface->notifyPointerButton(Qt::LeftButton, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); } // TODO: This test would be better, if it could also test that a client trying to guess @@ -288,9 +265,9 @@ dataDevice->startDrag(pointerButtonSerial, dataSource.data(), surface.data()); QCOMPARE(dragStartedSpy.wait(500), success); QCOMPARE(!dragStartedSpy.isEmpty(), success); - QCOMPARE(deviceInterface->dragSource(), success ? sourceInterface : nullptr); - QCOMPARE(deviceInterface->origin(), success ? surfaceInterface : nullptr); - QVERIFY(!deviceInterface->icon()); + QCOMPARE(m_seatInterface->dragSource(), success ? sourceInterface : nullptr); + QCOMPARE(m_seatInterface->dragSurface(), success ? surfaceInterface : nullptr); + QVERIFY(!m_seatInterface->dragIcon()); } void TestDataDevice::testDragInternally_data() @@ -308,10 +285,10 @@ void TestDataDevice::testDragInternally() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataDeviceCreated(KWayland::Server::DataDeviceInterface*))); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); @@ -319,10 +296,10 @@ QVERIFY(dataDeviceCreatedSpy.wait()); QCOMPARE(dataDeviceCreatedSpy.count(), 1); - auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); + auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); @@ -330,17 +307,17 @@ QVERIFY(surfaceCreatedSpy.wait()); QCOMPARE(surfaceCreatedSpy.count(), 1); - auto surfaceInterface = surfaceCreatedSpy.first().first().value(); + auto surfaceInterface = surfaceCreatedSpy.first().first().value(); QScopedPointer iconSurface(m_compositor->createSurface()); QVERIFY(iconSurface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); QCOMPARE(surfaceCreatedSpy.count(), 2); - auto iconSurfaceInterface = surfaceCreatedSpy.last().first().value(); + auto iconSurfaceInterface = surfaceCreatedSpy.last().first().value(); // now we have all we need to start a drag operation - QSignalSpy dragStartedSpy(deviceInterface, SIGNAL(dragStarted())); + QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted); QVERIFY(dragStartedSpy.isValid()); // first we need to fake the pointer enter @@ -349,13 +326,15 @@ QFETCH(bool, success); if (!hasGrab) { // in case we don't have grab, still generate a pointer serial to make it more interesting - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + m_seatInterface->notifyPointerButton(Qt::LeftButton, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); } if (hasPointerFocus) { m_seatInterface->setFocusedPointerSurface(surfaceInterface); } if (hasGrab) { - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + m_seatInterface->notifyPointerButton(Qt::LeftButton, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); } // TODO: This test would be better, if it could also test that a client trying to guess @@ -367,18 +346,23 @@ dataDevice->startDragInternally(pointerButtonSerial, surface.data(), iconSurface.data()); QCOMPARE(dragStartedSpy.wait(500), success); QCOMPARE(!dragStartedSpy.isEmpty(), success); - QVERIFY(!deviceInterface->dragSource()); - QCOMPARE(deviceInterface->origin(), success ? surfaceInterface : nullptr); - QCOMPARE(deviceInterface->icon(), success ? iconSurfaceInterface : nullptr); + QVERIFY(!m_seatInterface->dragSource()); + QCOMPARE(m_seatInterface->dragSurface(), success ? surfaceInterface : nullptr); + + if (success) { + QCOMPARE(m_seatInterface->dragIcon()->surface(), iconSurfaceInterface); + } else { + QCOMPARE(m_seatInterface->dragIcon(), nullptr); + } } void TestDataDevice::testSetSelection() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataDeviceCreated(KWayland::Server::DataDeviceInterface*))); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); @@ -386,10 +370,10 @@ QVERIFY(dataDeviceCreatedSpy.wait()); QCOMPARE(dataDeviceCreatedSpy.count(), 1); - auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); + auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataDeviceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); @@ -398,13 +382,13 @@ QVERIFY(dataSourceCreatedSpy.wait()); QCOMPARE(dataSourceCreatedSpy.count(), 1); - auto sourceInterface = dataSourceCreatedSpy.first().first().value(); + auto sourceInterface = dataSourceCreatedSpy.first().first().value(); QVERIFY(sourceInterface); // everything setup, now we can test setting the selection - QSignalSpy selectionChangedSpy(deviceInterface, SIGNAL(selectionChanged(KWayland::Server::DataSourceInterface*))); + QSignalSpy selectionChangedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionChanged); QVERIFY(selectionChangedSpy.isValid()); - QSignalSpy selectionClearedSpy(deviceInterface, SIGNAL(selectionCleared())); + QSignalSpy selectionClearedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionCleared); QVERIFY(selectionClearedSpy.isValid()); QVERIFY(!deviceInterface->selection()); @@ -412,22 +396,22 @@ QVERIFY(selectionChangedSpy.wait()); QCOMPARE(selectionChangedSpy.count(), 1); QCOMPARE(selectionClearedSpy.count(), 0); - QCOMPARE(selectionChangedSpy.first().first().value(), sourceInterface); + QCOMPARE(selectionChangedSpy.first().first().value(), sourceInterface); QCOMPARE(deviceInterface->selection(), sourceInterface); // send selection to datadevice - QSignalSpy selectionOfferedSpy(dataDevice.data(), SIGNAL(selectionOffered(KWayland::Client::DataOffer*))); + QSignalSpy selectionOfferedSpy(dataDevice.data(), &KWayland::Client::DataDevice::selectionOffered); QVERIFY(selectionOfferedSpy.isValid()); deviceInterface->sendSelection(deviceInterface->selection()); QVERIFY(selectionOfferedSpy.wait()); QCOMPARE(selectionOfferedSpy.count(), 1); - auto dataOffer = selectionOfferedSpy.first().first().value(); + auto dataOffer = selectionOfferedSpy.first().first().value(); QVERIFY(dataOffer); QCOMPARE(dataOffer->offeredMimeTypes().count(), 1); QCOMPARE(dataOffer->offeredMimeTypes().first().name(), QStringLiteral("text/plain")); // sending a new mimetype to the selection, should be announced in the offer - QSignalSpy mimeTypeAddedSpy(dataOffer, SIGNAL(mimeTypeOffered(QString))); + QSignalSpy mimeTypeAddedSpy(dataOffer, &KWayland::Client::DataOffer::mimeTypeOffered); QVERIFY(mimeTypeAddedSpy.isValid()); dataSource->offer(QStringLiteral("text/html")); QVERIFY(mimeTypeAddedSpy.wait()); @@ -448,19 +432,17 @@ dataDevice->setSelection(2, dataSource.data()); QVERIFY(selectionChangedSpy.wait()); // now unbind the dataDevice - QSignalSpy unboundSpy(deviceInterface, &DataDeviceInterface::unbound); + QSignalSpy unboundSpy(deviceInterface, &QObject::destroyed); QVERIFY(unboundSpy.isValid()); dataDevice.reset(); QVERIFY(unboundSpy.wait()); - // send a selection to the unbound data device - deviceInterface->sendSelection(deviceInterface->selection()); } void TestDataDevice::testSendSelectionOnSeat() { // this test verifies that the selection is sent when setting a focused keyboard using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first add keyboard support to Seat QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged); QVERIFY(keyboardChangedSpy.isValid()); @@ -472,7 +454,7 @@ QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); QVERIFY(dataDeviceCreatedSpy.wait()); - auto serverDataDevice = dataDeviceCreatedSpy.first().first().value(); + auto serverDataDevice = dataDeviceCreatedSpy.first().first().value(); QVERIFY(serverDataDevice); QScopedPointer keyboard(m_seat->createKeyboard()); QVERIFY(keyboard->isValid()); @@ -482,7 +464,7 @@ QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); m_seatInterface->setFocusedKeyboardSurface(serverSurface); @@ -506,7 +488,7 @@ // now let's try to destroy the data device and set a focused keyboard just while the data device is being destroyedd m_seatInterface->setFocusedKeyboardSurface(nullptr); - QSignalSpy unboundSpy(serverDataDevice, &Resource::unbound); + QSignalSpy unboundSpy(serverDataDevice, &QObject::destroyed); QVERIFY(unboundSpy.isValid()); dataDevice.reset(); QVERIFY(unboundSpy.wait()); @@ -517,7 +499,7 @@ { // this test verifies that replacing a data source cancels the previous source using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first add keyboard support to Seat QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged); QVERIFY(keyboardChangedSpy.isValid()); @@ -529,7 +511,7 @@ QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); QVERIFY(dataDeviceCreatedSpy.wait()); - auto serverDataDevice = dataDeviceCreatedSpy.first().first().value(); + auto serverDataDevice = dataDeviceCreatedSpy.first().first().value(); QVERIFY(serverDataDevice); QScopedPointer keyboard(m_seat->createKeyboard()); QVERIFY(keyboard->isValid()); @@ -539,7 +521,7 @@ QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); m_seatInterface->setFocusedKeyboardSurface(serverSurface); @@ -590,32 +572,21 @@ dataSource3.reset(); dataDevice2->setSelection(1, dataSource4.data()); QVERIFY(selectionOfferedSpy.wait()); -} -void TestDataDevice::testDestroy() -{ - using namespace KWayland::Client; + auto dataOffer = selectionOfferedSpy.last()[0].value(); - QScopedPointer dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); - QVERIFY(dataDevice->isValid()); + // try to crash by destroying the data source, then requesting data + dataSource4.reset(); + int pipeFds[2] = {0, 0}; + QVERIFY(pipe(pipeFds) == 0); - connect(m_connection, &ConnectionThread::connectionDied, m_dataDeviceManager, &DataDeviceManager::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_seat, &Seat::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, dataDevice.data(), &DataDevice::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); + dataOffer->receive(QStringLiteral("text/plain"), pipeFds[1]); + close(pipeFds[1]); - // now the data device should be destroyed; - QVERIFY(!dataDevice->isValid()); + // spin the event loop, nothing should explode + QTest::qWait(10); - // calling destroy again should not fail - dataDevice->destroy(); + close(pipeFds[0]); } QTEST_GUILESS_MAIN(TestDataDevice) diff -Nru dwayland-5.57.0.23/autotests/client/test_datasource.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_datasource.cpp --- dwayland-5.57.0.23/autotests/client/test_datasource.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_datasource.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,34 +1,20 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt -#include #include +#include // KWayland +#include "../../src/server/datadevicemanager_interface.h" +#include "../../src/server/datasource_interface.h" +#include "../../src/server/display.h" #include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" #include "../../src/client/datadevicemanager.h" #include "../../src/client/datasource.h" +#include "../../src/client/event_queue.h" #include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/datadevicemanager_interface.h" -#include "../../src/server/datasource_interface.h" // Wayland #include @@ -43,14 +29,12 @@ void testTargetAccepts_data(); void testTargetAccepts(); void testRequestSend(); - void testRequestSendOnUnbound(); void testCancel(); void testServerGet(); - void testDestroy(); private: - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -61,16 +45,16 @@ void TestDataSource::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -86,7 +70,7 @@ QVERIFY(m_queue->isValid()); KWayland::Client::Registry registry; - QSignalSpy dataDeviceManagerSpy(®istry, SIGNAL(dataDeviceManagerAnnounced(quint32,quint32))); + QSignalSpy dataDeviceManagerSpy(®istry, &KWayland::Client::Registry::dataDeviceManagerAnnounced); QVERIFY(dataDeviceManagerSpy.isValid()); QVERIFY(!registry.eventQueue()); registry.setEventQueue(m_queue); @@ -95,13 +79,11 @@ QVERIFY(registry.isValid()); registry.setup(); - m_dataDeviceManagerInterface = m_display->createDataDeviceManager(m_display); - m_dataDeviceManagerInterface->create(); - QVERIFY(m_dataDeviceManagerInterface->isValid()); + m_dataDeviceManagerInterface = new DataDeviceManagerInterface(m_display, m_display); QVERIFY(dataDeviceManagerSpy.wait()); - m_dataDeviceManager = registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), - dataDeviceManagerSpy.first().last().value(), this); + m_dataDeviceManager = + registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), dataDeviceManagerSpy.first().last().value(), this); } void TestDataSource::cleanup() @@ -130,10 +112,10 @@ void TestDataSource::testOffer() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - qRegisterMetaType(); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + qRegisterMetaType(); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataSourceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); @@ -142,12 +124,11 @@ QVERIFY(dataSourceCreatedSpy.wait()); QCOMPARE(dataSourceCreatedSpy.count(), 1); - QPointer serverDataSource = dataSourceCreatedSpy.first().first().value(); + QPointer serverDataSource = dataSourceCreatedSpy.first().first().value(); QVERIFY(!serverDataSource.isNull()); QCOMPARE(serverDataSource->mimeTypes().count(), 0); - QVERIFY(serverDataSource->parentResource()); - QSignalSpy offeredSpy(serverDataSource.data(), SIGNAL(mimeTypeOffered(QString))); + QSignalSpy offeredSpy(serverDataSource.data(), &KWaylandServer::AbstractDataSource::mimeTypeOffered); QVERIFY(offeredSpy.isValid()); const QString plain = QStringLiteral("text/plain"); @@ -175,10 +156,6 @@ dataSource.reset(); QVERIFY(!serverDataSource.isNull()); wl_display_flush(m_connection->display()); - // after running the event loop the Wayland event should be delivered, but it uses delete later - QCoreApplication::processEvents(); - QVERIFY(!serverDataSource.isNull()); - // so once more event loop QCoreApplication::processEvents(); QVERIFY(serverDataSource.isNull()); } @@ -194,22 +171,22 @@ void TestDataSource::testTargetAccepts() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataSourceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); - QSignalSpy targetAcceptsSpy(dataSource.data(), SIGNAL(targetAccepts(QString))); + QSignalSpy targetAcceptsSpy(dataSource.data(), &KWayland::Client::DataSource::targetAccepts); QVERIFY(targetAcceptsSpy.isValid()); QVERIFY(dataSourceCreatedSpy.wait()); QCOMPARE(dataSourceCreatedSpy.count(), 1); QFETCH(QString, mimeType); - dataSourceCreatedSpy.first().first().value()->accept(mimeType); + dataSourceCreatedSpy.first().first().value()->accept(mimeType); QVERIFY(targetAcceptsSpy.wait()); QCOMPARE(targetAcceptsSpy.count(), 1); @@ -219,15 +196,14 @@ void TestDataSource::testRequestSend() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataSourceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); - - QSignalSpy sendRequestedSpy(dataSource.data(), SIGNAL(sendDataRequested(QString,qint32))); + QSignalSpy sendRequestedSpy(dataSource.data(), &KWayland::Client::DataSource::sendDataRequested); QVERIFY(sendRequestedSpy.isValid()); const QString plain = QStringLiteral("text/plain"); @@ -235,7 +211,7 @@ QCOMPARE(dataSourceCreatedSpy.count(), 1); QTemporaryFile file; QVERIFY(file.open()); - dataSourceCreatedSpy.first().first().value()->requestData(plain, file.handle()); + dataSourceCreatedSpy.first().first().value()->requestData(plain, file.handle()); QVERIFY(sendRequestedSpy.wait()); QCOMPARE(sendRequestedSpy.count(), 1); @@ -248,45 +224,23 @@ writeFile.close(); } -void TestDataSource::testRequestSendOnUnbound() -{ - // this test verifies that the server doesn't crash when requesting a send on an unbound DataSource - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &DataDeviceManagerInterface::dataSourceCreated); - QVERIFY(dataSourceCreatedSpy.isValid()); - - QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); - QVERIFY(dataSource->isValid()); - QVERIFY(dataSourceCreatedSpy.wait()); - QCOMPARE(dataSourceCreatedSpy.count(), 1); - auto sds = dataSourceCreatedSpy.first().first().value(); - QVERIFY(sds); - - QSignalSpy unboundSpy(sds, &Resource::unbound); - QVERIFY(unboundSpy.isValid()); - dataSource.reset(); - QVERIFY(unboundSpy.wait()); - sds->requestData(QStringLiteral("text/plain"), -1); -} - void TestDataSource::testCancel() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataSourceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); - QSignalSpy cancelledSpy(dataSource.data(), SIGNAL(cancelled())); + QSignalSpy cancelledSpy(dataSource.data(), &KWayland::Client::DataSource::cancelled); QVERIFY(cancelledSpy.isValid()); QVERIFY(dataSourceCreatedSpy.wait()); QCOMPARE(cancelledSpy.count(), 0); - dataSourceCreatedSpy.first().first().value()->cancel(); + dataSourceCreatedSpy.first().first().value()->cancel(); QVERIFY(cancelledSpy.wait()); QCOMPARE(cancelledSpy.count(), 1); @@ -295,9 +249,9 @@ void TestDataSource::testServerGet() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, SIGNAL(dataSourceCreated(KWayland::Server::DataSourceInterface*))); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); QVERIFY(dataSourceCreatedSpy.isValid()); QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); @@ -305,35 +259,11 @@ QVERIFY(!DataSourceInterface::get(nullptr)); QVERIFY(dataSourceCreatedSpy.wait()); - auto d = dataSourceCreatedSpy.first().first().value(); + auto d = dataSourceCreatedSpy.first().first().value(); QCOMPARE(DataSourceInterface::get(d->resource()), d); QVERIFY(!DataSourceInterface::get(nullptr)); } -void TestDataSource::testDestroy() -{ - using namespace KWayland::Client; - - QScopedPointer dataSource(m_dataDeviceManager->createDataSource()); - QVERIFY(dataSource->isValid()); - - connect(m_connection, &ConnectionThread::connectionDied, m_dataDeviceManager, &DataDeviceManager::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - connect(m_connection, &ConnectionThread::connectionDied, dataSource.data(), &DataSource::destroy); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the pool should be destroyed; - QVERIFY(!dataSource->isValid()); - - // calling destroy again should not fail - dataSource->destroy(); -} - QTEST_GUILESS_MAIN(TestDataSource) #include "test_datasource.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_drag_drop.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_drag_drop.cpp --- dwayland-5.57.0.23/autotests/client/test_drag_drop.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_drag_drop.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,25 +1,17 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/datadevicemanager_interface.h" +#include "../../src/server/datasource_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/seat_interface_p.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/datadevice.h" @@ -27,18 +19,11 @@ #include "../../src/client/datasource.h" #include "../../src/client/event_queue.h" #include "../../src/client/pointer.h" -#include "../../src/client/touch.h" #include "../../src/client/registry.h" #include "../../src/client/seat.h" -#include "../../src/client/shell.h" #include "../../src/client/shm_pool.h" #include "../../src/client/surface.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/datadevicemanager_interface.h" -#include "../../src/server/datasource_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/shell_interface.h" +#include "../../src/client/touch.h" class TestDragAndDrop : public QObject { @@ -55,13 +40,12 @@ private: KWayland::Client::Surface *createSurface(); - KWayland::Server::SurfaceInterface *getServerSurface(); + KWaylandServer::SurfaceInterface *getServerSurface(); - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::CompositorInterface *m_compositorInterface = nullptr; - KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; - KWayland::Server::SeatInterface *m_seatInterface = nullptr; - KWayland::Server::ShellInterface *m_shellInterface = nullptr; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; + KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWaylandServer::SeatInterface *m_seatInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -74,18 +58,17 @@ KWayland::Client::Touch *m_touch = nullptr; KWayland::Client::DataDeviceManager *m_ddm = nullptr; KWayland::Client::ShmPool *m_shm = nullptr; - KWayland::Client::Shell *m_shell = nullptr; }; static const QString s_socketName = QStringLiteral("kwayland-test-wayland-drag-n-drop-0"); void TestDragAndDrop::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -95,20 +78,12 @@ QVERIFY(connectedSpy.isValid()); m_connection->setSocketName(s_socketName); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - m_seatInterface = m_display->createSeat(m_display); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_seatInterface = new SeatInterface(m_display, m_display); m_seatInterface->setHasPointer(true); m_seatInterface->setHasTouch(true); - m_seatInterface->create(); - QVERIFY(m_seatInterface->isValid()); - m_dataDeviceManagerInterface = m_display->createDataDeviceManager(m_display); - m_dataDeviceManagerInterface->create(); - QVERIFY(m_dataDeviceManagerInterface->isValid()); + m_dataDeviceManagerInterface = new DataDeviceManagerInterface(m_display, m_display); m_display->createShm(); - m_shellInterface = m_display->createShell(m_display); - m_shellInterface->create(); m_thread = new QThread(this); m_connection->moveToThread(m_thread); @@ -134,15 +109,15 @@ m_registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); -#define CREATE(variable, factory, iface) \ - variable = m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ +#define CREATE(variable, factory, iface) \ + variable = \ + m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ QVERIFY(variable); CREATE(m_compositor, Compositor, Compositor) CREATE(m_seat, Seat, Seat) CREATE(m_ddm, DataDeviceManager, DataDeviceManager) CREATE(m_shm, ShmPool, Shm) - CREATE(m_shell, Shell, Shell) #undef CREATE @@ -162,14 +137,13 @@ void TestDragAndDrop::cleanup() { -#define DELETE(name) \ - if (name) { \ - delete name; \ - name = nullptr; \ +#define DELETE(name) \ + if (name) { \ + delete name; \ + name = nullptr; \ } DELETE(m_dataSource) DELETE(m_dataDevice) - DELETE(m_shell) DELETE(m_shm) DELETE(m_compositor) DELETE(m_ddm) @@ -203,9 +177,9 @@ return s; } -KWayland::Server::SurfaceInterface *TestDragAndDrop::getServerSurface() +KWaylandServer::SurfaceInterface *TestDragAndDrop::getServerSurface() { - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); if (!surfaceCreatedSpy.isValid()) { return nullptr; @@ -213,13 +187,13 @@ if (!surfaceCreatedSpy.wait(500)) { return nullptr; } - return surfaceCreatedSpy.first().first().value(); + return surfaceCreatedSpy.first().first().value(); } void TestDragAndDrop::testPointerDragAndDrop() { // this test verifies the very basic drag and drop on one surface, an enter, a move and the drop - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; // first create a window QScopedPointer s(createSurface()); @@ -234,7 +208,8 @@ QVERIFY(buttonPressSpy.isValid()); m_seatInterface->setFocusedPointerSurface(serverSurface); m_seatInterface->setTimestamp(2); - m_seatInterface->pointerButtonPressed(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonPressSpy.wait()); QCOMPARE(buttonPressSpy.first().at(1).value(), quint32(2)); @@ -256,8 +231,8 @@ QVERIFY(dragStartedSpy.wait()); QCOMPARE(m_seatInterface->dragSurface(), serverSurface); QCOMPARE(m_seatInterface->dragSurfaceTransformation(), QMatrix4x4()); - QVERIFY(!m_seatInterface->dragSource()->icon()); - QCOMPARE(m_seatInterface->dragSource()->dragImplicitGrabSerial(), buttonPressSpy.first().first().value()); + QVERIFY(!m_seatInterface->dragIcon()); + QCOMPARE(SeatInterfacePrivate::get(m_seatInterface)->drag.dragImplicitGrabSerial, buttonPressSpy.first().first().value()); QVERIFY(dragEnteredSpy.wait()); QCOMPARE(dragEnteredSpy.count(), 1); QCOMPARE(dragEnteredSpy.first().first().value(), m_display->serial()); @@ -271,6 +246,7 @@ QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1); QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain")); QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move); + offer->accept(QStringLiteral("text/plain"), dragEnteredSpy.last().at(0).toUInt()); offer->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move, DataDeviceManager::DnDAction::Move); QVERIFY(offerActionChangedSpy.wait()); QCOMPARE(offerActionChangedSpy.count(), 1); @@ -280,7 +256,8 @@ // simulate motion m_seatInterface->setTimestamp(3); - m_seatInterface->setPointerPos(QPointF(3, 3)); + m_seatInterface->notifyPointerMotion(QPointF(3, 3)); + m_seatInterface->notifyPointerFrame(); QVERIFY(dragMotionSpy.wait()); QCOMPARE(dragMotionSpy.count(), 1); QCOMPARE(dragMotionSpy.first().first().toPointF(), QPointF(3, 3)); @@ -292,7 +269,8 @@ QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped); QVERIFY(droppedSpy.isValid()); m_seatInterface->setTimestamp(4); - m_seatInterface->pointerButtonReleased(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); QVERIFY(sourceDropSpy.isEmpty()); QVERIFY(droppedSpy.wait()); QCOMPARE(sourceDropSpy.count(), 1); @@ -312,11 +290,11 @@ void TestDragAndDrop::testTouchDragAndDrop() { // this test verifies the very basic drag and drop on one surface, an enter, a move and the drop - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; // first create a window QScopedPointer s(createSurface()); - s->setSize(QSize(100,100)); + s->setSize(QSize(100, 100)); auto serverSurface = getServerSurface(); QVERIFY(serverSurface); @@ -330,10 +308,11 @@ QVERIFY(pointAddedSpy.isValid()); m_seatInterface->setFocusedTouchSurface(serverSurface); m_seatInterface->setTimestamp(2); - const qint32 touchId = m_seatInterface->touchDown(QPointF(50,50)); + const qint32 touchId = 0; + m_seatInterface->notifyTouchDown(touchId, QPointF(50, 50)); QVERIFY(sequenceStartedSpy.wait()); - QScopedPointer tp(sequenceStartedSpy.first().at(0).value()); + QScopedPointer tp(sequenceStartedSpy.first().at(0).value()); QVERIFY(!tp.isNull()); QCOMPARE(tp->time(), quint32(2)); @@ -355,12 +334,12 @@ QVERIFY(dragStartedSpy.wait()); QCOMPARE(m_seatInterface->dragSurface(), serverSurface); QCOMPARE(m_seatInterface->dragSurfaceTransformation(), QMatrix4x4()); - QVERIFY(!m_seatInterface->dragSource()->icon()); - QCOMPARE(m_seatInterface->dragSource()->dragImplicitGrabSerial(), tp->downSerial()); + QVERIFY(!m_seatInterface->dragIcon()); + QCOMPARE(SeatInterfacePrivate::get(m_seatInterface)->drag.dragImplicitGrabSerial, tp->downSerial()); QVERIFY(dragEnteredSpy.wait()); QCOMPARE(dragEnteredSpy.count(), 1); QCOMPARE(dragEnteredSpy.first().first().value(), m_display->serial()); - QCOMPARE(dragEnteredSpy.first().last().toPointF(), QPointF(0, 0)); + QCOMPARE(dragEnteredSpy.first().last().toPointF(), QPointF(50.0, 50.0)); QCOMPARE(m_dataDevice->dragSurface().data(), s.data()); auto offer = m_dataDevice->dragOffer(); QVERIFY(offer); @@ -370,6 +349,7 @@ QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1); QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain")); QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move); + offer->accept(QStringLiteral("text/plain"), dragEnteredSpy.last().at(0).toUInt()); offer->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move, DataDeviceManager::DnDAction::Move); QVERIFY(offerActionChangedSpy.wait()); QCOMPARE(offerActionChangedSpy.count(), 1); @@ -379,7 +359,7 @@ // simulate motion m_seatInterface->setTimestamp(3); - m_seatInterface->touchMove(touchId, QPointF(75, 75)); + m_seatInterface->notifyTouchMotion(touchId, QPointF(75, 75)); QVERIFY(dragMotionSpy.wait()); QCOMPARE(dragMotionSpy.count(), 1); QCOMPARE(dragMotionSpy.first().first().toPointF(), QPointF(75, 75)); @@ -391,7 +371,7 @@ QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped); QVERIFY(droppedSpy.isValid()); m_seatInterface->setTimestamp(4); - m_seatInterface->touchUp(touchId); + m_seatInterface->notifyTouchUp(touchId); QVERIFY(sourceDropSpy.isEmpty()); QVERIFY(droppedSpy.wait()); QCOMPARE(sourceDropSpy.count(), 1); @@ -408,11 +388,10 @@ QCOMPARE(pointAddedSpy.count(), 0); } - void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource() { // this test simulates the problem from BUG 389221 - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; // first create a window QScopedPointer s(createSurface()); @@ -427,7 +406,8 @@ QVERIFY(buttonPressSpy.isValid()); m_seatInterface->setFocusedPointerSurface(serverSurface); m_seatInterface->setTimestamp(2); - m_seatInterface->pointerButtonPressed(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonPressSpy.wait()); QCOMPARE(buttonPressSpy.first().at(1).value(), quint32(2)); @@ -449,8 +429,8 @@ QVERIFY(dragStartedSpy.wait()); QCOMPARE(m_seatInterface->dragSurface(), serverSurface); QCOMPARE(m_seatInterface->dragSurfaceTransformation(), QMatrix4x4()); - QVERIFY(!m_seatInterface->dragSource()->icon()); - QCOMPARE(m_seatInterface->dragSource()->dragImplicitGrabSerial(), buttonPressSpy.first().first().value()); + QVERIFY(!m_seatInterface->dragIcon()); + QCOMPARE(SeatInterfacePrivate::get(m_seatInterface)->drag.dragImplicitGrabSerial, buttonPressSpy.first().first().value()); QVERIFY(dragEnteredSpy.wait()); QCOMPARE(dragEnteredSpy.count(), 1); QCOMPARE(dragEnteredSpy.first().first().value(), m_display->serial()); @@ -464,6 +444,7 @@ QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1); QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain")); QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move); + offer->accept(QStringLiteral("text/plain"), dragEnteredSpy.last().at(0).toUInt()); offer->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move, DataDeviceManager::DnDAction::Move); QVERIFY(offerActionChangedSpy.wait()); QCOMPARE(offerActionChangedSpy.count(), 1); @@ -473,7 +454,8 @@ // simulate motion m_seatInterface->setTimestamp(3); - m_seatInterface->setPointerPos(QPointF(3, 3)); + m_seatInterface->notifyPointerMotion(QPointF(3, 3)); + m_seatInterface->notifyPointerFrame(); QVERIFY(dragMotionSpy.wait()); QCOMPARE(dragMotionSpy.count(), 1); QCOMPARE(dragMotionSpy.first().first().toPointF(), QPointF(3, 3)); @@ -493,7 +475,8 @@ QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped); QVERIFY(droppedSpy.isValid()); m_seatInterface->setTimestamp(4); - m_seatInterface->pointerButtonReleased(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); QVERIFY(!droppedSpy.wait(500)); // verify that we did not get any further input events @@ -504,7 +487,7 @@ void TestDragAndDrop::testPointerEventsIgnored() { // this test verifies that all pointer events are ignored on the focused Pointer device during drag - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; // first create a window QScopedPointer s(createSurface()); @@ -531,9 +514,10 @@ // first simulate a few things quint32 timestamp = 1; m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(10, 10)); + m_seatInterface->notifyPointerMotion(QPointF(10, 10)); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerAxis(Qt::Vertical, 5); + m_seatInterface->notifyPointerAxis(Qt::Vertical, 5, 1, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); // verify that we have those QVERIFY(axisSpy.wait()); QCOMPARE(axisSpy.count(), 1); @@ -544,7 +528,8 @@ // let's start the drag m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonPressed(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonSpy.wait()); QCOMPARE(buttonSpy.count(), 1); m_dataDevice->startDrag(buttonSpy.first().first().value(), m_dataSource, s.data()); @@ -552,26 +537,34 @@ // now simulate all the possible pointer interactions m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonPressed(2); + m_seatInterface->notifyPointerButton(2, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonReleased(2); + m_seatInterface->notifyPointerButton(2, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerAxis(Qt::Vertical, 5); + m_seatInterface->notifyPointerAxis(Qt::Vertical, 5, 1, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerAxis(Qt::Horizontal, 5); + m_seatInterface->notifyPointerAxis(Qt::Vertical, 5, 1, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); m_seatInterface->setFocusedPointerSurface(nullptr); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); m_seatInterface->setFocusedPointerSurface(serverSurface); + m_seatInterface->notifyPointerFrame(); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(50, 50)); + m_seatInterface->notifyPointerMotion(QPointF(50, 50)); + m_seatInterface->notifyPointerFrame(); // last but not least, simulate the drop - QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped); - QVERIFY(droppedSpy.isValid()); + QSignalSpy cancelledSpy(m_dataSource, &DataSource::cancelled); + QVERIFY(cancelledSpy.isValid()); m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonReleased(1); - QVERIFY(droppedSpy.wait()); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); + QVERIFY(cancelledSpy.wait()); // all the changes should have been ignored QCOMPARE(axisSpy.count(), 1); diff -Nru dwayland-5.57.0.23/autotests/client/test_error.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_error.cpp --- dwayland-5.57.0.23/autotests/client/test_error.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_error.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client @@ -25,20 +11,18 @@ #include "../../src/client/event_queue.h" #include "../../src/client/plasmashell.h" #include "../../src/client/registry.h" -#include "../../src/client/shell.h" #include "../../src/client/surface.h" // server -#include "../../src/server/display.h" #include "../../src/server/compositor_interface.h" -#include "../../src/server/shell_interface.h" +#include "../../src/server/display.h" #include "../../src/server/plasmashell_interface.h" #include -#include // For EPROTO +#include // For EPROTO using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; class ErrorTest : public QObject { @@ -47,21 +31,16 @@ void init(); void cleanup(); - void testMultipleShellSurfacesForSurface(); void testMultiplePlasmaShellSurfacesForSurface(); - void testTransientForSameSurface_data(); - void testTransientForSameSurface(); private: Display *m_display = nullptr; CompositorInterface *m_ci = nullptr; - ShellInterface *m_si = nullptr; PlasmaShellInterface *m_psi = nullptr; ConnectionThread *m_connection = nullptr; QThread *m_thread = nullptr; EventQueue *m_queue = nullptr; Compositor *m_compositor = nullptr; - Shell *m_shell = nullptr; PlasmaShell *m_plasmaShell = nullptr; }; @@ -71,16 +50,12 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_ci = m_display->createCompositor(m_display); - m_ci->create(); - m_si = m_display->createShell(m_display); - m_si->create(); - m_psi = m_display->createPlasmaShell(m_display); - m_psi->create(); + m_ci = new CompositorInterface(m_display, m_display); + m_psi = new PlasmaShellInterface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -107,14 +82,9 @@ registry.setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - m_compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version, - this); + m_compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); QVERIFY(m_compositor); - m_shell = registry.createShell(registry.interface(Registry::Interface::Shell).name, - registry.interface(Registry::Interface::Shell).version, - this); - QVERIFY(m_shell); m_plasmaShell = registry.createPlasmaShell(registry.interface(Registry::Interface::PlasmaShell).name, registry.interface(Registry::Interface::PlasmaShell).version, this); @@ -123,13 +93,12 @@ void ErrorTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_plasmaShell) - CLEANUP(m_shell) CLEANUP(m_compositor) CLEANUP(m_queue) if (m_connection) { @@ -142,24 +111,11 @@ delete m_thread; m_thread = nullptr; } - CLEANUP(m_psi) - CLEANUP(m_si) - CLEANUP(m_ci) CLEANUP(m_display) #undef CLEANUP -} - -void ErrorTest::testMultipleShellSurfacesForSurface() -{ - // this test verifies that creating two ShellSurfaces for the same Surface triggers a protocol error - QSignalSpy errorSpy(m_connection, &ConnectionThread::errorOccurred); - QVERIFY(errorSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer shellSurface1(m_shell->createSurface(surface.data())); - QScopedPointer shellSurface2(m_shell->createSurface(surface.data())); - QVERIFY(errorSpy.wait()); - QVERIFY(m_connection->hasError()); - QCOMPARE(m_connection->errorCode(), EPROTO); + // these are the children of the display + m_psi = nullptr; + m_ci = nullptr; } void ErrorTest::testMultiplePlasmaShellSurfacesForSurface() @@ -179,27 +135,5 @@ wl_surface_destroy(surface); } -void ErrorTest::testTransientForSameSurface_data() -{ - QTest::addColumn("flag"); - - QTest::newRow("transient") << ShellSurface::TransientFlag::Default; - QTest::newRow("transient no focus") << ShellSurface::TransientFlag::NoFocus; -} - -void ErrorTest::testTransientForSameSurface() -{ - // this test verifies that creating a transient shell surface for itself triggers a protocol error - QSignalSpy errorSpy(m_connection, &ConnectionThread::errorOccurred); - QVERIFY(errorSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer shellSurface(m_shell->createSurface(surface.data())); - QFETCH(ShellSurface::TransientFlag, flag); - shellSurface->setTransient(surface.data(), QPoint(), flag); - QVERIFY(errorSpy.wait()); - QVERIFY(m_connection->hasError()); - QCOMPARE(m_connection->errorCode(), EPROTO); -} - QTEST_GUILESS_MAIN(ErrorTest) #include "test_error.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_fake_input.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_fake_input.cpp --- dwayland-5.57.0.23/autotests/client/test_fake_input.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_fake_input.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client @@ -31,7 +17,7 @@ #include using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; Q_DECLARE_METATYPE(Qt::MouseButton) @@ -52,6 +38,8 @@ void testAxis_data(); void testAxis(); void testTouch(); + void testKeyboardKeyLinux_data(); + void testKeyboardKeyLinux(); private: Display *m_display = nullptr; @@ -69,12 +57,11 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_fakeInputInterface = m_display->createFakeInput(); - m_fakeInputInterface->create(); + m_fakeInputInterface = new FakeInputInterface(m_display); QSignalSpy deviceCreatedSpy(m_fakeInputInterface, &FakeInputInterface::deviceCreated); QVERIFY(deviceCreatedSpy.isValid()); @@ -103,22 +90,21 @@ registry.setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - m_fakeInput = registry.createFakeInput(registry.interface(Registry::Interface::FakeInput).name, - registry.interface(Registry::Interface::FakeInput).version, - this); + m_fakeInput = + registry.createFakeInput(registry.interface(Registry::Interface::FakeInput).name, registry.interface(Registry::Interface::FakeInput).version, this); QVERIFY(m_fakeInput->isValid()); QVERIFY(deviceCreatedSpy.wait()); - m_device = deviceCreatedSpy.first().first().value(); + m_device = deviceCreatedSpy.first().first().value(); QVERIFY(m_device); } void FakeInputTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_fakeInput) CLEANUP(m_queue) @@ -134,9 +120,11 @@ } CLEANUP(m_device) - CLEANUP(m_fakeInputInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_fakeInputInterface = nullptr; } void FakeInputTest::testAuthenticate() @@ -314,9 +302,9 @@ QTest::addColumn("orientation"); QTest::addColumn("delta"); - QTest::newRow("horizontal/1") << Qt::Horizontal << 1.0; + QTest::newRow("horizontal/1") << Qt::Horizontal << 1.0; QTest::newRow("horizontal/-2") << Qt::Horizontal << -2.0; - QTest::newRow("vertical/10") << Qt::Vertical << 10.0; + QTest::newRow("vertical/10") << Qt::Vertical << 10.0; QTest::newRow("vertical/-20") << Qt::Vertical << -22.0; } @@ -386,7 +374,7 @@ QCOMPARE(touchDownSpy.last().at(1).toPointF(), QPointF(1, 2)); // Same id should not trigger another touchDown. - m_fakeInput->requestTouchDown(0, QPointF(5,6)); + m_fakeInput->requestTouchDown(0, QPointF(5, 6)); QVERIFY(!touchDownSpy.wait(100)); m_fakeInput->requestTouchMotion(0, QPointF(3, 4)); @@ -423,6 +411,57 @@ QCOMPARE(touchCancelSpy.count(), 1); } +void FakeInputTest::testKeyboardKeyLinux_data() +{ + QTest::addColumn("linuxKey"); + + QTest::newRow("A") << quint32(KEY_A); + QTest::newRow("S") << quint32(KEY_S); + QTest::newRow("D") << quint32(KEY_D); + QTest::newRow("F") << quint32(KEY_F); +} + +void FakeInputTest::testKeyboardKeyLinux() +{ + // this test verifies that keyboard key events are properly passed to the server with Qt button codes + QVERIFY(!m_device->isAuthenticated()); + QSignalSpy pressedSpy(m_device, &FakeInputDevice::keyboardKeyPressRequested); + QVERIFY(pressedSpy.isValid()); + QSignalSpy releasedSpy(m_device, &FakeInputDevice::keyboardKeyReleaseRequested); + QVERIFY(releasedSpy.isValid()); + + // without an authentication we shouldn't get the signals + QFETCH(quint32, linuxKey); + m_fakeInput->requestKeyboardKeyPress(linuxKey); + m_fakeInput->requestKeyboardKeyRelease(linuxKey); + QVERIFY(!pressedSpy.wait(100)); + QVERIFY(pressedSpy.isEmpty()); + QVERIFY(releasedSpy.isEmpty()); + + // now authenticate + m_device->setAuthentication(true); + // now our click should work + m_fakeInput->requestKeyboardKeyPress(linuxKey); + m_fakeInput->requestKeyboardKeyRelease(linuxKey); + QVERIFY(releasedSpy.wait()); + QCOMPARE(pressedSpy.count(), 1); + QCOMPARE(releasedSpy.count(), 1); + QTEST(pressedSpy.last().first().value(), "linuxKey"); + QTEST(releasedSpy.last().first().value(), "linuxKey"); + + // and a press/release "manually" + m_fakeInput->requestKeyboardKeyPress(linuxKey); + QVERIFY(pressedSpy.wait()); + QCOMPARE(pressedSpy.count(), 2); + QCOMPARE(releasedSpy.count(), 1); + QTEST(pressedSpy.last().first().value(), "linuxKey"); + // and release + m_fakeInput->requestKeyboardKeyRelease(linuxKey); + QVERIFY(releasedSpy.wait()); + QCOMPARE(pressedSpy.count(), 2); + QCOMPARE(releasedSpy.count(), 2); + QTEST(releasedSpy.last().first().value(), "linuxKey"); +} QTEST_GUILESS_MAIN(FakeInputTest) #include "test_fake_input.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_idle.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_idle.cpp --- dwayland-5.57.0.23/autotests/client/test_idle.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_idle.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client @@ -31,7 +17,7 @@ #include "../../src/server/seat_interface.h" using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; class IdleTest : public QObject { @@ -63,15 +49,13 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_seatInterface = m_display->createSeat(); + m_seatInterface = new SeatInterface(m_display); m_seatInterface->setName(QStringLiteral("seat0")); - m_seatInterface->create(); - m_idleInterface = m_display->createIdle(); - m_idleInterface->create(); + m_idleInterface = new IdleInterface(m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -98,22 +82,18 @@ registry.setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - m_seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, - registry.interface(Registry::Interface::Seat).version, - this); + m_seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, registry.interface(Registry::Interface::Seat).version, this); QVERIFY(m_seat->isValid()); - m_idle = registry.createIdle(registry.interface(Registry::Interface::Idle).name, - registry.interface(Registry::Interface::Idle).version, - this); + m_idle = registry.createIdle(registry.interface(Registry::Interface::Idle).name, registry.interface(Registry::Interface::Idle).version, this); QVERIFY(m_idle->isValid()); } void IdleTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_idle) CLEANUP(m_seat) @@ -129,10 +109,12 @@ m_thread = nullptr; } - CLEANUP(m_idleInterface) - CLEANUP(m_seatInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_idleInterface = nullptr; + m_seatInterface = nullptr; } void IdleTest::testTimeout() @@ -153,7 +135,7 @@ // simulate some activity QVERIFY(resumedFormIdleSpy.isEmpty()); - m_seatInterface->setTimestamp(1); + m_idleInterface->simulateUserActivity(); QVERIFY(resumedFormIdleSpy.wait()); timeout.reset(); diff -Nru dwayland-5.57.0.23/autotests/client/test_plasma_activities.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_activities.cpp --- dwayland-5.57.0.23/autotests/client/test_plasma_activities.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_activities.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,199 @@ +/* + SPDX-FileCopyrightText: 2021 Kevin Ottens + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +// Qt +#include +// KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/plasmawindowmanagement_interface.h" +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/plasmawindowmanagement.h" +#include "../../src/client/region.h" +#include "../../src/client/registry.h" +#include "../../src/client/surface.h" + +using namespace KWayland::Client; + +class TestActivities : public QObject +{ + Q_OBJECT +public: + explicit TestActivities(QObject *parent = nullptr); +private Q_SLOTS: + void init(); + void cleanup(); + + void testEnterLeaveActivity(); + +private: + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWaylandServer::PlasmaWindowInterface *m_windowInterface; + + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::Compositor *m_compositor; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::PlasmaWindowManagement *m_windowManagement; + KWayland::Client::PlasmaWindow *m_window; + + QThread *m_thread; +}; + +static const QString s_socketName = QStringLiteral("kwayland-test-wayland-activities-0"); + +TestActivities::TestActivities(QObject *parent) + : QObject(parent) + , m_display(nullptr) + , m_compositorInterface(nullptr) + , m_connection(nullptr) + , m_compositor(nullptr) + , m_queue(nullptr) + , m_thread(nullptr) +{ +} + +void TestActivities::init() +{ + using namespace KWaylandServer; + delete m_display; + m_display = new Display(this); + m_display->addSocketName(s_socketName); + m_display->start(); + QVERIFY(m_display->isRunning()); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); + QVERIFY(connectedSpy.isValid()); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + Registry registry; + QSignalSpy compositorSpy(®istry, &Registry::compositorAnnounced); + QVERIFY(compositorSpy.isValid()); + + QSignalSpy windowManagementSpy(®istry, &Registry::plasmaWindowManagementAnnounced); + QVERIFY(windowManagementSpy.isValid()); + + QVERIFY(!registry.eventQueue()); + registry.setEventQueue(m_queue); + QCOMPARE(registry.eventQueue(), m_queue); + registry.create(m_connection->display()); + QVERIFY(registry.isValid()); + registry.setup(); + + m_compositorInterface = new CompositorInterface(m_display, m_display); + QVERIFY(compositorSpy.wait()); + m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + + m_windowManagementInterface = new PlasmaWindowManagementInterface(m_display, m_display); + + QVERIFY(windowManagementSpy.wait()); + m_windowManagement = + registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value(), windowManagementSpy.first().last().value(), this); + + QSignalSpy windowSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated); + QVERIFY(windowSpy.isValid()); + m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid()); + m_windowInterface->setPid(1337); + + QVERIFY(windowSpy.wait()); + m_window = windowSpy.first().first().value(); +} + +void TestActivities::cleanup() +{ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ + } + CLEANUP(m_compositor) + CLEANUP(m_windowInterface) + CLEANUP(m_windowManagement) + CLEANUP(m_queue) + if (m_connection) { + m_connection->deleteLater(); + m_connection = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + CLEANUP(m_compositorInterface) + CLEANUP(m_windowManagementInterface) + CLEANUP(m_display) +#undef CLEANUP +} + +void TestActivities::testEnterLeaveActivity() +{ + QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaActivityRequested); + m_window->requestEnterActivity(QStringLiteral("0-1")); + enterRequestedSpy.wait(); + + QCOMPARE(enterRequestedSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); + + QSignalSpy activityEnteredSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaActivityEntered); + + // agree to the request + m_windowInterface->addPlasmaActivity(QStringLiteral("0-1")); + QCOMPARE(m_windowInterface->plasmaActivities().length(), 1); + QCOMPARE(m_windowInterface->plasmaActivities().first(), QStringLiteral("0-1")); + + // check if the client received the enter + activityEnteredSpy.wait(); + QCOMPARE(activityEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); + QCOMPARE(m_window->plasmaActivities().length(), 1); + QCOMPARE(m_window->plasmaActivities().first(), QStringLiteral("0-1")); + + // add another activity, server side + m_windowInterface->addPlasmaActivity(QStringLiteral("0-3")); + activityEnteredSpy.wait(); + QCOMPARE(activityEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-3")); + QCOMPARE(m_windowInterface->plasmaActivities().length(), 2); + QCOMPARE(m_window->plasmaActivities().length(), 2); + QCOMPARE(m_window->plasmaActivities()[1], QStringLiteral("0-3")); + + // remove an activity + QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaActivityRequested); + m_window->requestLeaveActivity(QStringLiteral("0-1")); + leaveRequestedSpy.wait(); + + QCOMPARE(leaveRequestedSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); + + QSignalSpy activityLeftSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaActivityLeft); + + // agree to the request + m_windowInterface->removePlasmaActivity(QStringLiteral("0-1")); + QCOMPARE(m_windowInterface->plasmaActivities().length(), 1); + QCOMPARE(m_windowInterface->plasmaActivities().first(), QStringLiteral("0-3")); + + // check if the client received the leave + activityLeftSpy.wait(); + QCOMPARE(activityLeftSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); + QCOMPARE(m_window->plasmaActivities().length(), 1); + QCOMPARE(m_window->plasmaActivities().first(), QStringLiteral("0-3")); +} + +QTEST_GUILESS_MAIN(TestActivities) +#include "test_plasma_activities.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_plasmashell.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasmashell.cpp --- dwayland-5.57.0.23/autotests/client/test_plasmashell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasmashell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,39 +1,23 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWayland -#include "../../src/client/connection_thread.h" +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/plasmashell_interface.h" #include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" +#include "../../src/client/plasmashell.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/plasmashell.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/plasmashell_interface.h" - using namespace KWayland::Client; -using namespace KWayland::Server; - +using namespace KWaylandServer; class TestPlasmaShell : public QObject { @@ -42,7 +26,6 @@ void init(); void cleanup(); - void testRole_data(); void testRole(); void testPosition(); @@ -74,16 +57,14 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); + m_compositorInterface = new CompositorInterface(m_display, m_display); m_display->createShm(); - m_plasmaShellInterface = m_display->createPlasmaShell(m_display); - m_plasmaShellInterface->create(); + m_plasmaShellInterface = new PlasmaShellInterface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -115,23 +96,23 @@ m_registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); -#define CREATE(variable, factory, iface) \ - variable = m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ +#define CREATE(variable, factory, iface) \ + variable = \ + m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ QVERIFY(variable); CREATE(m_compositor, Compositor, Compositor) CREATE(m_plasmaShell, PlasmaShell, PlasmaShell) #undef CREATE - } void TestPlasmaShell::cleanup() { -#define DELETE(name) \ - if (name) { \ - delete name; \ - name = nullptr; \ +#define DELETE(name) \ + if (name) { \ + delete name; \ + name = nullptr; \ } DELETE(m_plasmaShell) DELETE(m_compositor) @@ -154,13 +135,14 @@ void TestPlasmaShell::testRole_data() { QTest::addColumn("clientRole"); - QTest::addColumn("serverRole"); + QTest::addColumn("serverRole"); QTest::newRow("desktop") << PlasmaShellSurface::Role::Desktop << PlasmaShellSurfaceInterface::Role::Desktop; QTest::newRow("osd") << PlasmaShellSurface::Role::OnScreenDisplay << PlasmaShellSurfaceInterface::Role::OnScreenDisplay; QTest::newRow("panel") << PlasmaShellSurface::Role::Panel << PlasmaShellSurfaceInterface::Role::Panel; QTest::newRow("notification") << PlasmaShellSurface::Role::Notification << PlasmaShellSurfaceInterface::Role::Notification; QTest::newRow("tooltip") << PlasmaShellSurface::Role::ToolTip << PlasmaShellSurfaceInterface::Role::ToolTip; + QTest::newRow("criticalnotification") << PlasmaShellSurface::Role::CriticalNotification << PlasmaShellSurfaceInterface::Role::CriticalNotification; } void TestPlasmaShell::testRole() @@ -191,13 +173,10 @@ QCOMPARE(surfaceCreatedSpy.count(), 1); // verify that we got a plasma shell surface - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QVERIFY(sps->surface()); - QCOMPARE(sps->surface(), surfaceCreatedSpy.first().first().value()); - QCOMPARE(sps->shell(), m_plasmaShellInterface); - QCOMPARE(PlasmaShellSurfaceInterface::get(sps->resource()), sps); - QVERIFY(!PlasmaShellSurfaceInterface::get(nullptr)); + QCOMPARE(sps->surface(), surfaceCreatedSpy.first().first().value()); // default role should be normal QCOMPARE(sps->role(), PlasmaShellSurfaceInterface::Role::Normal); @@ -236,7 +215,7 @@ QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); // verify that we got a plasma shell surface - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QVERIFY(sps->surface()); @@ -275,7 +254,7 @@ QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); // verify that we got a plasma shell surface - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QVERIFY(sps->surface()); QVERIFY(!sps->skipTaskbar()); @@ -310,7 +289,7 @@ QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); // verify that we got a plasma shell surface - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QVERIFY(sps->surface()); QVERIFY(!sps->skipSwitcher()); @@ -356,7 +335,7 @@ QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); // verify that we got a plasma shell surface - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QVERIFY(sps->surface()); QCOMPARE(sps->panelBehavior(), PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible); @@ -391,7 +370,7 @@ ps->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AutoHide); QVERIFY(plasmaSurfaceCreatedSpy.wait()); QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); QCOMPARE(sps->panelBehavior(), PlasmaShellSurfaceInterface::PanelBehavior::AutoHide); @@ -437,23 +416,30 @@ { // this test verifies that whether a panel wants to take focus is passed through correctly QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated); + QVERIFY(plasmaSurfaceCreatedSpy.isValid()); QScopedPointer s(m_compositor->createSurface()); QScopedPointer ps(m_plasmaShell->createSurface(s.data())); ps->setRole(PlasmaShellSurface::Role::Panel); QVERIFY(plasmaSurfaceCreatedSpy.wait()); QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + QSignalSpy plasmaSurfaceTakesFocusSpy(sps, &PlasmaShellSurfaceInterface::panelTakesFocusChanged); + QVERIFY(sps); QCOMPARE(sps->role(), PlasmaShellSurfaceInterface::Role::Panel); QCOMPARE(sps->panelTakesFocus(), false); ps->setPanelTakesFocus(true); m_connection->flush(); - QTRY_COMPARE(sps->panelTakesFocus(), true); + QVERIFY(plasmaSurfaceTakesFocusSpy.wait()); + QCOMPARE(plasmaSurfaceTakesFocusSpy.count(), 1); + QCOMPARE(sps->panelTakesFocus(), true); ps->setPanelTakesFocus(false); m_connection->flush(); - QTRY_COMPARE(sps->panelTakesFocus(), false); + QVERIFY(plasmaSurfaceTakesFocusSpy.wait()); + QCOMPARE(plasmaSurfaceTakesFocusSpy.count(), 2); + QCOMPARE(sps->panelTakesFocus(), false); } void TestPlasmaShell::testDisconnect() @@ -468,20 +454,16 @@ // and get them on the server QVERIFY(plasmaSurfaceCreatedSpy.wait()); QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); - auto sps = plasmaSurfaceCreatedSpy.first().first().value(); + auto sps = plasmaSurfaceCreatedSpy.first().first().value(); QVERIFY(sps); // disconnect - QSignalSpy clientDisconnectedSpy(sps->client(), &ClientConnection::disconnected); - QVERIFY(clientDisconnectedSpy.isValid()); QSignalSpy surfaceDestroyedSpy(sps, &QObject::destroyed); QVERIFY(surfaceDestroyedSpy.isValid()); if (m_connection) { m_connection->deleteLater(); m_connection = nullptr; } - QVERIFY(clientDisconnectedSpy.wait()); - QCOMPARE(clientDisconnectedSpy.count(), 1); QCOMPARE(surfaceDestroyedSpy.count(), 0); QVERIFY(surfaceDestroyedSpy.wait()); QCOMPARE(surfaceDestroyedSpy.count(), 1); @@ -503,7 +485,7 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer s(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); // create ShellSurface diff -Nru dwayland-5.57.0.23/autotests/client/test_plasma_virtual_desktop.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_virtual_desktop.cpp --- dwayland-5.57.0.23/autotests/client/test_plasma_virtual_desktop.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_virtual_desktop.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,38 +1,23 @@ -/******************************************************************** -Copyright 2018 Marco Martin +/* + SPDX-FileCopyrightText: 2018 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/plasmavirtualdesktop_interface.h" +#include "../../src/server/plasmawindowmanagement_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" +#include "../../src/client/plasmavirtualdesktop.h" +#include "../../src/client/plasmawindowmanagement.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/plasmavirtualdesktop.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/plasmavirtualdesktop_interface.h" -#include "../../src/server/plasmawindowmanagement_interface.h" -#include "../../src/client/plasmawindowmanagement.h" using namespace KWayland::Client; @@ -46,6 +31,7 @@ void cleanup(); void testCreate(); + void testSetRows(); void testConnectNewClient(); void testDestroy(); void testActivate(); @@ -56,11 +42,11 @@ void testRemoveRequested(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface; - KWayland::Server::PlasmaWindowManagementInterface *m_windowManagementInterface; - KWayland::Server::PlasmaWindowInterface *m_windowInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface; + KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWaylandServer::PlasmaWindowInterface *m_windowInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; @@ -87,10 +73,10 @@ void TestVirtualDesktop::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -119,7 +105,7 @@ QSignalSpy plasmaVirtualDesktopManagementSpy(®istry, &Registry::plasmaVirtualDesktopManagementAnnounced); QVERIFY(plasmaVirtualDesktopManagementSpy.isValid()); - QSignalSpy windowManagementSpy(®istry, SIGNAL(plasmaWindowManagementAnnounced(quint32,quint32))); + QSignalSpy windowManagementSpy(®istry, &Registry::plasmaWindowManagementAnnounced); QVERIFY(windowManagementSpy.isValid()); QVERIFY(!registry.eventQueue()); @@ -129,43 +115,39 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_plasmaVirtualDesktopManagementInterface = m_display->createPlasmaVirtualDesktopManagement(m_display); - m_plasmaVirtualDesktopManagementInterface->create(); - QVERIFY(m_plasmaVirtualDesktopManagementInterface->isValid()); + m_plasmaVirtualDesktopManagementInterface = new PlasmaVirtualDesktopManagementInterface(m_display, m_display); QVERIFY(plasmaVirtualDesktopManagementSpy.wait()); - m_plasmaVirtualDesktopManagement = registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value(), plasmaVirtualDesktopManagementSpy.first().last().value(), this); + m_plasmaVirtualDesktopManagement = registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value(), + plasmaVirtualDesktopManagementSpy.first().last().value(), + this); - m_windowManagementInterface = m_display->createPlasmaWindowManagement(m_display); - m_windowManagementInterface->create(); - QVERIFY(m_windowManagementInterface->isValid()); + m_windowManagementInterface = new PlasmaWindowManagementInterface(m_display, m_display); m_windowManagementInterface->setPlasmaVirtualDesktopManagementInterface(m_plasmaVirtualDesktopManagementInterface); QVERIFY(windowManagementSpy.wait()); - m_windowManagement = registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value(), windowManagementSpy.first().last().value(), this); + m_windowManagement = + registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value(), windowManagementSpy.first().last().value(), this); - QSignalSpy windowSpy(m_windowManagement, SIGNAL(windowCreated(KWayland::Client::PlasmaWindow*))); + QSignalSpy windowSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated); QVERIFY(windowSpy.isValid()); - m_windowInterface = m_windowManagementInterface->createWindow(this); + m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid()); m_windowInterface->setPid(1337); QVERIFY(windowSpy.wait()); - m_window = windowSpy.first().first().value(); + m_window = windowSpy.first().first().value(); } void TestVirtualDesktop::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_plasmaVirtualDesktopManagement) @@ -194,9 +176,8 @@ QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &PlasmaVirtualDesktopManagement::desktopCreated); QSignalSpy managementDoneSpy(m_plasmaVirtualDesktopManagement, &PlasmaVirtualDesktopManagement::done); - - //on this createDesktop bind() isn't called already, the desktopadded signals will be sent after bind happened - KWayland::Server::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1")); + // on this createDesktop bind() isn't called already, the desktopadded signals will be sent after bind happened + KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1")); desktop1Int->setName("Desktop 1"); desktopCreatedSpy.wait(); @@ -206,7 +187,6 @@ m_plasmaVirtualDesktopManagementInterface->sendDone(); managementDoneSpy.wait(); - QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 1); KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first(); @@ -217,9 +197,8 @@ QCOMPARE(desktop1->id(), QStringLiteral("0-1")); QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1")); - - //on those createDesktop the bind will already be done - KWayland::Server::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2")); + // on those createDesktop the bind will already be done + KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2")); desktop2Int->setName("Desktop 2"); desktopCreatedSpy.wait(); arguments = desktopCreatedSpy.takeFirst(); @@ -227,7 +206,7 @@ QCOMPARE(arguments.at(1).toUInt(), (quint32)1); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2); - KWayland::Server::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3")); + KWaylandServer::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3")); desktop3Int->setName("Desktop 3"); desktopCreatedSpy.wait(); arguments = desktopCreatedSpy.takeFirst(); @@ -237,8 +216,7 @@ m_plasmaVirtualDesktopManagementInterface->sendDone(); managementDoneSpy.wait(); - - //get the clients + // get the clients KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1]; QSignalSpy desktop2DoneSpy(desktop2, &PlasmaVirtualDesktop::done); desktop2Int->sendDone(); @@ -249,7 +227,6 @@ desktop3Int->sendDone(); desktop3DoneSpy.wait(); - QCOMPARE(desktop1->id(), QStringLiteral("0-1")); QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1")); @@ -259,7 +236,7 @@ QCOMPARE(desktop3->id(), QStringLiteral("0-3")); QCOMPARE(desktop3->name(), QStringLiteral("Desktop 3")); - //coherence of order between client and server + // coherence of order between client and server QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().length(), 3); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 3); @@ -268,9 +245,21 @@ } } +void TestVirtualDesktop::testSetRows() +{ + // rebuild some desktops + testCreate(); + + QSignalSpy rowsChangedSpy(m_plasmaVirtualDesktopManagement, &PlasmaVirtualDesktopManagement::rowsChanged); + + m_plasmaVirtualDesktopManagementInterface->setRows(3); + QVERIFY(rowsChangedSpy.wait()); + QCOMPARE(m_plasmaVirtualDesktopManagement->rows(), 3); +} + void TestVirtualDesktop::testConnectNewClient() { - //rebuild some desktops + // rebuild some desktops testCreate(); Registry registry; @@ -286,7 +275,10 @@ QVERIFY(plasmaVirtualDesktopManagementSpy.wait()); - KWayland::Client::PlasmaVirtualDesktopManagement *otherPlasmaVirtualDesktopManagement = registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value(), plasmaVirtualDesktopManagementSpy.first().last().value(), this); + KWayland::Client::PlasmaVirtualDesktopManagement *otherPlasmaVirtualDesktopManagement = + registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value(), + plasmaVirtualDesktopManagementSpy.first().last().value(), + this); QSignalSpy managementDoneSpy(otherPlasmaVirtualDesktopManagement, &PlasmaVirtualDesktopManagement::done); @@ -298,24 +290,23 @@ void TestVirtualDesktop::testDestroy() { - //rebuild some desktops + // rebuild some desktops testCreate(); - KWayland::Server::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); + KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first(); - QSignalSpy desktop1IntDestroyedSpy(desktop1Int, &QObject::destroyed); QSignalSpy desktop1DestroyedSpy(desktop1, &QObject::destroyed); QSignalSpy desktop1RemovedSpy(desktop1, &KWayland::Client::PlasmaVirtualDesktop::removed); m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-1")); - //test that both server and client desktoip interfaces go away + // test that both server and client desktoip interfaces go away desktop1IntDestroyedSpy.wait(); desktop1RemovedSpy.wait(); desktop1DestroyedSpy.wait(); - //coherence of order between client and server + // coherence of order between client and server QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().length(), 2); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2); @@ -323,7 +314,7 @@ QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().at(i)->id(), m_plasmaVirtualDesktopManagement->desktops().at(i)->id()); } - //Test the desktopRemoved signal of the manager, remove another desktop as the signals can't be tested at the same time + // Test the desktopRemoved signal of the manager, remove another desktop as the signals can't be tested at the same time QSignalSpy desktopManagerRemovedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopRemoved); m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-2")); desktopManagerRemovedSpy.wait(); @@ -335,25 +326,25 @@ void TestVirtualDesktop::testActivate() { - //rebuild some desktops + // rebuild some desktops testCreate(); - KWayland::Server::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); + KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first(); QVERIFY(desktop1->isActive()); QVERIFY(desktop1Int->isActive()); - KWayland::Server::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1]; + KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1]; KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1]; QVERIFY(!desktop2Int->isActive()); - QSignalSpy requestActivateSpy(desktop2Int, &KWayland::Server::PlasmaVirtualDesktopInterface::activateRequested); + QSignalSpy requestActivateSpy(desktop2Int, &KWaylandServer::PlasmaVirtualDesktopInterface::activateRequested); QSignalSpy activatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::activated); desktop2->requestActivate(); requestActivateSpy.wait(); - //This simulates a compositor which supports only one active desktop at a time + // This simulates a compositor which supports only one active desktop at a time for (auto *deskInt : m_plasmaVirtualDesktopManagementInterface->desktops()) { if (deskInt->id() == desktop2->id()) { deskInt->setActive(true); @@ -363,14 +354,14 @@ } activatedSpy.wait(); - //correct state in the server + // correct state in the server QVERIFY(desktop2Int->isActive()); QVERIFY(!desktop1Int->isActive()); - //correct state in the client + // correct state in the client QVERIFY(desktop2Int->isActive()); QVERIFY(!desktop1Int->isActive()); - //Test the deactivated signal + // Test the deactivated signal QSignalSpy deactivatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::deactivated); for (auto *deskInt : m_plasmaVirtualDesktopManagementInterface->desktops()) { @@ -387,7 +378,7 @@ { testCreate(); - QSignalSpy enterRequestedSpy(m_windowInterface, &KWayland::Server::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested); + QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested); m_window->requestEnterVirtualDesktop(QStringLiteral("0-1")); enterRequestedSpy.wait(); @@ -395,18 +386,18 @@ QSignalSpy virtualDesktopEnteredSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopEntered); - //agree to the request + // agree to the request m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-1")); QCOMPARE(m_windowInterface->plasmaVirtualDesktops().length(), 1); QCOMPARE(m_windowInterface->plasmaVirtualDesktops().first(), QStringLiteral("0-1")); - //check if the client received the enter + // check if the client received the enter virtualDesktopEnteredSpy.wait(); QCOMPARE(virtualDesktopEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1); QCOMPARE(m_window->plasmaVirtualDesktops().first(), QStringLiteral("0-1")); - //add another desktop, server side + // add another desktop, server side m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-3")); virtualDesktopEnteredSpy.wait(); QCOMPARE(virtualDesktopEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-3")); @@ -414,14 +405,12 @@ QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2); QCOMPARE(m_window->plasmaVirtualDesktops()[1], QStringLiteral("0-3")); - - - //try to add an invalid desktop + // try to add an invalid desktop m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("invalid")); QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2); - //remove a desktop - QSignalSpy leaveRequestedSpy(m_windowInterface, &KWayland::Server::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested); + // remove a desktop + QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested); m_window->requestLeaveVirtualDesktop(QStringLiteral("0-1")); leaveRequestedSpy.wait(); @@ -429,20 +418,20 @@ QSignalSpy virtualDesktopLeftSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopLeft); - //agree to the request + // agree to the request m_windowInterface->removePlasmaVirtualDesktop(QStringLiteral("0-1")); QCOMPARE(m_windowInterface->plasmaVirtualDesktops().length(), 1); QCOMPARE(m_windowInterface->plasmaVirtualDesktops().first(), QStringLiteral("0-3")); - //check if the client received the leave + // check if the client received the leave virtualDesktopLeftSpy.wait(); QCOMPARE(virtualDesktopLeftSpy.takeFirst().at(0).toString(), QStringLiteral("0-1")); QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1); QCOMPARE(m_window->plasmaVirtualDesktops().first(), QStringLiteral("0-3")); - //Destroy desktop 2 + // Destroy desktop 2 m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-3")); - //the window should receive a left signal from the destroyed desktop + // the window should receive a left signal from the destroyed desktop virtualDesktopLeftSpy.wait(); QCOMPARE(m_window->plasmaVirtualDesktops().length(), 0); @@ -454,15 +443,15 @@ QSignalSpy virtualDesktopEnteredSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopEntered); QSignalSpy virtualDesktopLeftSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopLeft); - //in the beginning the window is on desktop 1 and desktop 3 + // in the beginning the window is on desktop 1 and desktop 3 m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-1")); m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-3")); virtualDesktopEnteredSpy.wait(); - //setting on all desktops + // setting on all desktops QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2); m_windowInterface->setOnAllDesktops(true); - //setting on all desktops, the window will leave every desktop + // setting on all desktops, the window will leave every desktop virtualDesktopLeftSpy.wait(); QCOMPARE(virtualDesktopLeftSpy.count(), 2); @@ -472,7 +461,7 @@ QCOMPARE(m_window->plasmaVirtualDesktops().length(), 0); QVERIFY(m_window->isOnAllDesktops()); - //return to the active desktop (0-1) + // return to the active desktop (0-1) m_windowInterface->setOnAllDesktops(false); virtualDesktopEnteredSpy.wait(); QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1); @@ -482,35 +471,36 @@ void TestVirtualDesktop::testCreateRequested() { - //rebuild some desktops + // rebuild some desktops testCreate(); - QSignalSpy desktopCreateRequestedSpy(m_plasmaVirtualDesktopManagementInterface, &KWayland::Server::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested); + QSignalSpy desktopCreateRequestedSpy(m_plasmaVirtualDesktopManagementInterface, + &KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested); QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &PlasmaVirtualDesktopManagement::desktopCreated); - //listen for createdRequested + // listen for createdRequested m_plasmaVirtualDesktopManagement->requestCreateVirtualDesktop(QStringLiteral("Desktop"), 1); desktopCreateRequestedSpy.wait(); QCOMPARE(desktopCreateRequestedSpy.first().first().toString(), QStringLiteral("Desktop")); QCOMPARE(desktopCreateRequestedSpy.first().at(1).toUInt(), (quint32)1); - //actually create + // actually create m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-4"), 1); - KWayland::Server::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1); + KWaylandServer::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1); QCOMPARE(desktopInt->id(), QStringLiteral("0-4")); desktopInt->setName(QStringLiteral("Desktop")); desktopCreatedSpy.wait(); - + QCOMPARE(desktopCreatedSpy.first().first().toString(), QStringLiteral("0-4")); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().count(), 4); PlasmaVirtualDesktop *desktop = m_plasmaVirtualDesktopManagement->desktops().at(1); QSignalSpy desktopDoneSpy(desktop, &PlasmaVirtualDesktop::done); desktopInt->sendDone(); - // desktopDoneSpy.wait(); - //check the order is correct + // desktopDoneSpy.wait(); + // check the order is correct QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().at(0)->id(), QStringLiteral("0-1")); QCOMPARE(desktop->id(), QStringLiteral("0-4")); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().at(2)->id(), QStringLiteral("0-2")); @@ -519,12 +509,13 @@ void TestVirtualDesktop::testRemoveRequested() { - //rebuild some desktops + // rebuild some desktops testCreate(); - QSignalSpy desktopRemoveRequestedSpy(m_plasmaVirtualDesktopManagementInterface, &KWayland::Server::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested); + QSignalSpy desktopRemoveRequestedSpy(m_plasmaVirtualDesktopManagementInterface, + &KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested); - //request a remove, just check the request arrived, ignore the request. + // request a remove, just check the request arrived, ignore the request. m_plasmaVirtualDesktopManagement->requestRemoveVirtualDesktop(QStringLiteral("0-1")); desktopRemoveRequestedSpy.wait(); QCOMPARE(desktopRemoveRequestedSpy.first().first().toString(), QStringLiteral("0-1")); diff -Nru dwayland-5.57.0.23/autotests/client/test_plasma_window_model.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_window_model.cpp --- dwayland-5.57.0.23/autotests/client/test_plasma_window_model.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_plasma_window_model.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,935 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// client -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/registry.h" -#include "../../src/client/plasmawindowmanagement.h" -#include "../../src/client/plasmawindowmodel.h" -// server -#include "../../src/server/display.h" -#include "../../src/server/plasmawindowmanagement_interface.h" -#include "../../src/server/plasmavirtualdesktop_interface.h" - -#include - -using namespace KWayland::Client; -using namespace KWayland::Server; - -Q_DECLARE_METATYPE(Qt::MouseButton) -typedef void (KWayland::Client::PlasmaWindow::*ClientWindowSignal)(); -Q_DECLARE_METATYPE(ClientWindowSignal) -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowBoolSetter)(bool); -Q_DECLARE_METATYPE(ServerWindowBoolSetter) -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowStringSetter)(const QString&); -Q_DECLARE_METATYPE(ServerWindowStringSetter) -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowQuint32Setter)(quint32); -Q_DECLARE_METATYPE(ServerWindowQuint32Setter) -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowVoidSetter)(); -Q_DECLARE_METATYPE(ServerWindowVoidSetter) - -class PlasmaWindowModelTest : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void init(); - void cleanup(); - - void testRoleNames_data(); - void testRoleNames(); - void testAddRemoveRows(); - void testDefaultData_data(); - void testDefaultData(); - void testIsActive(); - void testIsFullscreenable(); - void testIsFullscreen(); - void testIsMaximizable(); - void testIsMaximized(); - void testIsMinimizable(); - void testIsMinimized(); - void testIsKeepAbove(); - void testIsKeepBelow(); - void testIsDemandingAttention(); - void testSkipTaskbar(); - void testSkipSwitcher(); - void testIsShadeable(); - void testIsShaded(); - void testIsMovable(); - void testIsResizable(); - void testIsVirtualDesktopChangeable(); - void testIsCloseable(); - void testGeometry(); - void testTitle(); - void testAppId(); - void testPid(); - void testVirtualDesktops(); - // TODO icon: can we ensure a theme is installed on CI? - void testRequests(); - // TODO: minimized geometry - // TODO: model reset - void testCreateWithUnmappedWindow(); - void testChangeWindowAfterModelDestroy_data(); - void testChangeWindowAfterModelDestroy(); - void testCreateWindowAfterModelDestroy(); - -private: - bool testBooleanData(PlasmaWindowModel::AdditionalRoles role, void (PlasmaWindowInterface::*function)(bool)); - Display *m_display = nullptr; - PlasmaWindowManagementInterface *m_pwInterface = nullptr; - PlasmaWindowManagement *m_pw = nullptr; - KWayland::Server::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface = nullptr; - ConnectionThread *m_connection = nullptr; - QThread *m_thread = nullptr; - EventQueue *m_queue = nullptr; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-fake-input-0"); - -void PlasmaWindowModelTest::init() -{ - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - m_display->createShm(); - m_pwInterface = m_display->createPlasmaWindowManagement(); - m_pwInterface->create(); - m_plasmaVirtualDesktopManagementInterface = m_display->createPlasmaVirtualDesktopManagement(m_display); - m_plasmaVirtualDesktopManagementInterface->create(); - QVERIFY(m_plasmaVirtualDesktopManagementInterface->isValid()); - m_plasmaVirtualDesktopManagementInterface->createDesktop("desktop1"); - m_plasmaVirtualDesktopManagementInterface->createDesktop("desktop2"); - m_pwInterface->setPlasmaVirtualDesktopManagementInterface(m_plasmaVirtualDesktopManagementInterface); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); - QVERIFY(connectedSpy.isValid()); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new EventQueue(this); - m_queue->setup(m_connection); - - Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - registry.setEventQueue(m_queue); - registry.create(m_connection); - QVERIFY(registry.isValid()); - registry.setup(); - QVERIFY(interfacesAnnouncedSpy.wait()); - - m_pw = registry.createPlasmaWindowManagement(registry.interface(Registry::Interface::PlasmaWindowManagement).name, - registry.interface(Registry::Interface::PlasmaWindowManagement).version, - this); - QVERIFY(m_pw->isValid()); -} - -void PlasmaWindowModelTest::cleanup() -{ -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ - } - CLEANUP(m_pw) - CLEANUP(m_plasmaVirtualDesktopManagementInterface) - CLEANUP(m_queue) - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - - CLEANUP(m_pwInterface) - CLEANUP(m_display) -#undef CLEANUP -} - -bool PlasmaWindowModelTest::testBooleanData(PlasmaWindowModel::AdditionalRoles role, void (PlasmaWindowInterface::*function)(bool)) -{ -#define VERIFY(statement) \ -if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ - return false; -#define COMPARE(actual, expected) \ -if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ - return false; - - auto model = m_pw->createWindowModel(); - VERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - VERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - VERIFY(w); - VERIFY(rowInsertedSpy.wait()); - m_connection->flush(); - m_display->dispatchEvents(); - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - VERIFY(dataChangedSpy.isValid()); - - const QModelIndex index = model->index(0); - COMPARE(model->data(index, role).toBool(), false); - - (w->*(function))(true); - VERIFY(dataChangedSpy.wait()); - COMPARE(dataChangedSpy.count(), 1); - COMPARE(dataChangedSpy.last().first().toModelIndex(), index); - COMPARE(dataChangedSpy.last().last().value>(), QVector{int(role)}); - COMPARE(model->data(index, role).toBool(), true); - - (w->*(function))(false); - VERIFY(dataChangedSpy.wait()); - COMPARE(dataChangedSpy.count(), 2); - COMPARE(dataChangedSpy.last().first().toModelIndex(), index); - COMPARE(dataChangedSpy.last().last().value>(), QVector{int(role)}); - COMPARE(model->data(index, role).toBool(), false); - -#undef COMPARE -#undef VERIFY - return true; -} - -void PlasmaWindowModelTest::testRoleNames_data() -{ - QTest::addColumn("role"); - QTest::addColumn("name"); - - QTest::newRow("display") << int(Qt::DisplayRole) << QByteArrayLiteral("DisplayRole"); - QTest::newRow("decoration") << int(Qt::DecorationRole) << QByteArrayLiteral("DecorationRole"); - - QTest::newRow("AppId") << int(PlasmaWindowModel::AppId) << QByteArrayLiteral("AppId"); - QTest::newRow("Pid") << int(PlasmaWindowModel::Pid) << QByteArrayLiteral("Pid"); - QTest::newRow("IsActive") << int(PlasmaWindowModel::IsActive) << QByteArrayLiteral("IsActive"); - QTest::newRow("IsFullscreenable") << int(PlasmaWindowModel::IsFullscreenable) << QByteArrayLiteral("IsFullscreenable"); - QTest::newRow("IsFullscreen") << int(PlasmaWindowModel::IsFullscreen) << QByteArrayLiteral("IsFullscreen"); - QTest::newRow("IsMaximizable") << int(PlasmaWindowModel::IsMaximizable) << QByteArrayLiteral("IsMaximizable"); - QTest::newRow("IsMaximized") << int(PlasmaWindowModel::IsMaximized) << QByteArrayLiteral("IsMaximized"); - QTest::newRow("IsMinimizable") << int(PlasmaWindowModel::IsMinimizable) << QByteArrayLiteral("IsMinimizable"); - QTest::newRow("IsMinimized") << int(PlasmaWindowModel::IsMinimized) << QByteArrayLiteral("IsMinimized"); - QTest::newRow("IsKeepAbove") << int(PlasmaWindowModel::IsKeepAbove) << QByteArrayLiteral("IsKeepAbove"); - QTest::newRow("IsKeepBelow") << int(PlasmaWindowModel::IsKeepBelow) << QByteArrayLiteral("IsKeepBelow"); - QTest::newRow("VirtualDesktop") << int(PlasmaWindowModel::VirtualDesktop) << QByteArrayLiteral("VirtualDesktop"); - QTest::newRow("IsOnAllDesktops") << int(PlasmaWindowModel::IsOnAllDesktops) << QByteArrayLiteral("IsOnAllDesktops"); - QTest::newRow("IsDemandingAttention") << int(PlasmaWindowModel::IsDemandingAttention) << QByteArrayLiteral("IsDemandingAttention"); - QTest::newRow("SkipTaskbar") << int(PlasmaWindowModel::SkipTaskbar) << QByteArrayLiteral("SkipTaskbar"); - QTest::newRow("SkipSwitcher") << int(PlasmaWindowModel::SkipSwitcher) << QByteArrayLiteral("SkipSwitcher"); - QTest::newRow("IsShadeable") << int(PlasmaWindowModel::IsShadeable) << QByteArrayLiteral("IsShadeable"); - QTest::newRow("IsShaded") << int(PlasmaWindowModel::IsShaded) << QByteArrayLiteral("IsShaded"); - QTest::newRow("IsMovable") << int(PlasmaWindowModel::IsMovable) << QByteArrayLiteral("IsMovable"); - QTest::newRow("IsResizable") << int(PlasmaWindowModel::IsResizable) << QByteArrayLiteral("IsResizable"); - QTest::newRow("IsVirtualDesktopChangeable") << int(PlasmaWindowModel::IsVirtualDesktopChangeable) << QByteArrayLiteral("IsVirtualDesktopChangeable"); - QTest::newRow("IsCloseable") << int(PlasmaWindowModel::IsCloseable) << QByteArrayLiteral("IsCloseable"); - QTest::newRow("Geometry") << int(PlasmaWindowModel::Geometry) << QByteArrayLiteral("Geometry"); -} - -void PlasmaWindowModelTest::testRoleNames() -{ - // just verifies that all role names are available - auto model = m_pw->createWindowModel(); - QVERIFY(model); - const auto roles = model->roleNames(); - - QFETCH(int, role); - auto it = roles.find(role); - QVERIFY(it != roles.end()); - QTEST(it.value(), "name"); -} - -void PlasmaWindowModelTest::testAddRemoveRows() -{ - // this test verifies that adding/removing rows to the Model works - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QCOMPARE(model->rowCount(), 0); - QVERIFY(!model->index(0).isValid()); - - // now let's add a row - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - // this happens by creating a PlasmaWindow on server side - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - QCOMPARE(rowInsertedSpy.count(), 1); - QVERIFY(!rowInsertedSpy.first().at(0).toModelIndex().isValid()); - QCOMPARE(rowInsertedSpy.first().at(1).toInt(), 0); - QCOMPARE(rowInsertedSpy.first().at(2).toInt(), 0); - - // the model should have a row now - QCOMPARE(model->rowCount(), 1); - QVERIFY(model->index(0).isValid()); - // that index doesn't have children - QCOMPARE(model->rowCount(model->index(0)), 0); - - // process events in order to ensure that the resource is created on server side before we unmap the window - QCoreApplication::instance()->processEvents(QEventLoop::WaitForMoreEvents); - - // now let's remove that again - QSignalSpy rowRemovedSpy(model, &PlasmaWindowModel::rowsRemoved); - QVERIFY(rowRemovedSpy.isValid()); - w->unmap(); - QVERIFY(rowRemovedSpy.wait()); - QCOMPARE(rowRemovedSpy.count(), 1); - QVERIFY(!rowRemovedSpy.first().at(0).toModelIndex().isValid()); - QCOMPARE(rowRemovedSpy.first().at(1).toInt(), 0); - QCOMPARE(rowRemovedSpy.first().at(2).toInt(), 0); - - // now the model is empty again - QCOMPARE(model->rowCount(), 0); - QVERIFY(!model->index(0).isValid()); - - QSignalSpy wDestroyedSpy(w, &QObject::destroyed); - QVERIFY(wDestroyedSpy.isValid()); - QVERIFY(wDestroyedSpy.wait()); -} - -void PlasmaWindowModelTest::testDefaultData_data() -{ - QTest::addColumn("role"); - QTest::addColumn("value"); - - QTest::newRow("display") << int(Qt::DisplayRole) << QVariant(QString()); - QTest::newRow("decoration") << int(Qt::DecorationRole) << QVariant(QIcon()); - - QTest::newRow("AppId") << int(PlasmaWindowModel::AppId) << QVariant(QString()); - QTest::newRow("IsActive") << int(PlasmaWindowModel::IsActive) << QVariant(false); - QTest::newRow("IsFullscreenable") << int(PlasmaWindowModel::IsFullscreenable) << QVariant(false); - QTest::newRow("IsFullscreen") << int(PlasmaWindowModel::IsFullscreen) << QVariant(false); - QTest::newRow("IsMaximizable") << int(PlasmaWindowModel::IsMaximizable) << QVariant(false); - QTest::newRow("IsMaximized") << int(PlasmaWindowModel::IsMaximized) << QVariant(false); - QTest::newRow("IsMinimizable") << int(PlasmaWindowModel::IsMinimizable) << QVariant(false); - QTest::newRow("IsMinimized") << int(PlasmaWindowModel::IsMinimized) << QVariant(false); - QTest::newRow("IsKeepAbove") << int(PlasmaWindowModel::IsKeepAbove) << QVariant(false); - QTest::newRow("IsKeepBelow") << int(PlasmaWindowModel::IsKeepBelow) << QVariant(false); - QTest::newRow("VirtualDesktop") << int(PlasmaWindowModel::VirtualDesktop) << QVariant(0); - QTest::newRow("IsOnAllDesktops") << int(PlasmaWindowModel::IsOnAllDesktops) << QVariant(true); - QTest::newRow("IsDemandingAttention") << int(PlasmaWindowModel::IsDemandingAttention) << QVariant(false); - QTest::newRow("IsShadeable") << int(PlasmaWindowModel::IsShadeable) << QVariant(false); - QTest::newRow("IsShaded") << int(PlasmaWindowModel::IsShaded) << QVariant(false); - QTest::newRow("SkipTaskbar") << int(PlasmaWindowModel::SkipTaskbar) << QVariant(false); - QTest::newRow("IsMovable") << int(PlasmaWindowModel::IsMovable) << QVariant(false); - QTest::newRow("IsResizable") << int(PlasmaWindowModel::IsResizable) << QVariant(false); - QTest::newRow("IsVirtualDesktopChangeable") << int(PlasmaWindowModel::IsVirtualDesktopChangeable) << QVariant(false); - QTest::newRow("IsCloseable") << int(PlasmaWindowModel::IsCloseable) << QVariant(false); - QTest::newRow("Geometry") << int(PlasmaWindowModel::Geometry) << QVariant(QRect()); - QTest::newRow("Pid") << int(PlasmaWindowModel::Pid) << QVariant(0); -} - -void PlasmaWindowModelTest::testDefaultData() -{ - // this test validates the default data of a PlasmaWindow without having set any values - // first create a model with a window - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - - QModelIndex index = model->index(0); - QFETCH(int, role); - QTEST(model->data(index, role), "value"); -} - -void PlasmaWindowModelTest::testIsActive() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsActive, &PlasmaWindowInterface::setActive)); -} - -void PlasmaWindowModelTest::testIsFullscreenable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsFullscreenable, &PlasmaWindowInterface::setFullscreenable)); -} - -void PlasmaWindowModelTest::testIsFullscreen() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsFullscreen, &PlasmaWindowInterface::setFullscreen)); -} - -void PlasmaWindowModelTest::testIsMaximizable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsMaximizable, &PlasmaWindowInterface::setMaximizeable)); -} - -void PlasmaWindowModelTest::testIsMaximized() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsMaximized, &PlasmaWindowInterface::setMaximized)); -} - -void PlasmaWindowModelTest::testIsMinimizable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsMinimizable, &PlasmaWindowInterface::setMinimizeable)); -} - -void PlasmaWindowModelTest::testIsMinimized() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsMinimized, &PlasmaWindowInterface::setMinimized)); -} - -void PlasmaWindowModelTest::testIsKeepAbove() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsKeepAbove, &PlasmaWindowInterface::setKeepAbove)); -} - -void PlasmaWindowModelTest::testIsKeepBelow() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsKeepBelow, &PlasmaWindowInterface::setKeepBelow)); -} - -void PlasmaWindowModelTest::testIsDemandingAttention() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsDemandingAttention, &PlasmaWindowInterface::setDemandsAttention)); -} - -void PlasmaWindowModelTest::testSkipTaskbar() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::SkipTaskbar, &PlasmaWindowInterface::setSkipTaskbar)); -} - -void PlasmaWindowModelTest::testSkipSwitcher() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::SkipSwitcher, &PlasmaWindowInterface::setSkipSwitcher)); -} - -void PlasmaWindowModelTest::testIsShadeable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsShadeable, &PlasmaWindowInterface::setShadeable)); -} - -void PlasmaWindowModelTest::testIsShaded() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsShaded, &PlasmaWindowInterface::setShaded)); -} - -void PlasmaWindowModelTest::testIsMovable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsMovable, &PlasmaWindowInterface::setMovable)); -} - -void PlasmaWindowModelTest::testIsResizable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsResizable, &PlasmaWindowInterface::setResizable)); -} - -void PlasmaWindowModelTest::testIsVirtualDesktopChangeable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsVirtualDesktopChangeable, &PlasmaWindowInterface::setVirtualDesktopChangeable)); -} - -void PlasmaWindowModelTest::testIsCloseable() -{ - QVERIFY(testBooleanData(PlasmaWindowModel::IsCloseable, &PlasmaWindowInterface::setCloseable)); -} - -void PlasmaWindowModelTest::testGeometry() -{ - auto model = m_pw->createWindowModel(); - QVERIFY(model); - - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - - const QModelIndex index = model->index(0); - - QCOMPARE(model->data(index, PlasmaWindowModel::Geometry).toRect(), QRect()); - - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - QVERIFY(dataChangedSpy.isValid()); - - const QRect geom(0, 15, 50, 75); - w->setGeometry(geom); - - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.count(), 1); - QCOMPARE(dataChangedSpy.last().first().toModelIndex(), index); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(PlasmaWindowModel::Geometry)}); - - QCOMPARE(model->data(index, PlasmaWindowModel::Geometry).toRect(), geom); -} - -void PlasmaWindowModelTest::testTitle() -{ - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - m_connection->flush(); - m_display->dispatchEvents(); - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - QVERIFY(dataChangedSpy.isValid()); - - const QModelIndex index = model->index(0); - QCOMPARE(model->data(index, Qt::DisplayRole).toString(), QString()); - - w->setTitle(QStringLiteral("foo")); - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.count(), 1); - QCOMPARE(dataChangedSpy.last().first().toModelIndex(), index); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(Qt::DisplayRole)}); - QCOMPARE(model->data(index, Qt::DisplayRole).toString(), QStringLiteral("foo")); -} - -void PlasmaWindowModelTest::testAppId() -{ - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - m_connection->flush(); - m_display->dispatchEvents(); - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - QVERIFY(dataChangedSpy.isValid()); - - const QModelIndex index = model->index(0); - QCOMPARE(model->data(index, PlasmaWindowModel::AppId).toString(), QString()); - - w->setAppId(QStringLiteral("org.kde.testapp")); - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.count(), 1); - QCOMPARE(dataChangedSpy.last().first().toModelIndex(), index); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(PlasmaWindowModel::AppId)}); - QCOMPARE(model->data(index, PlasmaWindowModel::AppId).toString(), QStringLiteral("org.kde.testapp")); -} - -void PlasmaWindowModelTest::testPid() -{ - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - w->setPid(1337); - QVERIFY(w); - m_connection->flush(); - m_display->dispatchEvents(); - QVERIFY(rowInsertedSpy.wait()); - - //pid should be set as soon as the new row appears - const QModelIndex index = model->index(0); - QCOMPARE(model->data(index, PlasmaWindowModel::Pid).toInt(), 1337); -} - -void PlasmaWindowModelTest::testVirtualDesktops() -{ - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - m_connection->flush(); - m_display->dispatchEvents(); - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - QVERIFY(dataChangedSpy.isValid()); - - const QModelIndex index = model->index(0); - QCOMPARE(model->data(index, PlasmaWindowModel::VirtualDesktops).toStringList(), QStringList()); - - w->addPlasmaVirtualDesktop("desktop1"); - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.count(), 2); - QCOMPARE(dataChangedSpy.first().first().toModelIndex(), index); - QCOMPARE(dataChangedSpy.last().first().toModelIndex(), index); - - QCOMPARE(dataChangedSpy.first().last().value>(), QVector{int(PlasmaWindowModel::VirtualDesktops)}); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(PlasmaWindowModel::IsOnAllDesktops)}); - - QCOMPARE(model->data(index, PlasmaWindowModel::VirtualDesktops).toStringList(), QStringList({"desktop1"})); - QCOMPARE(model->data(index, PlasmaWindowModel::IsOnAllDesktops).toBool(), false); - - dataChangedSpy.clear(); - w->addPlasmaVirtualDesktop("desktop2"); - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.count(), 1); - QCOMPARE(dataChangedSpy.last().first().toModelIndex(), index); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(PlasmaWindowModel::VirtualDesktops)}); - QCOMPARE(model->data(index, PlasmaWindowModel::VirtualDesktops).toStringList(), QStringList({"desktop1", "desktop2"})); - QCOMPARE(model->data(index, PlasmaWindowModel::IsOnAllDesktops).toBool(), false); - - w->removePlasmaVirtualDesktop("desktop2"); - w->removePlasmaVirtualDesktop("desktop1"); - QVERIFY(dataChangedSpy.wait()); - QCOMPARE(dataChangedSpy.last().last().value>(), QVector{int(PlasmaWindowModel::IsOnAllDesktops)}); - QCOMPARE(model->data(index, PlasmaWindowModel::VirtualDesktops).toStringList(), QStringList({})); - QCOMPARE(model->data(index, PlasmaWindowModel::IsOnAllDesktops).toBool(), true); - - QVERIFY(!dataChangedSpy.wait(100)); -} - -void PlasmaWindowModelTest::testRequests() -{ - // this test verifies that the various requests are properly passed to the server - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy rowInsertedSpy(model, &PlasmaWindowModel::rowsInserted); - QVERIFY(rowInsertedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(rowInsertedSpy.wait()); - - QSignalSpy activateRequestedSpy(w, &PlasmaWindowInterface::activeRequested); - QVERIFY(activateRequestedSpy.isValid()); - QSignalSpy closeRequestedSpy(w, &PlasmaWindowInterface::closeRequested); - QVERIFY(closeRequestedSpy.isValid()); - QSignalSpy moveRequestedSpy(w, &PlasmaWindowInterface::moveRequested); - QVERIFY(moveRequestedSpy.isValid()); - QSignalSpy resizeRequestedSpy(w, &PlasmaWindowInterface::resizeRequested); - QVERIFY(resizeRequestedSpy.isValid()); - QSignalSpy virtualDesktopRequestedSpy(w, &PlasmaWindowInterface::virtualDesktopRequested); - QVERIFY(virtualDesktopRequestedSpy.isValid()); - QSignalSpy keepAboveRequestedSpy(w, &PlasmaWindowInterface::keepAboveRequested); - QVERIFY(keepAboveRequestedSpy.isValid()); - QSignalSpy keepBelowRequestedSpy(w, &PlasmaWindowInterface::keepBelowRequested); - QVERIFY(keepBelowRequestedSpy.isValid()); - QSignalSpy minimizedRequestedSpy(w, &PlasmaWindowInterface::minimizedRequested); - QVERIFY(minimizedRequestedSpy.isValid()); - QSignalSpy maximizeRequestedSpy(w, &PlasmaWindowInterface::maximizedRequested); - QVERIFY(maximizeRequestedSpy.isValid()); - QSignalSpy shadeRequestedSpy(w, &PlasmaWindowInterface::shadedRequested); - QVERIFY(shadeRequestedSpy.isValid()); - - // first let's use some invalid row numbers - model->requestActivate(-1); - model->requestClose(-1); - model->requestVirtualDesktop(-1, 1); - model->requestToggleKeepAbove(-1); - model->requestToggleKeepBelow(-1); - model->requestToggleMinimized(-1); - model->requestToggleMaximized(-1); - model->requestActivate(1); - model->requestClose(1); - model->requestMove(1); - model->requestResize(1); - model->requestVirtualDesktop(1, 1); - model->requestToggleKeepAbove(1); - model->requestToggleKeepBelow(1); - model->requestToggleMinimized(1); - model->requestToggleMaximized(1); - model->requestToggleShaded(1); - // that should not have triggered any signals - QVERIFY(!activateRequestedSpy.wait(100)); - QVERIFY(activateRequestedSpy.isEmpty()); - QVERIFY(closeRequestedSpy.isEmpty()); - QVERIFY(moveRequestedSpy.isEmpty()); - QVERIFY(resizeRequestedSpy.isEmpty()); - QVERIFY(virtualDesktopRequestedSpy.isEmpty()); - QVERIFY(minimizedRequestedSpy.isEmpty()); - QVERIFY(maximizeRequestedSpy.isEmpty()); - QVERIFY(shadeRequestedSpy.isEmpty()); - - // now with the proper row - // activate - model->requestActivate(0); - QVERIFY(activateRequestedSpy.wait()); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(activateRequestedSpy.first().first().toBool(), true); - QCOMPARE(closeRequestedSpy.count(), 0); - QCOMPARE(moveRequestedSpy.count(), 0); - QCOMPARE(resizeRequestedSpy.count(), 0); - QCOMPARE(virtualDesktopRequestedSpy.count(), 0); - QCOMPARE(minimizedRequestedSpy.count(), 0); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // close - model->requestClose(0); - QVERIFY(closeRequestedSpy.wait()); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 0); - QCOMPARE(resizeRequestedSpy.count(), 0); - QCOMPARE(virtualDesktopRequestedSpy.count(), 0); - QCOMPARE(minimizedRequestedSpy.count(), 0); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // move - model->requestMove(0); - QVERIFY(moveRequestedSpy.wait()); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 0); - QCOMPARE(virtualDesktopRequestedSpy.count(), 0); - QCOMPARE(minimizedRequestedSpy.count(), 0); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // resize - model->requestResize(0); - QVERIFY(resizeRequestedSpy.wait()); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 0); - QCOMPARE(minimizedRequestedSpy.count(), 0); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // virtual desktop - model->requestVirtualDesktop(0, 1); - QVERIFY(virtualDesktopRequestedSpy.wait()); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.first().first().toUInt(), 1u); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(minimizedRequestedSpy.count(), 0); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // keep above - model->requestToggleKeepAbove(0); - QVERIFY(keepAboveRequestedSpy.wait()); - QCOMPARE(keepAboveRequestedSpy.count(), 1); - QCOMPARE(keepAboveRequestedSpy.first().first().toBool(), true); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // keep Below - model->requestToggleKeepBelow(0); - QVERIFY(keepBelowRequestedSpy.wait()); - QCOMPARE(keepBelowRequestedSpy.count(), 1); - QCOMPARE(keepBelowRequestedSpy.first().first().toBool(), true); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // minimize - model->requestToggleMinimized(0); - QVERIFY(minimizedRequestedSpy.wait()); - QCOMPARE(minimizedRequestedSpy.count(), 1); - QCOMPARE(minimizedRequestedSpy.first().first().toBool(), true); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.count(), 0); - QCOMPARE(shadeRequestedSpy.count(), 0); - // maximize - model->requestToggleMaximized(0); - QVERIFY(maximizeRequestedSpy.wait()); - QCOMPARE(maximizeRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.first().first().toBool(), true); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(minimizedRequestedSpy.count(), 1); - QCOMPARE(shadeRequestedSpy.count(), 0); - // shade - model->requestToggleShaded(0); - QVERIFY(shadeRequestedSpy.wait()); - QCOMPARE(shadeRequestedSpy.count(), 1); - QCOMPARE(shadeRequestedSpy.first().first().toBool(), true); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(closeRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(virtualDesktopRequestedSpy.count(), 1); - QCOMPARE(minimizedRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.count(), 1); - - // the toggles can also support a different state - QSignalSpy dataChangedSpy(model, &PlasmaWindowModel::dataChanged); - QVERIFY(dataChangedSpy.isValid()); - // keepAbove - w->setKeepAbove(true); - QVERIFY(dataChangedSpy.wait()); - model->requestToggleKeepAbove(0); - QVERIFY(keepAboveRequestedSpy.wait()); - QCOMPARE(keepAboveRequestedSpy.count(), 2); - QCOMPARE(keepAboveRequestedSpy.last().first().toBool(), false); - // keepBelow - w->setKeepBelow(true); - QVERIFY(dataChangedSpy.wait()); - model->requestToggleKeepBelow(0); - QVERIFY(keepBelowRequestedSpy.wait()); - QCOMPARE(keepBelowRequestedSpy.count(), 2); - QCOMPARE(keepBelowRequestedSpy.last().first().toBool(), false); - // minimize - w->setMinimized(true); - QVERIFY(dataChangedSpy.wait()); - model->requestToggleMinimized(0); - QVERIFY(minimizedRequestedSpy.wait()); - QCOMPARE(minimizedRequestedSpy.count(), 2); - QCOMPARE(minimizedRequestedSpy.last().first().toBool(), false); - // maximized - w->setMaximized(true); - QVERIFY(dataChangedSpy.wait()); - model->requestToggleMaximized(0); - QVERIFY(maximizeRequestedSpy.wait()); - QCOMPARE(maximizeRequestedSpy.count(), 2); - QCOMPARE(maximizeRequestedSpy.last().first().toBool(), false); - // shaded - w->setShaded(true); - QVERIFY(dataChangedSpy.wait()); - model->requestToggleShaded(0); - QVERIFY(shadeRequestedSpy.wait()); - QCOMPARE(shadeRequestedSpy.count(), 2); - QCOMPARE(shadeRequestedSpy.last().first().toBool(), false); -} - -void PlasmaWindowModelTest::testCreateWithUnmappedWindow() -{ - // this test verifies that creating the model just when an unmapped window exists doesn't cause problems - // that is the unmapped window should be added (as expected), but also be removed again - - // create a window in "normal way" - QSignalSpy windowCreatedSpy(m_pw, &PlasmaWindowManagement::windowCreated); - QVERIFY(windowCreatedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(w); - QVERIFY(windowCreatedSpy.wait()); - PlasmaWindow *window = windowCreatedSpy.first().first().value(); - QVERIFY(window); - // make sure the resource is properly created on server side - QCoreApplication::instance()->processEvents(QEventLoop::WaitForMoreEvents); - - QSignalSpy unmappedSpy(window, &PlasmaWindow::unmapped); - QVERIFY(unmappedSpy.isValid()); - QSignalSpy destroyedSpy(window, &PlasmaWindow::destroyed); - QVERIFY(destroyedSpy.isValid()); - // unmap should be triggered, but not yet the destroyed - w->unmap(); - QVERIFY(unmappedSpy.wait()); - QVERIFY(destroyedSpy.isEmpty()); - - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QCOMPARE(model->rowCount(), 1); - QSignalSpy rowRemovedSpy(model, &PlasmaWindowModel::rowsRemoved); - QVERIFY(rowRemovedSpy.isValid()); - QVERIFY(rowRemovedSpy.wait()); - QCOMPARE(rowRemovedSpy.count(), 1); - QCOMPARE(model->rowCount(), 0); - QCOMPARE(destroyedSpy.count(), 1); -} - -void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy_data() -{ - QTest::addColumn("changedSignal"); - QTest::addColumn("setter"); - QTest::addColumn("value"); - - QTest::newRow("active") << &PlasmaWindow::activeChanged << qVariantFromValue(&PlasmaWindowInterface::setActive) << QVariant(true); - QTest::newRow("minimized") << &PlasmaWindow::minimizedChanged << qVariantFromValue(&PlasmaWindowInterface::setMinimized) << QVariant(true); - QTest::newRow("fullscreen") << &PlasmaWindow::fullscreenChanged << qVariantFromValue(&PlasmaWindowInterface::setFullscreen) << QVariant(true); - QTest::newRow("keepAbove") << &PlasmaWindow::keepAboveChanged << qVariantFromValue(&PlasmaWindowInterface::setKeepAbove) << QVariant(true); - QTest::newRow("keepBelow") << &PlasmaWindow::keepBelowChanged << qVariantFromValue(&PlasmaWindowInterface::setKeepBelow) << QVariant(true); - QTest::newRow("maximized") << &PlasmaWindow::maximizedChanged << qVariantFromValue(&PlasmaWindowInterface::setMaximized) << QVariant(true); - QTest::newRow("demandsAttention") << &PlasmaWindow::demandsAttentionChanged << qVariantFromValue(&PlasmaWindowInterface::setDemandsAttention) << QVariant(true); - QTest::newRow("closeable") << &PlasmaWindow::closeableChanged << qVariantFromValue(&PlasmaWindowInterface::setCloseable) << QVariant(true); - QTest::newRow("minimizeable") << &PlasmaWindow::minimizeableChanged << qVariantFromValue(&PlasmaWindowInterface::setMinimizeable) << QVariant(true); - QTest::newRow("maximizeable") << &PlasmaWindow::maximizeableChanged << qVariantFromValue(&PlasmaWindowInterface::setMaximizeable) << QVariant(true); - QTest::newRow("fullscreenable") << &PlasmaWindow::fullscreenableChanged << qVariantFromValue(&PlasmaWindowInterface::setFullscreenable) << QVariant(true); - QTest::newRow("skipTaskbar") << &PlasmaWindow::skipTaskbarChanged << qVariantFromValue(&PlasmaWindowInterface::setSkipTaskbar) << QVariant(true); - QTest::newRow("shadeable") << &PlasmaWindow::shadeableChanged << qVariantFromValue(&PlasmaWindowInterface::setShadeable) << QVariant(true); - QTest::newRow("shaded") << &PlasmaWindow::shadedChanged << qVariantFromValue(&PlasmaWindowInterface::setShaded) << QVariant(true); - QTest::newRow("movable") << &PlasmaWindow::movableChanged << qVariantFromValue(&PlasmaWindowInterface::setMovable) << QVariant(true); - QTest::newRow("resizable") << &PlasmaWindow::resizableChanged << qVariantFromValue(&PlasmaWindowInterface::setResizable) << QVariant(true); - QTest::newRow("vdChangeable") << &PlasmaWindow::virtualDesktopChangeableChanged << qVariantFromValue(&PlasmaWindowInterface::setVirtualDesktopChangeable) << QVariant(true); - QTest::newRow("onallDesktop") << &PlasmaWindow::onAllDesktopsChanged << qVariantFromValue(&PlasmaWindowInterface::setOnAllDesktops) << QVariant(true); - QTest::newRow("title") << &PlasmaWindow::titleChanged << qVariantFromValue(&PlasmaWindowInterface::setTitle) << QVariant(QStringLiteral("foo")); - QTest::newRow("appId") << &PlasmaWindow::appIdChanged << qVariantFromValue(&PlasmaWindowInterface::setAppId) << QVariant(QStringLiteral("foo")); - QTest::newRow("icon" ) << &PlasmaWindow::iconChanged << qVariantFromValue(&PlasmaWindowInterface::setThemedIconName) << QVariant(QStringLiteral("foo")); - QTest::newRow("vd") << &PlasmaWindow::virtualDesktopChanged << qVariantFromValue(&PlasmaWindowInterface::setVirtualDesktop) << QVariant(2u); - QTest::newRow("unmapped") << &PlasmaWindow::unmapped << qVariantFromValue(&PlasmaWindowInterface::unmap) << QVariant(); -} - -void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy() -{ - // this test verifies that changes in a window after the model got destroyed doesn't crash - auto model = m_pw->createWindowModel(); - QVERIFY(model); - QSignalSpy windowCreatedSpy(m_pw, &PlasmaWindowManagement::windowCreated); - QVERIFY(windowCreatedSpy.isValid()); - auto w = m_pwInterface->createWindow(m_pwInterface); - QVERIFY(windowCreatedSpy.wait()); - PlasmaWindow *window = windowCreatedSpy.first().first().value(); - // make sure the resource is properly created on server side - QCoreApplication::instance()->processEvents(QEventLoop::WaitForMoreEvents); - QCOMPARE(model->rowCount(), 1); - delete model; - QFETCH(ClientWindowSignal, changedSignal); - QSignalSpy changedSpy(window, changedSignal); - QVERIFY(changedSpy.isValid()); - QVERIFY(!window->isActive()); - QFETCH(QVariant, setter); - QFETCH(QVariant, value); - if (QMetaType::Type(value.type()) == QMetaType::Bool) { - (w->*(setter.value()))(value.toBool()); - } else if (QMetaType::Type(value.type()) == QMetaType::QString) { - (w->*(setter.value()))(value.toString()); - } else if (QMetaType::Type(value.type()) == QMetaType::UInt) { - (w->*(setter.value()))(value.toUInt()); - } else if (!value.isValid()) { - (w->*(setter.value()))(); - } - - QVERIFY(changedSpy.wait()); -} - -void PlasmaWindowModelTest::testCreateWindowAfterModelDestroy() -{ - // this test verifies that creating a window after the model got destroyed doesn't crash - auto model = m_pw->createWindowModel(); - QVERIFY(model); - delete model; - QSignalSpy windowCreatedSpy(m_pw, &PlasmaWindowManagement::windowCreated); - QVERIFY(windowCreatedSpy.isValid()); - m_pwInterface->createWindow(m_pwInterface); - QVERIFY(windowCreatedSpy.wait()); -} - -QTEST_GUILESS_MAIN(PlasmaWindowModelTest) -#include "test_plasma_window_model.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_pointer_constraints.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_pointer_constraints.cpp --- dwayland-5.57.0.23/autotests/client/test_pointer_constraints.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_pointer_constraints.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,27 +1,13 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client -#include "../../src/client/connection_thread.h" #include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/pointer.h" #include "../../src/client/pointerconstraints.h" @@ -29,18 +15,18 @@ #include "../../src/client/seat.h" #include "../../src/client/surface.h" // server -#include "../../src/server/display.h" #include "../../src/server/compositor_interface.h" -#include "../../src/server/pointerconstraints_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/pointerconstraints_v1_interface.h" #include "../../src/server/seat_interface.h" #include "../../src/server/surface_interface.h" using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; Q_DECLARE_METATYPE(KWayland::Client::PointerConstraints::LifeTime) -Q_DECLARE_METATYPE(KWayland::Server::ConfinedPointerInterface::LifeTime) -Q_DECLARE_METATYPE(KWayland::Server::LockedPointerInterface::LifeTime) +Q_DECLARE_METATYPE(KWaylandServer::ConfinedPointerV1Interface::LifeTime) +Q_DECLARE_METATYPE(KWaylandServer::LockedPointerV1Interface::LifeTime) class TestPointerConstraints : public QObject { @@ -61,7 +47,7 @@ Display *m_display = nullptr; CompositorInterface *m_compositorInterface = nullptr; SeatInterface *m_seatInterface = nullptr; - PointerConstraintsInterface *m_pointerConstraintsInterface = nullptr; + PointerConstraintsV1Interface *m_pointerConstraintsInterface = nullptr; ConnectionThread *m_connection = nullptr; QThread *m_thread = nullptr; EventQueue *m_queue = nullptr; @@ -77,17 +63,14 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_seatInterface = m_display->createSeat(m_display); + m_seatInterface = new SeatInterface(m_display, m_display); m_seatInterface->setHasPointer(true); - m_seatInterface->create(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - m_pointerConstraintsInterface = m_display->createPointerConstraints(PointerConstraintsInterfaceVersion::UnstableV1, m_display); - m_pointerConstraintsInterface->create(); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_pointerConstraintsInterface = new PointerConstraintsV1Interface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -116,12 +99,14 @@ registry.setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - m_compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); + m_compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); QVERIFY(m_compositor); QVERIFY(m_compositor->isValid()); m_pointerConstraints = registry.createPointerConstraints(registry.interface(Registry::Interface::PointerConstraintsUnstableV1).name, - registry.interface(Registry::Interface::PointerConstraintsUnstableV1).version, this); + registry.interface(Registry::Interface::PointerConstraintsUnstableV1).version, + this); QVERIFY(m_pointerConstraints); QVERIFY(m_pointerConstraints->isValid()); @@ -137,10 +122,10 @@ void TestPointerConstraints::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_pointerConstraints) @@ -158,22 +143,24 @@ m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_seatInterface); - CLEANUP(m_pointerConstraintsInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_compositorInterface = nullptr; + m_seatInterface = nullptr; + m_pointerConstraintsInterface = nullptr; } void TestPointerConstraints::testLockPointer_data() { QTest::addColumn("clientLifeTime"); - QTest::addColumn("serverLifeTime"); + QTest::addColumn("serverLifeTime"); QTest::addColumn("hasConstraintAfterUnlock"); QTest::addColumn("pointerChangedCount"); - QTest::newRow("persistent") << PointerConstraints::LifeTime::Persistent << LockedPointerInterface::LifeTime::Persistent << true << 1; - QTest::newRow("oneshot") << PointerConstraints::LifeTime::OneShot << LockedPointerInterface::LifeTime::OneShot << false << 2; + QTest::newRow("persistent") << PointerConstraints::LifeTime::Persistent << LockedPointerV1Interface::LifeTime::Persistent << true << 1; + QTest::newRow("oneshot") << PointerConstraints::LifeTime::OneShot << LockedPointerV1Interface::LifeTime::OneShot << false << 2; } void TestPointerConstraints::testLockPointer() @@ -186,10 +173,10 @@ QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - QVERIFY(serverSurface->lockedPointer().isNull()); - QVERIFY(serverSurface->confinedPointer().isNull()); + QVERIFY(!serverSurface->lockedPointer()); + QVERIFY(!serverSurface->confinedPointer()); // now create the locked pointer QSignalSpy pointerConstraintsChangedSpy(serverSurface, &SurfaceInterface::pointerConstraintsChanged); @@ -205,20 +192,20 @@ auto serverLockedPointer = serverSurface->lockedPointer(); QVERIFY(serverLockedPointer); - QVERIFY(serverSurface->confinedPointer().isNull()); + QVERIFY(!serverSurface->confinedPointer()); QCOMPARE(serverLockedPointer->isLocked(), false); QCOMPARE(serverLockedPointer->region(), QRegion()); - QFETCH(LockedPointerInterface::LifeTime, serverLifeTime); + QFETCH(LockedPointerV1Interface::LifeTime, serverLifeTime); QCOMPARE(serverLockedPointer->lifeTime(), serverLifeTime); // setting to unlocked now should not trigger an unlocked spy serverLockedPointer->setLocked(false); QVERIFY(!unlockedSpy.wait(500)); // try setting a region - QSignalSpy destroyedSpy(serverLockedPointer.data(), &QObject::destroyed); + QSignalSpy destroyedSpy(serverLockedPointer, &QObject::destroyed); QVERIFY(destroyedSpy.isValid()); - QSignalSpy regionChangedSpy(serverLockedPointer.data(), &LockedPointerInterface::regionChanged); + QSignalSpy regionChangedSpy(serverLockedPointer, &LockedPointerV1Interface::regionChanged); QVERIFY(regionChangedSpy.isValid()); lockedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor)); // it's double buffered @@ -233,17 +220,19 @@ QCOMPARE(serverLockedPointer->region(), QRegion()); // let's lock the surface - QSignalSpy lockedChangedSpy(serverLockedPointer.data(), &LockedPointerInterface::lockedChanged); + QSignalSpy lockedChangedSpy(serverLockedPointer, &LockedPointerV1Interface::lockedChanged); QVERIFY(lockedChangedSpy.isValid()); m_seatInterface->setFocusedPointerSurface(serverSurface); QSignalSpy pointerMotionSpy(m_pointer, &Pointer::motion); QVERIFY(pointerMotionSpy.isValid()); - m_seatInterface->setPointerPos(QPoint(0, 1)); + m_seatInterface->notifyPointerMotion(QPoint(0, 1)); + m_seatInterface->notifyPointerFrame(); QVERIFY(pointerMotionSpy.wait()); serverLockedPointer->setLocked(true); QCOMPARE(serverLockedPointer->isLocked(), true); - m_seatInterface->setPointerPos(QPoint(1, 1)); + m_seatInterface->notifyPointerMotion(QPoint(1, 1)); + m_seatInterface->notifyPointerFrame(); QCOMPARE(lockedChangedSpy.count(), 1); QCOMPARE(pointerMotionSpy.count(), 1); QVERIFY(lockedSpy.isEmpty()); @@ -251,7 +240,7 @@ QVERIFY(unlockedSpy.isEmpty()); const QPointF hint = QPointF(1.5, 0.5); - QSignalSpy hintChangedSpy(serverLockedPointer.data(), &LockedPointerInterface::cursorPositionHintChanged); + QSignalSpy hintChangedSpy(serverLockedPointer, &LockedPointerV1Interface::cursorPositionHintChanged); lockedPointer->setCursorPositionHint(hint); QCOMPARE(serverLockedPointer->cursorPositionHint(), QPointF(-1., -1.)); surface->commit(Surface::CommitFlag::None); @@ -263,14 +252,15 @@ QCOMPARE(serverLockedPointer->isLocked(), false); QCOMPARE(serverLockedPointer->cursorPositionHint(), QPointF(-1., -1.)); QCOMPARE(lockedChangedSpy.count(), 2); - QTEST(!serverSurface->lockedPointer().isNull(), "hasConstraintAfterUnlock"); + QTEST(bool(serverSurface->lockedPointer()), "hasConstraintAfterUnlock"); QTEST(pointerConstraintsChangedSpy.count(), "pointerChangedCount"); QVERIFY(unlockedSpy.wait()); QCOMPARE(unlockedSpy.count(), 1); QCOMPARE(lockedSpy.count(), 1); // now motion should work again - m_seatInterface->setPointerPos(QPoint(0, 1)); + m_seatInterface->notifyPointerMotion(QPoint(0, 1)); + m_seatInterface->notifyPointerFrame(); QVERIFY(pointerMotionSpy.wait()); QCOMPARE(pointerMotionSpy.count(), 2); @@ -282,12 +272,12 @@ void TestPointerConstraints::testConfinePointer_data() { QTest::addColumn("clientLifeTime"); - QTest::addColumn("serverLifeTime"); + QTest::addColumn("serverLifeTime"); QTest::addColumn("hasConstraintAfterUnlock"); QTest::addColumn("pointerChangedCount"); - QTest::newRow("persistent") << PointerConstraints::LifeTime::Persistent << ConfinedPointerInterface::LifeTime::Persistent << true << 1; - QTest::newRow("oneshot") << PointerConstraints::LifeTime::OneShot << ConfinedPointerInterface::LifeTime::OneShot << false << 2; + QTest::newRow("persistent") << PointerConstraints::LifeTime::Persistent << ConfinedPointerV1Interface::LifeTime::Persistent << true << 1; + QTest::newRow("oneshot") << PointerConstraints::LifeTime::OneShot << ConfinedPointerV1Interface::LifeTime::OneShot << false << 2; } void TestPointerConstraints::testConfinePointer() @@ -300,10 +290,10 @@ QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - QVERIFY(serverSurface->lockedPointer().isNull()); - QVERIFY(serverSurface->confinedPointer().isNull()); + QVERIFY(!serverSurface->lockedPointer()); + QVERIFY(!serverSurface->confinedPointer()); // now create the confined pointer QSignalSpy pointerConstraintsChangedSpy(serverSurface, &SurfaceInterface::pointerConstraintsChanged); @@ -319,20 +309,20 @@ auto serverConfinedPointer = serverSurface->confinedPointer(); QVERIFY(serverConfinedPointer); - QVERIFY(serverSurface->lockedPointer().isNull()); + QVERIFY(!serverSurface->lockedPointer()); QCOMPARE(serverConfinedPointer->isConfined(), false); QCOMPARE(serverConfinedPointer->region(), QRegion()); - QFETCH(ConfinedPointerInterface::LifeTime, serverLifeTime); + QFETCH(ConfinedPointerV1Interface::LifeTime, serverLifeTime); QCOMPARE(serverConfinedPointer->lifeTime(), serverLifeTime); // setting to unconfined now should not trigger an unconfined spy serverConfinedPointer->setConfined(false); QVERIFY(!unconfinedSpy.wait(500)); // try setting a region - QSignalSpy destroyedSpy(serverConfinedPointer.data(), &QObject::destroyed); + QSignalSpy destroyedSpy(serverConfinedPointer, &QObject::destroyed); QVERIFY(destroyedSpy.isValid()); - QSignalSpy regionChangedSpy(serverConfinedPointer.data(), &ConfinedPointerInterface::regionChanged); + QSignalSpy regionChangedSpy(serverConfinedPointer, &ConfinedPointerV1Interface::regionChanged); QVERIFY(regionChangedSpy.isValid()); confinedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor)); // it's double buffered @@ -347,7 +337,7 @@ QCOMPARE(serverConfinedPointer->region(), QRegion()); // let's confine the surface - QSignalSpy confinedChangedSpy(serverConfinedPointer.data(), &ConfinedPointerInterface::confinedChanged); + QSignalSpy confinedChangedSpy(serverConfinedPointer, &ConfinedPointerV1Interface::confinedChanged); QVERIFY(confinedChangedSpy.isValid()); m_seatInterface->setFocusedPointerSurface(serverSurface); serverConfinedPointer->setConfined(true); @@ -361,7 +351,7 @@ serverConfinedPointer->setConfined(false); QCOMPARE(serverConfinedPointer->isConfined(), false); QCOMPARE(confinedChangedSpy.count(), 2); - QTEST(!serverSurface->confinedPointer().isNull(), "hasConstraintAfterUnlock"); + QTEST(bool(serverSurface->confinedPointer()), "hasConstraintAfterUnlock"); QTEST(pointerConstraintsChangedSpy.count(), "pointerChangedCount"); QVERIFY(unconfinedSpy.wait()); QCOMPARE(unconfinedSpy.count(), 1); @@ -374,7 +364,7 @@ enum class Constraint { Lock, - Confine + Confine, }; Q_DECLARE_METATYPE(Constraint) diff -Nru dwayland-5.57.0.23/autotests/client/test_primaryselect.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_primaryselect.cpp --- dwayland-5.57.0.23/autotests/client/test_primaryselect.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_primaryselect.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// client -#include "../../src/client/connection_thread.h" -#include "../../src/client/compositor.h" -#include "../../src/client/primaryselectiondevice_v1.h" -#include "../../src/client/primaryselectiondevicemanager_v1.h" -#include "../../src/client/primaryselectionsource_v1.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/keyboard.h" -#include "../../src/client/registry.h" -#include "../../src/client/seat.h" -#include "../../src/client/surface.h" -// server -#include "../../src/server/compositor_interface.h" -#include "../../src/server/primaryselectiondevicemanager_v1_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/seat_interface.h" - -using namespace KWayland::Client; -using namespace KWayland::Server; - - -class PrimarySelectionTest : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void init(); - void cleanup(); - void testClearOnEnter(); - -private: - Display *m_display = nullptr; - CompositorInterface *m_compositorInterface = nullptr; - SeatInterface *m_seatInterface = nullptr; - PrimarySelectionDeviceManagerV1Interface *m_ddmInterface = nullptr; - - struct Connection { - ConnectionThread *connection = nullptr; - QThread *thread = nullptr; - EventQueue *queue = nullptr; - Compositor *compositor = nullptr; - Seat *seat = nullptr; - PrimarySelectionDeviceManagerV1 *ddm = nullptr; - Keyboard *keyboard = nullptr; - PrimarySelectionDeviceV1 *dataDevice = nullptr; - }; - bool setupConnection(Connection *c); - void cleanupConnection(Connection *c); - - Connection m_client1; - Connection m_client2; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-selection-0"); - -void PrimarySelectionTest::init() -{ - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - m_display->createShm(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - m_seatInterface = m_display->createSeat(m_display); - m_seatInterface->setHasKeyboard(true); - m_seatInterface->create(); - m_ddmInterface = m_display->createPrimarySelectionDeviceManagerV1(m_display); - m_ddmInterface->create(); - - // setup connection - setupConnection(&m_client1); - setupConnection(&m_client2); -} - -bool PrimarySelectionTest::setupConnection(Connection* c) -{ - c->connection = new ConnectionThread; - QSignalSpy connectedSpy(c->connection, &ConnectionThread::connected); - if (!connectedSpy.isValid()) { - return false; - } - c->connection->setSocketName(s_socketName); - - c->thread = new QThread(this); - c->connection->moveToThread(c->thread); - c->thread->start(); - - c->connection->initConnection(); - if (!connectedSpy.wait(500)) { - return false; - } - - c->queue = new EventQueue(this); - c->queue->setup(c->connection); - - Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Registry::interfacesAnnounced); - if (!interfacesAnnouncedSpy.isValid()) { - return false; - } - registry.setEventQueue(c->queue); - registry.create(c->connection); - if (!registry.isValid()) { - return false; - } - registry.setup(); - if (!interfacesAnnouncedSpy.wait(500)) { - return false; - } - - c->compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version, - this); - if (!c->compositor->isValid()) { - return false; - } - c->ddm = registry.createPrimarySelectionDeviceManagerV1(registry.interface(Registry::Interface::PrimarySelectionDeviceManagerV1).name, - registry.interface(Registry::Interface::PrimarySelectionDeviceManagerV1).version, - this); - if (!c->ddm->isValid()) { - return false; - } - c->seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, - registry.interface(Registry::Interface::Seat).version, - this); - if (!c->seat->isValid()) { - return false; - } - QSignalSpy keyboardSpy(c->seat, &Seat::hasKeyboardChanged); - if (!keyboardSpy.isValid()) { - return false; - } - if (!keyboardSpy.wait(500)) { - return false; - } - if (!c->seat->hasKeyboard()) { - return false; - } - c->keyboard = c->seat->createKeyboard(c->seat); - if (!c->keyboard->isValid()) { - return false; - } - c->dataDevice = c->ddm->getPrimarySelectDevice(c->seat, this); - if (!c->dataDevice->isValid()) { - return false; - } - - return true; -} - -void PrimarySelectionTest::cleanup() -{ - cleanupConnection(&m_client1); - cleanupConnection(&m_client2); -#define CLEANUP(variable) \ - delete variable; \ - variable = nullptr; - - CLEANUP(m_ddmInterface) - CLEANUP(m_seatInterface) - CLEANUP(m_compositorInterface) - CLEANUP(m_display) -#undef CLEANUP -} - -void PrimarySelectionTest::cleanupConnection(Connection *c) -{ - delete c->dataDevice; - c->dataDevice = nullptr; - delete c->keyboard; - c->keyboard = nullptr; - delete c->ddm; - c->ddm = nullptr; - delete c->seat; - c->seat = nullptr; - delete c->compositor; - c->compositor = nullptr; - delete c->queue; - c->queue = nullptr; - if (c->connection) { - c->connection->deleteLater(); - c->connection = nullptr; - } - if (c->thread) { - c->thread->quit(); - c->thread->wait(); - delete c->thread; - c->thread = nullptr; - } -} - -void PrimarySelectionTest::testClearOnEnter() -{ - // this test verifies that the selection is cleared prior to keyboard enter if there is no current selection - QSignalSpy selectionClearedClient1Spy(m_client1.dataDevice, &PrimarySelectionDeviceV1::selectionCleared); - QVERIFY(selectionClearedClient1Spy.isValid()); - QSignalSpy keyboardEnteredClient1Spy(m_client1.keyboard, &Keyboard::entered); - QVERIFY(keyboardEnteredClient1Spy.isValid()); - - // now create a Surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - QVERIFY(surfaceCreatedSpy.isValid()); - QScopedPointer s1(m_client1.compositor->createSurface()); - QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface1 = surfaceCreatedSpy.first().first().value(); - QVERIFY(serverSurface1); - - // pass this surface keyboard focus - m_seatInterface->setFocusedKeyboardSurface(serverSurface1); - // should get a clear - QVERIFY(selectionClearedClient1Spy.wait()); - - // let's set a selection - QScopedPointer dataSource(m_client1.ddm->createPrimarySelectSource()); - dataSource->offer(QStringLiteral("text/plain")); - m_client1.dataDevice->setSelection(keyboardEnteredClient1Spy.first().first().value(), dataSource.data()); - - // now let's bring in client 2 - QSignalSpy selectionOfferedClient2Spy(m_client2.dataDevice, &PrimarySelectionDeviceV1::selectionOffered); - QVERIFY(selectionOfferedClient2Spy.isValid()); - QSignalSpy selectionClearedClient2Spy(m_client2.dataDevice, &PrimarySelectionDeviceV1::selectionCleared); - QVERIFY(selectionClearedClient2Spy.isValid()); - QSignalSpy keyboardEnteredClient2Spy(m_client2.keyboard, &Keyboard::entered); - QVERIFY(keyboardEnteredClient2Spy.isValid()); - QScopedPointer s2(m_client2.compositor->createSurface()); - QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface2 = surfaceCreatedSpy.last().first().value(); - QVERIFY(serverSurface2); - - // entering that surface should give a selection offer - m_seatInterface->setFocusedKeyboardSurface(serverSurface2); - QVERIFY(selectionOfferedClient2Spy.wait()); - QVERIFY(selectionClearedClient2Spy.isEmpty()); - - // set a data source but without offers - QScopedPointer dataSource2(m_client2.ddm->createPrimarySelectSource()); - m_client2.dataDevice->setSelection(keyboardEnteredClient2Spy.first().first().value(), dataSource2.data()); - QVERIFY(selectionOfferedClient2Spy.wait()); - -} - - -QTEST_GUILESS_MAIN(PrimarySelectionTest) -#include "test_primaryselect.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_remote_access.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_remote_access.cpp --- dwayland-5.57.0.23/autotests/client/test_remote_access.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_remote_access.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,487 +0,0 @@ -/******************************************************************** -Copyright 2016 Oleg Chernovskiy -Copyright 2018 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// client -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/remote_access.h" -#include "../../src/client/registry.h" -#include "../../src/client/output.h" -// server -#include "../../src/server/display.h" -#include "../../src/server/output_interface.h" -#include "../../src/server/remote_access_interface.h" - -#include - -using namespace KWayland::Client; -using namespace KWayland::Server; - -Q_DECLARE_METATYPE(const BufferHandle *) -Q_DECLARE_METATYPE(const RemoteBuffer *) -Q_DECLARE_METATYPE(const void *) - -class RemoteAccessTest : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void init(); - void cleanup(); - - void testSendReleaseSingle(); - void testSendReleaseMultiple(); - void testSendReleaseCrossScreen(); - void testSendClientGone(); - void testSendReceiveClientGone(); - -private: - Display *m_display = nullptr; - OutputInterface *m_outputInterface[2] = {nullptr}; - RemoteAccessManagerInterface *m_remoteAccessInterface = nullptr; -}; - -class MockupClient : public QObject -{ - Q_OBJECT -public: - MockupClient(QObject *parent = nullptr); - ~MockupClient(); - - void bindOutput(int index); - - ConnectionThread *connection = nullptr; - QThread *thread = nullptr; - EventQueue *queue = nullptr; - Registry *registry = nullptr; - RemoteAccessManager *remoteAccess = nullptr; - Output *outputs[2] = {nullptr}; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-remote-access-0"); - -MockupClient::MockupClient(QObject *parent) - : QObject(parent) -{ - // setup connection - connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(connection, &ConnectionThread::connected); - QVERIFY(connectedSpy.isValid()); - connection->setSocketName(s_socketName); - - thread = new QThread(this); - connection->moveToThread(thread); - thread->start(); - - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - queue = new EventQueue(this); - queue->setup(connection); - - registry = new Registry(this); - QSignalSpy interfacesAnnouncedSpy(registry, &Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - registry->setEventQueue(queue); - registry->create(connection); - QVERIFY(registry->isValid()); - registry->setup(); - QVERIFY(interfacesAnnouncedSpy.wait()); - - remoteAccess = registry->createRemoteAccessManager( - registry->interface(Registry::Interface::RemoteAccessManager).name, - registry->interface(Registry::Interface::RemoteAccessManager).version, - this); - QVERIFY(remoteAccess->isValid()); - connection->flush(); -} - -MockupClient::~MockupClient() -{ -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ - } - CLEANUP(outputs[0]) - CLEANUP(outputs[1]) - CLEANUP(remoteAccess) - CLEANUP(queue) - CLEANUP(registry) - if (thread) { - if (connection) { - connection->flush(); - connection->deleteLater(); - connection = nullptr; - } - - thread->quit(); - thread->wait(); - delete thread; - thread = nullptr; - } -#undef CLEANUP -} - -void MockupClient::bindOutput(int index) -{ - // client-bound output - outputs[index] = registry->createOutput(registry->interfaces(Registry::Interface::Output)[index].name, - registry->interfaces(Registry::Interface::Output)[index].version, - this); - QVERIFY(outputs[index]->isValid()); - connection->flush(); -} - -void RemoteAccessTest::init() -{ - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - m_display->createShm(); - - auto initOutputIface = [this](int i) { - m_outputInterface[i] = m_display->createOutput(); - m_outputInterface[i]->create(); - }; - initOutputIface(0); - initOutputIface(1); - - m_remoteAccessInterface = m_display->createRemoteAccessManager(); - m_remoteAccessInterface->create(); - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); -} - -void RemoteAccessTest::cleanup() -{ -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ - } - CLEANUP(m_outputInterface[0]) - CLEANUP(m_outputInterface[1]) - CLEANUP(m_remoteAccessInterface) - CLEANUP(m_display) -#undef CLEANUP -} - -void RemoteAccessTest::testSendReleaseSingle() -{ - // this test verifies that a buffer is sent to client and returned back - - // setup - QVERIFY(!m_remoteAccessInterface->isBound()); - auto *client = new MockupClient(this); - client->bindOutput(0); - - m_display->dispatchEvents(); - - QVERIFY(m_remoteAccessInterface->isBound()); // we have one client now - QSignalSpy bufferReadySpy(client->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy.isValid()); - - BufferHandle *buf = new BufferHandle(); - QTemporaryFile *tmpFile = new QTemporaryFile(this); - tmpFile->open(); - - buf->setFd(tmpFile->handle()); - buf->setSize(50, 50); - buf->setFormat(100500); - buf->setStride(7800); - m_remoteAccessInterface->sendBufferReady(m_outputInterface[0], buf); - - // receive buffer - QVERIFY(bufferReadySpy.wait()); - auto rbuf = bufferReadySpy.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy(rbuf, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy.isValid()); - - // wait for params - QVERIFY(paramsObtainedSpy.wait()); - // client fd is different, not subject to check - QCOMPARE(rbuf->width(), 50u); - QCOMPARE(rbuf->height(), 50u); - QCOMPARE(rbuf->format(), 100500u); - QCOMPARE(rbuf->stride(), 7800u); - - // release - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); - delete rbuf; - QVERIFY(bufferReleasedSpy.wait()); - - // cleanup - delete buf; - delete client; - m_display->dispatchEvents(); - QVERIFY(!m_remoteAccessInterface->isBound()); -} - -void RemoteAccessTest::testSendReleaseMultiple() -{ - // this test verifies that a buffer is sent to 2 clients and returned back - - // setup - QVERIFY(!m_remoteAccessInterface->isBound()); - auto *client1 = new MockupClient(this); - auto *client2 = new MockupClient(this); - client1->bindOutput(0); - client2->bindOutput(0); - m_display->dispatchEvents(); - QVERIFY(m_remoteAccessInterface->isBound()); // now we have 2 clients - - QSignalSpy bufferReadySpy1(client1->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy1.isValid()); - QSignalSpy bufferReadySpy2(client2->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy2.isValid()); - - BufferHandle *buf = new BufferHandle(); - QTemporaryFile *tmpFile = new QTemporaryFile(this); - tmpFile->open(); - - buf->setFd(tmpFile->handle()); - buf->setSize(50, 50); - buf->setFormat(100500); - buf->setStride(7800); - m_remoteAccessInterface->sendBufferReady(m_outputInterface[0], buf); - - // wait for event loop - QVERIFY(bufferReadySpy1.wait()); - if (bufferReadySpy2.size() == 0) { - QVERIFY(bufferReadySpy2.wait()); - } - - // receive buffer at client 1 - QCOMPARE(bufferReadySpy1.size(), 1); - auto rbuf1 = bufferReadySpy1.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy1(rbuf1, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy1.isValid()); - - // receive buffer at client 2 - QCOMPARE(bufferReadySpy2.size(), 1); - auto rbuf2 = bufferReadySpy2.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy2(rbuf2, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy2.isValid()); - - // wait for event loop - QVERIFY(paramsObtainedSpy1.wait()); - QCOMPARE(paramsObtainedSpy1.size(), 1); - if (paramsObtainedSpy2.size() == 0) { - QVERIFY(paramsObtainedSpy2.wait()); - } - QCOMPARE(paramsObtainedSpy2.size(), 1); - - // release - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); - delete rbuf1; - QVERIFY(!bufferReleasedSpy.wait(1000)); // one client released, second still holds buffer! - - delete rbuf2; - QVERIFY(bufferReleasedSpy.wait()); // all clients released, buffer should be freed - - // cleanup - delete buf; - delete client1; - delete client2; - m_display->dispatchEvents(); - QVERIFY(!m_remoteAccessInterface->isBound()); -} - -void RemoteAccessTest::testSendReleaseCrossScreen() -{ - // this test verifies that multiple buffers for multiple screens are sent to - // multiple clients and returned back - - // setup - QVERIFY(!m_remoteAccessInterface->isBound()); - auto *client1 = new MockupClient(this); - auto *client2 = new MockupClient(this); - client1->bindOutput(1); - client2->bindOutput(0); - m_display->dispatchEvents(); - QVERIFY(m_remoteAccessInterface->isBound()); // now we have 2 clients - - QSignalSpy bufferReadySpy1(client1->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy1.isValid()); - QSignalSpy bufferReadySpy2(client2->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy2.isValid()); - - BufferHandle *buf1 = new BufferHandle(); - QTemporaryFile *tmpFile1 = new QTemporaryFile(this); - tmpFile1->open(); - - BufferHandle *buf2 = new BufferHandle(); - QTemporaryFile *tmpFile2 = new QTemporaryFile(this); - tmpFile2->open(); - - buf1->setFd(tmpFile1->handle()); - buf1->setSize(50, 50); - buf1->setFormat(100500); - buf1->setStride(7800); - - buf2->setFd(tmpFile2->handle()); - buf2->setSize(100, 100); - buf2->setFormat(100500); - buf2->setStride(7800); - - m_remoteAccessInterface->sendBufferReady(m_outputInterface[0], buf1); - m_remoteAccessInterface->sendBufferReady(m_outputInterface[1], buf2); - - // wait for event loop - QVERIFY(bufferReadySpy1.wait()); - if (bufferReadySpy2.size() == 0) { - QVERIFY(bufferReadySpy2.wait()); - } - - // receive buffer at client 1 - QCOMPARE(bufferReadySpy1.size(), 1); - auto rbuf1 = bufferReadySpy1.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy1(rbuf1, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy1.isValid()); - - // receive buffer at client 2 - QCOMPARE(bufferReadySpy2.size(), 1); - auto rbuf2 = bufferReadySpy2.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy2(rbuf2, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy2.isValid()); - - // wait for event loop - QVERIFY(paramsObtainedSpy1.wait()); - if (paramsObtainedSpy2.size() == 0) { - QVERIFY(paramsObtainedSpy2.wait()); - } - QCOMPARE(paramsObtainedSpy1.size(), 1); - QCOMPARE(paramsObtainedSpy2.size(), 1); - - // release - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); - delete rbuf1; - QVERIFY(bufferReleasedSpy.wait()); - - delete rbuf2; - QVERIFY(bufferReleasedSpy.wait()); - - QCOMPARE(bufferReleasedSpy.size(), 2); - - // cleanup - delete buf1; - delete buf2; - delete client1; - delete client2; - m_display->dispatchEvents(); - QVERIFY(!m_remoteAccessInterface->isBound()); -} - -void RemoteAccessTest::testSendClientGone() -{ - // this test verifies that when buffer is sent and client is gone, server will release buffer correctly - QVERIFY(!m_remoteAccessInterface->isBound()); - auto *client = new MockupClient(this); - client->bindOutput(0); - m_display->dispatchEvents(); - - QVERIFY(m_remoteAccessInterface->isBound()); // we have one client now - QSignalSpy bufferReadySpy(client->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy.isValid()); - - BufferHandle *buf = new BufferHandle(); - QTemporaryFile *tmpFile = new QTemporaryFile(this); - tmpFile->open(); - - buf->setFd(tmpFile->handle()); - buf->setSize(50, 50); - buf->setFormat(100500); - buf->setStride(7800); - m_remoteAccessInterface->sendBufferReady(m_outputInterface[0], buf); - - // release forcefully - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); - delete client; - QVERIFY(bufferReleasedSpy.wait()); - - // cleanup - delete buf; - m_display->dispatchEvents(); - QVERIFY(!m_remoteAccessInterface->isBound()); -} - -void RemoteAccessTest::testSendReceiveClientGone() -{ - // this test verifies that when buffer is sent, received and client is gone, - // both client and server will release buffer correctly - QVERIFY(!m_remoteAccessInterface->isBound()); - auto *client = new MockupClient(this); - client->bindOutput(0); - m_display->dispatchEvents(); - - QVERIFY(m_remoteAccessInterface->isBound()); // we have one client now - QSignalSpy bufferReadySpy(client->remoteAccess, &RemoteAccessManager::bufferReady); - QVERIFY(bufferReadySpy.isValid()); - - BufferHandle *buf = new BufferHandle(); - QTemporaryFile *tmpFile = new QTemporaryFile(this); - tmpFile->open(); - - buf->setFd(tmpFile->handle()); - buf->setSize(50, 50); - buf->setFormat(100500); - buf->setStride(7800); - m_remoteAccessInterface->sendBufferReady(m_outputInterface[0], buf); - - // receive buffer - QVERIFY(bufferReadySpy.wait()); - auto rbuf = bufferReadySpy.takeFirst()[1].value(); - QSignalSpy paramsObtainedSpy(rbuf, &RemoteBuffer::parametersObtained); - QVERIFY(paramsObtainedSpy.isValid()); - - // wait for params - QVERIFY(paramsObtainedSpy.wait()); - // client fd is different, not subject to check - QCOMPARE(rbuf->width(), 50u); - QCOMPARE(rbuf->height(), 50u); - QCOMPARE(rbuf->format(), 100500u); - QCOMPARE(rbuf->stride(), 7800u); - - // release forcefully - QSignalSpy bufferReleasedSpy(m_remoteAccessInterface, &RemoteAccessManagerInterface::bufferReleased); - QVERIFY(bufferReleasedSpy.isValid()); - delete client; - QVERIFY(bufferReleasedSpy.wait()); - - // cleanup - delete buf; - m_display->dispatchEvents(); - QVERIFY(!m_remoteAccessInterface->isBound()); -} - -QTEST_GUILESS_MAIN(RemoteAccessTest) -#include "test_remote_access.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_selection.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_selection.cpp --- dwayland-5.57.0.23/autotests/client/test_selection.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_selection.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,27 +1,13 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client -#include "../../src/client/connection_thread.h" #include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" #include "../../src/client/datadevice.h" #include "../../src/client/datadevicemanager.h" #include "../../src/client/datasource.h" @@ -37,8 +23,7 @@ #include "../../src/server/seat_interface.h" using namespace KWayland::Client; -using namespace KWayland::Server; - +using namespace KWaylandServer; class SelectionTest : public QObject { @@ -77,24 +62,21 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - m_seatInterface = m_display->createSeat(m_display); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_seatInterface = new SeatInterface(m_display, m_display); m_seatInterface->setHasKeyboard(true); - m_seatInterface->create(); - m_ddmInterface = m_display->createDataDeviceManager(m_display); - m_ddmInterface->create(); + m_ddmInterface = new DataDeviceManagerInterface(m_display, m_display); // setup connection setupConnection(&m_client1); setupConnection(&m_client2); } -bool SelectionTest::setupConnection(Connection* c) +bool SelectionTest::setupConnection(Connection *c) { c->connection = new ConnectionThread; QSignalSpy connectedSpy(c->connection, &ConnectionThread::connected); @@ -130,9 +112,8 @@ return false; } - c->compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version, - this); + c->compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); if (!c->compositor->isValid()) { return false; } @@ -142,9 +123,7 @@ if (!c->ddm->isValid()) { return false; } - c->seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, - registry.interface(Registry::Interface::Seat).version, - this); + c->seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, registry.interface(Registry::Interface::Seat).version, this); if (!c->seat->isValid()) { return false; } @@ -174,15 +153,16 @@ { cleanupConnection(&m_client1); cleanupConnection(&m_client2); -#define CLEANUP(variable) \ - delete variable; \ - variable = nullptr; - - CLEANUP(m_ddmInterface) - CLEANUP(m_seatInterface) - CLEANUP(m_compositorInterface) +#define CLEANUP(variable) \ + delete variable; \ + variable = nullptr; + CLEANUP(m_display) #undef CLEANUP + // these are the children of the display + m_ddmInterface = nullptr; + m_seatInterface = nullptr; + m_compositorInterface = nullptr; } void SelectionTest::cleanupConnection(Connection *c) @@ -224,7 +204,7 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer s1(m_client1.compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface1 = surfaceCreatedSpy.first().first().value(); + auto serverSurface1 = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface1); // pass this surface keyboard focus @@ -246,7 +226,7 @@ QVERIFY(keyboardEnteredClient2Spy.isValid()); QScopedPointer s2(m_client2.compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface2 = surfaceCreatedSpy.last().first().value(); + auto serverSurface2 = surfaceCreatedSpy.last().first().value(); QVERIFY(serverSurface2); // entering that surface should give a selection offer diff -Nru dwayland-5.57.0.23/autotests/client/test_server_side_decoration.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_server_side_decoration.cpp --- dwayland-5.57.0.23/autotests/client/test_server_side_decoration.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_server_side_decoration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,34 +1,20 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/server_decoration_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/registry.h" #include "../../src/client/server_decoration.h" #include "../../src/client/surface.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/server_decoration_interface.h" class TestServerSideDecoration : public QObject { @@ -48,9 +34,9 @@ void testSurfaceDestroy(); private: - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::CompositorInterface *m_compositorInterface = nullptr; - KWayland::Server::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; + KWaylandServer::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -68,11 +54,11 @@ void TestServerSideDecoration::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -107,20 +93,16 @@ QVERIFY(m_registry->isValid()); m_registry->setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = m_registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_serverSideDecorationManagerInterface = m_display->createServerSideDecorationManager(m_display); - m_serverSideDecorationManagerInterface->create(); - QVERIFY(m_serverSideDecorationManagerInterface->isValid()); + m_serverSideDecorationManagerInterface = new ServerSideDecorationManagerInterface(m_display, m_display); QVERIFY(serverSideDecoManagerSpy.wait()); m_serverSideDecorationManager = m_registry->createServerSideDecorationManager(serverSideDecoManagerSpy.first().first().value(), - serverSideDecoManagerSpy.first().last().value(), this); + serverSideDecoManagerSpy.first().last().value(), + this); } void TestServerSideDecoration::cleanup() @@ -157,11 +139,11 @@ void TestServerSideDecoration::testCreate_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("serverMode"); QTest::addColumn("clientMode"); - QTest::newRow("none") << ServerSideDecorationManagerInterface::Mode::None << ServerSideDecoration::Mode::None; + QTest::newRow("none") << ServerSideDecorationManagerInterface::Mode::None << ServerSideDecoration::Mode::None; QTest::newRow("client") << ServerSideDecorationManagerInterface::Mode::Client << ServerSideDecoration::Mode::Client; QTest::newRow("server") << ServerSideDecorationManagerInterface::Mode::Server << ServerSideDecoration::Mode::Server; } @@ -169,8 +151,8 @@ void TestServerSideDecoration::testCreate() { using namespace KWayland::Client; - using namespace KWayland::Server; - QFETCH(KWayland::Server::ServerSideDecorationManagerInterface::Mode, serverMode); + using namespace KWaylandServer; + QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, serverMode); m_serverSideDecorationManagerInterface->setDefaultMode(serverMode); QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), serverMode); @@ -183,7 +165,7 @@ QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); + auto serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(!ServerSideDecorationInterface::get(serverSurface)); // create server side deco @@ -194,7 +176,7 @@ QVERIFY(decorationCreated.wait()); - auto serverDeco = decorationCreated.first().first().value(); + auto serverDeco = decorationCreated.first().first().value(); QVERIFY(serverDeco); QCOMPARE(serverDeco, ServerSideDecorationInterface::get(serverSurface)); QCOMPARE(serverDeco->surface(), serverSurface); @@ -214,7 +196,7 @@ void TestServerSideDecoration::testRequest_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("defaultMode"); QTest::addColumn("clientMode"); QTest::addColumn("clientRequestMode"); @@ -227,13 +209,13 @@ const auto clientClient = ServerSideDecoration::Mode::Client; const auto clientServer = ServerSideDecoration::Mode::Server; - QTest::newRow("none->none") << serverNone << clientNone << clientNone << serverNone; - QTest::newRow("none->client") << serverNone << clientNone << clientClient << serverClient; - QTest::newRow("none->server") << serverNone << clientNone << clientServer << serverServer; - QTest::newRow("client->none") << serverClient << clientClient << clientNone << serverNone; + QTest::newRow("none->none") << serverNone << clientNone << clientNone << serverNone; + QTest::newRow("none->client") << serverNone << clientNone << clientClient << serverClient; + QTest::newRow("none->server") << serverNone << clientNone << clientServer << serverServer; + QTest::newRow("client->none") << serverClient << clientClient << clientNone << serverNone; QTest::newRow("client->client") << serverClient << clientClient << clientClient << serverClient; QTest::newRow("client->server") << serverClient << clientClient << clientServer << serverServer; - QTest::newRow("server->none") << serverServer << clientServer << clientNone << serverNone; + QTest::newRow("server->none") << serverServer << clientServer << clientNone << serverNone; QTest::newRow("server->client") << serverServer << clientServer << clientClient << serverClient; QTest::newRow("server->server") << serverServer << clientServer << clientServer << serverServer; } @@ -241,8 +223,8 @@ void TestServerSideDecoration::testRequest() { using namespace KWayland::Client; - using namespace KWayland::Server; - QFETCH(KWayland::Server::ServerSideDecorationManagerInterface::Mode, defaultMode); + using namespace KWaylandServer; + QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, defaultMode); m_serverSideDecorationManagerInterface->setDefaultMode(defaultMode); QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), defaultMode); @@ -260,10 +242,10 @@ QVERIFY(modeChangedSpy.isValid()); QVERIFY(decorationCreated.wait()); - auto serverDeco = decorationCreated.first().first().value(); + auto serverDeco = decorationCreated.first().first().value(); QVERIFY(serverDeco); - QSignalSpy modeSpy(serverDeco, &ServerSideDecorationInterface::modeRequested); - QVERIFY(modeSpy.isValid()); + QSignalSpy preferredModeChangedSpy(serverDeco, &ServerSideDecorationInterface::preferredModeChanged); + QVERIFY(preferredModeChangedSpy.isValid()); // after binding the client should get the default mode QVERIFY(modeChangedSpy.wait()); @@ -276,10 +258,10 @@ // mode not yet changed QTEST(serverSideDecoration->mode(), "clientMode"); - QVERIFY(modeSpy.wait()); - QCOMPARE(modeSpy.count(), 1); + QVERIFY(preferredModeChangedSpy.wait()); + QCOMPARE(preferredModeChangedSpy.count(), 1); QFETCH(ServerSideDecorationManagerInterface::Mode, serverRequestedMode); - QCOMPARE(modeSpy.first().first().value(), serverRequestedMode); + QCOMPARE(serverDeco->preferredMode(), serverRequestedMode); // mode not yet changed QCOMPARE(serverDeco->mode(), defaultMode); @@ -295,7 +277,7 @@ void TestServerSideDecoration::testSurfaceDestroy() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated); @@ -304,11 +286,11 @@ QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); + auto serverSurface = serverSurfaceCreated.first().first().value(); QScopedPointer serverSideDecoration(m_serverSideDecorationManager->create(surface.data())); QCOMPARE(serverSideDecoration->mode(), ServerSideDecoration::Mode::None); QVERIFY(decorationCreated.wait()); - auto serverDeco = decorationCreated.first().first().value(); + auto serverDeco = decorationCreated.first().first().value(); QVERIFY(serverDeco); // destroy the parent surface diff -Nru dwayland-5.57.0.23/autotests/client/test_server_side_decoration_palette.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_server_side_decoration_palette.cpp --- dwayland-5.57.0.23/autotests/client/test_server_side_decoration_palette.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_server_side_decoration_palette.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,22 @@ -/******************************************************************** -Copyright 2017 David Edmundson -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2017 David Edmundson + SPDX-FileCopyrightText: 2014 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/server_decoration_palette_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" -#include "../../src/client/surface.h" #include "../../src/client/server_decoration_palette.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/server_decoration_palette_interface.h" +#include "../../src/client/surface.h" using namespace KWayland::Client; @@ -47,9 +32,9 @@ void testCreateAndSet(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ServerSideDecorationPaletteManager *m_paletteManager; @@ -72,10 +57,10 @@ void TestServerSideDecorationPalette::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -111,27 +96,23 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_paletteManagerInterface = m_display->createServerSideDecorationPaletteManager(m_display); - m_paletteManagerInterface->create(); - QVERIFY(m_paletteManagerInterface->isValid()); + m_paletteManagerInterface = new ServerSideDecorationPaletteManagerInterface(m_display, m_display); QVERIFY(registrySpy.wait()); - m_paletteManager = registry.createServerSideDecorationPaletteManager(registrySpy.first().first().value(), registrySpy.first().last().value(), this); + m_paletteManager = + registry.createServerSideDecorationPaletteManager(registrySpy.first().first().value(), registrySpy.first().last().value(), this); } void TestServerSideDecorationPalette::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_paletteManager) @@ -154,25 +135,25 @@ void TestServerSideDecorationPalette::testCreateAndSet() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWayland::Server::ServerSideDecorationPaletteManagerInterface::paletteCreated); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWaylandServer::ServerSideDecorationPaletteManagerInterface::paletteCreated); QVERIFY(!m_paletteManagerInterface->paletteForSurface(serverSurface)); auto palette = m_paletteManager->create(surface.data(), surface.data()); QVERIFY(paletteCreatedSpy.wait()); - auto paletteInterface = paletteCreatedSpy.first().first().value(); + auto paletteInterface = paletteCreatedSpy.first().first().value(); QCOMPARE(m_paletteManagerInterface->paletteForSurface(serverSurface), paletteInterface); QCOMPARE(paletteInterface->palette(), QString()); - QSignalSpy changedSpy(paletteInterface, &KWayland::Server::ServerSideDecorationPaletteInterface::paletteChanged); + QSignalSpy changedSpy(paletteInterface, &KWaylandServer::ServerSideDecorationPaletteInterface::paletteChanged); palette->setPalette("foobar"); diff -Nru dwayland-5.57.0.23/autotests/client/test_shadow.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_shadow.cpp --- dwayland-5.57.0.23/autotests/client/test_shadow.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_shadow.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,40 +1,26 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // client -#include "../../src/client/connection_thread.h" #include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/registry.h" #include "../../src/client/shadow.h" #include "../../src/client/shm_pool.h" #include "../../src/client/surface.h" // server -#include "../../src/server/buffer_interface.h" -#include "../../src/server/display.h" #include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" #include "../../src/server/shadow_interface.h" +#include "../../src/server/shmclientbuffer.h" using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; class ShadowTest : public QObject { @@ -66,14 +52,12 @@ { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - m_shadowInterface = m_display->createShadowManager(m_display); - m_shadowInterface->create(); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_shadowInterface = new ShadowManagerInterface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -100,26 +84,22 @@ registry.setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - m_shm = registry.createShmPool(registry.interface(Registry::Interface::Shm).name, - registry.interface(Registry::Interface::Shm).version, - this); + m_shm = registry.createShmPool(registry.interface(Registry::Interface::Shm).name, registry.interface(Registry::Interface::Shm).version, this); QVERIFY(m_shm->isValid()); - m_compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version, - this); + m_compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); QVERIFY(m_compositor->isValid()); - m_shadow = registry.createShadowManager(registry.interface(Registry::Interface::Shadow).name, - registry.interface(Registry::Interface::Shadow).version, - this); + m_shadow = + registry.createShadowManager(registry.interface(Registry::Interface::Shadow).name, registry.interface(Registry::Interface::Shadow).version, this); QVERIFY(m_shadow->isValid()); } void ShadowTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_shm) CLEANUP(m_compositor) @@ -136,10 +116,12 @@ m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_shadowInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_compositorInterface = nullptr; + m_shadowInterface = nullptr; } void ShadowTest::testCreateShadow() @@ -149,7 +131,7 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); // a surface without anything should not have a Shadow QVERIFY(!serverSurface->shadow()); @@ -189,6 +171,15 @@ QVERIFY(!serverSurface->shadow()); } +static QImage bufferToImage(ClientBuffer *clientBuffer) +{ + auto shmBuffer = qobject_cast(clientBuffer); + if (shmBuffer) { + return shmBuffer->data(); + } + return QImage(); +} + void ShadowTest::testShadowElements() { // this test verifies that all shadow elements are correctly passed to the server @@ -197,7 +188,7 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); QSignalSpy shadowChangedSpy(serverSurface, &SurfaceInterface::shadowChanged); QVERIFY(shadowChangedSpy.isValid()); @@ -236,47 +227,26 @@ auto serverShadow = serverSurface->shadow(); QVERIFY(serverShadow); QCOMPARE(serverShadow->offset(), QMarginsF(1, 2, 3, 4)); - QCOMPARE(serverShadow->topLeft()->data(), topLeftImage); - QCOMPARE(serverShadow->top()->data(), topImage); - QCOMPARE(serverShadow->topRight()->data(), topRightImage); - QCOMPARE(serverShadow->right()->data(), rightImage); - QCOMPARE(serverShadow->bottomRight()->data(), bottomRightImage); - QCOMPARE(serverShadow->bottom()->data(), bottomImage); - QCOMPARE(serverShadow->bottomLeft()->data(), bottomLeftImage); - QCOMPARE(serverShadow->left()->data(), leftImage); - - // try to destroy the buffer - // first attach one buffer - shadow->attachTopLeft(m_shm->createBuffer(topLeftImage)); - // create a destroyed signal - QSignalSpy destroyedSpy(serverShadow->topLeft(), &BufferInterface::aboutToBeDestroyed); - QVERIFY(destroyedSpy.isValid()); - delete m_shm; - m_shm = nullptr; - QVERIFY(destroyedSpy.wait()); - - // now all buffers should be gone - // TODO: does that need a signal? - QVERIFY(!serverShadow->topLeft()); - QVERIFY(!serverShadow->top()); - QVERIFY(!serverShadow->topRight()); - QVERIFY(!serverShadow->right()); - QVERIFY(!serverShadow->bottomRight()); - QVERIFY(!serverShadow->bottom()); - QVERIFY(!serverShadow->bottomLeft()); - QVERIFY(!serverShadow->left()); + QCOMPARE(bufferToImage(serverShadow->topLeft()), topLeftImage); + QCOMPARE(bufferToImage(serverShadow->top()), topImage); + QCOMPARE(bufferToImage(serverShadow->topRight()), topRightImage); + QCOMPARE(bufferToImage(serverShadow->right()), rightImage); + QCOMPARE(bufferToImage(serverShadow->bottomRight()), bottomRightImage); + QCOMPARE(bufferToImage(serverShadow->bottom()), bottomImage); + QCOMPARE(bufferToImage(serverShadow->bottomLeft()), bottomLeftImage); + QCOMPARE(bufferToImage(serverShadow->left()), leftImage); } void ShadowTest::testSurfaceDestroy() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); + auto serverSurface = serverSurfaceCreated.first().first().value(); QSignalSpy shadowChangedSpy(serverSurface, &SurfaceInterface::shadowChanged); QVERIFY(shadowChangedSpy.isValid()); diff -Nru dwayland-5.57.0.23/autotests/client/test_shm_pool.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_shm_pool.cpp --- dwayland-5.57.0.23/autotests/client/test_shm_pool.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_shm_pool.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,20 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt -#include #include +#include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/surface_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" -#include "../../src/client/surface.h" #include "../../src/client/registry.h" #include "../../src/client/shm_pool.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/surface_interface.h" +#include "../../src/client/surface.h" class TestShmPool : public QObject { @@ -47,11 +32,9 @@ void testCreateBufferFromImageWithAlpha(); void testCreateBufferFromData(); void testReuseBuffer(); - void testDestroy(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; + KWaylandServer::Display *m_display; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shmPool; @@ -63,7 +46,6 @@ TestShmPool::TestShmPool(QObject *parent) : QObject(parent) , m_display(nullptr) - , m_compositorInterface(nullptr) , m_connection(nullptr) , m_compositor(nullptr) , m_shmPool(nullptr) @@ -73,16 +55,16 @@ void TestShmPool::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -93,7 +75,7 @@ QVERIFY(connectedSpy.wait()); KWayland::Client::Registry registry; - QSignalSpy shmSpy(®istry, SIGNAL(shmAnnounced(quint32,quint32))); + QSignalSpy shmSpy(®istry, &KWayland::Client::Registry::shmAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -169,7 +151,7 @@ { QVERIFY(m_shmPool->isValid()); QImage img(24, 24, QImage::Format_ARGB32_Premultiplied); - img.fill(QColor(255,0,0,100)); //red with alpha + img.fill(QColor(255, 0, 0, 100)); // red with alpha QVERIFY(!img.isNull()); auto buffer = m_shmPool->createBuffer(img).toStrongRef(); QVERIFY(buffer); @@ -222,27 +204,5 @@ QVERIFY(buffer4 != buffer3); } -void TestShmPool::testDestroy() -{ - using namespace KWayland::Client; - connect(m_connection, &ConnectionThread::connectionDied, m_shmPool, &ShmPool::destroy); - QVERIFY(m_shmPool->isValid()); - - // let's create one Buffer - m_shmPool->getBuffer(QSize(10, 10), 8); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the pool should be destroyed; - QVERIFY(!m_shmPool->isValid()); - - // calling destroy again should not fail - m_shmPool->destroy(); -} - QTEST_GUILESS_MAIN(TestShmPool) #include "test_shm_pool.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_text_input.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_text_input.cpp --- dwayland-5.57.0.23/autotests/client/test_text_input.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_text_input.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,936 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// client -#include "../../src/client/compositor.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/keyboard.h" -#include "../../src/client/registry.h" -#include "../../src/client/seat.h" -#include "../../src/client/surface.h" -#include "../../src/client/textinput.h" -// server -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/textinput_interface.h" - -using namespace KWayland::Client; -using namespace KWayland::Server; - -class TextInputTest : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void init(); - void cleanup(); - - void testEnterLeave_data(); - void testEnterLeave(); - void testShowHidePanel_data(); - void testShowHidePanel(); - void testCursorRectangle_data(); - void testCursorRectangle(); - void testPreferredLanguage_data(); - void testPreferredLanguage(); - void testReset_data(); - void testReset(); - void testSurroundingText_data(); - void testSurroundingText(); - void testContentHints_data(); - void testContentHints(); - void testContentPurpose_data(); - void testContentPurpose(); - void testTextDirection_data(); - void testTextDirection(); - void testLanguage_data(); - void testLanguage(); - void testKeyEvent_data(); - void testKeyEvent(); - void testPreEdit_data(); - void testPreEdit(); - void testCommit_data(); - void testCommit(); - -private: - SurfaceInterface *waitForSurface(); - TextInput *createTextInput(TextInputInterfaceVersion version); - Display *m_display = nullptr; - SeatInterface *m_seatInterface = nullptr; - CompositorInterface *m_compositorInterface = nullptr; - TextInputManagerInterface *m_textInputManagerV0Interface = nullptr; - TextInputManagerInterface *m_textInputManagerV2Interface = nullptr; - ConnectionThread *m_connection = nullptr; - QThread *m_thread = nullptr; - EventQueue *m_queue = nullptr; - Seat *m_seat = nullptr; - Keyboard *m_keyboard = nullptr; - Compositor *m_compositor = nullptr; - TextInputManager *m_textInputManagerV0 = nullptr; - TextInputManager *m_textInputManagerV2 = nullptr; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-text-input-0"); - -void TextInputTest::init() -{ - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - m_display->createShm(); - m_seatInterface = m_display->createSeat(); - m_seatInterface->setHasKeyboard(true); - m_seatInterface->setHasTouch(true); - m_seatInterface->create(); - m_compositorInterface = m_display->createCompositor(); - m_compositorInterface->create(); - m_textInputManagerV0Interface = m_display->createTextInputManager(TextInputInterfaceVersion::UnstableV0); - m_textInputManagerV0Interface->create(); - m_textInputManagerV2Interface = m_display->createTextInputManager(TextInputInterfaceVersion::UnstableV2); - m_textInputManagerV2Interface->create(); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); - QVERIFY(connectedSpy.isValid()); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new EventQueue(this); - m_queue->setup(m_connection); - - Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - registry.setEventQueue(m_queue); - registry.create(m_connection); - QVERIFY(registry.isValid()); - registry.setup(); - QVERIFY(interfacesAnnouncedSpy.wait()); - - m_seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, - registry.interface(Registry::Interface::Seat).version, - this); - QVERIFY(m_seat->isValid()); - QSignalSpy hasKeyboardSpy(m_seat, &Seat::hasKeyboardChanged); - QVERIFY(hasKeyboardSpy.isValid()); - QVERIFY(hasKeyboardSpy.wait()); - m_keyboard = m_seat->createKeyboard(this); - QVERIFY(m_keyboard->isValid()); - - m_compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version, - this); - QVERIFY(m_compositor->isValid()); - - m_textInputManagerV0 = registry.createTextInputManager(registry.interface(Registry::Interface::TextInputManagerUnstableV0).name, - registry.interface(Registry::Interface::TextInputManagerUnstableV0).version, - this); - QVERIFY(m_textInputManagerV0->isValid()); - - m_textInputManagerV2 = registry.createTextInputManager(registry.interface(Registry::Interface::TextInputManagerUnstableV2).name, - registry.interface(Registry::Interface::TextInputManagerUnstableV2).version, - this); - QVERIFY(m_textInputManagerV2->isValid()); -} - -void TextInputTest::cleanup() -{ -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ - } - CLEANUP(m_textInputManagerV0) - CLEANUP(m_textInputManagerV2) - CLEANUP(m_keyboard) - CLEANUP(m_seat) - CLEANUP(m_compositor) - CLEANUP(m_queue) - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - - CLEANUP(m_textInputManagerV0Interface) - CLEANUP(m_textInputManagerV2Interface) - CLEANUP(m_compositorInterface) - CLEANUP(m_seatInterface) - CLEANUP(m_display) -#undef CLEANUP -} - -SurfaceInterface *TextInputTest::waitForSurface() -{ - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - if (!surfaceCreatedSpy.isValid()) { - return nullptr; - } - if (!surfaceCreatedSpy.wait(500)) { - return nullptr; - } - if (surfaceCreatedSpy.count() != 1) { - return nullptr; - } - return surfaceCreatedSpy.first().first().value(); -} - -TextInput *TextInputTest::createTextInput(TextInputInterfaceVersion version) -{ - switch (version) { - case TextInputInterfaceVersion::UnstableV0: - return m_textInputManagerV0->createTextInput(m_seat); - case TextInputInterfaceVersion::UnstableV2: - return m_textInputManagerV2->createTextInput(m_seat); - default: - Q_UNREACHABLE(); - return nullptr; - } -} - -void TextInputTest::testEnterLeave_data() -{ - QTest::addColumn("version"); - QTest::addColumn("updatesDirectly"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0 << false; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2 << true; -} - -void TextInputTest::testEnterLeave() -{ - // this test verifies that enter leave are sent correctly - QScopedPointer surface(m_compositor->createSurface()); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QVERIFY(!textInput.isNull()); - QSignalSpy enteredSpy(textInput.data(), &TextInput::entered); - QVERIFY(enteredSpy.isValid()); - QSignalSpy leftSpy(textInput.data(), &TextInput::left); - QVERIFY(leftSpy.isValid()); - QSignalSpy textInputChangedSpy(m_seatInterface, &SeatInterface::focusedTextInputChanged); - QVERIFY(textInputChangedSpy.isValid()); - - // now let's try to enter it - QVERIFY(!m_seatInterface->focusedTextInput()); - QVERIFY(!m_seatInterface->focusedTextInputSurface()); - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - QCOMPARE(m_seatInterface->focusedTextInputSurface(), serverSurface); - // text input not yet set for the surface - QFETCH(bool, updatesDirectly); - QCOMPARE(bool(m_seatInterface->focusedTextInput()), updatesDirectly); - QCOMPARE(textInputChangedSpy.isEmpty(), !updatesDirectly); - textInput->enable(surface.data()); - // this should trigger on server side - if (!updatesDirectly) { - QVERIFY(textInputChangedSpy.wait()); - } - QCOMPARE(textInputChangedSpy.count(), 1); - auto serverTextInput = m_seatInterface->focusedTextInput(); - QVERIFY(serverTextInput); - QCOMPARE(serverTextInput->interfaceVersion(), version); - QSignalSpy enabledChangedSpy(serverTextInput, &TextInputInterface::enabledChanged); - QVERIFY(enabledChangedSpy.isValid()); - if (updatesDirectly) { - QVERIFY(enabledChangedSpy.wait()); - enabledChangedSpy.clear(); - } - QCOMPARE(serverTextInput->surface().data(), serverSurface); - QVERIFY(serverTextInput->isEnabled()); - - // and trigger an enter - if (enteredSpy.isEmpty()) { - QVERIFY(enteredSpy.wait()); - } - QCOMPARE(enteredSpy.count(), 1); - QCOMPARE(textInput->enteredSurface(), surface.data()); - - // now trigger a leave - m_seatInterface->setFocusedKeyboardSurface(nullptr); - QCOMPARE(textInputChangedSpy.count(), 2); - QVERIFY(!m_seatInterface->focusedTextInput()); - QVERIFY(leftSpy.wait()); - QVERIFY(!textInput->enteredSurface()); - QVERIFY(serverTextInput->isEnabled()); - - // if we enter again we should directly get the text input as it's still activated - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - QCOMPARE(textInputChangedSpy.count(), 3); - QVERIFY(m_seatInterface->focusedTextInput()); - QVERIFY(enteredSpy.wait()); - QCOMPARE(enteredSpy.count(), 2); - QCOMPARE(textInput->enteredSurface(), surface.data()); - QVERIFY(serverTextInput->isEnabled()); - - // let's deactivate on client side - textInput->disable(surface.data()); - QVERIFY(enabledChangedSpy.wait()); - QCOMPARE(enabledChangedSpy.count(), 1); - QVERIFY(!serverTextInput->isEnabled()); - // does not trigger a leave - QCOMPARE(textInputChangedSpy.count(), 3); - // should still be the same text input - QCOMPARE(m_seatInterface->focusedTextInput(), serverTextInput); - //reset - textInput->enable(surface.data()); - QVERIFY(enabledChangedSpy.wait()); - - //trigger an enter again and leave, but this - //time we try sending an event after the surface is unbound - //but not yet destroyed. It should work without errors - QCOMPARE(textInput->enteredSurface(), surface.data()); - connect(serverSurface, &Resource::unbound, [=]() { - m_seatInterface->setFocusedKeyboardSurface(nullptr); - }); - //delete the client and wait for the server to catch up - QSignalSpy unboundSpy(serverSurface, &QObject::destroyed); - surface.reset(); - QVERIFY(unboundSpy.wait()); - QVERIFY(leftSpy.wait()); - QVERIFY(!textInput->enteredSurface()); -} - -void TextInputTest::testShowHidePanel_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testShowHidePanel() -{ - // this test verifies that the requests for show/hide panel work - // and that status is properly sent to the client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - QSignalSpy showPanelRequestedSpy(ti, &TextInputInterface::requestShowInputPanel); - QVERIFY(showPanelRequestedSpy.isValid()); - QSignalSpy hidePanelRequestedSpy(ti, &TextInputInterface::requestHideInputPanel); - QVERIFY(hidePanelRequestedSpy.isValid()); - QSignalSpy inputPanelStateChangedSpy(textInput.data(), &TextInput::inputPanelStateChanged); - QVERIFY(inputPanelStateChangedSpy.isValid()); - - QCOMPARE(textInput->isInputPanelVisible(), false); - textInput->showInputPanel(); - QVERIFY(showPanelRequestedSpy.wait()); - ti->setInputPanelState(true, QRect(0, 0, 0, 0)); - QVERIFY(inputPanelStateChangedSpy.wait()); - QCOMPARE(textInput->isInputPanelVisible(), true); - - textInput->hideInputPanel(); - QVERIFY(hidePanelRequestedSpy.wait()); - ti->setInputPanelState(false, QRect(0, 0, 0, 0)); - QVERIFY(inputPanelStateChangedSpy.wait()); - QCOMPARE(textInput->isInputPanelVisible(), false); -} - -void TextInputTest::testCursorRectangle_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testCursorRectangle() -{ - // this test verifies that passing the cursor rectangle from client to server works - // and that setting visibility state from server to client works - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - QCOMPARE(ti->cursorRectangle(), QRect()); - QSignalSpy cursorRectangleChangedSpy(ti, &TextInputInterface::cursorRectangleChanged); - QVERIFY(cursorRectangleChangedSpy.isValid()); - - textInput->setCursorRectangle(QRect(10, 20, 30, 40)); - QVERIFY(cursorRectangleChangedSpy.wait()); - QCOMPARE(ti->cursorRectangle(), QRect(10, 20, 30, 40)); -} - -void TextInputTest::testPreferredLanguage_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testPreferredLanguage() -{ - // this test verifies that passing the preferred language from client to server works - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - QVERIFY(ti->preferredLanguage().isEmpty()); - - QSignalSpy preferredLanguageChangedSpy(ti, &TextInputInterface::preferredLanguageChanged); - QVERIFY(preferredLanguageChangedSpy.isValid()); - textInput->setPreferredLanguage(QStringLiteral("foo")); - QVERIFY(preferredLanguageChangedSpy.wait()); - QCOMPARE(ti->preferredLanguage(), QStringLiteral("foo").toUtf8()); -} - -void TextInputTest::testReset_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testReset() -{ - // this test verifies that the reset request is properly passed from client to server - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - QSignalSpy resetRequestedSpy(ti, &TextInputInterface::requestReset); - QVERIFY(resetRequestedSpy.isValid()); - - textInput->reset(); - QVERIFY(resetRequestedSpy.wait()); -} - -void TextInputTest::testSurroundingText_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testSurroundingText() -{ - // this test verifies that surrounding text is properly passed around - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - QVERIFY(ti->surroundingText().isEmpty()); - QCOMPARE(ti->surroundingTextCursorPosition(), 0); - QCOMPARE(ti->surroundingTextSelectionAnchor(), 0); - - QSignalSpy surroundingTextChangedSpy(ti, &TextInputInterface::surroundingTextChanged); - QVERIFY(surroundingTextChangedSpy.isValid()); - - textInput->setSurroundingText(QStringLiteral("100 €, 100 $"), 5, 6); - QVERIFY(surroundingTextChangedSpy.wait()); - QCOMPARE(ti->surroundingText(), QStringLiteral("100 €, 100 $").toUtf8()); - QCOMPARE(ti->surroundingTextCursorPosition(), QStringLiteral("100 €, 100 $").toUtf8().indexOf(',')); - QCOMPARE(ti->surroundingTextSelectionAnchor(), QStringLiteral("100 €, 100 $").toUtf8().indexOf(' ', ti->surroundingTextCursorPosition())); -} - -void TextInputTest::testContentHints_data() -{ - QTest::addColumn("version"); - QTest::addColumn("clientHints"); - QTest::addColumn("serverHints"); - - QTest::newRow("completion/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::AutoCompletion) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCompletion); - QTest::newRow("Correction/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::AutoCorrection) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCorrection); - QTest::newRow("Capitalization/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::AutoCapitalization) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCapitalization); - QTest::newRow("Lowercase/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::LowerCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::LowerCase); - QTest::newRow("Uppercase/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::UpperCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::UpperCase); - QTest::newRow("Titlecase/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::TitleCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::TitleCase); - QTest::newRow("HiddenText/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::HiddenText) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::HiddenText); - QTest::newRow("SensitiveData/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::SensitiveData) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::SensitiveData); - QTest::newRow("Latin/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::Latin) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::Latin); - QTest::newRow("Multiline/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentHints(TextInput::ContentHint::MultiLine) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::MultiLine); - - QTest::newRow("autos/v0") << TextInputInterfaceVersion::UnstableV0 - << (TextInput::ContentHint::AutoCompletion | TextInput::ContentHint::AutoCorrection | TextInput::ContentHint::AutoCapitalization) - << (TextInputInterface::ContentHint::AutoCompletion | TextInputInterface::ContentHint::AutoCorrection | TextInputInterface::ContentHint::AutoCapitalization); - - // all has combinations which don't make sense - what's both lowercase and uppercase? - QTest::newRow("all/v0") << TextInputInterfaceVersion::UnstableV0 - << (TextInput::ContentHint::AutoCompletion | - TextInput::ContentHint::AutoCorrection | - TextInput::ContentHint::AutoCapitalization | - TextInput::ContentHint::LowerCase | - TextInput::ContentHint::UpperCase | - TextInput::ContentHint::TitleCase | - TextInput::ContentHint::HiddenText | - TextInput::ContentHint::SensitiveData | - TextInput::ContentHint::Latin | - TextInput::ContentHint::MultiLine) - << (TextInputInterface::ContentHint::AutoCompletion | - TextInputInterface::ContentHint::AutoCorrection | - TextInputInterface::ContentHint::AutoCapitalization | - TextInputInterface::ContentHint::LowerCase | - TextInputInterface::ContentHint::UpperCase | - TextInputInterface::ContentHint::TitleCase | - TextInputInterface::ContentHint::HiddenText | - TextInputInterface::ContentHint::SensitiveData | - TextInputInterface::ContentHint::Latin | - TextInputInterface::ContentHint::MultiLine); - - // same for version 2 - - QTest::newRow("completion/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::AutoCompletion) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCompletion); - QTest::newRow("Correction/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::AutoCorrection) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCorrection); - QTest::newRow("Capitalization/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::AutoCapitalization) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::AutoCapitalization); - QTest::newRow("Lowercase/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::LowerCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::LowerCase); - QTest::newRow("Uppercase/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::UpperCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::UpperCase); - QTest::newRow("Titlecase/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::TitleCase) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::TitleCase); - QTest::newRow("HiddenText/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::HiddenText) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::HiddenText); - QTest::newRow("SensitiveData/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::SensitiveData) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::SensitiveData); - QTest::newRow("Latin/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::Latin) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::Latin); - QTest::newRow("Multiline/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentHints(TextInput::ContentHint::MultiLine) << TextInputInterface::ContentHints(TextInputInterface::ContentHint::MultiLine); - - QTest::newRow("autos/v2") << TextInputInterfaceVersion::UnstableV2 - << (TextInput::ContentHint::AutoCompletion | TextInput::ContentHint::AutoCorrection | TextInput::ContentHint::AutoCapitalization) - << (TextInputInterface::ContentHint::AutoCompletion | TextInputInterface::ContentHint::AutoCorrection | TextInputInterface::ContentHint::AutoCapitalization); - - // all has combinations which don't make sense - what's both lowercase and uppercase? - QTest::newRow("all/v2") << TextInputInterfaceVersion::UnstableV2 - << (TextInput::ContentHint::AutoCompletion | - TextInput::ContentHint::AutoCorrection | - TextInput::ContentHint::AutoCapitalization | - TextInput::ContentHint::LowerCase | - TextInput::ContentHint::UpperCase | - TextInput::ContentHint::TitleCase | - TextInput::ContentHint::HiddenText | - TextInput::ContentHint::SensitiveData | - TextInput::ContentHint::Latin | - TextInput::ContentHint::MultiLine) - << (TextInputInterface::ContentHint::AutoCompletion | - TextInputInterface::ContentHint::AutoCorrection | - TextInputInterface::ContentHint::AutoCapitalization | - TextInputInterface::ContentHint::LowerCase | - TextInputInterface::ContentHint::UpperCase | - TextInputInterface::ContentHint::TitleCase | - TextInputInterface::ContentHint::HiddenText | - TextInputInterface::ContentHint::SensitiveData | - TextInputInterface::ContentHint::Latin | - TextInputInterface::ContentHint::MultiLine); -} - -void TextInputTest::testContentHints() -{ - // this test verifies that content hints are properly passed from client to server - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - QCOMPARE(ti->contentHints(), TextInputInterface::ContentHints()); - - QSignalSpy contentTypeChangedSpy(ti, &TextInputInterface::contentTypeChanged); - QVERIFY(contentTypeChangedSpy.isValid()); - QFETCH(TextInput::ContentHints, clientHints); - textInput->setContentType(clientHints, TextInput::ContentPurpose::Normal); - QVERIFY(contentTypeChangedSpy.wait()); - QTEST(ti->contentHints(), "serverHints"); - - // setting to same should not trigger an update - textInput->setContentType(clientHints, TextInput::ContentPurpose::Normal); - QVERIFY(!contentTypeChangedSpy.wait(100)); - - // unsetting should work - textInput->setContentType(TextInput::ContentHints(), TextInput::ContentPurpose::Normal); - QVERIFY(contentTypeChangedSpy.wait()); - QCOMPARE(ti->contentHints(), TextInputInterface::ContentHints()); -} - -void TextInputTest::testContentPurpose_data() -{ - QTest::addColumn("version"); - QTest::addColumn("clientPurpose"); - QTest::addColumn("serverPurpose"); - - QTest::newRow("Alpha/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Alpha << TextInputInterface::ContentPurpose::Alpha; - QTest::newRow("Digits/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Digits << TextInputInterface::ContentPurpose::Digits; - QTest::newRow("Number/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Number << TextInputInterface::ContentPurpose::Number; - QTest::newRow("Phone/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Phone << TextInputInterface::ContentPurpose::Phone; - QTest::newRow("Url/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Url << TextInputInterface::ContentPurpose::Url; - QTest::newRow("Email/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Email << TextInputInterface::ContentPurpose::Email; - QTest::newRow("Name/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Name << TextInputInterface::ContentPurpose::Name; - QTest::newRow("Password/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Password << TextInputInterface::ContentPurpose::Password; - QTest::newRow("Date/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Date << TextInputInterface::ContentPurpose::Date; - QTest::newRow("Time/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Time << TextInputInterface::ContentPurpose::Time; - QTest::newRow("Datetime/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::DateTime << TextInputInterface::ContentPurpose::DateTime; - QTest::newRow("Terminal/v0") << TextInputInterfaceVersion::UnstableV0 << TextInput::ContentPurpose::Terminal << TextInputInterface::ContentPurpose::Terminal; - - QTest::newRow("Alpha/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Alpha << TextInputInterface::ContentPurpose::Alpha; - QTest::newRow("Digits/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Digits << TextInputInterface::ContentPurpose::Digits; - QTest::newRow("Number/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Number << TextInputInterface::ContentPurpose::Number; - QTest::newRow("Phone/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Phone << TextInputInterface::ContentPurpose::Phone; - QTest::newRow("Url/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Url << TextInputInterface::ContentPurpose::Url; - QTest::newRow("Email/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Email << TextInputInterface::ContentPurpose::Email; - QTest::newRow("Name/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Name << TextInputInterface::ContentPurpose::Name; - QTest::newRow("Password/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Password << TextInputInterface::ContentPurpose::Password; - QTest::newRow("Date/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Date << TextInputInterface::ContentPurpose::Date; - QTest::newRow("Time/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Time << TextInputInterface::ContentPurpose::Time; - QTest::newRow("Datetime/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::DateTime << TextInputInterface::ContentPurpose::DateTime; - QTest::newRow("Terminal/v2") << TextInputInterfaceVersion::UnstableV2 << TextInput::ContentPurpose::Terminal << TextInputInterface::ContentPurpose::Terminal; -} - -void TextInputTest::testContentPurpose() -{ - // this test verifies that content purpose are properly passed from client to server - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - QCOMPARE(ti->contentPurpose(), TextInputInterface::ContentPurpose::Normal); - - QSignalSpy contentTypeChangedSpy(ti, &TextInputInterface::contentTypeChanged); - QVERIFY(contentTypeChangedSpy.isValid()); - QFETCH(TextInput::ContentPurpose, clientPurpose); - textInput->setContentType(TextInput::ContentHints(), clientPurpose); - QVERIFY(contentTypeChangedSpy.wait()); - QTEST(ti->contentPurpose(), "serverPurpose"); - - // setting to same should not trigger an update - textInput->setContentType(TextInput::ContentHints(), clientPurpose); - QVERIFY(!contentTypeChangedSpy.wait(100)); - - // unsetting should work - textInput->setContentType(TextInput::ContentHints(), TextInput::ContentPurpose::Normal); - QVERIFY(contentTypeChangedSpy.wait()); - QCOMPARE(ti->contentPurpose(), TextInputInterface::ContentPurpose::Normal); -} - -void TextInputTest::testTextDirection_data() -{ - QTest::addColumn("version"); - QTest::addColumn("textDirection"); - - QTest::newRow("ltr/v0") << TextInputInterfaceVersion::UnstableV0 << Qt::LeftToRight; - QTest::newRow("rtl/v0") << TextInputInterfaceVersion::UnstableV0 << Qt::RightToLeft; - - QTest::newRow("ltr/v2") << TextInputInterfaceVersion::UnstableV2 << Qt::LeftToRight; - QTest::newRow("rtl/v2") << TextInputInterfaceVersion::UnstableV2 << Qt::RightToLeft; -} - -void TextInputTest::testTextDirection() -{ - // this test verifies that the text direction is sent from server to client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - // default should be auto - QCOMPARE(textInput->textDirection(), Qt::LayoutDirectionAuto); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - // let's send the new text direction - QSignalSpy textDirectionChangedSpy(textInput.data(), &TextInput::textDirectionChanged); - QVERIFY(textDirectionChangedSpy.isValid()); - QFETCH(Qt::LayoutDirection, textDirection); - ti->setTextDirection(textDirection); - QVERIFY(textDirectionChangedSpy.wait()); - QCOMPARE(textInput->textDirection(), textDirection); - // setting again should not change - ti->setTextDirection(textDirection); - QVERIFY(!textDirectionChangedSpy.wait(100)); - - // setting back to auto - ti->setTextDirection(Qt::LayoutDirectionAuto); - QVERIFY(textDirectionChangedSpy.wait()); - QCOMPARE(textInput->textDirection(), Qt::LayoutDirectionAuto); -} - -void TextInputTest::testLanguage_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testLanguage() -{ - // this test verifies that language is sent from server to client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - // default should be empty - QVERIFY(textInput->language().isEmpty()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - // let's send the new language - QSignalSpy langugageChangedSpy(textInput.data(), &TextInput::languageChanged); - QVERIFY(langugageChangedSpy.isValid()); - ti->setLanguage(QByteArrayLiteral("foo")); - QVERIFY(langugageChangedSpy.wait()); - QCOMPARE(textInput->language(), QByteArrayLiteral("foo")); - // setting to same should not trigger - ti->setLanguage(QByteArrayLiteral("foo")); - QVERIFY(!langugageChangedSpy.wait(100)); - // but to something else should trigger again - ti->setLanguage(QByteArrayLiteral("bar")); - QVERIFY(langugageChangedSpy.wait()); - QCOMPARE(textInput->language(), QByteArrayLiteral("bar")); -} - -void TextInputTest::testKeyEvent_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testKeyEvent() -{ - qRegisterMetaType(); - qRegisterMetaType(); - // this test verifies that key events are properly sent to the client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - // TODO: test modifiers - QSignalSpy keyEventSpy(textInput.data(), &TextInput::keyEvent); - QVERIFY(keyEventSpy.isValid()); - m_seatInterface->setTimestamp(100); - ti->keysymPressed(2); - QVERIFY(keyEventSpy.wait()); - QCOMPARE(keyEventSpy.count(), 1); - QCOMPARE(keyEventSpy.last().at(0).value(), 2u); - QCOMPARE(keyEventSpy.last().at(1).value(), TextInput::KeyState::Pressed); - QCOMPARE(keyEventSpy.last().at(2).value(), Qt::KeyboardModifiers()); - QCOMPARE(keyEventSpy.last().at(3).value(), 100u); - m_seatInterface->setTimestamp(101); - ti->keysymReleased(2); - QVERIFY(keyEventSpy.wait()); - QCOMPARE(keyEventSpy.count(), 2); - QCOMPARE(keyEventSpy.last().at(0).value(), 2u); - QCOMPARE(keyEventSpy.last().at(1).value(), TextInput::KeyState::Released); - QCOMPARE(keyEventSpy.last().at(2).value(), Qt::KeyboardModifiers()); - QCOMPARE(keyEventSpy.last().at(3).value(), 101u); -} - -void TextInputTest::testPreEdit_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testPreEdit() -{ - // this test verifies that pre-edit is correctly passed to the client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - // verify default values - QVERIFY(textInput->composingText().isEmpty()); - QVERIFY(textInput->composingFallbackText().isEmpty()); - QCOMPARE(textInput->composingTextCursorPosition(), 0); - - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - // now let's pass through some pre-edit events - QSignalSpy composingTextChangedSpy(textInput.data(), &TextInput::composingTextChanged); - QVERIFY(composingTextChangedSpy.isValid()); - ti->setPreEditCursor(1); - ti->preEdit(QByteArrayLiteral("foo"), QByteArrayLiteral("bar")); - QVERIFY(composingTextChangedSpy.wait()); - QCOMPARE(composingTextChangedSpy.count(), 1); - QCOMPARE(textInput->composingText(), QByteArrayLiteral("foo")); - QCOMPARE(textInput->composingFallbackText(), QByteArrayLiteral("bar")); - QCOMPARE(textInput->composingTextCursorPosition(), 1); - - // when no pre edit cursor is sent, it's at end of text - ti->preEdit(QByteArrayLiteral("foobar"), QByteArray()); - QVERIFY(composingTextChangedSpy.wait()); - QCOMPARE(composingTextChangedSpy.count(), 2); - QCOMPARE(textInput->composingText(), QByteArrayLiteral("foobar")); - QCOMPARE(textInput->composingFallbackText(), QByteArray()); - QCOMPARE(textInput->composingTextCursorPosition(), 6); -} - -void TextInputTest::testCommit_data() -{ - QTest::addColumn("version"); - - QTest::newRow("UnstableV0") << TextInputInterfaceVersion::UnstableV0; - QTest::newRow("UnstableV2") << TextInputInterfaceVersion::UnstableV2; -} - -void TextInputTest::testCommit() -{ - // this test verifies that the commit is handled correctly by the client - QScopedPointer surface(m_compositor->createSurface()); - auto serverSurface = waitForSurface(); - QVERIFY(serverSurface); - QFETCH(TextInputInterfaceVersion, version); - QScopedPointer textInput(createTextInput(version)); - QVERIFY(!textInput.isNull()); - // verify default values - QCOMPARE(textInput->commitText(), QByteArray()); - QCOMPARE(textInput->cursorPosition(), 0); - QCOMPARE(textInput->anchorPosition(), 0); - QCOMPARE(textInput->deleteSurroundingText().beforeLength, 0u); - QCOMPARE(textInput->deleteSurroundingText().afterLength, 0u); - - textInput->enable(surface.data()); - m_connection->flush(); - m_display->dispatchEvents(); - - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - auto ti = m_seatInterface->focusedTextInput(); - QVERIFY(ti); - - // now let's commit - QSignalSpy committedSpy(textInput.data(), &TextInput::committed); - QVERIFY(committedSpy.isValid()); - ti->setCursorPosition(3, 4); - ti->deleteSurroundingText(2, 1); - ti->commit(QByteArrayLiteral("foo")); - - QVERIFY(committedSpy.wait()); - QCOMPARE(textInput->commitText(), QByteArrayLiteral("foo")); - QCOMPARE(textInput->cursorPosition(), 3); - QCOMPARE(textInput->anchorPosition(), 4); - QCOMPARE(textInput->deleteSurroundingText().beforeLength, 2u); - QCOMPARE(textInput->deleteSurroundingText().afterLength, 1u); -} - -QTEST_GUILESS_MAIN(TextInputTest) -#include "test_text_input.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_text_input_v2.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_text_input_v2.cpp --- dwayland-5.57.0.23/autotests/client/test_text_input_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_text_input_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,793 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +// Qt +#include +// client +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/keyboard.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/surface.h" +#include "../../src/client/textinput.h" +// server +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/textinput.h" +#include "../../src/server/textinput_v2_interface.h" + +using namespace KWayland::Client; +using namespace KWaylandServer; + +class TextInputTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void init(); + void cleanup(); + + void testEnterLeave_data(); + void testEnterLeave(); + void testFocusedBeforeCreateTextInput(); + void testShowHidePanel(); + void testCursorRectangle(); + void testPreferredLanguage(); + void testReset(); + void testSurroundingText(); + void testContentHints_data(); + void testContentHints(); + void testContentPurpose_data(); + void testContentPurpose(); + void testTextDirection_data(); + void testTextDirection(); + void testLanguage(); + void testKeyEvent(); + void testPreEdit(); + void testCommit(); + +private: + SurfaceInterface *waitForSurface(); + TextInput *createTextInput(); + Display *m_display = nullptr; + SeatInterface *m_seatInterface = nullptr; + CompositorInterface *m_compositorInterface = nullptr; + TextInputManagerV2Interface *m_textInputManagerV2Interface = nullptr; + ConnectionThread *m_connection = nullptr; + QThread *m_thread = nullptr; + EventQueue *m_queue = nullptr; + Seat *m_seat = nullptr; + Keyboard *m_keyboard = nullptr; + Compositor *m_compositor = nullptr; + TextInputManager *m_textInputManagerV2 = nullptr; +}; + +static const QString s_socketName = QStringLiteral("kwayland-test-text-input-0"); + +void TextInputTest::init() +{ + delete m_display; + m_display = new Display(this); + m_display->addSocketName(s_socketName); + m_display->start(); + QVERIFY(m_display->isRunning()); + m_display->createShm(); + m_seatInterface = new SeatInterface(m_display, m_display); + m_seatInterface->setHasKeyboard(true); + m_seatInterface->setHasTouch(true); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_textInputManagerV2Interface = new TextInputManagerV2Interface(m_display, m_display); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); + QVERIFY(connectedSpy.isValid()); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + + m_queue = new EventQueue(this); + m_queue->setup(m_connection); + + Registry registry; + QSignalSpy interfacesAnnouncedSpy(®istry, &Registry::interfacesAnnounced); + QVERIFY(interfacesAnnouncedSpy.isValid()); + registry.setEventQueue(m_queue); + registry.create(m_connection); + QVERIFY(registry.isValid()); + registry.setup(); + QVERIFY(interfacesAnnouncedSpy.wait()); + + m_seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, registry.interface(Registry::Interface::Seat).version, this); + QVERIFY(m_seat->isValid()); + QSignalSpy hasKeyboardSpy(m_seat, &Seat::hasKeyboardChanged); + QVERIFY(hasKeyboardSpy.isValid()); + QVERIFY(hasKeyboardSpy.wait()); + m_keyboard = m_seat->createKeyboard(this); + QVERIFY(m_keyboard->isValid()); + + m_compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); + QVERIFY(m_compositor->isValid()); + + m_textInputManagerV2 = registry.createTextInputManager(registry.interface(Registry::Interface::TextInputManagerUnstableV2).name, + registry.interface(Registry::Interface::TextInputManagerUnstableV2).version, + this); + QVERIFY(m_textInputManagerV2->isValid()); +} + +void TextInputTest::cleanup() +{ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ + } + CLEANUP(m_textInputManagerV2) + CLEANUP(m_keyboard) + CLEANUP(m_seat) + CLEANUP(m_compositor) + CLEANUP(m_queue) + if (m_connection) { + m_connection->deleteLater(); + m_connection = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + + CLEANUP(m_display) +#undef CLEANUP + + // these are the children of the display + m_textInputManagerV2Interface = nullptr; + m_compositorInterface = nullptr; + m_seatInterface = nullptr; +} + +SurfaceInterface *TextInputTest::waitForSurface() +{ + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); + if (!surfaceCreatedSpy.isValid()) { + return nullptr; + } + if (!surfaceCreatedSpy.wait(500)) { + return nullptr; + } + if (surfaceCreatedSpy.count() != 1) { + return nullptr; + } + return surfaceCreatedSpy.first().first().value(); +} + +TextInput *TextInputTest::createTextInput() +{ + return m_textInputManagerV2->createTextInput(m_seat); +} + +void TextInputTest::testEnterLeave_data() +{ + QTest::addColumn("updatesDirectly"); + QTest::newRow("UnstableV2") << true; +} + +void TextInputTest::testEnterLeave() +{ + // this test verifies that enter leave are sent correctly + QScopedPointer surface(m_compositor->createSurface()); + + QScopedPointer textInput(createTextInput()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + QVERIFY(!textInput.isNull()); + QSignalSpy enteredSpy(textInput.data(), &TextInput::entered); + QVERIFY(enteredSpy.isValid()); + QSignalSpy leftSpy(textInput.data(), &TextInput::left); + QVERIFY(leftSpy.isValid()); + QSignalSpy textInputChangedSpy(m_seatInterface, &SeatInterface::focusedTextInputSurfaceChanged); + QVERIFY(textInputChangedSpy.isValid()); + + // now let's try to enter it + QVERIFY(!m_seatInterface->focusedTextInputSurface()); + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + QCOMPARE(m_seatInterface->focusedTextInputSurface(), serverSurface); + // text input not yet set for the surface + QFETCH(bool, updatesDirectly); + QCOMPARE(bool(m_seatInterface->textInputV2()), updatesDirectly); + QCOMPARE(textInputChangedSpy.isEmpty(), !updatesDirectly); + textInput->enable(surface.data()); + // this should trigger on server side + if (!updatesDirectly) { + QVERIFY(textInputChangedSpy.wait()); + } + QCOMPARE(textInputChangedSpy.count(), 1); + auto serverTextInput = m_seatInterface->textInputV2(); + QVERIFY(serverTextInput); + QSignalSpy enabledChangedSpy(serverTextInput, &TextInputV2Interface::enabledChanged); + QVERIFY(enabledChangedSpy.isValid()); + if (updatesDirectly) { + QVERIFY(enabledChangedSpy.wait()); + enabledChangedSpy.clear(); + } + QCOMPARE(serverTextInput->surface().data(), serverSurface); + QVERIFY(serverTextInput->isEnabled()); + + // and trigger an enter + if (enteredSpy.isEmpty()) { + QVERIFY(enteredSpy.wait()); + } + QCOMPARE(enteredSpy.count(), 1); + QCOMPARE(textInput->enteredSurface(), surface.data()); + + // now trigger a leave + m_seatInterface->setFocusedKeyboardSurface(nullptr); + QCOMPARE(textInputChangedSpy.count(), 2); + QVERIFY(leftSpy.wait()); + QVERIFY(!textInput->enteredSurface()); + QVERIFY(!serverTextInput->isEnabled()); + + // if we enter again we should directly get the text input as it's still activated + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + QCOMPARE(textInputChangedSpy.count(), 3); + QVERIFY(m_seatInterface->textInputV2()); + QVERIFY(enteredSpy.wait()); + QCOMPARE(enteredSpy.count(), 2); + QCOMPARE(textInput->enteredSurface(), surface.data()); + QVERIFY(serverTextInput->isEnabled()); + + // let's deactivate on client side + textInput->disable(surface.data()); + QVERIFY(enabledChangedSpy.wait()); + QCOMPARE(enabledChangedSpy.count(), 3); + QVERIFY(!serverTextInput->isEnabled()); + // does not trigger a leave + QCOMPARE(textInputChangedSpy.count(), 3); + // should still be the same text input + QCOMPARE(m_seatInterface->textInputV2(), serverTextInput); + // reset + textInput->enable(surface.data()); + QVERIFY(enabledChangedSpy.wait()); + + // delete the client and wait for the server to catch up + QSignalSpy unboundSpy(serverSurface, &QObject::destroyed); + surface.reset(); + QVERIFY(unboundSpy.wait()); + QVERIFY(leftSpy.wait()); + QVERIFY(!textInput->enteredSurface()); +} + +void TextInputTest::testFocusedBeforeCreateTextInput() +{ + // this test verifies that enter leave are sent correctly + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + // now let's try to enter it + QSignalSpy textInputChangedSpy(m_seatInterface, &SeatInterface::focusedTextInputSurfaceChanged); + QVERIFY(textInputChangedSpy.isValid()); + QVERIFY(!m_seatInterface->focusedTextInputSurface()); + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + QCOMPARE(m_seatInterface->focusedTextInputSurface(), serverSurface); + QCOMPARE(textInputChangedSpy.count(), 1); + + // This is null because there is no text input object for this client. + QCOMPARE(m_seatInterface->textInputV2()->surface(), nullptr); + + QVERIFY(serverSurface); + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + QSignalSpy enteredSpy(textInput.data(), &TextInput::entered); + QVERIFY(enteredSpy.isValid()); + QSignalSpy leftSpy(textInput.data(), &TextInput::left); + QVERIFY(leftSpy.isValid()); + + // and trigger an enter + if (enteredSpy.isEmpty()) { + QVERIFY(enteredSpy.wait()); + } + QCOMPARE(enteredSpy.count(), 1); + QCOMPARE(textInput->enteredSurface(), surface.data()); + + // This is not null anymore because there is a text input object associated with it. + QCOMPARE(m_seatInterface->textInputV2()->surface(), serverSurface); + + // now trigger a leave + m_seatInterface->setFocusedKeyboardSurface(nullptr); + QCOMPARE(textInputChangedSpy.count(), 2); + QVERIFY(leftSpy.wait()); + QVERIFY(!textInput->enteredSurface()); + + QCOMPARE(m_seatInterface->textInputV2()->surface(), nullptr); + QCOMPARE(m_seatInterface->focusedTextInputSurface(), nullptr); +} + +void TextInputTest::testShowHidePanel() +{ + // this test verifies that the requests for show/hide panel work + // and that status is properly sent to the client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + QSignalSpy showPanelRequestedSpy(ti, &TextInputV2Interface::requestShowInputPanel); + QVERIFY(showPanelRequestedSpy.isValid()); + QSignalSpy hidePanelRequestedSpy(ti, &TextInputV2Interface::requestHideInputPanel); + QVERIFY(hidePanelRequestedSpy.isValid()); + QSignalSpy inputPanelStateChangedSpy(textInput.data(), &TextInput::inputPanelStateChanged); + QVERIFY(inputPanelStateChangedSpy.isValid()); + + QCOMPARE(textInput->isInputPanelVisible(), false); + textInput->showInputPanel(); + QVERIFY(showPanelRequestedSpy.wait()); + ti->setInputPanelState(true, QRect(0, 0, 0, 0)); + QVERIFY(inputPanelStateChangedSpy.wait()); + QCOMPARE(textInput->isInputPanelVisible(), true); + + textInput->hideInputPanel(); + QVERIFY(hidePanelRequestedSpy.wait()); + ti->setInputPanelState(false, QRect(0, 0, 0, 0)); + QVERIFY(inputPanelStateChangedSpy.wait()); + QCOMPARE(textInput->isInputPanelVisible(), false); +} + +void TextInputTest::testCursorRectangle() +{ + // this test verifies that passing the cursor rectangle from client to server works + // and that setting visibility state from server to client works + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + QCOMPARE(ti->cursorRectangle(), QRect()); + QSignalSpy cursorRectangleChangedSpy(ti, &TextInputV2Interface::cursorRectangleChanged); + QVERIFY(cursorRectangleChangedSpy.isValid()); + + textInput->setCursorRectangle(QRect(10, 20, 30, 40)); + QVERIFY(cursorRectangleChangedSpy.wait()); + QCOMPARE(ti->cursorRectangle(), QRect(10, 20, 30, 40)); +} + +void TextInputTest::testPreferredLanguage() +{ + // this test verifies that passing the preferred language from client to server works + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + QVERIFY(ti->preferredLanguage().isEmpty()); + + QSignalSpy preferredLanguageChangedSpy(ti, &TextInputV2Interface::preferredLanguageChanged); + QVERIFY(preferredLanguageChangedSpy.isValid()); + textInput->setPreferredLanguage(QStringLiteral("foo")); + QVERIFY(preferredLanguageChangedSpy.wait()); + QCOMPARE(ti->preferredLanguage(), QStringLiteral("foo").toUtf8()); +} + +void TextInputTest::testReset() +{ + // this test verifies that the reset request is properly passed from client to server + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + QSignalSpy stateUpdatedSpy(ti, &TextInputV2Interface::stateUpdated); + QVERIFY(stateUpdatedSpy.isValid()); + + textInput->reset(); + QVERIFY(stateUpdatedSpy.wait()); +} + +void TextInputTest::testSurroundingText() +{ + // this test verifies that surrounding text is properly passed around + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + QVERIFY(ti->surroundingText().isEmpty()); + QCOMPARE(ti->surroundingTextCursorPosition(), 0); + QCOMPARE(ti->surroundingTextSelectionAnchor(), 0); + + QSignalSpy surroundingTextChangedSpy(ti, &TextInputV2Interface::surroundingTextChanged); + QVERIFY(surroundingTextChangedSpy.isValid()); + + textInput->setSurroundingText(QStringLiteral("100 €, 100 $"), 5, 6); + QVERIFY(surroundingTextChangedSpy.wait()); + QCOMPARE(ti->surroundingText(), QStringLiteral("100 €, 100 $").toUtf8()); + QCOMPARE(ti->surroundingTextCursorPosition(), QStringLiteral("100 €, 100 $").toUtf8().indexOf(',')); + QCOMPARE(ti->surroundingTextSelectionAnchor(), QStringLiteral("100 €, 100 $").toUtf8().indexOf(' ', ti->surroundingTextCursorPosition())); +} + +void TextInputTest::testContentHints_data() +{ + QTest::addColumn("clientHints"); + QTest::addColumn("serverHints"); + + QTest::newRow("completion/v2") << TextInput::ContentHints(TextInput::ContentHint::AutoCompletion) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCompletion); + QTest::newRow("Correction/v2") << TextInput::ContentHints(TextInput::ContentHint::AutoCorrection) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCorrection); + QTest::newRow("Capitalization/v2") << TextInput::ContentHints(TextInput::ContentHint::AutoCapitalization) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCapitalization); + QTest::newRow("Lowercase/v2") << TextInput::ContentHints(TextInput::ContentHint::LowerCase) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::LowerCase); + QTest::newRow("Uppercase/v2") << TextInput::ContentHints(TextInput::ContentHint::UpperCase) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::UpperCase); + QTest::newRow("Titlecase/v2") << TextInput::ContentHints(TextInput::ContentHint::TitleCase) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::TitleCase); + QTest::newRow("HiddenText/v2") << TextInput::ContentHints(TextInput::ContentHint::HiddenText) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::HiddenText); + QTest::newRow("SensitiveData/v2") << TextInput::ContentHints(TextInput::ContentHint::SensitiveData) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::SensitiveData); + QTest::newRow("Latin/v2") << TextInput::ContentHints(TextInput::ContentHint::Latin) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::Latin); + QTest::newRow("Multiline/v2") << TextInput::ContentHints(TextInput::ContentHint::MultiLine) + << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::MultiLine); + + QTest::newRow("autos/v2") << (TextInput::ContentHint::AutoCompletion | TextInput::ContentHint::AutoCorrection | TextInput::ContentHint::AutoCapitalization) + << (KWaylandServer::TextInputContentHint::AutoCompletion | KWaylandServer::TextInputContentHint::AutoCorrection + | KWaylandServer::TextInputContentHint::AutoCapitalization); + + // all has combinations which don't make sense - what's both lowercase and uppercase? + QTest::newRow("all/v2") << (TextInput::ContentHint::AutoCompletion | TextInput::ContentHint::AutoCorrection | TextInput::ContentHint::AutoCapitalization + | TextInput::ContentHint::LowerCase | TextInput::ContentHint::UpperCase | TextInput::ContentHint::TitleCase + | TextInput::ContentHint::HiddenText | TextInput::ContentHint::SensitiveData | TextInput::ContentHint::Latin + | TextInput::ContentHint::MultiLine) + << (KWaylandServer::TextInputContentHint::AutoCompletion | KWaylandServer::TextInputContentHint::AutoCorrection + | KWaylandServer::TextInputContentHint::AutoCapitalization | KWaylandServer::TextInputContentHint::LowerCase + | KWaylandServer::TextInputContentHint::UpperCase | KWaylandServer::TextInputContentHint::TitleCase + | KWaylandServer::TextInputContentHint::HiddenText | KWaylandServer::TextInputContentHint::SensitiveData + | KWaylandServer::TextInputContentHint::Latin | KWaylandServer::TextInputContentHint::MultiLine); +} + +void TextInputTest::testContentHints() +{ + // this test verifies that content hints are properly passed from client to server + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + QCOMPARE(ti->contentHints(), KWaylandServer::TextInputContentHints()); + + QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged); + QVERIFY(contentTypeChangedSpy.isValid()); + QFETCH(TextInput::ContentHints, clientHints); + textInput->setContentType(clientHints, TextInput::ContentPurpose::Normal); + QVERIFY(contentTypeChangedSpy.wait()); + QTEST(ti->contentHints(), "serverHints"); + + // setting to same should not trigger an update + textInput->setContentType(clientHints, TextInput::ContentPurpose::Normal); + QVERIFY(!contentTypeChangedSpy.wait(100)); + + // unsetting should work + textInput->setContentType(TextInput::ContentHints(), TextInput::ContentPurpose::Normal); + QVERIFY(contentTypeChangedSpy.wait()); + QCOMPARE(ti->contentHints(), KWaylandServer::TextInputContentHints()); +} + +void TextInputTest::testContentPurpose_data() +{ + QTest::addColumn("clientPurpose"); + QTest::addColumn("serverPurpose"); + + QTest::newRow("Alpha/v2") << TextInput::ContentPurpose::Alpha << KWaylandServer::TextInputContentPurpose::Alpha; + QTest::newRow("Digits/v2") << TextInput::ContentPurpose::Digits << KWaylandServer::TextInputContentPurpose::Digits; + QTest::newRow("Number/v2") << TextInput::ContentPurpose::Number << KWaylandServer::TextInputContentPurpose::Number; + QTest::newRow("Phone/v2") << TextInput::ContentPurpose::Phone << KWaylandServer::TextInputContentPurpose::Phone; + QTest::newRow("Url/v2") << TextInput::ContentPurpose::Url << KWaylandServer::TextInputContentPurpose::Url; + QTest::newRow("Email/v2") << TextInput::ContentPurpose::Email << KWaylandServer::TextInputContentPurpose::Email; + QTest::newRow("Name/v2") << TextInput::ContentPurpose::Name << KWaylandServer::TextInputContentPurpose::Name; + QTest::newRow("Password/v2") << TextInput::ContentPurpose::Password << KWaylandServer::TextInputContentPurpose::Password; + QTest::newRow("Date/v2") << TextInput::ContentPurpose::Date << KWaylandServer::TextInputContentPurpose::Date; + QTest::newRow("Time/v2") << TextInput::ContentPurpose::Time << KWaylandServer::TextInputContentPurpose::Time; + QTest::newRow("Datetime/v2") << TextInput::ContentPurpose::DateTime << KWaylandServer::TextInputContentPurpose::DateTime; + QTest::newRow("Terminal/v2") << TextInput::ContentPurpose::Terminal << KWaylandServer::TextInputContentPurpose::Terminal; +} + +void TextInputTest::testContentPurpose() +{ + // this test verifies that content purpose are properly passed from client to server + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + QCOMPARE(ti->contentPurpose(), KWaylandServer::TextInputContentPurpose::Normal); + + QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged); + QVERIFY(contentTypeChangedSpy.isValid()); + QFETCH(TextInput::ContentPurpose, clientPurpose); + textInput->setContentType(TextInput::ContentHints(), clientPurpose); + QVERIFY(contentTypeChangedSpy.wait()); + QTEST(ti->contentPurpose(), "serverPurpose"); + + // setting to same should not trigger an update + textInput->setContentType(TextInput::ContentHints(), clientPurpose); + QVERIFY(!contentTypeChangedSpy.wait(100)); + + // unsetting should work + textInput->setContentType(TextInput::ContentHints(), TextInput::ContentPurpose::Normal); + QVERIFY(contentTypeChangedSpy.wait()); + QCOMPARE(ti->contentPurpose(), KWaylandServer::TextInputContentPurpose::Normal); +} + +void TextInputTest::testTextDirection_data() +{ + QTest::addColumn("textDirection"); + + QTest::newRow("ltr/v0") << Qt::LeftToRight; + QTest::newRow("rtl/v0") << Qt::RightToLeft; + + QTest::newRow("ltr/v2") << Qt::LeftToRight; + QTest::newRow("rtl/v2") << Qt::RightToLeft; +} + +void TextInputTest::testTextDirection() +{ + // this test verifies that the text direction is sent from server to client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + // default should be auto + QCOMPARE(textInput->textDirection(), Qt::LayoutDirectionAuto); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + // let's send the new text direction + QSignalSpy textDirectionChangedSpy(textInput.data(), &TextInput::textDirectionChanged); + QVERIFY(textDirectionChangedSpy.isValid()); + QFETCH(Qt::LayoutDirection, textDirection); + ti->setTextDirection(textDirection); + QVERIFY(textDirectionChangedSpy.wait()); + QCOMPARE(textInput->textDirection(), textDirection); + // setting again should not change + ti->setTextDirection(textDirection); + QVERIFY(!textDirectionChangedSpy.wait(100)); + + // setting back to auto + ti->setTextDirection(Qt::LayoutDirectionAuto); + QVERIFY(textDirectionChangedSpy.wait()); + QCOMPARE(textInput->textDirection(), Qt::LayoutDirectionAuto); +} + +void TextInputTest::testLanguage() +{ + // this test verifies that language is sent from server to client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + // default should be empty + QVERIFY(textInput->language().isEmpty()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + // let's send the new language + QSignalSpy langugageChangedSpy(textInput.data(), &TextInput::languageChanged); + QVERIFY(langugageChangedSpy.isValid()); + ti->setLanguage(QByteArrayLiteral("foo")); + QVERIFY(langugageChangedSpy.wait()); + QCOMPARE(textInput->language(), QByteArrayLiteral("foo")); + // setting to same should not trigger + ti->setLanguage(QByteArrayLiteral("foo")); + QVERIFY(!langugageChangedSpy.wait(100)); + // but to something else should trigger again + ti->setLanguage(QByteArrayLiteral("bar")); + QVERIFY(langugageChangedSpy.wait()); + QCOMPARE(textInput->language(), QByteArrayLiteral("bar")); +} + +void TextInputTest::testKeyEvent() +{ + qRegisterMetaType(); + qRegisterMetaType(); + // this test verifies that key events are properly sent to the client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + // TODO: test modifiers + QSignalSpy keyEventSpy(textInput.data(), &TextInput::keyEvent); + QVERIFY(keyEventSpy.isValid()); + m_seatInterface->setTimestamp(100); + ti->keysymPressed(2); + QVERIFY(keyEventSpy.wait()); + QCOMPARE(keyEventSpy.count(), 1); + QCOMPARE(keyEventSpy.last().at(0).value(), 2u); + QCOMPARE(keyEventSpy.last().at(1).value(), TextInput::KeyState::Pressed); + QCOMPARE(keyEventSpy.last().at(2).value(), Qt::KeyboardModifiers()); + QCOMPARE(keyEventSpy.last().at(3).value(), 100u); + m_seatInterface->setTimestamp(101); + ti->keysymReleased(2); + QVERIFY(keyEventSpy.wait()); + QCOMPARE(keyEventSpy.count(), 2); + QCOMPARE(keyEventSpy.last().at(0).value(), 2u); + QCOMPARE(keyEventSpy.last().at(1).value(), TextInput::KeyState::Released); + QCOMPARE(keyEventSpy.last().at(2).value(), Qt::KeyboardModifiers()); + QCOMPARE(keyEventSpy.last().at(3).value(), 101u); +} + +void TextInputTest::testPreEdit() +{ + // this test verifies that pre-edit is correctly passed to the client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + // verify default values + QVERIFY(textInput->composingText().isEmpty()); + QVERIFY(textInput->composingFallbackText().isEmpty()); + QCOMPARE(textInput->composingTextCursorPosition(), 0); + + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + // now let's pass through some pre-edit events + QSignalSpy composingTextChangedSpy(textInput.data(), &TextInput::composingTextChanged); + QVERIFY(composingTextChangedSpy.isValid()); + ti->setPreEditCursor(1); + ti->preEdit(QByteArrayLiteral("foo"), QByteArrayLiteral("bar")); + QVERIFY(composingTextChangedSpy.wait()); + QCOMPARE(composingTextChangedSpy.count(), 1); + QCOMPARE(textInput->composingText(), QByteArrayLiteral("foo")); + QCOMPARE(textInput->composingFallbackText(), QByteArrayLiteral("bar")); + QCOMPARE(textInput->composingTextCursorPosition(), 1); + + // when no pre edit cursor is sent, it's at end of text + ti->preEdit(QByteArrayLiteral("foobar"), QByteArray()); + QVERIFY(composingTextChangedSpy.wait()); + QCOMPARE(composingTextChangedSpy.count(), 2); + QCOMPARE(textInput->composingText(), QByteArrayLiteral("foobar")); + QCOMPARE(textInput->composingFallbackText(), QByteArray()); + QCOMPARE(textInput->composingTextCursorPosition(), 6); +} + +void TextInputTest::testCommit() +{ + // this test verifies that the commit is handled correctly by the client + QScopedPointer surface(m_compositor->createSurface()); + auto serverSurface = waitForSurface(); + QVERIFY(serverSurface); + + QScopedPointer textInput(createTextInput()); + QVERIFY(!textInput.isNull()); + // verify default values + QCOMPARE(textInput->commitText(), QByteArray()); + QCOMPARE(textInput->cursorPosition(), 0); + QCOMPARE(textInput->anchorPosition(), 0); + QCOMPARE(textInput->deleteSurroundingText().beforeLength, 0u); + QCOMPARE(textInput->deleteSurroundingText().afterLength, 0u); + + textInput->enable(surface.data()); + m_connection->flush(); + m_display->dispatchEvents(); + + m_seatInterface->setFocusedKeyboardSurface(serverSurface); + auto ti = m_seatInterface->textInputV2(); + QVERIFY(ti); + + // now let's commit + QSignalSpy committedSpy(textInput.data(), &TextInput::committed); + QVERIFY(committedSpy.isValid()); + ti->setCursorPosition(3, 4); + ti->deleteSurroundingText(2, 1); + ti->commitString(QByteArrayLiteral("foo")); + + QVERIFY(committedSpy.wait()); + QCOMPARE(textInput->commitText(), QByteArrayLiteral("foo")); + QCOMPARE(textInput->cursorPosition(), 3); + QCOMPARE(textInput->anchorPosition(), 4); + QCOMPARE(textInput->deleteSurroundingText().beforeLength, 2u); + QCOMPARE(textInput->deleteSurroundingText().afterLength, 1u); +} + +QTEST_GUILESS_MAIN(TextInputTest) +#include "test_text_input_v2.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_appmenu.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_appmenu.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_appmenu.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_appmenu.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,41 +1,26 @@ -/******************************************************************** -Copyright 2017 David Edmundson -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2017 David Edmundson + SPDX-FileCopyrightText: 2014 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/appmenu_interface.h" +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/client/appmenu.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/appmenu.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/appmenu_interface.h" using namespace KWayland::Client; -Q_DECLARE_METATYPE(KWayland::Server::AppMenuInterface::InterfaceAddress) +Q_DECLARE_METATYPE(KWaylandServer::AppMenuInterface::InterfaceAddress) class TestAppmenu : public QObject { @@ -49,9 +34,9 @@ void testCreateAndSet(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::AppMenuManagerInterface *m_appmenuManagerInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::AppMenuManagerInterface *m_appmenuManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::AppMenuManager *m_appmenuManager; @@ -74,11 +59,11 @@ void TestAppmenu::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; qRegisterMetaType(); delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -114,16 +99,11 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_appmenuManagerInterface = m_display->createAppMenuManagerInterface(m_display); - m_appmenuManagerInterface->create(); - QVERIFY(m_appmenuManagerInterface->isValid()); + m_appmenuManagerInterface = new AppMenuManagerInterface(m_display, m_display); QVERIFY(appmenuSpy.wait()); m_appmenuManager = registry.createAppMenuManager(appmenuSpy.first().first().value(), appmenuSpy.first().last().value(), this); @@ -131,10 +111,10 @@ void TestAppmenu::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_appmenuManager) @@ -157,26 +137,26 @@ void TestAppmenu::testCreateAndSet() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy appMenuCreated(m_appmenuManagerInterface, &KWayland::Server::AppMenuManagerInterface::appMenuCreated); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy appMenuCreated(m_appmenuManagerInterface, &KWaylandServer::AppMenuManagerInterface::appMenuCreated); QVERIFY(!m_appmenuManagerInterface->appMenuForSurface(serverSurface)); auto appmenu = m_appmenuManager->create(surface.data(), surface.data()); QVERIFY(appMenuCreated.wait()); - auto appMenuInterface = appMenuCreated.first().first().value(); + auto appMenuInterface = appMenuCreated.first().first().value(); QCOMPARE(m_appmenuManagerInterface->appMenuForSurface(serverSurface), appMenuInterface); QCOMPARE(appMenuInterface->address().serviceName, QString()); QCOMPARE(appMenuInterface->address().objectPath, QString()); - QSignalSpy appMenuChangedSpy(appMenuInterface, &KWayland::Server::AppMenuInterface::addressChanged); + QSignalSpy appMenuChangedSpy(appMenuInterface, &KWaylandServer::AppMenuInterface::addressChanged); appmenu->setAddress("net.somename", "/test/path"); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_blur.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_blur.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_blur.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_blur.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,36 +1,21 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/blur_interface.h" +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/client/blur.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/blur.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/blur_interface.h" using namespace KWayland::Client; @@ -47,9 +32,9 @@ void testSurfaceDestroy(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::BlurManagerInterface *m_blurManagerInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::BlurManagerInterface *m_blurManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::BlurManager *m_blurManager; @@ -72,10 +57,10 @@ void TestBlur::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -111,27 +96,21 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_blurManagerInterface = m_display->createBlurManager(m_display); - m_blurManagerInterface->create(); - QVERIFY(m_blurManagerInterface->isValid()); - + m_blurManagerInterface = new BlurManagerInterface(m_display, m_display); QVERIFY(blurSpy.wait()); m_blurManager = registry.createBlurManager(blurSpy.first().first().value(), blurSpy.first().last().value(), this); } void TestBlur::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_blurManager) @@ -146,22 +125,24 @@ delete m_thread; m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_blurManagerInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_compositorInterface = nullptr; + m_blurManagerInterface = nullptr; } void TestBlur::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy blurChanged(serverSurface, SIGNAL(blurChanged())); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy blurChanged(serverSurface, &KWaylandServer::SurfaceInterface::blurChanged); auto blur = m_blurManager->createBlur(surface.data(), surface.data()); blur->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); @@ -180,14 +161,14 @@ void TestBlur::testSurfaceDestroy() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWayland::Server::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy blurChanged(serverSurface, &KWayland::Server::SurfaceInterface::blurChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy blurChanged(serverSurface, &KWaylandServer::SurfaceInterface::blurChanged); QVERIFY(blurChanged.isValid()); QScopedPointer blur(m_blurManager->createBlur(surface.data())); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_connection_thread.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_connection_thread.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_connection_thread.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_connection_thread.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,301 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/registry.h" -#include "../../src/server/display.h" -// Wayland -#include -// system -#include -#include -#include - -class TestWaylandConnectionThread : public QObject -{ - Q_OBJECT -public: - explicit TestWaylandConnectionThread(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testInitConnectionNoThread(); - void testConnectionFailure(); - void testConnectionDieing(); - void testConnectionThread(); - void testConnectFd(); - void testConnectFdNoSocketName(); - -private: - KWayland::Server::Display *m_display; -}; - -static const QString s_socketName = QStringLiteral("kwin-test-wayland-connection-0"); - -TestWaylandConnectionThread::TestWaylandConnectionThread(QObject *parent) - : QObject(parent) - , m_display(nullptr) -{ -} - -void TestWaylandConnectionThread::init() -{ - using namespace KWayland::Server; - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - m_display->createShm(); -} - -void TestWaylandConnectionThread::cleanup() -{ - delete m_display; - m_display = nullptr; -} - -void TestWaylandConnectionThread::testInitConnectionNoThread() -{ - QVERIFY(KWayland::Client::ConnectionThread::connections().isEmpty()); - QScopedPointer connection(new KWayland::Client::ConnectionThread); - QVERIFY(KWayland::Client::ConnectionThread::connections().contains(connection.data())); - QCOMPARE(connection->socketName(), QStringLiteral("wayland-0")); - connection->setSocketName(s_socketName); - QCOMPARE(connection->socketName(), s_socketName); - - QSignalSpy connectedSpy(connection.data(), SIGNAL(connected())); - QSignalSpy failedSpy(connection.data(), SIGNAL(failed())); - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - QCOMPARE(connectedSpy.count(), 1); - QCOMPARE(failedSpy.count(), 0); - QVERIFY(connection->display()); - - connection.reset(); - QVERIFY(KWayland::Client::ConnectionThread::connections().isEmpty()); -} - -void TestWaylandConnectionThread::testConnectionFailure() -{ - QScopedPointer connection(new KWayland::Client::ConnectionThread); - connection->setSocketName(QStringLiteral("kwin-test-socket-does-not-exist")); - - QSignalSpy connectedSpy(connection.data(), SIGNAL(connected())); - QSignalSpy failedSpy(connection.data(), SIGNAL(failed())); - connection->initConnection(); - QVERIFY(failedSpy.wait()); - QCOMPARE(connectedSpy.count(), 0); - QCOMPARE(failedSpy.count(), 1); - QVERIFY(!connection->display()); -} - -static void registryHandleGlobal(void *data, struct wl_registry *registry, - uint32_t name, const char *interface, uint32_t version) -{ - Q_UNUSED(data) - Q_UNUSED(registry) - Q_UNUSED(name) - Q_UNUSED(interface) - Q_UNUSED(version) -} - -static void registryHandleGlobalRemove(void *data, struct wl_registry *registry, uint32_t name) -{ - Q_UNUSED(data) - Q_UNUSED(registry) - Q_UNUSED(name) -} - -static const struct wl_registry_listener s_registryListener = { - registryHandleGlobal, - registryHandleGlobalRemove -}; - -void TestWaylandConnectionThread::testConnectionThread() -{ - KWayland::Client::ConnectionThread *connection = new KWayland::Client::ConnectionThread; - connection->setSocketName(s_socketName); - - QThread *connectionThread = new QThread(this); - connection->moveToThread(connectionThread); - connectionThread->start(); - - QSignalSpy connectedSpy(connection, SIGNAL(connected())); - QVERIFY(connectedSpy.isValid()); - QSignalSpy failedSpy(connection, SIGNAL(failed())); - QVERIFY(failedSpy.isValid()); - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - QCOMPARE(connectedSpy.count(), 1); - QCOMPARE(failedSpy.count(), 0); - QVERIFY(connection->display()); - - // now we have the connection ready, let's get some events - QSignalSpy eventsSpy(connection, SIGNAL(eventsRead())); - QVERIFY(eventsSpy.isValid()); - wl_display *display = connection->display(); - QScopedPointer queue(new KWayland::Client::EventQueue); - queue->setup(display); - QVERIFY(queue->isValid()); - connect(connection, &KWayland::Client::ConnectionThread::eventsRead, queue.data(), &KWayland::Client::EventQueue::dispatch, Qt::QueuedConnection); - - wl_registry *registry = wl_display_get_registry(display); - wl_proxy_set_queue((wl_proxy*)registry, *(queue.data())); - - wl_registry_add_listener(registry, &s_registryListener, this); - wl_display_flush(display); - - if (eventsSpy.isEmpty()) { - QVERIFY(eventsSpy.wait()); - } - QVERIFY(!eventsSpy.isEmpty()); - - wl_registry_destroy(registry); - queue.reset(); - - connection->deleteLater(); - connectionThread->quit(); - connectionThread->wait(); - delete connectionThread; -} - -void TestWaylandConnectionThread::testConnectionDieing() -{ - QScopedPointer connection(new KWayland::Client::ConnectionThread); - QSignalSpy connectedSpy(connection.data(), SIGNAL(connected())); - connection->setSocketName(s_socketName); - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - QVERIFY(connection->display()); - - QSignalSpy diedSpy(connection.data(), SIGNAL(connectionDied())); - m_display->terminate(); - QVERIFY(!m_display->isRunning()); - QVERIFY(diedSpy.wait()); - QCOMPARE(diedSpy.count(), 1); - QVERIFY(!connection->display()); - - connectedSpy.clear(); - QVERIFY(connectedSpy.isEmpty()); - // restarts the server - m_display->start(); - QVERIFY(m_display->isRunning()); - if (connectedSpy.count() == 0) { - QVERIFY(connectedSpy.wait()); - } - QCOMPARE(connectedSpy.count(), 1); -} - -void TestWaylandConnectionThread::testConnectFd() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - int sv[2]; - QVERIFY(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) >= 0); - auto c = m_display->createClient(sv[0]); - QVERIFY(c); - QSignalSpy disconnectedSpy(c, &ClientConnection::disconnected); - QVERIFY(disconnectedSpy.isValid()); - - ConnectionThread *connection = new ConnectionThread; - QSignalSpy connectedSpy(connection, SIGNAL(connected())); - QVERIFY(connectedSpy.isValid()); - connection->setSocketFd(sv[1]); - - QThread *connectionThread = new QThread(this); - connection->moveToThread(connectionThread); - connectionThread->start(); - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - // create the Registry - QScopedPointer registry(new Registry); - QSignalSpy announcedSpy(registry.data(), SIGNAL(interfacesAnnounced())); - QVERIFY(announcedSpy.isValid()); - registry->create(connection); - QScopedPointer queue(new EventQueue); - queue->setup(connection); - registry->setEventQueue(queue.data()); - registry->setup(); - QVERIFY(announcedSpy.wait()); - - registry.reset(); - queue.reset(); - connection->deleteLater(); - connectionThread->quit(); - connectionThread->wait(); - delete connectionThread; - - c->destroy(); - QCOMPARE(disconnectedSpy.count(), 1); -} - -void TestWaylandConnectionThread::testConnectFdNoSocketName() -{ - delete m_display; - m_display = nullptr; - using namespace KWayland::Client; - using namespace KWayland::Server; - - Display display; - display.start(Display::StartMode::ConnectClientsOnly); - QVERIFY(display.isRunning()); - - int sv[2]; - QVERIFY(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) >= 0); - QVERIFY(display.createClient(sv[0])); - - ConnectionThread *connection = new ConnectionThread; - QSignalSpy connectedSpy(connection, SIGNAL(connected())); - QVERIFY(connectedSpy.isValid()); - connection->setSocketFd(sv[1]); - - QThread *connectionThread = new QThread(this); - connection->moveToThread(connectionThread); - connectionThread->start(); - connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - // create the Registry - QScopedPointer registry(new Registry); - QSignalSpy announcedSpy(registry.data(), SIGNAL(interfacesAnnounced())); - QVERIFY(announcedSpy.isValid()); - registry->create(connection); - QScopedPointer queue(new EventQueue); - queue->setup(connection); - registry->setEventQueue(queue.data()); - registry->setup(); - QVERIFY(announcedSpy.wait()); - - registry.reset(); - queue.reset(); - connection->deleteLater(); - connectionThread->quit(); - connectionThread->wait(); - delete connectionThread; -} - -QTEST_GUILESS_MAIN(TestWaylandConnectionThread) -#include "test_wayland_connection_thread.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_contrast.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_contrast.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_contrast.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_contrast.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,22 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/contrast_interface.h" +#include "../../src/server/display.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" +#include "../../src/client/contrast.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/contrast.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/contrast_interface.h" #include @@ -50,9 +35,9 @@ void testSurfaceDestroy(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::ContrastManagerInterface *m_contrastManagerInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::ContrastManagerInterface *m_contrastManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ContrastManager *m_contrastManager; @@ -75,16 +60,16 @@ void TestContrast::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -113,16 +98,11 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_contrastManagerInterface = m_display->createContrastManager(m_display); - m_contrastManagerInterface->create(); - QVERIFY(m_contrastManagerInterface->isValid()); + m_contrastManagerInterface = new ContrastManagerInterface(m_display, m_display); QVERIFY(contrastSpy.wait()); m_contrastManager = registry.createContrastManager(contrastSpy.first().first().value(), contrastSpy.first().last().value(), this); @@ -130,10 +110,10 @@ void TestContrast::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_contrastManager) @@ -148,22 +128,24 @@ delete m_thread; m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_contrastManagerInterface) CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_compositorInterface = nullptr; + m_contrastManagerInterface = nullptr; } void TestContrast::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy contrastChanged(serverSurface, SIGNAL(contrastChanged())); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy contrastChanged(serverSurface, &KWaylandServer::SurfaceInterface::contrastChanged); auto contrast = m_contrastManager->createContrast(surface.data(), surface.data()); contrast->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); @@ -190,14 +172,14 @@ void TestContrast::testSurfaceDestroy() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWayland::Server::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy contrastChanged(serverSurface, &KWayland::Server::SurfaceInterface::contrastChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy contrastChanged(serverSurface, &KWaylandServer::SurfaceInterface::contrastChanged); QVERIFY(contrastChanged.isValid()); QScopedPointer contrast(m_contrastManager->createContrast(surface.data())); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_filter.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_filter.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_filter.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_filter.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,22 @@ -/******************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/blur_interface.h" +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/filtered_display.h" +#include "../../src/client/blur.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/blur.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/blur_interface.h" -#include "../../src/server/filtered_display.h" #include @@ -52,27 +37,28 @@ private: TestDisplay *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::BlurManagerInterface *m_blurManagerInterface; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::BlurManagerInterface *m_blurManagerInterface; }; static const QString s_socketName = QStringLiteral("kwayland-test-wayland-blur-0"); -//The following non-realistic class allows only clients in the m_allowedClients list to access the blur interface -//all other interfaces are allowed -class TestDisplay : public KWayland::Server::FilteredDisplay +// The following non-realistic class allows only clients in the m_allowedClients list to access the blur interface +// all other interfaces are allowed +class TestDisplay : public KWaylandServer::FilteredDisplay { public: TestDisplay(QObject *parent); - bool allowInterface(KWayland::Server::ClientConnection * client, const QByteArray & interfaceName) override; - QList m_allowedClients; + bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override; + QList m_allowedClients; }; -TestDisplay::TestDisplay(QObject *parent): - KWayland::Server::FilteredDisplay(parent) -{} +TestDisplay::TestDisplay(QObject *parent) + : KWaylandServer::FilteredDisplay(parent) +{ +} -bool TestDisplay::allowInterface(KWayland::Server::ClientConnection* client, const QByteArray& interfaceName) +bool TestDisplay::allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) { if (interfaceName == "org_kde_kwin_blur_manager") { return m_allowedClients.contains(*client); @@ -84,24 +70,20 @@ : QObject(parent) , m_display(nullptr) , m_compositorInterface(nullptr) -{} +{ +} void TestFilter::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new TestDisplay(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - m_blurManagerInterface = m_display->createBlurManager(m_display); - m_blurManagerInterface->create(); - QVERIFY(m_blurManagerInterface->isValid()); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_blurManagerInterface = new BlurManagerInterface(m_display, m_display); } void TestFilter::cleanup() @@ -113,14 +95,13 @@ QTest::addColumn("accessAllowed"); QTest::newRow("granted") << true; QTest::newRow("denied") << false; - } void TestFilter::testFilter() { QFETCH(bool, accessAllowed); - // setup connection + // setup connection QScopedPointer connection(new KWayland::Client::ConnectionThread()); QSignalSpy connectedSpy(connection.data(), &ConnectionThread::connected); QVERIFY(connectedSpy.isValid()); @@ -133,11 +114,12 @@ connection->initConnection(); QVERIFY(connectedSpy.wait()); - //use low level API as Server::Display::connections only lists connections which have - //been previous fetched via getConnection() + // use low level API as Server::Display::connections only lists connections which have + // been previous fetched via getConnection() if (accessAllowed) { wl_client *clientConnection; - wl_client_for_each(clientConnection, wl_display_get_client_list(*m_display)) { + wl_client_for_each(clientConnection, wl_display_get_client_list(*m_display)) + { m_display->m_allowedClients << clientConnection; } } @@ -163,6 +145,5 @@ thread->wait(); } - QTEST_GUILESS_MAIN(TestFilter) #include "test_wayland_filter.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_fullscreen_shell.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_fullscreen_shell.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_fullscreen_shell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_fullscreen_shell.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/connection_thread.h" -#include "../../src/client/registry.h" -#include "../../src/client/fullscreen_shell.h" -// Wayland -#include - -class TestWaylandFullscreenShell : public QObject -{ - Q_OBJECT -public: - explicit TestWaylandFullscreenShell(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testRegistry(); - void testRegistryCreate(); - - // TODO: add tests for removal - requires more control over the compositor - -private: - QProcess *m_westonProcess; -}; - -static const QString s_socketName = QStringLiteral("kwin-test-wayland-fullscreen-shell-0"); - -TestWaylandFullscreenShell::TestWaylandFullscreenShell(QObject *parent) - : QObject(parent) - , m_westonProcess(nullptr) -{ -} - -void TestWaylandFullscreenShell::init() -{ - QVERIFY(!m_westonProcess); - // starts weston - m_westonProcess = new QProcess(this); - m_westonProcess->setProgram(QStringLiteral("weston")); - - m_westonProcess->setArguments(QStringList({QStringLiteral("--socket=%1").arg(s_socketName), - QStringLiteral("--backend=headless-backend.so"), - QStringLiteral("--shell=fullscreen-shell.so")})); - m_westonProcess->start(); - QVERIFY(m_westonProcess->waitForStarted()); - QTest::qWait(500); - - // wait for the socket to appear - QDir runtimeDir(qgetenv("XDG_RUNTIME_DIR")); - if (runtimeDir.exists(s_socketName)) { - return; - } - QFileSystemWatcher *socketWatcher = new QFileSystemWatcher(QStringList({runtimeDir.absolutePath()}), this); - QSignalSpy socketSpy(socketWatcher, SIGNAL(directoryChanged(QString))); - - // limit to maximum of 10 waits - for (int i = 0; i < 10; ++i) { - QVERIFY(socketSpy.wait()); - if (runtimeDir.exists(s_socketName)) { - delete socketWatcher; - return; - } - } -} - -void TestWaylandFullscreenShell::cleanup() -{ - // terminates weston - m_westonProcess->terminate(); - QVERIFY(m_westonProcess->waitForFinished()); - delete m_westonProcess; - m_westonProcess = nullptr; -} - -void TestWaylandFullscreenShell::testRegistry() -{ - if (m_westonProcess->state() != QProcess::Running) { - QSKIP("This test requires a running wayland server"); - } - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - - KWayland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &KWayland::Client::Registry::interfaceAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, SIGNAL(fullscreenShellAnnounced(quint32,quint32))); - registry.create(connection.display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(connection.display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - if (!registry.hasInterface(KWayland::Client::Registry::Interface::FullscreenShell)) { - QSKIP("Weston does not have fullscreen shell support"); - } - QCOMPARE(announced.count(), 1); - - KWayland::Client::FullscreenShell fullscreenShell; - QVERIFY(!fullscreenShell.isValid()); - QVERIFY(!fullscreenShell.hasCapabilityArbitraryModes()); - QVERIFY(!fullscreenShell.hasCapabilityCursorPlane()); - - fullscreenShell.setup(registry.bindFullscreenShell(announced.first().first().value(), 1)); - QVERIFY(fullscreenShell.isValid()); -} - -void TestWaylandFullscreenShell::testRegistryCreate() -{ if (m_westonProcess->state() != QProcess::Running) { - QSKIP("This test requires a running wayland server"); - } - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - - KWayland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &KWayland::Client::Registry::interfaceAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, SIGNAL(fullscreenShellAnnounced(quint32,quint32))); - registry.create(connection.display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(connection.display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - if (!registry.hasInterface(KWayland::Client::Registry::Interface::FullscreenShell)) { - QSKIP("Weston does not have fullscreen shell support"); - } - QCOMPARE(announced.count(), 1); - - KWayland::Client::FullscreenShell *fullscreenShell = registry.createFullscreenShell(announced.first().first().value(), 1, ®istry); - QVERIFY(fullscreenShell->isValid()); -} - -QTEST_GUILESS_MAIN(TestWaylandFullscreenShell) -#include "test_wayland_fullscreen_shell.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_output.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_output.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_output.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_output.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,33 +1,19 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/display.h" +#include "../../src/server/dpms_interface.h" +#include "../../src/server/output_interface.h" #include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" #include "../../src/client/dpms.h" +#include "../../src/client/event_queue.h" #include "../../src/client/output.h" #include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/dpms_interface.h" -#include "../../src/server/output_interface.h" // Wayland #include @@ -41,7 +27,7 @@ void cleanup(); void testRegistry(); - void testModeChanges(); + void testModeChange(); void testScaleChange(); void testSubPixel_data(); @@ -57,8 +43,8 @@ void testDpmsRequestMode(); private: - KWayland::Server::Display *m_display; - KWayland::Server::OutputInterface *m_serverOutput; + KWaylandServer::Display *m_display; + KWaylandServer::OutputInterface *m_serverOutput; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::EventQueue *m_queue; QThread *m_thread; @@ -77,31 +63,25 @@ void TestWaylandOutput::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - m_serverOutput = m_display->createOutput(this); + m_serverOutput = new OutputInterface(m_display, this); QCOMPARE(m_serverOutput->pixelSize(), QSize()); QCOMPARE(m_serverOutput->refreshRate(), 60000); - m_serverOutput->addMode(QSize(800, 600), OutputInterface::ModeFlags(OutputInterface::ModeFlag::Preferred)); - QCOMPARE(m_serverOutput->pixelSize(), QSize(800, 600)); - m_serverOutput->addMode(QSize(1024, 768)); - m_serverOutput->addMode(QSize(1280, 1024), OutputInterface::ModeFlags(), 90000); - QCOMPARE(m_serverOutput->pixelSize(), QSize(800, 600)); - m_serverOutput->setCurrentMode(QSize(1024, 768)); + m_serverOutput->setMode(QSize(1024, 768)); QCOMPARE(m_serverOutput->pixelSize(), QSize(1024, 768)); QCOMPARE(m_serverOutput->refreshRate(), 60000); - m_serverOutput->create(); QCOMPARE(m_serverOutput->isDpmsSupported(), false); - QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::On); + QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::Off); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -132,16 +112,16 @@ delete m_connection; m_connection = nullptr; - delete m_serverOutput; - m_serverOutput = nullptr; - delete m_display; m_display = nullptr; + + // these are the children of the display + m_serverOutput = nullptr; } void TestWaylandOutput::testRegistry() { - QSignalSpy globalPositionChangedSpy(m_serverOutput, &KWayland::Server::OutputInterface::globalPositionChanged); + QSignalSpy globalPositionChangedSpy(m_serverOutput, &KWaylandServer::OutputInterface::globalPositionChanged); QVERIFY(globalPositionChangedSpy.isValid()); QCOMPARE(m_serverOutput->globalPosition(), QPoint(0, 0)); m_serverOutput->setGlobalPosition(QPoint(100, 50)); @@ -151,7 +131,7 @@ m_serverOutput->setGlobalPosition(QPoint(100, 50)); QCOMPARE(globalPositionChangedSpy.count(), 1); - QSignalSpy physicalSizeChangedSpy(m_serverOutput, &KWayland::Server::OutputInterface::physicalSizeChanged); + QSignalSpy physicalSizeChangedSpy(m_serverOutput, &KWaylandServer::OutputInterface::physicalSizeChanged); QVERIFY(physicalSizeChangedSpy.isValid()); QCOMPARE(m_serverOutput->physicalSize(), QSize()); m_serverOutput->setPhysicalSize(QSize(200, 100)); @@ -160,9 +140,10 @@ // changing again should not trigger signal m_serverOutput->setPhysicalSize(QSize(200, 100)); QCOMPARE(physicalSizeChangedSpy.count(), 1); + m_serverOutput->done(); KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -182,7 +163,7 @@ QCOMPARE(output.subPixel(), KWayland::Client::Output::SubPixel::Unknown); QCOMPARE(output.transform(), KWayland::Client::Output::Transform::Normal); - QSignalSpy outputChanged(&output, SIGNAL(changed())); + QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed); QVERIFY(outputChanged.isValid()); auto o = registry.bindOutput(announced.first().first().value(), announced.first().last().value()); @@ -206,25 +187,11 @@ QCOMPARE(output.transform(), KWayland::Client::Output::Transform::Normal); } -void TestWaylandOutput::testModeChanges() +void TestWaylandOutput::testModeChange() { - // verify the server modes - using namespace KWayland::Server; - const auto serverModes = m_serverOutput->modes(); - QCOMPARE(serverModes.count(), 3); - QCOMPARE(serverModes.at(0).size, QSize(800, 600)); - QCOMPARE(serverModes.at(1).size, QSize(1024, 768)); - QCOMPARE(serverModes.at(2).size, QSize(1280, 1024)); - QCOMPARE(serverModes.at(0).refreshRate, 60000); - QCOMPARE(serverModes.at(1).refreshRate, 60000); - QCOMPARE(serverModes.at(2).refreshRate, 90000); - QCOMPARE(serverModes.at(0).flags, OutputInterface::ModeFlags(OutputInterface::ModeFlag::Preferred)); - QCOMPARE(serverModes.at(1).flags, OutputInterface::ModeFlags(OutputInterface::ModeFlag::Current)); - QCOMPARE(serverModes.at(2).flags, OutputInterface::ModeFlags()); - using namespace KWayland::Client; KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); registry.setEventQueue(m_queue); registry.create(m_connection->display()); QVERIFY(registry.isValid()); @@ -233,91 +200,39 @@ QVERIFY(announced.wait()); KWayland::Client::Output output; - QSignalSpy outputChanged(&output, SIGNAL(changed())); + QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed); QVERIFY(outputChanged.isValid()); - QSignalSpy modeAddedSpy(&output, SIGNAL(modeAdded(KWayland::Client::Output::Mode))); + QSignalSpy modeAddedSpy(&output, &KWayland::Client::Output::modeAdded); QVERIFY(modeAddedSpy.isValid()); output.setup(registry.bindOutput(announced.first().first().value(), announced.first().last().value())); wl_display_flush(m_connection->display()); QVERIFY(outputChanged.wait()); - QCOMPARE(modeAddedSpy.count(), 3); - QCOMPARE(modeAddedSpy.at(0).first().value().size, QSize(800, 600)); + QCOMPARE(modeAddedSpy.count(), 1); + QCOMPARE(modeAddedSpy.at(0).first().value().size, QSize(1024, 768)); QCOMPARE(modeAddedSpy.at(0).first().value().refreshRate, 60000); - QCOMPARE(modeAddedSpy.at(0).first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Preferred)); + QCOMPARE(modeAddedSpy.at(0).first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Current)); QCOMPARE(modeAddedSpy.at(0).first().value().output, QPointer(&output)); - QCOMPARE(modeAddedSpy.at(1).first().value().size, QSize(1280, 1024)); - QCOMPARE(modeAddedSpy.at(1).first().value().refreshRate, 90000); - QCOMPARE(modeAddedSpy.at(1).first().value().flags, Output::Mode::Flags(Output::Mode::Flag::None)); - QCOMPARE(modeAddedSpy.at(1).first().value().output, QPointer(&output)); - QCOMPARE(modeAddedSpy.at(2).first().value().size, QSize(1024, 768)); - QCOMPARE(modeAddedSpy.at(2).first().value().refreshRate, 60000); - QCOMPARE(modeAddedSpy.at(2).first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Current)); - QCOMPARE(modeAddedSpy.at(2).first().value().output, QPointer(&output)); - const QList &modes = output.modes(); - QCOMPARE(modes.size(), 3); - QCOMPARE(modes.at(0), modeAddedSpy.at(0).first().value()); - QCOMPARE(modes.at(1), modeAddedSpy.at(1).first().value()); - QCOMPARE(modes.at(2), modeAddedSpy.at(2).first().value()); - QCOMPARE(output.pixelSize(), QSize(1024, 768)); - - // change the current mode - outputChanged.clear(); - QSignalSpy modeChangedSpy(&output, &KWayland::Client::Output::modeChanged); - QVERIFY(modeChangedSpy.isValid()); - m_serverOutput->setCurrentMode(QSize(800, 600)); - QVERIFY(modeChangedSpy.wait()); - if (modeChangedSpy.size() == 1) { - QVERIFY(modeChangedSpy.wait()); - } - QCOMPARE(modeChangedSpy.size(), 2); - // the one which lost the current flag - QCOMPARE(modeChangedSpy.first().first().value().size, QSize(1024, 768)); - QCOMPARE(modeChangedSpy.first().first().value().refreshRate, 60000); - QCOMPARE(modeChangedSpy.first().first().value().flags, Output::Mode::Flags()); - // the one which got the current flag - QCOMPARE(modeChangedSpy.last().first().value().size, QSize(800, 600)); - QCOMPARE(modeChangedSpy.last().first().value().refreshRate, 60000); - QCOMPARE(modeChangedSpy.last().first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Current | Output::Mode::Flag::Preferred)); - QVERIFY(!outputChanged.isEmpty()); - QCOMPARE(output.pixelSize(), QSize(800, 600)); - const QList &modes2 = output.modes(); - QCOMPARE(modes2.at(0).size, QSize(1280, 1024)); - QCOMPARE(modes2.at(0).refreshRate, 90000); - QCOMPARE(modes2.at(0).flags, Output::Mode::Flag::None); - QCOMPARE(modes2.at(1).size, QSize(1024, 768)); - QCOMPARE(modes2.at(1).refreshRate, 60000); - QCOMPARE(modes2.at(1).flags, Output::Mode::Flag::None); - QCOMPARE(modes2.at(2).size, QSize(800, 600)); - QCOMPARE(modes2.at(2).refreshRate, 60000); - QCOMPARE(modes2.at(2).flags, Output::Mode::Flag::Current | Output::Mode::Flag::Preferred); + QCOMPARE(output.refreshRate(), 60000); // change once more - outputChanged.clear(); - modeChangedSpy.clear(); - m_serverOutput->setCurrentMode(QSize(1280, 1024), 90000); + m_serverOutput->setMode(QSize(1280, 1024), 90000); QCOMPARE(m_serverOutput->refreshRate(), 90000); - QVERIFY(modeChangedSpy.wait()); - if (modeChangedSpy.size() == 1) { - QVERIFY(modeChangedSpy.wait()); - } - QCOMPARE(modeChangedSpy.size(), 2); - // the one which lost the current flag - QCOMPARE(modeChangedSpy.first().first().value().size, QSize(800, 600)); - QCOMPARE(modeChangedSpy.first().first().value().refreshRate, 60000); - QCOMPARE(modeChangedSpy.first().first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Preferred)); - // the one which got the current flag - QCOMPARE(modeChangedSpy.last().first().value().size, QSize(1280, 1024)); - QCOMPARE(modeChangedSpy.last().first().value().refreshRate, 90000); - QCOMPARE(modeChangedSpy.last().first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Current)); - QVERIFY(!outputChanged.isEmpty()); + m_serverOutput->done(); + QVERIFY(outputChanged.wait()); + QCOMPARE(modeAddedSpy.count(), 2); + QCOMPARE(modeAddedSpy.at(1).first().value().size, QSize(1280, 1024)); + QCOMPARE(modeAddedSpy.at(1).first().value().refreshRate, 90000); + QCOMPARE(modeAddedSpy.at(1).first().value().flags, Output::Mode::Flags(Output::Mode::Flag::Current)); + QCOMPARE(modeAddedSpy.at(1).first().value().output, QPointer(&output)); QCOMPARE(output.pixelSize(), QSize(1280, 1024)); + QCOMPARE(output.refreshRate(), 90000); } void TestWaylandOutput::testScaleChange() { KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -325,7 +240,7 @@ QVERIFY(announced.wait()); KWayland::Client::Output output; - QSignalSpy outputChanged(&output, SIGNAL(changed())); + QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed); QVERIFY(outputChanged.isValid()); output.setup(registry.bindOutput(announced.first().first().value(), announced.first().last().value())); wl_display_flush(m_connection->display()); @@ -335,10 +250,11 @@ // change the scale outputChanged.clear(); QCOMPARE(m_serverOutput->scale(), 1); - QSignalSpy serverScaleChanged(m_serverOutput, &KWayland::Server::OutputInterface::scaleChanged); + QSignalSpy serverScaleChanged(m_serverOutput, &KWaylandServer::OutputInterface::scaleChanged); QVERIFY(serverScaleChanged.isValid()); m_serverOutput->setScale(2); QCOMPARE(m_serverOutput->scale(), 2); + m_serverOutput->done(); QCOMPARE(serverScaleChanged.count(), 1); QVERIFY(outputChanged.wait()); QCOMPARE(output.scale(), 2); @@ -350,6 +266,7 @@ // change once more outputChanged.clear(); m_serverOutput->setScale(4); + m_serverOutput->done(); QVERIFY(outputChanged.wait()); QCOMPARE(output.scale(), 4); } @@ -357,9 +274,9 @@ void TestWaylandOutput::testSubPixel_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("expected"); - QTest::addColumn("actual"); + QTest::addColumn("actual"); QTest::newRow("none") << Output::SubPixel::None << OutputInterface::SubPixel::None; QTest::newRow("horizontal/rgb") << Output::SubPixel::HorizontalRGB << OutputInterface::SubPixel::HorizontalRGB; @@ -371,7 +288,7 @@ void TestWaylandOutput::testSubPixel() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QFETCH(OutputInterface::SubPixel, actual); QCOMPARE(m_serverOutput->subPixel(), OutputInterface::SubPixel::Unknown); QSignalSpy serverSubPixelChangedSpy(m_serverOutput, &OutputInterface::subPixelChanged); @@ -384,7 +301,7 @@ QCOMPARE(serverSubPixelChangedSpy.count(), 1); KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -392,7 +309,7 @@ QVERIFY(announced.wait()); KWayland::Client::Output output; - QSignalSpy outputChanged(&output, SIGNAL(changed())); + QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed); QVERIFY(outputChanged.isValid()); output.setup(registry.bindOutput(announced.first().first().value(), announced.first().last().value())); wl_display_flush(m_connection->display()); @@ -406,6 +323,7 @@ outputChanged.clear(); m_serverOutput->setSubPixel(OutputInterface::SubPixel::Unknown); QCOMPARE(m_serverOutput->subPixel(), OutputInterface::SubPixel::Unknown); + m_serverOutput->done(); QCOMPARE(serverSubPixelChangedSpy.count(), 2); if (outputChanged.isEmpty()) { QVERIFY(outputChanged.wait()); @@ -416,15 +334,15 @@ void TestWaylandOutput::testTransform_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("expected"); - QTest::addColumn("actual"); + QTest::addColumn("actual"); - QTest::newRow("90") << Output::Transform::Rotated90 << OutputInterface::Transform::Rotated90; - QTest::newRow("180") << Output::Transform::Rotated180 << OutputInterface::Transform::Rotated180; - QTest::newRow("270") << Output::Transform::Rotated270 << OutputInterface::Transform::Rotated270; - QTest::newRow("Flipped") << Output::Transform::Flipped << OutputInterface::Transform::Flipped; - QTest::newRow("Flipped 90") << Output::Transform::Flipped90 << OutputInterface::Transform::Flipped90; + QTest::newRow("90") << Output::Transform::Rotated90 << OutputInterface::Transform::Rotated90; + QTest::newRow("180") << Output::Transform::Rotated180 << OutputInterface::Transform::Rotated180; + QTest::newRow("270") << Output::Transform::Rotated270 << OutputInterface::Transform::Rotated270; + QTest::newRow("Flipped") << Output::Transform::Flipped << OutputInterface::Transform::Flipped; + QTest::newRow("Flipped 90") << Output::Transform::Flipped90 << OutputInterface::Transform::Flipped90; QTest::newRow("Flipped 180") << Output::Transform::Flipped180 << OutputInterface::Transform::Flipped180; QTest::newRow("Flipped 280") << Output::Transform::Flipped270 << OutputInterface::Transform::Flipped270; } @@ -432,7 +350,7 @@ void TestWaylandOutput::testTransform() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QFETCH(OutputInterface::Transform, actual); QCOMPARE(m_serverOutput->transform(), OutputInterface::Transform::Normal); QSignalSpy serverTransformChangedSpy(m_serverOutput, &OutputInterface::transformChanged); @@ -445,7 +363,7 @@ QCOMPARE(serverTransformChangedSpy.count(), 1); KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -453,7 +371,7 @@ QVERIFY(announced.wait()); KWayland::Client::Output *output = registry.createOutput(announced.first().first().value(), announced.first().last().value(), ®istry); - QSignalSpy outputChanged(output, SIGNAL(changed())); + QSignalSpy outputChanged(output, &KWayland::Client::Output::changed); QVERIFY(outputChanged.isValid()); wl_display_flush(m_connection->display()); if (outputChanged.isEmpty()) { @@ -466,6 +384,7 @@ outputChanged.clear(); m_serverOutput->setTransform(OutputInterface::Transform::Normal); QCOMPARE(m_serverOutput->transform(), OutputInterface::Transform::Normal); + m_serverOutput->done(); QCOMPARE(serverTransformChangedSpy.count(), 2); if (outputChanged.isEmpty()) { QVERIFY(outputChanged.wait()); @@ -476,22 +395,22 @@ void TestWaylandOutput::testDpms_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("client"); - QTest::addColumn("server"); + QTest::addColumn("server"); QTest::newRow("Standby") << Dpms::Mode::Standby << OutputInterface::DpmsMode::Standby; QTest::newRow("Suspend") << Dpms::Mode::Suspend << OutputInterface::DpmsMode::Suspend; - QTest::newRow("Off") << Dpms::Mode::Off << OutputInterface::DpmsMode::Off; + QTest::newRow("On") << Dpms::Mode::On << OutputInterface::DpmsMode::On; } void TestWaylandOutput::testDpms() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - m_display->createDpmsManager()->create(); + DpmsManagerInterface iface(m_display); // set Dpms on the Output QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged); @@ -514,9 +433,11 @@ QVERIFY(announced.wait()); QCOMPARE(dpmsAnnouncedSpy.count(), 1); - Output *output = registry.createOutput(registry.interface(Registry::Interface::Output).name, registry.interface(Registry::Interface::Output).version, ®istry); + Output *output = + registry.createOutput(registry.interface(Registry::Interface::Output).name, registry.interface(Registry::Interface::Output).version, ®istry); - DpmsManager *dpmsManager = registry.createDpmsManager(dpmsAnnouncedSpy.first().first().value(), dpmsAnnouncedSpy.first().last().value(), ®istry); + DpmsManager *dpmsManager = + registry.createDpmsManager(dpmsAnnouncedSpy.first().first().value(), dpmsAnnouncedSpy.first().last().value(), ®istry); QVERIFY(dpmsManager->isValid()); Dpms *dpms = dpmsManager->getDpms(output, ®istry); @@ -536,7 +457,7 @@ QSignalSpy clientDpmsModeChangedSpy(dpms, &Dpms::modeChanged); QVERIFY(clientDpmsModeChangedSpy.isValid()); - QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::On); + QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::Off); QFETCH(OutputInterface::DpmsMode, server); m_serverOutput->setDpmsMode(server); QCOMPARE(m_serverOutput->dpmsMode(), server); @@ -558,20 +479,20 @@ QCOMPARE(supportedChangedSpy.count(), 2); QVERIFY(dpms->isSupported()); - // and switch back to on - m_serverOutput->setDpmsMode(OutputInterface::DpmsMode::On); + // and switch back to off + m_serverOutput->setDpmsMode(OutputInterface::DpmsMode::Off); QVERIFY(clientDpmsModeChangedSpy.wait()); QCOMPARE(clientDpmsModeChangedSpy.count(), 2); - QCOMPARE(dpms->mode(), Dpms::Mode::On); + QCOMPARE(dpms->mode(), Dpms::Mode::Off); } void TestWaylandOutput::testDpmsRequestMode_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("client"); - QTest::addColumn("server"); + QTest::addColumn("server"); QTest::newRow("Standby") << Dpms::Mode::Standby << OutputInterface::DpmsMode::Standby; QTest::newRow("Suspend") << Dpms::Mode::Suspend << OutputInterface::DpmsMode::Suspend; @@ -583,10 +504,10 @@ { // this test verifies that requesting a dpms change from client side emits the signal on server side using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // setup code - m_display->createDpmsManager()->create(); + DpmsManagerInterface iface(m_display); // set Dpms on the Output QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged); @@ -609,9 +530,11 @@ QVERIFY(announced.wait()); QCOMPARE(dpmsAnnouncedSpy.count(), 1); - Output *output = registry.createOutput(registry.interface(Registry::Interface::Output).name, registry.interface(Registry::Interface::Output).version, ®istry); + Output *output = + registry.createOutput(registry.interface(Registry::Interface::Output).name, registry.interface(Registry::Interface::Output).version, ®istry); - DpmsManager *dpmsManager = registry.createDpmsManager(dpmsAnnouncedSpy.first().first().value(), dpmsAnnouncedSpy.first().last().value(), ®istry); + DpmsManager *dpmsManager = + registry.createDpmsManager(dpmsAnnouncedSpy.first().first().value(), dpmsAnnouncedSpy.first().last().value(), ®istry); QVERIFY(dpmsManager->isValid()); Dpms *dpms = dpmsManager->getDpms(output, ®istry); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_outputdevice.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_outputdevice.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_outputdevice.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_outputdevice.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,23 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2015 Sebastian Kügler - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/display.h" +#include "../../src/server/outputdevice_interface.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/outputdevice.h" #include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/outputdevice_interface.h" // Wayland #include using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; class TestWaylandOutputDevice : public QObject { @@ -44,7 +30,6 @@ void testRegistry(); void testModeChanges(); - void testScaleChange_legacy(); void testScaleChange(); void testColorCurvesChange(); @@ -60,17 +45,16 @@ void testDone(); private: - KWayland::Server::Display *m_display; - KWayland::Server::OutputDeviceInterface *m_serverOutputDevice; + KWaylandServer::Display *m_display; + KWaylandServer::OutputDeviceInterface *m_serverOutputDevice; QByteArray m_edid; QString m_serialNumber; QString m_eidaId; - KWayland::Server::OutputDeviceInterface::ColorCurves m_initColorCurves; + KWaylandServer::OutputDeviceInterface::ColorCurves m_initColorCurves; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::EventQueue *m_queue; QThread *m_thread; - }; static const QString s_socketName = QStringLiteral("kwin-test-wayland-output-0"); @@ -87,16 +71,16 @@ void TestWaylandOutputDevice::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; + qRegisterMetaType(); delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - m_serverOutputDevice = m_display->createOutputDevice(this); - m_serverOutputDevice->setUuid("1337"); - + m_serverOutputDevice = new OutputDeviceInterface(m_display, this); + m_serverOutputDevice->setUuid(QUuid("00000000-0000-0000-0000-000000000000")); OutputDeviceInterface::Mode m0; m0.id = 0; @@ -117,7 +101,10 @@ m_serverOutputDevice->setCurrentMode(1); - m_edid = QByteArray::fromBase64("AP///////wAQrBbwTExLQQ4WAQOANCB46h7Frk80sSYOUFSlSwCBgKlA0QBxTwEBAQEBAQEBKDyAoHCwI0AwIDYABkQhAAAaAAAA/wBGNTI1TTI0NUFLTEwKAAAA/ABERUxMIFUyNDEwCiAgAAAA/QA4TB5REQAKICAgICAgAToCAynxUJAFBAMCBxYBHxITFCAVEQYjCQcHZwMMABAAOC2DAQAA4wUDAQI6gBhxOC1AWCxFAAZEIQAAHgEdgBhxHBYgWCwlAAZEIQAAngEdAHJR0B4gbihVAAZEIQAAHowK0Iog4C0QED6WAAZEIQAAGAAAAAAAAAAAAAAAAAAAPg=="); + m_edid = QByteArray::fromBase64( + "AP///////wAQrBbwTExLQQ4WAQOANCB46h7Frk80sSYOUFSlSwCBgKlA0QBxTwEBAQEBAQEBKDyAoHCwI0AwIDYABkQhAAAaAAAA/wBGNTI1TTI0NUFLTEwKAAAA/ABERUxMIFUyNDEwCiAgAAAA/" + "QA4TB5REQAKICAgICAgAToCAynxUJAFBAMCBxYBHxITFCAVEQYjCQcHZwMMABAAOC2DAQAA4wUDAQI6gBhxOC1AWCxFAAZEIQAAHgEdgBhxHBYgWCwlAAZEIQAAngEdAHJR0B4gbihVAAZEIQAAHow" + "K0Iog4C0QED6WAAZEIQAAGAAAAAAAAAAAAAAAAAAAPg=="); m_serverOutputDevice->setEdid(m_edid); m_serialNumber = "23498723948723"; @@ -131,8 +118,8 @@ // 8 bit color ramps for (int i = 0; i < 256; i++) { quint16 val = (double)i / 255 * UINT16_MAX; - m_initColorCurves.red << val ; - m_initColorCurves.green << val ; + m_initColorCurves.red << val; + m_initColorCurves.green << val; } // 10 bit color ramp for (int i = 0; i < 320; i++) { @@ -140,8 +127,6 @@ } m_serverOutputDevice->setColorCurves(m_initColorCurves); - m_serverOutputDevice->create(); - // setup connection m_connection = new KWayland::Client::ConnectionThread; QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); @@ -199,7 +184,7 @@ KWayland::Client::OutputDevice output; QVERIFY(!output.isValid()); - QCOMPARE(output.uuid(), QByteArray()); + QCOMPARE(output.uuid(), QString()); QCOMPARE(output.geometry(), QRect()); QCOMPARE(output.globalPosition(), QPoint()); QCOMPARE(output.manufacturer(), QString()); @@ -207,7 +192,7 @@ QCOMPARE(output.physicalSize(), QSize()); QCOMPARE(output.pixelSize(), QSize()); QCOMPARE(output.refreshRate(), 0); - QCOMPARE(output.scale(), 1); + QCOMPARE(output.scaleF(), 1.0); QCOMPARE(output.colorCurves().red, QVector()); QCOMPARE(output.colorCurves().green, QVector()); QCOMPARE(output.colorCurves().blue, QVector()); @@ -233,7 +218,7 @@ QCOMPARE(output.physicalSize(), QSize(200, 100)); QCOMPARE(output.pixelSize(), QSize(1024, 768)); QCOMPARE(output.refreshRate(), 60000); - QCOMPARE(output.scale(), 1); + QCOMPARE(output.scaleF(), 1.0); QCOMPARE(output.colorCurves().red, m_initColorCurves.red); QCOMPARE(output.colorCurves().green, m_initColorCurves.green); QCOMPARE(output.colorCurves().blue, m_initColorCurves.blue); @@ -244,7 +229,7 @@ QCOMPARE(output.edid(), m_edid); QCOMPARE(output.enabled(), OutputDevice::Enablement::Enabled); - QCOMPARE(output.uuid(), QByteArray("1337")); + QCOMPARE(output.uuid(), QStringLiteral("00000000-0000-0000-0000-000000000000")); QCOMPARE(output.serialNumber(), m_serialNumber); QCOMPARE(output.eisaId(), m_eidaId); } @@ -314,7 +299,8 @@ // the one which got the current flag QCOMPARE(modeChangedSpy.last().first().value().size, QSize(800, 600)); QCOMPARE(modeChangedSpy.last().first().value().refreshRate, 60000); - QCOMPARE(modeChangedSpy.last().first().value().flags, OutputDevice::Mode::Flags(OutputDevice::Mode::Flag::Current | OutputDevice::Mode::Flag::Preferred)); + QCOMPARE(modeChangedSpy.last().first().value().flags, + OutputDevice::Mode::Flags(OutputDevice::Mode::Flag::Current | OutputDevice::Mode::Flag::Preferred)); QVERIFY(!outputChanged.isEmpty()); QCOMPARE(output.pixelSize(), QSize(800, 600)); const QList &modes2 = output.modes(); @@ -346,43 +332,6 @@ QCOMPARE(output.pixelSize(), QSize(1280, 1024)); } -void TestWaylandOutputDevice::testScaleChange_legacy() -{ - KWayland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &KWayland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &KWayland::Client::Registry::outputDeviceAnnounced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - KWayland::Client::OutputDevice output; - QSignalSpy outputChanged(&output, &KWayland::Client::OutputDevice::done); - QVERIFY(outputChanged.isValid()); - output.setup(registry.bindOutputDevice(announced.first().first().value(), announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(outputChanged.wait()); - QCOMPARE(output.scale(), 1); - - // change the scale - outputChanged.clear(); - m_serverOutputDevice->setScale(2); - QVERIFY(outputChanged.wait()); - QCOMPARE(output.scale(), 2); - QCOMPARE(output.scaleF(), 2.0); //check we're forward compatible - - - // change once more - outputChanged.clear(); - m_serverOutputDevice->setScale(4); - QVERIFY(outputChanged.wait()); - QCOMPARE(output.scale(), 4); - QCOMPARE(output.scaleF(), 4.0); -} - void TestWaylandOutputDevice::testScaleChange() { KWayland::Client::Registry registry; @@ -408,14 +357,12 @@ outputChanged.clear(); m_serverOutputDevice->setScaleF(2.2); QVERIFY(outputChanged.wait()); - QCOMPARE(output.scale(), 2); //check backwards compatibility works QCOMPARE(wl_fixed_from_double(output.scaleF()), wl_fixed_from_double(2.2)); // change once more outputChanged.clear(); m_serverOutputDevice->setScaleF(4.9); QVERIFY(outputChanged.wait()); - QCOMPARE(output.scale(), 5); QCOMPARE(wl_fixed_from_double(output.scaleF()), wl_fixed_from_double(4.9)); } @@ -444,7 +391,7 @@ // change the color curves outputChanged.clear(); - KWayland::Server::OutputDeviceInterface::ColorCurves cc; + KWaylandServer::OutputDeviceInterface::ColorCurves cc; cc.red = QVector(256, 0); cc.green = QVector(256, UINT16_MAX); cc.blue = QVector(320, 1); @@ -469,9 +416,9 @@ void TestWaylandOutputDevice::testSubPixel_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("expected"); - QTest::addColumn("actual"); + QTest::addColumn("actual"); QTest::newRow("none") << OutputDevice::SubPixel::None << OutputDeviceInterface::SubPixel::None; QTest::newRow("horizontal/rgb") << OutputDevice::SubPixel::HorizontalRGB << OutputDeviceInterface::SubPixel::HorizontalRGB; @@ -483,7 +430,7 @@ void TestWaylandOutputDevice::testSubPixel() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QFETCH(OutputDeviceInterface::SubPixel, actual); m_serverOutputDevice->setSubPixel(actual); @@ -517,15 +464,15 @@ void TestWaylandOutputDevice::testTransform_data() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("expected"); - QTest::addColumn("actual"); + QTest::addColumn("actual"); - QTest::newRow("90") << OutputDevice::Transform::Rotated90 << OutputDeviceInterface::Transform::Rotated90; - QTest::newRow("180") << OutputDevice::Transform::Rotated180 << OutputDeviceInterface::Transform::Rotated180; - QTest::newRow("270") << OutputDevice::Transform::Rotated270 << OutputDeviceInterface::Transform::Rotated270; - QTest::newRow("Flipped") << OutputDevice::Transform::Flipped << OutputDeviceInterface::Transform::Flipped; - QTest::newRow("Flipped 90") << OutputDevice::Transform::Flipped90 << OutputDeviceInterface::Transform::Flipped90; + QTest::newRow("90") << OutputDevice::Transform::Rotated90 << OutputDeviceInterface::Transform::Rotated90; + QTest::newRow("180") << OutputDevice::Transform::Rotated180 << OutputDeviceInterface::Transform::Rotated180; + QTest::newRow("270") << OutputDevice::Transform::Rotated270 << OutputDeviceInterface::Transform::Rotated270; + QTest::newRow("Flipped") << OutputDevice::Transform::Flipped << OutputDeviceInterface::Transform::Flipped; + QTest::newRow("Flipped 90") << OutputDevice::Transform::Flipped90 << OutputDeviceInterface::Transform::Flipped90; QTest::newRow("Flipped 180") << OutputDevice::Transform::Flipped180 << OutputDeviceInterface::Transform::Flipped180; QTest::newRow("Flipped 280") << OutputDevice::Transform::Flipped270 << OutputDeviceInterface::Transform::Flipped270; } @@ -533,7 +480,7 @@ void TestWaylandOutputDevice::testTransform() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QFETCH(OutputDeviceInterface::Transform, actual); m_serverOutputDevice->setTransform(actual); @@ -548,7 +495,8 @@ wl_display_flush(m_connection->display()); QVERIFY(interfacesAnnouncedSpy.wait()); - KWayland::Client::OutputDevice *output = registry.createOutputDevice(announced.first().first().value(), announced.first().last().value(), ®istry); + KWayland::Client::OutputDevice *output = + registry.createOutputDevice(announced.first().first().value(), announced.first().last().value(), ®istry); QSignalSpy outputChanged(output, &KWayland::Client::OutputDevice::done); QVERIFY(outputChanged.isValid()); wl_display_flush(m_connection->display()); @@ -651,22 +599,16 @@ wl_display_flush(m_connection->display()); QVERIFY(outputChanged.wait()); - QCOMPARE(output.uuid(), QByteArray("1337")); + QCOMPARE(output.uuid(), QStringLiteral("00000000-0000-0000-0000-000000000000")); QSignalSpy idChanged(&output, &KWayland::Client::OutputDevice::uuidChanged); QVERIFY(idChanged.isValid()); - m_serverOutputDevice->setUuid("42"); + m_serverOutputDevice->setUuid(QUuid("00000000-0000-0000-0000-000000000001")); QVERIFY(idChanged.wait()); - QCOMPARE(idChanged.first().first().toByteArray(), QByteArray("42")); + QCOMPARE(idChanged.first().first().toByteArray(), QByteArray("00000000-0000-0000-0000-000000000001")); idChanged.clear(); - QCOMPARE(output.uuid(), QByteArray("42")); - - m_serverOutputDevice->setUuid("4711"); - QVERIFY(idChanged.wait()); - QCOMPARE(idChanged.first().first().toByteArray(), QByteArray("4711")); - idChanged.clear(); - QCOMPARE(output.uuid(), QByteArray("4711")); + QCOMPARE(output.uuid(), QStringLiteral("00000000-0000-0000-0000-000000000001")); } void TestWaylandOutputDevice::testDone() @@ -690,6 +632,5 @@ QVERIFY(outputDone.wait()); } - QTEST_GUILESS_MAIN(TestWaylandOutputDevice) #include "test_wayland_outputdevice.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_outputmanagement.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_outputmanagement.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_outputmanagement.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_outputmanagement.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,45 +1,30 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2015 Sebastian Kügler - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/outputconfiguration_interface.h" +#include "../../src/server/outputdevice_interface.h" +#include "../../src/server/outputmanagement_interface.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" -#include "../../src/client/outputdevice.h" +#include "../../src/client/output.h" #include "../../src/client/outputconfiguration.h" +#include "../../src/client/outputdevice.h" #include "../../src/client/outputmanagement.h" -#include "../../src/client/output.h" #include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/shell_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/outputconfiguration_interface.h" -#include "../../src/server/outputdevice_interface.h" -#include "../../src/server/outputmanagement_interface.h" // Wayland #include using namespace KWayland::Client; -using namespace KWayland::Server; +using namespace KWaylandServer; class TestWaylandOutputManagement : public QObject { @@ -65,19 +50,18 @@ private: void createOutputDevices(); void testEnable(); - void applyPendingChanges(KWayland::Server::OutputConfigurationInterface *configurationInterface); - - KWayland::Server::Display *m_display; - KWayland::Server::OutputManagementInterface *m_outputManagementInterface; - QList m_serverOutputs; + void applyPendingChanges(KWaylandServer::OutputConfigurationInterface *configurationInterface); + KWaylandServer::Display *m_display; + KWaylandServer::OutputManagementInterface *m_outputManagementInterface; + QList m_serverOutputs; KWayland::Client::Registry *m_registry = nullptr; KWayland::Client::OutputDevice *m_outputDevice = nullptr; KWayland::Client::OutputManagement *m_outputManagement = nullptr; KWayland::Client::OutputConfiguration *m_outputConfiguration = nullptr; QList m_clientOutputs; - QList m_modes; + QList m_modes; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -85,7 +69,6 @@ QSignalSpy *m_announcedSpy; QSignalSpy *m_omSpy; - QSignalSpy *m_configSpy; }; static const QString s_socketName = QStringLiteral("kwin-test-wayland-output-0"); @@ -99,24 +82,20 @@ , m_thread(nullptr) , m_announcedSpy(nullptr) { - qRegisterMetaType(); + qRegisterMetaType(); } void TestWaylandOutputManagement::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - auto shell = m_display->createShell(this); - shell->create(); - auto comp = m_display->createCompositor(this); - comp->create(); - - auto outputDeviceInterface = m_display->createOutputDevice(this); + new CompositorInterface(m_display, this); + auto outputDeviceInterface = new OutputDeviceInterface(m_display, this); OutputDeviceInterface::Mode m0; m0.id = 0; @@ -146,12 +125,9 @@ outputDeviceInterface->setCurrentMode(1); outputDeviceInterface->setGlobalPosition(QPoint(0, 1920)); - outputDeviceInterface->create(); m_serverOutputs << outputDeviceInterface; - m_outputManagementInterface = m_display->createOutputManagement(this); - m_outputManagementInterface->create(); - QVERIFY(m_outputManagementInterface->isValid()); + m_outputManagementInterface = new OutputManagementInterface(m_display, this); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -220,20 +196,19 @@ m_thread = nullptr; } - if (m_outputManagementInterface) { - delete m_outputManagementInterface; - m_outputManagementInterface = nullptr; - } delete m_display; m_display = nullptr; m_serverOutputs.clear(); m_clientOutputs.clear(); + + // these are the children of the display + m_outputManagementInterface = nullptr; } -void TestWaylandOutputManagement::applyPendingChanges(KWayland::Server::OutputConfigurationInterface *configurationInterface) +void TestWaylandOutputManagement::applyPendingChanges(KWaylandServer::OutputConfigurationInterface *configurationInterface) { auto changes = configurationInterface->changes(); - for (auto outputdevice: changes.keys()) { + for (auto outputdevice : changes.keys()) { auto c = changes[outputdevice]; if (c->enabledChanged()) { outputdevice->setEnabled(c->enabled()); @@ -270,7 +245,7 @@ QCOMPARE(output->physicalSize(), QSize()); QCOMPARE(output->pixelSize(), QSize()); QCOMPARE(output->refreshRate(), 0); - QCOMPARE(output->scale(), 1); + QCOMPARE(output->scaleF(), 1.0); QCOMPARE(output->colorCurves().red, QVector()); QCOMPARE(output->colorCurves().green, QVector()); QCOMPARE(output->colorCurves().blue, QVector()); @@ -278,7 +253,7 @@ QCOMPARE(output->transform(), KWayland::Client::OutputDevice::Transform::Normal); QCOMPARE(output->enabled(), OutputDevice::Enablement::Enabled); QCOMPARE(output->edid(), QByteArray()); - QCOMPARE(output->uuid(), QByteArray()); + QCOMPARE(output->uuid(), QString()); QSignalSpy outputChanged(output, &KWayland::Client::OutputDevice::changed); QVERIFY(outputChanged.isValid()); @@ -301,10 +276,12 @@ createConfig(); QSignalSpy serverApplySpy(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested); - KWayland::Server::OutputConfigurationInterface *configurationInterface = nullptr; - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=, &configurationInterface](KWayland::Server::OutputConfigurationInterface *c) { - configurationInterface = c; - }); + KWaylandServer::OutputConfigurationInterface *configurationInterface = nullptr; + connect(m_outputManagementInterface, + &OutputManagementInterface::configurationChangeRequested, + [=, &configurationInterface](KWaylandServer::OutputConfigurationInterface *c) { + configurationInterface = c; + }); m_outputConfiguration->apply(); QVERIFY(serverApplySpy.wait()); @@ -340,10 +317,11 @@ QVERIFY(m_outputConfiguration->isValid()); QSignalSpy appliedSpy(m_outputConfiguration, &KWayland::Client::OutputConfiguration::applied); - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, - [=](KWayland::Server::OutputConfigurationInterface *configurationInterface) { + connect(m_outputManagementInterface, + &OutputManagementInterface::configurationChangeRequested, + [=](KWaylandServer::OutputConfigurationInterface *configurationInterface) { configurationInterface->setApplied(); - }); + }); m_outputConfiguration->apply(); QVERIFY(appliedSpy.wait(200)); QCOMPARE(appliedSpy.count(), 1); @@ -355,14 +333,14 @@ QVERIFY(m_outputConfiguration->isValid()); QSignalSpy failedSpy(m_outputConfiguration, &KWayland::Client::OutputConfiguration::failed); - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, - [=](KWayland::Server::OutputConfigurationInterface *configurationInterface) { + connect(m_outputManagementInterface, + &OutputManagementInterface::configurationChangeRequested, + [=](KWaylandServer::OutputConfigurationInterface *configurationInterface) { configurationInterface->setFailed(); - }); + }); m_outputConfiguration->apply(); QVERIFY(failedSpy.wait(200)); QCOMPARE(failedSpy.count(), 1); - } void TestWaylandOutputManagement::testEnable() @@ -388,8 +366,6 @@ config->apply(); } - - void TestWaylandOutputManagement::testMultipleSettings() { createConfig(); @@ -399,18 +375,20 @@ KWayland::Client::OutputDevice *output = m_clientOutputs.first(); QSignalSpy outputChangedSpy(output, &KWayland::Client::OutputDevice::changed); - KWayland::Server::OutputConfigurationInterface *configurationInterface; - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=, &configurationInterface](KWayland::Server::OutputConfigurationInterface *c) { - applyPendingChanges(c); - configurationInterface = c; - }); + KWaylandServer::OutputConfigurationInterface *configurationInterface; + connect(m_outputManagementInterface, + &OutputManagementInterface::configurationChangeRequested, + [=, &configurationInterface](KWaylandServer::OutputConfigurationInterface *c) { + applyPendingChanges(c); + configurationInterface = c; + }); QSignalSpy serverApplySpy(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested); QVERIFY(serverApplySpy.isValid()); config->setMode(output, m_modes.first().id); config->setTransform(output, OutputDevice::Transform::Rotated90); config->setPosition(output, QPoint(13, 37)); - config->setScale(output, 2); + config->setScaleF(output, 2.0); const auto zeroVector = QVector(256, 0); config->setColorCurves(output, zeroVector, zeroVector, zeroVector); config->setEnabled(output, OutputDevice::Enablement::Disabled); @@ -425,12 +403,12 @@ QVERIFY(configAppliedSpy.isValid()); QVERIFY(configAppliedSpy.wait(200)); QCOMPARE(configAppliedSpy.count(), 1); - QCOMPARE(outputChangedSpy.count(), 6); + QCOMPARE(outputChangedSpy.count(), 5); config->setMode(output, m_modes.at(1).id); config->setTransform(output, OutputDevice::Transform::Normal); config->setPosition(output, QPoint(0, 1920)); - config->setScale(output, 1); + config->setScaleF(output, 1.0); const auto oneVector = QVector(256, 1); config->setColorCurves(output, oneVector, oneVector, oneVector); config->setEnabled(output, OutputDevice::Enablement::Enabled); @@ -443,19 +421,16 @@ QVERIFY(configAppliedSpy.wait(200)); QCOMPARE(configAppliedSpy.count(), 2); - QCOMPARE(outputChangedSpy.count(), 12); - + QCOMPARE(outputChangedSpy.count(), 10); } void TestWaylandOutputManagement::testConfigFailed() { createConfig(); auto config = m_outputConfiguration; - auto s_o = m_serverOutputs.first(); KWayland::Client::OutputDevice *output = m_clientOutputs.first(); QVERIFY(config->isValid()); - QVERIFY(s_o->isValid()); QVERIFY(output->isValid()); QSignalSpy serverApplySpy(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested); @@ -473,7 +448,7 @@ config->apply(); - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWayland::Server::OutputConfigurationInterface *c) { + connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWaylandServer::OutputConfigurationInterface *c) { c->setFailed(); }); @@ -497,14 +472,13 @@ config->setPosition(output, QPoint(-1, -1)); QSignalSpy configAppliedSpy(config, &OutputConfiguration::applied); - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWayland::Server::OutputConfigurationInterface *c) { + connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWaylandServer::OutputConfigurationInterface *c) { c->setApplied(); }); config->apply(); QVERIFY(configAppliedSpy.isValid()); QVERIFY(configAppliedSpy.wait(200)); - } void TestWaylandOutputManagement::testScale() @@ -518,28 +492,15 @@ config->apply(); QSignalSpy configAppliedSpy(config, &OutputConfiguration::applied); - connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWayland::Server::OutputConfigurationInterface *c) { + connect(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested, [=](KWaylandServer::OutputConfigurationInterface *c) { applyPendingChanges(c); c->setApplied(); }); QVERIFY(configAppliedSpy.isValid()); QVERIFY(configAppliedSpy.wait(200)); - QCOMPARE(output->scale(), 2); //test backwards compatibility QCOMPARE(wl_fixed_from_double(output->scaleF()), wl_fixed_from_double(2.3)); - - config->setScale(output, 3); - config->apply(); - - QVERIFY(configAppliedSpy.isValid()); - QVERIFY(configAppliedSpy.wait(200)); - - //will be setApplied using the connect above - - QCOMPARE(output->scale(), 3); - QCOMPARE(output->scaleF(), 3.0); //test forward compatibility } - QTEST_GUILESS_MAIN(TestWaylandOutputManagement) #include "test_wayland_outputmanagement.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_region.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_region.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_region.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_region.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/compositor.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/region.h" -#include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" - -class TestRegion : public QObject -{ - Q_OBJECT -public: - explicit TestRegion(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testCreate(); - void testCreateWithRegion(); - void testCreateUniquePtr(); - void testAdd(); - void testRemove(); - void testDestroy(); - void testDisconnect(); - -private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Client::ConnectionThread *m_connection; - KWayland::Client::Compositor *m_compositor; - KWayland::Client::EventQueue *m_queue; - QThread *m_thread; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-wayland-region-0"); - -TestRegion::TestRegion(QObject *parent) - : QObject(parent) - , m_display(nullptr) - , m_compositorInterface(nullptr) - , m_connection(nullptr) - , m_compositor(nullptr) - , m_queue(nullptr) - , m_thread(nullptr) -{ -} - -void TestRegion::init() -{ - using namespace KWayland::Server; - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new KWayland::Client::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); - - KWayland::Client::Registry registry; - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QVERIFY(compositorSpy.isValid()); - QVERIFY(!registry.eventQueue()); - registry.setEventQueue(m_queue); - QCOMPARE(registry.eventQueue(), m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - QVERIFY(compositorSpy.wait()); - m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); -} - -void TestRegion::cleanup() -{ - if (m_compositor) { - delete m_compositor; - m_compositor = nullptr; - } - if (m_queue) { - delete m_queue; - m_queue = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - delete m_connection; - m_connection = nullptr; - - delete m_display; - m_display = nullptr; -} - -void TestRegion::testCreate() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy regionCreatedSpy(m_compositorInterface, SIGNAL(regionCreated(KWayland::Server::RegionInterface*))); - QVERIFY(regionCreatedSpy.isValid()); - - QScopedPointer region(m_compositor->createRegion()); - QCOMPARE(region->region(), QRegion()); - - QVERIFY(regionCreatedSpy.wait()); - QCOMPARE(regionCreatedSpy.count(), 1); - auto serverRegion = regionCreatedSpy.first().first().value(); - QVERIFY(serverRegion); - QCOMPARE(serverRegion->region(), QRegion()); - QCOMPARE(serverRegion->global(), m_compositorInterface); -} - -void TestRegion::testCreateWithRegion() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy regionCreatedSpy(m_compositorInterface, SIGNAL(regionCreated(KWayland::Server::RegionInterface*))); - QVERIFY(regionCreatedSpy.isValid()); - - QScopedPointer region(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); - QCOMPARE(region->region(), QRegion(0, 0, 10, 20)); - - QVERIFY(regionCreatedSpy.wait()); - QCOMPARE(regionCreatedSpy.count(), 1); - auto serverRegion = regionCreatedSpy.first().first().value(); - QVERIFY(serverRegion); - QCOMPARE(serverRegion->region(), QRegion(0, 0, 10, 20)); - QVERIFY(serverRegion->parentResource()); -} - -void TestRegion::testCreateUniquePtr() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy regionCreatedSpy(m_compositorInterface, SIGNAL(regionCreated(KWayland::Server::RegionInterface*))); - QVERIFY(regionCreatedSpy.isValid()); - - std::unique_ptr region(m_compositor->createRegion(QRegion(0, 0, 10, 20))); - QCOMPARE(region->region(), QRegion(0, 0, 10, 20)); - - QVERIFY(regionCreatedSpy.wait()); - QCOMPARE(regionCreatedSpy.count(), 1); - auto serverRegion = regionCreatedSpy.first().first().value(); - QVERIFY(serverRegion); - QCOMPARE(serverRegion->region(), QRegion(0, 0, 10, 20)); -} - -void TestRegion::testAdd() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy regionCreatedSpy(m_compositorInterface, SIGNAL(regionCreated(KWayland::Server::RegionInterface*))); - QVERIFY(regionCreatedSpy.isValid()); - - QScopedPointer region(m_compositor->createRegion()); - QVERIFY(regionCreatedSpy.wait()); - auto serverRegion = regionCreatedSpy.first().first().value(); - - QSignalSpy regionChangedSpy(serverRegion, SIGNAL(regionChanged(QRegion))); - QVERIFY(regionChangedSpy.isValid()); - - // adding a QRect - region->add(QRect(0, 0, 10, 20)); - QCOMPARE(region->region(), QRegion(0, 0, 10, 20)); - - QVERIFY(regionChangedSpy.wait()); - QCOMPARE(regionChangedSpy.count(), 1); - QCOMPARE(regionChangedSpy.last().first().value(), QRegion(0, 0, 10, 20)); - QCOMPARE(serverRegion->region(), QRegion(0, 0, 10, 20)); - - // adding a QRegion - region->add(QRegion(5, 5, 10, 50)); - QRegion compareRegion(0, 0, 10, 20); - compareRegion = compareRegion.united(QRect(5, 5, 10, 50)); - QCOMPARE(region->region(), compareRegion); - - QVERIFY(regionChangedSpy.wait()); - QCOMPARE(regionChangedSpy.count(), 2); - QCOMPARE(regionChangedSpy.last().first().value(), compareRegion); - QCOMPARE(serverRegion->region(), compareRegion); -} - -void TestRegion::testRemove() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy regionCreatedSpy(m_compositorInterface, SIGNAL(regionCreated(KWayland::Server::RegionInterface*))); - QVERIFY(regionCreatedSpy.isValid()); - - std::unique_ptr region(m_compositor->createRegion(QRegion(0, 0, 100, 200))); - QVERIFY(regionCreatedSpy.wait()); - auto serverRegion = regionCreatedSpy.first().first().value(); - - QSignalSpy regionChangedSpy(serverRegion, SIGNAL(regionChanged(QRegion))); - QVERIFY(regionChangedSpy.isValid()); - - // subtract a QRect - region->subtract(QRect(0, 0, 10, 20)); - QRegion compareRegion(0, 0, 100, 200); - compareRegion = compareRegion.subtracted(QRect(0, 0, 10, 20)); - QCOMPARE(region->region(), compareRegion); - - QVERIFY(regionChangedSpy.wait()); - QCOMPARE(regionChangedSpy.count(), 1); - QCOMPARE(regionChangedSpy.last().first().value(), compareRegion); - QCOMPARE(serverRegion->region(), compareRegion); - - // subtracting a QRegion - region->subtract(QRegion(5, 5, 10, 50)); - compareRegion = compareRegion.subtracted(QRect(5, 5, 10, 50)); - QCOMPARE(region->region(), compareRegion); - - QVERIFY(regionChangedSpy.wait()); - QCOMPARE(regionChangedSpy.count(), 2); - QCOMPARE(regionChangedSpy.last().first().value(), compareRegion); - QCOMPARE(serverRegion->region(), compareRegion); -} - -void TestRegion::testDestroy() -{ - using namespace KWayland::Client; - QScopedPointer region(m_compositor->createRegion()); - - connect(m_connection, &ConnectionThread::connectionDied, region.data(), &Region::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - QVERIFY(region->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the region should be destroyed; - QVERIFY(!region->isValid()); - - // calling destroy again should not fail - region->destroy(); -} - -void TestRegion::testDisconnect() -{ - // this test verifies that the server side correctly tears down the resources when the client disconnects - using namespace KWayland::Client; - using namespace KWayland::Server; - QScopedPointer r(m_compositor->createRegion()); - QVERIFY(!r.isNull()); - QVERIFY(r->isValid()); - QSignalSpy regionCreatedSpy(m_compositorInterface, &CompositorInterface::regionCreated); - QVERIFY(regionCreatedSpy.isValid()); - QVERIFY(regionCreatedSpy.wait()); - auto serverRegion = regionCreatedSpy.first().first().value(); - - // destroy client - QSignalSpy clientDisconnectedSpy(serverRegion->client(), &ClientConnection::disconnected); - QVERIFY(clientDisconnectedSpy.isValid()); - QSignalSpy regionDestroyedSpy(serverRegion, &QObject::destroyed); - QVERIFY(regionDestroyedSpy.isValid()); - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - QVERIFY(clientDisconnectedSpy.wait()); - QCOMPARE(clientDisconnectedSpy.count(), 1); - QCOMPARE(regionDestroyedSpy.count(), 0); - QVERIFY(regionDestroyedSpy.wait()); - QCOMPARE(regionDestroyedSpy.count(), 1); - - r->destroy(); - m_compositor->destroy(); - m_queue->destroy(); -} - -QTEST_GUILESS_MAIN(TestRegion) -#include "test_wayland_region.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_registry.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_registry.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_registry.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_registry.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,872 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/blur.h" -#include "../../src/client/contrast.h" -#include "../../src/client/compositor.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/dpms.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/registry.h" -#include "../../src/client/output.h" -#include "../../src/client/pointerconstraints.h" -#include "../../src/client/pointergestures.h" -#include "../../src/client/idleinhibit.h" -#include "../../src/client/seat.h" -#include "../../src/client/relativepointer.h" -#include "../../src/client/server_decoration.h" -#include "../../src/client/shell.h" -#include "../../src/client/surface.h" -#include "../../src/client/subcompositor.h" -#include "../../src/client/xdgshell.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/datadevicemanager_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/dpms_interface.h" -#include "../../src/server/idleinhibit_interface.h" -#include "../../src/server/output_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/shell_interface.h" -#include "../../src/server/blur_interface.h" -#include "../../src/server/contrast_interface.h" -#include "../../src/server/server_decoration_interface.h" -#include "../../src/server/slide_interface.h" -#include "../../src/server/subcompositor_interface.h" -#include "../../src/server/outputmanagement_interface.h" -#include "../../src/server/outputdevice_interface.h" -#include "../../src/server/pointerconstraints_interface.h" -#include "../../src/server/pointergestures_interface.h" -#include "../../src/server/textinput_interface.h" -#include "../../src/server/xdgshell_interface.h" -#include "../../src/server/relativepointer_interface.h" -// Wayland -#include -#include "../../build/src/server/wayland-dpms-client-protocol.h" -#include "../../build/src/server/wayland-idle-inhibit-unstable-v1-client-protocol.h" -#include "../../build/src/server/wayland-server_decoration-client-protocol.h" -#include "../../build/src/server/wayland-text-input-unstable-v2-client-protocol.h" -#include "../../build/src/server/wayland-relativepointer-unstable-v1-client-protocol.h" -#include "../../build/src/server/wayland-pointer-gestures-unstable-v1-client-protocol.h" -#include "../../build/src/server/wayland-pointer-constraints-unstable-v1-client-protocol.h" -#include "../../src/compat/wayland-xdg-shell-v5-client-protocol.h" - -class TestWaylandRegistry : public QObject -{ - Q_OBJECT -public: - explicit TestWaylandRegistry(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testCreate(); - void testBindCompositor(); - void testBindShell(); - void testBindOutput(); - void testBindShm(); - void testBindSeat(); - void testBindSubCompositor(); - void testBindDataDeviceManager(); - void testBindBlurManager(); - void testBindContrastManager(); - void testBindSlideManager(); - void testBindDpmsManager(); - void testBindServerSideDecorationManager(); - void testBindTextInputManagerUnstableV2(); - void testBindXdgShellUnstableV5(); - void testBindRelativePointerManagerUnstableV1(); - void testBindPointerGesturesUnstableV1(); - void testBindPointerConstraintsUnstableV1(); - void testBindIdleIhibitManagerUnstableV1(); - void testGlobalSync(); - void testGlobalSyncThreaded(); - void testRemoval(); - void testOutOfSyncRemoval(); - void testDestroy(); - void testAnnounceMultiple(); - void testAnnounceMultipleOutputDevices(); - -private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositor; - KWayland::Server::OutputInterface *m_output; - KWayland::Server::OutputDeviceInterface *m_outputDevice; - KWayland::Server::SeatInterface *m_seat; - KWayland::Server::ShellInterface *m_shell; - KWayland::Server::SubCompositorInterface *m_subcompositor; - KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManager; - KWayland::Server::OutputManagementInterface *m_outputManagement; - KWayland::Server::ServerSideDecorationManagerInterface *m_serverSideDecorationManager; - KWayland::Server::TextInputManagerInterface *m_textInputManagerV0; - KWayland::Server::TextInputManagerInterface *m_textInputManagerV2; - KWayland::Server::XdgShellInterface *m_xdgShellUnstableV5; - KWayland::Server::RelativePointerManagerInterface *m_relativePointerV1; - KWayland::Server::PointerGesturesInterface *m_pointerGesturesV1; - KWayland::Server::PointerConstraintsInterface *m_pointerConstraintsV1; - KWayland::Server::BlurManagerInterface *m_blur; - KWayland::Server::ContrastManagerInterface *m_contrast; - KWayland::Server::IdleInhibitManagerInterface *m_idleInhibit; - -}; - -static const QString s_socketName = QStringLiteral("kwin-test-wayland-registry-0"); - -TestWaylandRegistry::TestWaylandRegistry(QObject *parent) - : QObject(parent) - , m_display(nullptr) - , m_compositor(nullptr) - , m_output(nullptr) - , m_outputDevice(nullptr) - , m_seat(nullptr) - , m_shell(nullptr) - , m_subcompositor(nullptr) - , m_dataDeviceManager(nullptr) - , m_outputManagement(nullptr) - , m_serverSideDecorationManager(nullptr) - , m_textInputManagerV0(nullptr) - , m_textInputManagerV2(nullptr) - , m_xdgShellUnstableV5(nullptr) - , m_relativePointerV1(nullptr) - , m_pointerGesturesV1(nullptr) - , m_pointerConstraintsV1(nullptr) - , m_blur(nullptr) - , m_contrast(nullptr) - , m_idleInhibit(nullptr) -{ -} - -void TestWaylandRegistry::init() -{ - m_display = new KWayland::Server::Display(); - m_display->setSocketName(s_socketName); - m_display->start(); - m_display->createShm(); - m_compositor = m_display->createCompositor(); - m_compositor->create(); - m_output = m_display->createOutput(); - m_output->create(); - m_seat = m_display->createSeat(); - m_seat->create(); - m_shell = m_display->createShell(); - m_shell->create(); - m_subcompositor = m_display->createSubCompositor(); - m_subcompositor->create(); - m_dataDeviceManager = m_display->createDataDeviceManager(); - m_dataDeviceManager->create(); - m_outputManagement = m_display->createOutputManagement(); - m_outputManagement->create(); - m_outputDevice = m_display->createOutputDevice(); - m_outputDevice->create(); - QVERIFY(m_outputManagement->isValid()); - m_blur = m_display->createBlurManager(this); - m_blur->create(); - m_contrast = m_display->createContrastManager(this); - m_contrast->create(); - m_display->createSlideManager(this)->create(); - m_display->createDpmsManager()->create(); - m_serverSideDecorationManager = m_display->createServerSideDecorationManager(); - m_serverSideDecorationManager->create(); - m_textInputManagerV0->create(); - m_textInputManagerV2 = m_display->createTextInputManager(KWayland::Server::TextInputInterfaceVersion::UnstableV2); - QCOMPARE(m_textInputManagerV2->interfaceVersion(), KWayland::Server::TextInputInterfaceVersion::UnstableV2); - m_textInputManagerV2->create(); - m_xdgShellUnstableV5 = m_display->createXdgShell(KWayland::Server::XdgShellInterfaceVersion::UnstableV5); - m_xdgShellUnstableV5->create(); - QCOMPARE(m_xdgShellUnstableV5->interfaceVersion(), KWayland::Server::XdgShellInterfaceVersion::UnstableV5); - m_relativePointerV1 = m_display->createRelativePointerManager(KWayland::Server::RelativePointerInterfaceVersion::UnstableV1); - m_relativePointerV1->create(); - QCOMPARE(m_relativePointerV1->interfaceVersion(), KWayland::Server::RelativePointerInterfaceVersion::UnstableV1); - m_pointerGesturesV1 = m_display->createPointerGestures(KWayland::Server::PointerGesturesInterfaceVersion::UnstableV1); - m_pointerGesturesV1->create(); - QCOMPARE(m_pointerGesturesV1->interfaceVersion(), KWayland::Server::PointerGesturesInterfaceVersion::UnstableV1); - m_pointerConstraintsV1 = m_display->createPointerConstraints(KWayland::Server::PointerConstraintsInterfaceVersion::UnstableV1); - m_pointerConstraintsV1->create(); - QCOMPARE(m_pointerConstraintsV1->interfaceVersion(), KWayland::Server::PointerConstraintsInterfaceVersion::UnstableV1); - m_idleInhibit = m_display->createIdleInhibitManager(KWayland::Server::IdleInhibitManagerInterfaceVersion::UnstableV1); - m_idleInhibit->create(); - QCOMPARE(m_idleInhibit->interfaceVersion(), KWayland::Server::IdleInhibitManagerInterfaceVersion::UnstableV1); -} - -void TestWaylandRegistry::cleanup() -{ - delete m_display; - m_display = nullptr; -} - -void TestWaylandRegistry::testCreate() -{ - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - - KWayland::Client::Registry registry; - QVERIFY(!registry.isValid()); - registry.create(connection.display()); - QVERIFY(registry.isValid()); - registry.release(); - QVERIFY(!registry.isValid()); -} - -#define TEST_BIND(iface, signalName, bindMethod, destroyFunction) \ - KWayland::Client::ConnectionThread connection; \ - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); \ - connection.setSocketName(s_socketName); \ - connection.initConnection(); \ - QVERIFY(connectedSpy.wait()); \ - \ - KWayland::Client::Registry registry; \ - /* before registry is created, we cannot bind the interface*/ \ - QVERIFY(!registry.bindMethod(0, 0)); \ - \ - QVERIFY(!registry.isValid()); \ - registry.create(&connection); \ - QVERIFY(registry.isValid()); \ - /* created but not yet connected still results in no bind */ \ - QVERIFY(!registry.bindMethod(0, 0)); \ - /* interface information should be empty */ \ - QVERIFY(registry.interfaces(iface).isEmpty()); \ - QCOMPARE(registry.interface(iface).name, 0u); \ - QCOMPARE(registry.interface(iface).version, 0u); \ - \ - /* now let's register */ \ - QSignalSpy announced(®istry, signalName); \ - QVERIFY(announced.isValid()); \ - registry.setup(); \ - wl_display_flush(connection.display()); \ - QVERIFY(announced.wait()); \ - const quint32 name = announced.first().first().value(); \ - const quint32 version = announced.first().last().value(); \ - QCOMPARE(registry.interfaces(iface).count(), 1); \ - QCOMPARE(registry.interfaces(iface).first().name, name); \ - QCOMPARE(registry.interfaces(iface).first().version, version); \ - QCOMPARE(registry.interface(iface).name, name); \ - QCOMPARE(registry.interface(iface).version, version); \ - \ - /* registry should know about the interface now */ \ - QVERIFY(registry.hasInterface(iface)); \ - QVERIFY(!registry.bindMethod(name+1, version)); \ - QVERIFY(registry.bindMethod(name, version+1)); \ - auto *c = registry.bindMethod(name, version); \ - QVERIFY(c); \ - destroyFunction(c); \ - -void TestWaylandRegistry::testBindCompositor() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Compositor, SIGNAL(compositorAnnounced(quint32,quint32)), bindCompositor, wl_compositor_destroy) -} - -void TestWaylandRegistry::testBindShell() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Shell, SIGNAL(shellAnnounced(quint32,quint32)), bindShell, free) -} - -void TestWaylandRegistry::testBindOutput() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Output, SIGNAL(outputAnnounced(quint32,quint32)), bindOutput, wl_output_destroy) -} - -void TestWaylandRegistry::testBindSeat() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Seat, SIGNAL(seatAnnounced(quint32,quint32)), bindSeat, wl_seat_destroy) -} - -void TestWaylandRegistry::testBindShm() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Shm, SIGNAL(shmAnnounced(quint32,quint32)), bindShm, wl_shm_destroy) -} - -void TestWaylandRegistry::testBindSubCompositor() -{ - TEST_BIND(KWayland::Client::Registry::Interface::SubCompositor, SIGNAL(subCompositorAnnounced(quint32,quint32)), bindSubCompositor, wl_subcompositor_destroy) -} - -void TestWaylandRegistry::testBindDataDeviceManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::DataDeviceManager, SIGNAL(dataDeviceManagerAnnounced(quint32,quint32)), bindDataDeviceManager, wl_data_device_manager_destroy) -} - -void TestWaylandRegistry::testBindBlurManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Blur, SIGNAL(blurAnnounced(quint32,quint32)), bindBlurManager, free) -} - -void TestWaylandRegistry::testBindContrastManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Contrast, SIGNAL(contrastAnnounced(quint32,quint32)), bindContrastManager, free) -} - -void TestWaylandRegistry::testBindSlideManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Slide, SIGNAL(slideAnnounced(quint32,quint32)), bindSlideManager, free) -} - -void TestWaylandRegistry::testBindDpmsManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::Dpms, SIGNAL(dpmsAnnounced(quint32,quint32)), bindDpmsManager, org_kde_kwin_dpms_manager_destroy) -} - -void TestWaylandRegistry::testBindServerSideDecorationManager() -{ - TEST_BIND(KWayland::Client::Registry::Interface::ServerSideDecorationManager, SIGNAL(serverSideDecorationManagerAnnounced(quint32,quint32)), bindServerSideDecorationManager, org_kde_kwin_server_decoration_manager_destroy) -} - -void TestWaylandRegistry::testBindTextInputManagerUnstableV2() -{ - TEST_BIND(KWayland::Client::Registry::Interface::TextInputManagerUnstableV2, SIGNAL(textInputManagerUnstableV2Announced(quint32,quint32)), bindTextInputManagerUnstableV2, zwp_text_input_manager_v2_destroy) -} - -void TestWaylandRegistry::testBindXdgShellUnstableV5() -{ - TEST_BIND(KWayland::Client::Registry::Interface::XdgShellUnstableV5, SIGNAL(xdgShellUnstableV5Announced(quint32,quint32)), bindXdgShellUnstableV5, zxdg_shell_v5_destroy) -} - -void TestWaylandRegistry::testBindRelativePointerManagerUnstableV1() -{ - TEST_BIND(KWayland::Client::Registry::Interface::RelativePointerManagerUnstableV1, SIGNAL(relativePointerManagerUnstableV1Announced(quint32,quint32)), bindRelativePointerManagerUnstableV1, zwp_relative_pointer_manager_v1_destroy) -} - -void TestWaylandRegistry::testBindPointerGesturesUnstableV1() -{ - TEST_BIND(KWayland::Client::Registry::Interface::PointerGesturesUnstableV1, SIGNAL(pointerGesturesUnstableV1Announced(quint32,quint32)), bindPointerGesturesUnstableV1, zwp_pointer_gestures_v1_destroy) -} - -void TestWaylandRegistry::testBindPointerConstraintsUnstableV1() -{ - TEST_BIND(KWayland::Client::Registry::Interface::PointerConstraintsUnstableV1, SIGNAL(pointerConstraintsUnstableV1Announced(quint32,quint32)), bindPointerConstraintsUnstableV1, zwp_pointer_constraints_v1_destroy) -} - -void TestWaylandRegistry::testBindIdleIhibitManagerUnstableV1() -{ - TEST_BIND(KWayland::Client::Registry::Interface::IdleInhibitManagerUnstableV1, SIGNAL(idleInhibitManagerUnstableV1Announced(quint32,quint32)), bindIdleInhibitManagerUnstableV1, zwp_idle_inhibit_manager_v1_destroy) -} - -#undef TEST_BIND - -void TestWaylandRegistry::testRemoval() -{ - using namespace KWayland::Client; - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, &connection, - [&connection] { - wl_display_flush(connection.display()); - } - ); - - KWayland::Client::Registry registry; - QSignalSpy shmAnnouncedSpy(®istry, SIGNAL(shmAnnounced(quint32,quint32))); - QVERIFY(shmAnnouncedSpy.isValid()); - QSignalSpy compositorAnnouncedSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QVERIFY(compositorAnnouncedSpy.isValid()); - QSignalSpy outputAnnouncedSpy(®istry, SIGNAL(outputAnnounced(quint32,quint32))); - QVERIFY(outputAnnouncedSpy.isValid()); - QSignalSpy outputDeviceAnnouncedSpy(®istry, SIGNAL(outputDeviceAnnounced(quint32,quint32))); - QVERIFY(outputDeviceAnnouncedSpy.isValid()); - QSignalSpy shellAnnouncedSpy(®istry, SIGNAL(shellAnnounced(quint32,quint32))); - QVERIFY(shellAnnouncedSpy.isValid()); - QSignalSpy seatAnnouncedSpy(®istry, SIGNAL(seatAnnounced(quint32,quint32))); - QVERIFY(seatAnnouncedSpy.isValid()); - QSignalSpy subCompositorAnnouncedSpy(®istry, SIGNAL(subCompositorAnnounced(quint32,quint32))); - QVERIFY(subCompositorAnnouncedSpy.isValid()); - QSignalSpy outputManagementAnnouncedSpy(®istry, SIGNAL(outputManagementAnnounced(quint32,quint32))); - QVERIFY(outputManagementAnnouncedSpy.isValid()); - QSignalSpy serverSideDecorationManagerAnnouncedSpy(®istry, &Registry::serverSideDecorationManagerAnnounced); - QVERIFY(serverSideDecorationManagerAnnouncedSpy.isValid()); - QSignalSpy blurAnnouncedSpy(®istry, &Registry::blurAnnounced); - QVERIFY(blurAnnouncedSpy.isValid()); - QSignalSpy idleInhibitManagerUnstableV1AnnouncedSpy(®istry, &Registry::idleInhibitManagerUnstableV1Announced); - QVERIFY(idleInhibitManagerUnstableV1AnnouncedSpy.isValid()); - - QVERIFY(!registry.isValid()); - registry.create(connection.display()); - registry.setup(); - - QVERIFY(shmAnnouncedSpy.wait()); - QVERIFY(!compositorAnnouncedSpy.isEmpty()); - QVERIFY(!outputAnnouncedSpy.isEmpty()); - QVERIFY(!outputDeviceAnnouncedSpy.isEmpty()); - QVERIFY(!shellAnnouncedSpy.isEmpty()); - QVERIFY(!seatAnnouncedSpy.isEmpty()); - QVERIFY(!subCompositorAnnouncedSpy.isEmpty()); - QVERIFY(!outputManagementAnnouncedSpy.isEmpty()); - QVERIFY(!serverSideDecorationManagerAnnouncedSpy.isEmpty()); - QVERIFY(!blurAnnouncedSpy.isEmpty()); - QVERIFY(!idleInhibitManagerUnstableV1AnnouncedSpy.isEmpty()); - - - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Compositor)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Output)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::OutputDevice)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Seat)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Shell)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Shm)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::SubCompositor)); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::FullscreenShell)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::OutputManagement)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::ServerSideDecorationManager)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::Blur)); - QVERIFY(registry.hasInterface(KWayland::Client::Registry::Interface::IdleInhibitManagerUnstableV1)); - - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Compositor).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Output).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::OutputDevice).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Seat).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Shell).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Shm).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::SubCompositor).isEmpty()); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::FullscreenShell).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::OutputManagement).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::ServerSideDecorationManager).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::Blur).isEmpty()); - QVERIFY(!registry.interfaces(KWayland::Client::Registry::Interface::IdleInhibitManagerUnstableV1).isEmpty()); - - QSignalSpy seatRemovedSpy(®istry, SIGNAL(seatRemoved(quint32))); - QVERIFY(seatRemovedSpy.isValid()); - - Seat *seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, registry.interface(Registry::Interface::Seat).version, ®istry); - Shell *shell = registry.createShell(registry.interface(Registry::Interface::Shell).name, registry.interface(Registry::Interface::Shell).version, ®istry); - Output *output = registry.createOutput(registry.interface(Registry::Interface::Output).name, registry.interface(Registry::Interface::Output).version, ®istry); - Compositor *compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, ®istry); - SubCompositor *subcompositor = registry.createSubCompositor(registry.interface(Registry::Interface::SubCompositor).name, registry.interface(Registry::Interface::SubCompositor).version, ®istry); - ServerSideDecorationManager *serverSideDeco = registry.createServerSideDecorationManager(registry.interface(Registry::Interface::ServerSideDecorationManager).name, registry.interface(Registry::Interface::ServerSideDecorationManager).version, ®istry); - BlurManager *blurManager = registry.createBlurManager(registry.interface(Registry::Interface::Blur).name, registry.interface(Registry::Interface::Blur).version, ®istry); - auto idleInhibitManager = registry.createIdleInhibitManager(registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).name, registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).version, ®istry); - - connection.flush(); - m_display->dispatchEvents(); - QSignalSpy seatObjectRemovedSpy(seat, &Seat::removed); - QVERIFY(seatObjectRemovedSpy.isValid()); - QSignalSpy shellObjectRemovedSpy(shell, &Shell::removed); - QVERIFY(shellObjectRemovedSpy.isValid()); - QSignalSpy outputObjectRemovedSpy(output, &Output::removed); - QVERIFY(outputObjectRemovedSpy.isValid()); - QSignalSpy compositorObjectRemovedSpy(compositor, &Compositor::removed); - QVERIFY(compositorObjectRemovedSpy.isValid()); - QSignalSpy subcompositorObjectRemovedSpy(subcompositor, &SubCompositor::removed); - QVERIFY(subcompositorObjectRemovedSpy.isValid()); - QSignalSpy idleInhibitManagerObjectRemovedSpy(idleInhibitManager, &IdleInhibitManager::removed); - QVERIFY(idleInhibitManagerObjectRemovedSpy.isValid()); - - delete m_seat; - QVERIFY(seatRemovedSpy.wait()); - QCOMPARE(seatRemovedSpy.first().first(), seatAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::Seat)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::Seat).isEmpty()); - QCOMPARE(seatObjectRemovedSpy.count(), 1); - - QSignalSpy shellRemovedSpy(®istry, SIGNAL(shellRemoved(quint32))); - QVERIFY(shellRemovedSpy.isValid()); - - delete m_shell; - QVERIFY(shellRemovedSpy.wait()); - QCOMPARE(shellRemovedSpy.first().first(), shellAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::Shell)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::Shell).isEmpty()); - QCOMPARE(shellObjectRemovedSpy.count(), 1); - - QSignalSpy outputRemovedSpy(®istry, SIGNAL(outputRemoved(quint32))); - QVERIFY(outputRemovedSpy.isValid()); - - delete m_output; - QVERIFY(outputRemovedSpy.wait()); - QCOMPARE(outputRemovedSpy.first().first(), outputAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::Output)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::Output).isEmpty()); - QCOMPARE(outputObjectRemovedSpy.count(), 1); - - QSignalSpy outputDeviceRemovedSpy(®istry, SIGNAL(outputDeviceRemoved(quint32))); - QVERIFY(outputDeviceRemovedSpy.isValid()); - - delete m_outputDevice; - QVERIFY(outputDeviceRemovedSpy.wait()); - QCOMPARE(outputDeviceRemovedSpy.first().first(), outputDeviceAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::OutputDevice)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::OutputDevice).isEmpty()); - - QSignalSpy compositorRemovedSpy(®istry, SIGNAL(compositorRemoved(quint32))); - QVERIFY(compositorRemovedSpy.isValid()); - - delete m_compositor; - QVERIFY(compositorRemovedSpy.wait()); - QCOMPARE(compositorRemovedSpy.first().first(), compositorAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::Compositor)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::Compositor).isEmpty()); - QCOMPARE(compositorObjectRemovedSpy.count(), 1); - - QSignalSpy subCompositorRemovedSpy(®istry, SIGNAL(subCompositorRemoved(quint32))); - QVERIFY(subCompositorRemovedSpy.isValid()); - - delete m_subcompositor; - QVERIFY(subCompositorRemovedSpy.wait()); - QCOMPARE(subCompositorRemovedSpy.first().first(), subCompositorAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::SubCompositor)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::SubCompositor).isEmpty()); - QCOMPARE(subcompositorObjectRemovedSpy.count(), 1); - - QSignalSpy outputManagementRemovedSpy(®istry, SIGNAL(outputManagementRemoved(quint32))); - QVERIFY(outputManagementRemovedSpy.isValid()); - - delete m_outputManagement; - QVERIFY(outputManagementRemovedSpy.wait()); - QCOMPARE(outputManagementRemovedSpy.first().first(), outputManagementAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::OutputManagement)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::OutputManagement).isEmpty()); - - QSignalSpy serverSideDecoManagerRemovedSpy(®istry, &Registry::serverSideDecorationManagerRemoved); - QVERIFY(serverSideDecoManagerRemovedSpy.isValid()); - QSignalSpy serverSideDecoManagerObjectRemovedSpy(serverSideDeco, &ServerSideDecorationManager::removed); - QVERIFY(serverSideDecoManagerObjectRemovedSpy.isValid()); - - delete m_serverSideDecorationManager; - QVERIFY(serverSideDecoManagerRemovedSpy.wait()); - QCOMPARE(serverSideDecoManagerRemovedSpy.first().first(), serverSideDecorationManagerAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::ServerSideDecorationManager)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::ServerSideDecorationManager).isEmpty()); - QCOMPARE(serverSideDecoManagerObjectRemovedSpy.count(), 1); - - QSignalSpy blurRemovedSpy(®istry, &Registry::blurRemoved); - QVERIFY(blurRemovedSpy.isValid()); - QSignalSpy blurObjectRemovedSpy(blurManager, &BlurManager::removed); - QVERIFY(blurObjectRemovedSpy.isValid()); - - delete m_blur; - QVERIFY(blurRemovedSpy.wait()); - QCOMPARE(blurRemovedSpy.first().first(), blurRemovedSpy.first().first()); - QVERIFY(!registry.hasInterface(KWayland::Client::Registry::Interface::Blur)); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::Blur).isEmpty()); - QCOMPARE(blurObjectRemovedSpy.count(), 1); - - QSignalSpy idleInhibitManagerUnstableV1RemovedSpy(®istry, &Registry::idleInhibitManagerUnstableV1Removed); - QVERIFY(idleInhibitManagerUnstableV1RemovedSpy.isValid()); - delete m_idleInhibit; - QVERIFY(idleInhibitManagerUnstableV1RemovedSpy.wait()); - QCOMPARE(idleInhibitManagerUnstableV1RemovedSpy.first().first(), idleInhibitManagerUnstableV1AnnouncedSpy.first().first()); - QVERIFY(registry.interfaces(KWayland::Client::Registry::Interface::IdleInhibitManagerUnstableV1).isEmpty()); - QCOMPARE(idleInhibitManagerObjectRemovedSpy.count(), 1); - - // cannot test shmRemoved as there is no functionality for it - - // verify everything has been removed only once - QCOMPARE(seatObjectRemovedSpy.count(), 1); - QCOMPARE(shellObjectRemovedSpy.count(), 1); - QCOMPARE(outputObjectRemovedSpy.count(), 1); - QCOMPARE(compositorObjectRemovedSpy.count(), 1); - QCOMPARE(subcompositorObjectRemovedSpy.count(), 1); - QCOMPARE(serverSideDecoManagerObjectRemovedSpy.count(), 1); - QCOMPARE(blurObjectRemovedSpy.count(), 1); - QCOMPARE(idleInhibitManagerObjectRemovedSpy.count(), 1); -} - -void TestWaylandRegistry::testOutOfSyncRemoval() -{ - //This tests the following sequence of events - //server announces global - //client binds to that global - - //server removes the global - //(simultaneously) the client legimitely uses the bound resource to the global - //client then gets the server events...it should no-op, not be a protocol error - - using namespace KWayland::Client; - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, &connection, - [&connection] { - wl_display_flush(connection.display()); - } - ); - - KWayland::Client::Registry registry; - QVERIFY(!registry.isValid()); - registry.create(connection.display()); - registry.setup(); - QSignalSpy blurAnnouncedSpy(®istry, &Registry::blurAnnounced); - QSignalSpy contrastAnnouncedSpy(®istry, &Registry::blurAnnounced); - - blurAnnouncedSpy.wait(); - contrastAnnouncedSpy.wait(); - BlurManager *blurManager = registry.createBlurManager(registry.interface(Registry::Interface::Blur).name, registry.interface(Registry::Interface::Blur).version, ®istry); - ContrastManager *contrastManager = registry.createContrastManager(registry.interface(Registry::Interface::Contrast).name, registry.interface(Registry::Interface::Contrast).version, ®istry); - - connection.flush(); - m_display->dispatchEvents(); - - QScopedPointer compositor(registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, - registry.interface(Registry::Interface::Compositor).version)); - QScopedPointer surface(compositor->createSurface()); - QVERIFY(surface); - - //remove blur - QSignalSpy blurRemovedSpy(®istry, &Registry::blurRemoved); - - delete m_blur; - - //client hasn't processed the event yet - QVERIFY(blurRemovedSpy.count() == 0); - - //use the in the client - blurManager->createBlur(surface.data(), nullptr); - - //now process events, - QVERIFY(blurRemovedSpy.wait()); - QVERIFY(blurRemovedSpy.count() == 1); - - //remove background contrast - QSignalSpy contrastRemovedSpy(®istry, &Registry::contrastRemoved); - - delete m_contrast; - - //client hasn't processed the event yet - QVERIFY(contrastRemovedSpy.count() == 0); - - //use the in the client - contrastManager->createContrast(surface.data(), nullptr); - - //now process events, - QVERIFY(contrastRemovedSpy.wait()); - QVERIFY(contrastRemovedSpy.count() == 1); - -} - -void TestWaylandRegistry::testDestroy() -{ - using namespace KWayland::Client; - KWayland::Client::ConnectionThread connection; - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.setSocketName(s_socketName); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - - Registry registry; - QSignalSpy shellAnnouncedSpy(®istry, SIGNAL(shellAnnounced(quint32,quint32))); - - QVERIFY(!registry.isValid()); - registry.create(&connection); - registry.setup(); - QVERIFY(registry.isValid()); - - //create some arbitrary Interface - shellAnnouncedSpy.wait(); - QScopedPointer shell(registry.createShell(registry.interface(Registry::Interface::Shell).name, registry.interface(Registry::Interface::Shell).version, ®istry)); - - - QSignalSpy connectionDiedSpy(&connection, SIGNAL(connectionDied())); - QSignalSpy registryDiedSpy(®istry, SIGNAL(registryDestroyed())); - - QVERIFY(connectionDiedSpy.isValid()); - QVERIFY(registryDiedSpy.isValid()); - - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - QVERIFY(connectionDiedSpy.count() == 1); - QVERIFY(registryDiedSpy.count() == 1); - - // now the registry should be destroyed; - QVERIFY(!registry.isValid()); - - // calling destroy again should not fail - registry.destroy(); - shell->destroy(); -} - -void TestWaylandRegistry::testGlobalSync() -{ - using namespace KWayland::Client; - ConnectionThread connection; - connection.setSocketName(s_socketName); - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - - Registry registry; - QSignalSpy syncSpy(®istry, SIGNAL(interfacesAnnounced())); - // Most simple case: don't even use the ConnectionThread, - // just its display. - registry.create(connection.display()); - registry.setup(); - QVERIFY(syncSpy.wait()); - QCOMPARE(syncSpy.count(), 1); - registry.destroy(); -} - -void TestWaylandRegistry::testGlobalSyncThreaded() -{ - // More complex case, use a ConnectionThread, in a different Thread, - // and our own EventQueue - using namespace KWayland::Client; - ConnectionThread connection; - connection.setSocketName(s_socketName); - QThread thread; - connection.moveToThread(&thread); - thread.start(); - - QSignalSpy connectedSpy(&connection, SIGNAL(connected())); - connection.initConnection(); - - QVERIFY(connectedSpy.wait()); - EventQueue queue; - queue.setup(&connection); - - Registry registry; - QSignalSpy syncSpy(®istry, SIGNAL(interfacesAnnounced())); - registry.setEventQueue(&queue); - registry.create(&connection); - registry.setup(); - - QVERIFY(syncSpy.wait()); - QCOMPARE(syncSpy.count(), 1); - registry.destroy(); - - thread.quit(); - thread.wait(); -} - -void TestWaylandRegistry::testAnnounceMultiple() -{ - using namespace KWayland::Client; - ConnectionThread connection; - connection.setSocketName(s_socketName); - QSignalSpy connectedSpy(&connection, &ConnectionThread::connected); - QVERIFY(connectedSpy.isValid()); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, &connection, - [&connection] { - wl_display_flush(connection.display()); - } - ); - - Registry registry; - QSignalSpy syncSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(syncSpy.isValid()); - // Most simple case: don't even use the ConnectionThread, - // just its display. - registry.create(connection.display()); - registry.setup(); - QVERIFY(syncSpy.wait()); - QCOMPARE(syncSpy.count(), 1); - - // we should have one output now - QCOMPARE(registry.interfaces(Registry::Interface::Output).count(), 1); - - QSignalSpy outputAnnouncedSpy(®istry, &Registry::outputAnnounced); - QVERIFY(outputAnnouncedSpy.isValid()); - m_display->createOutput()->create(); - QVERIFY(outputAnnouncedSpy.wait()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().name, outputAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().version, outputAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).name, outputAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).version, outputAnnouncedSpy.first().last().value()); - - auto output = m_display->createOutput(); - output->create(); - QVERIFY(outputAnnouncedSpy.wait()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).count(), 3); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().name, outputAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().version, outputAnnouncedSpy.last().last().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).name, outputAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).version, outputAnnouncedSpy.last().last().value()); - - QSignalSpy outputRemovedSpy(®istry, &Registry::outputRemoved); - QVERIFY(outputRemovedSpy.isValid()); - delete output; - QVERIFY(outputRemovedSpy.wait()); - QCOMPARE(outputRemovedSpy.first().first().value(), outputAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().name, outputAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::Output).last().version, outputAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).name, outputAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::Output).version, outputAnnouncedSpy.first().last().value()); -} - -void TestWaylandRegistry::testAnnounceMultipleOutputDevices() -{ - using namespace KWayland::Client; - ConnectionThread connection; - connection.setSocketName(s_socketName); - QSignalSpy connectedSpy(&connection, &ConnectionThread::connected); - QVERIFY(connectedSpy.isValid()); - connection.initConnection(); - QVERIFY(connectedSpy.wait()); - connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, &connection, - [&connection] { - wl_display_flush(connection.display()); - } - ); - - Registry registry; - QSignalSpy syncSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(syncSpy.isValid()); - // Most simple case: don't even use the ConnectionThread, - // just its display. - registry.create(connection.display()); - registry.setup(); - QVERIFY(syncSpy.wait()); - QCOMPARE(syncSpy.count(), 1); - - // we should have one output now - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).count(), 1); - - QSignalSpy outputDeviceAnnouncedSpy(®istry, &Registry::outputDeviceAnnounced); - QVERIFY(outputDeviceAnnouncedSpy.isValid()); - m_display->createOutputDevice()->create(); - QVERIFY(outputDeviceAnnouncedSpy.wait()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().name, outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().version, outputDeviceAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).name, outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).version, outputDeviceAnnouncedSpy.first().last().value()); - - auto outputDevice = m_display->createOutputDevice(); - outputDevice->create(); - QVERIFY(outputDeviceAnnouncedSpy.wait()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).count(), 3); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().name, outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().version, outputDeviceAnnouncedSpy.last().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).name, outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).version, outputDeviceAnnouncedSpy.last().last().value()); - - QSignalSpy outputDeviceRemovedSpy(®istry, &Registry::outputDeviceRemoved); - QVERIFY(outputDeviceRemovedSpy.isValid()); - delete outputDevice; - QVERIFY(outputDeviceRemovedSpy.wait()); - QCOMPARE(outputDeviceRemovedSpy.first().first().value(), outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().name, outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDevice).last().version, outputDeviceAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).name, outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDevice).version, outputDeviceAnnouncedSpy.first().last().value()); -} - -QTEST_GUILESS_MAIN(TestWaylandRegistry) -#include "test_wayland_registry.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_seat.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_seat.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_seat.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_seat.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,25 +1,23 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/datadevicemanager_interface.h" +#include "../../src/server/datasource_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/keyboard_interface.h" +#include "../../src/server/pointer_interface.h" +#include "../../src/server/pointergestures_v1_interface.h" +#include "../../src/server/relativepointer_v1_interface.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/shmclientbuffer.h" +#include "../../src/server/subcompositor_interface.h" +#include "../../src/server/surface_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/datadevice.h" @@ -29,28 +27,16 @@ #include "../../src/client/keyboard.h" #include "../../src/client/pointer.h" #include "../../src/client/pointergestures.h" -#include "../../src/client/surface.h" #include "../../src/client/registry.h" #include "../../src/client/relativepointer.h" #include "../../src/client/seat.h" #include "../../src/client/shm_pool.h" #include "../../src/client/subcompositor.h" #include "../../src/client/subsurface.h" +#include "../../src/client/surface.h" #include "../../src/client/touch.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/datadevicemanager_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/keyboard_interface.h" -#include "../../src/server/pointer_interface.h" -#include "../../src/server/pointergestures_interface.h" -#include "../../src/server/relativepointer_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/subcompositor_interface.h" -#include "../../src/server/surface_interface.h" -#include "../../src/server/abstract_data_source.h" - // Wayland +#include "qwayland-pointer-gestures-unstable-v1.h" #include #include @@ -80,32 +66,29 @@ void testPointerSwipeGesture(); void testPointerPinchGesture_data(); void testPointerPinchGesture(); - void testKeyboardSubSurfaceTreeFromPointer(); + void testPointerHoldGesture_data(); + void testPointerHoldGesture(); + void testPointerAxis(); void testCursor(); void testCursorDamage(); void testKeyboard(); - void testCast(); - void testDestroy(); void testSelection(); - void testSelectionNoDataSource(); void testDataDeviceForKeyboardSurface(); void testTouch(); - void testDisconnect(); - void testPointerEnterOnUnboundSurface(); - // TODO: add test for keymap + void testKeymap(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::SeatInterface *m_seatInterface; - KWayland::Server::SubCompositorInterface *m_subCompositorInterface; - KWayland::Server::RelativePointerManagerInterface *m_relativePointerManagerInterface; - KWayland::Server::PointerGesturesInterface *m_pointerGesturesInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::SeatInterface *m_seatInterface; + KWaylandServer::SubCompositorInterface *m_subCompositorInterface; + KWaylandServer::RelativePointerManagerV1Interface *m_relativePointerManagerV1Interface; + KWaylandServer::PointerGesturesV1Interface *m_pointerGesturesV1Interface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::Seat *m_seat; KWayland::Client::ShmPool *m_shm; - KWayland::Client::SubCompositor * m_subCompositor; + KWayland::Client::SubCompositor *m_subCompositor; KWayland::Client::RelativePointerManager *m_relativePointerManager; KWayland::Client::PointerGestures *m_pointerGestures; KWayland::Client::EventQueue *m_queue; @@ -120,8 +103,8 @@ , m_compositorInterface(nullptr) , m_seatInterface(nullptr) , m_subCompositorInterface(nullptr) - , m_relativePointerManagerInterface(nullptr) - , m_pointerGesturesInterface(nullptr) + , m_relativePointerManagerV1Interface(nullptr) + , m_pointerGesturesV1Interface(nullptr) , m_connection(nullptr) , m_compositor(nullptr) , m_seat(nullptr) @@ -136,37 +119,24 @@ void TestWaylandSeat::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_compositorInterface = m_display->createCompositor(m_display); - QVERIFY(m_compositorInterface); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - m_subCompositorInterface = m_display->createSubCompositor(m_display); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_subCompositorInterface = new SubCompositorInterface(m_display, m_display); QVERIFY(m_subCompositorInterface); - m_subCompositorInterface->create(); - QVERIFY(m_subCompositorInterface->isValid()); - m_relativePointerManagerInterface = m_display->createRelativePointerManager(RelativePointerInterfaceVersion::UnstableV1, m_display); - QVERIFY(m_relativePointerManagerInterface); - m_relativePointerManagerInterface->create(); - QVERIFY(m_relativePointerManagerInterface->isValid()); - - m_pointerGesturesInterface = m_display->createPointerGestures(PointerGesturesInterfaceVersion::UnstableV1, m_display); - QVERIFY(m_pointerGesturesInterface); - m_pointerGesturesInterface->create(); - QVERIFY(m_pointerGesturesInterface->isValid()); + m_relativePointerManagerV1Interface = new RelativePointerManagerV1Interface(m_display, m_display); + m_pointerGesturesV1Interface = new PointerGesturesV1Interface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -180,20 +150,18 @@ m_queue->setup(m_connection); KWayland::Client::Registry registry; - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QSignalSpy seatSpy(®istry, SIGNAL(seatAnnounced(quint32,quint32))); - QSignalSpy shmSpy(®istry, SIGNAL(shmAnnounced(quint32,quint32))); + QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced); + QSignalSpy seatSpy(®istry, &KWayland::Client::Registry::seatAnnounced); + QSignalSpy shmSpy(®istry, &KWayland::Client::Registry::shmAnnounced); registry.setEventQueue(m_queue); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); QVERIFY(compositorSpy.wait()); - m_seatInterface = m_display->createSeat(); + m_seatInterface = new SeatInterface(m_display); QVERIFY(m_seatInterface); m_seatInterface->setName(QStringLiteral("seat0")); - m_seatInterface->create(); - QVERIFY(m_seatInterface->isValid()); QVERIFY(seatSpy.wait()); m_compositor = new KWayland::Client::Compositor(this); @@ -201,7 +169,7 @@ QVERIFY(m_compositor->isValid()); m_seat = registry.createSeat(seatSpy.first().first().value(), seatSpy.first().last().value(), this); - QSignalSpy nameSpy(m_seat, SIGNAL(nameChanged(QString))); + QSignalSpy nameSpy(m_seat, &KWayland::Client::Seat::nameChanged); QVERIFY(nameSpy.wait()); m_shm = new KWayland::Client::ShmPool(this); @@ -213,9 +181,10 @@ this); QVERIFY(m_subCompositor->isValid()); - m_relativePointerManager = registry.createRelativePointerManager(registry.interface(KWayland::Client::Registry::Interface::RelativePointerManagerUnstableV1).name, - registry.interface(KWayland::Client::Registry::Interface::RelativePointerManagerUnstableV1).version, - this); + m_relativePointerManager = + registry.createRelativePointerManager(registry.interface(KWayland::Client::Registry::Interface::RelativePointerManagerUnstableV1).name, + registry.interface(KWayland::Client::Registry::Interface::RelativePointerManagerUnstableV1).version, + this); QVERIFY(m_relativePointerManager->isValid()); m_pointerGestures = registry.createPointerGestures(registry.interface(KWayland::Client::Registry::Interface::PointerGesturesUnstableV1).name, @@ -265,23 +234,15 @@ m_thread = nullptr; } - delete m_compositorInterface; - m_compositorInterface = nullptr; + delete m_display; + m_display = nullptr; - delete m_seatInterface; + // these are the children of the display + m_compositorInterface = nullptr; m_seatInterface = nullptr; - - delete m_subCompositorInterface; m_subCompositorInterface = nullptr; - - delete m_relativePointerManagerInterface; - m_relativePointerManagerInterface = nullptr; - - delete m_pointerGesturesInterface; - m_pointerGesturesInterface = nullptr; - - delete m_display; - m_display = nullptr; + m_relativePointerManagerV1Interface = nullptr; + m_pointerGesturesV1Interface = nullptr; } void TestWaylandSeat::testName() @@ -289,7 +250,7 @@ // no name set yet QCOMPARE(m_seat->name(), QStringLiteral("seat0")); - QSignalSpy spy(m_seat, SIGNAL(nameChanged(QString))); + QSignalSpy spy(m_seat, &KWayland::Client::Seat::nameChanged); QVERIFY(spy.isValid()); const QString name = QStringLiteral("foobar"); @@ -306,14 +267,14 @@ QTest::addColumn("keyboard"); QTest::addColumn("touch"); - QTest::newRow("none") << false << false << false; - QTest::newRow("pointer") << true << false << false; - QTest::newRow("keyboard") << false << true << false; - QTest::newRow("touch") << false << false << true; - QTest::newRow("pointer/keyboard") << true << true << false; - QTest::newRow("pointer/touch") << true << false << true; - QTest::newRow("keyboard/touch") << false << true << true; - QTest::newRow("all") << true << true << true; + QTest::newRow("none") << false << false << false; + QTest::newRow("pointer") << true << false << false; + QTest::newRow("keyboard") << false << true << false; + QTest::newRow("touch") << false << false << true; + QTest::newRow("pointer/keyboard") << true << true << false; + QTest::newRow("pointer/touch") << true << false << true; + QTest::newRow("keyboard/touch") << false << true << true; + QTest::newRow("all") << true << true << true; } void TestWaylandSeat::testCapabilities() @@ -326,11 +287,11 @@ QFETCH(bool, keyboard); QFETCH(bool, touch); - QSignalSpy pointerSpy(m_seat, SIGNAL(hasPointerChanged(bool))); + QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); - QSignalSpy keyboardSpy(m_seat, SIGNAL(hasKeyboardChanged(bool))); + QSignalSpy keyboardSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); QVERIFY(keyboardSpy.isValid()); - QSignalSpy touchSpy(m_seat, SIGNAL(hasTouchChanged(bool))); + QSignalSpy touchSpy(m_seat, &KWayland::Client::Seat::hasTouchChanged); QVERIFY(touchSpy.isValid()); m_seatInterface->setHasPointer(pointer); @@ -368,30 +329,30 @@ void TestWaylandSeat::testPointer() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy pointerSpy(m_seat, SIGNAL(hasPointerChanged(bool))); + QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); Surface *s = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - QSignalSpy focusedPointerChangedSpy(m_seatInterface, &SeatInterface::focusedPointerChanged); - QVERIFY(focusedPointerChangedSpy.isValid()); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + s->attachBuffer(m_shm->createBuffer(image)); + s->damage(image.rect()); + s->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); - m_seatInterface->setPointerPos(QPoint(20, 18)); + m_seatInterface->notifyPointerMotion(QPoint(20, 18)); m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(10, 15)); - QCOMPARE(focusedPointerChangedSpy.count(), 1); - QVERIFY(!focusedPointerChangedSpy.first().first().value()); - // no pointer yet - QVERIFY(m_seatInterface->focusedPointerSurface()); - QVERIFY(!m_seatInterface->focusedPointer()); Pointer *p = m_seat->createPointer(m_seat); QSignalSpy frameSpy(p, &Pointer::frame); @@ -400,37 +361,27 @@ QVERIFY(p->isValid()); QScopedPointer relativePointer(m_relativePointerManager->createRelativePointer(p)); QVERIFY(relativePointer->isValid()); - QSignalSpy pointerCreatedSpy(m_seatInterface, SIGNAL(pointerCreated(KWayland::Server::PointerInterface*))); - QVERIFY(pointerCreatedSpy.isValid()); - // once the pointer is created it should be set as the focused pointer - QVERIFY(pointerCreatedSpy.wait()); - QVERIFY(m_seatInterface->focusedPointer()); - QCOMPARE(pointerCreatedSpy.first().first().value(), m_seatInterface->focusedPointer()); - QCOMPARE(focusedPointerChangedSpy.count(), 2); - QCOMPARE(focusedPointerChangedSpy.last().first().value(), m_seatInterface->focusedPointer()); QVERIFY(frameSpy.wait()); QCOMPARE(frameSpy.count(), 1); m_seatInterface->setFocusedPointerSurface(nullptr); - QCOMPARE(focusedPointerChangedSpy.count(), 3); - QVERIFY(!focusedPointerChangedSpy.last().first().value()); serverSurface->client()->flush(); QVERIFY(frameSpy.wait()); QCOMPARE(frameSpy.count(), 2); - QSignalSpy enteredSpy(p, SIGNAL(entered(quint32,QPointF))); + QSignalSpy enteredSpy(p, &KWayland::Client::Pointer::entered); QVERIFY(enteredSpy.isValid()); - QSignalSpy leftSpy(p, SIGNAL(left(quint32))); + QSignalSpy leftSpy(p, &KWayland::Client::Pointer::left); QVERIFY(leftSpy.isValid()); - QSignalSpy motionSpy(p, SIGNAL(motion(QPointF,quint32))); + QSignalSpy motionSpy(p, &KWayland::Client::Pointer::motion); QVERIFY(motionSpy.isValid()); - QSignalSpy axisSpy(p, SIGNAL(axisChanged(quint32,KWayland::Client::Pointer::Axis,qreal))); + QSignalSpy axisSpy(p, &KWayland::Client::Pointer::axisChanged); QVERIFY(axisSpy.isValid()); - QSignalSpy buttonSpy(p, SIGNAL(buttonStateChanged(quint32,quint32,quint32,KWayland::Client::Pointer::ButtonState))); + QSignalSpy buttonSpy(p, &KWayland::Client::Pointer::buttonStateChanged); QVERIFY(buttonSpy.isValid()); QSignalSpy relativeMotionSpy(relativePointer.data(), &RelativePointer::relativeMotion); @@ -444,16 +395,13 @@ QCOMPARE(enteredSpy.first().first().value(), m_display->serial()); QCOMPARE(enteredSpy.first().last().toPoint(), QPoint(10, 3)); QCOMPARE(frameSpy.count(), 3); - PointerInterface *serverPointer = m_seatInterface->focusedPointer(); - QVERIFY(serverPointer); QCOMPARE(p->enteredSurface(), s); QCOMPARE(cp.enteredSurface(), s); - QCOMPARE(focusedPointerChangedSpy.count(), 4); - QCOMPARE(focusedPointerChangedSpy.last().first().value(), serverPointer); // test motion m_seatInterface->setTimestamp(1); - m_seatInterface->setPointerPos(QPoint(10, 16)); + m_seatInterface->notifyPointerMotion(QPoint(10, 16)); + m_seatInterface->notifyPointerFrame(); QVERIFY(motionSpy.wait()); QCOMPARE(frameSpy.count(), 4); QCOMPARE(motionSpy.first().first().toPoint(), QPoint(0, 1)); @@ -461,6 +409,7 @@ // test relative motion m_seatInterface->relativePointerMotion(QSizeF(1, 2), QSizeF(3, 4), quint64(-1)); + m_seatInterface->notifyPointerFrame(); QVERIFY(relativeMotionSpy.wait()); QCOMPARE(relativeMotionSpy.count(), 1); QCOMPARE(frameSpy.count(), 5); @@ -470,11 +419,13 @@ // test axis m_seatInterface->setTimestamp(2); - m_seatInterface->pointerAxis(Qt::Horizontal, 10); + m_seatInterface->notifyPointerAxis(Qt::Horizontal, 10, 1, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); QVERIFY(axisSpy.wait()); QCOMPARE(frameSpy.count(), 6); m_seatInterface->setTimestamp(3); - m_seatInterface->pointerAxis(Qt::Vertical, 20); + m_seatInterface->notifyPointerAxis(Qt::Vertical, 20, 2, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); QVERIFY(axisSpy.wait()); QCOMPARE(frameSpy.count(), 7); QCOMPARE(axisSpy.first().at(0).value(), quint32(2)); @@ -487,22 +438,26 @@ // test button m_seatInterface->setTimestamp(4); - m_seatInterface->pointerButtonPressed(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonSpy.wait()); QCOMPARE(frameSpy.count(), 8); QCOMPARE(buttonSpy.at(0).at(0).value(), m_display->serial()); m_seatInterface->setTimestamp(5); - m_seatInterface->pointerButtonPressed(2); + m_seatInterface->notifyPointerButton(2, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonSpy.wait()); QCOMPARE(frameSpy.count(), 9); QCOMPARE(buttonSpy.at(1).at(0).value(), m_display->serial()); m_seatInterface->setTimestamp(6); - m_seatInterface->pointerButtonReleased(2); + m_seatInterface->notifyPointerButton(2, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonSpy.wait()); QCOMPARE(frameSpy.count(), 10); QCOMPARE(buttonSpy.at(2).at(0).value(), m_display->serial()); m_seatInterface->setTimestamp(7); - m_seatInterface->pointerButtonReleased(1); + m_seatInterface->notifyPointerButton(1, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); QVERIFY(buttonSpy.wait()); QCOMPARE(frameSpy.count(), 11); QCOMPARE(buttonSpy.count(), 4); @@ -535,7 +490,6 @@ // leave the surface m_seatInterface->setFocusedPointerSurface(nullptr); - QCOMPARE(focusedPointerChangedSpy.count(), 5); QVERIFY(leftSpy.wait()); QCOMPARE(frameSpy.count(), 12); QCOMPARE(leftSpy.first().first().value(), m_display->serial()); @@ -548,7 +502,6 @@ // enter it again m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(0, 0)); - QCOMPARE(focusedPointerChangedSpy.count(), 6); QVERIFY(enteredSpy.wait()); QCOMPARE(frameSpy.count(), 13); QCOMPARE(p->enteredSurface(), s); @@ -561,62 +514,6 @@ QCOMPARE(relativeMotionSpy.last().at(0).toSizeF(), QSizeF(4, 5)); QCOMPARE(relativeMotionSpy.last().at(1).toSizeF(), QSizeF(6, 7)); QCOMPARE(relativeMotionSpy.last().at(2).value(), quint64(1)); - - // destroy the focused pointer - QSignalSpy unboundSpy(serverPointer, &Resource::unbound); - QVERIFY(unboundSpy.isValid()); - QSignalSpy destroyedSpy(serverPointer, &Resource::destroyed); - QVERIFY(destroyedSpy.isValid()); - delete p; - QVERIFY(unboundSpy.wait()); - QCOMPARE(unboundSpy.count(), 1); - QCOMPARE(destroyedSpy.count(), 0); - // now test that calling into the methods in Seat does not crash - QCOMPARE(m_seatInterface->focusedPointer(), serverPointer); - QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - m_seatInterface->setTimestamp(8); - m_seatInterface->setPointerPos(QPoint(10, 15)); - m_seatInterface->setTimestamp(9); - m_seatInterface->pointerButtonPressed(1); - m_seatInterface->setTimestamp(10); - m_seatInterface->pointerButtonReleased(1); - m_seatInterface->setTimestamp(11); - m_seatInterface->pointerAxis(Qt::Horizontal, 10); - m_seatInterface->setTimestamp(12); - m_seatInterface->pointerAxis(Qt::Vertical, 20); - m_seatInterface->setFocusedPointerSurface(nullptr); - QCOMPARE(focusedPointerChangedSpy.count(), 7); - m_seatInterface->setFocusedPointerSurface(serverSurface); - QCOMPARE(focusedPointerChangedSpy.count(), 8); - QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedPointer()); - - // and now destroy - QVERIFY(destroyedSpy.wait()); - QCOMPARE(unboundSpy.count(), 1); - QCOMPARE(destroyedSpy.count(), 1); - QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedPointer()); - - // create a pointer again - p = m_seat->createPointer(m_seat); - QVERIFY(focusedPointerChangedSpy.wait()); - QCOMPARE(focusedPointerChangedSpy.count(), 9); - QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - serverPointer = m_seatInterface->focusedPointer(); - QVERIFY(serverPointer); - - QSignalSpy entered2Spy(p, &Pointer::entered); - QVERIFY(entered2Spy.wait()); - QCOMPARE(p->enteredSurface(), s); - QSignalSpy leftSpy2(p, &Pointer::left); - QVERIFY(leftSpy2.isValid()); - delete s; - QVERIFY(!p->enteredSurface()); - QVERIFY(leftSpy2.wait()); - QCOMPARE(focusedPointerChangedSpy.count(), 10); - QVERIFY(!m_seatInterface->focusedPointerSurface()); - QVERIFY(!m_seatInterface->focusedPointer()); } void TestWaylandSeat::testPointerTransformation_data() @@ -641,7 +538,7 @@ void TestWaylandSeat::testPointerTransformation() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy pointerSpy(m_seat, &Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); @@ -652,26 +549,29 @@ QVERIFY(surfaceCreatedSpy.isValid()); Surface *s = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - m_seatInterface->setPointerPos(QPoint(20, 18)); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + s->attachBuffer(m_shm->createBuffer(image)); + s->damage(image.rect()); + s->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + + m_seatInterface->notifyPointerMotion(QPoint(20, 18)); QFETCH(QMatrix4x4, enterTransformation); m_seatInterface->setFocusedPointerSurface(serverSurface, enterTransformation); QCOMPARE(m_seatInterface->focusedPointerSurfaceTransformation(), enterTransformation); // no pointer yet QVERIFY(m_seatInterface->focusedPointerSurface()); - QVERIFY(!m_seatInterface->focusedPointer()); Pointer *p = m_seat->createPointer(m_seat); - const Pointer &cp = *p; QVERIFY(p->isValid()); - QSignalSpy pointerCreatedSpy(m_seatInterface, &SeatInterface::pointerCreated); - QVERIFY(pointerCreatedSpy.isValid()); - // once the pointer is created it should be set as the focused pointer - QVERIFY(pointerCreatedSpy.wait()); - QVERIFY(m_seatInterface->focusedPointer()); - QCOMPARE(pointerCreatedSpy.first().first().value(), m_seatInterface->focusedPointer()); + QSignalSpy frameSpy(p, &Pointer::frame); + QVERIFY(frameSpy.wait()); + const Pointer &cp = *p; m_seatInterface->setFocusedPointerSurface(nullptr); serverSurface->client()->flush(); @@ -693,14 +593,13 @@ QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.first().first().value(), m_display->serial()); QTEST(enteredSpy.first().last().toPointF(), "expectedEnterPoint"); - PointerInterface *serverPointer = m_seatInterface->focusedPointer(); - QVERIFY(serverPointer); QCOMPARE(p->enteredSurface(), s); QCOMPARE(cp.enteredSurface(), s); // test motion m_seatInterface->setTimestamp(1); - m_seatInterface->setPointerPos(QPoint(10, 16)); + m_seatInterface->notifyPointerMotion(QPoint(10, 16)); + m_seatInterface->notifyPointerFrame(); QVERIFY(motionSpy.wait()); QTEST(motionSpy.first().first().toPointF(), "expectedMovePoint"); QCOMPARE(motionSpy.first().last().value(), quint32(1)); @@ -731,24 +630,27 @@ QTest::addColumn("qtButton"); QTest::addColumn("waylandButton"); - QTest::newRow("left") << Qt::LeftButton << quint32(BTN_LEFT); - QTest::newRow("right") << Qt::RightButton << quint32(BTN_RIGHT); - QTest::newRow("mid") << Qt::MidButton << quint32(BTN_MIDDLE); - QTest::newRow("middle") << Qt::MiddleButton << quint32(BTN_MIDDLE); - QTest::newRow("back") << Qt::BackButton << quint32(BTN_BACK); - QTest::newRow("x1") << Qt::XButton1 << quint32(BTN_BACK); - QTest::newRow("extra1") << Qt::ExtraButton1 << quint32(BTN_BACK); + QTest::newRow("left") << Qt::LeftButton << quint32(BTN_LEFT); + QTest::newRow("right") << Qt::RightButton << quint32(BTN_RIGHT); + // Deprecated in qt5.15 +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + QTest::newRow("mid") << Qt::MidButton << quint32(BTN_MIDDLE); +#endif + QTest::newRow("middle") << Qt::MiddleButton << quint32(BTN_MIDDLE); + QTest::newRow("back") << Qt::BackButton << quint32(BTN_BACK); + QTest::newRow("x1") << Qt::XButton1 << quint32(BTN_BACK); + QTest::newRow("extra1") << Qt::ExtraButton1 << quint32(BTN_BACK); QTest::newRow("forward") << Qt::ForwardButton << quint32(BTN_FORWARD); - QTest::newRow("x2") << Qt::XButton2 << quint32(BTN_FORWARD); - QTest::newRow("extra2") << Qt::ExtraButton2 << quint32(BTN_FORWARD); - QTest::newRow("task") << Qt::TaskButton << quint32(BTN_TASK); - QTest::newRow("extra3") << Qt::ExtraButton3 << quint32(BTN_TASK); - QTest::newRow("extra4") << Qt::ExtraButton4 << quint32(BTN_EXTRA); - QTest::newRow("extra5") << Qt::ExtraButton5 << quint32(BTN_SIDE); - QTest::newRow("extra6") << Qt::ExtraButton6 << quint32(0x118); - QTest::newRow("extra7") << Qt::ExtraButton7 << quint32(0x119); - QTest::newRow("extra8") << Qt::ExtraButton8 << quint32(0x11a); - QTest::newRow("extra9") << Qt::ExtraButton9 << quint32(0x11b); + QTest::newRow("x2") << Qt::XButton2 << quint32(BTN_FORWARD); + QTest::newRow("extra2") << Qt::ExtraButton2 << quint32(BTN_FORWARD); + QTest::newRow("task") << Qt::TaskButton << quint32(BTN_TASK); + QTest::newRow("extra3") << Qt::ExtraButton3 << quint32(BTN_TASK); + QTest::newRow("extra4") << Qt::ExtraButton4 << quint32(BTN_EXTRA); + QTest::newRow("extra5") << Qt::ExtraButton5 << quint32(BTN_SIDE); + QTest::newRow("extra6") << Qt::ExtraButton6 << quint32(0x118); + QTest::newRow("extra7") << Qt::ExtraButton7 << quint32(0x119); + QTest::newRow("extra8") << Qt::ExtraButton8 << quint32(0x11a); + QTest::newRow("extra9") << Qt::ExtraButton9 << quint32(0x11b); QTest::newRow("extra10") << Qt::ExtraButton10 << quint32(0x11c); QTest::newRow("extra11") << Qt::ExtraButton11 << quint32(0x11d); QTest::newRow("extra12") << Qt::ExtraButton12 << quint32(0x11e); @@ -758,44 +660,50 @@ void TestWaylandSeat::testPointerButton() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy pointerSpy(m_seat, SIGNAL(hasPointerChanged(bool))); + QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - m_compositor->createSurface(m_compositor); + KWayland::Client::Surface *s = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + s->attachBuffer(m_shm->createBuffer(image)); + s->damage(image.rect()); + s->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + QScopedPointer p(m_seat->createPointer()); QVERIFY(p->isValid()); - QSignalSpy buttonChangedSpy(p.data(), SIGNAL(buttonStateChanged(quint32,quint32,quint32,KWayland::Client::Pointer::ButtonState))); + QSignalSpy buttonChangedSpy(p.data(), &KWayland::Client::Pointer::buttonStateChanged); QVERIFY(buttonChangedSpy.isValid()); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - m_seatInterface->setPointerPos(QPoint(20, 18)); + m_seatInterface->notifyPointerMotion(QPoint(20, 18)); m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(10, 15)); QVERIFY(m_seatInterface->focusedPointerSurface()); - QVERIFY(m_seatInterface->focusedPointer()); QCoreApplication::processEvents(); m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(10, 15)); - PointerInterface *serverPointer = m_seatInterface->focusedPointer(); - QVERIFY(serverPointer); QFETCH(Qt::MouseButton, qtButton); QFETCH(quint32, waylandButton); quint32 msec = QDateTime::currentMSecsSinceEpoch(); QCOMPARE(m_seatInterface->isPointerButtonPressed(waylandButton), false); QCOMPARE(m_seatInterface->isPointerButtonPressed(qtButton), false); m_seatInterface->setTimestamp(msec); - m_seatInterface->pointerButtonPressed(qtButton); + m_seatInterface->notifyPointerButton(qtButton, PointerButtonState::Pressed); + m_seatInterface->notifyPointerFrame(); QCOMPARE(m_seatInterface->isPointerButtonPressed(waylandButton), true); QCOMPARE(m_seatInterface->isPointerButtonPressed(qtButton), true); QVERIFY(buttonChangedSpy.wait()); @@ -807,7 +715,8 @@ QCOMPARE(buttonChangedSpy.last().at(3).value(), Pointer::ButtonState::Pressed); msec = QDateTime::currentMSecsSinceEpoch(); m_seatInterface->setTimestamp(QDateTime::currentMSecsSinceEpoch()); - m_seatInterface->pointerButtonReleased(qtButton); + m_seatInterface->notifyPointerButton(qtButton, PointerButtonState::Released); + m_seatInterface->notifyPointerFrame(); QCOMPARE(m_seatInterface->isPointerButtonPressed(waylandButton), false); QCOMPARE(m_seatInterface->isPointerButtonPressed(qtButton), false); QVERIFY(buttonChangedSpy.wait()); @@ -823,7 +732,7 @@ { // this test verifies that pointer motion on a surface with sub-surfaces sends motion enter/leave to the sub-surface using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first create the pointer QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged); @@ -847,7 +756,7 @@ grandChild2SubSurface->setPosition(QPoint(0, 25)); // let's map the surfaces - auto render = [this] (Surface *s, const QSize &size) { + auto render = [this](Surface *s, const QSize &size) { QImage image(size, QImage::Format_ARGB32_Premultiplied); image.fill(Qt::black); s->attachBuffer(m_shm->createBuffer(image)); @@ -860,7 +769,7 @@ render(parentSurface.data(), QSize(100, 100)); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface->isMapped()); // send in pointer events @@ -873,7 +782,7 @@ // first to the grandChild2 in the overlapped area quint32 timestamp = 1; m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(25, 50)); + m_seatInterface->notifyPointerMotion(QPointF(25, 50)); m_seatInterface->setFocusedPointerSurface(serverSurface); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 1); @@ -883,7 +792,8 @@ QCOMPARE(pointer->enteredSurface(), grandChild2Surface.data()); // a motion on grandchild2 m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(25, 60)); + m_seatInterface->notifyPointerMotion(QPointF(25, 60)); + m_seatInterface->notifyPointerFrame(); QVERIFY(motionSpy.wait()); QCOMPARE(enteredSpy.count(), 1); QCOMPARE(leftSpy.count(), 0); @@ -891,11 +801,12 @@ QCOMPARE(motionSpy.last().first().toPointF(), QPointF(25, 35)); // motion which changes to childSurface m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(25, 80)); + m_seatInterface->notifyPointerMotion(QPointF(25, 80)); + m_seatInterface->notifyPointerFrame(); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 2); QCOMPARE(leftSpy.count(), 1); - QCOMPARE(motionSpy.count(), 1); + QCOMPARE(motionSpy.count(), 2); QCOMPARE(enteredSpy.last().last().toPointF(), QPointF(25, 80)); QCOMPARE(pointer->enteredSurface(), childSurface.data()); // a leave for the whole surface @@ -904,15 +815,15 @@ QVERIFY(leftSpy.wait()); QCOMPARE(enteredSpy.count(), 2); QCOMPARE(leftSpy.count(), 2); - QCOMPARE(motionSpy.count(), 1); + QCOMPARE(motionSpy.count(), 2); // a new enter on the main surface m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(75, 50)); + m_seatInterface->notifyPointerMotion(QPointF(75, 50)); m_seatInterface->setFocusedPointerSurface(serverSurface); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 3); QCOMPARE(leftSpy.count(), 2); - QCOMPARE(motionSpy.count(), 1); + QCOMPARE(motionSpy.count(), 2); QCOMPARE(enteredSpy.last().last().toPointF(), QPointF(75, 50)); QCOMPARE(pointer->enteredSurface(), parentSurface.data()); } @@ -930,7 +841,7 @@ void TestWaylandSeat::testPointerSwipeGesture() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged); @@ -958,11 +869,20 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); + + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + m_seatInterface->setFocusedPointerSurface(serverSurface); QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - QVERIFY(m_seatInterface->focusedPointer()); + QVERIFY(m_seatInterface->pointer()); // send in the start quint32 timestamp = 1; @@ -1046,7 +966,7 @@ void TestWaylandSeat::testPointerPinchGesture() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged); @@ -1074,11 +994,20 @@ QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); + + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + m_seatInterface->setFocusedPointerSurface(serverSurface); QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); - QVERIFY(m_seatInterface->focusedPointer()); + QVERIFY(m_seatInterface->pointer()); // send in the start quint32 timestamp = 1; @@ -1153,162 +1082,302 @@ QVERIFY(spy->wait()); } -void TestWaylandSeat::testKeyboardSubSurfaceTreeFromPointer() +void TestWaylandSeat::testPointerHoldGesture_data() +{ + QTest::addColumn("cancel"); + QTest::addColumn("expectedEndCount"); + QTest::addColumn("expectedCancelCount"); + + QTest::newRow("end") << false << 1 << 0; + QTest::newRow("cancel") << true << 0 << 1; +} + +class PointerHoldGesture : public QObject, public QtWayland::zwp_pointer_gesture_hold_v1 +{ + using zwp_pointer_gesture_hold_v1::zwp_pointer_gesture_hold_v1; + Q_OBJECT + void zwp_pointer_gesture_hold_v1_begin(uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) override + { + Q_EMIT started(serial, time, surface, fingers); + } + + void zwp_pointer_gesture_hold_v1_end(uint32_t serial, uint32_t time, int32_t cancelled) override + { + cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time); + } +Q_SIGNALS: + void started(quint32 serial , quint32 time, void *surface, quint32 fingers); + void ended(quint32 serial, quint32 time); + void cancelled(quint32 serial, quint32 time); +}; + +void TestWaylandSeat::testPointerHoldGesture() { - // this test verifies that when clicking on a sub-surface the keyboard focus passes to it using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - // first create the pointer + // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged); QVERIFY(hasPointerChangedSpy.isValid()); m_seatInterface->setHasPointer(true); QVERIFY(hasPointerChangedSpy.wait()); QScopedPointer pointer(m_seat->createPointer()); + Registry registry; + QSignalSpy gesturesAnnoucedSpy(®istry, &Registry::pointerGesturesUnstableV1Announced); + QVERIFY(gesturesAnnoucedSpy.isValid()); + registry.create(m_connection); + registry.setup(); + QVERIFY(gesturesAnnoucedSpy.wait()); + QtWayland::zwp_pointer_gestures_v1 gestures(registry, gesturesAnnoucedSpy.first().at(0).value(), gesturesAnnoucedSpy.first().at(1).value()); + PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer)); + QVERIFY(gesture.isInitialized()); - // and create keyboard - QSignalSpy hasKeyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged); - QVERIFY(hasKeyboardChangedSpy.isValid()); - m_seatInterface->setHasKeyboard(true); - QVERIFY(hasKeyboardChangedSpy.wait()); - QScopedPointer keyboard(m_seat->createKeyboard()); - // create a sub surface tree - // parent surface (100, 100) with one sub surface taking the half of it's size (50, 100) - // which has two further children (50, 50) which are overlapping + QSignalSpy startSpy(&gesture, &PointerHoldGesture::started); + QVERIFY(startSpy.isValid()); + QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended); + QVERIFY(endSpy.isValid()); + QSignalSpy cancelledSpy(&gesture, &PointerHoldGesture::cancelled); + QVERIFY(cancelledSpy.isValid()); + + // now create a surface QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - QScopedPointer parentSurface(m_compositor->createSurface()); - QScopedPointer childSurface(m_compositor->createSurface()); - QScopedPointer grandChild1Surface(m_compositor->createSurface()); - QScopedPointer grandChild2Surface(m_compositor->createSurface()); - QScopedPointer childSubSurface(m_subCompositor->createSubSurface(childSurface.data(), parentSurface.data())); - QScopedPointer grandChild1SubSurface(m_subCompositor->createSubSurface(grandChild1Surface.data(), childSurface.data())); - QScopedPointer grandChild2SubSurface(m_subCompositor->createSubSurface(grandChild2Surface.data(), childSurface.data())); - grandChild2SubSurface->setPosition(QPoint(0, 25)); - - // let's map the surfaces - auto render = [this] (Surface *s, const QSize &size) { - QImage image(size, QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::black); - s->attachBuffer(m_shm->createBuffer(image)); - s->damage(QRect(QPoint(0, 0), size)); - s->commit(Surface::CommitFlag::None); - }; - render(grandChild2Surface.data(), QSize(50, 50)); - render(grandChild1Surface.data(), QSize(50, 50)); - render(childSurface.data(), QSize(50, 100)); - render(parentSurface.data(), QSize(100, 100)); - + QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); auto serverSurface = surfaceCreatedSpy.first().first().value(); - QVERIFY(serverSurface->isMapped()); + QVERIFY(serverSurface); - // pass keyboard focus to the main surface - QSignalSpy enterSpy(keyboard.data(), &Keyboard::entered); - QVERIFY(enterSpy.isValid()); - QSignalSpy leftSpy(keyboard.data(), &Keyboard::left); - QVERIFY(leftSpy.isValid()); - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - QVERIFY(enterSpy.wait()); - QCOMPARE(enterSpy.count(), 1); - QCOMPARE(leftSpy.count(), 0); - QCOMPARE(keyboard->enteredSurface(), parentSurface.data()); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); - // now pass also pointer focus to the surface - QSignalSpy pointerEnterSpy(pointer.data(), &Pointer::entered); - QVERIFY(pointerEnterSpy.isValid()); + m_seatInterface->setFocusedPointerSurface(serverSurface); + QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); + QVERIFY(m_seatInterface->pointer()); + + // send in the start quint32 timestamp = 1; m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->setPointerPos(QPointF(25, 50)); - m_seatInterface->setFocusedPointerSurface(serverSurface); - QVERIFY(pointerEnterSpy.wait()); - QCOMPARE(pointerEnterSpy.count(), 1); - // should not have affected the keyboard - QCOMPARE(enterSpy.count(), 1); - QCOMPARE(leftSpy.count(), 0); + m_seatInterface->startPointerHoldGesture(3); + QVERIFY(startSpy.wait()); + QCOMPARE(startSpy.count(), 1); + QCOMPARE(startSpy.first().at(0).value(), m_display->serial()); + QCOMPARE(startSpy.first().at(1).value(), 1u); + QCOMPARE(startSpy.first().at(2).value(), *surface.get()); + QCOMPARE(startSpy.first().at(3).value(), 3); - // let's click + // another start should not be possible + m_seatInterface->startPointerPinchGesture(3); + QVERIFY(!startSpy.wait(500)); + + // now end or cancel + QFETCH(bool, cancel); + QSignalSpy *spy; m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + if (cancel) { + m_seatInterface->cancelPointerHoldGesture(); + spy = &cancelledSpy; + } else { + m_seatInterface->endPointerHoldGesture(); + spy = &endSpy; + } + QVERIFY(spy->wait()); + QTEST(endSpy.count(), "expectedEndCount"); + QTEST(cancelledSpy.count(), "expectedCancelCount"); + QCOMPARE(spy->count(), 1); + QCOMPARE(spy->first().at(0).value(), m_display->serial()); + QCOMPARE(spy->first().at(1).value(), 2); + + // now a start should be possible again m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonReleased(Qt::LeftButton); - QVERIFY(enterSpy.wait()); - QCOMPARE(enterSpy.count(), 2); - QCOMPARE(leftSpy.count(), 1); - QCOMPARE(keyboard->enteredSurface(), grandChild2Surface.data()); + m_seatInterface->startPointerHoldGesture(3); + QVERIFY(startSpy.wait()); - // click on same surface should not trigger another enter + // and end m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonPressed(Qt::LeftButton); + if (cancel) { + m_seatInterface->cancelPointerHoldGesture(); + } else { + m_seatInterface->endPointerHoldGesture(); + } + QVERIFY(spy->wait()); +} + +void TestWaylandSeat::testPointerAxis() +{ + using namespace KWayland::Client; + using namespace KWaylandServer; + + // first create the pointer + QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged); + QVERIFY(hasPointerChangedSpy.isValid()); + m_seatInterface->setHasPointer(true); + QVERIFY(hasPointerChangedSpy.wait()); + QScopedPointer pointer(m_seat->createPointer()); + QVERIFY(pointer); + + // now create a surface + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); + QVERIFY(surfaceCreatedSpy.isValid()); + QScopedPointer surface(m_compositor->createSurface()); + QVERIFY(surfaceCreatedSpy.wait()); + auto serverSurface = surfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + + m_seatInterface->setFocusedPointerSurface(serverSurface); + QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface); + QSignalSpy frameSpy(pointer.data(), &Pointer::frame); + QVERIFY(frameSpy.isValid()); + QVERIFY(frameSpy.wait()); + QCOMPARE(frameSpy.count(), 1); + + // let's scroll vertically + QSignalSpy axisSourceSpy(pointer.data(), &Pointer::axisSourceChanged); + QVERIFY(axisSourceSpy.isValid()); + QSignalSpy axisSpy(pointer.data(), &Pointer::axisChanged); + QVERIFY(axisSpy.isValid()); + QSignalSpy axisDiscreteSpy(pointer.data(), &Pointer::axisDiscreteChanged); + QVERIFY(axisDiscreteSpy.isValid()); + QSignalSpy axisStoppedSpy(pointer.data(), &Pointer::axisStopped); + QVERIFY(axisStoppedSpy.isValid()); + + quint32 timestamp = 1; m_seatInterface->setTimestamp(timestamp++); - m_seatInterface->pointerButtonReleased(Qt::LeftButton); - QVERIFY(!enterSpy.wait(200)); - QCOMPARE(enterSpy.count(), 2); - QCOMPARE(leftSpy.count(), 1); - QCOMPARE(keyboard->enteredSurface(), grandChild2Surface.data()); + m_seatInterface->notifyPointerAxis(Qt::Vertical, 10, 1, PointerAxisSource::Wheel); + m_seatInterface->notifyPointerFrame(); + QVERIFY(frameSpy.wait()); + QCOMPARE(frameSpy.count(), 2); + QCOMPARE(axisSourceSpy.count(), 1); + QCOMPARE(axisSourceSpy.last().at(0).value(), Pointer::AxisSource::Wheel); + QCOMPARE(axisDiscreteSpy.count(), 1); + QCOMPARE(axisDiscreteSpy.last().at(0).value(), Pointer::Axis::Vertical); + QCOMPARE(axisDiscreteSpy.last().at(1).value(), 1); + QCOMPARE(axisSpy.count(), 1); + QCOMPARE(axisSpy.last().at(0).value(), quint32(1)); + QCOMPARE(axisSpy.last().at(1).value(), Pointer::Axis::Vertical); + QCOMPARE(axisSpy.last().at(2).value(), 10.0); + QCOMPARE(axisStoppedSpy.count(), 0); - // unfocus keyboard - m_seatInterface->setFocusedKeyboardSurface(nullptr); - QVERIFY(leftSpy.wait()); - QCOMPARE(enterSpy.count(), 2); - QCOMPARE(leftSpy.count(), 2); + // let's scroll using fingers + m_seatInterface->setTimestamp(timestamp++); + m_seatInterface->notifyPointerAxis(Qt::Horizontal, 42, 0, PointerAxisSource::Finger); + m_seatInterface->notifyPointerFrame(); + QVERIFY(frameSpy.wait()); + QCOMPARE(frameSpy.count(), 3); + QCOMPARE(axisSourceSpy.count(), 2); + QCOMPARE(axisSourceSpy.last().at(0).value(), Pointer::AxisSource::Finger); + QCOMPARE(axisDiscreteSpy.count(), 1); + QCOMPARE(axisSpy.count(), 2); + QCOMPARE(axisSpy.last().at(0).value(), quint32(2)); + QCOMPARE(axisSpy.last().at(1).value(), Pointer::Axis::Horizontal); + QCOMPARE(axisSpy.last().at(2).value(), 42.0); + QCOMPARE(axisStoppedSpy.count(), 0); + + // lift the fingers off the device + m_seatInterface->setTimestamp(timestamp++); + m_seatInterface->notifyPointerAxis(Qt::Horizontal, 0, 0, PointerAxisSource::Finger); + m_seatInterface->notifyPointerFrame(); + QVERIFY(frameSpy.wait()); + QCOMPARE(frameSpy.count(), 4); + QCOMPARE(axisSourceSpy.count(), 3); + QCOMPARE(axisSourceSpy.last().at(0).value(), Pointer::AxisSource::Finger); + QCOMPARE(axisDiscreteSpy.count(), 1); + QCOMPARE(axisSpy.count(), 2); + QCOMPARE(axisStoppedSpy.count(), 1); + QCOMPARE(axisStoppedSpy.last().at(0).value(), 3); + QCOMPARE(axisStoppedSpy.last().at(1).value(), Pointer::Axis::Horizontal); + + // if the device is unknown, no axis_source event should be sent + m_seatInterface->setTimestamp(timestamp++); + m_seatInterface->notifyPointerAxis(Qt::Horizontal, 42, 1, PointerAxisSource::Unknown); + m_seatInterface->notifyPointerFrame(); + QVERIFY(frameSpy.wait()); + QCOMPARE(frameSpy.count(), 5); + QCOMPARE(axisSourceSpy.count(), 3); + QCOMPARE(axisDiscreteSpy.count(), 2); + QCOMPARE(axisDiscreteSpy.last().at(0).value(), Pointer::Axis::Horizontal); + QCOMPARE(axisDiscreteSpy.last().at(1).value(), 1); + QCOMPARE(axisSpy.count(), 3); + QCOMPARE(axisSpy.last().at(0).value(), quint32(4)); + QCOMPARE(axisSpy.last().at(1).value(), Pointer::Axis::Horizontal); + QCOMPARE(axisSpy.last().at(2).value(), 42.0); + QCOMPARE(axisStoppedSpy.count(), 1); } void TestWaylandSeat::testCursor() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy pointerSpy(m_seat, SIGNAL(hasPointerChanged(bool))); + QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - m_compositor->createSurface(m_compositor); + KWayland::Client::Surface *surface = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + QScopedPointer p(m_seat->createPointer()); QVERIFY(p->isValid()); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QSignalSpy enteredSpy(p.data(), SIGNAL(entered(quint32,QPointF))); + QSignalSpy enteredSpy(p.data(), &KWayland::Client::Pointer::entered); QVERIFY(enteredSpy.isValid()); - m_seatInterface->setPointerPos(QPoint(20, 18)); + m_seatInterface->notifyPointerMotion(QPoint(20, 18)); m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(10, 15)); quint32 serial = m_seatInterface->display()->serial(); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.first().first().value(), serial); QVERIFY(m_seatInterface->focusedPointerSurface()); - QVERIFY(m_seatInterface->focusedPointer()); - QVERIFY(!m_seatInterface->focusedPointer()->cursor()); + QVERIFY(!m_seatInterface->pointer()->cursor()); - QSignalSpy cursorChangedSpy(m_seatInterface->focusedPointer(), SIGNAL(cursorChanged())); + QSignalSpy cursorChangedSpy(m_seatInterface->pointer(), &KWaylandServer::PointerInterface::cursorChanged); QVERIFY(cursorChangedSpy.isValid()); // just remove the pointer p->setCursor(nullptr); QVERIFY(cursorChangedSpy.wait()); QCOMPARE(cursorChangedSpy.count(), 1); - auto cursor = m_seatInterface->focusedPointer()->cursor(); + auto cursor = m_seatInterface->pointer()->cursor(); QVERIFY(cursor); QVERIFY(!cursor->surface()); QCOMPARE(cursor->hotspot(), QPoint()); QCOMPARE(cursor->enteredSerial(), serial); - QCOMPARE(cursor->pointer(), m_seatInterface->focusedPointer()); + QCOMPARE(cursor->pointer(), m_seatInterface->pointer()); - QSignalSpy hotspotChangedSpy(cursor, SIGNAL(hotspotChanged())); + QSignalSpy hotspotChangedSpy(cursor, &KWaylandServer::Cursor::hotspotChanged); QVERIFY(hotspotChangedSpy.isValid()); - QSignalSpy surfaceChangedSpy(cursor, SIGNAL(surfaceChanged())); + QSignalSpy surfaceChangedSpy(cursor, &KWaylandServer::Cursor::surfaceChanged); QVERIFY(surfaceChangedSpy.isValid()); - QSignalSpy enteredSerialChangedSpy(cursor, SIGNAL(enteredSerialChanged())); + QSignalSpy enteredSerialChangedSpy(cursor, &KWaylandServer::Cursor::enteredSerialChanged); QVERIFY(enteredSerialChangedSpy.isValid()); - QSignalSpy changedSpy(cursor, SIGNAL(changed())); + QSignalSpy changedSpy(cursor, &KWaylandServer::Cursor::changed); QVERIFY(changedSpy.isValid()); // test changing hotspot @@ -1343,7 +1412,7 @@ QCOMPARE(changedSpy.count(), 3); QCOMPARE(cursorChangedSpy.count(), 4); QCOMPARE(surfaceChangedSpy.count(), 1); - QCOMPARE(cursor->surface()->buffer()->data(), img); + QCOMPARE(qobject_cast(cursor->surface()->buffer())->data(), img); // and add another image to the surface QImage blue(QSize(10, 20), QImage::Format_ARGB32_Premultiplied); @@ -1354,7 +1423,7 @@ QVERIFY(changedSpy.wait()); QCOMPARE(changedSpy.count(), 4); QCOMPARE(cursorChangedSpy.count(), 5); - QCOMPARE(cursor->surface()->buffer()->data(), blue); + QCOMPARE(qobject_cast(cursor->surface()->buffer())->data(), blue); p->hideCursor(); QVERIFY(surfaceChangedSpy.wait()); @@ -1368,7 +1437,7 @@ { // this test verifies that damaging a cursor surface triggers a cursor changed on the server using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy pointerSpy(m_seat, &Seat::hasPointerChanged); QVERIFY(pointerSpy.isValid()); @@ -1383,17 +1452,25 @@ // create surface QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - m_compositor->createSurface(m_compositor); + KWayland::Client::Surface *surface = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(image.rect()); + surface->commit(Surface::CommitFlag::None); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QVERIFY(committedSpy.wait()); + // send enter to the surface m_seatInterface->setFocusedPointerSurface(serverSurface); QVERIFY(enteredSpy.wait()); // create a signal spy for the cursor changed signal - auto pointer = m_seatInterface->focusedPointer(); + auto pointer = m_seatInterface->pointer(); QSignalSpy cursorChangedSpy(pointer, &PointerInterface::cursorChanged); QVERIFY(cursorChangedSpy.isValid()); @@ -1407,7 +1484,7 @@ cursorSurface->commit(Surface::CommitFlag::None); p->setCursor(cursorSurface, QPoint(0, 0)); QVERIFY(cursorChangedSpy.wait()); - QCOMPARE(pointer->cursor()->surface()->buffer()->data(), red); + QCOMPARE(qobject_cast(pointer->cursor()->surface()->buffer())->data(), red); // and damage the surface QImage blue(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); @@ -1416,32 +1493,30 @@ cursorSurface->damage(QRect(0, 0, 10, 10)); cursorSurface->commit(Surface::CommitFlag::None); QVERIFY(cursorChangedSpy.wait()); - QCOMPARE(pointer->cursor()->surface()->buffer()->data(), blue); + QCOMPARE(qobject_cast(pointer->cursor()->surface()->buffer())->data(), blue); } void TestWaylandSeat::testKeyboard() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy keyboardSpy(m_seat, SIGNAL(hasKeyboardChanged(bool))); + QSignalSpy keyboardSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); QVERIFY(keyboardSpy.isValid()); m_seatInterface->setHasKeyboard(true); QVERIFY(keyboardSpy.wait()); + // update modifiers before any surface focused + m_seatInterface->notifyKeyboardModifiers(4, 3, 2, 1); + // create the surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); Surface *s = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - // no keyboard yet - QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedKeyboard()); - Keyboard *keyboard = m_seat->createKeyboard(m_seat); QSignalSpy repeatInfoSpy(keyboard, &Keyboard::keyRepeatChanged); QVERIFY(repeatInfoSpy.isValid()); @@ -1450,9 +1525,10 @@ QCOMPARE(keyboard->isKeyRepeatEnabled(), false); QCOMPARE(keyboard->keyRepeatDelay(), 0); QCOMPARE(keyboard->keyRepeatRate(), 0); + QVERIFY(repeatInfoSpy.wait()); wl_display_flush(m_connection->display()); QTest::qWait(100); - auto serverKeyboard = m_seatInterface->focusedKeyboard(); + auto serverKeyboard = m_seatInterface->keyboard(); QVERIFY(serverKeyboard); // we should get the repeat info announced @@ -1462,8 +1538,7 @@ QCOMPARE(keyboard->keyRepeatRate(), 0); // let's change repeat in server - m_seatInterface->setKeyRepeatInfo(25, 660); - m_seatInterface->focusedKeyboard()->client()->flush(); + m_seatInterface->keyboard()->setRepeatInfo(25, 660); QVERIFY(repeatInfoSpy.wait()); QCOMPARE(repeatInfoSpy.count(), 2); QCOMPARE(keyboard->isKeyRepeatEnabled(), true); @@ -1471,49 +1546,49 @@ QCOMPARE(keyboard->keyRepeatDelay(), 660); m_seatInterface->setTimestamp(1); - m_seatInterface->keyPressed(KEY_K); + m_seatInterface->notifyKeyboardKey(KEY_K, KeyboardKeyState::Pressed); m_seatInterface->setTimestamp(2); - m_seatInterface->keyPressed(KEY_D); + m_seatInterface->notifyKeyboardKey(KEY_D, KeyboardKeyState::Pressed); m_seatInterface->setTimestamp(3); - m_seatInterface->keyPressed(KEY_E); + m_seatInterface->notifyKeyboardKey(KEY_E, KeyboardKeyState::Pressed); - QSignalSpy modifierSpy(keyboard, SIGNAL(modifiersChanged(quint32,quint32,quint32,quint32))); + QSignalSpy modifierSpy(keyboard, &KWayland::Client::Keyboard::modifiersChanged); QVERIFY(modifierSpy.isValid()); - QSignalSpy enteredSpy(keyboard, SIGNAL(entered(quint32))); + QSignalSpy enteredSpy(keyboard, &KWayland::Client::Keyboard::entered); QVERIFY(enteredSpy.isValid()); m_seatInterface->setFocusedKeyboardSurface(serverSurface); QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QCOMPARE(m_seatInterface->focusedKeyboard()->focusedSurface(), serverSurface); + QCOMPARE(m_seatInterface->keyboard()->focusedSurface(), serverSurface); // we get the modifiers sent after the enter QVERIFY(modifierSpy.wait()); QCOMPARE(modifierSpy.count(), 1); - QCOMPARE(modifierSpy.first().at(0).value(), quint32(0)); - QCOMPARE(modifierSpy.first().at(1).value(), quint32(0)); - QCOMPARE(modifierSpy.first().at(2).value(), quint32(0)); - QCOMPARE(modifierSpy.first().at(3).value(), quint32(0)); + QCOMPARE(modifierSpy.first().at(0).value(), quint32(4)); + QCOMPARE(modifierSpy.first().at(1).value(), quint32(3)); + QCOMPARE(modifierSpy.first().at(2).value(), quint32(2)); + QCOMPARE(modifierSpy.first().at(3).value(), quint32(1)); QCOMPARE(enteredSpy.count(), 1); // TODO: get through API QCOMPARE(enteredSpy.first().first().value(), m_display->serial() - 1); - QSignalSpy keyChangedSpy(keyboard, SIGNAL(keyChanged(quint32,KWayland::Client::Keyboard::KeyState,quint32))); + QSignalSpy keyChangedSpy(keyboard, &KWayland::Client::Keyboard::keyChanged); QVERIFY(keyChangedSpy.isValid()); m_seatInterface->setTimestamp(4); - m_seatInterface->keyReleased(KEY_E); + m_seatInterface->notifyKeyboardKey(KEY_E, KeyboardKeyState::Released); QVERIFY(keyChangedSpy.wait()); m_seatInterface->setTimestamp(5); - m_seatInterface->keyReleased(KEY_D); + m_seatInterface->notifyKeyboardKey(KEY_D, KeyboardKeyState::Released); QVERIFY(keyChangedSpy.wait()); m_seatInterface->setTimestamp(6); - m_seatInterface->keyReleased(KEY_K); + m_seatInterface->notifyKeyboardKey(KEY_K, KeyboardKeyState::Released); QVERIFY(keyChangedSpy.wait()); m_seatInterface->setTimestamp(7); - m_seatInterface->keyPressed(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Pressed); QVERIFY(keyChangedSpy.wait()); m_seatInterface->setTimestamp(8); - m_seatInterface->keyReleased(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Released); QVERIFY(keyChangedSpy.wait()); QCOMPARE(keyChangedSpy.count(), 5); @@ -1534,21 +1609,21 @@ QCOMPARE(keyChangedSpy.at(4).at(2).value(), quint32(8)); // releasing a key which is already released should not set a key changed - m_seatInterface->keyReleased(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Released); QVERIFY(!keyChangedSpy.wait(200)); // let's press it again - m_seatInterface->keyPressed(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Pressed); QVERIFY(keyChangedSpy.wait()); QCOMPARE(keyChangedSpy.count(), 6); // press again should be ignored - m_seatInterface->keyPressed(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Pressed); QVERIFY(!keyChangedSpy.wait(200)); // and release - m_seatInterface->keyReleased(KEY_F1); + m_seatInterface->notifyKeyboardKey(KEY_F1, KeyboardKeyState::Released); QVERIFY(keyChangedSpy.wait()); QCOMPARE(keyChangedSpy.count(), 7); - m_seatInterface->updateKeyboardModifiers(1, 2, 3, 4); + m_seatInterface->notifyKeyboardModifiers(1, 2, 3, 4); QVERIFY(modifierSpy.wait()); QCOMPARE(modifierSpy.count(), 2); QCOMPARE(modifierSpy.last().at(0).value(), quint32(1)); @@ -1556,15 +1631,14 @@ QCOMPARE(modifierSpy.last().at(2).value(), quint32(3)); QCOMPARE(modifierSpy.last().at(3).value(), quint32(4)); - QSignalSpy leftSpy(keyboard, SIGNAL(left(quint32))); + QSignalSpy leftSpy(keyboard, &KWayland::Client::Keyboard::left); QVERIFY(leftSpy.isValid()); m_seatInterface->setFocusedKeyboardSurface(nullptr); QVERIFY(!m_seatInterface->focusedKeyboardSurface()); - QVERIFY(!m_seatInterface->focusedKeyboard()); QVERIFY(leftSpy.wait()); QCOMPARE(leftSpy.count(), 1); // TODO: get through API - QCOMPARE(leftSpy.first().first().value(), m_display->serial() -1 ); + QCOMPARE(leftSpy.first().first().value(), m_display->serial() - 1); QVERIFY(!keyboard->enteredSurface()); QVERIFY(!ckeyboard.enteredSurface()); @@ -1573,7 +1647,7 @@ m_seatInterface->setFocusedKeyboardSurface(serverSurface); QVERIFY(modifierSpy.wait()); QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QCOMPARE(m_seatInterface->focusedKeyboard()->focusedSurface(), serverSurface); + QCOMPARE(m_seatInterface->keyboard()->focusedSurface(), serverSurface); QCOMPARE(enteredSpy.count(), 2); QCOMPARE(keyboard->enteredSurface(), s); @@ -1587,187 +1661,54 @@ QVERIFY(leftSpy.wait()); QCOMPARE(serverSurfaceDestroyedSpy.count(), 1); QVERIFY(!m_seatInterface->focusedKeyboardSurface()); - QVERIFY(!m_seatInterface->focusedKeyboard()); QVERIFY(!serverKeyboard->focusedSurface()); // let's create a Surface again QScopedPointer s2(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); QCOMPARE(surfaceCreatedSpy.count(), 2); - serverSurface = surfaceCreatedSpy.last().first().value(); + serverSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(serverSurface); m_seatInterface->setFocusedKeyboardSurface(serverSurface); QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QCOMPARE(m_seatInterface->focusedKeyboard(), serverKeyboard); - - // delete the Keyboard - QSignalSpy unboundSpy(serverKeyboard, &Resource::unbound); - QVERIFY(unboundSpy.isValid()); - QSignalSpy destroyedSpy(serverKeyboard, &Resource::destroyed); - QVERIFY(destroyedSpy.isValid()); - delete keyboard; - QVERIFY(unboundSpy.wait()); - QCOMPARE(unboundSpy.count(), 1); - QCOMPARE(destroyedSpy.count(), 0); - // verify that calling into the Keyboard related functionality doesn't crash - m_seatInterface->setTimestamp(9); - m_seatInterface->keyPressed(KEY_F2); - m_seatInterface->setTimestamp(10); - m_seatInterface->keyReleased(KEY_F2); - m_seatInterface->setKeyRepeatInfo(30, 560); - m_seatInterface->setKeyRepeatInfo(25, 660); - m_seatInterface->updateKeyboardModifiers(5, 6, 7, 8); - m_seatInterface->setKeymap(open("/dev/null", O_RDONLY), 0); - m_seatInterface->setFocusedKeyboardSurface(nullptr); - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedKeyboard()); - - QVERIFY(destroyedSpy.wait()); - QCOMPARE(destroyedSpy.count(), 1); - - // create a second Keyboard to verify that repeat info is announced properly - Keyboard *keyboard2 = m_seat->createKeyboard(m_seat); - QSignalSpy repeatInfoSpy2(keyboard2, &Keyboard::keyRepeatChanged); - QVERIFY(repeatInfoSpy2.isValid()); - QVERIFY(keyboard2->isValid()); - QCOMPARE(keyboard2->isKeyRepeatEnabled(), false); - QCOMPARE(keyboard2->keyRepeatDelay(), 0); - QCOMPARE(keyboard2->keyRepeatRate(), 0); - wl_display_flush(m_connection->display()); - QVERIFY(repeatInfoSpy2.wait()); - QCOMPARE(keyboard2->isKeyRepeatEnabled(), true); - QCOMPARE(keyboard2->keyRepeatRate(), 25); - QCOMPARE(keyboard2->keyRepeatDelay(), 660); - QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - serverKeyboard = m_seatInterface->focusedKeyboard(); - QVERIFY(serverKeyboard); - QSignalSpy keyboard2DestroyedSpy(serverKeyboard, &QObject::destroyed); - QVERIFY(keyboard2DestroyedSpy.isValid()); - delete keyboard2; - QVERIFY(keyboard2DestroyedSpy.wait()); - // this should have unset it on the server - QVERIFY(!m_seatInterface->focusedKeyboard()); - // but not the surface - QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); -} - -void TestWaylandSeat::testCast() -{ - using namespace KWayland::Client; - Registry registry; - QSignalSpy seatSpy(®istry, SIGNAL(seatAnnounced(quint32,quint32))); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - QVERIFY(seatSpy.wait()); - Seat s; - QVERIFY(!s.isValid()); - auto wlSeat = registry.bindSeat(seatSpy.first().first().value(), seatSpy.first().last().value()); - QVERIFY(wlSeat); - s.setup(wlSeat); - QVERIFY(s.isValid()); - - QCOMPARE((wl_seat*)s, wlSeat); - const Seat &s2(s); - QCOMPARE((wl_seat*)s2, wlSeat); -} - -void TestWaylandSeat::testDestroy() -{ - using namespace KWayland::Client; - QSignalSpy keyboardSpy(m_seat, SIGNAL(hasKeyboardChanged(bool))); - QVERIFY(keyboardSpy.isValid()); - m_seatInterface->setHasKeyboard(true); - QVERIFY(keyboardSpy.wait()); - Keyboard *k = m_seat->createKeyboard(m_seat); - QVERIFY(k->isValid()); - - QSignalSpy pointerSpy(m_seat, SIGNAL(hasPointerChanged(bool))); - QVERIFY(pointerSpy.isValid()); - m_seatInterface->setHasPointer(true); - QVERIFY(pointerSpy.wait()); - Pointer *p = m_seat->createPointer(m_seat); - QVERIFY(p->isValid()); - - QSignalSpy touchSpy(m_seat, SIGNAL(hasTouchChanged(bool))); - QVERIFY(touchSpy.isValid()); - m_seatInterface->setHasTouch(true); - QVERIFY(touchSpy.wait()); - Touch *t = m_seat->createTouch(m_seat); - QVERIFY(t->isValid()); - - delete m_compositor; - m_compositor = nullptr; - connect(m_connection, &ConnectionThread::connectionDied, m_seat, &Seat::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_shm, &ShmPool::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_subCompositor, &SubCompositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_relativePointerManager, &RelativePointerManager::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_pointerGestures, &PointerGestures::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - QVERIFY(m_seat->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - m_compositorInterface = nullptr; - m_seatInterface = nullptr; - m_subCompositorInterface = nullptr; - m_relativePointerManagerInterface = nullptr; - m_pointerGesturesInterface = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the seat should be destroyed; - QVERIFY(!m_seat->isValid()); - QVERIFY(!k->isValid()); - QVERIFY(!p->isValid()); - QVERIFY(!t->isValid()); - - // calling destroy again should not fail - m_seat->destroy(); - k->destroy(); - p->destroy(); - t->destroy(); + QCOMPARE(m_seatInterface->keyboard(), serverKeyboard); } void TestWaylandSeat::testSelection() { using namespace KWayland::Client; - using namespace KWayland::Server; - QScopedPointer ddmi(m_display->createDataDeviceManager()); - ddmi->create(); + using namespace KWaylandServer; + QScopedPointer ddmi(new DataDeviceManagerInterface(m_display)); Registry registry; - QSignalSpy dataDeviceManagerSpy(®istry, SIGNAL(dataDeviceManagerAnnounced(quint32,quint32))); + QSignalSpy dataDeviceManagerSpy(®istry, &KWayland::Client::Registry::dataDeviceManagerAnnounced); QVERIFY(dataDeviceManagerSpy.isValid()); + m_seatInterface->setHasKeyboard(true); registry.setEventQueue(m_queue); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); QVERIFY(dataDeviceManagerSpy.wait()); - QScopedPointer ddm(registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), - dataDeviceManagerSpy.first().last().value())); + QScopedPointer ddm( + registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), dataDeviceManagerSpy.first().last().value())); QVERIFY(ddm->isValid()); QScopedPointer dd1(ddm->getDataDevice(m_seat)); QVERIFY(dd1->isValid()); - QSignalSpy selectionSpy(dd1.data(), SIGNAL(selectionOffered(KWayland::Client::DataOffer*))); + QSignalSpy selectionSpy(dd1.data(), &KWayland::Client::DataDevice::selectionOffered); QVERIFY(selectionSpy.isValid()); - QSignalSpy selectionClearedSpy(dd1.data(), SIGNAL(selectionCleared())); + QSignalSpy selectionClearedSpy(dd1.data(), &KWayland::Client::DataDevice::selectionCleared); QVERIFY(selectionClearedSpy.isValid()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(!m_seatInterface->selection()); m_seatInterface->setFocusedKeyboardSurface(serverSurface); QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedKeyboard()); QVERIFY(selectionClearedSpy.wait()); QVERIFY(selectionSpy.isEmpty()); QVERIFY(!selectionClearedSpy.isEmpty()); @@ -1783,7 +1724,7 @@ QCOMPARE(selectionSpy.count(), 1); auto ddi = m_seatInterface->selection(); QVERIFY(ddi); - auto df = selectionSpy.first().first().value(); + auto df = selectionSpy.first().first().value(); QCOMPARE(df->offeredMimeTypes().count(), 1); QCOMPARE(df->offeredMimeTypes().first().name(), QStringLiteral("text/plain")); @@ -1796,7 +1737,6 @@ // unset the keyboard focus m_seatInterface->setFocusedKeyboardSurface(nullptr); QVERIFY(!m_seatInterface->focusedKeyboardSurface()); - QVERIFY(!m_seatInterface->focusedKeyboard()); serverSurface->client()->flush(); QCoreApplication::processEvents(); QCoreApplication::processEvents(); @@ -1839,52 +1779,6 @@ QVERIFY(cancelledSpy.isValid()); m_seatInterface->setSelection(ddi); QVERIFY(cancelledSpy.wait()); - - // Copy already cleared selection, BUG 383054 - m_seatInterface->setSelection(ddi); -} - -void TestWaylandSeat::testSelectionNoDataSource() -{ - // this test verifies that the server doesn't crash when using setSelection with - // a DataDevice which doesn't have a DataSource yet - using namespace KWayland::Client; - using namespace KWayland::Server; - // first create the DataDevice - QScopedPointer ddmi(m_display->createDataDeviceManager()); - ddmi->create(); - QSignalSpy ddiCreatedSpy(ddmi.data(), &DataDeviceManagerInterface::dataDeviceCreated); - QVERIFY(ddiCreatedSpy.isValid()); - Registry registry; - QSignalSpy dataDeviceManagerSpy(®istry, &Registry::dataDeviceManagerAnnounced); - QVERIFY(dataDeviceManagerSpy.isValid()); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - QVERIFY(dataDeviceManagerSpy.wait()); - QScopedPointer ddm(registry.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), - dataDeviceManagerSpy.first().last().value())); - QVERIFY(ddm->isValid()); - - QScopedPointer dd(ddm->getDataDevice(m_seat)); - QVERIFY(dd->isValid()); - QVERIFY(ddiCreatedSpy.wait()); - auto ddi = ddiCreatedSpy.first().first().value(); - QVERIFY(ddi); - - // now create a surface and pass it keyboard focus - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - QVERIFY(surfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QVERIFY(surface->isValid()); - QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); - QVERIFY(!m_seatInterface->selection()); - m_seatInterface->setFocusedKeyboardSurface(serverSurface); - QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); - } void TestWaylandSeat::testDataDeviceForKeyboardSurface() @@ -1893,12 +1787,12 @@ // and the currentSelection does not have a DataSource. // to properly test the functionality this test requires a second client using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create the DataDeviceManager - QScopedPointer ddmi(m_display->createDataDeviceManager()); - ddmi->create(); + QScopedPointer ddmi(new DataDeviceManagerInterface(m_display)); QSignalSpy ddiCreatedSpy(ddmi.data(), &DataDeviceManagerInterface::dataDeviceCreated); QVERIFY(ddiCreatedSpy.isValid()); + m_seatInterface->setHasKeyboard(true); // create a second Wayland client connection to use it for setSelection auto c = new ConnectionThread; @@ -1925,8 +1819,8 @@ registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - QScopedPointer seat(registry->createSeat(registry->interface(Registry::Interface::Seat).name, - registry->interface(Registry::Interface::Seat).version)); + QScopedPointer seat( + registry->createSeat(registry->interface(Registry::Interface::Seat).name, registry->interface(Registry::Interface::Seat).version)); QVERIFY(seat->isValid()); QScopedPointer ddm1(registry->createDataDeviceManager(registry->interface(Registry::Interface::DataDeviceManager).name, registry->interface(Registry::Interface::DataDeviceManager).version)); @@ -1935,9 +1829,9 @@ // now create our first datadevice QScopedPointer dd1(ddm1->getDataDevice(seat.data())); QVERIFY(ddiCreatedSpy.wait()); - auto ddi = ddiCreatedSpy.first().first().value(); + auto ddi = ddiCreatedSpy.first().first().value(); QVERIFY(ddi); - m_seatInterface->setSelection((AbstractDataSource*)ddi->selection()); + m_seatInterface->setSelection(ddi->selection()); // switch to other client // create a surface and pass it keyboard focus @@ -1946,7 +1840,7 @@ QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); m_seatInterface->setFocusedKeyboardSurface(serverSurface); QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface); @@ -1960,8 +1854,8 @@ registry2.setup(); QVERIFY(dataDeviceManagerSpy.wait()); - QScopedPointer ddm(registry2.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), - dataDeviceManagerSpy.first().last().value())); + QScopedPointer ddm( + registry2.createDataDeviceManager(dataDeviceManagerSpy.first().first().value(), dataDeviceManagerSpy.first().last().value())); QVERIFY(ddm->isValid()); QScopedPointer dd(ddm->getDataDevice(m_seat)); @@ -1987,55 +1881,52 @@ void TestWaylandSeat::testTouch() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QSignalSpy touchSpy(m_seat, SIGNAL(hasTouchChanged(bool))); + QSignalSpy touchSpy(m_seat, &KWayland::Client::Seat::hasTouchChanged); QVERIFY(touchSpy.isValid()); m_seatInterface->setHasTouch(true); QVERIFY(touchSpy.wait()); // create the surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); Surface *s = m_compositor->createSurface(m_compositor); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); m_seatInterface->setFocusedTouchSurface(serverSurface); // no keyboard yet QCOMPARE(m_seatInterface->focusedTouchSurface(), serverSurface); - QVERIFY(!m_seatInterface->focusedTouch()); - QSignalSpy touchCreatedSpy(m_seatInterface, SIGNAL(touchCreated(KWayland::Server::TouchInterface*))); - QVERIFY(touchCreatedSpy.isValid()); Touch *touch = m_seat->createTouch(m_seat); QVERIFY(touch->isValid()); - QVERIFY(touchCreatedSpy.wait()); - auto serverTouch = m_seatInterface->focusedTouch(); - QVERIFY(serverTouch); - QCOMPARE(touchCreatedSpy.first().first().value(), m_seatInterface->focusedTouch()); - QSignalSpy sequenceStartedSpy(touch, SIGNAL(sequenceStarted(KWayland::Client::TouchPoint*))); + // Process wl_touch bind request. + wl_display_flush(m_connection->display()); + QCoreApplication::processEvents(); + + QSignalSpy sequenceStartedSpy(touch, &KWayland::Client::Touch::sequenceStarted); QVERIFY(sequenceStartedSpy.isValid()); - QSignalSpy sequenceEndedSpy(touch, SIGNAL(sequenceEnded())); + QSignalSpy sequenceEndedSpy(touch, &KWayland::Client::Touch::sequenceEnded); QVERIFY(sequenceEndedSpy.isValid()); - QSignalSpy sequenceCanceledSpy(touch, SIGNAL(sequenceCanceled())); + QSignalSpy sequenceCanceledSpy(touch, &KWayland::Client::Touch::sequenceCanceled); QVERIFY(sequenceCanceledSpy.isValid()); - QSignalSpy frameEndedSpy(touch, SIGNAL(frameEnded())); + QSignalSpy frameEndedSpy(touch, &KWayland::Client::Touch::frameEnded); QVERIFY(frameEndedSpy.isValid()); - QSignalSpy pointAddedSpy(touch, SIGNAL(pointAdded(KWayland::Client::TouchPoint*))); + QSignalSpy pointAddedSpy(touch, &KWayland::Client::Touch::pointAdded); QVERIFY(pointAddedSpy.isValid()); - QSignalSpy pointMovedSpy(touch, SIGNAL(pointMoved(KWayland::Client::TouchPoint*))); + QSignalSpy pointMovedSpy(touch, &KWayland::Client::Touch::pointMoved); QVERIFY(pointMovedSpy.isValid()); - QSignalSpy pointRemovedSpy(touch, SIGNAL(pointRemoved(KWayland::Client::TouchPoint*))); + QSignalSpy pointRemovedSpy(touch, &KWayland::Client::Touch::pointRemoved); QVERIFY(pointRemovedSpy.isValid()); // try a few things m_seatInterface->setFocusedTouchSurfacePosition(QPointF(10, 20)); QCOMPARE(m_seatInterface->focusedTouchSurfacePosition(), QPointF(10, 20)); m_seatInterface->setTimestamp(1); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 0); + m_seatInterface->notifyTouchDown(0, QPointF(15, 26)); QVERIFY(sequenceStartedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(sequenceEndedSpy.count(), 0); @@ -2044,7 +1935,7 @@ QCOMPARE(pointAddedSpy.count(), 0); QCOMPARE(pointMovedSpy.count(), 0); QCOMPARE(pointRemovedSpy.count(), 0); - TouchPoint *tp = sequenceStartedSpy.first().first().value(); + TouchPoint *tp = sequenceStartedSpy.first().first().value(); QVERIFY(tp); QCOMPARE(tp->downSerial(), m_seatInterface->display()->serial()); QCOMPARE(tp->id(), 0); @@ -2059,14 +1950,14 @@ QCOMPARE(touch->sequence().first(), tp); // let's end the frame - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchFrame(); QVERIFY(frameEndedSpy.wait()); QCOMPARE(frameEndedSpy.count(), 1); // move the one point m_seatInterface->setTimestamp(2); - m_seatInterface->touchMove(0, QPointF(10, 20)); - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchMotion(0, QPointF(10, 20)); + m_seatInterface->notifyTouchFrame(); QVERIFY(frameEndedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(sequenceEndedSpy.count(), 0); @@ -2075,7 +1966,7 @@ QCOMPARE(pointAddedSpy.count(), 0); QCOMPARE(pointMovedSpy.count(), 1); QCOMPARE(pointRemovedSpy.count(), 0); - QCOMPARE(pointMovedSpy.first().first().value(), tp); + QCOMPARE(pointMovedSpy.first().first().value(), tp); QCOMPARE(tp->id(), 0); QVERIFY(tp->isDown()); @@ -2088,8 +1979,8 @@ // add onther point m_seatInterface->setTimestamp(3); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 1); - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchDown(1, QPointF(15, 26)); + m_seatInterface->notifyTouchFrame(); QVERIFY(frameEndedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(sequenceEndedSpy.count(), 0); @@ -2100,7 +1991,7 @@ QCOMPARE(pointRemovedSpy.count(), 0); QCOMPARE(touch->sequence().count(), 2); QCOMPARE(touch->sequence().first(), tp); - TouchPoint *tp2 = pointAddedSpy.first().first().value(); + TouchPoint *tp2 = pointAddedSpy.first().first().value(); QVERIFY(tp2); QCOMPARE(touch->sequence().last(), tp2); QCOMPARE(tp2->id(), 1); @@ -2114,8 +2005,8 @@ // send it an up m_seatInterface->setTimestamp(4); - m_seatInterface->touchUp(1); - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchUp(1); + m_seatInterface->notifyTouchFrame(); QVERIFY(frameEndedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(sequenceEndedSpy.count(), 0); @@ -2124,7 +2015,7 @@ QCOMPARE(pointAddedSpy.count(), 1); QCOMPARE(pointMovedSpy.count(), 1); QCOMPARE(pointRemovedSpy.count(), 1); - QCOMPARE(pointRemovedSpy.first().first().value(), tp2); + QCOMPARE(pointRemovedSpy.first().first().value(), tp2); QCOMPARE(tp2->id(), 1); QVERIFY(!tp2->isDown()); QCOMPARE(tp2->position(), QPointF(5, 6)); @@ -2136,13 +2027,13 @@ // send another down and up m_seatInterface->setTimestamp(5); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 1); - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchDown(1, QPointF(15, 26)); + m_seatInterface->notifyTouchFrame(); m_seatInterface->setTimestamp(6); - m_seatInterface->touchUp(1); + m_seatInterface->notifyTouchUp(1); // and send an up for the first point - m_seatInterface->touchUp(0); - m_seatInterface->touchFrame(); + m_seatInterface->notifyTouchUp(0); + m_seatInterface->notifyTouchFrame(); QVERIFY(frameEndedSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 1); QCOMPARE(sequenceEndedSpy.count(), 1); @@ -2160,9 +2051,9 @@ // try cancel m_seatInterface->setFocusedTouchSurface(serverSurface, QPointF(15, 26)); m_seatInterface->setTimestamp(7); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 0); - m_seatInterface->touchFrame(); - m_seatInterface->cancelTouchSequence(); + m_seatInterface->notifyTouchDown(0, QPointF(15, 26)); + m_seatInterface->notifyTouchFrame(); + m_seatInterface->notifyTouchCancel(); QVERIFY(sequenceCanceledSpy.wait()); QCOMPARE(sequenceStartedSpy.count(), 2); QCOMPARE(sequenceEndedSpy.count(), 1); @@ -2172,140 +2063,56 @@ QCOMPARE(pointMovedSpy.count(), 1); QCOMPARE(pointRemovedSpy.count(), 3); QCOMPARE(touch->sequence().first()->position(), QPointF(0, 0)); - - // destroy touch on client side - QSignalSpy unboundSpy(serverTouch, &TouchInterface::unbound); - QVERIFY(unboundSpy.isValid()); - QSignalSpy destroyedSpy(serverTouch, &TouchInterface::destroyed); - QVERIFY(destroyedSpy.isValid()); - delete touch; - QVERIFY(unboundSpy.wait()); - QCOMPARE(unboundSpy.count(), 1); - QCOMPARE(destroyedSpy.count(), 0); - QVERIFY(!serverTouch->resource()); - // try to call into all the methods of the touch interface, should not crash - QCOMPARE(m_seatInterface->focusedTouch(), serverTouch); - m_seatInterface->setTimestamp(8); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 0); - m_seatInterface->touchFrame(); - m_seatInterface->touchMove(0, QPointF(0, 0)); - QCOMPARE(m_seatInterface->touchDown(QPointF(15, 26)), 1); - m_seatInterface->cancelTouchSequence(); - QVERIFY(destroyedSpy.wait()); - QCOMPARE(destroyedSpy.count(), 1); - // should have unset the focused touch - QVERIFY(!m_seatInterface->focusedTouch()); - // but not the focused touch surface - QCOMPARE(m_seatInterface->focusedTouchSurface(), serverSurface); } -void TestWaylandSeat::testDisconnect() +void TestWaylandSeat::testKeymap() { - // this test verifies that disconnecting the client cleans up correctly using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy keyboardCreatedSpy(m_seatInterface, &SeatInterface::keyboardCreated); - QVERIFY(keyboardCreatedSpy.isValid()); - QSignalSpy pointerCreatedSpy(m_seatInterface, &SeatInterface::pointerCreated); - QVERIFY(pointerCreatedSpy.isValid()); - QSignalSpy touchCreatedSpy(m_seatInterface, &SeatInterface::touchCreated); - QVERIFY(touchCreatedSpy.isValid()); + using namespace KWaylandServer; - // create the things we need m_seatInterface->setHasKeyboard(true); - m_seatInterface->setHasPointer(true); - m_seatInterface->setHasTouch(true); - QSignalSpy touchSpy(m_seat, &Seat::hasTouchChanged); - QVERIFY(touchSpy.isValid()); - QVERIFY(touchSpy.wait()); + QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged); + QVERIFY(keyboardChangedSpy.isValid()); + QVERIFY(keyboardChangedSpy.wait()); QScopedPointer keyboard(m_seat->createKeyboard()); - QVERIFY(!keyboard.isNull()); - QVERIFY(keyboardCreatedSpy.wait()); - auto serverKeyboard = keyboardCreatedSpy.first().first().value(); - QVERIFY(serverKeyboard); - - QScopedPointer pointer(m_seat->createPointer()); - QVERIFY(!pointer.isNull()); - QVERIFY(pointerCreatedSpy.wait()); - auto serverPointer = pointerCreatedSpy.first().first().value(); - QVERIFY(serverPointer); - - QScopedPointer touch(m_seat->createTouch()); - QVERIFY(!touch.isNull()); - QVERIFY(touchCreatedSpy.wait()); - auto serverTouch = touchCreatedSpy.first().first().value(); - QVERIFY(serverTouch); - - // setup destroys - QSignalSpy keyboardDestroyedSpy(serverKeyboard, &QObject::destroyed); - QVERIFY(keyboardDestroyedSpy.isValid()); - QSignalSpy pointerDestroyedSpy(serverPointer, &QObject::destroyed); - QVERIFY(pointerDestroyedSpy.isValid()); - QSignalSpy touchDestroyedSpy(serverTouch, &QObject::destroyed); - QVERIFY(touchDestroyedSpy.isValid()); - QSignalSpy clientDisconnectedSpy(serverKeyboard->client(), &ClientConnection::disconnected); - QVERIFY(clientDisconnectedSpy.isValid()); - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - QVERIFY(clientDisconnectedSpy.wait()); - QCOMPARE(clientDisconnectedSpy.count(), 1); - QCOMPARE(keyboardDestroyedSpy.count(), 0); - QCOMPARE(pointerDestroyedSpy.count(), 0); - QCOMPARE(touchDestroyedSpy.count(), 0); - QVERIFY(keyboardDestroyedSpy.wait()); - QCOMPARE(keyboardDestroyedSpy.count(), 1); - QCOMPARE(pointerDestroyedSpy.count(), 1); - QCOMPARE(touchDestroyedSpy.count(), 1); - - keyboard->destroy(); - pointer->destroy(); - touch->destroy(); - m_relativePointerManager->destroy(); - m_pointerGestures->destroy(); - m_compositor->destroy(); - m_seat->destroy(); - m_shm->destroy(); - m_subCompositor->destroy(); - m_queue->destroy(); -} - -void TestWaylandSeat::testPointerEnterOnUnboundSurface() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - - // create the things we need - m_seatInterface->setHasKeyboard(true); - m_seatInterface->setHasPointer(true); - m_seatInterface->setHasTouch(true); - QSignalSpy pointerChangedSpy(m_seat, &Seat::hasPointerChanged); - QVERIFY(pointerChangedSpy.isValid()); - QVERIFY(pointerChangedSpy.wait()); - - // create pointer and Surface - QScopedPointer pointer(m_seat->createPointer()); - QVERIFY(!pointer.isNull()); - // create the surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); + // create surface + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - QScopedPointer s(m_compositor->createSurface()); + QScopedPointer surface(m_compositor->createSurface()); + QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); - QVERIFY(serverSurface); + auto serverSurface = surfaceCreatedSpy.first().first().value(); + QVERIFY(!m_seatInterface->selection()); + m_seatInterface->setFocusedKeyboardSurface(serverSurface); - // unbind the surface again - QSignalSpy surfaceUnboundSpy(serverSurface, &SurfaceInterface::unbound); - QVERIFY(surfaceUnboundSpy.isValid()); - s.reset(); - QVERIFY(surfaceUnboundSpy.wait()); - QSignalSpy clientErrorSpy(m_connection, &ConnectionThread::errorOccurred); - QVERIFY(clientErrorSpy.isValid()); - m_seatInterface->setFocusedPointerSurface(serverSurface); - QVERIFY(!clientErrorSpy.wait(100)); + QSignalSpy keymapChangedSpy(keyboard.data(), &Keyboard::keymapChanged); + QVERIFY(keymapChangedSpy.isValid()); + + m_seatInterface->keyboard()->setKeymap(QByteArrayLiteral("foo")); + QVERIFY(keymapChangedSpy.wait()); + int fd = keymapChangedSpy.first().first().toInt(); + QVERIFY(fd != -1); + QCOMPARE(keymapChangedSpy.first().last().value(), 3u); + QFile file; + QVERIFY(file.open(fd, QIODevice::ReadOnly)); + const char *address = reinterpret_cast(file.map(0, keymapChangedSpy.first().last().value())); + QVERIFY(address); + QCOMPARE(qstrcmp(address, "foo"), 0); + file.close(); + + // change the keymap + keymapChangedSpy.clear(); + m_seatInterface->keyboard()->setKeymap(QByteArrayLiteral("bar")); + QVERIFY(keymapChangedSpy.wait()); + fd = keymapChangedSpy.first().first().toInt(); + QVERIFY(fd != -1); + QCOMPARE(keymapChangedSpy.first().last().value(), 3u); + QVERIFY(file.open(fd, QIODevice::ReadWrite)); + address = reinterpret_cast(file.map(0, keymapChangedSpy.first().last().value())); + QVERIFY(address); + QCOMPARE(qstrcmp(address, "bar"), 0); } QTEST_GUILESS_MAIN(TestWaylandSeat) diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_shell.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_shell.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_shell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_shell.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,922 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/compositor.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/pointer.h" -#include "../../src/client/seat.h" -#include "../../src/client/shell.h" -#include "../../src/client/surface.h" -#include "../../src/client/registry.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/shell_interface.h" -#include "../../src/server/surface_interface.h" -// Wayland -#include - -Q_DECLARE_METATYPE(Qt::Edges) - -class TestWaylandShell : public QObject -{ - Q_OBJECT -public: - explicit TestWaylandShell(QObject *parent = nullptr); -private Q_SLOTS: - void initTestCase(); - void init(); - void cleanup(); - - void testCreateMultiple(); - void testFullscreen(); - void testMaximize(); - void testToplevel(); - void testTransient_data(); - void testTransient(); - void testTransientPopup(); - void testPing(); - void testTitle(); - void testWindowClass(); - void testDestroy(); - void testCast(); - void testMove(); - void testResize_data(); - void testResize(); - void testDisconnect(); - void testWhileDestroying(); - void testClientDisconnecting(); - -private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::ShellInterface *m_shellInterface; - KWayland::Server::SeatInterface *m_seatInterface; - KWayland::Client::ConnectionThread *m_connection; - KWayland::Client::Compositor *m_compositor; - KWayland::Client::Shell *m_shell; - KWayland::Client::Seat *m_seat; - KWayland::Client::Pointer *m_pointer; - KWayland::Client::EventQueue *m_queue; - QThread *m_thread; -}; - -static const QString s_socketName = QStringLiteral("kwin-test-wayland-shell-0"); - -TestWaylandShell::TestWaylandShell(QObject *parent) - : QObject(parent) - , m_display(nullptr) - , m_compositorInterface(nullptr) - , m_shellInterface(nullptr) - , m_seatInterface(nullptr) - , m_connection(nullptr) - , m_compositor(nullptr) - , m_shell(nullptr) - , m_seat(nullptr) - , m_pointer(nullptr) - , m_queue(nullptr) - , m_thread(nullptr) -{ -} - -void TestWaylandShell::initTestCase() -{ - qRegisterMetaType(); -} - -void TestWaylandShell::init() -{ - using namespace KWayland::Server; - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - - m_compositorInterface = m_display->createCompositor(m_display); - QVERIFY(m_compositorInterface); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - m_shellInterface = m_display->createShell(m_display); - QVERIFY(m_shellInterface); - m_shellInterface->create(); - QVERIFY(m_shellInterface->isValid()); - - m_seatInterface = m_display->createSeat(m_display); - QVERIFY(m_seatInterface); - m_seatInterface->setHasPointer(true); - m_seatInterface->create(); - QVERIFY(m_seatInterface->isValid()); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new KWayland::Client::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); - - using namespace KWayland::Client; - KWayland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QSignalSpy shellSpy(®istry, SIGNAL(shellAnnounced(quint32,quint32))); - QSignalSpy seatAnnouncedSpy(®istry, &Registry::seatAnnounced); - QVERIFY(seatAnnouncedSpy.isValid()); - QVERIFY(!registry.eventQueue()); - registry.setEventQueue(m_queue); - QCOMPARE(registry.eventQueue(), m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - QVERIFY(interfacesAnnouncedSpy.wait()); - - m_compositor = new KWayland::Client::Compositor(this); - m_compositor->setup(registry.bindCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value())); - QVERIFY(m_compositor->isValid()); - - if (shellSpy.isEmpty()) { - QVERIFY(shellSpy.wait()); - } - m_shell = registry.createShell(shellSpy.first().first().value(), shellSpy.first().last().value(), this); - QVERIFY(m_shell->isValid()); - - QVERIFY(!seatAnnouncedSpy.isEmpty()); - m_seat = registry.createSeat(seatAnnouncedSpy.first().first().value(), seatAnnouncedSpy.first().last().value(), this); - QVERIFY(seatAnnouncedSpy.isValid()); - QSignalSpy hasPointerSpy(m_seat, &Seat::hasPointerChanged); - QVERIFY(hasPointerSpy.isValid()); - QVERIFY(hasPointerSpy.wait()); - QVERIFY(hasPointerSpy.first().first().toBool()); - m_pointer = m_seat->createPointer(m_seat); - QVERIFY(m_pointer->isValid()); -} - -void TestWaylandShell::cleanup() -{ - if (m_pointer) { - delete m_pointer; - m_pointer = nullptr; - } - if (m_seat) { - delete m_seat; - m_seat = nullptr; - } - if (m_shell) { - delete m_shell; - m_shell = nullptr; - } - if (m_compositor) { - delete m_compositor; - m_compositor = nullptr; - } - if (m_queue) { - delete m_queue; - m_queue = nullptr; - } - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - - delete m_seatInterface; - m_seatInterface = nullptr; - - delete m_shellInterface; - m_shellInterface = nullptr; - - delete m_compositorInterface; - m_compositorInterface = nullptr; - - delete m_display; - m_display = nullptr; -} - -void TestWaylandShell::testCreateMultiple() -{ - using namespace KWayland::Server; - using namespace KWayland::Client; - - QScopedPointer s1(m_compositor->createSurface()); - QScopedPointer s2(m_compositor->createSurface()); - QVERIFY(!s1.isNull()); - QVERIFY(s1->isValid()); - QVERIFY(!s2.isNull()); - QVERIFY(s2->isValid()); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QScopedPointer surface1(m_shell->createSurface(s1.data())); - QVERIFY(!surface1.isNull()); - QVERIFY(surface1->isValid()); - QVERIFY(!ShellSurface::get(nullptr)); - QCOMPARE(ShellSurface::get(*(surface1.data())), surface1.data()); - - QVERIFY(serverSurfaceSpy.wait()); - QCOMPARE(serverSurfaceSpy.count(), 1); - - QScopedPointer surface2(m_shell->createSurface(s2.data())); - QVERIFY(!surface2.isNull()); - QVERIFY(surface2->isValid()); - QCOMPARE(ShellSurface::get(*(surface2.data())), surface2.data()); - - QVERIFY(serverSurfaceSpy.wait()); - QCOMPARE(serverSurfaceSpy.count(), 2); - - // try creating for one which already exist should not be possible - QScopedPointer surface3(m_shell->createSurface(s2.data())); - QVERIFY(!surface3.isNull()); - QVERIFY(surface3->isValid()); - QCOMPARE(ShellSurface::get(*(surface3.data())), surface3.data()); - - QVERIFY(!serverSurfaceSpy.wait(100)); - QCOMPARE(serverSurfaceSpy.count(), 2); -} - -void TestWaylandShell::testFullscreen() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize))); - QVERIFY(sizeSpy.isValid()); - QCOMPARE(surface->size(), QSize()); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QVERIFY(serverSurface->parentResource()); - QCOMPARE(serverSurface->shell(), m_shellInterface); - - QSignalSpy fullscreenSpy(serverSurface, SIGNAL(fullscreenChanged(bool))); - QVERIFY(fullscreenSpy.isValid()); - - QVERIFY(!serverSurface->isFullscreen()); - surface->setFullscreen(); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 1); - QVERIFY(fullscreenSpy.first().first().toBool()); - QVERIFY(serverSurface->isFullscreen()); - serverSurface->requestSize(QSize(1024, 768)); - - QVERIFY(sizeSpy.wait()); - QCOMPARE(sizeSpy.count(), 1); - QCOMPARE(sizeSpy.first().first().toSize(), QSize(1024, 768)); - QCOMPARE(surface->size(), QSize(1024, 768)); - - // set back to toplevel - fullscreenSpy.clear(); - wl_shell_surface_set_toplevel(*surface); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 1); - QVERIFY(!fullscreenSpy.first().first().toBool()); - QVERIFY(!serverSurface->isFullscreen()); -} - -void TestWaylandShell::testMaximize() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize))); - QVERIFY(sizeSpy.isValid()); - QCOMPARE(surface->size(), QSize()); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QVERIFY(serverSurface->parentResource()); - - QSignalSpy maximizedSpy(serverSurface, SIGNAL(maximizedChanged(bool))); - QVERIFY(maximizedSpy.isValid()); - - QVERIFY(!serverSurface->isMaximized()); - surface->setMaximized(); - QVERIFY(maximizedSpy.wait()); - QCOMPARE(maximizedSpy.count(), 1); - QVERIFY(maximizedSpy.first().first().toBool()); - QVERIFY(serverSurface->isMaximized()); - serverSurface->requestSize(QSize(1024, 768)); - - QVERIFY(sizeSpy.wait()); - QCOMPARE(sizeSpy.count(), 1); - QCOMPARE(sizeSpy.first().first().toSize(), QSize(1024, 768)); - QCOMPARE(surface->size(), QSize(1024, 768)); - - // set back to toplevel - maximizedSpy.clear(); - wl_shell_surface_set_toplevel(*surface); - QVERIFY(maximizedSpy.wait()); - QCOMPARE(maximizedSpy.count(), 1); - QVERIFY(!maximizedSpy.first().first().toBool()); - QVERIFY(!serverSurface->isMaximized()); -} - -void TestWaylandShell::testToplevel() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize))); - QVERIFY(sizeSpy.isValid()); - QCOMPARE(surface->size(), QSize()); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QVERIFY(serverSurface->parentResource()); - - QSignalSpy toplevelSpy(serverSurface, SIGNAL(toplevelChanged(bool))); - QVERIFY(toplevelSpy.isValid()); - - surface->setFullscreen(); - QVERIFY(toplevelSpy.wait()); - QCOMPARE(toplevelSpy.count(), 1); - QVERIFY(!toplevelSpy.first().first().toBool()); - toplevelSpy.clear(); - surface->setToplevel(); - QVERIFY(toplevelSpy.wait()); - QCOMPARE(toplevelSpy.count(), 1); - QVERIFY(toplevelSpy.first().first().toBool()); - serverSurface->requestSize(QSize(1024, 768)); - - QVERIFY(sizeSpy.wait()); - QCOMPARE(sizeSpy.count(), 1); - QCOMPARE(sizeSpy.first().first().toSize(), QSize(1024, 768)); - QCOMPARE(surface->size(), QSize(1024, 768)); - - // set back to fullscreen - toplevelSpy.clear(); - surface->setFullscreen(); - QVERIFY(toplevelSpy.wait()); - QCOMPARE(toplevelSpy.count(), 1); - QVERIFY(!toplevelSpy.first().first().toBool()); -} - -void TestWaylandShell::testTransient_data() -{ - QTest::addColumn("keyboardFocus"); - - QTest::newRow("focus") << true; - QTest::newRow("no focus") << false; -} - -void TestWaylandShell::testTransient() -{ - using namespace KWayland::Server; - using namespace KWayland::Client; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QSignalSpy acceptsKeyboardFocusChangedSpy(serverSurface, &ShellSurfaceInterface::acceptsKeyboardFocusChanged); - QVERIFY(acceptsKeyboardFocusChangedSpy.isValid()); - QCOMPARE(serverSurface->isToplevel(), true); - QCOMPARE(serverSurface->isPopup(), false); - QCOMPARE(serverSurface->isTransient(), false); - QCOMPARE(serverSurface->transientFor(), QPointer()); - QCOMPARE(serverSurface->transientOffset(), QPoint()); - QVERIFY(serverSurface->acceptsKeyboardFocus()); - QVERIFY(acceptsKeyboardFocusChangedSpy.isEmpty()); - - QSignalSpy transientSpy(serverSurface, &ShellSurfaceInterface::transientChanged); - QVERIFY(transientSpy.isValid()); - QSignalSpy transientOffsetSpy(serverSurface, &ShellSurfaceInterface::transientOffsetChanged); - QVERIFY(transientOffsetSpy.isValid()); - QSignalSpy transientForChangedSpy(serverSurface, &ShellSurfaceInterface::transientForChanged); - QVERIFY(transientForChangedSpy.isValid()); - - QScopedPointer s2(m_compositor->createSurface()); - m_shell->createSurface(s2.data(), m_shell); - serverSurfaceSpy.clear(); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface2 = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface2 != serverSurface); - QVERIFY(serverSurface2); - QVERIFY(serverSurface2->acceptsKeyboardFocus()); - - QFETCH(bool, keyboardFocus); - surface->setTransient(s2.data(), QPoint(10, 20), keyboardFocus ? ShellSurface::TransientFlag::Default : ShellSurface::TransientFlag::NoFocus); - QVERIFY(transientSpy.wait()); - QCOMPARE(transientSpy.count(), 1); - QCOMPARE(transientSpy.first().first().toBool(), true); - QCOMPARE(transientOffsetSpy.count(), 1); - QCOMPARE(transientOffsetSpy.first().first().toPoint(), QPoint(10, 20)); - QCOMPARE(transientForChangedSpy.count(), 1); - QCOMPARE(serverSurface->isToplevel(), true); - QCOMPARE(serverSurface->isPopup(), false); - QCOMPARE(serverSurface->isTransient(), true); - QCOMPARE(serverSurface->transientFor(), QPointer(serverSurface2->surface())); - QCOMPARE(serverSurface->transientOffset(), QPoint(10, 20)); - QCOMPARE(serverSurface->acceptsKeyboardFocus(), keyboardFocus); - QCOMPARE(acceptsKeyboardFocusChangedSpy.isEmpty(), keyboardFocus); - QCOMPARE(acceptsKeyboardFocusChangedSpy.count(), keyboardFocus ? 0 : 1); - - QCOMPARE(serverSurface2->isToplevel(), true); - QCOMPARE(serverSurface2->isPopup(), false); - QCOMPARE(serverSurface2->isTransient(), false); - QCOMPARE(serverSurface2->transientFor(), QPointer()); - QCOMPARE(serverSurface2->transientOffset(), QPoint()); - QVERIFY(serverSurface2->acceptsKeyboardFocus()); -} - -void TestWaylandShell::testTransientPopup() -{ - using namespace KWayland::Server; - using namespace KWayland::Client; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QCOMPARE(serverSurface->isToplevel(), true); - QCOMPARE(serverSurface->isPopup(), false); - QCOMPARE(serverSurface->isTransient(), false); - QCOMPARE(serverSurface->transientFor(), QPointer()); - QCOMPARE(serverSurface->transientOffset(), QPoint()); - QVERIFY(serverSurface->acceptsKeyboardFocus()); - - QSignalSpy transientSpy(serverSurface, &ShellSurfaceInterface::transientChanged); - QVERIFY(transientSpy.isValid()); - QSignalSpy transientOffsetSpy(serverSurface, &ShellSurfaceInterface::transientOffsetChanged); - QVERIFY(transientOffsetSpy.isValid()); - QSignalSpy transientForChangedSpy(serverSurface, &ShellSurfaceInterface::transientForChanged); - QVERIFY(transientForChangedSpy.isValid()); - - QScopedPointer s2(m_compositor->createSurface()); - m_shell->createSurface(s2.data(), m_shell); - serverSurfaceSpy.clear(); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface2 = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface2 != serverSurface); - QVERIFY(serverSurface2); - QVERIFY(serverSurface2->acceptsKeyboardFocus()); - - // TODO: proper serial checking - surface->setTransientPopup(s2.data(), m_seat, 1, QPoint(10, 20)); - QVERIFY(transientSpy.wait()); - QCOMPARE(transientSpy.count(), 1); - QCOMPARE(transientSpy.first().first().toBool(), true); - QCOMPARE(transientOffsetSpy.count(), 1); - QCOMPARE(transientOffsetSpy.first().first().toPoint(), QPoint(10, 20)); - QCOMPARE(transientForChangedSpy.count(), 1); - QCOMPARE(serverSurface->isToplevel(), false); - QCOMPARE(serverSurface->isPopup(), true); - QCOMPARE(serverSurface->isTransient(), true); - QCOMPARE(serverSurface->transientFor(), QPointer(serverSurface2->surface())); - QCOMPARE(serverSurface->transientOffset(), QPoint(10, 20)); - // TODO: honor the flag - QCOMPARE(serverSurface->acceptsKeyboardFocus(), false); - - QCOMPARE(serverSurface2->isToplevel(), true); - QCOMPARE(serverSurface2->isPopup(), false); - QCOMPARE(serverSurface2->isTransient(), false); - QCOMPARE(serverSurface2->transientFor(), QPointer()); - QCOMPARE(serverSurface2->transientOffset(), QPoint()); - - // send popup done - QSignalSpy popupDoneSpy(surface, &ShellSurface::popupDone); - QVERIFY(popupDoneSpy.isValid()); - serverSurface->popupDone(); - QVERIFY(popupDoneSpy.wait()); -} - -void TestWaylandShell::testPing() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - QSignalSpy pingSpy(surface, SIGNAL(pinged())); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QVERIFY(!serverSurface->isPinged()); - - QSignalSpy pingTimeoutSpy(serverSurface, SIGNAL(pingTimeout())); - QVERIFY(pingTimeoutSpy.isValid()); - QSignalSpy pongSpy(serverSurface, SIGNAL(pongReceived())); - QVERIFY(pongSpy.isValid()); - - serverSurface->ping(); - QVERIFY(serverSurface->isPinged()); - QVERIFY(pingSpy.wait()); - wl_display_flush(m_connection->display()); - - if (pongSpy.isEmpty()) { - QVERIFY(pongSpy.wait()); - } - QVERIFY(!pongSpy.isEmpty()); - QVERIFY(pingTimeoutSpy.isEmpty()); - - // evil trick - timeout of zero will make it not get the pong - serverSurface->setPingTimeout(0); - pongSpy.clear(); - pingTimeoutSpy.clear(); - serverSurface->ping(); - QTest::qWait(100); - if (pingTimeoutSpy.isEmpty()) { - QVERIFY(pingTimeoutSpy.wait()); - } - QCOMPARE(pingTimeoutSpy.count(), 1); - QVERIFY(pongSpy.isEmpty()); -} - -void TestWaylandShell::testTitle() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - - QSignalSpy titleSpy(serverSurface, SIGNAL(titleChanged(QString))); - QVERIFY(titleSpy.isValid()); - QString testTitle = QStringLiteral("fooBar"); - QVERIFY(serverSurface->title().isNull()); - - wl_shell_surface_set_title(*(const KWayland::Client::ShellSurface *)surface, testTitle.toUtf8().constData()); - QVERIFY(titleSpy.wait()); - QCOMPARE(serverSurface->title(), testTitle); - QCOMPARE(titleSpy.first().first().toString(), testTitle); -} - -void TestWaylandShell::testWindowClass() -{ - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - KWayland::Client::ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, SIGNAL(surfaceCreated(KWayland::Server::ShellSurfaceInterface*))); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - - QSignalSpy windowClassSpy(serverSurface, SIGNAL(windowClassChanged(QByteArray))); - QVERIFY(windowClassSpy.isValid()); - QByteArray testClass = QByteArrayLiteral("fooBar"); - QVERIFY(serverSurface->windowClass().isNull()); - - wl_shell_surface_set_class(*surface, testClass.constData()); - QVERIFY(windowClassSpy.wait()); - QCOMPARE(serverSurface->windowClass(), testClass); - QCOMPARE(windowClassSpy.first().first().toByteArray(), testClass); - - // try setting it to same should not trigger the signal - wl_shell_surface_set_class(*surface, testClass.constData()); - QVERIFY(!windowClassSpy.wait(100)); -} - -void TestWaylandShell::testDestroy() -{ - using namespace KWayland::Client; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - QVERIFY(surface->isValid()); - - connect(m_connection, &ConnectionThread::connectionDied, m_shell, &Shell::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_pointer, &Pointer::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_seat, &Seat::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, s.data(), &Surface::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - m_compositorInterface = nullptr; - m_shellInterface = nullptr; - m_seatInterface = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - QVERIFY(!m_shell->isValid()); - QVERIFY(!surface->isValid()); - - m_shell->destroy(); - surface->destroy(); -} - -void TestWaylandShell::testCast() -{ - using namespace KWayland::Client; - Registry registry; - QSignalSpy shellSpy(®istry, SIGNAL(shellAnnounced(quint32,quint32))); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - QVERIFY(shellSpy.wait()); - - Shell s; - auto wlShell = registry.bindShell(shellSpy.first().first().value(), shellSpy.first().last().value()); - m_queue->addProxy(wlShell); - QVERIFY(wlShell); - QVERIFY(!s.isValid()); - s.setup(wlShell); - QVERIFY(s.isValid()); - QCOMPARE((wl_shell*)s, wlShell); - - const Shell &s2(s); - QCOMPARE((wl_shell*)s2, wlShell); -} - -void TestWaylandShell::testMove() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QSignalSpy moveRequestedSpy(serverSurface, &ShellSurfaceInterface::moveRequested); - QVERIFY(moveRequestedSpy.isValid()); - - QSignalSpy pointerButtonChangedSpy(m_pointer, &Pointer::buttonStateChanged); - QVERIFY(pointerButtonChangedSpy.isValid()); - - m_seatInterface->setFocusedPointerSurface(serverSurface->surface()); - m_seatInterface->pointerButtonPressed(Qt::LeftButton); - QVERIFY(pointerButtonChangedSpy.wait()); - - surface->requestMove(m_seat, pointerButtonChangedSpy.first().first().value()); - QVERIFY(moveRequestedSpy.wait()); - QCOMPARE(moveRequestedSpy.count(), 1); - QCOMPARE(moveRequestedSpy.first().at(0).value(), m_seatInterface); - QCOMPARE(moveRequestedSpy.first().at(1).value(), m_seatInterface->pointerButtonSerial(Qt::LeftButton)); -} - -void TestWaylandShell::testResize_data() -{ - QTest::addColumn("resizeEdge"); - QTest::addColumn("expectedEdge"); - - QTest::newRow("None") << Qt::Edges() << Qt::Edges(); - - QTest::newRow("Top") << Qt::Edges(Qt::TopEdge) << Qt::Edges(Qt::TopEdge); - QTest::newRow("Bottom") << Qt::Edges(Qt::BottomEdge) << Qt::Edges(Qt::BottomEdge); - QTest::newRow("Left") << Qt::Edges(Qt::LeftEdge) << Qt::Edges(Qt::LeftEdge); - QTest::newRow("Right") << Qt::Edges(Qt::RightEdge) << Qt::Edges(Qt::RightEdge); - - QTest::newRow("Top Left") << Qt::Edges(Qt::TopEdge | Qt::LeftEdge) << Qt::Edges(Qt::TopEdge | Qt::LeftEdge); - QTest::newRow("Top Right") << Qt::Edges(Qt::TopEdge | Qt::RightEdge) << Qt::Edges(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("Bottom Left") << Qt::Edges(Qt::BottomEdge | Qt::LeftEdge) << Qt::Edges(Qt::BottomEdge | Qt::LeftEdge); - QTest::newRow("Bottom Right") << Qt::Edges(Qt::BottomEdge | Qt::RightEdge) << Qt::Edges(Qt::BottomEdge | Qt::RightEdge); - - // invalid combinations - QTest::newRow("Top Bottom") << Qt::Edges(Qt::TopEdge | Qt::BottomEdge) << Qt::Edges(); - QTest::newRow("Left Right") << Qt::Edges(Qt::RightEdge | Qt::LeftEdge) << Qt::Edges(); - QTest::newRow("Top Bottom Right") << Qt::Edges(Qt::TopEdge | Qt::BottomEdge | Qt::RightEdge) << Qt::Edges(); - QTest::newRow("Top Bottom Left") << Qt::Edges(Qt::TopEdge | Qt::BottomEdge | Qt::LeftEdge) << Qt::Edges(); - QTest::newRow("Left Right Top") << Qt::Edges(Qt::RightEdge | Qt::LeftEdge | Qt::TopEdge) << Qt::Edges(); - QTest::newRow("Left Right Bottom") << Qt::Edges(Qt::RightEdge | Qt::LeftEdge | Qt::BottomEdge) << Qt::Edges(); - QTest::newRow("All") << Qt::Edges(Qt::RightEdge | Qt::LeftEdge | Qt::BottomEdge | Qt::TopEdge) << Qt::Edges(); -} - -void TestWaylandShell::testResize() -{ - using namespace KWayland::Client; - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - ShellSurface *surface = m_shell->createSurface(s.data(), m_shell); - - QSignalSpy serverSurfaceSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - QSignalSpy resizeRequestedSpy(serverSurface, &ShellSurfaceInterface::resizeRequested); - QVERIFY(resizeRequestedSpy.isValid()); - - QSignalSpy pointerButtonChangedSpy(m_pointer, &Pointer::buttonStateChanged); - QVERIFY(pointerButtonChangedSpy.isValid()); - - m_seatInterface->setFocusedPointerSurface(serverSurface->surface()); - m_seatInterface->pointerButtonPressed(Qt::LeftButton); - QVERIFY(pointerButtonChangedSpy.wait()); - - QFETCH(Qt::Edges, resizeEdge); - surface->requestResize(m_seat, pointerButtonChangedSpy.first().first().value(), resizeEdge); - QVERIFY(resizeRequestedSpy.wait()); - QCOMPARE(resizeRequestedSpy.count(), 1); - QCOMPARE(resizeRequestedSpy.first().at(0).value(), m_seatInterface); - QCOMPARE(resizeRequestedSpy.first().at(1).value(), m_seatInterface->pointerButtonSerial(Qt::LeftButton)); - QTEST(resizeRequestedSpy.first().at(2).value(), "expectedEdge"); -} - -void TestWaylandShell::testDisconnect() -{ - // this test verifies that the server side correctly tears down the resources when the client disconnects - using namespace KWayland::Client; - using namespace KWayland::Server; - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(!s.isNull()); - QVERIFY(s->isValid()); - QScopedPointer surface(m_shell->createSurface(s.data(), m_shell)); - QSignalSpy serverSurfaceSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(serverSurfaceSpy.isValid()); - QVERIFY(serverSurfaceSpy.wait()); - ShellSurfaceInterface *serverSurface = serverSurfaceSpy.first().first().value(); - QVERIFY(serverSurface); - - // destroy client - QSignalSpy clientDisconnectedSpy(serverSurface->client(), &ClientConnection::disconnected); - QVERIFY(clientDisconnectedSpy.isValid()); - QSignalSpy shellSurfaceDestroyedSpy(serverSurface, &QObject::destroyed); - QVERIFY(shellSurfaceDestroyedSpy.isValid()); - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - QVERIFY(clientDisconnectedSpy.wait()); - QCOMPARE(clientDisconnectedSpy.count(), 1); - QCOMPARE(shellSurfaceDestroyedSpy.count(), 0); - // it's already unbound, but the shell surface is not yet destroyed - QVERIFY(!serverSurface->resource()); - // ensure we don't crash when accessing it in this state - serverSurface->ping(); - serverSurface->requestSize(QSize(1, 2)); - QVERIFY(shellSurfaceDestroyedSpy.wait()); - QCOMPARE(shellSurfaceDestroyedSpy.count(), 1); - - s->destroy(); - surface->destroy(); - m_shell->destroy(); - m_compositor->destroy(); - m_pointer->destroy(); - m_seat->destroy(); - m_queue->destroy(); -} - -void TestWaylandShell::testWhileDestroying() -{ - // this test tries to hit a condition that a Surface gets created with an ID which was already - // used for a previous Surface. For each Surface we try to create a ShellSurface. - // Even if there was a Surface in the past with the same ID, it should create the ShellSurface - using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - QVERIFY(surfaceCreatedSpy.isValid()); - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); - QVERIFY(serverSurface); - - // create ShellSurface - QSignalSpy shellSurfaceCreatedSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(shellSurfaceCreatedSpy.isValid()); - QScopedPointer ps(m_shell->createSurface(s.data())); - QVERIFY(shellSurfaceCreatedSpy.wait()); - - // now try to create more surfaces - QSignalSpy clientErrorSpy(m_connection, &ConnectionThread::errorOccurred); - QVERIFY(clientErrorSpy.isValid()); - for (int i = 0; i < 100; i++) { - s.reset(); - ps.reset(); - s.reset(m_compositor->createSurface()); - ps.reset(m_shell->createSurface(s.data())); - QVERIFY(surfaceCreatedSpy.wait()); - } - QVERIFY(clientErrorSpy.isEmpty()); - QVERIFY(!clientErrorSpy.wait(100)); - QVERIFY(clientErrorSpy.isEmpty()); -} - -void TestWaylandShell::testClientDisconnecting() -{ - // this test tries to request a new surface size while the client is actually already destroyed - // see BUG: 370232 - using namespace KWayland::Client; - using namespace KWayland::Server; - // create ShellSurface - QScopedPointer s(m_compositor->createSurface()); - QSignalSpy shellSurfaceCreatedSpy(m_shellInterface, &ShellInterface::surfaceCreated); - QVERIFY(shellSurfaceCreatedSpy.isValid()); - QScopedPointer ps(m_shell->createSurface(s.data())); - QVERIFY(shellSurfaceCreatedSpy.wait()); - - auto serverShellSurface = shellSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverShellSurface); - - QSignalSpy shellSurfaceUnboundSpy(serverShellSurface, &Resource::unbound); - QVERIFY(shellSurfaceUnboundSpy.isValid()); - - QScopedPointer s2(m_compositor->createSurface()); - QScopedPointer ps2(m_shell->createSurface(s2.data())); - QVERIFY(shellSurfaceCreatedSpy.wait()); - auto serverShellSurface2 = shellSurfaceCreatedSpy.last().first().value(); - QVERIFY(serverShellSurface2); - - connect(serverShellSurface, &Resource::unbound, this, - [serverShellSurface, serverShellSurface2] { - serverShellSurface2->requestSize(QSize(100, 200)); - } - ); - - m_connection->deleteLater(); - m_connection = nullptr; - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - - QVERIFY(shellSurfaceUnboundSpy.wait()); - - ps->destroy(); - s->destroy(); - ps2->destroy(); - s2->destroy(); - m_pointer->destroy(); - m_seat->destroy(); - m_shell->destroy(); - m_compositor->destroy(); - m_queue->destroy(); -} - -QTEST_GUILESS_MAIN(TestWaylandShell) -#include "test_wayland_shell.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_slide.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_slide.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_slide.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_slide.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,36 +1,21 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/slide_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" -#include "../../src/client/surface.h" #include "../../src/client/slide.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/slide_interface.h" +#include "../../src/client/surface.h" using namespace KWayland::Client; @@ -47,9 +32,9 @@ void testSurfaceDestroy(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::SlideManagerInterface *m_slideManagerInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::SlideManagerInterface *m_slideManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::SlideManager *m_slideManager; @@ -72,16 +57,16 @@ void TestSlide::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -110,16 +95,11 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_slideManagerInterface = m_display->createSlideManager(m_display); - m_slideManagerInterface->create(); - QVERIFY(m_slideManagerInterface->isValid()); + m_slideManagerInterface = new SlideManagerInterface(m_display, m_display); QVERIFY(slideSpy.wait()); m_slideManager = registry.createSlideManager(slideSpy.first().first().value(), slideSpy.first().last().value(), this); @@ -127,10 +107,10 @@ void TestSlide::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_slideManager) @@ -145,22 +125,23 @@ delete m_thread; m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_slideManagerInterface) CLEANUP(m_display) #undef CLEANUP + // these are the children of the display + m_compositorInterface = nullptr; + m_slideManagerInterface = nullptr; } void TestSlide::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy slideChanged(serverSurface, SIGNAL(slideOnShowHideChanged())); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy slideChanged(serverSurface, &KWaylandServer::SurfaceInterface::slideOnShowHideChanged); auto slide = m_slideManager->createSlide(surface.data(), surface.data()); slide->setLocation(KWayland::Client::Slide::Location::Top); @@ -169,7 +150,7 @@ surface->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(slideChanged.wait()); - QCOMPARE(serverSurface->slideOnShowHide()->location(), KWayland::Server::SlideInterface::Location::Top); + QCOMPARE(serverSurface->slideOnShowHide()->location(), KWaylandServer::SlideInterface::Location::Top); QCOMPARE(serverSurface->slideOnShowHide()->offset(), 15); // and destroy @@ -181,14 +162,14 @@ void TestSlide::testSurfaceDestroy() { - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); + auto serverSurface = serverSurfaceCreated.first().first().value(); QSignalSpy slideChanged(serverSurface, &SurfaceInterface::slideOnShowHideChanged); QVERIFY(slideChanged.isValid()); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_subcompositor.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_subcompositor.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_subcompositor.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_subcompositor.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -// KWin -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/registry.h" -#include "../../src/client/subcompositor.h" -#include "../../src/server/display.h" -#include "../../src/server/subcompositor_interface.h" - -class TestSubCompositor : public QObject -{ - Q_OBJECT -public: - explicit TestSubCompositor(QObject *parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - - void testDestroy(); - void testCast(); - -private: - KWayland::Server::Display *m_display; - KWayland::Server::SubCompositorInterface *m_subcompositorInterface; - KWayland::Client::ConnectionThread *m_connection; - KWayland::Client::SubCompositor *m_subCompositor; - KWayland::Client::EventQueue *m_queue; - QThread *m_thread; -}; - -static const QString s_socketName = QStringLiteral("kwayland-test-wayland-subcompositor-0"); - -TestSubCompositor::TestSubCompositor(QObject *parent) - : QObject(parent) - , m_display(nullptr) - , m_subcompositorInterface(nullptr) - , m_connection(nullptr) - , m_subCompositor(nullptr) - , m_queue(nullptr) - , m_thread(nullptr) -{ -} - -void TestSubCompositor::init() -{ - using namespace KWayland::Server; - delete m_display; - m_display = new Display(this); - m_display->setSocketName(s_socketName); - m_display->start(); - QVERIFY(m_display->isRunning()); - - // setup connection - m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); - m_connection->setSocketName(s_socketName); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->initConnection(); - QVERIFY(connectedSpy.wait()); - - m_queue = new KWayland::Client::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); - - KWayland::Client::Registry registry; - QSignalSpy subCompositorSpy(®istry, SIGNAL(subCompositorAnnounced(quint32,quint32))); - QVERIFY(subCompositorSpy.isValid()); - QVERIFY(!registry.eventQueue()); - registry.setEventQueue(m_queue); - QCOMPARE(registry.eventQueue(), m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - m_subcompositorInterface = m_display->createSubCompositor(m_display); - QVERIFY(m_subcompositorInterface); - m_subcompositorInterface->create(); - QVERIFY(m_subcompositorInterface->isValid()); - - QVERIFY(subCompositorSpy.wait()); - m_subCompositor = registry.createSubCompositor(subCompositorSpy.first().first().value(), subCompositorSpy.first().last().value(), this); -} - -void TestSubCompositor::cleanup() -{ - if (m_subCompositor) { - delete m_subCompositor; - m_subCompositor = nullptr; - } - if (m_queue) { - delete m_queue; - m_queue = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - delete m_connection; - m_connection = nullptr; - - delete m_display; - m_display = nullptr; -} - -void TestSubCompositor::testDestroy() -{ - using namespace KWayland::Client; - connect(m_connection, &ConnectionThread::connectionDied, m_subCompositor, &SubCompositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - QVERIFY(m_subCompositor->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the pool should be destroyed; - QVERIFY(!m_subCompositor->isValid()); - - // calling destroy again should not fail - m_subCompositor->destroy(); -} - -void TestSubCompositor::testCast() -{ - using namespace KWayland::Client; - Registry registry; - QSignalSpy subCompositorSpy(®istry, SIGNAL(subCompositorAnnounced(quint32,quint32))); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - - QVERIFY(subCompositorSpy.wait()); - - SubCompositor c; - auto wlSubComp = registry.bindSubCompositor(subCompositorSpy.first().first().value(), subCompositorSpy.first().last().value()); - c.setup(wlSubComp); - QCOMPARE((wl_subcompositor*)c, wlSubComp); - - const SubCompositor &c2(c); - QCOMPARE((wl_subcompositor*)c2, wlSubComp); -} - -QTEST_GUILESS_MAIN(TestSubCompositor) -#include "test_wayland_subcompositor.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_subsurface.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_subsurface.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_subsurface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_subsurface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,25 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/subcompositor_interface.h" +#include "../../src/server/surface_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" @@ -29,14 +19,11 @@ #include "../../src/client/subcompositor.h" #include "../../src/client/subsurface.h" #include "../../src/client/surface.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/subcompositor_interface.h" -#include "../../src/server/surface_interface.h" // Wayland #include +Q_DECLARE_METATYPE(KWayland::Client::SubSurface::Mode) + class TestSubSurface : public QObject { Q_OBJECT @@ -48,11 +35,10 @@ void testCreate(); void testMode(); + void testPosition_data(); void testPosition(); void testPlaceAbove(); void testPlaceBelow(); - void testDestroy(); - void testCast(); void testSyncMode(); void testDeSyncMode(); void testMainSurfaceFromTree(); @@ -63,9 +49,9 @@ void testDestroyParentSurface(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::SubCompositorInterface *m_subcompositorInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::SubCompositorInterface *m_subcompositorInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shm; @@ -92,17 +78,17 @@ void TestSubSurface::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -118,9 +104,9 @@ QVERIFY(m_queue->isValid()); KWayland::Client::Registry registry; - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); + QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced); QVERIFY(compositorSpy.isValid()); - QSignalSpy subCompositorSpy(®istry, SIGNAL(subCompositorAnnounced(quint32,quint32))); + QSignalSpy subCompositorSpy(®istry, &KWayland::Client::Registry::subCompositorAnnounced); QVERIFY(subCompositorSpy.isValid()); QVERIFY(!registry.eventQueue()); registry.setEventQueue(m_queue); @@ -129,14 +115,9 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - - m_subcompositorInterface = m_display->createSubCompositor(m_display); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_subcompositorInterface = new SubCompositorInterface(m_display, m_display); QVERIFY(m_subcompositorInterface); - m_subcompositorInterface->create(); - QVERIFY(m_subcompositorInterface->isValid()); QVERIFY(subCompositorSpy.wait()); m_subCompositor = registry.createSubCompositor(subCompositorSpy.first().first().value(), subCompositorSpy.first().last().value(), this); @@ -146,7 +127,9 @@ } m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_shm = registry.createShmPool(registry.interface(KWayland::Client::Registry::Interface::Shm).name, registry.interface(KWayland::Client::Registry::Interface::Shm).version, this); + m_shm = registry.createShmPool(registry.interface(KWayland::Client::Registry::Interface::Shm).name, + registry.interface(KWayland::Client::Registry::Interface::Shm).version, + this); QVERIFY(m_shm->isValid()); } @@ -184,81 +167,85 @@ void TestSubSurface::testCreate() { using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy surfaceCreatedSpy(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + using namespace KWaylandServer; + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); // create two Surfaces QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); surfaceCreatedSpy.clear(); QScopedPointer parent(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverParentSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverParentSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverParentSurface); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, SIGNAL(subSurfaceCreated(KWayland::Server::SubSurfaceInterface*))); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); QVERIFY(subSurfaceCreatedSpy.isValid()); // create subSurface for surface of parent QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface); QVERIFY(serverSubSurface->parentSurface()); - QCOMPARE(serverSubSurface->parentSurface().data(), serverParentSurface); - QCOMPARE(serverSubSurface->surface().data(), serverSurface); - QCOMPARE(serverSurface->subSurface().data(), serverSubSurface); - QCOMPARE(serverSubSurface->mainSurface().data(), serverParentSurface); + QCOMPARE(serverSubSurface->parentSurface(), serverParentSurface); + QCOMPARE(serverSubSurface->surface(), serverSurface); + QCOMPARE(serverSurface->subSurface(), serverSubSurface); + QCOMPARE(serverSubSurface->mainSurface(), serverParentSurface); // children are only added after committing the surface + QCOMPARE(serverParentSurface->below().count(), 0); QEXPECT_FAIL("", "Incorrect adding of child windows to workaround QtWayland behavior", Continue); - QCOMPARE(serverParentSurface->childSubSurfaces().count(), 0); + QCOMPARE(serverParentSurface->above().count(), 0); // so let's commit the surface, to apply the stacking change parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverParentSurface->childSubSurfaces().count(), 1); - QCOMPARE(serverParentSurface->childSubSurfaces().first().data(), serverSubSurface); + QCOMPARE(serverParentSurface->below().count(), 0); + QCOMPARE(serverParentSurface->above().count(), 1); + QCOMPARE(serverParentSurface->above().constFirst(), serverSubSurface); // and let's destroy it again - QSignalSpy destroyedSpy(serverSubSurface, SIGNAL(destroyed(QObject*))); + QSignalSpy destroyedSpy(serverSubSurface, &QObject::destroyed); QVERIFY(destroyedSpy.isValid()); subSurface.reset(); QVERIFY(destroyedSpy.wait()); QCOMPARE(serverSurface->subSurface(), QPointer()); // only applied after next commit + QCOMPARE(serverParentSurface->below().count(), 0); QEXPECT_FAIL("", "Incorrect removing of child windows to workaround QtWayland behavior", Continue); - QCOMPARE(serverParentSurface->childSubSurfaces().count(), 1); + QCOMPARE(serverParentSurface->above().count(), 1); // but the surface should be invalid - if (!serverParentSurface->childSubSurfaces().isEmpty()) { - QVERIFY(serverParentSurface->childSubSurfaces().first().isNull()); + if (!serverParentSurface->above().isEmpty()) { + QVERIFY(!serverParentSurface->above().constFirst()); } // committing the state should solve it parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverParentSurface->childSubSurfaces().count(), 0); + QCOMPARE(serverParentSurface->below().count(), 0); + QCOMPARE(serverParentSurface->above().count(), 0); } void TestSubSurface::testMode() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create two Surface QScopedPointer surface(m_compositor->createSurface()); QScopedPointer parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, SIGNAL(subSurfaceCreated(KWayland::Server::SubSurfaceInterface*))); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); QVERIFY(subSurfaceCreatedSpy.isValid()); // create the SubSurface for surface of parent QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface); // both client and server subsurface should be in synchronized mode @@ -266,14 +253,14 @@ QCOMPARE(serverSubSurface->mode(), SubSurfaceInterface::Mode::Synchronized); // verify that we can change to desynchronized - QSignalSpy modeChangedSpy(serverSubSurface, SIGNAL(modeChanged(KWayland::Server::SubSurfaceInterface::Mode))); + QSignalSpy modeChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::modeChanged); QVERIFY(modeChangedSpy.isValid()); subSurface->setMode(SubSurface::Mode::Desynchronized); QCOMPARE(subSurface->mode(), SubSurface::Mode::Desynchronized); QVERIFY(modeChangedSpy.wait()); - QCOMPARE(modeChangedSpy.first().first().value(), SubSurfaceInterface::Mode::Desynchronized); + QCOMPARE(modeChangedSpy.first().first().value(), SubSurfaceInterface::Mode::Desynchronized); QCOMPARE(serverSubSurface->mode(), SubSurfaceInterface::Mode::Desynchronized); // setting the same again won't change @@ -287,37 +274,45 @@ QVERIFY(modeChangedSpy.wait()); QCOMPARE(modeChangedSpy.count(), 2); - QCOMPARE(modeChangedSpy.first().first().value(), SubSurfaceInterface::Mode::Desynchronized); - QCOMPARE(modeChangedSpy.last().first().value(), SubSurfaceInterface::Mode::Synchronized); + QCOMPARE(modeChangedSpy.first().first().value(), SubSurfaceInterface::Mode::Desynchronized); + QCOMPARE(modeChangedSpy.last().first().value(), SubSurfaceInterface::Mode::Synchronized); QCOMPARE(serverSubSurface->mode(), SubSurfaceInterface::Mode::Synchronized); } +void TestSubSurface::testPosition_data() +{ + QTest::addColumn("commitMode"); + + QTest::addRow("sync") << KWayland::Client::SubSurface::Mode::Synchronized; + QTest::addRow("desync") << KWayland::Client::SubSurface::Mode::Desynchronized; +} + void TestSubSurface::testPosition() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create two Surface QScopedPointer surface(m_compositor->createSurface()); QScopedPointer parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, SIGNAL(subSurfaceCreated(KWayland::Server::SubSurfaceInterface*))); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); QVERIFY(subSurfaceCreatedSpy.isValid()); // create the SubSurface for surface of parent QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface); - // create a signalspy - QSignalSpy subsurfaceTreeChanged(serverSubSurface->parentSurface().data(), &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subsurfaceTreeChanged.isValid()); + // put the subsurface in the desired commit mode + QFETCH(KWayland::Client::SubSurface::Mode, commitMode); + subSurface->setMode(commitMode); // both client and server should have a default position QCOMPARE(subSurface->position(), QPoint()); QCOMPARE(serverSubSurface->position(), QPoint()); - QSignalSpy positionChangedSpy(serverSubSurface, SIGNAL(positionChanged(QPoint))); + QSignalSpy positionChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::positionChanged); QVERIFY(positionChangedSpy.isValid()); // changing the position should not trigger a direct update on server side @@ -336,159 +331,162 @@ QCOMPARE(serverSubSurface->position(), QPoint()); // committing the parent surface should update the position + QSignalSpy parentCommittedSpy(serverSubSurface->parentSurface(), &SurfaceInterface::committed); + QVERIFY(parentCommittedSpy.isValid()); parent->commit(Surface::CommitFlag::None); - QCOMPARE(subsurfaceTreeChanged.count(), 0); - QVERIFY(positionChangedSpy.wait()); + QVERIFY(parentCommittedSpy.wait()); QCOMPARE(positionChangedSpy.count(), 1); QCOMPARE(positionChangedSpy.first().first().toPoint(), QPoint(20, 30)); QCOMPARE(serverSubSurface->position(), QPoint(20, 30)); - QCOMPARE(subsurfaceTreeChanged.count(), 1); } void TestSubSurface::testPlaceAbove() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create needed Surfaces (one parent, three client QScopedPointer surface1(m_compositor->createSurface()); QScopedPointer surface2(m_compositor->createSurface()); QScopedPointer surface3(m_compositor->createSurface()); QScopedPointer parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, SIGNAL(subSurfaceCreated(KWayland::Server::SubSurfaceInterface*))); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); QVERIFY(subSurfaceCreatedSpy.isValid()); // create the SubSurfaces for surface of parent QScopedPointer subSurface1(m_subCompositor->createSubSurface(QPointer(surface1.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface1); subSurfaceCreatedSpy.clear(); QScopedPointer subSurface2(m_subCompositor->createSubSurface(QPointer(surface2.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface2); subSurfaceCreatedSpy.clear(); QScopedPointer subSurface3(m_subCompositor->createSubSurface(QPointer(surface3.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface3); subSurfaceCreatedSpy.clear(); // so far the stacking order should still be empty + QVERIFY(serverSubSurface1->parentSurface()->below().isEmpty()); QEXPECT_FAIL("", "Incorrect adding of child windows to workaround QtWayland behavior", Continue); - QVERIFY(serverSubSurface1->parentSurface()->childSubSurfaces().isEmpty()); + QVERIFY(serverSubSurface1->parentSurface()->above().isEmpty()); // committing the parent should create the stacking order parent->commit(Surface::CommitFlag::None); // ensure it's processed on server side wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 0); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface3); // raising subsurface1 should place it to top of stack - subSurface1->raise(); + subSurface1->placeAbove(subSurface3.data()); // ensure it's processed on server side wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); // but as long as parent is not committed it shouldn't change on server side - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface1); // after commit it's changed parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface1); // try placing 3 above 1, should result in 2, 1, 3 subSurface3->placeAbove(QPointer(subSurface1.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface3); // try placing 3 above 2, should result in 2, 3, 1 subSurface3->placeAbove(QPointer(subSurface2.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface1); // try placing 1 above 3 - shouldn't change subSurface1->placeAbove(QPointer(subSurface3.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface1); // and 2 above 3 - > 3, 2, 1 subSurface2->placeAbove(QPointer(subSurface3.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface1); } void TestSubSurface::testPlaceBelow() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create needed Surfaces (one parent, three client QScopedPointer surface1(m_compositor->createSurface()); QScopedPointer surface2(m_compositor->createSurface()); QScopedPointer surface3(m_compositor->createSurface()); QScopedPointer parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, SIGNAL(subSurfaceCreated(KWayland::Server::SubSurfaceInterface*))); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); QVERIFY(subSurfaceCreatedSpy.isValid()); // create the SubSurfaces for surface of parent QScopedPointer subSurface1(m_subCompositor->createSubSurface(QPointer(surface1.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface1); subSurfaceCreatedSpy.clear(); QScopedPointer subSurface2(m_subCompositor->createSubSurface(QPointer(surface2.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface2); subSurfaceCreatedSpy.clear(); QScopedPointer subSurface3(m_subCompositor->createSubSurface(QPointer(surface3.data()), QPointer(parent.data()))); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface3); subSurfaceCreatedSpy.clear(); // so far the stacking order should still be empty + QVERIFY(serverSubSurface1->parentSurface()->below().isEmpty()); QEXPECT_FAIL("", "Incorrect adding of child windows to workaround QtWayland behavior", Continue); - QVERIFY(serverSubSurface1->parentSurface()->childSubSurfaces().isEmpty()); + QVERIFY(serverSubSurface1->parentSurface()->above().isEmpty()); // committing the parent should create the stacking order parent->commit(Surface::CommitFlag::None); // ensure it's processed on server side wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(2), serverSubSurface3); // lowering subsurface3 should place it to the bottom of stack subSurface3->lower(); @@ -496,126 +494,82 @@ wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); // but as long as parent is not committed it shouldn't change on server side - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface1); // after commit it's changed parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 1); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(0), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 2); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(1), serverSubSurface2); // place 1 below 3 -> 1, 3, 2 subSurface1->placeBelow(QPointer(subSurface3.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 2); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(1), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 1); + QCOMPARE(serverSubSurface1->parentSurface()->above().at(0), serverSubSurface2); // 2 below 3 -> 1, 2, 3 subSurface2->placeBelow(QPointer(subSurface3.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(1), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(2), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 0); // 1 below 2 -> shouldn't change subSurface1->placeBelow(QPointer(subSurface2.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface2); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(0), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(1), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(2), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 0); // and 3 below 1 -> 3, 1, 2 subSurface3->placeBelow(QPointer(subSurface1.data())); parent->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().count(), 3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(0).data(), serverSubSurface3); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(1).data(), serverSubSurface1); - QCOMPARE(serverSubSurface1->parentSurface()->childSubSurfaces().at(2).data(), serverSubSurface2); -} - -void TestSubSurface::testDestroy() -{ - using namespace KWayland::Client; - - // create two Surfaces - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer parent(m_compositor->createSurface()); - // create subSurface for surface of parent - QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); - - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_subCompositor, &SubCompositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_shm, &ShmPool::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - connect(m_connection, &ConnectionThread::connectionDied, surface.data(), &Surface::destroy); - connect(m_connection, &ConnectionThread::connectionDied, parent.data(), &Surface::destroy); - connect(m_connection, &ConnectionThread::connectionDied, subSurface.data(), &SubSurface::destroy); - QVERIFY(subSurface->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - delete m_display; - m_display = nullptr; - QVERIFY(connectionDiedSpy.wait()); - - // now the pool should be destroyed; - QVERIFY(!subSurface->isValid()); - - // calling destroy again should not fail - subSurface->destroy(); -} - -void TestSubSurface::testCast() -{ - using namespace KWayland::Client; - - // create two Surfaces - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer parent(m_compositor->createSurface()); - // create subSurface for surface of parent - QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); - - QCOMPARE(SubSurface::get(*(subSurface.data())), QPointer(subSurface.data())); + QCOMPARE(serverSubSurface1->parentSurface()->below().count(), 3); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(0), serverSubSurface3); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(1), serverSubSurface1); + QCOMPARE(serverSubSurface1->parentSurface()->below().at(2), serverSubSurface2); + QCOMPARE(serverSubSurface1->parentSurface()->above().count(), 0); } void TestSubSurface::testSyncMode() { // this test verifies that state is only applied when the parent surface commits its pending state using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childSurface = surfaceCreatedSpy.first().first().value(); + auto childSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(childSurface); QScopedPointer parent(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto parentSurface = surfaceCreatedSpy.last().first().value(); + auto parentSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(parentSurface); - QSignalSpy subSurfaceTreeChangedSpy(parentSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subSurfaceTreeChangedSpy.isValid()); // create subSurface for surface of parent QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); - QVERIFY(subSurfaceTreeChangedSpy.wait()); - QCOMPARE(subSurfaceTreeChangedSpy.count(), 1); // let's damage the child surface QSignalSpy childDamagedSpy(childSurface, &SurfaceInterface::damaged); @@ -641,9 +595,6 @@ parent->commit(); QVERIFY(childDamagedSpy.wait()); QCOMPARE(childDamagedSpy.count(), 1); - QCOMPARE(subSurfaceTreeChangedSpy.count(), 2); - QCOMPARE(childSurface->buffer()->data(), image); - QCOMPARE(parentSurface->buffer()->data(), image2); QVERIFY(childSurface->isMapped()); QVERIFY(parentSurface->isMapped()); @@ -658,26 +609,22 @@ { // this test verifies that state gets applied immediately in desync mode using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childSurface = surfaceCreatedSpy.first().first().value(); + auto childSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(childSurface); QScopedPointer parent(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto parentSurface = surfaceCreatedSpy.last().first().value(); + auto parentSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(parentSurface); - QSignalSpy subSurfaceTreeChangedSpy(parentSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subSurfaceTreeChangedSpy.isValid()); // create subSurface for surface of parent QScopedPointer subSurface(m_subCompositor->createSubSurface(QPointer(surface.data()), QPointer(parent.data()))); - QVERIFY(subSurfaceTreeChangedSpy.wait()); - QCOMPARE(subSurfaceTreeChangedSpy.count(), 1); // let's damage the child surface QSignalSpy childDamagedSpy(childSurface, &SurfaceInterface::damaged); @@ -697,8 +644,6 @@ // setting to desync should apply the state directly subSurface->setMode(SubSurface::Mode::Desynchronized); QVERIFY(childDamagedSpy.wait()); - QCOMPARE(subSurfaceTreeChangedSpy.count(), 2); - QCOMPARE(childSurface->buffer()->data(), image); QVERIFY(!childSurface->isMapped()); QVERIFY(!parentSurface->isMapped()); @@ -708,138 +653,143 @@ surface->damage(QRect(0, 0, 200, 200)); surface->commit(Surface::CommitFlag::None); QVERIFY(childDamagedSpy.wait()); - QCOMPARE(subSurfaceTreeChangedSpy.count(), 3); - QCOMPARE(childSurface->buffer()->data(), image); } - void TestSubSurface::testMainSurfaceFromTree() { // this test verifies that in a tree of surfaces every surface has the same main surface using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer parentSurface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto parentServerSurface = surfaceCreatedSpy.last().first().value(); + auto parentServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(parentServerSurface); QScopedPointer childLevel1Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel1ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel1ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel1ServerSurface); QScopedPointer childLevel2Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel2ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel2ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel2ServerSurface); QScopedPointer childLevel3Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel3ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel3ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel3ServerSurface); - QSignalSpy subSurfaceTreeChangedSpy(parentServerSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subSurfaceTreeChangedSpy.isValid()); - m_subCompositor->createSubSurface(childLevel1Surface.data(), parentSurface.data()); m_subCompositor->createSubSurface(childLevel2Surface.data(), childLevel1Surface.data()); m_subCompositor->createSubSurface(childLevel3Surface.data(), childLevel2Surface.data()); + QSignalSpy parentCommittedSpy(parentServerSurface, &SurfaceInterface::committed); + QVERIFY(parentCommittedSpy.isValid()); parentSurface->commit(Surface::CommitFlag::None); - QVERIFY(subSurfaceTreeChangedSpy.wait()); + QVERIFY(parentCommittedSpy.wait()); - QCOMPARE(parentServerSurface->childSubSurfaces().count(), 1); - auto child = parentServerSurface->childSubSurfaces().first(); - QCOMPARE(child->parentSurface().data(), parentServerSurface); - QCOMPARE(child->mainSurface().data(), parentServerSurface); - QCOMPARE(child->surface()->childSubSurfaces().count(), 1); - auto child2 = child->surface()->childSubSurfaces().first(); - QCOMPARE(child2->parentSurface().data(), child->surface().data()); - QCOMPARE(child2->mainSurface().data(), parentServerSurface); - QCOMPARE(child2->surface()->childSubSurfaces().count(), 1); - auto child3 = child2->surface()->childSubSurfaces().first(); - QCOMPARE(child3->parentSurface().data(), child2->surface().data()); - QCOMPARE(child3->mainSurface().data(), parentServerSurface); - QCOMPARE(child3->surface()->childSubSurfaces().count(), 0); + QCOMPARE(parentServerSurface->below().count(), 0); + QCOMPARE(parentServerSurface->above().count(), 1); + auto child = parentServerSurface->above().constFirst(); + QCOMPARE(child->parentSurface(), parentServerSurface); + QCOMPARE(child->mainSurface(), parentServerSurface); + QCOMPARE(child->surface()->below().count(), 0); + QCOMPARE(child->surface()->above().count(), 1); + auto child2 = child->surface()->above().constFirst(); + QCOMPARE(child2->parentSurface(), child->surface()); + QCOMPARE(child2->mainSurface(), parentServerSurface); + QCOMPARE(child2->surface()->below().count(), 0); + QCOMPARE(child2->surface()->above().count(), 1); + auto child3 = child2->surface()->above().constFirst(); + QCOMPARE(child3->parentSurface(), child2->surface()); + QCOMPARE(child3->mainSurface(), parentServerSurface); + QCOMPARE(child3->surface()->below().count(), 0); + QCOMPARE(child3->surface()->above().count(), 0); } void TestSubSurface::testRemoveSurface() { // this test verifies that removing the surface also removes the sub-surface from the parent using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer parentSurface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto parentServerSurface = surfaceCreatedSpy.last().first().value(); + auto parentServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(parentServerSurface); QScopedPointer childSurface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childServerSurface = surfaceCreatedSpy.last().first().value(); + auto childServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childServerSurface); - QSignalSpy subSurfaceTreeChangedSpy(parentServerSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subSurfaceTreeChangedSpy.isValid()); + QSignalSpy childrenChangedSpy(parentServerSurface, &SurfaceInterface::childSubSurfacesChanged); + QVERIFY(childrenChangedSpy.isValid()); m_subCompositor->createSubSurface(childSurface.data(), parentSurface.data()); parentSurface->commit(Surface::CommitFlag::None); - QVERIFY(subSurfaceTreeChangedSpy.wait()); + QVERIFY(childrenChangedSpy.wait()); - QCOMPARE(parentServerSurface->childSubSurfaces().count(), 1); + QCOMPARE(parentServerSurface->below().count(), 0); + QCOMPARE(parentServerSurface->above().count(), 1); // destroy surface, takes place immediately childSurface.reset(); - QVERIFY(subSurfaceTreeChangedSpy.wait()); - QCOMPARE(parentServerSurface->childSubSurfaces().count(), 0); + QVERIFY(childrenChangedSpy.wait()); + QCOMPARE(parentServerSurface->below().count(), 0); + QCOMPARE(parentServerSurface->above().count(), 0); } void TestSubSurface::testMappingOfSurfaceTree() { // this test verifies mapping and unmapping of a sub-surface tree using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer parentSurface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto parentServerSurface = surfaceCreatedSpy.last().first().value(); + auto parentServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(parentServerSurface); QScopedPointer childLevel1Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel1ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel1ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel1ServerSurface); QScopedPointer childLevel2Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel2ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel2ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel2ServerSurface); QScopedPointer childLevel3Surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto childLevel3ServerSurface = surfaceCreatedSpy.last().first().value(); + auto childLevel3ServerSurface = surfaceCreatedSpy.last().first().value(); QVERIFY(childLevel3ServerSurface); - QSignalSpy subSurfaceTreeChangedSpy(parentServerSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(subSurfaceTreeChangedSpy.isValid()); - auto subSurfaceLevel1 = m_subCompositor->createSubSurface(childLevel1Surface.data(), parentSurface.data()); auto subSurfaceLevel2 = m_subCompositor->createSubSurface(childLevel2Surface.data(), childLevel1Surface.data()); auto subSurfaceLevel3 = m_subCompositor->createSubSurface(childLevel3Surface.data(), childLevel2Surface.data()); + QSignalSpy parentCommittedSpy(parentServerSurface, &SurfaceInterface::committed); + QVERIFY(parentCommittedSpy.isValid()); parentSurface->commit(Surface::CommitFlag::None); - QVERIFY(subSurfaceTreeChangedSpy.wait()); + QVERIFY(parentCommittedSpy.wait()); - QCOMPARE(parentServerSurface->childSubSurfaces().count(), 1); - auto child = parentServerSurface->childSubSurfaces().first(); - QCOMPARE(child->surface()->childSubSurfaces().count(), 1); - auto child2 = child->surface()->childSubSurfaces().first(); - QCOMPARE(child2->surface()->childSubSurfaces().count(), 1); - auto child3 = child2->surface()->childSubSurfaces().first(); - QCOMPARE(child3->parentSurface().data(), child2->surface().data()); - QCOMPARE(child3->mainSurface().data(), parentServerSurface); - QCOMPARE(child3->surface()->childSubSurfaces().count(), 0); + QCOMPARE(parentServerSurface->below().count(), 0); + QCOMPARE(parentServerSurface->above().count(), 1); + auto child = parentServerSurface->above().constFirst(); + QCOMPARE(child->surface()->below().count(), 0); + QCOMPARE(child->surface()->above().count(), 1); + auto child2 = child->surface()->above().constFirst(); + QCOMPARE(child2->surface()->below().count(), 0); + QCOMPARE(child2->surface()->above().count(), 1); + auto child3 = child2->surface()->above().constFirst(); + QCOMPARE(child3->parentSurface(), child2->surface()); + QCOMPARE(child3->mainSurface(), parentServerSurface); + QCOMPARE(child3->surface()->below().count(), 0); + QCOMPARE(child3->surface()->above().count(), 0); // so far no surface is mapped QVERIFY(!parentServerSurface->isMapped()); @@ -853,7 +803,7 @@ subSurfaceLevel3->setMode(SubSurface::Mode::Desynchronized); // first map the child, should not map it - QSignalSpy child3DamageSpy(child3->surface().data(), &SurfaceInterface::damaged); + QSignalSpy child3DamageSpy(child3->surface(), &SurfaceInterface::damaged); QVERIFY(child3DamageSpy.isValid()); QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied); image.fill(Qt::black); @@ -873,15 +823,12 @@ QVERIFY(parentSpy.wait()); QVERIFY(parentServerSurface->isMapped()); // children should not yet be mapped - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child->surface()->isMapped()); - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child2->surface()->isMapped()); - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child3->surface()->isMapped()); // next level - QSignalSpy child2DamageSpy(child2->surface().data(), &SurfaceInterface::damaged); + QSignalSpy child2DamageSpy(child2->surface(), &SurfaceInterface::damaged); QVERIFY(child2DamageSpy.isValid()); childLevel2Surface->attachBuffer(m_shm->createBuffer(image)); childLevel2Surface->damage(QRect(0, 0, 200, 200)); @@ -889,15 +836,12 @@ QVERIFY(child2DamageSpy.wait()); QVERIFY(parentServerSurface->isMapped()); // children should not yet be mapped - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child->surface()->isMapped()); - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child2->surface()->isMapped()); - QEXPECT_FAIL("", "Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192", Continue); QVERIFY(!child3->surface()->isMapped()); // last but not least the first child level, which should map all our subsurfaces - QSignalSpy child1DamageSpy(child->surface().data(), &SurfaceInterface::damaged); + QSignalSpy child1DamageSpy(child->surface(), &SurfaceInterface::damaged); QVERIFY(child1DamageSpy.isValid()); childLevel1Surface->attachBuffer(m_shm->createBuffer(image)); childLevel1Surface->damage(QRect(0, 0, 200, 200)); @@ -911,7 +855,7 @@ QVERIFY(child3->surface()->isMapped()); // unmapping a parent should unmap the complete tree - QSignalSpy unmappedSpy(child->surface().data(), &SurfaceInterface::unmapped); + QSignalSpy unmappedSpy(child->surface(), &SurfaceInterface::unmapped); QVERIFY(unmappedSpy.isValid()); childLevel1Surface->attachBuffer(Buffer::Ptr()); childLevel1Surface->damage(QRect(0, 0, 200, 200)); @@ -928,7 +872,7 @@ { // this test verifies that the correct surface is picked in a sub-surface tree using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // first create a parent surface and map it QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); @@ -939,17 +883,25 @@ parent->damage(QRect(0, 0, 100, 100)); parent->commit(Surface::CommitFlag::None); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *parentServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *parentServerSurface = serverSurfaceCreated.last().first().value(); - // create two child sub surfaces, those won't be mapped, just added to the parent - // this is to simulate the behavior of QtWayland + // directChild1 occupies the top-left quarter of the parent surface + QImage directImage(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); QScopedPointer directChild1(m_compositor->createSurface()); + directChild1->attachBuffer(m_shm->createBuffer(directImage)); + directChild1->damage(QRect(0, 0, 50, 50)); + directChild1->commit(Surface::CommitFlag::None); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *directChild1ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *directChild1ServerSurface = serverSurfaceCreated.last().first().value(); QVERIFY(directChild1ServerSurface); + + // directChild2 occupies the bottom-right quarter of the parent surface QScopedPointer directChild2(m_compositor->createSurface()); + directChild2->attachBuffer(m_shm->createBuffer(directImage)); + directChild2->damage(QRect(0, 0, 50, 50)); + directChild2->commit(Surface::CommitFlag::None); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *directChild2ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *directChild2ServerSurface = serverSurfaceCreated.last().first().value(); QVERIFY(directChild2ServerSurface); // create the sub surfaces for them @@ -957,14 +909,28 @@ directChild1SubSurface->setMode(SubSurface::Mode::Desynchronized); QScopedPointer directChild2SubSurface(m_subCompositor->createSubSurface(directChild2.data(), parent.data())); directChild2SubSurface->setMode(SubSurface::Mode::Desynchronized); + directChild2SubSurface->setPosition(QPoint(50, 50)); + + // unset input regions for direct children + QSignalSpy directChild1CommittedSpy(directChild1ServerSurface, &SurfaceInterface::committed); + directChild1->setInputRegion(m_compositor->createRegion(QRegion()).get()); + directChild1->commit(Surface::CommitFlag::None); + parent->commit(Surface::CommitFlag::None); + QVERIFY(directChild1CommittedSpy.wait()); + + QSignalSpy directChild2CommittedSpy(directChild2ServerSurface, &SurfaceInterface::committed); + directChild2->setInputRegion(m_compositor->createRegion(QRegion()).get()); + directChild2->commit(Surface::CommitFlag::None); + parent->commit(Surface::CommitFlag::None); + QVERIFY(directChild2CommittedSpy.wait()); // each of the children gets a child QScopedPointer childFor1(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *childFor1ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *childFor1ServerSurface = serverSurfaceCreated.last().first().value(); QScopedPointer childFor2(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *childFor2ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *childFor2ServerSurface = serverSurfaceCreated.last().first().value(); // create sub surfaces for them QScopedPointer childFor1SubSurface(m_subCompositor->createSubSurface(childFor1.data(), directChild1.data())); @@ -972,12 +938,6 @@ QScopedPointer childFor2SubSurface(m_subCompositor->createSubSurface(childFor2.data(), directChild2.data())); childFor2SubSurface->setMode(SubSurface::Mode::Desynchronized); - // both get a quarter of the grand-parent surface - childFor2SubSurface->setPosition(QPoint(50, 50)); - childFor2->commit(Surface::CommitFlag::None); - directChild2->commit(Surface::CommitFlag::None); - parent->commit(Surface::CommitFlag::None); - // now let's render both grand children QImage partImage(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); partImage.fill(Qt::green); @@ -986,23 +946,22 @@ childFor1->commit(Surface::CommitFlag::None); partImage.fill(Qt::blue); + QSignalSpy childFor2CommittedSpy(childFor2ServerSurface, &SurfaceInterface::committed); + QVERIFY(childFor2CommittedSpy.isValid()); childFor2->attachBuffer(m_shm->createBuffer(partImage)); // child for 2's input region is subdivided into quadrants, with input mask on the top left and bottom right QRegion region; - region += QRect(0,0,25,25); - region += QRect(25,25,25,25); + region += QRect(0, 0, 25, 25); + region += QRect(25, 25, 25, 25); childFor2->setInputRegion(m_compositor->createRegion(region).get()); childFor2->damage(QRect(0, 0, 50, 50)); childFor2->commit(Surface::CommitFlag::None); + QVERIFY(childFor2CommittedSpy.wait()); - QSignalSpy treeChangedSpy(parentServerSurface, &SurfaceInterface::subSurfaceTreeChanged); - QVERIFY(treeChangedSpy.isValid()); - QVERIFY(treeChangedSpy.wait()); - - QCOMPARE(directChild1ServerSurface->subSurface()->parentSurface().data(), parentServerSurface); - QCOMPARE(directChild2ServerSurface->subSurface()->parentSurface().data(), parentServerSurface); - QCOMPARE(childFor1ServerSurface->subSurface()->parentSurface().data(), directChild1ServerSurface); - QCOMPARE(childFor2ServerSurface->subSurface()->parentSurface().data(), directChild2ServerSurface); + QCOMPARE(directChild1ServerSurface->subSurface()->parentSurface(), parentServerSurface); + QCOMPARE(directChild2ServerSurface->subSurface()->parentSurface(), parentServerSurface); + QCOMPARE(childFor1ServerSurface->subSurface()->parentSurface(), directChild1ServerSurface); + QCOMPARE(childFor2ServerSurface->subSurface()->parentSurface(), directChild2ServerSurface); // now let's test a few positions QCOMPARE(parentServerSurface->surfaceAt(QPointF(0, 0)), childFor1ServerSurface); @@ -1032,7 +991,7 @@ { // this test verifies that destroying of a buffer attached to a sub-surface works using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); @@ -1040,7 +999,7 @@ QVERIFY(serverSurfaceCreated.wait()); QScopedPointer child(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); // create sub-surface m_subCompositor->createSubSurface(child.data(), parent.data()); @@ -1066,19 +1025,19 @@ // this test verifies that destroying a parent surface does not create problems // see BUG 389231 using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer parent(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverParentSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverParentSurface = serverSurfaceCreated.last().first().value(); QScopedPointer child(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); QScopedPointer grandChild(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverGrandChildSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverGrandChildSurface = serverSurfaceCreated.last().first().value(); // create sub-surface in desynchronized mode as Qt uses them auto sub1 = m_subCompositor->createSubSurface(child.data(), parent.data()); sub1->setMode(SubSurface::Mode::Desynchronized); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_surface.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_surface.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_surface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_surface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,41 +1,28 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt -#include #include #include +#include // KWin +#include "../../src/server/clientbuffer.h" +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/idleinhibit_v1_interface.h" +#include "../../src/server/shmclientbuffer.h" +#include "../../src/server/surface_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/idleinhibit.h" #include "../../src/client/output.h" -#include "../../src/client/surface.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/shm_pool.h" -#include "../../src/server/buffer_interface.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/idleinhibit_interface.h" -#include "../../src/server/surface_interface.h" +#include "../../src/client/surface.h" // Wayland #include @@ -58,9 +45,7 @@ void testOpaque(); void testInput(); void testScale(); - void testDestroy(); void testUnmapOfNotMappedSurface(); - void testDamageTracking(); void testSurfaceAt(); void testDestroyAttachedBuffer(); void testDestroyWithPendingCallback(); @@ -69,9 +54,9 @@ void testInhibit(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::IdleInhibitManagerInterface *m_idleInhibitInterface; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::IdleInhibitManagerV1Interface *m_idleInhibitInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shm; @@ -94,27 +79,23 @@ void TestWaylandSurface::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_compositorInterface = m_display->createCompositor(m_display); + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(m_compositorInterface); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - m_idleInhibitInterface = m_display->createIdleInhibitManager(IdleInhibitManagerInterfaceVersion::UnstableV1, m_display); + m_idleInhibitInterface = new IdleInhibitManagerV1Interface(m_display, m_display); QVERIFY(m_idleInhibitInterface); - m_idleInhibitInterface->create(); - QVERIFY(m_idleInhibitInterface->isValid()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -139,9 +120,9 @@ KWayland::Client::Registry registry; registry.setEventQueue(m_queue); - QSignalSpy compositorSpy(®istry, SIGNAL(compositorAnnounced(quint32,quint32))); - QSignalSpy shmSpy(®istry, SIGNAL(shmAnnounced(quint32,quint32))); - QSignalSpy allAnnounced(®istry, SIGNAL(interfacesAnnounced())); + QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced); + QSignalSpy shmSpy(®istry, &KWayland::Client::Registry::shmAnnounced); + QSignalSpy allAnnounced(®istry, &KWayland::Client::Registry::interfacesAnnounced); QVERIFY(allAnnounced.isValid()); QVERIFY(shmSpy.isValid()); registry.create(m_connection->display()); @@ -156,7 +137,9 @@ m_shm = registry.createShmPool(shmSpy.first().first().value(), shmSpy.first().last().value(), this); QVERIFY(m_shm->isValid()); - m_idleInhibitManager = registry.createIdleInhibitManager(registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).name, registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).version, this); + m_idleInhibitManager = registry.createIdleInhibitManager(registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).name, + registry.interface(Registry::Interface::IdleInhibitManagerUnstableV1).version, + this); QVERIFY(m_idleInhibitManager->isValid()); } @@ -187,23 +170,21 @@ delete m_connection; m_connection = nullptr; - delete m_compositorInterface; - m_compositorInterface = nullptr; - - delete m_idleInhibitInterface; - m_idleInhibitInterface = nullptr; - delete m_display; m_display = nullptr; + + // these are the children of the display + m_compositorInterface = nullptr; + m_idleInhibitInterface = nullptr; } void TestWaylandSurface::testStaticAccessor() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); - QVERIFY(!KWayland::Server::SurfaceInterface::get(nullptr)); - QVERIFY(!KWayland::Server::SurfaceInterface::get(1, nullptr)); + QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr)); + QVERIFY(!KWaylandServer::SurfaceInterface::get(1, nullptr)); QVERIFY(KWayland::Client::Surface::all().isEmpty()); KWayland::Client::Surface *s1 = m_compositor->createSurface(); QVERIFY(s1->isValid()); @@ -211,13 +192,13 @@ QCOMPARE(KWayland::Client::Surface::all().first(), s1); QCOMPARE(KWayland::Client::Surface::get(*s1), s1); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface1 = serverSurfaceCreated.first().first().value(); + auto serverSurface1 = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface1); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); QVERIFY(!s1->size().isValid()); - QSignalSpy sizeChangedSpy(s1, SIGNAL(sizeChanged(QSize))); + QSignalSpy sizeChangedSpy(s1, &KWayland::Client::Surface::sizeChanged); QVERIFY(sizeChangedSpy.isValid()); const QSize testSize(200, 300); s1->setSize(testSize); @@ -235,12 +216,15 @@ QCOMPARE(KWayland::Client::Surface::get(*s2), s2); serverSurfaceCreated.clear(); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface2 = serverSurfaceCreated.first().first().value(); + auto serverSurface2 = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface2); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface2->resource()), serverSurface2); - QCOMPARE(KWayland::Server::SurfaceInterface::get(serverSurface2->id(), serverSurface2->client()), serverSurface2); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface2->resource()), serverSurface2); + QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface2->id(), serverSurface2->client()), serverSurface2); + + const quint32 surfaceId1 = serverSurface1->id(); + const quint32 surfaceId2 = serverSurface2->id(); // delete s2 again delete s2; @@ -252,26 +236,28 @@ delete s1; QVERIFY(KWayland::Client::Surface::all().isEmpty()); QVERIFY(!KWayland::Client::Surface::get(nullptr)); - QSignalSpy unboundSpy(serverSurface1, &KWayland::Server::Resource::unbound); - QVERIFY(unboundSpy.isValid()); - QVERIFY(unboundSpy.wait()); - QVERIFY(!KWayland::Server::SurfaceInterface::get(nullptr)); - QVERIFY(!KWayland::Server::SurfaceInterface::get(1, nullptr)); + QSignalSpy destroyedSpy(serverSurface1, &KWaylandServer::SurfaceInterface::destroyed); + QVERIFY(destroyedSpy.isValid()); + QVERIFY(destroyedSpy.wait()); + QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr)); + QVERIFY(!KWaylandServer::SurfaceInterface::get(surfaceId1, nullptr)); + QVERIFY(!KWaylandServer::SurfaceInterface::get(surfaceId2, nullptr)); } void TestWaylandSurface::testDamage() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); KWayland::Client::Surface *s = m_compositor->createSurface(); + s->setScale(2); QVERIFY(serverSurfaceCreated.wait()); - KWayland::Server::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); QCOMPARE(serverSurface->damage(), QRegion()); - QVERIFY(serverSurface->parentResource()); QVERIFY(!serverSurface->isMapped()); - QSignalSpy damageSpy(serverSurface, SIGNAL(damaged(QRegion))); + QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); QVERIFY(damageSpy.isValid()); // send damage without a buffer @@ -282,21 +268,24 @@ QCoreApplication::processEvents(); QVERIFY(damageSpy.isEmpty()); QVERIFY(!serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 1); QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); img.fill(Qt::black); auto b = m_shm->createBuffer(img); - s->attachBuffer(b); + s->attachBuffer(b, QPoint(55, 55)); s->damage(QRect(0, 0, 10, 10)); s->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(damageSpy.wait()); - QCOMPARE(serverSurface->damage(), QRegion(0, 0, 10, 10)); - QCOMPARE(damageSpy.first().first().value(), QRegion(0, 0, 10, 10)); + QCOMPARE(serverSurface->offset(), QPoint(55, 55)); // offset is surface local so scale doesn't change this + QCOMPARE(serverSurface->damage(), QRegion(0, 0, 5, 5)); // scale is 2 + QCOMPARE(damageSpy.first().first().value(), QRegion(0, 0, 5, 5)); QVERIFY(serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 2); // damage multiple times QRegion testRegion(5, 8, 3, 6); - testRegion = testRegion.united(QRect(10, 20, 30, 15)); + testRegion = testRegion.united(QRect(10, 11, 6, 1)); img = QImage(QSize(40, 35), QImage::Format_ARGB32_Premultiplied); img.fill(Qt::black); b = m_shm->createBuffer(img); @@ -308,21 +297,55 @@ QCOMPARE(serverSurface->damage(), testRegion); QCOMPARE(damageSpy.first().first().value(), testRegion); QVERIFY(serverSurface->isMapped()); + QCOMPARE(committedSpy.count(), 3); + + // damage buffer + const QRegion testRegion2(30, 40, 22, 4); + const QRegion cmpRegion2(15, 20, 11, 2); // divided by scale factor + img = QImage(QSize(80, 70), QImage::Format_ARGB32_Premultiplied); + img.fill(Qt::black); + b = m_shm->createBuffer(img); + s->attachBuffer(b); + s->damageBuffer(testRegion2); + damageSpy.clear(); + s->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(damageSpy.wait()); + QCOMPARE(serverSurface->damage(), cmpRegion2); + QCOMPARE(damageSpy.first().first().value(), cmpRegion2); + QVERIFY(serverSurface->isMapped()); + + // combined regular damage and damaged buffer + const QRegion testRegion3 = testRegion.united(cmpRegion2); + img = QImage(QSize(80, 70), QImage::Format_ARGB32_Premultiplied); + img.fill(Qt::black); + b = m_shm->createBuffer(img); + s->attachBuffer(b); + s->damage(testRegion); + s->damageBuffer(testRegion2); + damageSpy.clear(); + s->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(damageSpy.wait()); + QVERIFY(serverSurface->damage() != testRegion); + QVERIFY(serverSurface->damage() != testRegion2); + QVERIFY(serverSurface->damage() != cmpRegion2); + QCOMPARE(serverSurface->damage(), testRegion3); + QCOMPARE(damageSpy.first().first().value(), testRegion3); + QVERIFY(serverSurface->isMapped()); } void TestWaylandSurface::testFrameCallback() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); KWayland::Client::Surface *s = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWayland::Server::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy damageSpy(serverSurface, SIGNAL(damaged(QRegion))); + QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); QVERIFY(damageSpy.isValid()); - QSignalSpy frameRenderedSpy(s, SIGNAL(frameRendered())); + QSignalSpy frameRenderedSpy(s, &KWayland::Client::Surface::frameRendered); QVERIFY(frameRenderedSpy.isValid()); QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); img.fill(Qt::black); @@ -340,24 +363,28 @@ void TestWaylandSurface::testAttachBuffer() { // create the surface - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); KWayland::Client::Surface *s = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWayland::Server::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); // create three images QImage black(24, 24, QImage::Format_RGB32); black.fill(Qt::black); - QImage red(24, 24, QImage::Format_ARGB32); //Note - deliberately not premultiplied + QImage red(24, 24, QImage::Format_ARGB32); // Note - deliberately not premultiplied red.fill(QColor(255, 0, 0, 128)); QImage blue(24, 24, QImage::Format_ARGB32_Premultiplied); blue.fill(QColor(0, 0, 255, 128)); - wl_buffer *blackBuffer = *(m_shm->createBuffer(black).data()); - auto redBuffer = m_shm->createBuffer(red); - auto blueBuffer = m_shm->createBuffer(blue).toStrongRef(); + QSharedPointer blackBufferPtr = m_shm->createBuffer(black).toStrongRef(); + QVERIFY(blackBufferPtr); + wl_buffer *blackBuffer = *(blackBufferPtr.data()); + QSharedPointer redBuffer = m_shm->createBuffer(red).toStrongRef(); + QVERIFY(redBuffer); + QSharedPointer blueBuffer = m_shm->createBuffer(blue).toStrongRef(); + QVERIFY(blueBuffer); QCOMPARE(blueBuffer->format(), KWayland::Client::Buffer::Format::ARGB32); QCOMPARE(blueBuffer->size(), blue.size()); @@ -369,19 +396,24 @@ s->attachBuffer(blackBuffer); s->damage(QRect(0, 0, 24, 24)); s->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy damageSpy(serverSurface, SIGNAL(damaged(QRegion))); + QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); QVERIFY(damageSpy.isValid()); - QSignalSpy unmappedSpy(serverSurface, SIGNAL(unmapped())); + QSignalSpy mappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::mapped); + QVERIFY(mappedSpy.isValid()); + QSignalSpy unmappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::unmapped); QVERIFY(unmappedSpy.isValid()); QVERIFY(damageSpy.wait()); + QCOMPARE(mappedSpy.count(), 1); QVERIFY(unmappedSpy.isEmpty()); // now the ServerSurface should have the black image attached as a buffer - KWayland::Server::BufferInterface *buffer = serverSurface->buffer(); + KWaylandServer::ClientBuffer *buffer = serverSurface->buffer(); buffer->ref(); - QVERIFY(buffer->shmBuffer()); - QCOMPARE(buffer->data(), black); - QCOMPARE(buffer->data().format(), QImage::Format_RGB32); + auto shmBuffer = qobject_cast(buffer); + QVERIFY(shmBuffer); + QCOMPARE(shmBuffer->data(), black); + QCOMPARE(shmBuffer->data().format(), QImage::Format_RGB32); + QCOMPARE(shmBuffer->size(), QSize(24, 24)); // render another frame s->attachBuffer(redBuffer); @@ -389,17 +421,18 @@ s->commit(KWayland::Client::Surface::CommitFlag::None); damageSpy.clear(); QVERIFY(damageSpy.wait()); + QCOMPARE(mappedSpy.count(), 1); QVERIFY(unmappedSpy.isEmpty()); - KWayland::Server::BufferInterface *buffer2 = serverSurface->buffer(); + KWaylandServer::ClientBuffer *buffer2 = serverSurface->buffer(); buffer2->ref(); - QVERIFY(buffer2->shmBuffer()); - QCOMPARE(buffer2->data().format(), QImage::Format_ARGB32_Premultiplied); - QCOMPARE(buffer2->data().width(), 24); - QCOMPARE(buffer2->data().height(), 24); + auto shmBuffer2 = qobject_cast(buffer2); + QVERIFY(shmBuffer2); + QCOMPARE(shmBuffer2->data().format(), QImage::Format_ARGB32_Premultiplied); + QCOMPARE(shmBuffer2->size(), QSize(24, 24)); for (int i = 0; i < 24; ++i) { for (int j = 0; j < 24; ++j) { // it's premultiplied in the format - QCOMPARE(buffer2->data().pixel(i, j), qRgba(128, 0, 0, 128)); + QCOMPARE(shmBuffer2->data().pixel(i, j), qRgba(128, 0, 0, 128)); } } buffer2->unref(); @@ -411,14 +444,14 @@ QVERIFY(blueBuffer->isUsed()); s->attachBuffer(blueBuffer.data()); s->damage(QRect(0, 0, 24, 24)); - QSignalSpy frameRenderedSpy(s, SIGNAL(frameRendered())); + QSignalSpy frameRenderedSpy(s, &KWayland::Client::Surface::frameRendered); QVERIFY(frameRenderedSpy.isValid()); s->commit(); damageSpy.clear(); QVERIFY(damageSpy.wait()); + QCOMPARE(mappedSpy.count(), 1); QVERIFY(unmappedSpy.isEmpty()); QVERIFY(!buffer2->isReferenced()); - delete buffer2; // TODO: we should have a signal on when the Buffer gets released QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); if (!redBuffer.data()->isReleased()) { @@ -426,16 +459,16 @@ } QVERIFY(redBuffer.data()->isReleased()); - KWayland::Server::BufferInterface *buffer3 = serverSurface->buffer(); + KWaylandServer::ClientBuffer *buffer3 = serverSurface->buffer(); buffer3->ref(); - QVERIFY(buffer3->shmBuffer()); - QCOMPARE(buffer3->data().format(), QImage::Format_ARGB32_Premultiplied); - QCOMPARE(buffer3->data().width(), 24); - QCOMPARE(buffer3->data().height(), 24); + auto shmBuffer3 = qobject_cast(buffer3); + QVERIFY(shmBuffer3); + QCOMPARE(shmBuffer3->data().format(), QImage::Format_ARGB32_Premultiplied); + QCOMPARE(shmBuffer3->size(), QSize(24, 24)); for (int i = 0; i < 24; ++i) { for (int j = 0; j < 24; ++j) { // it's premultiplied in the format - QCOMPARE(buffer3->data().pixel(i, j), qRgba(0, 0, 128, 128)); + QCOMPARE(shmBuffer3->data().pixel(i, j), qRgba(0, 0, 128, 128)); } } buffer3->unref(); @@ -446,16 +479,15 @@ // commit a different value shouldn't change our buffer QCOMPARE(serverSurface->buffer(), buffer3); - QVERIFY(serverSurface->input().isNull()); damageSpy.clear(); s->setInputRegion(m_compositor->createRegion(QRegion(0, 0, 24, 24)).get()); s->commit(KWayland::Client::Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); QCoreApplication::processEvents(); - QCOMPARE(serverSurface->input(), QRegion(0, 0, 24, 24)); QCOMPARE(serverSurface->buffer(), buffer3); QVERIFY(damageSpy.isEmpty()); + QCOMPARE(mappedSpy.count(), 1); QVERIFY(unmappedSpy.isEmpty()); QVERIFY(serverSurface->isMapped()); @@ -463,11 +495,11 @@ s->attachBuffer(blackBuffer); s->damage(QRect(0, 0, 1, 1)); // TODO: better method - s->attachBuffer((wl_buffer*)nullptr); + s->attachBuffer((wl_buffer *)nullptr); s->damage(QRect(0, 0, 10, 10)); s->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(unmappedSpy.wait()); - QVERIFY(!unmappedSpy.isEmpty()); + QCOMPARE(mappedSpy.count(), 1); QCOMPARE(unmappedSpy.count(), 1); QVERIFY(damageSpy.isEmpty()); QVERIFY(!serverSurface->isMapped()); @@ -479,9 +511,10 @@ void TestWaylandSurface::testMultipleSurfaces() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; Registry registry; - QSignalSpy shmSpy(®istry, SIGNAL(shmAnnounced(quint32,quint32))); + registry.setEventQueue(m_queue); + QSignalSpy shmSpy(®istry, &KWayland::Client::Registry::shmAnnounced); registry.create(m_connection->display()); QVERIFY(registry.isValid()); registry.setup(); @@ -495,16 +528,16 @@ QVERIFY(pool2.isValid()); // create the surfaces - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer s1(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface1 = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface1 = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface1); - //second surface + // second surface QScopedPointer s2(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface2 = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverSurface2 = serverSurfaceCreated.last().first().value(); QVERIFY(serverSurface2); QVERIFY(serverSurface1->resource() != serverSurface2->resource()); @@ -520,17 +553,17 @@ s1->attachBuffer(blackBuffer); s1->damage(QRect(0, 0, 24, 24)); s1->commit(Surface::CommitFlag::None); - QSignalSpy damageSpy1(serverSurface1, SIGNAL(damaged(QRegion))); + QSignalSpy damageSpy1(serverSurface1, &KWaylandServer::SurfaceInterface::damaged); QVERIFY(damageSpy1.isValid()); QVERIFY(damageSpy1.wait()); // now the ServerSurface should have the black image attached as a buffer - BufferInterface *buffer1 = serverSurface1->buffer(); + ClientBuffer *buffer1 = serverSurface1->buffer(); QVERIFY(buffer1); - QImage buffer1Data = buffer1->data(); + QImage buffer1Data = qobject_cast(buffer1)->data(); QCOMPARE(buffer1Data, black); // accessing the same buffer is OK - QImage buffer1Data2 = buffer1->data(); + QImage buffer1Data2 = qobject_cast(buffer1)->data(); QCOMPARE(buffer1Data2, buffer1Data); buffer1Data = QImage(); QVERIFY(buffer1Data.isNull()); @@ -541,17 +574,17 @@ s2->attachBuffer(redBuffer); s2->damage(QRect(0, 0, 24, 24)); s2->commit(Surface::CommitFlag::None); - QSignalSpy damageSpy2(serverSurface2, SIGNAL(damaged(QRegion))); + QSignalSpy damageSpy2(serverSurface2, &KWaylandServer::SurfaceInterface::damaged); QVERIFY(damageSpy2.isValid()); QVERIFY(damageSpy2.wait()); - BufferInterface *buffer2 = serverSurface2->buffer(); + ClientBuffer *buffer2 = serverSurface2->buffer(); QVERIFY(buffer2); - QImage buffer2Data = buffer2->data(); + QImage buffer2Data = qobject_cast(buffer2)->data(); QCOMPARE(buffer2Data, red); // while buffer2 is accessed we cannot access buffer1 - buffer1Data = buffer1->data(); + buffer1Data = qobject_cast(buffer1)->data(); QVERIFY(buffer1Data.isNull()); // a deep copy can be kept around @@ -562,7 +595,7 @@ QCOMPARE(deepCopy, red); // now that buffer2Data is destroyed we can access buffer1 again - buffer1Data = buffer1->data(); + buffer1Data = qobject_cast(buffer1)->data(); QVERIFY(!buffer1Data.isNull()); QCOMPARE(buffer1Data, black); } @@ -570,14 +603,14 @@ void TestWaylandSurface::testOpaque() { using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + using namespace KWaylandServer; + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); Surface *s = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy opaqueRegionChangedSpy(serverSurface, SIGNAL(opaqueChanged(QRegion))); + QSignalSpy opaqueRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::opaqueChanged); QVERIFY(opaqueRegionChangedSpy.isValid()); // by default there should be an empty opaque region @@ -625,284 +658,198 @@ void TestWaylandSurface::testInput() { using namespace KWayland::Client; - using namespace KWayland::Server; - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + using namespace KWaylandServer; + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); Surface *s = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy inputRegionChangedSpy(serverSurface, SIGNAL(inputChanged(QRegion))); + QSignalSpy inputRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::inputChanged); QVERIFY(inputRegionChangedSpy.isValid()); + QSignalSpy committedSpy(serverSurface, &SurfaceInterface::committed); + QVERIFY(committedSpy.isValid()); - // by default there should be an empty == infinite input region + // the input region should be empty if the surface has no buffer + QVERIFY(!serverSurface->isMapped()); QCOMPARE(serverSurface->input(), QRegion()); - QCOMPARE(serverSurface->inputIsInfinite(), true); + + // the default input region is infinite + QImage black(100, 50, QImage::Format_RGB32); + black.fill(Qt::black); + QSharedPointer buffer1 = m_shm->createBuffer(black).toStrongRef(); + QVERIFY(buffer1); + s->attachBuffer(buffer1); + s->commit(Surface::CommitFlag::None); + QVERIFY(committedSpy.wait()); + QVERIFY(serverSurface->isMapped()); + QCOMPARE(inputRegionChangedSpy.count(), 1); + QCOMPARE(serverSurface->input(), QRegion(0, 0, 100, 50)); // let's install an input region s->setInputRegion(m_compositor->createRegion(QRegion(0, 10, 20, 30)).get()); // the region should only be applied after the surface got committed wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(serverSurface->input(), QRegion()); - QCOMPARE(serverSurface->inputIsInfinite(), true); - QCOMPARE(inputRegionChangedSpy.count(), 0); + QCOMPARE(inputRegionChangedSpy.count(), 1); + QCOMPARE(serverSurface->input(), QRegion(0, 0, 100, 50)); // so let's commit to get the new region s->commit(Surface::CommitFlag::None); - QVERIFY(inputRegionChangedSpy.wait()); - QCOMPARE(inputRegionChangedSpy.count(), 1); - QCOMPARE(inputRegionChangedSpy.last().first().value(), QRegion(0, 10, 20, 30)); + QVERIFY(committedSpy.wait()); + QCOMPARE(inputRegionChangedSpy.count(), 2); QCOMPARE(serverSurface->input(), QRegion(0, 10, 20, 30)); - QCOMPARE(serverSurface->inputIsInfinite(), false); // committing without setting a new region shouldn't change s->commit(Surface::CommitFlag::None); wl_display_flush(m_connection->display()); QCoreApplication::processEvents(); - QCOMPARE(inputRegionChangedSpy.count(), 1); + QCOMPARE(inputRegionChangedSpy.count(), 2); QCOMPARE(serverSurface->input(), QRegion(0, 10, 20, 30)); - QCOMPARE(serverSurface->inputIsInfinite(), false); - // let's change the input region + // let's change the input region, note that the new input region is cropped s->setInputRegion(m_compositor->createRegion(QRegion(10, 20, 30, 40)).get()); s->commit(Surface::CommitFlag::None); - QVERIFY(inputRegionChangedSpy.wait()); - QCOMPARE(inputRegionChangedSpy.count(), 2); - QCOMPARE(inputRegionChangedSpy.last().first().value(), QRegion(10, 20, 30, 40)); - QCOMPARE(serverSurface->input(), QRegion(10, 20, 30, 40)); - QCOMPARE(serverSurface->inputIsInfinite(), false); + QVERIFY(committedSpy.wait()); + QCOMPARE(inputRegionChangedSpy.count(), 3); + QCOMPARE(serverSurface->input(), QRegion(10, 20, 30, 30)); // and let's go back to an empty region s->setInputRegion(); s->commit(Surface::CommitFlag::None); - QVERIFY(inputRegionChangedSpy.wait()); - QCOMPARE(inputRegionChangedSpy.count(), 3); - QCOMPARE(inputRegionChangedSpy.last().first().value(), QRegion()); - QCOMPARE(serverSurface->input(), QRegion()); - QCOMPARE(serverSurface->inputIsInfinite(), true); + QVERIFY(committedSpy.wait()); + QCOMPARE(inputRegionChangedSpy.count(), 4); + QCOMPARE(serverSurface->input(), QRegion(0, 0, 100, 50)); } void TestWaylandSurface::testScale() { // this test verifies that updating the scale factor is correctly passed to the Wayland server using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer s(m_compositor->createSurface()); QCOMPARE(s->scale(), 1); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QCOMPARE(serverSurface->scale(), 1); + QCOMPARE(serverSurface->bufferScale(), 1); // let's change the scale factor - QSignalSpy scaleChangedSpy(serverSurface, &SurfaceInterface::scaleChanged); + QSignalSpy bufferScaleChangedSpy(serverSurface, &SurfaceInterface::bufferScaleChanged); - //changing the scale implicitly changes the size + // changing the scale implicitly changes the size QSignalSpy sizeChangedSpy(serverSurface, &SurfaceInterface::sizeChanged); - QVERIFY(scaleChangedSpy.isValid()); + QVERIFY(bufferScaleChangedSpy.isValid()); s->setScale(2); QCOMPARE(s->scale(), 2); // needs a commit - QVERIFY(!scaleChangedSpy.wait(100)); + QVERIFY(!bufferScaleChangedSpy.wait(100)); s->commit(Surface::CommitFlag::None); - QVERIFY(scaleChangedSpy.wait()); - QCOMPARE(scaleChangedSpy.count(), 1); - QCOMPARE(scaleChangedSpy.first().first().toInt(), 2); - QCOMPARE(serverSurface->scale(), 2); + QVERIFY(bufferScaleChangedSpy.wait()); + QCOMPARE(bufferScaleChangedSpy.count(), 1); + QCOMPARE(bufferScaleChangedSpy.first().first().toInt(), 2); + QCOMPARE(serverSurface->bufferScale(), 2); - //even though we've changed the scale, if we don't have a buffer we - //don't have a size. If we don't have a size it can't have changed + // even though we've changed the scale, if we don't have a buffer we + // don't have a size. If we don't have a size it can't have changed QCOMPARE(sizeChangedSpy.count(), 0); QVERIFY(!serverSurface->size().isValid()); // let's try changing to same factor, should not emit changed on server s->setScale(2); s->commit(Surface::CommitFlag::None); - QVERIFY(!scaleChangedSpy.wait(100)); + QVERIFY(!bufferScaleChangedSpy.wait(100)); // but changing to a different value should still work s->setScale(4); s->commit(Surface::CommitFlag::None); - QVERIFY(scaleChangedSpy.wait()); - QCOMPARE(scaleChangedSpy.count(), 2); - QCOMPARE(scaleChangedSpy.first().first().toInt(), 2); - QCOMPARE(scaleChangedSpy.last().first().toInt(), 4); - QCOMPARE(serverSurface->scale(), 4); - scaleChangedSpy.clear(); + QVERIFY(bufferScaleChangedSpy.wait()); + QCOMPARE(bufferScaleChangedSpy.count(), 2); + QCOMPARE(bufferScaleChangedSpy.first().first().toInt(), 2); + QCOMPARE(bufferScaleChangedSpy.last().first().toInt(), 4); + QCOMPARE(serverSurface->bufferScale(), 4); + bufferScaleChangedSpy.clear(); - //attach a buffer of 100x100, our scale is 4, so this should be a size of 25x25 + // attach a buffer of 100x100, our scale is 4, so this should be a size of 25x25 QImage red(100, 100, QImage::Format_ARGB32_Premultiplied); red.fill(QColor(255, 0, 0, 128)); - auto redBuffer = m_shm->createBuffer(red); + QSharedPointer redBuffer = m_shm->createBuffer(red).toStrongRef(); + QVERIFY(redBuffer); s->attachBuffer(redBuffer.data()); - s->damage(QRect(0,0, 25,25)); + s->damage(QRect(0, 0, 25, 25)); s->commit(Surface::CommitFlag::None); QVERIFY(sizeChangedSpy.wait()); QCOMPARE(sizeChangedSpy.count(), 1); - QCOMPARE(serverSurface->size(), QSize(25,25)); + QCOMPARE(serverSurface->size(), QSize(25, 25)); sizeChangedSpy.clear(); - scaleChangedSpy.clear(); + bufferScaleChangedSpy.clear(); - //set the scale to 1, buffer is still 100x100 so size should change to 100x100 + // set the scale to 1, buffer is still 100x100 so size should change to 100x100 s->setScale(1); s->commit(Surface::CommitFlag::None); QVERIFY(sizeChangedSpy.wait()); QCOMPARE(sizeChangedSpy.count(), 1); - QCOMPARE(scaleChangedSpy.count(), 1); - QCOMPARE(serverSurface->scale(), 1); - QCOMPARE(serverSurface->size(), QSize(100,100)); + QCOMPARE(bufferScaleChangedSpy.count(), 1); + QCOMPARE(serverSurface->bufferScale(), 1); + QCOMPARE(serverSurface->size(), QSize(100, 100)); sizeChangedSpy.clear(); - scaleChangedSpy.clear(); + bufferScaleChangedSpy.clear(); - //set scale and size in one commit, buffer is 50x50 at scale 2 so size should be 25x25 + // set scale and size in one commit, buffer is 50x50 at scale 2 so size should be 25x25 QImage blue(50, 50, QImage::Format_ARGB32_Premultiplied); red.fill(QColor(255, 0, 0, 128)); - auto blueBuffer = m_shm->createBuffer(blue); + QSharedPointer blueBuffer = m_shm->createBuffer(blue).toStrongRef(); + QVERIFY(blueBuffer); s->attachBuffer(blueBuffer.data()); s->setScale(2); s->commit(Surface::CommitFlag::None); QVERIFY(sizeChangedSpy.wait()); QCOMPARE(sizeChangedSpy.count(), 1); - QCOMPARE(scaleChangedSpy.count(), 1); - QCOMPARE(serverSurface->scale(), 2); - QCOMPARE(serverSurface->size(), QSize(25,25)); -} - -void TestWaylandSurface::testDestroy() -{ - using namespace KWayland::Client; - Surface *s = m_compositor->createSurface(); - - connect(m_connection, &ConnectionThread::connectionDied, s, &Surface::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_compositor, &Compositor::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_shm, &ShmPool::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_queue, &EventQueue::destroy); - connect(m_connection, &ConnectionThread::connectionDied, m_idleInhibitManager, &IdleInhibitManager::destroy); - QVERIFY(s->isValid()); - - QSignalSpy connectionDiedSpy(m_connection, SIGNAL(connectionDied())); - QVERIFY(connectionDiedSpy.isValid()); - - delete m_compositorInterface; - m_compositorInterface = nullptr; - delete m_idleInhibitInterface; - m_idleInhibitInterface = nullptr; - delete m_display; - m_display = nullptr; - - QVERIFY(connectionDiedSpy.wait()); - - // now the Surface should be destroyed; - QVERIFY(!s->isValid()); - - // calling destroy again should not fail - s->destroy(); + QCOMPARE(bufferScaleChangedSpy.count(), 1); + QCOMPARE(serverSurface->bufferScale(), 2); + QCOMPARE(serverSurface->size(), QSize(25, 25)); } void TestWaylandSurface::testUnmapOfNotMappedSurface() { // this test verifies that a surface which doesn't have a buffer attached doesn't trigger the unmapped signal using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QSignalSpy unmappedSpy(serverSurface, &SurfaceInterface::unmapped); QVERIFY(unmappedSpy.isValid()); - QSignalSpy scaleChanged(serverSurface, &SurfaceInterface::scaleChanged); + QSignalSpy bufferScaleChanged(serverSurface, &SurfaceInterface::bufferScaleChanged); // let's map a null buffer and change scale to trigger a signal we can wait for s->attachBuffer(Buffer::Ptr()); s->setScale(2); s->commit(Surface::CommitFlag::None); - QVERIFY(scaleChanged.wait()); + QVERIFY(bufferScaleChanged.wait()); QVERIFY(unmappedSpy.isEmpty()); } -void TestWaylandSurface::testDamageTracking() -{ - // this tests the damage tracking feature - using namespace KWayland::Client; - using namespace KWayland::Server; - // create surface - QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); - QVERIFY(serverSurfaceCreated.isValid()); - QScopedPointer s(m_compositor->createSurface()); - QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); - - // before first commit, the tracked damage should be empty - QVERIFY(serverSurface->trackedDamage().isEmpty()); - - // Now let's damage the surface - QSignalSpy damagedSpy(serverSurface, &SurfaceInterface::damaged); - QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::red); - s->attachBuffer(m_shm->createBuffer(image)); - s->damage(QRect(0, 0, 100, 100)); - s->commit(Surface::CommitFlag::None); - QVERIFY(damagedSpy.wait()); - QCOMPARE(serverSurface->trackedDamage(), QRegion(0, 0, 100, 100)); - QCOMPARE(serverSurface->damage(), QRegion(0, 0, 100, 100)); - - // resetting the tracked damage should empty it - serverSurface->resetTrackedDamage(); - QVERIFY(serverSurface->trackedDamage().isEmpty()); - // but not affect the actual damage - QCOMPARE(serverSurface->damage(), QRegion(0, 0, 100, 100)); - - // let's damage some parts of the surface - QPainter p; - p.begin(&image); - p.fillRect(QRect(0, 0, 10, 10), Qt::blue); - p.end(); - s->attachBuffer(m_shm->createBuffer(image)); - s->damage(QRect(0, 0, 10, 10)); - s->commit(Surface::CommitFlag::None); - QVERIFY(damagedSpy.wait()); - QCOMPARE(serverSurface->trackedDamage(), QRegion(0, 0, 10, 10)); - QCOMPARE(serverSurface->damage(), QRegion(0, 0, 10, 10)); - - // and damage some part completely not bounding to the current damage region - p.begin(&image); - p.fillRect(QRect(50, 40, 20, 30), Qt::blue); - p.end(); - s->attachBuffer(m_shm->createBuffer(image)); - s->damage(QRect(50, 40, 20, 30)); - s->commit(Surface::CommitFlag::None); - QVERIFY(damagedSpy.wait()); - QCOMPARE(serverSurface->trackedDamage(), QRegion(0, 0, 10, 10).united(QRegion(50, 40, 20, 30))); - QCOMPARE(serverSurface->trackedDamage().rectCount(), 2); - QCOMPARE(serverSurface->damage(), QRegion(50, 40, 20, 30)); - - // now let's reset the tracked damage again - serverSurface->resetTrackedDamage(); - QVERIFY(serverSurface->trackedDamage().isEmpty()); - // but not affect the actual damage - QCOMPARE(serverSurface->damage(), QRegion(50, 40, 20, 30)); -} - void TestWaylandSurface::testSurfaceAt() { // this test verifies that surfaceAt(const QPointF&) works as expected for the case of no children using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); // a newly created surface should not be mapped and not provide a surface at a position QVERIFY(!serverSurface->isMapped()); @@ -931,13 +878,13 @@ { // this test verifies that destroying of a buffer attached to a surface works using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); QScopedPointer s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); // let's damage this surface QSignalSpy damagedSpy(serverSurface, &SurfaceInterface::damaged); @@ -956,30 +903,24 @@ m_connection->flush(); // Let's try to destroy it - QSignalSpy destroySpy(serverSurface->buffer(), &BufferInterface::aboutToBeDestroyed); - QVERIFY(destroySpy.isValid()); delete m_shm; m_shm = nullptr; - QVERIFY(destroySpy.wait()); - - // TODO: should this emit unmapped? - QVERIFY(!serverSurface->buffer()); + QTRY_VERIFY(serverSurface->buffer()->isDestroyed()); } - void TestWaylandSurface::testDestroyWithPendingCallback() { // this test tries to verify that destroying a surface with a pending callback works correctly // first create surface using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer s(m_compositor->createSurface()); QVERIFY(!s.isNull()); QVERIFY(s->isValid()); QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); // now render to it @@ -1008,14 +949,14 @@ { // this test verifies that the server side correctly tears down the resources when the client disconnects using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer s(m_compositor->createSurface()); QVERIFY(!s.isNull()); QVERIFY(s->isValid()); QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); // destroy client @@ -1045,8 +986,8 @@ { // This test verifies that the enter/leave are sent correctly to the Client using namespace KWayland::Client; - using namespace KWayland::Server; - qRegisterMetaType(); + using namespace KWaylandServer; + qRegisterMetaType(); QScopedPointer s(m_compositor->createSurface()); QVERIFY(!s.isNull()); QVERIFY(s->isValid()); @@ -1059,9 +1000,9 @@ QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); - QCOMPARE(serverSurface->outputs(), QVector()); + QCOMPARE(serverSurface->outputs(), QVector()); // create another registry to get notified about added outputs Registry registry; @@ -1075,61 +1016,61 @@ QSignalSpy outputAnnouncedSpy(®istry, &Registry::outputAnnounced); QVERIFY(outputAnnouncedSpy.isValid()); - auto serverOutput = m_display->createOutput(m_display); - serverOutput->create(); + auto serverOutput = new OutputInterface(m_display, m_display); QVERIFY(outputAnnouncedSpy.wait()); - QScopedPointer clientOutput(registry.createOutput(outputAnnouncedSpy.first().first().value(), outputAnnouncedSpy.first().last().value())); + QScopedPointer clientOutput( + registry.createOutput(outputAnnouncedSpy.first().first().value(), outputAnnouncedSpy.first().last().value())); QVERIFY(clientOutput->isValid()); m_connection->flush(); m_display->dispatchEvents(); // now enter it - serverSurface->setOutputs(QVector{serverOutput}); - QCOMPARE(serverSurface->outputs(), QVector{serverOutput}); + serverSurface->setOutputs(QVector{serverOutput}); + QCOMPARE(serverSurface->outputs(), QVector{serverOutput}); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 1); - QCOMPARE(enteredSpy.first().first().value(), clientOutput.data()); - QCOMPARE(s->outputs(), QVector{clientOutput.data()}); + QCOMPARE(enteredSpy.first().first().value(), clientOutput.data()); + QCOMPARE(s->outputs(), QVector{clientOutput.data()}); // adding to same should not trigger - serverSurface->setOutputs(QVector{serverOutput}); + serverSurface->setOutputs(QVector{serverOutput}); // leave again - serverSurface->setOutputs(QVector()); - QCOMPARE(serverSurface->outputs(), QVector()); + serverSurface->setOutputs(QVector()); + QCOMPARE(serverSurface->outputs(), QVector()); QVERIFY(leftSpy.wait()); QCOMPARE(enteredSpy.count(), 1); QCOMPARE(leftSpy.count(), 1); - QCOMPARE(leftSpy.first().first().value(), clientOutput.data()); - QCOMPARE(s->outputs(), QVector()); + QCOMPARE(leftSpy.first().first().value(), clientOutput.data()); + QCOMPARE(s->outputs(), QVector()); // leave again should not trigger - serverSurface->setOutputs(QVector()); + serverSurface->setOutputs(QVector()); // and enter again, just to verify - serverSurface->setOutputs(QVector{serverOutput}); - QCOMPARE(serverSurface->outputs(), QVector{serverOutput}); + serverSurface->setOutputs(QVector{serverOutput}); + QCOMPARE(serverSurface->outputs(), QVector{serverOutput}); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 2); QCOMPARE(leftSpy.count(), 1); - //delete output client is on. - //client should get an exit and be left on no outputs (which is allowed) + // delete output client is on. + // client should get an exit and be left on no outputs (which is allowed) serverOutput->deleteLater(); QVERIFY(leftSpy.wait()); - QCOMPARE(serverSurface->outputs(), QVector()); + QCOMPARE(serverSurface->outputs(), QVector()); } void TestWaylandSurface::testInhibit() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; QScopedPointer s(m_compositor->createSurface()); // wait for the surface on the Server side QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); QCOMPARE(serverSurface->inhibitsIdle(), false); diff -Nru dwayland-5.57.0.23/autotests/client/test_wayland_windowmanagement.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_windowmanagement.cpp --- dwayland-5.57.0.23/autotests/client/test_wayland_windowmanagement.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_wayland_windowmanagement.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,42 +1,27 @@ -/******************************************************************** -Copyright 2015 Marco Martin +/* + SPDX-FileCopyrightText: 2015 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/plasmawindowmanagement_interface.h" +#include "../../src/server/surface_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" +#include "../../src/client/plasmawindowmanagement.h" #include "../../src/client/region.h" #include "../../src/client/registry.h" #include "../../src/client/surface.h" -#include "../../src/client/plasmawindowmanagement.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/region_interface.h" -#include "../../src/server/plasmawindowmanagement_interface.h" -#include "../../src/server/surface_interface.h" -#include "../../build/src/server/wayland-plasma-window-management-client-protocol.h" +#include -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowSignal)(); +typedef void (KWaylandServer::PlasmaWindowInterface::*ServerWindowSignal)(); Q_DECLARE_METATYPE(ServerWindowSignal) -typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowBooleanSignal)(bool); +typedef void (KWaylandServer::PlasmaWindowInterface::*ServerWindowBooleanSignal)(bool); Q_DECLARE_METATYPE(ServerWindowBooleanSignal) typedef void (KWayland::Client::PlasmaWindow::*ClientWindowVoidSetter)(); Q_DECLARE_METATYPE(ClientWindowVoidSetter) @@ -69,15 +54,16 @@ void testGeometry(); void testIcon(); void testPid(); + void testApplicationMenu(); void cleanup(); private: - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::PlasmaWindowManagementInterface *m_windowManagementInterface; - KWayland::Server::PlasmaWindowInterface *m_windowInterface; - KWayland::Server::SurfaceInterface *m_surfaceInterface = nullptr; + KWaylandServer::Display *m_display; + KWaylandServer::CompositorInterface *m_compositorInterface; + KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWaylandServer::PlasmaWindowInterface *m_windowInterface; + QPointer m_surfaceInterface; KWayland::Client::Surface *m_surface = nullptr; KWayland::Client::ConnectionThread *m_connection; @@ -104,17 +90,17 @@ void TestWindowManagement::init() { - using namespace KWayland::Server; - qRegisterMetaType("ShowingDesktopState"); + using namespace KWaylandServer; + qRegisterMetaType("ShowingDesktopState"); delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -130,13 +116,12 @@ QVERIFY(m_queue->isValid()); m_registry = new KWayland::Client::Registry(this); - QSignalSpy compositorSpy(m_registry, SIGNAL(compositorAnnounced(quint32,quint32))); + QSignalSpy compositorSpy(m_registry, &KWayland::Client::Registry::compositorAnnounced); QVERIFY(compositorSpy.isValid()); - QSignalSpy windowManagementSpy(m_registry, SIGNAL(plasmaWindowManagementAnnounced(quint32,quint32))); + QSignalSpy windowManagementSpy(m_registry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced); QVERIFY(windowManagementSpy.isValid()); - QVERIFY(!m_registry->eventQueue()); m_registry->setEventQueue(m_queue); QCOMPARE(m_registry->eventQueue(), m_queue); @@ -144,37 +129,33 @@ QVERIFY(m_registry->isValid()); m_registry->setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = m_registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - - m_windowManagementInterface = m_display->createPlasmaWindowManagement(m_display); - m_windowManagementInterface->create(); - QVERIFY(m_windowManagementInterface->isValid()); + m_windowManagementInterface = new PlasmaWindowManagementInterface(m_display, m_display); QVERIFY(windowManagementSpy.wait()); - m_windowManagement = m_registry->createPlasmaWindowManagement(windowManagementSpy.first().first().value(), windowManagementSpy.first().last().value(), this); + m_windowManagement = m_registry->createPlasmaWindowManagement(windowManagementSpy.first().first().value(), + windowManagementSpy.first().last().value(), + this); - QSignalSpy windowSpy(m_windowManagement, SIGNAL(windowCreated(KWayland::Client::PlasmaWindow*))); + QSignalSpy windowSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated); QVERIFY(windowSpy.isValid()); - m_windowInterface = m_windowManagementInterface->createWindow(this); + m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid()); m_windowInterface->setPid(1337); QVERIFY(windowSpy.wait()); m_window = windowSpy.first().first().value(); - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); m_surface = m_compositor->createSurface(this); QVERIFY(m_surface); QVERIFY(serverSurfaceCreated.wait()); - m_surfaceInterface = serverSurfaceCreated.first().first().value(); + m_surfaceInterface = serverSurfaceCreated.first().first().value(); QVERIFY(m_surfaceInterface); } @@ -182,7 +163,7 @@ { m_windowInterface->setTitle(QStringLiteral("Test Title")); - QSignalSpy titleSpy(m_window, SIGNAL(titleChanged())); + QSignalSpy titleSpy(m_window, &KWayland::Client::PlasmaWindow::titleChanged); QVERIFY(titleSpy.isValid()); QVERIFY(titleSpy.wait()); @@ -194,7 +175,7 @@ { m_window->setMinimizedGeometry(m_surface, QRect(5, 10, 100, 200)); - QSignalSpy geometrySpy(m_windowInterface, SIGNAL(minimizedGeometriesChanged())); + QSignalSpy geometrySpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::minimizedGeometriesChanged); QVERIFY(geometrySpy.isValid()); QVERIFY(geometrySpy.wait()); @@ -207,7 +188,6 @@ void TestWindowManagement::cleanup() { - if (m_surface) { delete m_surface; m_surface = nullptr; @@ -241,17 +221,15 @@ m_connection = nullptr; m_display->dispatchEvents(); - delete m_windowManagementInterface; - m_windowManagementInterface = nullptr; - delete m_windowInterface; - m_windowInterface = nullptr; - - delete m_surfaceInterface; - m_surfaceInterface = nullptr; + QVERIFY(m_surfaceInterface.isNull()); delete m_display; m_display = nullptr; + + // these are the children of the display + m_windowManagementInterface = nullptr; + m_windowInterface = nullptr; } void TestWindowManagement::testUseAfterUnmap() @@ -261,15 +239,12 @@ QVERIFY(unmappedSpy.isValid()); QSignalSpy destroyedSpy(m_window, &QObject::destroyed); QVERIFY(destroyedSpy.isValid()); - m_windowInterface->unmap(); + m_windowInterface->deleteLater(); + m_windowInterface = nullptr; m_window->requestClose(); QVERIFY(unmappedSpy.wait()); QVERIFY(destroyedSpy.wait()); m_window = nullptr; - QSignalSpy serverDestroyedSpy(m_windowInterface, &QObject::destroyed); - QVERIFY(serverDestroyedSpy.isValid()); - QVERIFY(serverDestroyedSpy.wait()); - m_windowInterface = nullptr; } void TestWindowManagement::testServerDelete() @@ -303,14 +278,10 @@ QVERIFY(destroyedSpy.isValid()); QSignalSpy serverDestroyedSpy(m_windowInterface, &QObject::destroyed); QVERIFY(serverDestroyedSpy.isValid()); - m_windowManagementInterface->unmapWindow(m_windowInterface); + delete m_windowInterface; + m_windowInterface = nullptr; QVERIFY(activeWindowChangedSpy.wait()); QVERIFY(!m_windowManagement->activeWindow()); - QVERIFY(destroyedSpy.wait()); - QCOMPARE(destroyedSpy.count(), 1); - m_window = nullptr; - QVERIFY(serverDestroyedSpy.wait()); - m_windowInterface = nullptr; } void TestWindowManagement::testDeleteActiveWindow() @@ -338,15 +309,17 @@ { // this test verifies that we don't get a protocol error on client side when creating an already unmapped window. QCOMPARE(m_windowManagement->children().count(), 1); + + QSignalSpy windowAddedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated); + // create and unmap in one go // client will first handle the create, the unmap will be sent once the server side is bound - auto serverWindow = m_windowManagementInterface->createWindow(this); - serverWindow->unmap(); + auto serverWindow = m_windowManagementInterface->createWindow(m_windowManagementInterface, QUuid::createUuid()); + delete serverWindow; QCOMPARE(m_windowManagementInterface->children().count(), 0); - QCoreApplication::instance()->processEvents(); - QCoreApplication::instance()->processEvents(QEventLoop::WaitForMoreEvents); - QTRY_COMPARE(m_windowManagement->children().count(), 2); - auto window = dynamic_cast(m_windowManagement->children().last()); + + windowAddedSpy.wait(); + auto window = dynamic_cast(m_windowManagement->children().last()); QVERIFY(window); // now this is not yet on the server, on the server it will be after next roundtrip // which we can trigger by waiting for destroy of the newly created window. @@ -354,26 +327,19 @@ QSignalSpy clientDestroyedSpy(window, &QObject::destroyed); QVERIFY(clientDestroyedSpy.isValid()); QVERIFY(clientDestroyedSpy.wait()); + // Verify that any wrappers created for our temporary window are now gone QCOMPARE(m_windowManagement->children().count(), 1); - // the server side created a helper PlasmaWindowInterface with PlasmaWindowManagementInterface as parent - // it emitted unmapped so we can be sure it will be destroyed directly - QCOMPARE(m_windowManagementInterface->children().count(), 1); - auto helperWindow = qobject_cast(m_windowManagementInterface->children().first()); - QVERIFY(helperWindow); - QSignalSpy helperDestroyedSpy(helperWindow, &QObject::destroyed); - QVERIFY(helperDestroyedSpy.isValid()); - QVERIFY(helperDestroyedSpy.wait()); } void TestWindowManagement::testRequests_data() { - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; QTest::addColumn("changedSignal"); QTest::addColumn("requester"); - QTest::newRow("close") << &PlasmaWindowInterface::closeRequested << &PlasmaWindow::requestClose; - QTest::newRow("move") << &PlasmaWindowInterface::moveRequested << &PlasmaWindow::requestMove; + QTest::newRow("close") << &PlasmaWindowInterface::closeRequested << &PlasmaWindow::requestClose; + QTest::newRow("move") << &PlasmaWindowInterface::moveRequested << &PlasmaWindow::requestMove; QTest::newRow("resize") << &PlasmaWindowInterface::resizeRequested << &PlasmaWindow::requestResize; } @@ -390,11 +356,11 @@ void TestWindowManagement::testRequestsBoolean_data() { - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("changedSignal"); QTest::addColumn("flag"); - QTest::newRow("activate") << &PlasmaWindowInterface::activeRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); + QTest::newRow("activate") << &PlasmaWindowInterface::activeRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); QTest::newRow("minimized") << &PlasmaWindowInterface::minimizedRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED); QTest::newRow("maximized") << &PlasmaWindowInterface::maximizedRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED); QTest::newRow("fullscreen") << &PlasmaWindowInterface::fullscreenRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREEN); @@ -411,7 +377,8 @@ QTest::newRow("shaded") << &PlasmaWindowInterface::shadedRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); QTest::newRow("movable") << &PlasmaWindowInterface::movableRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE); QTest::newRow("resizable") << &PlasmaWindowInterface::resizableRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE); - QTest::newRow("virtualDesktopChangeable") << &PlasmaWindowInterface::virtualDesktopChangeableRequested << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE); + QTest::newRow("virtualDesktopChangeable") << &PlasmaWindowInterface::virtualDesktopChangeableRequested + << int(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE); } void TestWindowManagement::testRequestsBoolean() @@ -433,7 +400,7 @@ void TestWindowManagement::testShowingDesktop() { - using namespace KWayland::Server; + using namespace KWaylandServer; // this test verifies setting the showing desktop state QVERIFY(!m_windowManagement->isShowingDesktop()); QSignalSpy showingDesktopChangedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::showingDesktopChanged); @@ -458,7 +425,7 @@ void TestWindowManagement::testRequestShowingDesktop_data() { - using namespace KWayland::Server; + using namespace KWaylandServer; QTest::addColumn("value"); QTest::addColumn("expectedValue"); @@ -469,7 +436,7 @@ void TestWindowManagement::testRequestShowingDesktop() { // this test verifies requesting show desktop state - using namespace KWayland::Server; + using namespace KWaylandServer; QSignalSpy requestSpy(m_windowManagementInterface, &PlasmaWindowManagementInterface::requestChangeShowingDesktop); QVERIFY(requestSpy.isValid()); QFETCH(bool, value); @@ -481,7 +448,7 @@ void TestWindowManagement::testKeepAbove() { - using namespace KWayland::Server; + using namespace KWaylandServer; // this test verifies setting the keep above state QVERIFY(!m_window->isKeepAbove()); QSignalSpy keepAboveChangedSpy(m_window, &KWayland::Client::PlasmaWindow::keepAboveChanged); @@ -503,7 +470,7 @@ void TestWindowManagement::testKeepBelow() { - using namespace KWayland::Server; + using namespace KWaylandServer; // this test verifies setting the keep below state QVERIFY(!m_window->isKeepBelow()); QSignalSpy keepBelowChangedSpy(m_window, &KWayland::Client::PlasmaWindow::keepBelowChanged); @@ -535,10 +502,10 @@ // now let's create a second window QSignalSpy windowAddedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated); QVERIFY(windowAddedSpy.isValid()); - auto serverTransient = m_windowManagementInterface->createWindow(this); + QScopedPointer serverTransient(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); serverTransient->setParentWindow(m_windowInterface); QVERIFY(windowAddedSpy.wait()); - auto transient = windowAddedSpy.first().first().value(); + auto transient = windowAddedSpy.first().first().value(); QCOMPARE(transient->parentWindow().data(), parentWindow); // let's unset the parent @@ -554,7 +521,7 @@ QCOMPARE(transient->parentWindow().data(), parentWindow); // now let's try to unmap the parent - m_windowInterface->unmap(); + m_windowInterface->deleteLater(); m_window = nullptr; m_windowInterface = nullptr; QVERIFY(parentWindowChangedSpy.wait()); @@ -584,8 +551,9 @@ QCOMPARE(m_window->geometry(), QRect(0, 0, 35, 45)); // let's bind a second PlasmaWindowManagement to verify the initial setting - QScopedPointer pm(m_registry->createPlasmaWindowManagement(m_registry->interface(Registry::Interface::PlasmaWindowManagement).name, - m_registry->interface(Registry::Interface::PlasmaWindowManagement).version)); + QScopedPointer pm( + m_registry->createPlasmaWindowManagement(m_registry->interface(Registry::Interface::PlasmaWindowManagement).name, + m_registry->interface(Registry::Interface::PlasmaWindowManagement).version)); QVERIFY(!pm.isNull()); QSignalSpy windowAddedSpy(pm.data(), &PlasmaWindowManagement::windowCreated); QVERIFY(windowAddedSpy.isValid()); @@ -597,36 +565,29 @@ void TestWindowManagement::testIcon() { using namespace KWayland::Client; - QVERIFY(m_window); + + // initially, there shouldn't be any icon QSignalSpy iconChangedSpy(m_window, &PlasmaWindow::iconChanged); QVERIFY(iconChangedSpy.isValid()); - m_windowInterface->setIcon(QIcon()); - // first goes from themed name to empty - QVERIFY(iconChangedSpy.wait()); - if (!QIcon::hasThemeIcon(QStringLiteral("wayland"))) { - QEXPECT_FAIL("", "no icon", Continue); - } - QCOMPARE(m_window->icon().name(), QStringLiteral("wayland")); - QVERIFY(iconChangedSpy.wait()); - if (!QIcon::hasThemeIcon(QStringLiteral("wayland"))) { - QEXPECT_FAIL("", "no icon", Continue); - } - QCOMPARE(m_window->icon().name(), QStringLiteral("wayland")); + QVERIFY(m_window->icon().isNull()); // create an icon with a pixmap - QPixmap p(32, 32); + QImage p(32, 32, QImage::Format_ARGB32_Premultiplied); p.fill(Qt::red); - m_windowInterface->setIcon(p); + const QIcon dummyIcon(QPixmap::fromImage(p)); + m_windowInterface->setIcon(dummyIcon); QVERIFY(iconChangedSpy.wait()); - QCOMPARE(m_window->icon().pixmap(32, 32), p); + QCOMPARE(iconChangedSpy.count(), 1); + QCOMPARE(m_window->icon().pixmap(32, 32), dummyIcon.pixmap(32, 32)); // let's set a themed icon - m_windowInterface->setIcon(QIcon::fromTheme(QStringLiteral("xorg"))); + m_windowInterface->setIcon(QIcon::fromTheme(QStringLiteral("wayland"))); QVERIFY(iconChangedSpy.wait()); - if (!QIcon::hasThemeIcon(QStringLiteral("xorg"))) { - QEXPECT_FAIL("", "no icon", Continue); + QCOMPARE(iconChangedSpy.count(), 2); + if (!QIcon::hasThemeIcon(QStringLiteral("wayland"))) { + QEXPECT_FAIL("", "no wayland icon", Continue); } - QCOMPARE(m_window->icon().name(), QStringLiteral("xorg")); + QCOMPARE(m_window->icon().name(), QStringLiteral("wayland")); } void TestWindowManagement::testPid() @@ -635,15 +596,30 @@ QVERIFY(m_window); QVERIFY(m_window->pid() == 1337); - //test server not setting a PID for whatever reason - QScopedPointer newWindowInterface(m_windowManagementInterface->createWindow(this)); - QSignalSpy windowSpy(m_windowManagement, SIGNAL(windowCreated(KWayland::Client::PlasmaWindow*))); + // test server not setting a PID for whatever reason + QScopedPointer newWindowInterface(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); + QSignalSpy windowSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated); QVERIFY(windowSpy.wait()); - QScopedPointer newWindow( windowSpy.first().first().value()); + QScopedPointer newWindow(windowSpy.first().first().value()); QVERIFY(newWindow); QVERIFY(newWindow->pid() == 0); +} + +void TestWindowManagement::testApplicationMenu() +{ + using namespace KWayland::Client; + + const auto serviceName = QStringLiteral("org.kde.foo"); + const auto objectPath = QStringLiteral("/org/kde/bar"); + + m_windowInterface->setApplicationMenuPaths(serviceName, objectPath); + QSignalSpy applicationMenuChangedSpy(m_window, &PlasmaWindow::applicationMenuChanged); + QVERIFY(applicationMenuChangedSpy.isValid()); + QVERIFY(applicationMenuChangedSpy.wait()); + QCOMPARE(m_window->applicationMenuServiceName(), serviceName); + QCOMPARE(m_window->applicationMenuObjectPath(), objectPath); } QTEST_MAIN(TestWindowManagement) diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_decoration.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_decoration.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_decoration.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_decoration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,36 +1,22 @@ -/******************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/xdgdecoration_v1_interface.h" +#include "../../src/server/xdgshell_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" #include "../../src/client/registry.h" -#include "../../src/client/xdgshell.h" -#include "../../src/client/xdgdecoration.h" #include "../../src/client/surface.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/xdgshell_interface.h" -#include "../../src/server/xdgdecoration_interface.h" +#include "../../src/client/xdgdecoration.h" +#include "../../src/client/xdgshell.h" class TestXdgDecoration : public QObject { @@ -45,10 +31,10 @@ void testDecoration(); private: - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::CompositorInterface *m_compositorInterface = nullptr; - KWayland::Server::XdgShellInterface *m_xdgShellInterface = nullptr; - KWayland::Server::XdgDecorationManagerInterface *m_xdgDecorationManagerInterface = nullptr; + KWaylandServer::Display *m_display = nullptr; + KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; + KWaylandServer::XdgShellInterface *m_xdgShellInterface = nullptr; + KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; @@ -69,15 +55,15 @@ void TestXdgDecoration::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; qRegisterMetaType(); - qRegisterMetaType(); + qRegisterMetaType(); delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -111,27 +97,20 @@ QVERIFY(m_registry->isValid()); m_registry->setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = m_registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_xdgShellInterface = m_display->createXdgShell(XdgShellInterfaceVersion::Stable, m_display); - m_xdgShellInterface->create(); - QVERIFY(m_xdgShellInterface->isValid()); + m_xdgShellInterface = new XdgShellInterface(m_display, m_display); QVERIFY(xdgShellSpy.wait()); - m_xdgShell = m_registry->createXdgShell(xdgShellSpy.first().first().value(), - xdgShellSpy.first().last().value(), this); + m_xdgShell = m_registry->createXdgShell(xdgShellSpy.first().first().value(), xdgShellSpy.first().last().value(), this); - m_xdgDecorationManagerInterface = m_display->createXdgDecorationManager(m_xdgShellInterface, m_display); - m_xdgDecorationManagerInterface->create(); - QVERIFY(m_xdgDecorationManagerInterface->isValid()); + m_xdgDecorationManagerInterface = new XdgDecorationManagerV1Interface(m_display, m_display); QVERIFY(xdgDecorationManagerSpy.wait()); m_xdgDecorationManager = m_registry->createXdgDecorationManager(xdgDecorationManagerSpy.first().first().value(), - xdgDecorationManagerSpy.first().last().value(), this); + xdgDecorationManagerSpy.first().last().value(), + this); } void TestXdgDecoration::cleanup() @@ -169,18 +148,17 @@ m_display = nullptr; } - void TestXdgDecoration::testDecoration_data() { using namespace KWayland::Client; - using namespace KWayland::Server; - QTest::addColumn("configuredMode"); + using namespace KWaylandServer; + QTest::addColumn("configuredMode"); QTest::addColumn("configuredModeExp"); QTest::addColumn("setMode"); - QTest::addColumn("setModeExp"); + QTest::addColumn("setModeExp"); - const auto serverClient = XdgDecorationInterface::Mode::ClientSide; - const auto serverServer = XdgDecorationInterface::Mode::ServerSide; + const auto serverClient = XdgToplevelDecorationV1Interface::Mode::Client; + const auto serverServer = XdgToplevelDecorationV1Interface::Mode::Server; const auto clientClient = XdgDecoration::Mode::ClientSide; const auto clientServer = XdgDecoration::Mode::ServerSide; @@ -193,57 +171,56 @@ void TestXdgDecoration::testDecoration() { using namespace KWayland::Client; - using namespace KWayland::Server; + using namespace KWaylandServer; - QFETCH(KWayland::Server::XdgDecorationInterface::Mode, configuredMode); + QFETCH(KWaylandServer::XdgToplevelDecorationV1Interface::Mode, configuredMode); QFETCH(KWayland::Client::XdgDecoration::Mode, configuredModeExp); QFETCH(KWayland::Client::XdgDecoration::Mode, setMode); - QFETCH(KWayland::Server::XdgDecorationInterface::Mode, setModeExp); - + QFETCH(KWaylandServer::XdgToplevelDecorationV1Interface::Mode, setModeExp); QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - QSignalSpy shellSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy decorationCreatedSpy(m_xdgDecorationManagerInterface, &XdgDecorationManagerInterface::xdgDecorationInterfaceCreated); + QSignalSpy shellSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); + QSignalSpy decorationCreatedSpy(m_xdgDecorationManagerInterface, &XdgDecorationManagerV1Interface::decorationCreated); // create shell surface and deco object QScopedPointer surface(m_compositor->createSurface()); QScopedPointer shellSurface(m_xdgShell->createSurface(surface.data())); QScopedPointer decoration(m_xdgDecorationManager->getToplevelDecoration(shellSurface.data())); - //and receive all these on the "server" + // and receive all these on the "server" QVERIFY(surfaceCreatedSpy.count() || surfaceCreatedSpy.wait()); QVERIFY(shellSurfaceCreatedSpy.count() || shellSurfaceCreatedSpy.wait()); QVERIFY(decorationCreatedSpy.count() || decorationCreatedSpy.wait()); - auto shellSurfaceIface = shellSurfaceCreatedSpy.first().first().value(); - auto decorationIface = decorationCreatedSpy.first().first().value(); + auto shellSurfaceIface = shellSurfaceCreatedSpy.first().first().value(); + auto decorationIface = decorationCreatedSpy.first().first().value(); QVERIFY(decorationIface); QVERIFY(shellSurfaceIface); - QCOMPARE(decorationIface->surface(), shellSurfaceIface); - QCOMPARE(decorationIface->requestedMode(), XdgDecorationInterface::Mode::Undefined); + QCOMPARE(decorationIface->toplevel(), shellSurfaceIface); + QCOMPARE(decorationIface->preferredMode(), XdgToplevelDecorationV1Interface::Mode::Undefined); QSignalSpy clientConfiguredSpy(decoration.data(), &XdgDecoration::modeChanged); - QSignalSpy modeRequestedSpy(decorationIface, &XdgDecorationInterface::modeRequested); + QSignalSpy modeRequestedSpy(decorationIface, &XdgToplevelDecorationV1Interface::preferredModeChanged); - //server configuring a client - decorationIface->configure(configuredMode); - quint32 serial = shellSurfaceIface->configure({}); + // server configuring a client + decorationIface->sendConfigure(configuredMode); + quint32 serial = shellSurfaceIface->sendConfigure(QSize(0, 0), {}); QVERIFY(clientConfiguredSpy.wait()); QCOMPARE(clientConfiguredSpy.first().first().value(), configuredModeExp); shellSurface->ackConfigure(serial); - //client requesting another mode + // client requesting another mode decoration->setMode(setMode); QVERIFY(modeRequestedSpy.wait()); - QCOMPARE(modeRequestedSpy.first().first().value(), setModeExp); - QCOMPARE(decorationIface->requestedMode(), setModeExp); + QCOMPARE(modeRequestedSpy.first().first().value(), setModeExp); + QCOMPARE(decorationIface->preferredMode(), setModeExp); modeRequestedSpy.clear(); decoration->unsetMode(); QVERIFY(modeRequestedSpy.wait()); - QCOMPARE(modeRequestedSpy.first().first().value(), XdgDecorationInterface::Mode::Undefined); + QCOMPARE(modeRequestedSpy.first().first().value(), XdgToplevelDecorationV1Interface::Mode::Undefined); } QTEST_GUILESS_MAIN(TestXdgDecoration) diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_foreign.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_foreign.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_foreign.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_foreign.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,16 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2017 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2017 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/surface_interface.h" +#include "../../src/server/xdgforeign_v2_interface.h" #include "../../src/client/compositor.h" #include "../../src/client/connection_thread.h" #include "../../src/client/event_queue.h" @@ -28,10 +18,6 @@ #include "../../src/client/registry.h" #include "../../src/client/surface.h" #include "../../src/client/xdgforeign.h" -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/surface_interface.h" -#include "../../src/server/xdgforeign_interface.h" using namespace KWayland::Client; @@ -51,13 +37,14 @@ void testDeleteExported(); void testExportTwoTimes(); void testImportTwoTimes(); + void testImportInvalidToplevel(); private: void doExport(); - KWayland::Server::Display *m_display; - KWayland::Server::CompositorInterface *m_compositorInterface; - KWayland::Server::XdgForeignInterface *m_foreignInterface; + KWaylandServer::Display *m_display; + QPointer m_compositorInterface; + KWaylandServer::XdgForeignV2Interface *m_foreignInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::EventQueue *m_queue; @@ -65,13 +52,13 @@ KWayland::Client::XdgImporter *m_importer; QPointer m_exportedSurface; - QPointer m_exportedSurfaceInterface; + QPointer m_exportedSurfaceInterface; QPointer m_exported; QPointer m_imported; QPointer m_childSurface; - QPointer m_childSurfaceInterface; + QPointer m_childSurfaceInterface; QThread *m_thread; }; @@ -93,15 +80,14 @@ void TestForeign::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - qRegisterMetaType("KWayland::Server::SurfaceInterface"); - + qRegisterMetaType(); // setup connection m_connection = new KWayland::Client::ConnectionThread; QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); @@ -137,19 +123,14 @@ QVERIFY(registry.isValid()); registry.setup(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - QVERIFY(m_compositorInterface->isValid()); - + m_compositorInterface = new CompositorInterface(m_display, m_display); QVERIFY(compositorSpy.wait()); m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); - m_foreignInterface = m_display->createXdgForeignInterface(m_display); - m_foreignInterface->create(); - QVERIFY(m_foreignInterface->isValid()); - + m_foreignInterface = new XdgForeignV2Interface(m_display, m_display); + QVERIFY(exporterSpy.wait()); - //Both importer and exporter should have been triggered by now + // Both importer and exporter should have been triggered by now QCOMPARE(exporterSpy.count(), 1); QCOMPARE(importerSpy.count(), 1); @@ -159,17 +140,12 @@ void TestForeign::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } - CLEANUP(m_exportedSurfaceInterface) - CLEANUP(m_childSurfaceInterface) - - - CLEANUP(m_compositor) CLEANUP(m_exporter) CLEANUP(m_importer) @@ -184,59 +160,52 @@ delete m_thread; m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_foreignInterface) - - //internally there are some deleteLaters on exported interfaces - //we want them processed before we delete the connection - if (m_display) { - QSignalSpy destroyedSpy(m_display, &QObject::destroyed); - m_display->deleteLater(); - m_display = nullptr; - destroyedSpy.wait(); - } - + delete m_display; + m_display = nullptr; #undef CLEANUP + + // these are the children of the display + m_foreignInterface = nullptr; } void TestForeign::doExport() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); m_exportedSurface = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - m_exportedSurfaceInterface = serverSurfaceCreated.first().first().value(); + m_exportedSurfaceInterface = serverSurfaceCreated.first().first().value(); - //Export a window - m_exported = m_exporter->exportTopLevel(m_exportedSurface, m_connection); + // Export a window + m_exported = m_exporter->exportTopLevel(m_exportedSurface); QVERIFY(m_exported->handle().isEmpty()); QSignalSpy doneSpy(m_exported.data(), &XdgExported::done); QVERIFY(doneSpy.wait()); QVERIFY(!m_exported->handle().isEmpty()); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); QVERIFY(transientSpy.isValid()); - //Import the just exported window - m_imported = m_importer->importTopLevel(m_exported->handle(), m_connection); + // Import the just exported window + m_imported = m_importer->importTopLevel(m_exported->handle()); QVERIFY(m_imported->isValid()); - QSignalSpy childSurfaceInterfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + QSignalSpy childSurfaceInterfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); m_childSurface = m_compositor->createSurface(); QVERIFY(childSurfaceInterfaceCreated.wait()); - m_childSurfaceInterface = childSurfaceInterfaceCreated.first().first().value(); + m_childSurfaceInterface = childSurfaceInterfaceCreated.first().first().value(); m_childSurface->commit(Surface::CommitFlag::None); m_imported->setParentOf(m_childSurface); QVERIFY(transientSpy.wait()); - QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); - QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); + QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); - //transientFor api + // transientFor api QCOMPARE(m_foreignInterface->transientFor(m_childSurfaceInterface), m_exportedSurfaceInterface.data()); } @@ -249,16 +218,16 @@ { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); - + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QVERIFY(transientSpy.isValid()); m_imported->deleteLater(); m_imported = nullptr; QVERIFY(transientSpy.wait()); - QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); - QVERIFY(!transientSpy.first().at(1).value()); + QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); + QVERIFY(!transientSpy.first().at(1).value()); QVERIFY(!m_foreignInterface->transientFor(m_childSurfaceInterface)); } @@ -266,38 +235,28 @@ { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); - + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QVERIFY(transientSpy.isValid()); m_childSurface->deleteLater(); QVERIFY(transientSpy.wait()); - //when the client surface dies, the server one will eventually die too - QSignalSpy surfaceDestroyedSpy(m_childSurfaceInterface, SIGNAL(destroyed())); - QVERIFY(surfaceDestroyedSpy.wait()); - - QVERIFY(!transientSpy.first().at(0).value()); - QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); + QVERIFY(!transientSpy.first().at(0).value()); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); } void TestForeign::testDeleteParentSurface() { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); - + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); QVERIFY(transientSpy.isValid()); m_exportedSurface->deleteLater(); - - QSignalSpy exportedSurfaceDestroyedSpy(m_exportedSurfaceInterface.data(), &QObject::destroyed); - QVERIFY(exportedSurfaceDestroyedSpy.isValid()); - exportedSurfaceDestroyedSpy.wait(); - QVERIFY(transientSpy.wait()); - QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); - QVERIFY(!transientSpy.first().at(1).value()); + QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); + QVERIFY(!transientSpy.first().at(1).value()); QVERIFY(!m_foreignInterface->transientFor(m_childSurfaceInterface)); } @@ -305,9 +264,9 @@ { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); QSignalSpy destroyedSpy(m_imported.data(), &KWayland::Client::XdgImported::importedDestroyed); - + QVERIFY(transientSpy.isValid()); m_exported->deleteLater(); m_exported = nullptr; @@ -315,8 +274,8 @@ QVERIFY(transientSpy.wait()); QVERIFY(destroyedSpy.wait()); - QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); - QVERIFY(!transientSpy.first().at(1).value()); + QCOMPARE(transientSpy.first().first().value(), m_childSurfaceInterface.data()); + QVERIFY(!transientSpy.first().at(1).value()); QVERIFY(!m_foreignInterface->transientFor(m_childSurfaceInterface)); QVERIFY(!m_imported->isValid()); @@ -326,39 +285,39 @@ { doExport(); - //Export second window - KWayland::Client::XdgExported *exported2 = m_exporter->exportTopLevel(m_exportedSurface, m_connection); + // Export second window + KWayland::Client::XdgExported *exported2 = m_exporter->exportTopLevel(m_exportedSurface); QVERIFY(exported2->handle().isEmpty()); QSignalSpy doneSpy(exported2, &XdgExported::done); QVERIFY(doneSpy.wait()); QVERIFY(!exported2->handle().isEmpty()); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); QVERIFY(transientSpy.isValid()); - //Import the just exported window - KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(exported2->handle(), m_connection); + // Import the just exported window + KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(exported2->handle()); QVERIFY(imported2->isValid()); - //create a second child surface - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + // create a second child surface + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); KWayland::Client::Surface *childSurface2 = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWayland::Server::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); + KWaylandServer::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); imported2->setParentOf(childSurface2); QVERIFY(transientSpy.wait()); - - QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); - QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); - //transientFor api - //check the old relationship is still here + QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); + + // transientFor api + // check the old relationship is still here QCOMPARE(m_foreignInterface->transientFor(m_childSurfaceInterface), m_exportedSurfaceInterface.data()); - //check the new relationship + // check the new relationship QCOMPARE(m_foreignInterface->transientFor(childSurface2Interface), m_exportedSurfaceInterface.data()); } @@ -366,34 +325,46 @@ { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWayland::Server::XdgForeignInterface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); QVERIFY(transientSpy.isValid()); - //Import another time the exported window - KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(m_exported->handle(), m_connection); + // Import another time the exported window + KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(m_exported->handle()); QVERIFY(imported2->isValid()); - //create a second child surface - QSignalSpy serverSurfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); + // create a second child surface + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); QVERIFY(serverSurfaceCreated.isValid()); KWayland::Client::Surface *childSurface2 = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWayland::Server::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); + KWaylandServer::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); imported2->setParentOf(childSurface2); QVERIFY(transientSpy.wait()); - - QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); - QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); - //transientFor api - //check the old relationship is still here + QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); + + // transientFor api + // check the old relationship is still here QCOMPARE(m_foreignInterface->transientFor(m_childSurfaceInterface), m_exportedSurfaceInterface.data()); - //check the new relationship + // check the new relationship QCOMPARE(m_foreignInterface->transientFor(childSurface2Interface), m_exportedSurfaceInterface.data()); } +void TestForeign::testImportInvalidToplevel() +{ + // This test verifies that the compositor properly handles the case where a client + // attempts to import a toplevel with an invalid handle. + + KWayland::Client::XdgImported *imported = m_importer->importTopLevel(QStringLiteral("foobar")); + QVERIFY(imported->isValid()); + + QSignalSpy importedDestroySpy(imported, &KWayland::Client::XdgImported::importedDestroyed); + QVERIFY(importedDestroySpy.wait()); +} + QTEST_GUILESS_MAIN(TestForeign) #include "test_xdg_foreign.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_output.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_output.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_output.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_output.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,21 @@ -/******************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // KWin +#include "../../src/server/display.h" +#include "../../src/server/dpms_interface.h" +#include "../../src/server/output_interface.h" +#include "../../src/server/xdgoutput_v1_interface.h" #include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" #include "../../src/client/dpms.h" +#include "../../src/client/event_queue.h" #include "../../src/client/output.h" -#include "../../src/client/xdgoutput.h" #include "../../src/client/registry.h" -#include "../../src/server/display.h" -#include "../../src/server/dpms_interface.h" -#include "../../src/server/output_interface.h" -#include "../../src/server/xdgoutput_interface.h" +#include "../../src/client/xdgoutput.h" // Wayland @@ -42,11 +28,12 @@ void init(); void cleanup(); void testChanges(); + private: - KWayland::Server::Display *m_display; - KWayland::Server::OutputInterface *m_serverOutput; - KWayland::Server::XdgOutputManagerInterface *m_serverXdgOutputManager; - KWayland::Server::XdgOutputInterface *m_serverXdgOutput; + KWaylandServer::Display *m_display; + KWaylandServer::OutputInterface *m_serverOutput; + KWaylandServer::XdgOutputManagerV1Interface *m_serverXdgOutputManager; + KWaylandServer::XdgOutputV1Interface *m_serverXdgOutput; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::EventQueue *m_queue; QThread *m_thread; @@ -65,28 +52,28 @@ void TestXdgOutput::init() { - using namespace KWayland::Server; + using namespace KWaylandServer; delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); - m_serverOutput = m_display->createOutput(this); - m_serverOutput->addMode(QSize(1920, 1080), OutputInterface::ModeFlags(OutputInterface::ModeFlag::Preferred)); - m_serverOutput->setCurrentMode(QSize(1920, 1080)); - m_serverOutput->create(); - - m_serverXdgOutputManager = m_display->createXdgOutputManager(this); - m_serverXdgOutputManager->create(); - m_serverXdgOutput = m_serverXdgOutputManager->createXdgOutput(m_serverOutput, this); - m_serverXdgOutput->setLogicalSize(QSize(1280, 720)); //a 1.5 scale factor - m_serverXdgOutput->setLogicalPosition(QPoint(11,12)); //not a sensible value for one monitor, but works for this test + m_serverOutput = new OutputInterface(m_display, this); + m_serverOutput->setMode(QSize(1920, 1080)); + + m_serverXdgOutputManager = new XdgOutputManagerV1Interface(m_display, this); + m_serverXdgOutput = m_serverXdgOutputManager->createXdgOutput(m_serverOutput, this); + m_serverXdgOutput->setLogicalSize(QSize(1280, 720)); // a 1.5 scale factor + m_serverXdgOutput->setLogicalPosition(QPoint(11, 12)); // not a sensible value for one monitor, but works for this test + m_serverXdgOutput->setName("testName"); + m_serverXdgOutput->setDescription("testDescription"); + m_serverXdgOutput->done(); // setup connection m_connection = new KWayland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, SIGNAL(connected())); + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); m_connection->setSocketName(s_socketName); m_thread = new QThread(this); @@ -127,11 +114,11 @@ void TestXdgOutput::testChanges() { // verify the server modes - using namespace KWayland::Server; + using namespace KWaylandServer; using namespace KWayland::Client; KWayland::Client::Registry registry; - QSignalSpy announced(®istry, SIGNAL(outputAnnounced(quint32,quint32))); - QSignalSpy xdgOutputAnnounced(®istry, SIGNAL(xdgOutputAnnounced(quint32,quint32))); + QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); + QSignalSpy xdgOutputAnnounced(®istry, &KWayland::Client::Registry::xdgOutputAnnounced); registry.setEventQueue(m_queue); registry.create(m_connection->display()); @@ -143,31 +130,37 @@ } KWayland::Client::Output output; - QSignalSpy outputChanged(&output, SIGNAL(changed())); + QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed); output.setup(registry.bindOutput(announced.first().first().value(), announced.first().last().value())); QVERIFY(outputChanged.wait()); - QScopedPointer xdgOutputManager(registry.createXdgOutputManager(xdgOutputAnnounced.first().first().value(), xdgOutputAnnounced.first().last().value(), this)); + QScopedPointer xdgOutputManager( + registry.createXdgOutputManager(xdgOutputAnnounced.first().first().value(), xdgOutputAnnounced.first().last().value(), this)); QScopedPointer xdgOutput(xdgOutputManager->getXdgOutput(&output, this)); - QSignalSpy xdgOutputChanged(xdgOutput.data(), SIGNAL(changed())); + QSignalSpy xdgOutputChanged(xdgOutput.data(), &KWayland::Client::XdgOutput::changed); - //check details are sent on client bind + // check details are sent on client bind QVERIFY(xdgOutputChanged.wait()); xdgOutputChanged.clear(); - QCOMPARE(xdgOutput->logicalPosition(), QPoint(11,12)); - QCOMPARE(xdgOutput->logicalSize(), QSize(1280,720)); + QCOMPARE(xdgOutput->logicalPosition(), QPoint(11, 12)); + QCOMPARE(xdgOutput->logicalSize(), QSize(1280, 720)); + QCOMPARE(xdgOutput->name(), "testName"); + QCOMPARE(xdgOutput->description(), "testDescription"); - //dynamic updates + // dynamic updates m_serverXdgOutput->setLogicalPosition(QPoint(1000, 2000)); - m_serverXdgOutput->setLogicalSize(QSize(100,200)); + m_serverXdgOutput->setLogicalSize(QSize(100, 200)); + // names cannot dynamically change according to the spec + m_serverXdgOutput->done(); + m_serverOutput->done(); QVERIFY(xdgOutputChanged.wait()); QCOMPARE(xdgOutputChanged.count(), 1); QCOMPARE(xdgOutput->logicalPosition(), QPoint(1000, 2000)); - QCOMPARE(xdgOutput->logicalSize(), QSize(100,200)); + QCOMPARE(xdgOutput->logicalSize(), QSize(100, 200)); } QTEST_GUILESS_MAIN(TestXdgOutput) diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_shell.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_shell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,56 +1,108 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ - -#include "test_xdg_shell.h" - -XdgShellTest::XdgShellTest(XdgShellInterfaceVersion version): - m_version(version) -{} +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2017 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +// Qt +#include +// client +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/output.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/shm_pool.h" +#include "../../src/client/surface.h" +#include "../../src/client/xdgshell.h" +// server +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/output_interface.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/surface_interface.h" +#include "../../src/server/xdgshell_interface.h" + +using namespace KWayland::Client; +using namespace KWaylandServer; + +Q_DECLARE_METATYPE(Qt::MouseButton) static const QString s_socketName = QStringLiteral("kwayland-test-xdg_shell-0"); +class XdgShellTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + + void testCreateSurface(); + void testTitle(); + void testWindowClass(); + void testMaximize(); + void testMinimize(); + void testFullscreen(); + void testShowWindowMenu(); + void testMove(); + void testResize_data(); + void testResize(); + void testTransient(); + void testPing(); + void testClose(); + void testConfigureStates_data(); + void testConfigureStates(); + void testConfigureMultipleAcks(); + +private: + XdgShellInterface *m_xdgShellInterface = nullptr; + Compositor *m_compositor = nullptr; + XdgShell *m_xdgShell = nullptr; + Display *m_display = nullptr; + CompositorInterface *m_compositorInterface = nullptr; + OutputInterface *m_o1Interface = nullptr; + OutputInterface *m_o2Interface = nullptr; + SeatInterface *m_seatInterface = nullptr; + ConnectionThread *m_connection = nullptr; + QThread *m_thread = nullptr; + EventQueue *m_queue = nullptr; + ShmPool *m_shmPool = nullptr; + Output *m_output1 = nullptr; + Output *m_output2 = nullptr; + Seat *m_seat = nullptr; +}; + +#define SURFACE \ + QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \ + QVERIFY(xdgSurfaceCreatedSpy.isValid()); \ + QScopedPointer surface(m_compositor->createSurface()); \ + QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); \ + QCOMPARE(xdgSurface->size(), QSize()); \ + QVERIFY(xdgSurfaceCreatedSpy.wait()); \ + auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value(); \ + QVERIFY(serverXdgToplevel); + void XdgShellTest::init() { delete m_display; m_display = new Display(this); - m_display->setSocketName(s_socketName); + m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); m_display->createShm(); - m_o1Interface = m_display->createOutput(m_display); - m_o1Interface->addMode(QSize(1024, 768)); - m_o1Interface->create(); - m_o2Interface = m_display->createOutput(m_display); - m_o2Interface->addMode(QSize(1024, 768)); - m_o2Interface->create(); - m_seatInterface = m_display->createSeat(m_display); + m_o1Interface = new OutputInterface(m_display, m_display); + m_o1Interface->setMode(QSize(1024, 768)); + m_o2Interface = new OutputInterface(m_display, m_display); + m_o2Interface->setMode(QSize(1024, 768)); + m_seatInterface = new SeatInterface(m_display, m_display); m_seatInterface->setHasKeyboard(true); m_seatInterface->setHasPointer(true); m_seatInterface->setHasTouch(true); - m_seatInterface->create(); - m_compositorInterface = m_display->createCompositor(m_display); - m_compositorInterface->create(); - m_xdgShellInterface = m_display->createXdgShell(m_version, m_display); - QCOMPARE(m_xdgShellInterface->interfaceVersion(), m_version); - m_xdgShellInterface->create(); + m_compositorInterface = new CompositorInterface(m_display, m_display); + m_xdgShellInterface = new XdgShellInterface(m_display, m_display); // setup connection m_connection = new KWayland::Client::ConnectionThread; @@ -76,11 +128,7 @@ QSignalSpy outputAnnouncedSpy(®istry, &Registry::outputAnnounced); QVERIFY(outputAnnouncedSpy.isValid()); - auto shellAnnouncedSignal = m_version == XdgShellInterfaceVersion::UnstableV5 ? &Registry::xdgShellUnstableV5Announced : - m_version == XdgShellInterfaceVersion::UnstableV6 ? &Registry::xdgShellUnstableV6Announced : - &Registry::xdgShellStableAnnounced; - - QSignalSpy xdgShellAnnouncedSpy(®istry, shellAnnouncedSignal); + QSignalSpy xdgShellAnnouncedSpy(®istry, &Registry::xdgShellStableAnnounced); QVERIFY(xdgShellAnnouncedSpy.isValid()); registry.setEventQueue(m_queue); registry.create(m_connection); @@ -96,7 +144,8 @@ QVERIFY(m_shmPool); QVERIFY(m_shmPool->isValid()); - m_compositor = registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); + m_compositor = + registry.createCompositor(registry.interface(Registry::Interface::Compositor).name, registry.interface(Registry::Interface::Compositor).version, this); QVERIFY(m_compositor); QVERIFY(m_compositor->isValid()); @@ -106,21 +155,8 @@ QCOMPARE(xdgShellAnnouncedSpy.count(), 1); - Registry::Interface iface; - switch (m_version) { - case XdgShellInterfaceVersion::UnstableV5: - iface = Registry::Interface::XdgShellUnstableV5; - break; - case XdgShellInterfaceVersion::UnstableV6: - iface = Registry::Interface::XdgShellUnstableV6; - break; - case XdgShellInterfaceVersion::Stable: - iface = Registry::Interface::XdgShellStable; - break; - } - - m_xdgShell = registry.createXdgShell(registry.interface(iface).name, - registry.interface(iface).version, + m_xdgShell = registry.createXdgShell(registry.interface(Registry::Interface::XdgShellStable).name, + registry.interface(Registry::Interface::XdgShellStable).version, this); QVERIFY(m_xdgShell); QVERIFY(m_xdgShell->isValid()); @@ -128,10 +164,10 @@ void XdgShellTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_xdgShell) CLEANUP(m_compositor) @@ -151,13 +187,15 @@ m_thread = nullptr; } - CLEANUP(m_compositorInterface) - CLEANUP(m_xdgShellInterface) - CLEANUP(m_o1Interface); - CLEANUP(m_o2Interface); - CLEANUP(m_seatInterface); CLEANUP(m_display) #undef CLEANUP + + // these are the children of the display + m_compositorInterface = nullptr; + m_xdgShellInterface = nullptr; + m_o1Interface = nullptr; + m_o2Interface = nullptr; + m_seatInterface = nullptr; } void XdgShellTest::testCreateSurface() @@ -166,14 +204,14 @@ // first created the signal spies for the server QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QVERIFY(surfaceCreatedSpy.isValid()); - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); + QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); QVERIFY(xdgSurfaceCreatedSpy.isValid()); // create surface QScopedPointer surface(m_compositor->createSurface()); QVERIFY(!surface.isNull()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); // create shell surface @@ -181,17 +219,15 @@ QVERIFY(!xdgSurface.isNull()); QVERIFY(xdgSurfaceCreatedSpy.wait()); // verify base things - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); - QCOMPARE(serverXdgSurface->isConfigurePending(), false); - QCOMPARE(serverXdgSurface->title(), QString()); - QCOMPARE(serverXdgSurface->windowClass(), QByteArray()); - QCOMPARE(serverXdgSurface->isTransient(), false); - QCOMPARE(serverXdgSurface->transientFor(), QPointer()); - QCOMPARE(serverXdgSurface->surface(), serverSurface); + auto serverToplevel = xdgSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverToplevel); + QCOMPARE(serverToplevel->windowTitle(), QString()); + QCOMPARE(serverToplevel->windowClass(), QByteArray()); + QCOMPARE(serverToplevel->parentXdgToplevel(), nullptr); + QCOMPARE(serverToplevel->surface(), serverSurface); // now let's destroy it - QSignalSpy destroyedSpy(serverXdgSurface, &QObject::destroyed); + QSignalSpy destroyedSpy(serverToplevel, &QObject::destroyed); QVERIFY(destroyedSpy.isValid()); xdgSurface.reset(); QVERIFY(destroyedSpy.wait()); @@ -204,16 +240,16 @@ SURFACE // should not have a title yet - QCOMPARE(serverXdgSurface->title(), QString()); + QCOMPARE(serverXdgToplevel->windowTitle(), QString()); // lets' change the title - QSignalSpy titleChangedSpy(serverXdgSurface, &XdgShellSurfaceInterface::titleChanged); + QSignalSpy titleChangedSpy(serverXdgToplevel, &XdgToplevelInterface::windowTitleChanged); QVERIFY(titleChangedSpy.isValid()); xdgSurface->setTitle(QStringLiteral("foo")); QVERIFY(titleChangedSpy.wait()); QCOMPARE(titleChangedSpy.count(), 1); QCOMPARE(titleChangedSpy.first().first().toString(), QStringLiteral("foo")); - QCOMPARE(serverXdgSurface->title(), QStringLiteral("foo")); + QCOMPARE(serverXdgToplevel->windowTitle(), QStringLiteral("foo")); } void XdgShellTest::testWindowClass() @@ -223,16 +259,16 @@ SURFACE // should not have a window class yet - QCOMPARE(serverXdgSurface->windowClass(), QByteArray()); + QCOMPARE(serverXdgToplevel->windowClass(), QByteArray()); // let's change the window class - QSignalSpy windowClassChanged(serverXdgSurface, &XdgShellSurfaceInterface::windowClassChanged); + QSignalSpy windowClassChanged(serverXdgToplevel, &XdgToplevelInterface::windowClassChanged); QVERIFY(windowClassChanged.isValid()); xdgSurface->setAppId(QByteArrayLiteral("org.kde.xdgsurfacetest")); QVERIFY(windowClassChanged.wait()); QCOMPARE(windowClassChanged.count(), 1); QCOMPARE(windowClassChanged.first().first().toByteArray(), QByteArrayLiteral("org.kde.xdgsurfacetest")); - QCOMPARE(serverXdgSurface->windowClass(), QByteArrayLiteral("org.kde.xdgsurfacetest")); + QCOMPARE(serverXdgToplevel->windowClass(), QByteArrayLiteral("org.kde.xdgsurfacetest")); } void XdgShellTest::testMaximize() @@ -240,18 +276,18 @@ // this test verifies that the maximize/unmaximize calls work SURFACE - QSignalSpy maximizeRequestedSpy(serverXdgSurface, &XdgShellSurfaceInterface::maximizedChanged); + QSignalSpy maximizeRequestedSpy(serverXdgToplevel, &XdgToplevelInterface::maximizeRequested); QVERIFY(maximizeRequestedSpy.isValid()); + QSignalSpy unmaximizeRequestedSpy(serverXdgToplevel, &XdgToplevelInterface::unmaximizeRequested); + QVERIFY(unmaximizeRequestedSpy.isValid()); xdgSurface->setMaximized(true); QVERIFY(maximizeRequestedSpy.wait()); QCOMPARE(maximizeRequestedSpy.count(), 1); - QCOMPARE(maximizeRequestedSpy.last().first().toBool(), true); xdgSurface->setMaximized(false); - QVERIFY(maximizeRequestedSpy.wait()); - QCOMPARE(maximizeRequestedSpy.count(), 2); - QCOMPARE(maximizeRequestedSpy.last().first().toBool(), false); + QVERIFY(unmaximizeRequestedSpy.wait()); + QCOMPARE(unmaximizeRequestedSpy.count(), 1); } void XdgShellTest::testMinimize() @@ -259,7 +295,7 @@ // this test verifies that the minimize request is delivered SURFACE - QSignalSpy minimizeRequestedSpy(serverXdgSurface, &XdgShellSurfaceInterface::minimizeRequested); + QSignalSpy minimizeRequestedSpy(serverXdgToplevel, &XdgToplevelInterface::minimizeRequested); QVERIFY(minimizeRequestedSpy.isValid()); xdgSurface->requestMinimize(); @@ -269,105 +305,106 @@ void XdgShellTest::testFullscreen() { - qRegisterMetaType(); + qRegisterMetaType(); // this test verifies going to/from fullscreen - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); + SURFACE - QSignalSpy fullscreenSpy(serverXdgSurface, &XdgShellSurfaceInterface::fullscreenChanged); - QVERIFY(fullscreenSpy.isValid()); + QSignalSpy fullscreenRequestedSpy(serverXdgToplevel, &XdgToplevelInterface::fullscreenRequested); + QVERIFY(fullscreenRequestedSpy.isValid()); + QSignalSpy unfullscreenRequestedSpy(serverXdgToplevel, &XdgToplevelInterface::unfullscreenRequested); + QVERIFY(fullscreenRequestedSpy.isValid()); // without an output xdgSurface->setFullscreen(true, nullptr); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 1); - QCOMPARE(fullscreenSpy.last().at(0).toBool(), true); - QVERIFY(!fullscreenSpy.last().at(1).value()); + QVERIFY(fullscreenRequestedSpy.wait()); + QCOMPARE(fullscreenRequestedSpy.count(), 1); + QVERIFY(!fullscreenRequestedSpy.last().at(0).value()); // unset xdgSurface->setFullscreen(false); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 2); - QCOMPARE(fullscreenSpy.last().at(0).toBool(), false); - QVERIFY(!fullscreenSpy.last().at(1).value()); + QVERIFY(unfullscreenRequestedSpy.wait()); + QCOMPARE(unfullscreenRequestedSpy.count(), 1); // with outputs xdgSurface->setFullscreen(true, m_output1); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 3); - QCOMPARE(fullscreenSpy.last().at(0).toBool(), true); - QCOMPARE(fullscreenSpy.last().at(1).value(), m_o1Interface); + QVERIFY(fullscreenRequestedSpy.wait()); + QCOMPARE(fullscreenRequestedSpy.count(), 2); + QCOMPARE(fullscreenRequestedSpy.last().at(0).value(), m_o1Interface); // now other output xdgSurface->setFullscreen(true, m_output2); - QVERIFY(fullscreenSpy.wait()); - QCOMPARE(fullscreenSpy.count(), 4); - QCOMPARE(fullscreenSpy.last().at(0).toBool(), true); - QCOMPARE(fullscreenSpy.last().at(1).value(), m_o2Interface); + QVERIFY(fullscreenRequestedSpy.wait()); + QCOMPARE(fullscreenRequestedSpy.count(), 3); + QCOMPARE(fullscreenRequestedSpy.last().at(0).value(), m_o2Interface); } void XdgShellTest::testShowWindowMenu() { - qRegisterMetaType(); + qRegisterMetaType(); // this test verifies that the show window menu request works SURFACE - QSignalSpy windowMenuSpy(serverXdgSurface, &XdgShellSurfaceInterface::windowMenuRequested); + // hack: pretend that the xdg-surface had been configured + serverXdgToplevel->sendConfigure(QSize(0, 0), XdgToplevelInterface::States()); + + QSignalSpy windowMenuSpy(serverXdgToplevel, &XdgToplevelInterface::windowMenuRequested); QVERIFY(windowMenuSpy.isValid()); // TODO: the serial needs to be a proper one xdgSurface->requestShowWindowMenu(m_seat, 20, QPoint(30, 40)); QVERIFY(windowMenuSpy.wait()); QCOMPARE(windowMenuSpy.count(), 1); - QCOMPARE(windowMenuSpy.first().at(0).value(), m_seatInterface); - QCOMPARE(windowMenuSpy.first().at(1).value(), 20u); - QCOMPARE(windowMenuSpy.first().at(2).toPoint(), QPoint(30, 40)); + QCOMPARE(windowMenuSpy.first().at(0).value(), m_seatInterface); + QCOMPARE(windowMenuSpy.first().at(1).toPoint(), QPoint(30, 40)); + QCOMPARE(windowMenuSpy.first().at(2).value(), 20u); } void XdgShellTest::testMove() { - qRegisterMetaType(); + qRegisterMetaType(); // this test verifies that the move request works SURFACE - QSignalSpy moveSpy(serverXdgSurface, &XdgShellSurfaceInterface::moveRequested); + // hack: pretend that the xdg-surface had been configured + serverXdgToplevel->sendConfigure(QSize(0, 0), XdgToplevelInterface::States()); + + QSignalSpy moveSpy(serverXdgToplevel, &XdgToplevelInterface::moveRequested); QVERIFY(moveSpy.isValid()); // TODO: the serial needs to be a proper one xdgSurface->requestMove(m_seat, 50); QVERIFY(moveSpy.wait()); QCOMPARE(moveSpy.count(), 1); - QCOMPARE(moveSpy.first().at(0).value(), m_seatInterface); + QCOMPARE(moveSpy.first().at(0).value(), m_seatInterface); QCOMPARE(moveSpy.first().at(1).value(), 50u); } void XdgShellTest::testResize_data() { QTest::addColumn("edges"); + QTest::addColumn("anchor"); - QTest::newRow("none") << Qt::Edges(); - QTest::newRow("top") << Qt::Edges(Qt::TopEdge); - QTest::newRow("bottom") << Qt::Edges(Qt::BottomEdge); - QTest::newRow("left") << Qt::Edges(Qt::LeftEdge); - QTest::newRow("top left") << Qt::Edges(Qt::TopEdge | Qt::LeftEdge); - QTest::newRow("bottom left") << Qt::Edges(Qt::BottomEdge | Qt::LeftEdge); - QTest::newRow("right") << Qt::Edges(Qt::RightEdge); - QTest::newRow("top right") << Qt::Edges(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("bottom right") << Qt::Edges(Qt::BottomEdge | Qt::RightEdge); + QTest::newRow("none") << Qt::Edges() << XdgToplevelInterface::ResizeAnchor::None; + QTest::newRow("top") << Qt::Edges(Qt::TopEdge) << XdgToplevelInterface::ResizeAnchor::Top; + QTest::newRow("bottom") << Qt::Edges(Qt::BottomEdge) << XdgToplevelInterface::ResizeAnchor::Bottom; + QTest::newRow("left") << Qt::Edges(Qt::LeftEdge) << XdgToplevelInterface::ResizeAnchor::Left; + QTest::newRow("top left") << Qt::Edges(Qt::TopEdge | Qt::LeftEdge) << XdgToplevelInterface::ResizeAnchor::TopLeft; + QTest::newRow("bottom left") << Qt::Edges(Qt::BottomEdge | Qt::LeftEdge) << XdgToplevelInterface::ResizeAnchor::BottomLeft; + QTest::newRow("right") << Qt::Edges(Qt::RightEdge) << XdgToplevelInterface::ResizeAnchor::Right; + QTest::newRow("top right") << Qt::Edges(Qt::TopEdge | Qt::RightEdge) << XdgToplevelInterface::ResizeAnchor::TopRight; + QTest::newRow("bottom right") << Qt::Edges(Qt::BottomEdge | Qt::RightEdge) << XdgToplevelInterface::ResizeAnchor::BottomRight; } void XdgShellTest::testResize() { - qRegisterMetaType(); + qRegisterMetaType(); // this test verifies that the resize request works SURFACE - QSignalSpy resizeSpy(serverXdgSurface, &XdgShellSurfaceInterface::resizeRequested); + // hack: pretend that the xdg-surface had been configured + serverXdgToplevel->sendConfigure(QSize(0, 0), XdgToplevelInterface::States()); + + QSignalSpy resizeSpy(serverXdgToplevel, &XdgToplevelInterface::resizeRequested); QVERIFY(resizeSpy.isValid()); // TODO: the serial needs to be a proper one @@ -375,9 +412,9 @@ xdgSurface->requestResize(m_seat, 60, edges); QVERIFY(resizeSpy.wait()); QCOMPARE(resizeSpy.count(), 1); - QCOMPARE(resizeSpy.first().at(0).value(), m_seatInterface); - QCOMPARE(resizeSpy.first().at(1).value(), 60u); - QCOMPARE(resizeSpy.first().at(2).value(), edges); + QCOMPARE(resizeSpy.first().at(0).value(), m_seatInterface); + QTEST(resizeSpy.first().at(1).value(), "anchor"); + QCOMPARE(resizeSpy.first().at(2).value(), 60u); } void XdgShellTest::testTransient() @@ -387,30 +424,28 @@ QScopedPointer surface2(m_compositor->createSurface()); QScopedPointer xdgSurface2(m_xdgShell->createSurface(surface2.data())); QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface2 = xdgSurfaceCreatedSpy.last().first().value(); - QVERIFY(serverXdgSurface2); + auto serverXdgToplevel2 = xdgSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverXdgToplevel2); - QVERIFY(!serverXdgSurface->isTransient()); - QVERIFY(!serverXdgSurface2->isTransient()); + QVERIFY(!serverXdgToplevel->parentXdgToplevel()); + QVERIFY(!serverXdgToplevel2->parentXdgToplevel()); // now make xdsgSurface2 a transient for xdgSurface - QSignalSpy transientForSpy(serverXdgSurface2, &XdgShellSurfaceInterface::transientForChanged); + QSignalSpy transientForSpy(serverXdgToplevel2, &XdgToplevelInterface::parentXdgToplevelChanged); QVERIFY(transientForSpy.isValid()); xdgSurface2->setTransientFor(xdgSurface.data()); QVERIFY(transientForSpy.wait()); QCOMPARE(transientForSpy.count(), 1); - QVERIFY(serverXdgSurface2->isTransient()); - QCOMPARE(serverXdgSurface2->transientFor().data(), serverXdgSurface); - QVERIFY(!serverXdgSurface->isTransient()); + QCOMPARE(serverXdgToplevel2->parentXdgToplevel(), serverXdgToplevel); + QVERIFY(!serverXdgToplevel->parentXdgToplevel()); // unset the transient for xdgSurface2->setTransientFor(nullptr); QVERIFY(transientForSpy.wait()); QCOMPARE(transientForSpy.count(), 2); - QVERIFY(!serverXdgSurface2->isTransient()); - QVERIFY(serverXdgSurface2->transientFor().isNull()); - QVERIFY(!serverXdgSurface->isTransient()); + QVERIFY(!serverXdgToplevel2->parentXdgToplevel()); + QVERIFY(!serverXdgToplevel->parentXdgToplevel()); } void XdgShellTest::testPing() @@ -421,7 +456,7 @@ QSignalSpy pingSpy(m_xdgShellInterface, &XdgShellInterface::pongReceived); QVERIFY(pingSpy.isValid()); - quint32 serial = m_xdgShellInterface->ping(serverXdgSurface); + quint32 serial = m_xdgShellInterface->ping(serverXdgToplevel->xdgSurface()); QVERIFY(pingSpy.wait()); QCOMPARE(pingSpy.count(), 1); QCOMPARE(pingSpy.takeFirst().at(0).value(), serial); @@ -429,7 +464,7 @@ // test of a ping failure // disconnecting the connection thread to the queue will break the connection and pings will do a timeout disconnect(m_connection, &ConnectionThread::eventsRead, m_queue, &EventQueue::dispatch); - m_xdgShellInterface->ping(serverXdgSurface); + m_xdgShellInterface->ping(serverXdgToplevel->xdgSurface()); QSignalSpy pingDelayedSpy(m_xdgShellInterface, &XdgShellInterface::pingDelayed); QVERIFY(pingDelayedSpy.wait()); @@ -445,11 +480,11 @@ QSignalSpy closeSpy(xdgSurface.data(), &XdgShellSurface::closeRequested); QVERIFY(closeSpy.isValid()); - serverXdgSurface->close(); + serverXdgToplevel->sendClose(); QVERIFY(closeSpy.wait()); QCOMPARE(closeSpy.count(), 1); - QSignalSpy destroyedSpy(serverXdgSurface, &XdgShellSurfaceInterface::destroyed); + QSignalSpy destroyedSpy(serverXdgToplevel, &XdgToplevelInterface::destroyed); QVERIFY(destroyedSpy.isValid()); xdgSurface.reset(); QVERIFY(destroyedSpy.wait()); @@ -457,37 +492,37 @@ void XdgShellTest::testConfigureStates_data() { - QTest::addColumn("serverStates"); + QTest::addColumn("serverStates"); QTest::addColumn("clientStates"); - const auto sa = XdgShellSurfaceInterface::States(XdgShellSurfaceInterface::State::Activated); - const auto sm = XdgShellSurfaceInterface::States(XdgShellSurfaceInterface::State::Maximized); - const auto sf = XdgShellSurfaceInterface::States(XdgShellSurfaceInterface::State::Fullscreen); - const auto sr = XdgShellSurfaceInterface::States(XdgShellSurfaceInterface::State::Resizing); + const auto sa = XdgToplevelInterface::States(XdgToplevelInterface::State::Activated); + const auto sm = XdgToplevelInterface::States(XdgToplevelInterface::State::Maximized); + const auto sf = XdgToplevelInterface::States(XdgToplevelInterface::State::FullScreen); + const auto sr = XdgToplevelInterface::States(XdgToplevelInterface::State::Resizing); const auto ca = XdgShellSurface::States(XdgShellSurface::State::Activated); const auto cm = XdgShellSurface::States(XdgShellSurface::State::Maximized); const auto cf = XdgShellSurface::States(XdgShellSurface::State::Fullscreen); const auto cr = XdgShellSurface::States(XdgShellSurface::State::Resizing); - QTest::newRow("none") << XdgShellSurfaceInterface::States() << XdgShellSurface::States(); - QTest::newRow("Active") << sa << ca; - QTest::newRow("Maximize") << sm << cm; + QTest::newRow("none") << XdgToplevelInterface::States() << XdgShellSurface::States(); + QTest::newRow("Active") << sa << ca; + QTest::newRow("Maximize") << sm << cm; QTest::newRow("Fullscreen") << sf << cf; - QTest::newRow("Resizing") << sr << cr; + QTest::newRow("Resizing") << sr << cr; - QTest::newRow("Active/Maximize") << (sa | sm) << (ca | cm); - QTest::newRow("Active/Fullscreen") << (sa | sf) << (ca | cf); - QTest::newRow("Active/Resizing") << (sa | sr) << (ca | cr); - QTest::newRow("Maximize/Fullscreen") << (sm | sf) << (cm | cf); - QTest::newRow("Maximize/Resizing") << (sm | sr) << (cm | cr); - QTest::newRow("Fullscreen/Resizing") << (sf | sr) << (cf | cr); + QTest::newRow("Active/Maximize") << (sa | sm) << (ca | cm); + QTest::newRow("Active/Fullscreen") << (sa | sf) << (ca | cf); + QTest::newRow("Active/Resizing") << (sa | sr) << (ca | cr); + QTest::newRow("Maximize/Fullscreen") << (sm | sf) << (cm | cf); + QTest::newRow("Maximize/Resizing") << (sm | sr) << (cm | cr); + QTest::newRow("Fullscreen/Resizing") << (sf | sr) << (cf | cr); - QTest::newRow("Active/Maximize/Fullscreen") << (sa | sm | sf) << (ca | cm | cf); - QTest::newRow("Active/Maximize/Resizing") << (sa | sm | sr) << (ca | cm | cr); + QTest::newRow("Active/Maximize/Fullscreen") << (sa | sm | sf) << (ca | cm | cf); + QTest::newRow("Active/Maximize/Resizing") << (sa | sm | sr) << (ca | cm | cr); QTest::newRow("Maximize/Fullscreen|Resizing") << (sm | sf | sr) << (cm | cf | cr); - QTest::newRow("Active/Maximize/Fullscreen/Resizing") << (sa | sm | sf | sr) << (ca | cm | cf | cr); + QTest::newRow("Active/Maximize/Fullscreen/Resizing") << (sa | sm | sf | sr) << (ca | cm | cf | cr); } void XdgShellTest::testConfigureStates() @@ -499,18 +534,19 @@ QSignalSpy configureSpy(xdgSurface.data(), &XdgShellSurface::configureRequested); QVERIFY(configureSpy.isValid()); - QFETCH(XdgShellSurfaceInterface::States, serverStates); - serverXdgSurface->configure(serverStates); + QFETCH(XdgToplevelInterface::States, serverStates); + serverXdgToplevel->sendConfigure(QSize(0, 0), serverStates); QVERIFY(configureSpy.wait()); QCOMPARE(configureSpy.count(), 1); QCOMPARE(configureSpy.first().at(0).toSize(), QSize(0, 0)); QTEST(configureSpy.first().at(1).value(), "clientStates"); QCOMPARE(configureSpy.first().at(2).value(), m_display->serial()); - QSignalSpy ackSpy(serverXdgSurface, &XdgShellSurfaceInterface::configureAcknowledged); + QSignalSpy ackSpy(serverXdgToplevel->xdgSurface(), &XdgSurfaceInterface::configureAcknowledged); QVERIFY(ackSpy.isValid()); xdgSurface->ackConfigure(configureSpy.first().at(2).value()); + surface->commit(Surface::CommitFlag::None); QVERIFY(ackSpy.wait()); QCOMPARE(ackSpy.count(), 1); QCOMPARE(ackSpy.first().first().value(), configureSpy.first().at(2).value()); @@ -526,15 +562,15 @@ QVERIFY(configureSpy.isValid()); QSignalSpy sizeChangedSpy(xdgSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangedSpy.isValid()); - QSignalSpy ackSpy(serverXdgSurface, &XdgShellSurfaceInterface::configureAcknowledged); + QSignalSpy ackSpy(serverXdgToplevel->xdgSurface(), &XdgSurfaceInterface::configureAcknowledged); QVERIFY(ackSpy.isValid()); - serverXdgSurface->configure(XdgShellSurfaceInterface::States(), QSize(10, 20)); + serverXdgToplevel->sendConfigure(QSize(10, 20), XdgToplevelInterface::States()); const quint32 serial1 = m_display->serial(); - serverXdgSurface->configure(XdgShellSurfaceInterface::States(), QSize(20, 30)); + serverXdgToplevel->sendConfigure(QSize(20, 30), XdgToplevelInterface::States()); const quint32 serial2 = m_display->serial(); QVERIFY(serial1 != serial2); - serverXdgSurface->configure(XdgShellSurfaceInterface::States(), QSize(30, 40)); + serverXdgToplevel->sendConfigure(QSize(30, 40), XdgToplevelInterface::States()); const quint32 serial3 = m_display->serial(); QVERIFY(serial1 != serial3); QVERIFY(serial2 != serial3); @@ -557,17 +593,19 @@ QCOMPARE(xdgSurface->size(), QSize(30, 40)); xdgSurface->ackConfigure(serial3); + surface->commit(Surface::CommitFlag::None); QVERIFY(ackSpy.wait()); - QCOMPARE(ackSpy.count(), 3); - QCOMPARE(ackSpy.at(0).first().value(), serial1); - QCOMPARE(ackSpy.at(1).first().value(), serial2); - QCOMPARE(ackSpy.at(2).first().value(), serial3); + QCOMPARE(ackSpy.count(), 1); + QCOMPARE(ackSpy.last().first().value(), serial3); // configure once more with a null size - serverXdgSurface->configure(XdgShellSurfaceInterface::States()); + serverXdgToplevel->sendConfigure(QSize(0, 0), XdgToplevelInterface::States()); // should not change size QVERIFY(configureSpy.wait()); QCOMPARE(configureSpy.count(), 4); QCOMPARE(sizeChangedSpy.count(), 3); QCOMPARE(xdgSurface->size(), QSize(30, 40)); } + +QTEST_GUILESS_MAIN(XdgShellTest) +#include "test_xdg_shell.moc" diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_shell.h dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell.h --- dwayland-5.57.0.23/autotests/client/test_xdg_shell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef TEST_XDG_SHELL_H -#define TEST_XDG_SHELL_H - -// Qt -#include -// client -#include "../../src/client/xdgshell.h" -#include "../../src/client/connection_thread.h" -#include "../../src/client/compositor.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/registry.h" -#include "../../src/client/output.h" -#include "../../src/client/seat.h" -#include "../../src/client/shm_pool.h" -#include "../../src/client/surface.h" -// server -#include "../../src/server/display.h" -#include "../../src/server/compositor_interface.h" -#include "../../src/server/output_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/surface_interface.h" -#include "../../src/server/xdgshell_interface.h" - -using namespace KWayland::Client; -using namespace KWayland::Server; - -Q_DECLARE_METATYPE(Qt::MouseButton) - -class XdgShellTest : public QObject -{ - Q_OBJECT - -protected: - XdgShellTest(XdgShellInterfaceVersion version); -private Q_SLOTS: - void init(); - void cleanup(); - - void testCreateSurface(); - void testTitle(); - void testWindowClass(); - void testMaximize(); - void testMinimize(); - void testFullscreen(); - void testShowWindowMenu(); - void testMove(); - void testResize_data(); - void testResize(); - void testTransient(); - void testPing(); - void testClose(); - void testConfigureStates_data(); - void testConfigureStates(); - void testConfigureMultipleAcks(); - -protected: - XdgShellInterface *m_xdgShellInterface = nullptr; - Compositor *m_compositor = nullptr; - XdgShell *m_xdgShell = nullptr; - Display *m_display = nullptr; - CompositorInterface *m_compositorInterface = nullptr; - OutputInterface *m_o1Interface = nullptr; - OutputInterface *m_o2Interface = nullptr; - SeatInterface *m_seatInterface = nullptr; - ConnectionThread *m_connection = nullptr; - QThread *m_thread = nullptr; - EventQueue *m_queue = nullptr; - ShmPool *m_shmPool = nullptr; - Output *m_output1 = nullptr; - Output *m_output2 = nullptr; - Seat *m_seat = nullptr; - -private: - XdgShellInterfaceVersion m_version; -}; - -#define SURFACE \ - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); \ - QVERIFY(xdgSurfaceCreatedSpy.isValid()); \ - QScopedPointer surface(m_compositor->createSurface()); \ - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); \ - QCOMPARE(xdgSurface->size(), QSize()); \ - QVERIFY(xdgSurfaceCreatedSpy.wait()); \ - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); \ - QVERIFY(serverXdgSurface); - -#endif diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_shell_stable.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_stable.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_shell_stable.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_stable.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ - -#include "test_xdg_shell.h" -#include "./../build/src/server/wayland-xdg-shell-client-protocol.h" - -class XdgShellTestStable : public XdgShellTest { - Q_OBJECT -public: - XdgShellTestStable() : - XdgShellTest(KWayland::Server::XdgShellInterfaceVersion::Stable) {} - -private Q_SLOTS: - void testMaxSize(); - void testMinSize(); - - void testPopup_data(); - void testPopup(); - - void testMultipleRoles1(); - void testMultipleRoles2(); -}; - -void XdgShellTestStable::testMaxSize() -{ - qRegisterMetaType(); - // this test verifies changing the window maxSize - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); - - QSignalSpy maxSizeSpy(serverXdgSurface, &XdgShellSurfaceInterface::maxSizeChanged); - QVERIFY(maxSizeSpy.isValid()); - - xdgSurface->setMaxSize(QSize(100, 100)); - QVERIFY(maxSizeSpy.wait()); - QCOMPARE(maxSizeSpy.count(), 1); - QCOMPARE(maxSizeSpy.last().at(0).value(), QSize(100,100)); - - xdgSurface->setMaxSize(QSize(200, 200)); - QVERIFY(maxSizeSpy.wait()); - QCOMPARE(maxSizeSpy.count(), 2); - QCOMPARE(maxSizeSpy.last().at(0).value(), QSize(200,200)); -} - - -void XdgShellTestStable::testPopup_data() -{ - QTest::addColumn("positioner"); - XdgPositioner positioner(QSize(10,10), QRect(100,100,50,50)); - QTest::newRow("default") << positioner; - - XdgPositioner positioner2(QSize(20,20), QRect(101,102,51,52)); - QTest::newRow("sizeAndAnchorRect") << positioner2; - - positioner.setAnchorEdge(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("anchorEdge") << positioner; - - positioner.setGravity(Qt::BottomEdge); - QTest::newRow("gravity") << positioner; - - positioner.setGravity(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("gravity2") << positioner; - - positioner.setConstraints(XdgPositioner::Constraint::SlideX | XdgPositioner::Constraint::FlipY); - QTest::newRow("constraints") << positioner; - - positioner.setConstraints(XdgPositioner::Constraint::SlideX | XdgPositioner::Constraint::SlideY | XdgPositioner::Constraint::FlipX | XdgPositioner::Constraint::FlipY | XdgPositioner::Constraint::ResizeX | XdgPositioner::Constraint::ResizeY); - QTest::newRow("constraints2") << positioner; - - positioner.setAnchorOffset(QPoint(4,5)); - QTest::newRow("offset") << positioner; -} - -void XdgShellTestStable::testPopup() -{ - QSignalSpy xdgTopLevelCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QScopedPointer parentSurface(m_compositor->createSurface()); - QScopedPointer xdgParentSurface(m_xdgShell->createSurface(parentSurface.data())); - - QVERIFY(xdgTopLevelCreatedSpy.wait()); - auto serverXdgTopLevel = xdgTopLevelCreatedSpy.first().first().value(); - - QFETCH(XdgPositioner, positioner); - - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createPopup(surface.data(), xdgParentSurface.data(), positioner)); - QVERIFY(xdgPopupCreatedSpy.wait()); - auto serverXdgPopup = xdgPopupCreatedSpy.first().first().value(); - QVERIFY(serverXdgPopup); - - QCOMPARE(serverXdgPopup->initialSize(), positioner.initialSize()); - QCOMPARE(serverXdgPopup->anchorRect(), positioner.anchorRect()); - QCOMPARE(serverXdgPopup->anchorEdge(), positioner.anchorEdge()); - QCOMPARE(serverXdgPopup->gravity(), positioner.gravity()); - QCOMPARE(serverXdgPopup->anchorOffset(), positioner.anchorOffset()); - //we have different enums for client server, but they share the same values - QCOMPARE((int)serverXdgPopup->constraintAdjustments(), (int)positioner.constraints()); - QCOMPARE(serverXdgPopup->transientFor().data(), serverXdgTopLevel->surface()); -} - -void XdgShellTestStable::testMinSize() -{ - qRegisterMetaType(); - // this test verifies changing the window minSize - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); - - QSignalSpy minSizeSpy(serverXdgSurface, &XdgShellSurfaceInterface::minSizeChanged); - QVERIFY(minSizeSpy.isValid()); - - xdgSurface->setMinSize(QSize(200, 200)); - QVERIFY(minSizeSpy.wait()); - QCOMPARE(minSizeSpy.count(), 1); - QCOMPARE(minSizeSpy.last().at(0).value(), QSize(200,200)); - - xdgSurface->setMinSize(QSize(100, 100)); - QVERIFY(minSizeSpy.wait()); - QCOMPARE(minSizeSpy.count(), 2); - QCOMPARE(minSizeSpy.last().at(0).value(), QSize(100,100)); -} - -//top level then toplevel -void XdgShellTestStable::testMultipleRoles1() -{ - //setting multiple roles on an xdg surface should fail - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QVERIFY(xdgPopupCreatedSpy.isValid()); - - QScopedPointer surface(m_compositor->createSurface()); - //This is testing we work when a client does something stupid - //we can't use KWayland API here because by design that stops you from doing anything stupid - - qDebug() << (xdg_wm_base*)*m_xdgShell; - auto xdgSurface = xdg_wm_base_get_xdg_surface(*m_xdgShell, *surface.data()); - - //create a top level - auto xdgTopLevel1 = xdg_surface_get_toplevel(xdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - //now try to create another top level for the same xdg surface. It should fail - auto xdgTopLevel2 = xdg_surface_get_toplevel(xdgSurface); - QVERIFY(!xdgSurfaceCreatedSpy.wait(10)); - - xdg_toplevel_destroy(xdgTopLevel1); - xdg_toplevel_destroy(xdgTopLevel2); - xdg_surface_destroy(xdgSurface); -} - -//toplevel then popup -void XdgShellTestStable::testMultipleRoles2() -{ - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QVERIFY(xdgPopupCreatedSpy.isValid()); - - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer parentSurface(m_compositor->createSurface()); - - auto parentXdgSurface = xdg_wm_base_get_xdg_surface(*m_xdgShell, *parentSurface.data()); - auto xdgTopLevelParent = xdg_surface_get_toplevel(parentXdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - - auto xdgSurface = xdg_wm_base_get_xdg_surface(*m_xdgShell, *surface.data()); - //create a top level - auto xdgTopLevel1 = xdg_surface_get_toplevel(xdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - //now try to create a popup on the same xdg surface. It should fail - - auto positioner = xdg_wm_base_create_positioner(*m_xdgShell); - xdg_positioner_set_anchor_rect(positioner,10, 10, 10, 10); - xdg_positioner_set_size(positioner,10, 100); - - auto xdgPopup2 = xdg_surface_get_popup(xdgSurface, parentXdgSurface, positioner); - QVERIFY(!xdgPopupCreatedSpy.wait(10)); - - xdg_positioner_destroy(positioner); - xdg_toplevel_destroy(xdgTopLevel1); - xdg_toplevel_destroy(xdgTopLevelParent); - xdg_popup_destroy(xdgPopup2); - xdg_surface_destroy(xdgSurface); -} - - -QTEST_GUILESS_MAIN(XdgShellTestStable) - -#include "test_xdg_shell_stable.moc" - diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_shell_v5.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_v5.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_shell_v5.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_v5.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ - -#include "test_xdg_shell.h" - -class XdgShellTestV5 : public XdgShellTest { - Q_OBJECT -public: - XdgShellTestV5() : - XdgShellTest(KWayland::Server::XdgShellInterfaceVersion::UnstableV5) {} -private Q_SLOTS: - void testPopup(); -}; - -void XdgShellTestV5::testPopup() -{ - // this test verifies that the creation of popups works correctly - SURFACE - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); - QVERIFY(surfaceCreatedSpy.isValid()); - QSignalSpy xdgPopupSpy(m_xdgShellInterface, &XdgShellInterface::popupCreated); - - //check as well as the compat signal, the new signal is also fired - QSignalSpy xdgPopupSpyNew(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - - QVERIFY(xdgPopupSpy.isValid()); - - QScopedPointer popupSurface(m_compositor->createSurface()); - QVERIFY(surfaceCreatedSpy.wait()); - - // TODO: proper serial - QScopedPointer xdgPopup(m_xdgShell->createPopup(popupSurface.data(), surface.data(), m_seat, 120, QPoint(10, 20))); - QVERIFY(xdgPopupSpy.wait()); - QCOMPARE(xdgPopupSpy.count(), 1); - QCOMPARE(xdgPopupSpyNew.count(), 1); - - - QCOMPARE(xdgPopupSpy.first().at(1).value(), m_seatInterface); - QCOMPARE(xdgPopupSpy.first().at(2).value(), 120u); - auto serverXdgPopup = xdgPopupSpy.first().first().value(); - QVERIFY(serverXdgPopup); - - QCOMPARE(serverXdgPopup->surface(), surfaceCreatedSpy.first().first().value()); - QCOMPARE(serverXdgPopup->transientFor().data(), serverXdgSurface->surface()); - QCOMPARE(serverXdgPopup->transientOffset(), QPoint(10, 20)); - - // now also a popup for the popup - QScopedPointer popup2Surface(m_compositor->createSurface()); - QScopedPointer xdgPopup2(m_xdgShell->createPopup(popup2Surface.data(), popupSurface.data(), m_seat, 121, QPoint(5, 7))); - QVERIFY(xdgPopupSpy.wait()); - QCOMPARE(xdgPopupSpy.count(), 2); - QCOMPARE(xdgPopupSpy.last().at(1).value(), m_seatInterface); - QCOMPARE(xdgPopupSpy.last().at(2).value(), 121u); - auto serverXdgPopup2 = xdgPopupSpy.last().first().value(); - QVERIFY(serverXdgPopup2); - - QCOMPARE(serverXdgPopup2->surface(), surfaceCreatedSpy.last().first().value()); - QCOMPARE(serverXdgPopup2->transientFor().data(), serverXdgPopup->surface()); - QCOMPARE(serverXdgPopup2->transientOffset(), QPoint(5, 7)); - - QSignalSpy popup2DoneSpy(xdgPopup2.data(), &XdgShellPopup::popupDone); - QVERIFY(popup2DoneSpy.isValid()); - serverXdgPopup2->popupDone(); - QVERIFY(popup2DoneSpy.wait()); - // TODO: test that this sends also the done to all parents -} - - - - -QTEST_GUILESS_MAIN(XdgShellTestV5) - -#include "test_xdg_shell_v5.moc" - diff -Nru dwayland-5.57.0.23/autotests/client/test_xdg_shell_v6.cpp dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_v6.cpp --- dwayland-5.57.0.23/autotests/client/test_xdg_shell_v6.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/client/test_xdg_shell_v6.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ - -#include "test_xdg_shell.h" -#include "./../build/src/server/wayland-xdg-shell-v6-client-protocol.h" - -class XdgShellTestV6 : public XdgShellTest { - Q_OBJECT -public: - XdgShellTestV6() : - XdgShellTest(KWayland::Server::XdgShellInterfaceVersion::UnstableV6) {} - -private Q_SLOTS: - void testMaxSize(); - void testMinSize(); - - void testPopup_data(); - void testPopup(); - - void testMultipleRoles1(); - void testMultipleRoles2(); -}; - -void XdgShellTestV6::testMaxSize() -{ - qRegisterMetaType(); - // this test verifies changing the window maxSize - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); - - QSignalSpy maxSizeSpy(serverXdgSurface, &XdgShellSurfaceInterface::maxSizeChanged); - QVERIFY(maxSizeSpy.isValid()); - - xdgSurface->setMaxSize(QSize(100, 100)); - QVERIFY(maxSizeSpy.wait()); - QCOMPARE(maxSizeSpy.count(), 1); - QCOMPARE(maxSizeSpy.last().at(0).value(), QSize(100,100)); - - xdgSurface->setMaxSize(QSize(200, 200)); - QVERIFY(maxSizeSpy.wait()); - QCOMPARE(maxSizeSpy.count(), 2); - QCOMPARE(maxSizeSpy.last().at(0).value(), QSize(200,200)); -} - - -void XdgShellTestV6::testPopup_data() -{ - QTest::addColumn("positioner"); - XdgPositioner positioner(QSize(10,10), QRect(100,100,50,50)); - QTest::newRow("default") << positioner; - - XdgPositioner positioner2(QSize(20,20), QRect(101,102,51,52)); - QTest::newRow("sizeAndAnchorRect") << positioner2; - - positioner.setAnchorEdge(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("anchorEdge") << positioner; - - positioner.setGravity(Qt::BottomEdge); - QTest::newRow("gravity") << positioner; - - positioner.setGravity(Qt::TopEdge | Qt::RightEdge); - QTest::newRow("gravity2") << positioner; - - positioner.setConstraints(XdgPositioner::Constraint::SlideX | XdgPositioner::Constraint::FlipY); - QTest::newRow("constraints") << positioner; - - positioner.setConstraints(XdgPositioner::Constraint::SlideX | XdgPositioner::Constraint::SlideY | XdgPositioner::Constraint::FlipX | XdgPositioner::Constraint::FlipY | XdgPositioner::Constraint::ResizeX | XdgPositioner::Constraint::ResizeY); - QTest::newRow("constraints2") << positioner; - - positioner.setAnchorOffset(QPoint(4,5)); - QTest::newRow("offset") << positioner; -} - -void XdgShellTestV6::testPopup() -{ - QSignalSpy xdgTopLevelCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QScopedPointer parentSurface(m_compositor->createSurface()); - QScopedPointer xdgParentSurface(m_xdgShell->createSurface(parentSurface.data())); - - QVERIFY(xdgTopLevelCreatedSpy.wait()); - auto serverXdgTopLevel = xdgTopLevelCreatedSpy.first().first().value(); - - QFETCH(XdgPositioner, positioner); - - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createPopup(surface.data(), xdgParentSurface.data(), positioner)); - QVERIFY(xdgPopupCreatedSpy.wait()); - auto serverXdgPopup = xdgPopupCreatedSpy.first().first().value(); - QVERIFY(serverXdgPopup); - - QCOMPARE(serverXdgPopup->initialSize(), positioner.initialSize()); - QCOMPARE(serverXdgPopup->anchorRect(), positioner.anchorRect()); - QCOMPARE(serverXdgPopup->anchorEdge(), positioner.anchorEdge()); - QCOMPARE(serverXdgPopup->gravity(), positioner.gravity()); - QCOMPARE(serverXdgPopup->anchorOffset(), positioner.anchorOffset()); - //we have different enums for client server, but they share the same values - QCOMPARE((int)serverXdgPopup->constraintAdjustments(), (int)positioner.constraints()); - QCOMPARE(serverXdgPopup->transientFor().data(), serverXdgTopLevel->surface()); -} - -void XdgShellTestV6::testMinSize() -{ - qRegisterMetaType(); - // this test verifies changing the window minSize - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - auto serverXdgSurface = xdgSurfaceCreatedSpy.first().first().value(); - QVERIFY(serverXdgSurface); - - QSignalSpy minSizeSpy(serverXdgSurface, &XdgShellSurfaceInterface::minSizeChanged); - QVERIFY(minSizeSpy.isValid()); - - xdgSurface->setMinSize(QSize(200, 200)); - QVERIFY(minSizeSpy.wait()); - QCOMPARE(minSizeSpy.count(), 1); - QCOMPARE(minSizeSpy.last().at(0).value(), QSize(200,200)); - - xdgSurface->setMinSize(QSize(100, 100)); - QVERIFY(minSizeSpy.wait()); - QCOMPARE(minSizeSpy.count(), 2); - QCOMPARE(minSizeSpy.last().at(0).value(), QSize(100,100)); -} - -//top level then toplevel -void XdgShellTestV6::testMultipleRoles1() -{ - //setting multiple roles on an xdg surface should fail - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QVERIFY(xdgPopupCreatedSpy.isValid()); - - QScopedPointer surface(m_compositor->createSurface()); - //This is testing we work when a client does something stupid - //we can't use KWayland API here because by design that stops you from doing anything stupid - auto xdgSurface = zxdg_shell_v6_get_xdg_surface(*m_xdgShell, *surface.data()); - - //create a top level - auto xdgTopLevel1 = zxdg_surface_v6_get_toplevel(xdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - //now try to create another top level for the same xdg surface. It should fail - auto xdgTopLevel2 = zxdg_surface_v6_get_toplevel(xdgSurface); - QVERIFY(!xdgSurfaceCreatedSpy.wait(10)); - - zxdg_toplevel_v6_destroy(xdgTopLevel1); - zxdg_toplevel_v6_destroy(xdgTopLevel2); - zxdg_surface_v6_destroy(xdgSurface); -} - -//toplevel then popup -void XdgShellTestV6::testMultipleRoles2() -{ - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::surfaceCreated); - QSignalSpy xdgPopupCreatedSpy(m_xdgShellInterface, &XdgShellInterface::xdgPopupCreated); - - QVERIFY(xdgSurfaceCreatedSpy.isValid()); - QVERIFY(xdgPopupCreatedSpy.isValid()); - - QScopedPointer surface(m_compositor->createSurface()); - QScopedPointer parentSurface(m_compositor->createSurface()); - - auto parentXdgSurface = zxdg_shell_v6_get_xdg_surface(*m_xdgShell, *parentSurface.data()); - auto xdgTopLevelParent = zxdg_surface_v6_get_toplevel(parentXdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - - auto xdgSurface = zxdg_shell_v6_get_xdg_surface(*m_xdgShell, *surface.data()); - //create a top level - auto xdgTopLevel1 = zxdg_surface_v6_get_toplevel(xdgSurface); - QVERIFY(xdgSurfaceCreatedSpy.wait()); - - //now try to create a popup on the same xdg surface. It should fail - - auto positioner = zxdg_shell_v6_create_positioner(*m_xdgShell); - zxdg_positioner_v6_set_anchor_rect(positioner,10, 10, 10, 10); - zxdg_positioner_v6_set_size(positioner,10, 100); - - auto xdgPopup2 = zxdg_surface_v6_get_popup(xdgSurface, parentXdgSurface, positioner); - QVERIFY(!xdgPopupCreatedSpy.wait(10)); - - zxdg_positioner_v6_destroy(positioner); - zxdg_toplevel_v6_destroy(xdgTopLevel1); - zxdg_toplevel_v6_destroy(xdgTopLevelParent); - zxdg_popup_v6_destroy(xdgPopup2); - zxdg_surface_v6_destroy(xdgSurface); -} - - -QTEST_GUILESS_MAIN(XdgShellTestV6) - -#include "test_xdg_shell_v6.moc" - diff -Nru dwayland-5.57.0.23/autotests/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/autotests/CMakeLists.txt --- dwayland-5.57.0.23/autotests/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,6 +1,6 @@ include(ECMMarkAsTest) -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test) +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Test) remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) remove_definitions(-DQT_NO_CAST_FROM_ASCII) diff -Nru dwayland-5.57.0.23/autotests/server/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/autotests/server/CMakeLists.txt --- dwayland-5.57.0.23/autotests/server/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -5,7 +5,7 @@ test_display.cpp ) add_executable(testWaylandServerDisplay ${testWaylandServerDisplay_SRCS}) -target_link_libraries( testWaylandServerDisplay Qt5::Test Qt5::Gui KF5::WaylandServer Wayland::Server) +target_link_libraries( testWaylandServerDisplay Qt::Test Qt::Gui Deepin::DWaylandServer Wayland::Server) add_test(NAME kwayland-testWaylandServerDisplay COMMAND testWaylandServerDisplay) ecm_mark_as_test(testWaylandServerDisplay) @@ -16,32 +16,119 @@ test_seat.cpp ) add_executable(testWaylandServerSeat ${testWaylandServerSeat_SRCS}) -target_link_libraries( testWaylandServerSeat Qt5::Test Qt5::Gui KF5::WaylandServer Wayland::Server) +target_link_libraries( testWaylandServerSeat Qt::Test Qt::Gui Deepin::DWaylandServer Wayland::Server) add_test(NAME kwayland-testWaylandServerSeat COMMAND testWaylandServerSeat) ecm_mark_as_test(testWaylandServerSeat) ######################################################## -# QtSurfaceExtenstion Helper +# Test No XDG_RUNTIME_DIR +######################################################## +add_executable(testNoXdgRuntimeDir test_no_xdg_runtime_dir.cpp) +target_link_libraries( testNoXdgRuntimeDir Qt::Test Deepin::DWaylandServer) +add_test(NAME kwayland-testNoXdgRuntimeDir COMMAND testNoXdgRuntimeDir) +ecm_mark_as_test(testNoXdgRuntimeDir) + ######################################################## -add_executable(surfaceExtensionHelper surfaceextension_helper.cpp) -target_link_libraries( surfaceExtensionHelper Qt5::Gui) -ecm_mark_as_test(surfaceExtensionHelper) +# Test Tablet Interface +######################################################## +ecm_add_qtwayland_client_protocol(TABLET_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml + BASENAME tablet-unstable-v2 +) +add_executable(testTabletInterface test_tablet_interface.cpp ${TABLET_SRCS}) +target_link_libraries( testTabletInterface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testTabletInterface COMMAND testTabletInterface) +ecm_mark_as_test(testTabletInterface) ######################################################## -# Test QtSurfaceExtenstion +# Test DataControlInterface ######################################################## -set( testQtSurfaceExtension_SRCS - test_qt_surface_extension.cpp +ecm_add_qtwayland_client_protocol(DATACONTROL_SRCS + PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-data-control-unstable-v1.xml + BASENAME wlr-data-control-unstable-v1 +) +add_executable(testDataControlInterface test_datacontrol_interface.cpp ${DATACONTROL_SRCS}) +target_link_libraries( testDataControlInterface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testDataControlInterface COMMAND testDataControlInterface) +ecm_mark_as_test(testDataControlInterface) + +######################################################## +# Test Keyboard Shortcuts Inhibitor Interface +######################################################## +ecm_add_qtwayland_client_protocol(KEYBOARD_SHORTCUTS_INHIBITOR_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml + BASENAME keyboard-shortcuts-inhibit-unstable-v1 ) -add_executable(testQtSurfaceExtension ${testQtSurfaceExtension_SRCS}) -target_link_libraries( testQtSurfaceExtension Qt5::Test Qt5::Gui KF5::WaylandServer) -add_test(NAME kwayland-testQtSurfaceExtension COMMAND testQtSurfaceExtension) -ecm_mark_as_test(testQtSurfaceExtension) +add_executable(testKeyboardShortcutsInhibitorInterface test_keyboard_shortcuts_inhibitor_interface.cpp ${KEYBOARD_SHORTCUTS_INHIBITOR_SRCS}) +target_link_libraries(testKeyboardShortcutsInhibitorInterface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testKeyboardShortcutsInhibitorInterface COMMAND testKeyboardShortcutsInhibitorInterface) +ecm_mark_as_test(testKeyboardShortcutsInhibitorInterface) ######################################################## -# Test No XDG_RUNTIME_DIR +# Test Viewporter Interface ######################################################## -add_executable(testNoXdgRuntimeDir test_no_xdg_runtime_dir.cpp) -target_link_libraries( testNoXdgRuntimeDir Qt5::Test KF5::WaylandServer) -add_test(NAME kwayland-testNoXdgRuntimeDir COMMAND testNoXdgRuntimeDir) -ecm_mark_as_test(testNoXdgRuntimeDir) +ecm_add_qtwayland_client_protocol(VIEWPORTER_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml + BASENAME viewporter + ) +add_executable(testViewporterInterface test_viewporter_interface.cpp ${VIEWPORTER_SRCS}) +target_link_libraries(testViewporterInterface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testViewporterInterface COMMAND testViewporterInterface) +ecm_mark_as_test(testViewporterInterface) + +######################################################## +# Test ScreencastV1Interface +######################################################## +ecm_add_qtwayland_client_protocol(SCREENCAST_SRCS + PROTOCOL PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/screencast.xml + BASENAME zkde-screencast-unstable-v1 +) +add_executable(testScreencastV1Interface test_screencast.cpp ${SCREENCAST_SRCS}) +target_link_libraries(testScreencastV1Interface Qt::Test Deepin::DWaylandServer Wayland::Client Deepin::WaylandClient) +add_test(NAME kwayland-testScreencastV1Interface COMMAND testScreencastV1Interface) +ecm_mark_as_test(testScreencastV1Interface) + +######################################################## +# Test InputMethod Interface +######################################################## +ecm_add_qtwayland_client_protocol(INPUTMETHOD_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml + BASENAME input-method-unstable-v1 + ) +ecm_add_qtwayland_client_protocol(VIEWPORTER_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml + BASENAME text-input-unstable-v1 + ) +add_executable(testInputMethodInterface test_inputmethod_interface.cpp ${INPUTMETHOD_SRCS}) +target_link_libraries(testInputMethodInterface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testInputMethodInterface COMMAND testInputMethodInterface) +ecm_mark_as_test(testInputMethodInterface) + +######################################################## +# Test LayerShellV1 Interface +######################################################## +ecm_add_qtwayland_client_protocol(LAYERSHELLV1_SRCS + PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-layer-shell-unstable-v1.xml + BASENAME wlr-layer-shell-unstable-v1 +) +ecm_add_qtwayland_client_protocol(LAYERSHELLV1_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml + BASENAME xdg-shell +) +add_executable(testLayerShellV1Interface test_layershellv1_interface.cpp ${LAYERSHELLV1_SRCS}) +target_link_libraries(testLayerShellV1Interface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testLayerShellV1Interface COMMAND testLayerShellV1Interface) +ecm_mark_as_test(testLayerShellV1Interface) + + +######################################################## +# Test TextInputV3 Interface +######################################################## +ecm_add_qtwayland_client_protocol(TEXTINPUTV3_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml + BASENAME text-input-unstable-v3 +) +add_executable(testTextInputV3Interface test_textinputv3_interface.cpp ${TEXTINPUTV3_SRCS}) +target_link_libraries(testTextInputV3Interface Qt::Test Deepin::DWaylandServer Deepin::WaylandClient Wayland::Client) +add_test(NAME kwayland-testTextInputV3Interface COMMAND testTextInputV3Interface) +ecm_mark_as_test(testTextInputV3Interface) diff -Nru dwayland-5.57.0.23/autotests/server/surfaceextension_helper.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/surfaceextension_helper.cpp --- dwayland-5.57.0.23/autotests/server/surfaceextension_helper.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/surfaceextension_helper.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include -#include -#include - -class Window : public QRasterWindow -{ - Q_OBJECT -public: - explicit Window(); - virtual ~Window(); - -protected: - void paintEvent(QPaintEvent *event) override; -}; - -Window::Window() - : QRasterWindow() -{ - setGeometry(QRect(0, 0, 200, 200)); -} - -Window::~Window() = default; - -void Window::paintEvent(QPaintEvent *event) -{ - Q_UNUSED(event) - QPainter p(this); - p.fillRect(QRect(QPoint(0, 0), size()), Qt::black); -} - -int main(int argc, char **argv) -{ - qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("wayland")); - QGuiApplication app(argc, argv); - - QScopedPointer w(new Window); - w->show(); - - return app.exec(); -} - -#include "surfaceextension_helper.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_datacontrol_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_datacontrol_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_datacontrol_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_datacontrol_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,386 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 David Redondo + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +// Qt +#include +#include +#include + +// WaylandServer +#include "../../src/server/compositor_interface.h" +#include "../../src/server/datacontroldevice_v1_interface.h" +#include "../../src/server/datacontroldevicemanager_v1_interface.h" +#include "../../src/server/datacontrolsource_v1_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/seat_interface.h" + +#include <../../src/client/compositor.h> +#include <../../src/client/connection_thread.h> +#include <../../src/client/event_queue.h> +#include <../../src/client/registry.h> +#include <../../src/client/seat.h> + +#include "qwayland-wlr-data-control-unstable-v1.h" + +using namespace KWaylandServer; + +// Faux-client API for tests + +Q_DECLARE_OPAQUE_POINTER(::zwlr_data_control_offer_v1 *) +Q_DECLARE_METATYPE(::zwlr_data_control_offer_v1 *) + +class DataControlDeviceManager : public QObject, public QtWayland::zwlr_data_control_manager_v1 +{ + Q_OBJECT +}; + +class DataControlOffer : public QObject, public QtWayland::zwlr_data_control_offer_v1 +{ + Q_OBJECT +public: + ~DataControlOffer() + { + destroy(); + } + QStringList receivedOffers() + { + return m_receivedOffers; + } + +protected: + virtual void zwlr_data_control_offer_v1_offer(const QString &mime_type) override + { + m_receivedOffers << mime_type; + } + +private: + QStringList m_receivedOffers; +}; + +class DataControlDevice : public QObject, public QtWayland::zwlr_data_control_device_v1 +{ + Q_OBJECT +public: + ~DataControlDevice() + { + destroy(); + } +Q_SIGNALS: + void dataControlOffer(DataControlOffer *offer); // our event receives a new ID, so we make a new object + void selection(struct ::zwlr_data_control_offer_v1 *id); + void primary_selection(struct ::zwlr_data_control_offer_v1 *id); + +protected: + void zwlr_data_control_device_v1_data_offer(struct ::zwlr_data_control_offer_v1 *id) override + { + auto offer = new DataControlOffer; + offer->init(id); + Q_EMIT dataControlOffer(offer); + } + + void zwlr_data_control_device_v1_selection(struct ::zwlr_data_control_offer_v1 *id) override + { + Q_EMIT selection(id); + } + + void zwlr_data_control_device_v1_primary_selection(struct ::zwlr_data_control_offer_v1 *id) override + { + Q_EMIT primary_selection(id); + } +}; + +class DataControlSource : public QObject, public QtWayland::zwlr_data_control_source_v1 +{ + Q_OBJECT +public: + ~DataControlSource() + { + destroy(); + } + +public: +}; + +class TestDataSource : public AbstractDataSource +{ + Q_OBJECT +public: + TestDataSource() + : AbstractDataSource(nullptr) + { + } + ~TestDataSource() + { + Q_EMIT aboutToBeDestroyed(); + } + void requestData(const QString &mimeType, qint32 fd) override + { + Q_UNUSED(mimeType); + Q_UNUSED(fd); + }; + void cancel() override{}; + QStringList mimeTypes() const override + { + return {"text/test1", "text/test2"}; + } +}; + +// The test itself + +class DataControlInterfaceTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void testCopyToControl(); + void testCopyToControlPrimarySelection(); + void testCopyFromControl(); + void testCopyFromControlPrimarySelection(); + void testKlipperCase(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::Seat *m_clientSeat = nullptr; + + QThread *m_thread; + Display *m_display; + SeatInterface *m_seat; + CompositorInterface *m_serverCompositor; + + DataControlDeviceManagerV1Interface *m_dataControlDeviceManagerInterface; + + DataControlDeviceManager *m_dataControlDeviceManager; + + QVector m_surfaces; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-datacontrol-test-0"); + +void DataControlInterfaceTest::init() +{ + m_display = new Display(); + m_display->addSocketName(s_socketName); + m_display->start(); + QVERIFY(m_display->isRunning()); + + m_seat = new SeatInterface(m_display, this); + m_serverCompositor = new CompositorInterface(m_display, this); + m_dataControlDeviceManagerInterface = new DataControlDeviceManagerV1Interface(m_display, this); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + KWayland::Client::Registry registry; + connect(®istry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, ®istry](const QByteArray &interface, quint32 name, quint32 version) { + if (interface == "zwlr_data_control_manager_v1") { + m_dataControlDeviceManager = new DataControlDeviceManager; + m_dataControlDeviceManager->init(registry.registry(), name, version); + } + }); + connect(®istry, &KWayland::Client::Registry::seatAnnounced, this, [this, ®istry](quint32 name, quint32 version) { + m_clientSeat = registry.createSeat(name, version); + }); + registry.setEventQueue(m_queue); + QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced); + registry.create(m_connection->display()); + QVERIFY(registry.isValid()); + registry.setup(); + wl_display_flush(m_connection->display()); + + QVERIFY(compositorSpy.wait()); + m_clientCompositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + + QVERIFY(m_dataControlDeviceManager); +} + +void DataControlInterfaceTest::cleanup() +{ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ + } + CLEANUP(m_dataControlDeviceManager) + CLEANUP(m_clientSeat) + CLEANUP(m_clientCompositor) + CLEANUP(m_queue) + if (m_connection) { + m_connection->deleteLater(); + m_connection = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + CLEANUP(m_display) +#undef CLEANUP + + // these are the children of the display + m_seat = nullptr; + m_serverCompositor = nullptr; +} + +void DataControlInterfaceTest::testCopyToControl() +{ + // we set a dummy data source on the seat using abstract client directly + // then confirm we receive the offer despite not having a surface + + QScopedPointer dataControlDevice(new DataControlDevice); + dataControlDevice->init(m_dataControlDeviceManager->get_data_device(*m_clientSeat)); + + QSignalSpy newOfferSpy(dataControlDevice.data(), &DataControlDevice::dataControlOffer); + QSignalSpy selectionSpy(dataControlDevice.data(), &DataControlDevice::selection); + + QScopedPointer testSelection(new TestDataSource); + m_seat->setSelection(testSelection.data()); + + // selection will be sent after we've been sent a new offer object and the mimes have been sent to that object + selectionSpy.wait(); + + QCOMPARE(newOfferSpy.count(), 1); + QScopedPointer offer(newOfferSpy.first().first().value()); + QCOMPARE(selectionSpy.first().first().value(), offer->object()); + + QCOMPARE(offer->receivedOffers().count(), 2); + QCOMPARE(offer->receivedOffers()[0], "text/test1"); + QCOMPARE(offer->receivedOffers()[1], "text/test2"); +} + +void DataControlInterfaceTest::testCopyToControlPrimarySelection() +{ + // we set a dummy data source on the seat using abstract client directly + // then confirm we receive the offer despite not having a surface + + QScopedPointer dataControlDevice(new DataControlDevice); + dataControlDevice->init(m_dataControlDeviceManager->get_data_device(*m_clientSeat)); + + QSignalSpy newOfferSpy(dataControlDevice.data(), &DataControlDevice::dataControlOffer); + QSignalSpy selectionSpy(dataControlDevice.data(), &DataControlDevice::primary_selection); + + QScopedPointer testSelection(new TestDataSource); + m_seat->setPrimarySelection(testSelection.data()); + + // selection will be sent after we've been sent a new offer object and the mimes have been sent to that object + selectionSpy.wait(); + + QCOMPARE(newOfferSpy.count(), 1); + QScopedPointer offer(newOfferSpy.first().first().value()); + QCOMPARE(selectionSpy.first().first().value(), offer->object()); + + QCOMPARE(offer->receivedOffers().count(), 2); + QCOMPARE(offer->receivedOffers()[0], "text/test1"); + QCOMPARE(offer->receivedOffers()[1], "text/test2"); +} + +void DataControlInterfaceTest::testCopyFromControl() +{ + // we create a data device and set a selection + // then confirm the server sees the new selection + QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::selectionChanged); + + QScopedPointer dataControlDevice(new DataControlDevice); + dataControlDevice->init(m_dataControlDeviceManager->get_data_device(*m_clientSeat)); + + QScopedPointer source(new DataControlSource); + source->init(m_dataControlDeviceManager->create_data_source()); + source->offer("cheese/test1"); + source->offer("cheese/test2"); + + dataControlDevice->set_selection(source->object()); + + serverSelectionChangedSpy.wait(); + QVERIFY(m_seat->selection()); + QCOMPARE(m_seat->selection()->mimeTypes(), QStringList({"cheese/test1", "cheese/test2"})); +} + +void DataControlInterfaceTest::testCopyFromControlPrimarySelection() +{ + // we create a data device and set a selection + // then confirm the server sees the new selection + QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::primarySelectionChanged); + + QScopedPointer dataControlDevice(new DataControlDevice); + dataControlDevice->init(m_dataControlDeviceManager->get_data_device(*m_clientSeat)); + + QScopedPointer source(new DataControlSource); + source->init(m_dataControlDeviceManager->create_data_source()); + source->offer("cheese/test1"); + source->offer("cheese/test2"); + + dataControlDevice->set_primary_selection(source->object()); + + serverSelectionChangedSpy.wait(); + QVERIFY(m_seat->primarySelection()); + QCOMPARE(m_seat->primarySelection()->mimeTypes(), QStringList({"cheese/test1", "cheese/test2"})); +} + +void DataControlInterfaceTest::testKlipperCase() +{ + // This tests the setup of klipper's real world operation and a race with a common pattern seen between clients and klipper + // The client's behaviour is faked with direct access to the seat + + QScopedPointer dataControlDevice(new DataControlDevice); + dataControlDevice->init(m_dataControlDeviceManager->get_data_device(*m_clientSeat)); + + QSignalSpy newOfferSpy(dataControlDevice.data(), &DataControlDevice::dataControlOffer); + QSignalSpy selectionSpy(dataControlDevice.data(), &DataControlDevice::selection); + QSignalSpy serverSelectionChangedSpy(m_seat, &SeatInterface::selectionChanged); + + // Client A has a data source + QScopedPointer testSelection(new TestDataSource); + m_seat->setSelection(testSelection.data()); + + // klipper gets it + selectionSpy.wait(); + + // Client A deletes it + testSelection.reset(); + + // klipper gets told + selectionSpy.wait(); + + // Client A sets something else + QScopedPointer testSelection2(new TestDataSource); + m_seat->setSelection(testSelection2.data()); + + // Meanwhile klipper updates with the old content + QScopedPointer source(new DataControlSource); + source->init(m_dataControlDeviceManager->create_data_source()); + source->offer("fromKlipper/test1"); + source->offer("application/x-kde-onlyReplaceEmpty"); + + dataControlDevice->set_selection(source->object()); + + QVERIFY(!serverSelectionChangedSpy.wait(10)); + QCOMPARE(m_seat->selection(), testSelection2.data()); +} + +QTEST_GUILESS_MAIN(DataControlInterfaceTest) + +#include "test_datacontrol_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_display.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_display.cpp --- dwayland-5.57.0.23/autotests/server/test_display.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_display.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,23 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // WaylandServer -#include "../../src/server/display.h" #include "../../src/server/clientconnection.h" -#include "../../src/server/outputmanagement_interface.h" +#include "../../src/server/display.h" #include "../../src/server/output_interface.h" +#include "../../src/server/outputmanagement_v2_interface.h" // Wayland #include // system -#include #include +#include #include -using namespace KWayland::Server; +using namespace KWaylandServer; class TestWaylandServerDisplay : public QObject { @@ -43,22 +29,22 @@ void testClientConnection(); void testConnectNoSocket(); void testOutputManagement(); + void testAutoSocketName(); }; void TestWaylandServerDisplay::testSocketName() { Display display; - QSignalSpy changedSpy(&display, SIGNAL(socketNameChanged(QString))); + QSignalSpy changedSpy(&display, &Display::socketNamesChanged); QVERIFY(changedSpy.isValid()); - QCOMPARE(display.socketName(), QStringLiteral("wayland-0")); + QCOMPARE(display.socketNames(), QStringList()); const QString testSName = QStringLiteral("fooBar"); - display.setSocketName(testSName); - QCOMPARE(display.socketName(), testSName); + display.addSocketName(testSName); + QCOMPARE(display.socketNames(), QStringList{testSName}); QCOMPARE(changedSpy.count(), 1); - QCOMPARE(changedSpy.first().first().toString(), testSName); // changing to same name again should not emit signal - display.setSocketName(testSName); + display.addSocketName(testSName); QCOMPARE(changedSpy.count(), 1); } @@ -69,57 +55,44 @@ QVERIFY(runtimeDir.exists()); QVERIFY(!runtimeDir.exists(testSocketName)); - Display display; - QSignalSpy runningSpy(&display, SIGNAL(runningChanged(bool))); + QScopedPointer display(new Display); + QSignalSpy runningSpy(display.data(), SIGNAL(runningChanged(bool))); QVERIFY(runningSpy.isValid()); - display.setSocketName(testSocketName); - QVERIFY(!display.isRunning()); - display.start(); -// QVERIFY(runningSpy.wait()); + display->addSocketName(testSocketName); + QVERIFY(!display->isRunning()); + display->start(); + // QVERIFY(runningSpy.wait()); QCOMPARE(runningSpy.count(), 1); QVERIFY(runningSpy.first().first().toBool()); - QVERIFY(display.isRunning()); + QVERIFY(display->isRunning()); QVERIFY(runtimeDir.exists(testSocketName)); - display.terminate(); - QVERIFY(!display.isRunning()); - QCOMPARE(runningSpy.count(), 2); - QVERIFY(runningSpy.first().first().toBool()); - QVERIFY(!runningSpy.last().first().toBool()); + display.reset(); QVERIFY(!runtimeDir.exists(testSocketName)); } void TestWaylandServerDisplay::testAddRemoveOutput() { Display display; - display.setSocketName(QStringLiteral("kwin-wayland-server-display-test-output-0")); + display.addSocketName(QStringLiteral("kwin-wayland-server-display-test-output-0")); display.start(); - OutputInterface *output = display.createOutput(); + OutputInterface *output = new OutputInterface(&display); QCOMPARE(display.outputs().size(), 1); QCOMPARE(display.outputs().first(), output); - // create a second output - OutputInterface *output2 = display.createOutput(); - QCOMPARE(display.outputs().size(), 2); - QCOMPARE(display.outputs().first(), output); - QCOMPARE(display.outputs().last(), output2); - // remove the first output - display.removeOutput(output); - QCOMPARE(display.outputs().size(), 1); - QCOMPARE(display.outputs().first(), output2); - // and delete the second - delete output2; + + delete output; QVERIFY(display.outputs().isEmpty()); } void TestWaylandServerDisplay::testClientConnection() { Display display; - display.setSocketName(QStringLiteral("kwin-wayland-server-display-test-client-connection")); + display.addSocketName(QStringLiteral("kwin-wayland-server-display-test-client-connection")); display.start(); - QSignalSpy connectedSpy(&display, SIGNAL(clientConnected(KWayland::Server::ClientConnection*))); + QSignalSpy connectedSpy(&display, SIGNAL(clientConnected(KWaylandServer::ClientConnection *))); QVERIFY(connectedSpy.isValid()); - QSignalSpy disconnectedSpy(&display, SIGNAL(clientDisconnected(KWayland::Server::ClientConnection*))); + QSignalSpy disconnectedSpy(&display, SIGNAL(clientDisconnected(KWaylandServer::ClientConnection *))); QVERIFY(disconnectedSpy.isValid()); int sv[2]; @@ -144,11 +117,11 @@ QVERIFY(connection->processId() != 0); QCOMPARE(connection->display(), &display); QCOMPARE(connection->executablePath(), QCoreApplication::applicationFilePath()); - QCOMPARE((wl_client*)*connection, client); + QCOMPARE((wl_client *)*connection, client); const ClientConnection &constRef = *connection; - QCOMPARE((wl_client*)constRef, client); + QCOMPARE((wl_client *)constRef, client); QCOMPARE(connectedSpy.count(), 1); - QCOMPARE(connectedSpy.first().first().value(), connection); + QCOMPARE(connectedSpy.first().first().value(), connection); QCOMPARE(display.connections().count(), 1); QCOMPARE(display.connections().first(), connection); @@ -164,9 +137,9 @@ QVERIFY(connection2); QCOMPARE(connection2, client2); QCOMPARE(connectedSpy.count(), 2); - QCOMPARE(connectedSpy.first().first().value(), connection); - QCOMPARE(connectedSpy.last().first().value(), connection2); - QCOMPARE(connectedSpy.last().first().value(), client2); + QCOMPARE(connectedSpy.first().first().value(), connection); + QCOMPARE(connectedSpy.last().first().value(), connection2); + QCOMPARE(connectedSpy.last().first().value(), client2); QCOMPARE(display.connections().count(), 2); QCOMPARE(display.connections().first(), connection); QCOMPARE(display.connections().last(), connection2); @@ -191,7 +164,7 @@ void TestWaylandServerDisplay::testConnectNoSocket() { Display display; - display.start(Display::StartMode::ConnectClientsOnly); + display.start(); QVERIFY(display.isRunning()); // let's try connecting a client @@ -208,13 +181,33 @@ void TestWaylandServerDisplay::testOutputManagement() { Display display; - display.setSocketName("kwayland-test-0"); + display.addSocketName("kwayland-test-0"); display.start(); - auto kwin = display.createOutputManagement(this); - kwin->create(); - QVERIFY(kwin->isValid()); + new OutputManagementV2Interface(&display, this); } +void TestWaylandServerDisplay::testAutoSocketName() +{ + QTemporaryDir runtimeDir; + QVERIFY(runtimeDir.isValid()); + QVERIFY(qputenv("XDG_RUNTIME_DIR", runtimeDir.path().toUtf8())); + + Display display0; + QSignalSpy socketNameChangedSpy0(&display0, &Display::socketNamesChanged); + QVERIFY(socketNameChangedSpy0.isValid()); + QVERIFY(display0.addSocketName()); + display0.start(); + QVERIFY(display0.isRunning()); + QCOMPARE(socketNameChangedSpy0.count(), 1); + + Display display1; + QSignalSpy socketNameChangedSpy1(&display1, &Display::socketNamesChanged); + QVERIFY(socketNameChangedSpy1.isValid()); + QVERIFY(display1.addSocketName()); + display1.start(); + QVERIFY(display1.isRunning()); + QCOMPARE(socketNameChangedSpy1.count(), 1); +} QTEST_GUILESS_MAIN(TestWaylandServerDisplay) #include "test_display.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_inputmethod_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_inputmethod_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_inputmethod_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_inputmethod_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,639 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +// Qt +#include +#include +#include +// WaylandServer +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/inputmethod_v1_interface.h" +#include "../../src/server/seat_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/keyboard.h" +#include "../../src/client/output.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/surface.h" + +#include "qwayland-input-method-unstable-v1.h" +#include "qwayland-server-text-input-unstable-v1.h" + +#include + +using namespace KWaylandServer; + +class InputPanelSurface : public QObject, public QtWayland::zwp_input_panel_surface_v1 +{ + Q_OBJECT +public: + InputPanelSurface(::zwp_input_panel_surface_v1 *t) + : QtWayland::zwp_input_panel_surface_v1(t) + { + } +}; + +class InputPanel : public QtWayland::zwp_input_panel_v1 +{ +public: + InputPanel(struct ::wl_registry *registry, int id, int version) + : QtWayland::zwp_input_panel_v1(registry, id, version) + { + } + + InputPanelSurface *panelForSurface(KWayland::Client::Surface *surface) + { + auto panelSurface = new InputPanelSurface(get_input_panel_surface(*surface)); + QObject::connect(surface, &QObject::destroyed, panelSurface, &QObject::deleteLater); + return panelSurface; + } +}; + +class InputMethodV1Context : public QObject, public QtWayland::zwp_input_method_context_v1 +{ + Q_OBJECT +public: + quint32 contentPurpose() + { + return imPurpose; + } + quint32 contentHints() + { + return imHint; + } +Q_SIGNALS: + void content_type_changed(); + void invoke_action(quint32 button, quint32 index); + void preferred_language(QString lang); + void surrounding_text(QString lang, quint32 cursor, quint32 anchor); + void reset(); + +protected: + void zwp_input_method_context_v1_content_type(uint32_t hint, uint32_t purpose) override + { + imHint = hint; + imPurpose = purpose; + Q_EMIT content_type_changed(); + } + void zwp_input_method_context_v1_invoke_action(uint32_t button, uint32_t index) override + { + Q_EMIT invoke_action(button, index); + } + void zwp_input_method_context_v1_preferred_language(const QString &language) override + { + Q_EMIT preferred_language(language); + } + void zwp_input_method_context_v1_surrounding_text(const QString &text, uint32_t cursor, uint32_t anchor) override + { + Q_EMIT surrounding_text(text, cursor, anchor); + } + void zwp_input_method_context_v1_reset() override + { + Q_EMIT reset(); + } + +private: + quint32 imHint = 0; + quint32 imPurpose = 0; +}; + +class InputMethodV1 : public QObject, public QtWayland::zwp_input_method_v1 +{ + Q_OBJECT +public: + InputMethodV1(struct ::wl_registry *registry, int id, int version) + : QtWayland::zwp_input_method_v1(registry, id, version) + { + } + InputMethodV1Context *context() + { + return m_context; + } + +Q_SIGNALS: + void activated(); + void deactivated(); + +protected: + void zwp_input_method_v1_activate(struct ::zwp_input_method_context_v1 *context) override + { + m_context = new InputMethodV1Context(); + m_context->init(context); + Q_EMIT activated(); + }; + void zwp_input_method_v1_deactivate(struct ::zwp_input_method_context_v1 *context) override + { + Q_UNUSED(context) + delete m_context; + m_context = nullptr; + Q_EMIT deactivated(); + }; + +private: + InputMethodV1Context *m_context; +}; + +class TestInputMethodInterface : public QObject +{ + Q_OBJECT +public: + TestInputMethodInterface() + { + } + ~TestInputMethodInterface() override; + +private Q_SLOTS: + void initTestCase(); + void testAdd(); + void testActivate(); + void testContext(); + void testGrabkeyboard(); + void testContentHints_data(); + void testContentHints(); + void testContentPurpose_data(); + void testContentPurpose(); + void testKeyboardGrab(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::Seat *m_clientSeat = nullptr; + KWayland::Client::Output *m_output = nullptr; + + InputMethodV1 *m_inputMethod; + InputPanel *m_inputPanel; + QThread *m_thread; + Display m_display; + SeatInterface *m_seat; + CompositorInterface *m_serverCompositor; + + KWaylandServer::InputMethodV1Interface *m_inputMethodIface; + KWaylandServer::InputPanelV1Interface *m_inputPanelIface; + + QVector m_surfaces; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-inputmethod-test-0"); + +void TestInputMethodInterface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_seat = new SeatInterface(&m_display, this); + m_serverCompositor = new CompositorInterface(&m_display, this); + m_inputMethodIface = new InputMethodV1Interface(&m_display, this); + m_inputPanelIface = new InputPanelV1Interface(&m_display, this); + new OutputInterface(&m_display, this); + + connect(m_serverCompositor, &CompositorInterface::surfaceCreated, this, [this](SurfaceInterface *surface) { + m_surfaces += surface; + }); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + QSignalSpy interfacesSpy(registry, &KWayland::Client::Registry::interfacesAnnounced); + connect(registry, &KWayland::Client::Registry::outputAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_output = new KWayland::Client::Output(this); + m_output->setup(registry->bindOutput(name, version)); + }); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 name, quint32 version) { + if (interface == "zwp_input_panel_v1") { + m_inputPanel = new InputPanel(registry->registry(), name, version); + } else if (interface == "zwp_input_method_v1") { + m_inputMethod = new InputMethodV1(registry->registry(), name, version); + } + }); + connect(registry, &KWayland::Client::Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_clientSeat = registry->createSeat(name, version); + }); + registry->setEventQueue(m_queue); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + wl_display_flush(m_connection->display()); + + QVERIFY(compositorSpy.wait()); + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + + QVERIFY(interfacesSpy.count() || interfacesSpy.wait()); + + QSignalSpy surfaceSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + for (int i = 0; i < 3; ++i) { + m_clientCompositor->createSurface(this); + } + QVERIFY(surfaceSpy.count() < 3 && surfaceSpy.wait(200)); + QVERIFY(m_surfaces.count() == 3); + QVERIFY(m_inputPanel); + QVERIFY(m_output); +} + +TestInputMethodInterface::~TestInputMethodInterface() +{ + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + delete m_inputPanel; + delete m_inputMethod; + delete m_inputMethodIface; + delete m_inputPanelIface; + m_connection->deleteLater(); + m_connection = nullptr; +} + +void TestInputMethodInterface::testAdd() +{ + QSignalSpy panelSpy(m_inputPanelIface, &InputPanelV1Interface::inputPanelSurfaceAdded); + QPointer panelSurfaceIface; + connect(m_inputPanelIface, &InputPanelV1Interface::inputPanelSurfaceAdded, this, [&panelSurfaceIface](InputPanelSurfaceV1Interface *surface) { + panelSurfaceIface = surface; + }); + + auto surface = m_clientCompositor->createSurface(this); + auto panelSurface = m_inputPanel->panelForSurface(surface); + + QVERIFY(panelSpy.wait() || panelSurfaceIface); + Q_ASSERT(panelSurfaceIface); + Q_ASSERT(panelSurfaceIface->surface() == m_surfaces.constLast()); + + QSignalSpy panelTopLevelSpy(panelSurfaceIface, &InputPanelSurfaceV1Interface::topLevel); + panelSurface->set_toplevel(*m_output, InputPanelSurface::position_center_bottom); + QVERIFY(panelTopLevelSpy.wait()); +} + +void TestInputMethodInterface::testActivate() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + QVERIFY(inputMethodActivateSpy.isValid()); + QSignalSpy inputMethodDeactivateSpy(m_inputMethod, &InputMethodV1::deactivated); + + // before sending activate the context should be null + QVERIFY(!m_inputMethodIface->context()); + + // send activate now + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(m_inputMethodIface->context()); + + // send deactivate and verify server interface resets context + m_inputMethodIface->sendDeactivate(); + QVERIFY(inputMethodDeactivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(!m_inputMethodIface->context()); +} + +void TestInputMethodInterface::testContext() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + QVERIFY(inputMethodActivateSpy.isValid()); + QSignalSpy inputMethodDeactivateSpy(m_inputMethod, &InputMethodV1::deactivated); + + // before sending activate the context should be null + QVERIFY(!m_inputMethodIface->context()); + + // send activate now + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + + KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + QVERIFY(serverContext); + + InputMethodV1Context *imContext = m_inputMethod->context(); + QVERIFY(imContext); + + quint32 serial = 1; + + // commit some text + QSignalSpy commitStringSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::commitString); + QVERIFY(commitStringSpy.isValid()); + imContext->commit_string(serial, "hello"); + QVERIFY(commitStringSpy.wait()); + QCOMPARE(commitStringSpy.count(), serial); + QCOMPARE(commitStringSpy.last().at(0).value(), serial); + QCOMPARE(commitStringSpy.last().at(1).value(), "hello"); + serial++; + + // preedit styling event + QSignalSpy preeditStylingSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::preeditStyling); + QVERIFY(preeditStylingSpy.isValid()); + // protocol does not document 3rd argument mean in much details (styling) + imContext->preedit_styling(0, 5, 1); + QVERIFY(preeditStylingSpy.wait()); + QCOMPARE(preeditStylingSpy.count(), 1); + QCOMPARE(preeditStylingSpy.last().at(0).value(), 0); + QCOMPARE(preeditStylingSpy.last().at(1).value(), 5); + QCOMPARE(preeditStylingSpy.last().at(2).value(), 1); + + // preedit cursor event + QSignalSpy preeditCursorSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor); + QVERIFY(preeditCursorSpy.isValid()); + imContext->preedit_cursor(3); + QVERIFY(preeditCursorSpy.wait()); + QCOMPARE(preeditCursorSpy.count(), 1); + QCOMPARE(preeditCursorSpy.last().at(0).value(), 3); + + // commit preedit_string + QSignalSpy preeditStringSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::preeditString); + QVERIFY(preeditStringSpy.isValid()); + imContext->preedit_string(serial, "hello", "kde"); + QVERIFY(preeditStringSpy.wait()); + QCOMPARE(preeditStringSpy.count(), 1); + QCOMPARE(preeditStringSpy.last().at(0).value(), serial); + QCOMPARE(preeditStringSpy.last().at(1).value(), "hello"); + QCOMPARE(preeditStringSpy.last().at(2).value(), "kde"); + serial++; + + // delete surrounding text + QSignalSpy deleteSurroundingSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::deleteSurroundingText); + QVERIFY(deleteSurroundingSpy.isValid()); + imContext->delete_surrounding_text(0, 5); + QVERIFY(deleteSurroundingSpy.wait()); + QCOMPARE(deleteSurroundingSpy.count(), 1); + QCOMPARE(deleteSurroundingSpy.last().at(0).value(), 0); + QCOMPARE(deleteSurroundingSpy.last().at(1).value(), 5); + + // set cursor position + QSignalSpy cursorPositionSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::cursorPosition); + QVERIFY(cursorPositionSpy.isValid()); + imContext->cursor_position(2, 4); + QVERIFY(cursorPositionSpy.wait()); + QCOMPARE(cursorPositionSpy.count(), 1); + QCOMPARE(cursorPositionSpy.last().at(0).value(), 2); + QCOMPARE(cursorPositionSpy.last().at(1).value(), 4); + + // invoke action + QSignalSpy invokeActionSpy(imContext, &InputMethodV1Context::invoke_action); + QVERIFY(invokeActionSpy.isValid()); + serverContext->sendInvokeAction(3, 5); + QVERIFY(invokeActionSpy.wait()); + QCOMPARE(invokeActionSpy.count(), 1); + QCOMPARE(invokeActionSpy.last().at(0).value(), 3); + QCOMPARE(invokeActionSpy.last().at(1).value(), 5); + + // preferred language + QSignalSpy preferredLanguageSpy(imContext, &InputMethodV1Context::preferred_language); + QVERIFY(preferredLanguageSpy.isValid()); + serverContext->sendPreferredLanguage("gu_IN"); + QVERIFY(preferredLanguageSpy.wait()); + QCOMPARE(preferredLanguageSpy.count(), 1); + QCOMPARE(preferredLanguageSpy.last().at(0).value(), "gu_IN"); + + // surrounding text + QSignalSpy surroundingTextSpy(imContext, &InputMethodV1Context::surrounding_text); + QVERIFY(surroundingTextSpy.isValid()); + serverContext->sendSurroundingText("Hello Plasma!", 2, 4); + QVERIFY(surroundingTextSpy.wait()); + QCOMPARE(surroundingTextSpy.count(), 1); + QCOMPARE(surroundingTextSpy.last().at(0).value(), "Hello Plasma!"); + QCOMPARE(surroundingTextSpy.last().at(1).value(), 2); + QCOMPARE(surroundingTextSpy.last().at(2).value(), 4); + + // reset + QSignalSpy resetSpy(imContext, &InputMethodV1Context::reset); + QVERIFY(resetSpy.isValid()); + serverContext->sendReset(); + QVERIFY(resetSpy.wait()); + QCOMPARE(resetSpy.count(), 1); + + // send deactivate and verify server interface resets context + m_inputMethodIface->sendDeactivate(); + QVERIFY(inputMethodDeactivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(!m_inputMethodIface->context()); + QVERIFY(!m_inputMethod->context()); +} + +void TestInputMethodInterface::testGrabkeyboard() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + QVERIFY(inputMethodActivateSpy.isValid()); + QSignalSpy inputMethodDeactivateSpy(m_inputMethod, &InputMethodV1::deactivated); + + // before sending activate the context should be null + QVERIFY(!m_inputMethodIface->context()); + + // send activate now + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + + KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + QVERIFY(serverContext); + + InputMethodV1Context *imContext = m_inputMethod->context(); + QVERIFY(imContext); + + QSignalSpy keyEventSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::key); + QVERIFY(keyEventSpy.isValid()); + imContext->key(0, 123, 56, 1); + QEXPECT_FAIL("", "We should be not get key event if keyboard is not grabbed", Continue); + QVERIFY(!keyEventSpy.wait(200)); + + QSignalSpy modifierEventSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::modifiers); + QVERIFY(modifierEventSpy.isValid()); + imContext->modifiers(1234, 0, 0, 0, 0); + QEXPECT_FAIL("", "We should be not get modifiers event if keyboard is not grabbed", Continue); + QVERIFY(!modifierEventSpy.wait(200)); + + // grab the keyboard + wl_keyboard *keyboard = imContext->grab_keyboard(); + QVERIFY(keyboard); + + // TODO: add more tests about keyboard grab here + + // send deactivate and verify server interface resets context + m_inputMethodIface->sendDeactivate(); + QVERIFY(inputMethodDeactivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(!m_inputMethodIface->context()); + QVERIFY(!m_inputMethod->context()); +} + +void TestInputMethodInterface::testContentHints_data() +{ + QTest::addColumn("serverHints"); + QTest::addColumn("imHint"); + QTest::addRow("Spellcheck") << TextInputContentHints(TextInputContentHint::AutoCorrection) + << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_auto_correction); + QTest::addRow("AutoCapital") << TextInputContentHints(TextInputContentHint::AutoCapitalization) + << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_auto_capitalization); + QTest::addRow("Lowercase") << TextInputContentHints(TextInputContentHint::LowerCase) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_lowercase); + QTest::addRow("Uppercase") << TextInputContentHints(TextInputContentHint::UpperCase) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_uppercase); + QTest::addRow("Titlecase") << TextInputContentHints(TextInputContentHint::TitleCase) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_titlecase); + QTest::addRow("HiddenText") << TextInputContentHints(TextInputContentHint::HiddenText) + << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_hidden_text); + QTest::addRow("SensitiveData") << TextInputContentHints(TextInputContentHint::SensitiveData) + << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_sensitive_data); + QTest::addRow("Latin") << TextInputContentHints(TextInputContentHint::Latin) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_latin); + QTest::addRow("Multiline") << TextInputContentHints(TextInputContentHint::MultiLine) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_multiline); + QTest::addRow("Auto") << TextInputContentHints(TextInputContentHint::AutoCorrection | TextInputContentHint::AutoCapitalization) + << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_auto_correction + | QtWaylandServer::zwp_text_input_v1::content_hint_auto_capitalization); +} + +void TestInputMethodInterface::testContentHints() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + QVERIFY(inputMethodActivateSpy.isValid()); + QSignalSpy inputMethodDeactivateSpy(m_inputMethod, &InputMethodV1::deactivated); + + // before sending activate the context should be null + QVERIFY(!m_inputMethodIface->context()); + + // send activate now + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + + KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + QVERIFY(serverContext); + + InputMethodV1Context *imContext = m_inputMethod->context(); + QVERIFY(imContext); + + QSignalSpy contentTypeChangedSpy(imContext, &InputMethodV1Context::content_type_changed); + QVERIFY(contentTypeChangedSpy.isValid()); + + QFETCH(KWaylandServer::TextInputContentHints, serverHints); + serverContext->sendContentType(serverHints, KWaylandServer::TextInputContentPurpose::Normal); + QVERIFY(contentTypeChangedSpy.wait()); + QCOMPARE(contentTypeChangedSpy.count(), 1); + QEXPECT_FAIL("SensitiveData", "SensitiveData content hint need fixing", Continue); + QTEST(imContext->contentHints(), "imHint"); + + // send deactivate and verify server interface resets context + m_inputMethodIface->sendDeactivate(); + QVERIFY(inputMethodDeactivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(!m_inputMethodIface->context()); + QVERIFY(!m_inputMethod->context()); +} + +void TestInputMethodInterface::testContentPurpose_data() +{ + QTest::addColumn("serverPurpose"); + QTest::addColumn("imPurpose"); + + QTest::newRow("Alpha") << TextInputContentPurpose::Alpha << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_alpha); + QTest::newRow("Digits") << TextInputContentPurpose::Digits << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_digits); + QTest::newRow("Number") << TextInputContentPurpose::Number << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_number); + QTest::newRow("Phone") << TextInputContentPurpose::Phone << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_phone); + QTest::newRow("Url") << TextInputContentPurpose::Url << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_url); + QTest::newRow("Email") << TextInputContentPurpose::Email << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_email); + QTest::newRow("Name") << TextInputContentPurpose::Name << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_name); + QTest::newRow("Password") << TextInputContentPurpose::Password << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_password); + QTest::newRow("Date") << TextInputContentPurpose::Date << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_date); + QTest::newRow("Time") << TextInputContentPurpose::Time << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_time); + QTest::newRow("DateTime") << TextInputContentPurpose::DateTime << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_datetime); + QTest::newRow("Terminal") << TextInputContentPurpose::Terminal << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_terminal); + QTest::newRow("Normal") << TextInputContentPurpose::Normal << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_normal); + QTest::newRow("Pin") << TextInputContentPurpose::Pin << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_password); +} + +void TestInputMethodInterface::testContentPurpose() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + QVERIFY(inputMethodActivateSpy.isValid()); + QSignalSpy inputMethodDeactivateSpy(m_inputMethod, &InputMethodV1::deactivated); + + // before sending activate the context should be null + QVERIFY(!m_inputMethodIface->context()); + + // send activate now + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + + KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + QVERIFY(serverContext); + + InputMethodV1Context *imContext = m_inputMethod->context(); + QVERIFY(imContext); + + QSignalSpy contentTypeChangedSpy(imContext, &InputMethodV1Context::content_type_changed); + QVERIFY(contentTypeChangedSpy.isValid()); + + QFETCH(KWaylandServer::TextInputContentPurpose, serverPurpose); + serverContext->sendContentType(KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::None), serverPurpose); + QVERIFY(contentTypeChangedSpy.wait()); + QCOMPARE(contentTypeChangedSpy.count(), 1); + QEXPECT_FAIL("Pin", "Pin should return content_purpose_password", Continue); + QTEST(imContext->contentPurpose(), "imPurpose"); + + // send deactivate and verify server interface resets context + m_inputMethodIface->sendDeactivate(); + QVERIFY(inputMethodDeactivateSpy.wait()); + QCOMPARE(inputMethodActivateSpy.count(), 1); + QVERIFY(!m_inputMethodIface->context()); + QVERIFY(!m_inputMethod->context()); +} + +void TestInputMethodInterface::testKeyboardGrab() +{ + QVERIFY(m_inputMethodIface); + QSignalSpy inputMethodActivateSpy(m_inputMethod, &InputMethodV1::activated); + + m_inputMethodIface->sendActivate(); + QVERIFY(inputMethodActivateSpy.wait()); + + QSignalSpy keyboardGrabSpy(m_inputMethodIface->context(), &InputMethodContextV1Interface::keyboardGrabRequested); + InputMethodV1Context *imContext = m_inputMethod->context(); + QVERIFY(imContext); + KWayland::Client::Keyboard *keyboard = new KWayland::Client::Keyboard(this); + keyboard->setup(imContext->grab_keyboard()); + QVERIFY(keyboard->isValid()); + QVERIFY(keyboardGrabSpy.count() || keyboardGrabSpy.wait()); + + QSignalSpy keyboardSpy(keyboard, &KWayland::Client::Keyboard::keyChanged); + m_inputMethodIface->context()->keyboardGrab()->sendKey(0, 0, KEY_F1, KeyboardKeyState::Pressed); + m_inputMethodIface->context()->keyboardGrab()->sendKey(0, 0, KEY_F1, KeyboardKeyState::Released); + keyboardSpy.wait(); + QCOMPARE(keyboardSpy.count(), 2); + + m_inputMethodIface->sendDeactivate(); +} + +QTEST_GUILESS_MAIN(TestInputMethodInterface) +#include "test_inputmethod_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,211 @@ +/* + SPDX-FileCopyrightText: 2020 Benjamin Port + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +// Qt +#include +#include +#include +// WaylandServer +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/keyboard_shortcuts_inhibit_v1_interface.h" +#include "../../src/server/seat_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/surface.h" + +#include "qwayland-keyboard-shortcuts-inhibit-unstable-v1.h" + +using namespace KWaylandServer; + +class KeyboardShortcutsInhibitManager : public QObject, public QtWayland::zwp_keyboard_shortcuts_inhibit_manager_v1 +{ + Q_OBJECT +public: + KeyboardShortcutsInhibitManager(wl_registry *registry, quint32 id, quint32 version) + : QtWayland::zwp_keyboard_shortcuts_inhibit_manager_v1(registry, id, version) + { + } +}; + +class KeyboardShortcutsInhibitor : public QObject, public QtWayland::zwp_keyboard_shortcuts_inhibitor_v1 +{ + Q_OBJECT +public: + KeyboardShortcutsInhibitor(::zwp_keyboard_shortcuts_inhibitor_v1 *inhibitorV1) + : QtWayland::zwp_keyboard_shortcuts_inhibitor_v1(inhibitorV1) + { + } + + void zwp_keyboard_shortcuts_inhibitor_v1_active() override + { + Q_EMIT inhibitorActive(); + } + + void zwp_keyboard_shortcuts_inhibitor_v1_inactive() override + { + Q_EMIT inhibitorInactive(); + } + +Q_SIGNALS: + void inhibitorActive(); + void inhibitorInactive(); +}; + +class TestKeyboardShortcutsInhibitorInterface : public QObject +{ + Q_OBJECT +public: + TestKeyboardShortcutsInhibitorInterface() + { + } + ~TestKeyboardShortcutsInhibitorInterface() override; + +private Q_SLOTS: + void initTestCase(); + void testKeyboardShortcuts(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::Seat *m_clientSeat = nullptr; + + QThread *m_thread; + Display m_display; + SeatInterface *m_seat; + CompositorInterface *m_serverCompositor; + + KeyboardShortcutsInhibitManagerV1Interface *m_manager; + QVector m_surfaces; + QVector m_clientSurfaces; + KeyboardShortcutsInhibitManager *m_inhibitManagerClient = nullptr; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-keyboard-shortcuts-inhibitor-test-0"); + +void TestKeyboardShortcutsInhibitorInterface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_seat = new SeatInterface(&m_display, this); + m_serverCompositor = new CompositorInterface(&m_display, this); + m_manager = new KeyboardShortcutsInhibitManagerV1Interface(&m_display, this); + + connect(m_serverCompositor, &CompositorInterface::surfaceCreated, this, [this](SurfaceInterface *surface) { + m_surfaces += surface; + }); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 id, quint32 version) { + if (interface == "zwp_keyboard_shortcuts_inhibit_manager_v1") { + m_inhibitManagerClient = new KeyboardShortcutsInhibitManager(registry->registry(), id, version); + } + }); + connect(registry, &KWayland::Client::Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_clientSeat = registry->createSeat(name, version); + }); + registry->setEventQueue(m_queue); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + wl_display_flush(m_connection->display()); + + QVERIFY(compositorSpy.wait()); + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + + QSignalSpy surfaceSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + for (int i = 0; i < 3; ++i) { + KWayland::Client::Surface *s = m_clientCompositor->createSurface(this); + m_clientSurfaces += s->operator wl_surface *(); + } + QVERIFY(surfaceSpy.count() < 3 && surfaceSpy.wait(200)); + QVERIFY(m_surfaces.count() == 3); + QVERIFY(m_inhibitManagerClient); +} + +TestKeyboardShortcutsInhibitorInterface::~TestKeyboardShortcutsInhibitorInterface() +{ + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + m_connection->deleteLater(); + m_connection = nullptr; +} + +void TestKeyboardShortcutsInhibitorInterface::testKeyboardShortcuts() +{ + auto clientSurface = m_clientSurfaces[0]; + auto surface = m_surfaces[0]; + + // Test creation + auto inhibitorClientV1 = m_inhibitManagerClient->inhibit_shortcuts(clientSurface, m_clientSeat->operator wl_seat *()); + auto inhibitorClient = new KeyboardShortcutsInhibitor(inhibitorClientV1); + QSignalSpy inhibitorActiveSpy(inhibitorClient, &KeyboardShortcutsInhibitor::inhibitorActive); + QSignalSpy inhibitorInactiveSpy(inhibitorClient, &KeyboardShortcutsInhibitor::inhibitorInactive); + QSignalSpy inhibitorCreatedSpy(m_manager, &KeyboardShortcutsInhibitManagerV1Interface::inhibitorCreated); + QVERIFY(inhibitorCreatedSpy.wait() || inhibitorCreatedSpy.count() == 1); + auto inhibitorServer = m_manager->findInhibitor(surface, m_seat); + + // Test deactivate + inhibitorServer->setActive(false); + QVERIFY(inhibitorInactiveSpy.wait() || inhibitorInactiveSpy.count() == 1); + + // Test activate + inhibitorServer->setActive(true); + QVERIFY(inhibitorInactiveSpy.wait() || inhibitorInactiveSpy.count() == 1); + + // Test creating for another surface + m_inhibitManagerClient->inhibit_shortcuts(m_clientSurfaces[1], m_clientSeat->operator wl_seat *()); + QVERIFY(inhibitorCreatedSpy.wait() || inhibitorCreatedSpy.count() == 2); + + // Test destroy is working + inhibitorClient->destroy(); + m_inhibitManagerClient->inhibit_shortcuts(clientSurface, m_clientSeat->operator wl_seat *()); + QVERIFY(inhibitorCreatedSpy.wait() || inhibitorCreatedSpy.count() == 3); + + // Test creating with same surface / seat (expect error) + QSignalSpy errorOccured(m_connection, &KWayland::Client::ConnectionThread::errorOccurred); + m_inhibitManagerClient->inhibit_shortcuts(m_clientSurfaces[0], m_clientSeat->operator wl_seat *()); + QVERIFY(errorOccured.wait() || errorOccured.count() == 1); +} + +QTEST_GUILESS_MAIN(TestKeyboardShortcutsInhibitorInterface) + +#include "test_keyboard_shortcuts_inhibitor_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_layershellv1_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_layershellv1_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_layershellv1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_layershellv1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,526 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include +#include + +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/layershell_v1_interface.h" +#include "../../src/server/surface_interface.h" +#include "../../src/server/xdgshell_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/registry.h" +#include "../../src/client/surface.h" + +#include "qwayland-wlr-layer-shell-unstable-v1.h" +#include "qwayland-xdg-shell.h" + +Q_DECLARE_METATYPE(KWaylandServer::LayerSurfaceV1Interface::Layer) +Q_DECLARE_METATYPE(KWaylandServer::LayerSurfaceV1Interface *) + +using namespace KWaylandServer; + +class LayerShellV1 : public QtWayland::zwlr_layer_shell_v1 +{ +public: + ~LayerShellV1() override + { + destroy(); + } +}; + +class LayerSurfaceV1 : public QtWayland::zwlr_layer_surface_v1 +{ +public: + ~LayerSurfaceV1() override + { + destroy(); + } +}; + +class XdgShell : public QtWayland::xdg_wm_base +{ +public: + ~XdgShell() + { + destroy(); + } +}; + +class XdgSurface : public QtWayland::xdg_surface +{ +public: + ~XdgSurface() + { + destroy(); + } +}; + +class XdgPositioner : public QtWayland::xdg_positioner +{ +public: + ~XdgPositioner() + { + destroy(); + } +}; + +class XdgPopup : public QtWayland::xdg_popup +{ +public: + ~XdgPopup() + { + destroy(); + } +}; + +class TestLayerShellV1Interface : public QObject +{ + Q_OBJECT + +public: + ~TestLayerShellV1Interface() override; + +private Q_SLOTS: + void initTestCase(); + void testDesiredSize(); + void testScope(); + void testAnchor_data(); + void testAnchor(); + void testMargins(); + void testExclusiveZone(); + void testExclusiveEdge_data(); + void testExclusiveEdge(); + void testLayer_data(); + void testLayer(); + void testPopup(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + + QThread *m_thread; + Display m_display; + CompositorInterface *m_serverCompositor; + LayerShellV1 *m_clientLayerShell = nullptr; + LayerShellV1Interface *m_serverLayerShell = nullptr; + XdgShell *m_clientXdgShell = nullptr; + XdgShellInterface *m_serverXdgShell = nullptr; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-layer-shell-v1-test-0"); + +void TestLayerShellV1Interface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_serverLayerShell = new LayerShellV1Interface(&m_display, this); + m_serverXdgShell = new XdgShellInterface(&m_display, this); + m_serverCompositor = new CompositorInterface(&m_display, this); + + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 id, quint32 version) { + if (interface == QByteArrayLiteral("zwlr_layer_shell_v1")) { + m_clientLayerShell = new LayerShellV1(); + m_clientLayerShell->init(*registry, id, version); + } + if (interface == QByteArrayLiteral("xdg_wm_base")) { + m_clientXdgShell = new XdgShell(); + m_clientXdgShell->init(*registry, id, version); + } + }); + QSignalSpy allAnnouncedSpy(registry, &KWayland::Client::Registry::interfaceAnnounced); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + QSignalSpy shmSpy(registry, &KWayland::Client::Registry::shmAnnounced); + registry->setEventQueue(m_queue); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + QVERIFY(allAnnouncedSpy.wait()); + + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); +} + +TestLayerShellV1Interface::~TestLayerShellV1Interface() +{ + if (m_clientXdgShell) { + delete m_clientXdgShell; + m_clientXdgShell = nullptr; + } + if (m_clientLayerShell) { + delete m_clientLayerShell; + m_clientLayerShell = nullptr; + } + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + m_connection->deleteLater(); + m_connection = nullptr; +} + +void TestLayerShellV1Interface::testDesiredSize() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + clientShellSurface->set_size(10, 20); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy desiredSizeChangedSpy(serverShellSurface, &LayerSurfaceV1Interface::desiredSizeChanged); + QVERIFY(desiredSizeChangedSpy.isValid()); + QVERIFY(desiredSizeChangedSpy.wait()); + + QCOMPARE(serverShellSurface->desiredSize(), QSize(10, 20)); +} + +void TestLayerShellV1Interface::testScope() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("foobar"))); + clientShellSurface->set_size(100, 50); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + QCOMPARE(serverShellSurface->scope(), QStringLiteral("foobar")); +} + +void TestLayerShellV1Interface::testAnchor_data() +{ + QTest::addColumn("anchor"); + QTest::addColumn("expected"); + + QTest::addRow("left") << int(QtWayland::zwlr_layer_surface_v1::anchor_left) << Qt::LeftEdge; + QTest::addRow("right") << int(QtWayland::zwlr_layer_surface_v1::anchor_right) << Qt::RightEdge; + QTest::addRow("top") << int(QtWayland::zwlr_layer_surface_v1::anchor_top) << Qt::TopEdge; + QTest::addRow("bottom") << int(QtWayland::zwlr_layer_surface_v1::anchor_bottom) << Qt::BottomEdge; +} + +void TestLayerShellV1Interface::testAnchor() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + QFETCH(int, anchor); + QFETCH(Qt::Edge, expected); + + clientShellSurface->set_anchor(anchor); + clientShellSurface->set_size(100, 50); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy anchorChangedSpy(serverShellSurface, &LayerSurfaceV1Interface::anchorChanged); + QVERIFY(anchorChangedSpy.isValid()); + QVERIFY(anchorChangedSpy.wait()); + + QCOMPARE(serverShellSurface->anchor(), expected); +} + +void TestLayerShellV1Interface::testMargins() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + clientShellSurface->set_margin(10, 20, 30, 40); + clientShellSurface->set_size(100, 50); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy marginsChangedSpy(serverShellSurface, &LayerSurfaceV1Interface::marginsChanged); + QVERIFY(marginsChangedSpy.isValid()); + QVERIFY(marginsChangedSpy.wait()); + + QCOMPARE(serverShellSurface->margins(), QMargins(40, 10, 20, 30)); +} + +void TestLayerShellV1Interface::testExclusiveZone() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + clientShellSurface->set_exclusive_zone(10); + clientShellSurface->set_size(100, 50); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy exclusiveZoneChangedSpy(serverShellSurface, &LayerSurfaceV1Interface::exclusiveZoneChanged); + QVERIFY(exclusiveZoneChangedSpy.isValid()); + QVERIFY(exclusiveZoneChangedSpy.wait()); + + QCOMPARE(serverShellSurface->exclusiveZone(), 10); +} + +void TestLayerShellV1Interface::testExclusiveEdge_data() +{ + QTest::addColumn("anchor"); + QTest::addColumn("expected"); + + QTest::addRow("left (singular)") << int(QtWayland::zwlr_layer_surface_v1::anchor_left) << Qt::LeftEdge; + + QTest::addRow("left (triplet)") << (QtWayland::zwlr_layer_surface_v1::anchor_bottom | QtWayland::zwlr_layer_surface_v1::anchor_left + | QtWayland::zwlr_layer_surface_v1::anchor_top) + << Qt::LeftEdge; + + QTest::addRow("right (singular)") << int(QtWayland::zwlr_layer_surface_v1::anchor_right) << Qt::RightEdge; + + QTest::addRow("right (triplet)") << (QtWayland::zwlr_layer_surface_v1::anchor_top | QtWayland::zwlr_layer_surface_v1::anchor_right + | QtWayland::zwlr_layer_surface_v1::anchor_bottom) + << Qt::RightEdge; + + QTest::addRow("top (singular)") << int(QtWayland::zwlr_layer_surface_v1::anchor_top) << Qt::TopEdge; + + QTest::addRow("top (triplet)") << (QtWayland::zwlr_layer_surface_v1::anchor_left | QtWayland::zwlr_layer_surface_v1::anchor_top + | QtWayland::zwlr_layer_surface_v1::anchor_right) + << Qt::TopEdge; + + QTest::addRow("bottom (singular)") << int(QtWayland::zwlr_layer_surface_v1::anchor_bottom) << Qt::BottomEdge; + + QTest::addRow("bottom (triplet)") << (QtWayland::zwlr_layer_surface_v1::anchor_right | QtWayland::zwlr_layer_surface_v1::anchor_bottom + | QtWayland::zwlr_layer_surface_v1::anchor_left) + << Qt::BottomEdge; + + QTest::addRow("all") << (QtWayland::zwlr_layer_surface_v1::anchor_left | QtWayland::zwlr_layer_surface_v1::anchor_right + | QtWayland::zwlr_layer_surface_v1::anchor_top | QtWayland::zwlr_layer_surface_v1::anchor_bottom) + << Qt::Edge(); +} + +void TestLayerShellV1Interface::testExclusiveEdge() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + QFETCH(int, anchor); + QFETCH(Qt::Edge, expected); + + clientShellSurface->set_exclusive_zone(10); + clientShellSurface->set_size(100, 50); + clientShellSurface->set_anchor(anchor); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy anchorChangedSpy(serverShellSurface, &LayerSurfaceV1Interface::anchorChanged); + QVERIFY(anchorChangedSpy.isValid()); + QVERIFY(anchorChangedSpy.wait()); + + QCOMPARE(serverShellSurface->exclusiveEdge(), expected); +} + +void TestLayerShellV1Interface::testLayer_data() +{ + QTest::addColumn("layer"); + QTest::addColumn("expected"); + + QTest::addRow("overlay") << int(QtWayland::zwlr_layer_shell_v1::layer_overlay) << LayerSurfaceV1Interface::OverlayLayer; + QTest::addRow("top") << int(QtWayland::zwlr_layer_shell_v1::layer_top) << LayerSurfaceV1Interface::TopLayer; + QTest::addRow("bottom") << int(QtWayland::zwlr_layer_shell_v1::layer_bottom) << LayerSurfaceV1Interface::BottomLayer; + QTest::addRow("background") << int(QtWayland::zwlr_layer_shell_v1::layer_background) << LayerSurfaceV1Interface::BackgroundLayer; +} + +void TestLayerShellV1Interface::testLayer() +{ + // Create a test wl_surface object. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + // Create a test wlr_layer_surface_v1 object. + QScopedPointer clientShellSurface(new LayerSurfaceV1); + clientShellSurface->init(m_clientLayerShell->get_layer_surface(*clientSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("test"))); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverShellSurface); + + QFETCH(int, layer); + QFETCH(LayerSurfaceV1Interface::Layer, expected); + + clientShellSurface->set_layer(layer); + clientShellSurface->set_size(100, 50); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + + QSignalSpy committedSpy(serverSurface, &SurfaceInterface::committed); + QVERIFY(committedSpy.isValid()); + QVERIFY(committedSpy.wait()); + + QCOMPARE(serverShellSurface->layer(), expected); +} + +void TestLayerShellV1Interface::testPopup() +{ + // Create a test wl_surface object for the panel. + QSignalSpy serverPanelSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverPanelSurfaceCreatedSpy.isValid()); + QScopedPointer clientPanelSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverPanelSurfaceCreatedSpy.wait()); + SurfaceInterface *serverPanelSurface = serverPanelSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverPanelSurface); + + // Create a test wlr_layer_surface_v1 object for the panel.. + QScopedPointer clientPanelShellSurface(new LayerSurfaceV1); + clientPanelShellSurface->init(m_clientLayerShell->get_layer_surface(*clientPanelSurface, nullptr, LayerShellV1::layer_top, QStringLiteral("panel"))); + clientPanelShellSurface->set_size(100, 50); + QSignalSpy layerSurfaceCreatedSpy(m_serverLayerShell, &LayerShellV1Interface::surfaceCreated); + QVERIFY(layerSurfaceCreatedSpy.isValid()); + QVERIFY(layerSurfaceCreatedSpy.wait()); + auto serverPanelShellSurface = layerSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverPanelShellSurface); + + // Create a wl_surface object for the popup. + QScopedPointer clientPopupSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverPanelSurfaceCreatedSpy.wait()); + SurfaceInterface *serverPopupSurface = serverPanelSurfaceCreatedSpy.last().first().value(); + QVERIFY(serverPopupSurface); + + // Create an xdg_surface object for the popup. + QScopedPointer clientXdgSurface(new XdgSurface); + clientXdgSurface->init(m_clientXdgShell->get_xdg_surface(*clientPopupSurface)); + + // Create an xdg_positioner object for the popup. + QScopedPointer<::XdgPositioner> positioner(new ::XdgPositioner); + positioner->init(m_clientXdgShell->create_positioner()); + positioner->set_size(100, 100); + positioner->set_anchor_rect(0, 0, 10, 10); + + // Create an xdg_popup surface. + QScopedPointer clientXdgPopup(new XdgPopup); + clientXdgPopup->init(clientXdgSurface->get_popup(nullptr, positioner->object())); + + // Wait for the server side to catch up. + QSignalSpy popupCreatedSpy(m_serverXdgShell, &XdgShellInterface::popupCreated); + QVERIFY(popupCreatedSpy.wait()); + XdgPopupInterface *serverPopupShellSurface = popupCreatedSpy.last().first().value(); + QVERIFY(serverPopupShellSurface); + QCOMPARE(serverPopupShellSurface->parentSurface(), nullptr); + + // Make the xdg_popup surface a child of the panel. + clientPanelShellSurface->get_popup(clientXdgPopup->object()); + + // Commit the initial state of the xdg_popup surface. + clientPopupSurface->commit(KWayland::Client::Surface::CommitFlag::None); + QSignalSpy initializeRequestedSpy(serverPopupShellSurface, &XdgPopupInterface::initializeRequested); + QVERIFY(initializeRequestedSpy.isValid()); + QVERIFY(initializeRequestedSpy.wait()); + + // The popup should be a transient for the panel. + QCOMPARE(serverPopupShellSurface->parentSurface(), serverPanelSurface); +} + +QTEST_GUILESS_MAIN(TestLayerShellV1Interface) + +#include "test_layershellv1_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_no_xdg_runtime_dir.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_no_xdg_runtime_dir.cpp --- dwayland-5.57.0.23/autotests/server/test_no_xdg_runtime_dir.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_no_xdg_runtime_dir.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // WaylandServer #include "../../src/server/display.h" -using namespace KWayland::Server; +using namespace KWaylandServer; class NoXdgRuntimeDirTest : public QObject { @@ -45,10 +31,8 @@ Display display; QSignalSpy runningSpy(&display, &Display::runningChanged); QVERIFY(runningSpy.isValid()); - display.setSocketName(testSocketName); - QVERIFY(!display.isRunning()); + QVERIFY(!display.addSocketName(testSocketName)); display.start(); - QVERIFY(!display.isRunning()); // call into dispatchEvents should not crash display.dispatchEvents(); diff -Nru dwayland-5.57.0.23/autotests/server/test_qt_surface_extension.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_qt_surface_extension.cpp --- dwayland-5.57.0.23/autotests/server/test_qt_surface_extension.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_qt_surface_extension.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -// Qt -#include -#include -// WaylandServer -#include "../../src/server/compositor_interface.h" -#include "../../src/server/display.h" -#include "../../src/server/output_interface.h" -#include "../../src/server/qtsurfaceextension_interface.h" -#include "../../src/server/seat_interface.h" -#include "../../src/server/shell_interface.h" - -using namespace KWayland::Server; - - -class TestQtSurfaceExtension : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void testCloseWindow(); -}; - -static const QString s_socketName = QStringLiteral("kwin-wayland-server-qt-surface-extension-0"); - -void TestQtSurfaceExtension::testCloseWindow() -{ - // this test verifies that we can close windows through the Qt surface extension interface - // for this we start a dummy server, launch a QtWayland powered application, wait for the - // window it opens, close it and verify that the process terminates - Display display; - display.setSocketName(s_socketName); - display.start(); - display.createShm(); - SeatInterface *seat = display.createSeat(); - seat->setHasKeyboard(true); - seat->setHasPointer(true); - seat->setHasTouch(true); - seat->create(); - CompositorInterface *compositor = display.createCompositor(); - compositor->create(); - ShellInterface *shell = display.createShell(); - shell->create(); - OutputInterface *output = display.createOutput(); - output->setManufacturer(QStringLiteral("org.kde")); - output->setModel(QStringLiteral("QtSurfaceExtensionTestCase")); - output->addMode(QSize(1280, 1024), OutputInterface::ModeFlag::Preferred | OutputInterface::ModeFlag::Current); - output->setPhysicalSize(QSize(1280, 1024) / 3.8); - output->create(); - // surface extension - QtSurfaceExtensionInterface *surfaceExtension = display.createQtSurfaceExtension(); - surfaceExtension->create(); - // create a signalspy for surfaceCreated - QSignalSpy surfaceExtensionSpy(surfaceExtension, &QtSurfaceExtensionInterface::surfaceCreated); - QVERIFY(surfaceExtensionSpy.isValid()); - - // now start our application - QString binary = QFINDTESTDATA("surfaceExtensionHelper"); - QVERIFY(!binary.isEmpty()); - - QProcess process; - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - env.insert(QStringLiteral("WAYLAND_DISPLAY"), s_socketName); - process.setProcessEnvironment(env); - process.start(binary, QStringList()); - QVERIFY(surfaceExtensionSpy.wait()); - QCOMPARE(surfaceExtensionSpy.count(), 1); - auto *extension = surfaceExtensionSpy.first().first().value(); - QVERIFY(extension); - QSignalSpy surfaceExtensionDestroyedSpy(extension, &QObject::destroyed); - QVERIFY(surfaceExtensionSpy.isValid()); - qRegisterMetaType(); - QSignalSpy processStateChangedSpy(&process, &QProcess::stateChanged); - QVERIFY(processStateChangedSpy.isValid()); - extension->close(); - extension->client()->flush(); - - QVERIFY(processStateChangedSpy.wait()); - QCOMPARE(process.exitStatus(), QProcess::NormalExit); - if (surfaceExtensionDestroyedSpy.count() == 0) { - QVERIFY(surfaceExtensionDestroyedSpy.wait()); - } - QCOMPARE(surfaceExtensionSpy.count(), 1); -} - -QTEST_GUILESS_MAIN(TestQtSurfaceExtension) -#include "test_qt_surface_extension.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_screencast.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_screencast.cpp --- dwayland-5.57.0.23/autotests/server/test_screencast.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_screencast.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,186 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +// Qt +#include +#include +#include + +#include + +// WaylandServer +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/screencast_v1_interface.h" +#include "../../src/server/seat_interface.h" + +#include <../../src/client/compositor.h> +#include <../../src/client/connection_thread.h> +#include <../../src/client/event_queue.h> +#include <../../src/client/registry.h> +#include <../../src/client/seat.h> + +#include "qwayland-zkde-screencast-unstable-v1.h" + +class ScreencastStreamV1 : public QObject, public QtWayland::zkde_screencast_stream_unstable_v1 +{ + Q_OBJECT + +public: + ScreencastStreamV1(::zkde_screencast_stream_unstable_v1 *obj, QObject *parent) + : QObject(parent) + , zkde_screencast_stream_unstable_v1(obj) + { + } + + void zkde_screencast_stream_unstable_v1_created(uint32_t node) override + { + Q_EMIT created(node); + } + +Q_SIGNALS: + void created(quint32 node); +}; + +class ScreencastV1 : public QObject, public QtWayland::zkde_screencast_unstable_v1 +{ + Q_OBJECT + +public: + ScreencastV1(QObject *parent) + : QObject(parent) + { + } + + ScreencastStreamV1 *createWindowStream(const QString &uuid) + { + return new ScreencastStreamV1(stream_window(uuid, 2), this); + } +}; + +class TestScreencastV1Interface : public QObject +{ + Q_OBJECT + +public: + TestScreencastV1Interface() + { + } + + ~TestScreencastV1Interface() override; + +private Q_SLOTS: + void initTestCase(); + void testCreate(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue = nullptr; + ScreencastV1 *m_screencast = nullptr; + + KWaylandServer::ScreencastV1Interface *m_screencastInterface = nullptr; + + QPointer m_triggered = nullptr; + QThread *m_thread; + KWaylandServer::Display *m_display = nullptr; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-screencast-test-0"); + +void TestScreencastV1Interface::initTestCase() +{ + delete m_display; + m_display = new KWaylandServer::Display(this); + m_display->addSocketName(s_socketName); + m_display->start(); + QVERIFY(m_display->isRunning()); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + QVERIFY(connectedSpy.isValid()); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + KWayland::Client::Registry registry; + + QSignalSpy screencastSpy(®istry, &KWayland::Client::Registry::interfacesAnnounced); + QVERIFY(screencastSpy.isValid()); + m_screencastInterface = new KWaylandServer::ScreencastV1Interface(m_display, this); + connect(m_screencastInterface, + &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, + this, + [this](KWaylandServer::ScreencastStreamV1Interface *stream, const QString &winid) { + Q_UNUSED(winid); + stream->sendCreated(123); + m_triggered = stream; + }); + + connect(®istry, + &KWayland::Client::Registry::interfaceAnnounced, + this, + [this, ®istry](const QByteArray &interfaceName, quint32 name, quint32 version) { + if (interfaceName != "zkde_screencast_unstable_v1") + return; + m_screencast = new ScreencastV1(this); + m_screencast->init(&*registry, name, version); + }); + registry.setEventQueue(m_queue); + registry.create(m_connection->display()); + QVERIFY(registry.isValid()); + registry.setup(); + wl_display_flush(m_connection->display()); + + QVERIFY(m_screencastInterface); + QVERIFY(m_screencast || screencastSpy.wait()); + QVERIFY(m_screencast); +} + +TestScreencastV1Interface::~TestScreencastV1Interface() +{ + delete m_queue; + m_queue = nullptr; + + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + m_connection->deleteLater(); + m_connection = nullptr; + + delete m_display; +} + +void TestScreencastV1Interface::testCreate() +{ + auto stream = m_screencast->createWindowStream("3"); + QVERIFY(stream); + + QSignalSpy spyWorking(stream, &ScreencastStreamV1::created); + QVERIFY(spyWorking.count() || spyWorking.wait()); + QVERIFY(m_triggered); + + QSignalSpy spyStop(m_triggered, &KWaylandServer::ScreencastStreamV1Interface::finished); + stream->close(); + QVERIFY(spyStop.count() || spyStop.wait()); +} + +QTEST_GUILESS_MAIN(TestScreencastV1Interface) + +#include "test_screencast.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_seat.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_seat.cpp --- dwayland-5.57.0.23/autotests/server/test_seat.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_seat.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,31 +1,17 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ // Qt #include // WaylandServer #include "../../src/server/display.h" +#include "../../src/server/keyboard_interface.h" #include "../../src/server/pointer_interface.h" #include "../../src/server/seat_interface.h" -using namespace KWayland::Server; - +using namespace KWaylandServer; class TestWaylandServerSeat : public QObject { @@ -35,7 +21,6 @@ void testName(); void testPointerButton(); void testPointerPos(); - void testDestroyThroughTerminate(); void testRepeatInfo(); void testMultiple(); }; @@ -45,9 +30,9 @@ void TestWaylandServerSeat::testCapabilities() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); - SeatInterface *seat = display.createSeat(); + SeatInterface *seat = new SeatInterface(&display); QVERIFY(!seat->hasKeyboard()); QVERIFY(!seat->hasPointer()); QVERIFY(!seat->hasTouch()); @@ -95,9 +80,9 @@ void TestWaylandServerSeat::testName() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); - SeatInterface *seat = display.createSeat(); + SeatInterface *seat = new SeatInterface(&display); QCOMPARE(seat->name(), QString()); QSignalSpy nameSpy(seat, SIGNAL(nameChanged(QString))); @@ -114,11 +99,10 @@ void TestWaylandServerSeat::testPointerButton() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); - SeatInterface *seat = display.createSeat(); - PointerInterface *pointer = seat->focusedPointer(); - QVERIFY(!pointer); + SeatInterface *seat = new SeatInterface(&display); + seat->setHasPointer(true); // no button pressed yet, should be released and no serial QVERIFY(!seat->isPointerButtonPressed(0)); @@ -127,7 +111,8 @@ QCOMPARE(seat->pointerButtonSerial(1), quint32(0)); // mark the button as pressed - seat->pointerButtonPressed(0); + seat->notifyPointerButton(0, PointerButtonState::Pressed); + seat->notifyPointerFrame(); QVERIFY(seat->isPointerButtonPressed(0)); QCOMPARE(seat->pointerButtonSerial(0), display.serial()); @@ -136,7 +121,8 @@ QCOMPARE(seat->pointerButtonSerial(1), quint32(0)); // release it again - seat->pointerButtonReleased(0); + seat->notifyPointerButton(0, PointerButtonState::Released); + seat->notifyPointerFrame(); QVERIFY(!seat->isPointerButtonPressed(0)); QCOMPARE(seat->pointerButtonSerial(0), display.serial()); } @@ -144,74 +130,65 @@ void TestWaylandServerSeat::testPointerPos() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); - SeatInterface *seat = display.createSeat(); + SeatInterface *seat = new SeatInterface(&display); + seat->setHasPointer(true); QSignalSpy seatPosSpy(seat, SIGNAL(pointerPosChanged(QPointF))); QVERIFY(seatPosSpy.isValid()); - PointerInterface *pointer = seat->focusedPointer(); - QVERIFY(!pointer); QCOMPARE(seat->pointerPos(), QPointF()); - seat->setPointerPos(QPointF(10, 15)); + seat->notifyPointerMotion(QPointF(10, 15)); + seat->notifyPointerFrame(); QCOMPARE(seat->pointerPos(), QPointF(10, 15)); QCOMPARE(seatPosSpy.count(), 1); QCOMPARE(seatPosSpy.first().first().toPointF(), QPointF(10, 15)); - seat->setPointerPos(QPointF(10, 15)); + seat->notifyPointerMotion(QPointF(10, 15)); + seat->notifyPointerFrame(); QCOMPARE(seatPosSpy.count(), 1); - seat->setPointerPos(QPointF(5, 7)); + seat->notifyPointerMotion(QPointF(5, 7)); + seat->notifyPointerFrame(); QCOMPARE(seat->pointerPos(), QPointF(5, 7)); QCOMPARE(seatPosSpy.count(), 2); QCOMPARE(seatPosSpy.first().first().toPointF(), QPointF(10, 15)); QCOMPARE(seatPosSpy.last().first().toPointF(), QPointF(5, 7)); } -void TestWaylandServerSeat::testDestroyThroughTerminate() -{ - Display display; - display.setSocketName(s_socketName); - display.start(); - SeatInterface *seat = display.createSeat(); - QSignalSpy destroyedSpy(seat, SIGNAL(destroyed(QObject*))); - QVERIFY(destroyedSpy.isValid()); - display.terminate(); - QVERIFY(!destroyedSpy.isEmpty()); -} - void TestWaylandServerSeat::testRepeatInfo() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); - SeatInterface *seat = display.createSeat(); - QCOMPARE(seat->keyRepeatRate(), 0); - QCOMPARE(seat->keyRepeatDelay(), 0); - seat->setKeyRepeatInfo(25, 660); - QCOMPARE(seat->keyRepeatRate(), 25); - QCOMPARE(seat->keyRepeatDelay(), 660); + SeatInterface *seat = new SeatInterface(&display); + seat->setHasKeyboard(true); + QCOMPARE(seat->keyboard()->keyRepeatRate(), 0); + QCOMPARE(seat->keyboard()->keyRepeatDelay(), 0); + seat->keyboard()->setRepeatInfo(25, 660); + QCOMPARE(seat->keyboard()->keyRepeatRate(), 25); + QCOMPARE(seat->keyboard()->keyRepeatDelay(), 660); // setting negative values should result in 0 - seat->setKeyRepeatInfo(-25, -660); - QCOMPARE(seat->keyRepeatRate(), 0); - QCOMPARE(seat->keyRepeatDelay(), 0); + seat->keyboard()->setRepeatInfo(-25, -660); + QCOMPARE(seat->keyboard()->keyRepeatRate(), 0); + QCOMPARE(seat->keyboard()->keyRepeatDelay(), 0); } void TestWaylandServerSeat::testMultiple() { Display display; - display.setSocketName(s_socketName); + display.addSocketName(s_socketName); display.start(); QVERIFY(display.seats().isEmpty()); - SeatInterface *seat1 = display.createSeat(); + SeatInterface *seat1 = new SeatInterface(&display); QCOMPARE(display.seats().count(), 1); QCOMPARE(display.seats().at(0), seat1); - SeatInterface *seat2 = display.createSeat(); + SeatInterface *seat2 = new SeatInterface(&display); QCOMPARE(display.seats().count(), 2); QCOMPARE(display.seats().at(0), seat1); QCOMPARE(display.seats().at(1), seat2); - SeatInterface *seat3 = display.createSeat(); + SeatInterface *seat3 = new SeatInterface(&display); QCOMPARE(display.seats().count(), 3); QCOMPARE(display.seats().at(0), seat1); QCOMPARE(display.seats().at(1), seat2); diff -Nru dwayland-5.57.0.23/autotests/server/test_tablet_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_tablet_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_tablet_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_tablet_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,359 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +// Qt +#include +#include +#include +// WaylandServer +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/tablet_v2_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/surface.h" + +#include "qwayland-tablet-unstable-v2.h" + +using namespace KWaylandServer; + +class Tablet : public QtWayland::zwp_tablet_v2 +{ +public: + Tablet(::zwp_tablet_v2 *t) + : QtWayland::zwp_tablet_v2(t) + { + } +}; + +class TabletPad : public QObject, public QtWayland::zwp_tablet_pad_v2 +{ + Q_OBJECT +public: + TabletPad(::zwp_tablet_pad_v2 *t) + : QtWayland::zwp_tablet_pad_v2(t) + { + } + + void zwp_tablet_pad_v2_done() override + { + Q_ASSERT(!doneCalled); + doneCalled = true; + } + + void zwp_tablet_pad_v2_buttons(uint32_t buttons) override + { + Q_ASSERT(buttons == 1); + } + + void zwp_tablet_pad_v2_enter(uint32_t /*serial*/, struct ::zwp_tablet_v2 * /*tablet*/, struct ::wl_surface *surface) override + { + m_currentSurface = surface; + } + + void zwp_tablet_pad_v2_button(uint32_t /*time*/, uint32_t button, uint32_t state) override + { + buttonStates[m_currentSurface][button] = state; + Q_EMIT buttonReceived(); + } + + ::wl_surface *m_currentSurface = nullptr; + + bool doneCalled = false; + QHash<::wl_surface *, QHash> buttonStates; + +Q_SIGNALS: + void buttonReceived(); +}; + +class Tool : public QObject, public QtWayland::zwp_tablet_tool_v2 +{ + Q_OBJECT +public: + Tool(::zwp_tablet_tool_v2 *t) + : QtWayland::zwp_tablet_tool_v2(t) + { + } + + void zwp_tablet_tool_v2_proximity_in(uint32_t /*serial*/, struct ::zwp_tablet_v2 * /*tablet*/, struct ::wl_surface *surface) override + { + surfaceApproximated[surface]++; + } + + void zwp_tablet_tool_v2_frame(uint32_t time) override + { + Q_EMIT frame(time); + } + + QHash surfaceApproximated; +Q_SIGNALS: + void frame(quint32 time); +}; + +class TabletSeat : public QObject, public QtWayland::zwp_tablet_seat_v2 +{ + Q_OBJECT +public: + TabletSeat(::zwp_tablet_seat_v2 *seat) + : QtWayland::zwp_tablet_seat_v2(seat) + { + } + + void zwp_tablet_seat_v2_tablet_added(struct ::zwp_tablet_v2 *id) override + { + m_tablets << new Tablet(id); + Q_EMIT tabletAdded(); + } + void zwp_tablet_seat_v2_tool_added(struct ::zwp_tablet_tool_v2 *id) override + { + m_tools << new Tool(id); + Q_EMIT toolAdded(); + } + + void zwp_tablet_seat_v2_pad_added(struct ::zwp_tablet_pad_v2 *id) override + { + m_pads << new TabletPad(id); + Q_EMIT padAdded(); + } + + QVector m_tablets; + QVector m_pads; + QVector m_tools; + +Q_SIGNALS: + void padAdded(); + void toolAdded(); + void tabletAdded(); +}; + +class TestTabletInterface : public QObject +{ + Q_OBJECT +public: + TestTabletInterface() + { + } + ~TestTabletInterface() override; + +private Q_SLOTS: + void initTestCase(); + void testAdd(); + void testAddPad(); + void testInteractSimple(); + void testInteractSurfaceChange(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::Seat *m_clientSeat = nullptr; + + QThread *m_thread; + Display m_display; + SeatInterface *m_seat; + CompositorInterface *m_serverCompositor; + + TabletSeat *m_tabletSeatClient = nullptr; + TabletManagerV2Interface *m_tabletManager; + QVector m_surfacesClient; + + TabletV2Interface *m_tablet; + TabletPadV2Interface *m_tabletPad = nullptr; + TabletToolV2Interface *m_tool; + + QVector m_surfaces; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-tablet-test-0"); + +void TestTabletInterface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_seat = new SeatInterface(&m_display, this); + m_serverCompositor = new CompositorInterface(&m_display, this); + m_tabletManager = new TabletManagerV2Interface(&m_display, this); + + connect(m_serverCompositor, &CompositorInterface::surfaceCreated, this, [this](SurfaceInterface *surface) { + m_surfaces += surface; + }); + + // setup connection + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 name, quint32 version) { + if (interface == "zwp_tablet_manager_v2") { + auto tabletClient = new QtWayland::zwp_tablet_manager_v2(registry->registry(), name, version); + auto _seat = tabletClient->get_tablet_seat(*m_clientSeat); + m_tabletSeatClient = new TabletSeat(_seat); + } + }); + connect(registry, &KWayland::Client::Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_clientSeat = registry->createSeat(name, version); + }); + registry->setEventQueue(m_queue); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + wl_display_flush(m_connection->display()); + + QVERIFY(compositorSpy.wait()); + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + + QSignalSpy surfaceSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + for (int i = 0; i < 3; ++i) { + m_surfacesClient += m_clientCompositor->createSurface(this); + } + QVERIFY(surfaceSpy.count() < 3 && surfaceSpy.wait(200)); + QVERIFY(m_surfaces.count() == 3); + QVERIFY(m_tabletSeatClient); +} + +TestTabletInterface::~TestTabletInterface() +{ + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + delete m_tabletSeatClient; + m_connection->deleteLater(); + m_connection = nullptr; +} + +void TestTabletInterface::testAdd() +{ + TabletSeatV2Interface *seatInterface = m_tabletManager->seat(m_seat); + QVERIFY(seatInterface); + + QSignalSpy tabletSpy(m_tabletSeatClient, &TabletSeat::tabletAdded); + m_tablet = seatInterface->addTablet(1, 2, QStringLiteral("event33"), QStringLiteral("my tablet"), {QStringLiteral("/test/event33")}); + QVERIFY(m_tablet); + QVERIFY(tabletSpy.wait() || tabletSpy.count() == 1); + QCOMPARE(m_tabletSeatClient->m_tablets.count(), 1); + + QSignalSpy toolSpy(m_tabletSeatClient, &TabletSeat::toolAdded); + m_tool = seatInterface->addTool(KWaylandServer::TabletToolV2Interface::Pen, 0, 0, {TabletToolV2Interface::Tilt, TabletToolV2Interface::Pressure}); + QVERIFY(m_tool); + QVERIFY(toolSpy.wait() || toolSpy.count() == 1); + QCOMPARE(m_tabletSeatClient->m_tools.count(), 1); + + QVERIFY(!m_tool->isClientSupported()); // There's no surface in it yet + m_tool->setCurrentSurface(nullptr); + QVERIFY(!m_tool->isClientSupported()); // There's no surface in it + + QCOMPARE(m_surfaces.count(), 3); + for (SurfaceInterface *surface : m_surfaces) { + m_tool->setCurrentSurface(surface); + } + m_tool->setCurrentSurface(nullptr); +} + +void TestTabletInterface::testAddPad() +{ + TabletSeatV2Interface *seatInterface = m_tabletManager->seat(m_seat); + QVERIFY(seatInterface); + + QSignalSpy tabletPadSpy(m_tabletSeatClient, &TabletSeat::padAdded); + m_tabletPad = + seatInterface->addTabletPad(QStringLiteral("my tablet pad"), QStringLiteral("tabletpad"), {QStringLiteral("/test/event33")}, 1, 1, 1, 1, 0, m_tablet); + QVERIFY(m_tabletPad); + QVERIFY(tabletPadSpy.wait() || tabletPadSpy.count() == 1); + QCOMPARE(m_tabletSeatClient->m_pads.count(), 1); + QVERIFY(m_tabletSeatClient->m_pads[0]); + + QVERIFY(m_tabletPad->ring(0)); + QVERIFY(m_tabletPad->strip(0)); + + QCOMPARE(m_surfaces.count(), 3); + QVERIFY(m_tabletSeatClient->m_pads[0]->buttonStates.isEmpty()); + QSignalSpy buttonSpy(m_tabletSeatClient->m_pads[0], &TabletPad::buttonReceived); + m_tabletPad->setCurrentSurface(m_surfaces[0], m_tablet); + m_tabletPad->sendButton(123, 0, QtWayland::zwp_tablet_pad_v2::button_state_pressed); + QVERIFY(buttonSpy.count() || buttonSpy.wait(100)); + QCOMPARE(m_tabletSeatClient->m_pads[0]->doneCalled, true); + QCOMPARE(m_tabletSeatClient->m_pads[0]->buttonStates.count(), 1); + QCOMPARE(m_tabletSeatClient->m_pads[0]->buttonStates[*m_surfacesClient[0]][0], QtWayland::zwp_tablet_pad_v2::button_state_pressed); +} + +static uint s_serial = 0; +void TestTabletInterface::testInteractSimple() +{ + QSignalSpy frameSpy(m_tabletSeatClient->m_tools[0], &Tool::frame); + + QVERIFY(!m_tool->isClientSupported()); + m_tool->setCurrentSurface(m_surfaces[0]); + QVERIFY(m_tool->isClientSupported() && m_tablet->isSurfaceSupported(m_surfaces[0])); + m_tool->sendProximityIn(m_tablet); + m_tool->sendPressure(0); + m_tool->sendFrame(s_serial++); + m_tool->sendMotion({3, 3}); + m_tool->sendFrame(s_serial++); + m_tool->sendProximityOut(); + QVERIFY(m_tool->isClientSupported()); + m_tool->sendFrame(s_serial++); + QVERIFY(!m_tool->isClientSupported()); + + QVERIFY(frameSpy.wait(500)); + QCOMPARE(m_tabletSeatClient->m_tools[0]->surfaceApproximated.count(), 1); +} + +void TestTabletInterface::testInteractSurfaceChange() +{ + m_tabletSeatClient->m_tools[0]->surfaceApproximated.clear(); + QSignalSpy frameSpy(m_tabletSeatClient->m_tools[0], &Tool::frame); + QVERIFY(!m_tool->isClientSupported()); + m_tool->setCurrentSurface(m_surfaces[0]); + QVERIFY(m_tool->isClientSupported() && m_tablet->isSurfaceSupported(m_surfaces[0])); + m_tool->sendProximityIn(m_tablet); + m_tool->sendPressure(0); + m_tool->sendFrame(s_serial++); + + m_tool->setCurrentSurface(m_surfaces[1]); + QVERIFY(m_tool->isClientSupported()); + + m_tool->sendMotion({3, 3}); + m_tool->sendFrame(s_serial++); + m_tool->sendProximityOut(); + QVERIFY(m_tool->isClientSupported()); + m_tool->sendFrame(s_serial++); + QVERIFY(!m_tool->isClientSupported()); + + QVERIFY(frameSpy.wait(500)); + QCOMPARE(m_tabletSeatClient->m_tools[0]->surfaceApproximated.count(), 2); +} + +QTEST_GUILESS_MAIN(TestTabletInterface) +#include "test_tablet_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_textinputv3_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_textinputv3_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_textinputv3_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_textinputv3_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,646 @@ +/* + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include +#include + +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/seat_interface.h" +#include "../../src/server/surface_interface.h" +#include "../../src/server/textinput_v3_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/registry.h" +#include "../../src/client/seat.h" +#include "../../src/client/surface.h" + +#include "qwayland-text-input-unstable-v3.h" + +using namespace KWaylandServer; + +Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v3::content_purpose) +Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v3::content_hint) + +class TextInputV3 : public QObject, public QtWayland::zwp_text_input_v3 +{ + Q_OBJECT +Q_SIGNALS: + void surface_enter(wl_surface *surface); + void surface_leave(wl_surface *surface); + void commit_string(const QString &text); + void delete_surrounding_text(quint32 before_length, quint32 after_length); + void preedit_string(const QString &text, quint32 cursor_begin, quint32 cursor_end); + void done(quint32 serial); + +public: + ~TextInputV3() override + { + destroy(); + } + void zwp_text_input_v3_enter(struct ::wl_surface *surface) override + { + Q_EMIT surface_enter(surface); + } + void zwp_text_input_v3_leave(struct ::wl_surface *surface) override + { + Q_EMIT surface_leave(surface); + } + void zwp_text_input_v3_commit_string(const QString &text) override + { + commitText = text; + } + void zwp_text_input_v3_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override + { + before = before_length; + after = after_length; + } + void zwp_text_input_v3_done(uint32_t serial) override + { + Q_EMIT commit_string(commitText); + Q_EMIT preedit_string(preeditText, cursorBegin, cursorEnd); + Q_EMIT delete_surrounding_text(before, after); + Q_EMIT done(serial); + } + void zwp_text_input_v3_preedit_string(const QString &text, int32_t cursor_begin, int32_t cursor_end) override + { + preeditText = text; + cursorBegin = cursor_begin; + cursorEnd = cursor_end; + } + +private: + QString preeditText; + QString commitText; + uint32_t cursorBegin, cursorEnd; + uint32_t before, after; +}; + +class TextInputManagerV3 : public QtWayland::zwp_text_input_manager_v3 +{ +public: + ~TextInputManagerV3() override + { + destroy(); + } +}; + +class TestTextInputV3Interface : public QObject +{ + Q_OBJECT + +public: + ~TestTextInputV3Interface() override; + +private Q_SLOTS: + void initTestCase(); + void testEnableDisable(); + void testEvents(); + void testContentPurpose_data(); + void testContentPurpose(); + void testContentHints_data(); + void testContentHints(); + void testMultipleTextinputs(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::Seat *m_clientSeat = nullptr; + + SeatInterface *m_seat; + QThread *m_thread; + Display m_display; + TextInputV3 *m_clientTextInputV3; + CompositorInterface *m_serverCompositor; + TextInputV3Interface *m_serverTextInputV3; + TextInputManagerV3 *m_clientTextInputManagerV3; + + quint32 m_totalCommits = 0; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-text-input-v3-test-0"); + +void TestTextInputV3Interface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_seat = new SeatInterface(&m_display, this); + m_seat->setHasKeyboard(true); + + m_serverCompositor = new CompositorInterface(&m_display, this); + new TextInputManagerV3Interface(&m_display); + + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 id, quint32 version) { + if (interface == QByteArrayLiteral("zwp_text_input_manager_v3")) { + m_clientTextInputManagerV3 = new TextInputManagerV3(); + m_clientTextInputManagerV3->init(*registry, id, version); + } + }); + + connect(registry, &KWayland::Client::Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_clientSeat = registry->createSeat(name, version); + }); + + QSignalSpy allAnnouncedSpy(registry, &KWayland::Client::Registry::interfaceAnnounced); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + QSignalSpy shmSpy(registry, &KWayland::Client::Registry::shmAnnounced); + registry->setEventQueue(m_queue); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + QVERIFY(allAnnouncedSpy.wait()); + + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + // create a text input v3 + m_clientTextInputV3 = new TextInputV3(); + m_clientTextInputV3->init(m_clientTextInputManagerV3->get_text_input(*m_clientSeat)); + QVERIFY(m_clientTextInputV3); +} + +TestTextInputV3Interface::~TestTextInputV3Interface() +{ + if (m_clientTextInputV3) { + delete m_clientTextInputV3; + m_clientTextInputV3 = nullptr; + } + if (m_clientTextInputManagerV3) { + delete m_clientTextInputManagerV3; + m_clientTextInputManagerV3 = nullptr; + } + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + m_connection->deleteLater(); + m_connection = nullptr; +} + +// Ensures that enable disable events don't fire without commit +void TestTextInputV3Interface::testEnableDisable() +{ + // create a surface + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + m_serverTextInputV3 = m_seat->textInputV3(); + QVERIFY(m_serverTextInputV3); + + QSignalSpy focusedSurfaceChangedSpy(m_seat, &SeatInterface::focusedTextInputSurfaceChanged); + QSignalSpy textInputEnabledSpy(m_serverTextInputV3, &TextInputV3Interface::enabledChanged); + QSignalSpy cursorRectangleChangedSpy(m_serverTextInputV3, &TextInputV3Interface::cursorRectangleChanged); + + QSignalSpy surfaceEnterSpy(m_clientTextInputV3, &TextInputV3::surface_enter); + QSignalSpy surfaceLeaveSpy(m_clientTextInputV3, &TextInputV3::surface_leave); + + // Enter the textinput + QVERIFY(focusedSurfaceChangedSpy.isValid()); + QVERIFY(textInputEnabledSpy.isValid()); + + QCOMPARE(focusedSurfaceChangedSpy.count(), 0); + + // Make sure that entering surface does not trigger the text input + m_seat->setFocusedTextInputSurface(serverSurface); + QVERIFY(surfaceEnterSpy.wait()); + QCOMPARE(surfaceEnterSpy.count(), 1); + QCOMPARE(focusedSurfaceChangedSpy.count(), 1); + QCOMPARE(textInputEnabledSpy.count(), 0); + + // Now enable the textInput, we should not get event just yet + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_cursor_rectangle(0, 0, 20, 20); + m_clientTextInputV3->set_surrounding_text("KDE Plasma Desktop", 0, 3); + QCOMPARE(textInputEnabledSpy.count(), 0); + QCOMPARE(cursorRectangleChangedSpy.count(), 0); + + // after we do commit we should get event + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + m_totalCommits++; + + QCOMPARE(textInputEnabledSpy.count(), 1); + QCOMPARE(cursorRectangleChangedSpy.count(), 1); + QCOMPARE(m_serverTextInputV3->cursorRectangle(), QRect(0, 0, 20, 20)); + QCOMPARE(m_serverTextInputV3->surroundingText(), QString("KDE Plasma Desktop")); + QCOMPARE(m_serverTextInputV3->surroundingTextCursorPosition(), 0); + QCOMPARE(m_serverTextInputV3->surroundingTextSelectionAnchor(), 3); + + // disabling we should not get the event + m_clientTextInputV3->disable(); + QCOMPARE(textInputEnabledSpy.count(), 1); + + // after we do commit we should get event + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + QCOMPARE(textInputEnabledSpy.count(), 2); + m_totalCommits++; + + // Lets try leaving the surface and make sure event propogage + m_seat->setFocusedTextInputSurface(nullptr); + QVERIFY(surfaceLeaveSpy.wait()); + QCOMPARE(surfaceLeaveSpy.count(), 1); +} + +void TestTextInputV3Interface::testEvents() +{ + // create a surface + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + m_serverTextInputV3 = m_seat->textInputV3(); + QVERIFY(m_serverTextInputV3); + + QSignalSpy focusedSurfaceChangedSpy(m_seat, &SeatInterface::focusedTextInputSurfaceChanged); + QSignalSpy textInputEnabledSpy(m_serverTextInputV3, &TextInputV3Interface::enabledChanged); + + // Enter the textinput + QVERIFY(focusedSurfaceChangedSpy.isValid()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 0); + + // Make sure that entering surface does not trigger the text input + m_seat->setFocusedTextInputSurface(serverSurface); + // FIXME: somehow this triggers BEFORE setFocusedTextInputSurface returns :( + // QVERIFY(focusedSurfaceChangedSpy.wait()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 1); + + // Now enable the textInput + m_clientTextInputV3->enable(); + m_clientTextInputV3->commit(); + m_totalCommits++; + QVERIFY(textInputEnabledSpy.wait()); + + QSignalSpy preEditSpy(m_clientTextInputV3, &TextInputV3::preedit_string); + QSignalSpy commitStringSpy(m_clientTextInputV3, &TextInputV3::commit_string); + QSignalSpy deleteSurroundingSpy(m_clientTextInputV3, &TextInputV3::delete_surrounding_text); + QSignalSpy doneSpy(m_clientTextInputV3, &TextInputV3::done); + + m_serverTextInputV3->sendPreEditString("Hello KDE community!", 1, 2); + m_serverTextInputV3->deleteSurroundingText(6, 10); + m_serverTextInputV3->commitString("Plasma"); + m_serverTextInputV3->done(); + + QVERIFY(doneSpy.wait()); + QCOMPARE(doneSpy.count(), 1); + QCOMPARE(preEditSpy.count(), 1); + QCOMPARE(commitStringSpy.count(), 1); + QCOMPARE(deleteSurroundingSpy.count(), 1); + + QCOMPARE(preEditSpy.last().at(0).value(), "Hello KDE community!"); + QCOMPARE(preEditSpy.last().at(1).value(), 1); + QCOMPARE(preEditSpy.last().at(2).value(), 2); + QCOMPARE(commitStringSpy.last().at(0).value(), "Plasma"); + QCOMPARE(deleteSurroundingSpy.last().at(0).value(), 6); + QCOMPARE(deleteSurroundingSpy.last().at(1).value(), 10); + + // zwp_text_input_v3.done event have serial of total commits + QCOMPARE(doneSpy.last().at(0).value(), m_totalCommits); + + // Now disable the textInput + m_clientTextInputV3->disable(); + m_clientTextInputV3->commit(); + m_totalCommits++; + QVERIFY(textInputEnabledSpy.wait()); +} + +void TestTextInputV3Interface::testContentPurpose_data() +{ + QTest::addColumn("clientPurpose"); + QTest::addColumn("serverPurpose"); + + QTest::newRow("Alpha") << QtWayland::zwp_text_input_v3::content_purpose_alpha << TextInputContentPurpose::Alpha; + QTest::newRow("Digits") << QtWayland::zwp_text_input_v3::content_purpose_digits << TextInputContentPurpose::Digits; + QTest::newRow("Number") << QtWayland::zwp_text_input_v3::content_purpose_number << TextInputContentPurpose::Number; + QTest::newRow("Phone") << QtWayland::zwp_text_input_v3::content_purpose_phone << TextInputContentPurpose::Phone; + QTest::newRow("Url") << QtWayland::zwp_text_input_v3::content_purpose_url << TextInputContentPurpose::Url; + QTest::newRow("Email") << QtWayland::zwp_text_input_v3::content_purpose_email << TextInputContentPurpose::Email; + QTest::newRow("Name") << QtWayland::zwp_text_input_v3::content_purpose_name << TextInputContentPurpose::Name; + QTest::newRow("Password") << QtWayland::zwp_text_input_v3::content_purpose_password << TextInputContentPurpose::Password; + QTest::newRow("Pin") << QtWayland::zwp_text_input_v3::content_purpose_pin << TextInputContentPurpose::Pin; + QTest::newRow("Date") << QtWayland::zwp_text_input_v3::content_purpose_date << TextInputContentPurpose::Date; + QTest::newRow("Time") << QtWayland::zwp_text_input_v3::content_purpose_time << TextInputContentPurpose::Time; + QTest::newRow("DateTime") << QtWayland::zwp_text_input_v3::content_purpose_datetime << TextInputContentPurpose::DateTime; + QTest::newRow("Terminal") << QtWayland::zwp_text_input_v3::content_purpose_terminal << TextInputContentPurpose::Terminal; +} + +void TestTextInputV3Interface::testContentPurpose() +{ + // create a surface + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + m_serverTextInputV3 = m_seat->textInputV3(); + QVERIFY(m_serverTextInputV3); + + QSignalSpy focusedSurfaceChangedSpy(m_seat, &SeatInterface::focusedTextInputSurfaceChanged); + QSignalSpy textInputEnabledSpy(m_serverTextInputV3, &TextInputV3Interface::enabledChanged); + + // Enter the textinput + QVERIFY(focusedSurfaceChangedSpy.isValid()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 0); + + // Make sure that entering surface does not trigger the text input + m_seat->setFocusedTextInputSurface(serverSurface); + // FIXME: somehow this triggers BEFORE setFocusedTextInputSurface returns :( + // QVERIFY(focusedSurfaceChangedSpy.wait()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 1); + + // Now enable the textInput + m_clientTextInputV3->enable(); + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + m_totalCommits++; + + // Default should be normal content purpose + QCOMPARE(m_serverTextInputV3->contentPurpose(), TextInputContentPurpose::Normal); + + QSignalSpy contentTypeChangedSpy(m_serverTextInputV3, &TextInputV3Interface::contentTypeChanged); + QVERIFY(contentTypeChangedSpy.isValid()); + + QFETCH(QtWayland::zwp_text_input_v3::content_purpose, clientPurpose); + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, clientPurpose); + m_clientTextInputV3->commit(); + QVERIFY(contentTypeChangedSpy.wait()); + QTEST(m_serverTextInputV3->contentPurpose(), "serverPurpose"); + m_totalCommits++; + + // Setting same thing should not trigger update + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, clientPurpose); + m_clientTextInputV3->commit(); + QVERIFY(!contentTypeChangedSpy.wait(100)); + m_totalCommits++; + + // unset to normal + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, QtWayland::zwp_text_input_v3::content_purpose_normal); + m_clientTextInputV3->commit(); + QVERIFY(contentTypeChangedSpy.wait()); + m_totalCommits++; + QCOMPARE(m_serverTextInputV3->contentPurpose(), TextInputContentPurpose::Normal); + + // Now disable the textInput + m_clientTextInputV3->disable(); + m_clientTextInputV3->commit(); + m_totalCommits++; + QVERIFY(textInputEnabledSpy.wait()); +} + +void TestTextInputV3Interface::testContentHints_data() +{ + QTest::addColumn("clientHint"); + QTest::addColumn("serverHints"); + + QTest::addRow("Spellcheck") << quint32(QtWayland::zwp_text_input_v3::content_hint_spellcheck) + << TextInputContentHints(TextInputContentHint::AutoCorrection); + QTest::addRow("Completion") << quint32(QtWayland::zwp_text_input_v3::content_hint_completion) + << TextInputContentHints(TextInputContentHint::AutoCompletion); + QTest::addRow("AutoCapital") << quint32(QtWayland::zwp_text_input_v3::content_hint_auto_capitalization) + << TextInputContentHints(TextInputContentHint::AutoCapitalization); + QTest::addRow("Lowercase") << quint32(QtWayland::zwp_text_input_v3::content_hint_lowercase) << TextInputContentHints(TextInputContentHint::LowerCase); + QTest::addRow("Uppercase") << quint32(QtWayland::zwp_text_input_v3::content_hint_uppercase) << TextInputContentHints(TextInputContentHint::UpperCase); + QTest::addRow("Titlecase") << quint32(QtWayland::zwp_text_input_v3::content_hint_titlecase) << TextInputContentHints(TextInputContentHint::TitleCase); + QTest::addRow("HiddenText") << quint32(QtWayland::zwp_text_input_v3::content_hint_hidden_text) << TextInputContentHints(TextInputContentHint::HiddenText); + QTest::addRow("SensitiveData") << quint32(QtWayland::zwp_text_input_v3::content_hint_sensitive_data) + << TextInputContentHints(TextInputContentHint::SensitiveData); + QTest::addRow("Latin") << quint32(QtWayland::zwp_text_input_v3::content_hint_latin) << TextInputContentHints(TextInputContentHint::Latin); + QTest::addRow("Multiline") << quint32(QtWayland::zwp_text_input_v3::content_hint_multiline) << TextInputContentHints(TextInputContentHint::MultiLine); + QTest::addRow("Auto") << quint32(QtWayland::zwp_text_input_v3::content_hint_completion | QtWayland::zwp_text_input_v3::content_hint_spellcheck + | QtWayland::zwp_text_input_v3::content_hint_auto_capitalization) + << TextInputContentHints(TextInputContentHint::AutoCompletion | TextInputContentHint::AutoCorrection + | TextInputContentHint::AutoCapitalization); +} + +void TestTextInputV3Interface::testContentHints() +{ + // create a surface + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + m_serverTextInputV3 = m_seat->textInputV3(); + QVERIFY(m_serverTextInputV3); + + QSignalSpy focusedSurfaceChangedSpy(m_seat, &SeatInterface::focusedTextInputSurfaceChanged); + QSignalSpy textInputEnabledSpy(m_serverTextInputV3, &TextInputV3Interface::enabledChanged); + + // Enter the textinput + QVERIFY(focusedSurfaceChangedSpy.isValid()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 0); + + // Make sure that entering surface does not trigger the text input + m_seat->setFocusedTextInputSurface(serverSurface); + // FIXME: somehow this triggers BEFORE setFocusedTextInputSurface returns :( + // QVERIFY(focusedSurfaceChangedSpy.wait()); + QCOMPARE(focusedSurfaceChangedSpy.count(), 1); + + // Now enable the textInput + m_clientTextInputV3->enable(); + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + m_totalCommits++; + + QCOMPARE(m_serverTextInputV3->contentHints(), TextInputContentHint::None); + + // Now disable the textInput + m_clientTextInputV3->disable(); + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + m_totalCommits++; + + QSignalSpy contentTypeChangedSpy(m_serverTextInputV3, &TextInputV3Interface::contentTypeChanged); + QVERIFY(contentTypeChangedSpy.isValid()); + + QFETCH(quint32, clientHint); + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(clientHint, QtWayland::zwp_text_input_v3::content_purpose_normal); + m_clientTextInputV3->commit(); + QVERIFY(contentTypeChangedSpy.wait()); + QTEST(m_serverTextInputV3->contentHints(), "serverHints"); + m_totalCommits++; + + // Setting same thing should not trigger update + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(clientHint, QtWayland::zwp_text_input_v3::content_purpose_normal); + m_clientTextInputV3->commit(); + QVERIFY(!contentTypeChangedSpy.wait(100)); + m_totalCommits++; + + // unset to normal + m_clientTextInputV3->enable(); + m_clientTextInputV3->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, QtWayland::zwp_text_input_v3::content_purpose_normal); + m_clientTextInputV3->commit(); + QVERIFY(contentTypeChangedSpy.wait()); + m_totalCommits++; + + // Now disable the textInput + m_clientTextInputV3->disable(); + m_clientTextInputV3->commit(); + QVERIFY(textInputEnabledSpy.wait()); + m_totalCommits++; +} + +void TestTextInputV3Interface::testMultipleTextinputs() +{ + // create two more text inputs + TextInputV3 *ti1 = new TextInputV3(); + ti1->init(m_clientTextInputManagerV3->get_text_input(*m_clientSeat)); + QVERIFY(ti1); + + TextInputV3 *ti2 = new TextInputV3(); + ti2->init(m_clientTextInputManagerV3->get_text_input(*m_clientSeat)); + QVERIFY(ti2); + + // create a surface + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + QSignalSpy focusedSurfaceChangedSpy(m_seat, &SeatInterface::focusedTextInputSurfaceChanged); + // Make sure that entering surface does not trigger the text input + m_seat->setFocusedTextInputSurface(serverSurface); + QCOMPARE(focusedSurfaceChangedSpy.count(), 1); + + m_serverTextInputV3 = m_seat->textInputV3(); + QVERIFY(m_serverTextInputV3); + QVERIFY(!m_serverTextInputV3->isEnabled()); + + QSignalSpy committedSpy(m_serverTextInputV3, &TextInputV3Interface::stateCommitted); + // Enable ti1 + ti1->enable(); + ti1->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 1); + QVERIFY(m_serverTextInputV3->isEnabled()); + + // Send another three commits on ti1 + ti1->enable(); + ti1->set_surrounding_text("hello", 0, 1); + ti1->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 2); + QVERIFY(m_serverTextInputV3->isEnabled()); + + ti1->enable(); + ti1->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, QtWayland::zwp_text_input_v3::content_purpose_normal); + ti1->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 3); + QVERIFY(m_serverTextInputV3->isEnabled()); + + // at this point total commit count to ti1 is 3 + QSignalSpy doneSpy1(ti1, &TextInputV3::done); + QSignalSpy doneSpy2(ti2, &TextInputV3::done); + + m_serverTextInputV3->commitString("Hello"); + m_serverTextInputV3->done(); + QVERIFY(doneSpy1.wait()); + + // zwp_text_input_v3.done event have serial of total commits + QCOMPARE(doneSpy1.last().at(0).value(), 3); + + // now ti1 is at 4 commit, while ti2 is still 0 + ti1->disable(); + ti1->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 4); + QVERIFY(!m_serverTextInputV3->isEnabled()); + + // first commit to ti2 + ti2->enable(); + ti2->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 1); + QVERIFY(m_serverTextInputV3->isEnabled()); + + // send commit string + m_serverTextInputV3->commitString("Hello world"); + m_serverTextInputV3->done(); + QVERIFY(doneSpy2.wait()); + + // ti2 is at one commit + QCOMPARE(doneSpy2.last().at(0).value(), 1); + ti2->disable(); + ti2->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 2); + QVERIFY(!m_serverTextInputV3->isEnabled()); + + // now re-enable the ti1 and verify sending commits to t2 hasn't affected it's serial + // Enable ti1 : 5 commits now + ti1->enable(); + ti1->commit(); + QVERIFY(committedSpy.wait()); + QCOMPARE(committedSpy.last().at(0).value(), 5); + QVERIFY(m_serverTextInputV3->isEnabled()); + + // send done signal + m_serverTextInputV3->commitString("Hello"); + m_serverTextInputV3->done(); + QVERIFY(doneSpy1.wait()); + QCOMPARE(doneSpy1.last().at(0).value(), 5); + + // cleanup + if (ti1) { + delete ti1; + ti1 = nullptr; + } + if (ti2) { + delete ti2; + ti2 = nullptr; + } +} + +QTEST_GUILESS_MAIN(TestTextInputV3Interface) + +#include "test_textinputv3_interface.moc" diff -Nru dwayland-5.57.0.23/autotests/server/test_viewporter_interface.cpp dwayland-5.57.0.24+really5.24.3/autotests/server/test_viewporter_interface.cpp --- dwayland-5.57.0.23/autotests/server/test_viewporter_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/autotests/server/test_viewporter_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,195 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include +#include + +#include "../../src/server/compositor_interface.h" +#include "../../src/server/display.h" +#include "../../src/server/surface_interface.h" +#include "../../src/server/viewporter_interface.h" + +#include "../../src/client/compositor.h" +#include "../../src/client/connection_thread.h" +#include "../../src/client/event_queue.h" +#include "../../src/client/registry.h" +#include "../../src/client/shm_pool.h" +#include "../../src/client/surface.h" + +#include "qwayland-viewporter.h" + +using namespace KWaylandServer; + +class Viewporter : public QtWayland::wp_viewporter +{ +}; + +class Viewport : public QtWayland::wp_viewport +{ +}; + +class TestViewporterInterface : public QObject +{ + Q_OBJECT + +public: + ~TestViewporterInterface() override; + +private Q_SLOTS: + void initTestCase(); + void testCropScale(); + +private: + KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::EventQueue *m_queue; + KWayland::Client::Compositor *m_clientCompositor; + KWayland::Client::ShmPool *m_shm; + + QThread *m_thread; + Display m_display; + CompositorInterface *m_serverCompositor; + Viewporter *m_viewporter; +}; + +static const QString s_socketName = QStringLiteral("kwin-wayland-server-viewporter-test-0"); + +void TestViewporterInterface::initTestCase() +{ + m_display.addSocketName(s_socketName); + m_display.start(); + QVERIFY(m_display.isRunning()); + + m_display.createShm(); + new ViewporterInterface(&m_display); + + m_serverCompositor = new CompositorInterface(&m_display, this); + + m_connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + QVERIFY(!m_connection->connections().isEmpty()); + + m_queue = new KWayland::Client::EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + auto registry = new KWayland::Client::Registry(this); + connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry](const QByteArray &interface, quint32 id, quint32 version) { + if (interface == QByteArrayLiteral("wp_viewporter")) { + m_viewporter = new Viewporter(); + m_viewporter->init(*registry, id, version); + } + }); + QSignalSpy allAnnouncedSpy(registry, &KWayland::Client::Registry::interfaceAnnounced); + QSignalSpy compositorSpy(registry, &KWayland::Client::Registry::compositorAnnounced); + QSignalSpy shmSpy(registry, &KWayland::Client::Registry::shmAnnounced); + registry->setEventQueue(m_queue); + registry->create(m_connection->display()); + QVERIFY(registry->isValid()); + registry->setup(); + QVERIFY(allAnnouncedSpy.wait()); + + m_clientCompositor = registry->createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_clientCompositor->isValid()); + + m_shm = registry->createShmPool(shmSpy.first().first().value(), shmSpy.first().last().value(), this); + QVERIFY(m_shm->isValid()); +} + +TestViewporterInterface::~TestViewporterInterface() +{ + if (m_viewporter) { + delete m_viewporter; + m_viewporter = nullptr; + } + if (m_shm) { + delete m_shm; + m_shm = nullptr; + } + if (m_queue) { + delete m_queue; + m_queue = nullptr; + } + if (m_thread) { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + } + m_connection->deleteLater(); + m_connection = nullptr; +} + +void TestViewporterInterface::testCropScale() +{ + // Create a test surface. + QSignalSpy serverSurfaceCreatedSpy(m_serverCompositor, &CompositorInterface::surfaceCreated); + QVERIFY(serverSurfaceCreatedSpy.isValid()); + QScopedPointer clientSurface(m_clientCompositor->createSurface(this)); + QVERIFY(serverSurfaceCreatedSpy.wait()); + SurfaceInterface *serverSurface = serverSurfaceCreatedSpy.first().first().value(); + QVERIFY(serverSurface); + + QSignalSpy serverSurfaceMappedSpy(serverSurface, &SurfaceInterface::mapped); + QVERIFY(serverSurfaceMappedSpy.isValid()); + QSignalSpy serverSurfaceSizeChangedSpy(serverSurface, &SurfaceInterface::sizeChanged); + QVERIFY(serverSurfaceSizeChangedSpy.isValid()); + QSignalSpy surfaceToBufferMatrixChangedSpy(serverSurface, &SurfaceInterface::surfaceToBufferMatrixChanged); + QVERIFY(surfaceToBufferMatrixChangedSpy.isValid()); + + // Map the surface. + QImage image(QSize(200, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::black); + KWayland::Client::Buffer::Ptr buffer = m_shm->createBuffer(image); + clientSurface->attachBuffer(buffer); + clientSurface->setScale(2); + clientSurface->damage(image.rect()); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(serverSurfaceMappedSpy.wait()); + QCOMPARE(surfaceToBufferMatrixChangedSpy.count(), 1); + QCOMPARE(serverSurface->size(), QSize(100, 50)); + QCOMPARE(serverSurface->mapToBuffer(QPointF(0, 0)), QPointF(0, 0)); + + // Create a viewport for the surface. + QScopedPointer clientViewport(new Viewport); + clientViewport->init(m_viewporter->get_viewport(*clientSurface)); + + // Crop the surface. + clientViewport->set_source(wl_fixed_from_double(10), wl_fixed_from_double(10), wl_fixed_from_double(30), wl_fixed_from_double(20)); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(serverSurfaceSizeChangedSpy.wait()); + QCOMPARE(surfaceToBufferMatrixChangedSpy.count(), 2); + QCOMPARE(serverSurface->size(), QSize(30, 20)); + QCOMPARE(serverSurface->mapToBuffer(QPointF(0, 0)), QPointF(20, 20)); + + // Scale the surface. + clientViewport->set_destination(500, 250); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(serverSurfaceSizeChangedSpy.wait()); + QCOMPARE(surfaceToBufferMatrixChangedSpy.count(), 3); + QCOMPARE(serverSurface->size(), QSize(500, 250)); + QCOMPARE(serverSurface->mapToBuffer(QPointF(0, 0)), QPointF(20, 20)); + + // If the viewport is destroyed, the crop and scale state will be unset on a next commit. + clientViewport->destroy(); + clientSurface->commit(KWayland::Client::Surface::CommitFlag::None); + QVERIFY(serverSurfaceSizeChangedSpy.wait()); + QCOMPARE(surfaceToBufferMatrixChangedSpy.count(), 4); + QCOMPARE(serverSurface->size(), QSize(100, 50)); + QCOMPARE(serverSurface->mapToBuffer(QPointF(0, 0)), QPointF(0, 0)); +} + +QTEST_GUILESS_MAIN(TestViewporterInterface) + +#include "test_viewporter_interface.moc" diff -Nru dwayland-5.57.0.23/cmake/Modules/FindWaylandProtocols.cmake dwayland-5.57.0.24+really5.24.3/cmake/Modules/FindWaylandProtocols.cmake --- dwayland-5.57.0.23/cmake/Modules/FindWaylandProtocols.cmake 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/cmake/Modules/FindWaylandProtocols.cmake 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,39 @@ +#.rst: +# FindWaylandProtocols +# ------- +# +# Try to find wayland-protocols on a Unix system. +# +# This will define the following variables: +# +# ``WaylandProtocols_FOUND`` +# True if (the requested version of) wayland-protocols is available +# ``WaylandProtocols_VERSION`` +# The version of wayland-protocols +# ``WaylandProtocols_DATADIR`` +# The wayland protocols data directory + +#============================================================================= +# SPDX-FileCopyrightText: 2019 Vlad Zahorodnii +# +# SPDX-License-Identifier: BSD-3-Clause +#============================================================================= + +find_package(PkgConfig) +pkg_check_modules(PKG_wayland_protocols QUIET wayland-protocols) + +set(WaylandProtocols_VERSION ${PKG_wayland_protocols_VERSION}) +pkg_get_variable(WaylandProtocols_DATADIR wayland-protocols pkgdatadir) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WaylandProtocols + FOUND_VAR WaylandProtocols_FOUND + REQUIRED_VARS WaylandProtocols_DATADIR + VERSION_VAR WaylandProtocols_VERSION +) + +include(FeatureSummary) +set_package_properties(WaylandProtocols PROPERTIES + DESCRIPTION "Specifications of extended Wayland protocols" + URL "https://wayland.freedesktop.org/" +) diff -Nru dwayland-5.57.0.23/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/CMakeLists.txt --- dwayland-5.57.0.23/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,66 +1,80 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) -set(KF5_VERSION "5.54.0") # handled by release scripts -project(KWayland VERSION ${KF5_VERSION}) +set(CMAKE_C_STANDARD 99) + +set(PROJECT_VERSION "5.24.3") +set(PROJECT_VERSION_MAJOR 5) + +set(QT_MIN_VERSION "5.15.0") +set(KF5_MIN_VERSION "5.86") +set(KDE_COMPILERSETTINGS_LEVEL "5.82") +set(WAYLAND_MIN_VERSION "1.18") + +project(DWayland VERSION ${PROJECT_VERSION}) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) # ECM setup include(FeatureSummary) -find_package(ECM 5.54.0 NO_MODULE) -set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") -feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) -include(FeatureSummary) -include(GenerateExportHeader) +include(CheckIncludeFile) +include(CMakeFindFrameworks) include(CMakePackageConfigHelpers) +include(FeatureSummary) +include(ECMGenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) -include(CMakeFindFrameworks) include(ECMQtDeclareLoggingCategory) - include(ECMPoQmTools) include(ECMAddQch) +include(KDEInstallDirs) +include(KDECompilerSettings NO_POLICY_SCOPE) +include(KDECMakeSettings) +include(KDEClangFormat) +include(KDEGitCommitHooks) option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") -ecm_setup_version(PROJECT VARIABLE_PREFIX KWAYLAND - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kwayland_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5WaylandConfigVersion.cmake" +ecm_setup_version(PROJECT VARIABLE_PREFIX DWAYLAND + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dwayland_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DWaylandConfigVersion.cmake" SOVERSION 5) # Dependencies -set(REQUIRED_QT_VERSION 5.9.0) -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent Gui WaylandClient) -find_package(KF5Wayland ${KF5_MIN_VERSION} CONFIG REQUIRED) +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Concurrent Gui WaylandClient) +find_package(DeepinWaylandProtocols 1.6.0 CONFIG REQUIRED) + find_package(QtWaylandScanner REQUIRED) -find_package(Wayland 1.13 COMPONENTS Client Server) +find_package(Wayland ${WAYLAND_MIN_VERSION} COMPONENTS Client Server) set_package_properties(Wayland PROPERTIES TYPE REQUIRED ) find_package(WaylandScanner) +find_package(WaylandProtocols 1.24) +set_package_properties(WaylandProtocols PROPERTIES TYPE REQUIRED) + find_package(EGL) set_package_properties(EGL PROPERTIES TYPE REQUIRED) -include(KDEInstallDirs) -include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) -include(KDECMakeSettings) -include(CheckIncludeFile) - -check_include_file("linux/input.h" HAVE_LINUX_INPUT_H) -configure_file(config-kwayland.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwayland.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # adjusting CMAKE_C_FLAGS to get wayland protocols to compile set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu90") +add_definitions(-DQT_NO_FOREACH) +add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) # Subdirectories if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) endif() + add_subdirectory(src) if (BUILD_TESTING) @@ -69,32 +83,37 @@ endif() # create a Config.cmake and a ConfigVersion.cmake file and install them -set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Wayland") +set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/DWayland") if (BUILD_QCH) ecm_install_qch_export( - TARGETS KF5Wayland_QCH - FILE KF5WaylandQchTargets.cmake + TARGETS DWayland_QCH + FILE DWaylandQchTargets.cmake DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) - set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5WaylandQchTargets.cmake\")") + set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/DWaylandQchTargets.cmake\")") endif() -configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF5WaylandConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KF5WaylandConfig.cmake" +configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/DWaylandConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/DWaylandConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5WaylandConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/KF5WaylandConfigVersion.cmake" +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DWaylandConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/DWaylandConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) -install(EXPORT KF5WaylandTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5WaylandTargets.cmake NAMESPACE KF5:: ) +install(EXPORT DWaylandTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE DWaylandTargets.cmake NAMESPACE Deepin:: ) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dwayland_version.h + DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel ) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kwayland_version.h - DESTINATION ${KF5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) +# add clang-format target for all our real source files +file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) +kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) +kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -Nru dwayland-5.57.0.23/config-kwayland.h.cmake dwayland-5.57.0.24+really5.24.3/config-kwayland.h.cmake --- dwayland-5.57.0.23/config-kwayland.h.cmake 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/config-kwayland.h.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#cmakedefine01 HAVE_LINUX_INPUT_H diff -Nru dwayland-5.57.0.23/COPYING.LIB dwayland-5.57.0.24+really5.24.3/COPYING.LIB --- dwayland-5.57.0.23/COPYING.LIB 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/COPYING.LIB 1970-01-01 00:00:00.000000000 +0000 @@ -1,510 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes a de-facto standard. To achieve this, non-free programs must -be allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at least - three years, to give the same user the materials specified in - Subsection 6a, above, for a charge no more than the cost of - performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or -your school, if any, to sign a "copyright disclaimer" for the library, -if necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James - Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff -Nru dwayland-5.57.0.23/debian/changelog dwayland-5.57.0.24+really5.24.3/debian/changelog --- dwayland-5.57.0.23/debian/changelog 2023-01-11 08:26:46.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/changelog 2023-01-11 12:23:59.000000000 +0000 @@ -1,733 +1,211 @@ -dwayland (4:5.57.0.23-1ubuntu1) jammy; urgency=medium +dwayland (4:5.57.0.24+really5.24.3-1ubuntu1) jammy; urgency=medium - * Upload to ubuntudde. + * Rebuild for UbuntuDDE. - -- Arun Kumar Pariyar Wed, 11 Jan 2023 14:11:46 +0545 + -- Arun Kumar Pariyar Wed, 11 Jan 2023 18:08:59 +0545 -kwayland (4:5.57.0.23-1) unstable; urgency=medium +dwayland (5.24.3-deepin.1.4) unstable; urgency=medium * Bug fix: - + 178455 fix: fix remote_access cause crash + + 146607 feat: remote-access protocol porting - -- Lei Su Fri, 06 Jan 2023 11:26:06 +0800 + -- Lei Su Tue, 15 Nov 2022 10:26:35 +0800 -kwayland (4:5.57.0.22-1) unstable; urgency=medium - - * feat: - + feat: add dde restrict wayland protocols. - - -- Lei Su Tue, 03 Jan 2023 19:00:56 +0800 - -kwayland (4:5.57.0.21-1) unstable; urgency=medium - - * Bug fix: - + fix: Revert "Fix: fix the problem that the window cannot be maximized" - - -- Lei Su Thu, 22 Dec 2022 13:00:12 +0800 - -kwayland (4:5.57.0.20-1) unstable; urgency=medium +dwayland (5.24.3-deepin.1.3) unstable; urgency=medium * Bug fix: - + 122483 Fix: fix the problem that the window cannot be maximized - - -- Lei Su Wed, 21 Dec 2022 15:14:41 +0800 - -kwayland (4:5.57.0.19-1) unstable; urgency=medium - - * Bug fix: - + 148417 Log: add datasource destroyed sign, fix the problem of selection crash. - - -- Lei Su Tue, 13 Dec 2022 15:29:55 +0800 - -kwayland (4:5.57.0.18-1) unstable; urgency=medium - - * fix: kwin seatInterface dataDevices crash - * Release tag 5.57.0.18 - - -- pengwenhao Tue, 26 July 2022 16:22:24 +0800 - -kwayland (4:5.57.0.17-1) unstable; urgency=medium - - * feat: move start and stop logic from kwin - * Release tag 5.57.0.17 - - -- Lei Su Wed, 01 Jun 2022 13:57:37 +0800 - -kwayland (4:5.57.0.16-1) unstable; urgency=medium - - * Realize the function of setOnAllDesktops in ddeshell protocol - * Release tag 5.57.0.16 - - -- zhangyaning Wed, 30 Mar 2022 16:45:45 +0800 - -kwayland (4:5.57.0.15-1) unstable; urgency=medium - - * Remote access adds render sequence interface - * Release tag 5.57.0.15 - - -- diguoliang Tue, 15 Mar 2022 21:28:29 +0800 - -kwayland (4:5.57.0.14-1) unstable; urgency=medium - - * Add a test program for gamma to adjust brightness - * Release tag 5.57.0.14 - - -- diguoliang Tue, 15 Mar 2022 20:50:00 +0800 - -kwayland (4:5.57.0.13-1) unstable; urgency=medium - - * Add window caption protocol - * Release tag 5.57.0.13 - - -- luochaojiang Thu, 15 Mar 2022 13:37:20 +0800 - -kwayland (4:5.57.0.12-1) unstable; urgency=medium - - * Add window caption protocol - * Release tag 5.57.0.12 - - -- luochaojiang Thu, 10 Mar 2022 13:37:20 +0800 - -kwayland (4:5.57.0.11-1) unstable; urgency=medium - - * Add interface to support dtk show split menu. - * Release tag 5.57.0.11 - - -- Lei Su Tue, 08 Mar 2022 15:21:43 +0800 - -kwayland (4:5.57.0.10-1) unstable; urgency=medium - * Fix copy failure in some cases. - * Release tag 5.57.0.10 - -- Tang Haixiang Mon, 17 Jan 2022 13:31:45 +0800 - -kwayland (4:5.57.0.9-1) unstable; urgency=medium - * Fix some errors in dataconctrl. - * Release tag 5.57.0.9 - -- Tang Haixiang Wed, 5 Jan 2022 13:31:45 +0800 - -kwayland (4:5.57.0.8-1) unstable; urgency=medium - * fix some problems about touch drag file to another window. - * Release tag 5.57.0.8 - -- zhangyaning Mon, 31 Dec 2021 09:45:45 +0800 - -kwayland (4:5.57.0.7-1) unstable; urgency=medium - * Add global touch protocol. - * Release tag 5.57.0.7 - -- zhangyaning Mon, 21 Dec 2021 14:45:45 +0800 - -kwayland (4:5.57.0.6-1) unstable; urgency=medium - - * feat: - feat: add decoration property interface - - -- Lei Su Fri, 03 Dec 2021 16:24:10 +0800 - -kwayland (4:5.57.0.5-1) unstable; urgency=medium - - * Add global clipboard protocol. - * Release tag 5.57.0.5 - - -- Tang Haixiang Mon, 30 Nov 2021 9:45:45 +0800 - -kwayland (4:5.57.0.4-1) unstable; urgency=medium - - * Release tag 5.57.0.4 - - -- Lei Su Mon, 29 Nov 2021 13:54:45 +0800 - -kwayland (4:5.57.0.3-1) unstable; urgency=medium - - * Release tag 5.57.0.3 - - -- luochaojiang Fri, 25 Nov 2021 11:25:38 +0800 - -kwayland (4:5.56.1000.11-1) unstable; urgency=medium - - * update for klu/pgv master branch - * To automate the packaging with correct versions - - -- wugang Sat, 18 Sep 2021 18:14:38 -0300 - -kwayland (4:5.56.0102.14-1) unstable; urgency=medium - - * New upstream release (5.52.0). - * Update build-deps and deps with the info from cmake - * Update symbols files. - * New upstream release (5.53.0). - * Update build-deps and deps with the info from cmake - * Update symbols files - * New upstream release (5.54.0). - * Update build-deps and deps with the info from cmake - * Rediff patches - * Update symbols file - * Bump group breaks (4:5.54) - * Release to unstable - - -- Maximiliano Curia Thu, 17 Jan 2019 19:27:25 -0300 - -kwayland (4:5.51.0-1) unstable; urgency=medium - - * New upstream release (5.50.0). - * Update build-deps and deps with the info from cmake - * Update symbols files - * Bump group breaks (4:5.50) - * New upstream release (5.51.0). - * Update build-deps and deps with the info from cmake - * Bump group breaks (4:5.51) - * Release to unstable - - -- Maximiliano Curia Wed, 07 Nov 2018 17:17:24 +0100 - -kwayland (4:5.49.0-1) unstable; urgency=medium - - * New upstream release (5.48.0). - * Update build-deps and deps with the info from cmake - * New upstream release (5.49.0). - * Update build-deps and deps with the info from cmake - * Update symbols files - * Bump group breaks (4:5.49) - * Release to unstable - - -- Maximiliano Curia Fri, 17 Aug 2018 16:19:04 +0200 - -kwayland (4:5.47.0-1) unstable; urgency=medium - - * New upstream release (5.47.0). - * Update build-deps and deps with the info from cmake - * Refresh patches - * Update symbols files. - * Update build-deps and deps with the info from cmake - * Bump group breaks (4:5.47) - * Release to unstable - - -- Maximiliano Curia Fri, 15 Jun 2018 12:10:35 +0200 - -kwayland (4:5.46.0-1) unstable; urgency=medium - - * New upstream release (5.46.0). - * Update build-deps and deps with the info from cmake - * Bump Standards-Version to 4.1.4. - * Use https for the debian/copyright - * testsuite: Run tests one at the time - * Add patch: Add-missing-header.patch - * Bump group breaks (4:5.46) - * Release to unstable - - -- Maximiliano Curia Thu, 17 May 2018 22:15:38 +0200 - -kwayland (4:5.45.0-1) unstable; urgency=medium - - * New upstream release (5.45.0). - * Update build-deps and deps with the info from cmake - * Update symbols files. - * Bump group breaks (4:5.45) - * Release to unstable - - -- Maximiliano Curia Sat, 05 May 2018 08:11:00 +0200 - -kwayland (4:5.44.0-1) sid; urgency=medium - - * New revision - * Bump doxygen build dep. - Thanks to Aaron M. Ucko for the report (Closes: 891606) - * New upstream release (5.44.0). - * Update build-deps and deps with the info from cmake - * Bump group breaks (4:5.44) - * Release to sid - - -- Maximiliano Curia Wed, 21 Mar 2018 14:48:56 +0100 - -kwayland (4:5.43.0-1) experimental; urgency=medium - - * Use the salsa canonical urls - * New upstream release (5.43.0). - * Update build-deps and deps with the info from cmake - * Bump group breaks (5.43) - * Update symbols files - * Release to experimental - - -- Maximiliano Curia Mon, 26 Feb 2018 11:44:11 +0100 - -kwayland (4:5.42.0-2) sid; urgency=medium - - * New revision - * Release to sid - - -- Maximiliano Curia Sat, 10 Feb 2018 11:29:15 +0100 - -kwayland (4:5.42.0-1) experimental; urgency=medium - - * New upstream release (5.42.0). - * Add link options as-needed - * Bump debhelper build-dep and compat to 11. - * Build without build_stamp - * Update build-deps and deps with the info from cmake - * Update symbols files - * Bump Standards-Version to 4.1.3. - * Release to experimental - - -- Maximiliano Curia Fri, 02 Feb 2018 12:05:59 +0100 - -kwayland (4:5.41.0-1) experimental; urgency=medium - - * New upstream release (5.41.0). - * Update build-deps and deps with the info from cmake - * Update symbols files - * Release to experimental - - -- Maximiliano Curia Fri, 15 Dec 2017 10:43:12 -0300 - -kwayland (4:5.41.0-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Fri, 08 Dec 2017 14:48:28 +0000 - -kwayland (4:5.40.0-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Fri, 10 Nov 2017 13:00:37 +0000 - -kwayland (4:5.39.0-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Sun, 15 Oct 2017 11:46:54 +0000 - -kwayland (4:5.38.0-0neon) xenial; urgency=medium - - * New release + + fix: support set split mode when request split window use splitmenu - -- Neon CI Mon, 11 Sep 2017 13:32:10 +0000 + -- Lei Su Mon, 07 Nov 2022 16:39:02 +0800 -kwayland (4:5.37.0-2) sid; urgency=medium +dwayland (5.24.3-deepin.1.2) unstable; urgency=medium - * New revision - * Bump Standards-Version to 4.1.0. - * Update upstream metadata - * Release to sid + * Fix data control version error + * Add datasource cache support - -- Maximiliano Curia Sun, 03 Sep 2017 09:58:56 +0200 + -- Lei Su Wed, 19 Oct 2022 17:05:39 +0800 -kwayland (4:5.37.0-1) experimental; urgency=medium +dwayland (5.24.3-deepin.1.1) unstable; urgency=medium - * New upstream release (5.37.0). - * Update build-deps and deps with the info from cmake - * Update symbols files. - * Add a libkf5wayland-doc package for the qch files - * Bump Standards-Version to 4.0.1. - * Set Priority to optional - * Set section for the doc package - * Release to experimental + * splitscreen package 8 - -- Maximiliano Curia Wed, 16 Aug 2017 10:42:18 +0200 + -- guokaka Mon, 15 Aug 2022 17:48:22 +0000 -kwayland (4:5.37.0-0neon) xenial; urgency=medium +dwayland (5.24.3-deepin.1.0) unstable; urgency=medium - * New release + * [Chaojiang Luo] + * Init DDEShellSurfaceInterface parent QObject - -- Neon CI Fri, 11 Aug 2017 15:16:35 +0000 + -- jccKevin Sat, 18 Jun 2022 16:21:54 +0800 -kwayland (4:5.36.0-1) experimental; urgency=medium +dwayland (5.24.3-1) unstable; urgency=medium - [ Maximiliano Curia ] - * New upstream release (5.35.0). - * Bump Standards-Version to 4.0.0. - * Update build-deps and deps with the info from cmake - * Update symbols files. - * Add qtwayland5 test dependency - * watch: Use https uris - * New upstream release (5.36.0). - * Update build-deps and deps with the info from cmake + [ Aurélien COUDERC ] + * New upstream release (5.24.3). + * Added myself to the uploaders. - [ Raymond Wooninck ] - * Add signing key - * also include signing-key + -- Aurélien COUDERC Thu, 10 Mar 2022 07:45:37 +0100 - [ Harald Sitter ] - * bring back xvfb-run wrapping +dwayland (5.24.2-2) unstable; urgency=medium - -- Maximiliano Curia Sun, 09 Jul 2017 23:41:22 +0200 + [ Patrick Franz ] + * Add missing Breaks for libkwin4-effect-builtins1. -kwayland (4:5.36.0-0neon) xenial; urgency=medium + -- Patrick Franz Fri, 04 Mar 2022 18:53:25 +0100 - * New release +dwayland (5.24.2-1) unstable; urgency=medium - -- Neon CI Mon, 10 Jul 2017 17:14:00 +0000 + [ Patrick Franz ] + * New upstream release (5.24.2). + * Bump Standards-Version to 4.6.0 (no changes needed). + * Re-export signing key without extra signatures. + * Update B-Ds and deps with the info from cmake. + * Update d/copyright. -kwayland (4:5.35.0-0neon) xenial; urgency=medium + -- Patrick Franz Sat, 26 Feb 2022 21:58:53 +0100 - * New release +dwayland (5.23.5-1) unstable; urgency=medium - -- Neon CI Sun, 11 Jun 2017 20:38:04 +0000 + [ Patrick Franz ] + * New upstream release (5.23.5). -kwayland (4:5.34.0-0neon) xenial; urgency=medium + -- Patrick Franz Fri, 07 Jan 2022 15:43:55 +0100 - * New release +dwayland (5.23.4-1) unstable; urgency=medium - -- Neon CI Sun, 14 May 2017 17:41:06 +0000 + [ Norbert Preining ] + * New upstream release (5.23.4). -kwayland (4:5.33.0-0neon) xenial; urgency=medium + -- Patrick Franz Thu, 02 Dec 2021 20:24:37 +0100 - * New release +dwayland (5.23.3-1) unstable; urgency=medium - -- Neon CI Fri, 07 Apr 2017 16:25:43 +0000 + [ Norbert Preining ] + * New upstream release (5.23.3). -kwayland (4:5.32.0-0neon) xenial; urgency=medium + -- Norbert Preining Wed, 10 Nov 2021 08:39:23 +0900 - * New release +dwayland (5.23.2-1) unstable; urgency=medium - -- Neon CI Sun, 12 Mar 2017 13:23:39 +0000 + [ Patrick Franz ] + * Update upstream signing-key. -kwayland (4:5.31.0-0neon) xenial; urgency=medium + [ Norbert Preining ] + * New upstream release (5.23.1). + * New upstream release (5.23.2). - * New release + -- Norbert Preining Wed, 03 Nov 2021 22:21:02 +0900 - -- Neon CI Mon, 13 Feb 2017 14:41:11 +0000 +dwayland (5.23.0-1) unstable; urgency=medium -kwayland (4:5.30.0-0neon) xenial; urgency=medium + [ Norbert Preining ] + * New upstream release (5.23.0). + * Bump plasma-wayland-protocols to 1.3.0. - * New release + -- Norbert Preining Thu, 14 Oct 2021 20:13:14 +0900 - -- Neon CI Mon, 16 Jan 2017 13:43:02 +0000 +dwayland (5.21.5-2) unstable; urgency=medium -kwayland (4:5.29.0-0neon) xenial; urgency=medium + [ Patrick Franz ] + * Release to unstable. - * New release + -- Patrick Franz Tue, 17 Aug 2021 03:24:01 +0200 - -- Neon CI Fri, 09 Dec 2016 19:09:26 +0000 +dwayland (5.21.5-1) experimental; urgency=medium -kwayland (4:5.28.0-1) unstable; urgency=medium + [ Patrick Franz ] + * New upstream release (5.21.5). - [ Automatic packaging ] - * Update build-deps and deps with the info from cmake - * Update symbols files from buildds logs (4:5.27.0-1). - * Update symbols files. + -- Patrick Franz Fri, 07 May 2021 13:54:43 +0200 - [ Maximiliano Curia ] - * New upstream release (5.28) +dwayland (5.21.4-1) experimental; urgency=medium - -- Maximiliano Curia Fri, 18 Nov 2016 16:02:26 +0100 + [ Patrick Franz ] + * New upstream release (5.21.4). -kwayland (4:5.28.0-0neon) xenial; urgency=medium + -- Patrick Franz Tue, 06 Apr 2021 17:47:03 +0200 - * New release +dwayland (5.21.3-1) experimental; urgency=medium - -- Neon CI Thu, 17 Nov 2016 09:46:36 +0000 + [ Norbert Preining ] + * New upstream release (5.21.3). -kwayland (4:5.27.0-1) unstable; urgency=medium + -- Norbert Preining Wed, 17 Mar 2021 05:49:41 +0900 - [ Automatic packaging ] - * Update build-deps and deps with the info from cmake +dwayland (5.21.2-1) experimental; urgency=medium - [ Maximiliano Curia ] - * New upstream release (5.27) + [ Patrick Franz ] + * New upstream release (5.21.2). - -- Maximiliano Curia Sat, 15 Oct 2016 16:56:38 +0200 + -- Norbert Preining Wed, 03 Mar 2021 05:33:49 +0900 -kwayland (4:5.27.0-0neon) xenial; urgency=medium +dwayland (5.21.1-1) experimental; urgency=medium - * New release + [ Norbert Preining ] + * New upstream release (5.21.1). - -- Neon CI Sat, 08 Oct 2016 11:33:15 +0000 + -- Norbert Preining Wed, 24 Feb 2021 14:36:39 +0900 -kwayland (4:5.26.0-1) unstable; urgency=medium +dwayland (5.21.0-1) experimental; urgency=medium - [ Automatic packaging ] - * Update build-deps and deps with the info from cmake + [ Norbert Preining ] + * New upstream release (5.21.0). - -- Maximiliano Curia Thu, 29 Sep 2016 11:56:48 +0200 + -- Norbert Preining Wed, 17 Feb 2021 05:42:27 +0900 -kwayland (4:5.26.0-0neon) xenial; urgency=medium +dwayland (5.20.5-1) unstable; urgency=medium - * New release + * New upstream release (5.20.5). - -- Neon CI Mon, 12 Sep 2016 08:34:10 +0000 + -- Norbert Preining Wed, 06 Jan 2021 23:50:52 +0900 -kwayland (4:5.25.0-1) unstable; urgency=medium +dwayland (5.20.4-3) unstable; urgency=medium - [ Harald Sitter ] - * Rename -dev package to align with the cmake package name for - greater discoverability and consistency across frameworks. - Add a transitional package to help with the name transition. + * Use virtual abi package to track versions (Closes: #978008) - [ Automatic packaging ] - * Update build-deps and deps with the info from cmake - * Update symbols files + -- Norbert Preining Mon, 28 Dec 2020 11:52:11 +0900 - -- Maximiliano Curia Thu, 18 Aug 2016 17:19:51 +0200 +dwayland (5.20.4-2) unstable; urgency=medium -kwayland (4:5.25.0-0neon) xenial; urgency=medium + * Release to unstable. - * New release + -- Norbert Preining Tue, 22 Dec 2020 11:04:37 +0900 - -- Neon CI Sat, 13 Aug 2016 20:16:39 +0000 +dwayland (5.20.4-1) experimental; urgency=medium -kwayland (4:5.24.0-0neon) xenial; urgency=medium + [ Norbert Preining ] + * New upstream release (5.20.4). + * Update (B-)Deps according to CMakeFiles.txt. + * Update symbols. - * New release + -- Norbert Preining Wed, 09 Dec 2020 14:17:32 +0900 - -- Neon CI Mon, 11 Jul 2016 07:42:50 +0000 - -kwayland (4:5.23.0-1) unstable; urgency=medium - - [ Automatic packaging ] - * Update build-deps and deps with the info from cmake - * Update symbols files - - [ Maximiliano Curia ] - * Install kwayland testserver - * Add shlibs depends for the org-kde-kf5-kwayland-testserver libexec - - -- Maximiliano Curia Sat, 18 Jun 2016 08:23:08 +0200 - -kwayland (4:5.23.0-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Mon, 13 Jun 2016 09:40:40 +0000 - -kwayland (4:5.22.0-1) unstable; urgency=medium - - [ Maximiliano Curia ] - * Update Vcs uris - - [ Automatic packaging ] - * Update watch file - * Update build-deps and deps with the info from cmake - * Update symbols files. - - -- Maximiliano Curia Wed, 18 May 2016 20:10:31 +0200 - -kwayland (4:5.22.0-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Tue, 17 May 2016 07:37:54 +0000 - -kwayland (4:5.6.4-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Wed, 11 May 2016 09:42:28 +0000 - -kwayland (4:5.6.3-1) experimental; urgency=medium - - [ Automatic packaging ] - * Update symbols files from buildds logs (4:5.5.4-1). - * Update symbols files - * Bump Standards-Version to 3.9.8 - - [ Maximiliano Curia ] - * uscan no longer supports this kind of watch files. - * New upstream release (5.5.5). - * Update symbols files from buildds logs (4:5.5.4-1). - * Automatic update with ddeb_migration3.py - * Add upstream metadata (DEP-12) - * debian/control: Update Vcs-Browser and Vcs-Git fields - * Update testsuite - - -- Maximiliano Curia Fri, 06 May 2016 20:22:53 +0200 - -kwayland (4:5.6.3-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Tue, 19 Apr 2016 16:56:24 +0000 - -kwayland (4:5.6.2-0neon) xenial; urgency=medium - - * New release - - -- Neon CI Fri, 08 Apr 2016 11:44:29 +0000 - -kwayland (4:5.5.4-1) experimental; urgency=medium - - * New upstream release (5.5.0). - * New upstream release (5.5.1). - * New upstream release (5.5.2). - * New upstream release (5.5.3). - * New upstream release (5.5.4). - - -- Maximiliano Curia Wed, 27 Jan 2016 16:48:51 +0100 - -kwayland (4:5.4.3-0ubuntu1) xenial; urgency=medium - - [ Scarlett Clark ] - * Vivid backport - * New upstream bugfix release - - [ Philip Muškovac ] - * New upstream bugfix release (LP: #1518598) - - -- Philip Muškovac Sun, 22 Nov 2015 16:33:34 +0100 - -kwayland (4:5.4.3-1) unstable; urgency=medium - - * New upstream release (5.4.3). - - -- Maximiliano Curia Tue, 01 Dec 2015 11:45:43 +0100 - -kwayland (4:5.4.2-0ubuntu2) xenial; urgency=medium - - * Fix autopackagetests by adding allow-stderr to the requirements. - - -- Philip Muškovac Tue, 03 Nov 2015 15:34:49 +0100 - -kwayland (4:5.4.2-1) unstable; urgency=medium - - * New upstream release (5.4.2). - * Update symbols files from buildds logs (4:5.4.1-1). - - -- Maximiliano Curia Tue, 06 Oct 2015 07:51:55 +0200 - -kwayland (4:5.4.2-0ubuntu1) wily; urgency=medium - - * New upstream release - - -- Scarlett Clark Fri, 02 Oct 2015 15:56:12 +0100 - -kwayland (4:5.4.1-1) unstable; urgency=medium - - * New upstream release (5.4.1). - - -- Maximiliano Curia Fri, 11 Sep 2015 18:45:00 +0200 - -kwayland (4:5.4.1-0ubuntu1) wily; urgency=medium - - * new upstream release - - -- Jonathan Riddell Tue, 08 Sep 2015 10:18:04 +0100 - -kwayland (4:5.4.0-1) unstable; urgency=medium - - * New upstream release (5.4.0). - * Update symbols files. - - -- Maximiliano Curia Fri, 04 Sep 2015 10:45:27 +0200 - -kwayland (4:5.4.0-0ubuntu1) wily; urgency=medium - - * new upstream release - - -- Jonathan Riddell Mon, 31 Aug 2015 15:51:53 +0100 - -kwayland (4:5.3.95-0ubuntu1) wily; urgency=medium - - * new upstream beta release - - -- Jonathan Riddell Mon, 10 Aug 2015 23:15:54 +0200 - -kwayland (4:5.3.2-1ubuntu3) wily; urgency=medium - - * Non-maintainer upload. - * Update symbols files: mark as optional the symbols gone after - building with GCC 5 - - -- José Manuel Santamaría Lema Wed, 22 Jul 2015 19:48:10 +0200 - -kwayland (4:5.3.2-1ubuntu2) wily; urgency=medium - - * Add kubuntu_disable-tests.diff to disable failing tests - - -- Jonathan Riddell Mon, 13 Jul 2015 16:32:21 +0200 - -kwayland (4:5.3.2-1ubuntu1) wily; urgency=medium - - * Enable weston in debian/tests/control - - -- Jonathan Riddell Mon, 13 Jul 2015 14:07:42 +0200 - -kwayland (4:5.3.2-2) unstable; urgency=medium +dwayland (5.19.5-2) unstable; urgency=medium * Team upload. + * Upload to unstable. - [ Martin Steigerwald ] - * Updated symbol files to fix FTBFS. - - -- Lisandro Damián Nicanor Pérez Meyer Tue, 18 Aug 2015 19:59:54 -0300 - -kwayland (4:5.3.2-1) unstable; urgency=medium - - * New upstream release (5.3.2). - * Update symbols files. - - -- Maximiliano Curia Tue, 30 Jun 2015 22:34:50 +0200 - -kwayland (4:5.3.1-1) unstable; urgency=medium - - * New upstream release (5.3.0). - * New upstream release (5.3.1). - - -- Maximiliano Curia Tue, 30 Jun 2015 10:53:37 +0200 - -kwayland (4:5.3.1-0ubuntu1) wily; urgency=medium - - [ Jonathan Riddell ] - * Plasma 5.3 beta - * new upstream release - - [ Scarlett Clark ] - * Vivid backport - - [ Jonathan Riddell ] - * New upstream release - - -- Jonathan Riddell Fri, 05 Jun 2015 02:33:14 +0200 - -kwayland (4:5.2.2-1) experimental; urgency=medium - - * New upstream release (5.2.1). - * New upstream release (5.2.2). - - -- Maximiliano Curia Wed, 25 Mar 2015 23:17:23 +0100 - -kwayland (4:5.2.2-0ubuntu1) vivid; urgency=medium - - * New upstream release - - -- Scarlett Clark Tue, 24 Mar 2015 07:32:32 -0700 - -kwayland (4:5.2.1-0ubuntu1) vivid; urgency=medium - - * New upstream release - - -- Scarlett Clark Mon, 23 Feb 2015 09:41:56 -0800 - -kwayland (4:5.2.0-1) experimental; urgency=medium - - * Prepare initial Debian release. - * Update watch file. - * Add myself as Uploader. - * Update build dependencies to build against experimental and to - follow cmake. - * Add acc autopkgtests. - * Update copyright information. - * Update symbols files. - - -- Maximiliano Curia Mon, 09 Feb 2015 00:43:37 +0100 - -kwayland (4:5.2.0-0ubuntu1) vivid; urgency=medium - - * New upstream release - - -- Harald Sitter Tue, 27 Jan 2015 14:54:21 +0100 + -- Pino Toscano Sat, 24 Oct 2020 09:24:33 +0200 -kwayland (4:5.1.95-0ubuntu1) vivid; urgency=medium +dwayland (5.19.5-1) experimental; urgency=medium - * New upstream beta release + * New upstream release (5.19.5). + * Add Scarlett, Patrick, myself to uploaders. + * Change maintainer to "Debian Qt/KDE ...". - -- Jonathan Riddell Thu, 15 Jan 2015 01:31:34 +0100 + -- Norbert Preining Fri, 23 Oct 2020 09:06:09 +0900 -kwayland (5.1.2-0ubuntu1) vivid; urgency=medium +dwayland (5.19.4-2) unstable; urgency=medium - * New upstream release + * Upload to unstable. + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. + * Update symbols file. - -- Jonathan Riddell Mon, 05 Jan 2015 19:29:06 +0100 + -- Pino Toscano Sun, 18 Oct 2020 17:33:58 +0200 -kwayland (5.1.1-0ubuntu1) vivid; urgency=medium +dwayland (5.19.4-1) experimental; urgency=medium - * New upstream release + * Initial packaging. - -- Jonathan Riddell Tue, 14 Oct 2014 13:48:52 +0200 + -- Pino Toscano Tue, 18 Aug 2020 21:13:14 +0200 diff -Nru dwayland-5.57.0.23/debian/compat dwayland-5.57.0.24+really5.24.3/debian/compat --- dwayland-5.57.0.23/debian/compat 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru dwayland-5.57.0.23/debian/control dwayland-5.57.0.24+really5.24.3/debian/control --- dwayland-5.57.0.23/debian/control 2023-01-11 08:26:46.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/control 2023-01-11 12:23:55.000000000 +0000 @@ -1,90 +1,93 @@ Source: dwayland Section: libs Priority: optional -Maintainer: Debian/Kubuntu Qt/KDE Maintainers -Uploaders: Maximiliano Curia -Build-Depends: cmake (>= 3.5~), - debhelper (>= 11~), +Maintainer: Debian Qt/KDE Maintainers +Uploaders: Aurélien COUDERC , + Norbert Preining , + Patrick Franz , + Pino Toscano , + Scarlett Moore , +Build-Depends: cmake (>= 3.16~), + debhelper-compat (= 13), doxygen (>= 1.8.13~), - extra-cmake-modules (>= 5.54.0~), - graphviz, - libegl1-mesa-dev, + extra-cmake-modules (>= 5.90.0~), + libegl-dev, libqt5sql5-sqlite, - libwayland-dev (>= 1.13~), + libqt5waylandclient5-dev (>= 5.15.0~), + libwayland-dev (>= 1.18~), pkg-config, - qtwayland5-dev-tools, - libkf5wayland-dev, - libqt5waylandclient5-dev, - pkg-kde-tools (>= 0.15.16), - qtbase5-dev (>= 5.9.0~), + pkg-kde-tools (>= 0.15.18~), + deepin-wayland-protocols (>= 1.6.0~), + qtbase5-dev (>= 5.15.0~), qtbase5-private-dev (>= 5.4.0~), + qttools5-dev, qttools5-dev-tools (>= 5.4), -Standards-Version: 4.1.4 -Homepage: https://projects.kde.org/projects/kde/frameworks/kwayland -Vcs-Browser: https://salsa.debian.org/qt-kde-team/kde/kwayland -Vcs-Git: https://salsa.debian.org/qt-kde-team/kde/kwayland.git + qtwayland5-dev-tools (>= 5.15.0~), + wayland-protocols (>= 1.24~), +Standards-Version: 4.6.0 +Rules-Requires-Root: no +Homepage: https://invent.kde.org/plasma/kwayland-server +Vcs-Browser: https://salsa.debian.org/qt-kde-team/kde/kwayland-server +Vcs-Git: https://salsa.debian.org/qt-kde-team/kde/kwayland-server.git -Package: kwayland-data -Architecture: all -Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends} +Package: dwayland-data +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends} Description: Qt library wrapper for Wayland libraries - data files - KWayland provides a Qt-style Server library wrapper for + DWayland provides a Qt-style Server library wrapper for the Wayland libraries. -Package: kwayland-dev -Depends: libkf5wayland-dev, ${misc:Depends} -Architecture: all -Priority: optional -Section: oldlibs -Description: transitional dummy package - This is a transitional dummy package. It can safely be removed. - -Package: libkf5wayland-dev +Package: libdwayland-dev Section: libdevel Architecture: any -Depends: libkf5waylandclient5 (= ${binary:Version}), - libkf5waylandserver5 (= ${binary:Version}), - qtbase5-dev (>= 5.9.0~), +Depends: libdwaylandclient5 (= ${binary:Version}), + libdwaylandserver5 (= ${binary:Version}), + libwayland-dev (>= 1.13~), + qtbase5-dev (>= 5.15.0~), ${misc:Depends}, ${shlibs:Depends}, -Replaces: kwayland-dev (<< 4:5.23.0-2~) -Breaks: kwayland-dev (<< 4:5.23.0-2~) -Recommends: libkf5wayland-doc (= ${source:Version}) -Description: development files for kwayland - KWayland provides a Qt-style Client and Server library wrapper for +Replaces: dwayland-dev (<< 4:5.23.0-2~) +Breaks: dwayland-dev (<< 4:5.23.0-2~) +Recommends: libdwayland-doc (= ${source:Version}) +Description: development files for dwayland + DWayland provides a Qt-style Client and Server library wrapper for the Wayland libraries. . - Contains development files for kwayland. + Contains development files for dwayland. -Package: libkf5wayland-doc +Package: libdwayland-doc Architecture: all Multi-Arch: foreign Depends: ${misc:Depends} Description: Qt library wrapper for Wayland libraries (documentation) - KWayland provides a Qt-style Client and Server library wrapper for + DWayland provides a Qt-style Client and Server library wrapper for the Wayland libraries. . This package contains the qch documentation files. Section: doc -Package: libkf5waylandclient5 +Package: libdwaylandclient5 Architecture: any Multi-Arch: same -Depends: kwayland-data (= ${source:Version}), +Depends: dwayland-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}, Description: Qt library wrapper for Wayland libraries - KWayland provides a Qt-style Client library wrapper for + DWayland provides a Qt-style Client library wrapper for the Wayland libraries. Breaks: libkf5plasmaquick5 (<< 5.54) -Package: libkf5waylandserver5 +Package: libdwaylandserver5 Architecture: any Multi-Arch: same -Depends: kwayland-data (= ${source:Version}), +Depends: dwayland-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}, +Breaks: libkwin4-effect-builtins1 Description: Qt library wrapper for Wayland libraries - KWayland provides a Qt-style Server library wrapper for + DWaylandServier provides a Qt-style Server library wrapper for the Wayland libraries. + . + This package contains the shared library. +Provides: ${ABI:VirtualPackage} \ No newline at end of file diff -Nru dwayland-5.57.0.23/debian/copyright dwayland-5.57.0.24+really5.24.3/debian/copyright --- dwayland-5.57.0.23/debian/copyright 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/copyright 2023-01-11 12:23:55.000000000 +0000 @@ -1,151 +1,67 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: kwayland -Source: git://anongit.kde.org/kwayland +Upstream-Name: kwayland-server +Source: https://invent.kde.org/plasma/kwayland-server Files: * -Copyright: 2017, David Edmundson - 2015, Eike Hein - 2015, Eike Hein - 2015-2017, Marco Martin - 2015-2017, Marco Martin - 2013-2017, Martin Flöser +Copyright: + 2014-2015, Collabora, Ltd. + 2014-2016, Martin Gräßlin + 2015, 2017-2018, Marco Martin 2015, Sebastian Kügler -License: LGPL-2.1+3+KDEeV - -Files: COPYING.LIB - src/client/protocols/blur.xml - src/client/protocols/contrast.xml - src/client/protocols/dpms.xml - src/client/protocols/fake-input.xml - src/client/protocols/idle.xml - src/client/protocols/plasma-effects.xml - src/client/protocols/plasma-shell.xml - src/client/protocols/plasma-window-management.xml - src/client/protocols/server-decoration.xml - src/client/protocols/shadow.xml - src/client/protocols/slide.xml -Copyright: 1991-1999, Free Software Foundation, Inc - 2015, Marco Martin - 2015, Martin Gräßlin - 2013-2014, Pier Luigi Fiorini -License: LGPL-2.1+ - -Files: src/client/protocols/idle-inhibit-unstable-v1.xml - src/client/protocols/output-management.xml - src/client/protocols/outputdevice.xml - src/client/protocols/pointer-constraints-unstable-v1.xml - src/client/protocols/relative-pointer-unstable-v1.xml - src/client/protocols/text-input-unstable-v2.xml - src/client/protocols/text-input.xml - src/client/protocols/xdg-foreign-unstable-v2.xml - src/client/protocols/xdg-shell-unstable-v5.xml - src/client/protocols/xdg-shell-unstable-v6.xml -Copyright: 2012-2013, Collabora, Ltd - 2010-2013, Intel Corporation - 2015-2016, Jan Arne Petersen - 2013, Jasper St. Pierre - 2014, Jonas Ådahl - 2008-2013, Kristian Høgsberg - 2013, Rafael Antognolli - 2015-2016, Red Hat Inc - 2015, Samsung Electronics Co., Ltd - 2015, Sebastian Kügler -License: MIT/X11 - -Files: src/client/protocols/surface-extension.xml -Copyright: 2012, Digia Plc and/or its subsidiary(-ies) -License: BSD-3-clause + 2016, Oleg Chernovskiy + 2017-2018, David Edmundson + 2017, Martin Flöser + 2018, Fredrik Höglund + 2018-2019, Roman Gilg + 2019, Aleix Pol Gonzalez + 2019, NVIDIA Inc. + 2019, Vlad Zahorodnii +License: LGPL-2.1+ or LicenseRef-KDE-Accepted-LGPL + +Files: src/server/drm_fourcc.h +Copyright: 2008-2013 Kristian Høgsberg + 2013 Rafael Antognolli + 2013 Jasper St. Pierre + 2010-2013 Intel Corporation +License: Expat Files: debian/* -Copyright: 2014, Jonathan Riddell -License: LGPL-2.1+ +Copyright: 2020, Pino Toscano +License: LGPL-2.1+ or LicenseRef-KDE-Accepted-LGPL -License: BSD-3-clause - You may use this file under the terms of the BSD license as follows: - . - "Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names - of its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is furnished + to do so, subject to the following conditions: + . + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: LGPL-2.1+ - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - . - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - . - On Debian systems, the complete text of the GNU Lesser General Public License - version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU Lesser General Public + License version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1". -License: LGPL-2.1+3+KDEeV +License: LicenseRef-KDE-Accepted-LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. + version 3 of the license or (at your option) any later version + that is accepted by the membership of KDE e.V. (or its successor + approved by the membership of KDE e.V.), which shall act as a + proxy as defined in Section 6 of version 3 of the license. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - . - On Debian systems, the complete text of the GNU Lesser General Public License - version 2.1 can be found in "/usr/share/common-licenses/LGPL-2.1", likewise, - the complete text of the GNU Lesser General Public License version 3 can be - found in "/usr/share/common-licenses/LGPL-3". - -License: MIT/X11 - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - . - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. diff -Nru dwayland-5.57.0.23/debian/dwayland-data.install dwayland-5.57.0.24+really5.24.3/debian/dwayland-data.install --- dwayland-5.57.0.23/debian/dwayland-data.install 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/dwayland-data.install 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,2 @@ +usr/share/qlogging-categories5/dwayland.categories +usr/share/qlogging-categories5/dwayland.renamecategories diff -Nru dwayland-5.57.0.23/debian/dwayland-data.maintscript dwayland-5.57.0.24+really5.24.3/debian/dwayland-data.maintscript --- dwayland-5.57.0.23/debian/dwayland-data.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/dwayland-data.maintscript 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/xdg/dwayland.categories 4:5.61.0-1~~ diff -Nru dwayland-5.57.0.23/debian/kwayland-data.install dwayland-5.57.0.24+really5.24.3/debian/kwayland-data.install --- dwayland-5.57.0.23/debian/kwayland-data.install 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/kwayland-data.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -etc/xdg/org_kde_kwayland.categories diff -Nru dwayland-5.57.0.23/debian/libdwaylandclient5.install dwayland-5.57.0.24+really5.24.3/debian/libdwaylandclient5.install --- dwayland-5.57.0.23/debian/libdwaylandclient5.install 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwaylandclient5.install 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,2 @@ +usr/lib/*/libDWaylandClient.so.5 +usr/lib/*/libDWaylandClient.so.5.* diff -Nru dwayland-5.57.0.23/debian/libdwaylandclient5.symbols dwayland-5.57.0.24+really5.24.3/debian/libdwaylandclient5.symbols --- dwayland-5.57.0.23/debian/libdwaylandclient5.symbols 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwaylandclient5.symbols 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,2674 @@ +# SymbolsHelper-Confirmed: 4:5.74.0 amd64 +libDWaylandClient.so.5 libdwaylandclient5 #MINVER# + _ZN8KWayland6Client10Compositor10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor12createRegionEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor12createRegionERK7QRegion@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor12createRegionERK7QRegionP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor13createSurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor15fromApplicationEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor5setupEP13wl_compositor@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10Compositor7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10CompositorcvP13wl_compositorEv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer11axisChangedEjNS1_4AxisEd@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer18buttonStateChangedERK7QPointFjNS1_11ButtonStateE@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer19getGlobalPointerPosEv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer5setupEP11dde_pointer@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer6motionERK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointer9getMotionEv@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DDEPointercvP11dde_pointerEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice10dragMotionERK7QPointFj@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice11dataOfferedEPNS0_9DataOfferE@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice11dragEnteredEjRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice12setSelectionEjPNS0_10DataSourceE@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice14clearSelectionEj@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice16selectionClearedEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice16selectionOfferedEPNS0_9DataOfferE@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice19startDragInternallyEjPNS0_7SurfaceES3_@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice5setupEP14wl_data_device@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice7droppedEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice8dragLeftEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevice9startDragEjPNS0_10DataSourceEPNS0_7SurfaceES5_@Base 5.24.3-1 + _ZN8KWayland6Client10DataDeviceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DataDeviceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DataDeviceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataDeviceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataDeviceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataDevicecvP14wl_data_deviceEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource13targetAcceptsERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource17sendDataRequestedERK7QStringi@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource19dragAndDropFinishedEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource20dragAndDropPerformedEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource21setDragAndDropActionsE6QFlagsINS0_17DataDeviceManager9DnDActionEE@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource32selectedDragAndDropActionChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource5offerERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource5offerERK9QMimeType@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource5setupEP14wl_data_source@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSource9cancelledEv@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10DataSourcecvP14wl_data_sourceEv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue5setupEP10wl_display@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue5setupEPNS0_16ConnectionThreadE@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue7isValidEv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue8addProxyEP8wl_proxy@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueue8dispatchEv@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueueC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueueC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueueD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueueD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueueD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10EventQueuecvP14wl_event_queueEv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface10placeAboveE8QPointerINS0_7SurfaceEE@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface10placeAboveE8QPointerIS1_E@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface10placeBelowE8QPointerINS0_7SurfaceEE@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface10placeBelowE8QPointerIS1_E@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface11setPositionERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface3getEP13wl_subsurface@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface5lowerEv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface5raiseEv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface5setupEP13wl_subsurface@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurface7setModeENS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfaceC1E8QPointerINS0_7SurfaceEES4_P7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfaceC2E8QPointerINS0_7SurfaceEES4_P7QObject@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10SubSurfacecvP13wl_subsurfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client10TouchPointC1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10TouchPointC2Ev@Base 5.24.3-1 + _ZN8KWayland6Client10TouchPointD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client10TouchPointD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client10TouchPointD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager10createBlurEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager10removeBlurEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager5setupEP25org_kde_kwin_blur_manager@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11BlurManagercvP25org_kde_kwin_blur_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard10keyChangedEjNS1_8KeyStateEj@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard13keymapChangedEij@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard16keyRepeatChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard16modifiersChangedEjjjj@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard5setupEP12dde_keyboard@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboard7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DDEKeyboardcvP12dde_keyboardEv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager5setupEP25org_kde_kwin_dpms_manager@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager7getDpmsEPNS0_6OutputEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11DpmsManagercvP25org_kde_kwin_dpms_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout14resumeFromIdleEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout20simulateUserActivityEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout4idleEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout5setupEP25org_kde_kwin_idle_timeout@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeout7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11IdleTimeoutcvP25org_kde_kwin_idle_timeoutEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell13createSurfaceEP10wl_surfaceP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell13createSurfaceEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell5setupEP20org_kde_plasma_shell@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShell7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11PlasmaShellcvP20org_kde_plasma_shellEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported4doneEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported5setupEP16zxdg_exported_v2@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExported7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportedcvP16zxdg_exported_v2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter14exportTopLevelEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter5setupEP16zxdg_exporter_v2@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporter7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporterC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporterC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporterD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporterD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExporterD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgExportercvP16zxdg_exporter_v2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported11setParentOfEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported17importedDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported5setupEP16zxdg_imported_v2@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImported7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportedcvP16zxdg_imported_v2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter14importTopLevelERK7QStringP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter5setupEP16zxdg_importer_v2@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporter7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporterC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporterC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporterD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporterD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImporterD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client11XdgImportercvP16zxdg_importer_v2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice11modeChangedERKNS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice11uuidChangedERK10QByteArray@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice14enabledChangedENS1_10EnablementE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice15overscanChangedEj@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice16vrrPolicyChangedENS1_9VrrPolicyE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice18colorCurvesChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice19capabilitiesChangedERK6QFlagsINS1_10CapabilityEE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice4doneEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice5setupEP25org_kde_kwin_outputdevice@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice6outputEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice7changedEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevice9modeAddedERKNS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDeviceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDeviceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDeviceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDeviceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDeviceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12OutputDevicecvP25org_kde_kwin_outputdeviceEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow11iconChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow11requestMoveEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow12appIdChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow12requestCloseEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow12titleChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow13activeChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow13requestResizeEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow13shadedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow14movableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow15geometryChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow15requestActivateEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16closeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16keepAboveChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16keepBelowChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16maximizedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16minimizedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16resizableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16shadeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow17fullscreenChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow18plasmaActivityLeftERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow18skipTaskbarChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow19maximizeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow19minimizeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow19parentWindowChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow19requestToggleShadedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow19skipSwitcherChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow20onAllDesktopsChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow20requestEnterActivityERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow20requestLeaveActivityERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow20setMinimizedGeometryEPNS0_7SurfaceERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow21fullscreenableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow21plasmaActivityEnteredERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow21requestVirtualDesktopEj@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow21virtualDesktopChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22applicationMenuChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22requestToggleKeepAboveEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22requestToggleKeepBelowEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22requestToggleMaximizedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22requestToggleMinimizedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow22unsetMinimizedGeometryEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow23demandsAttentionChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow24plasmaVirtualDesktopLeftERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow26requestEnterVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow26requestLeaveVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow27plasmaVirtualDesktopEnteredERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow29requestEnterNewVirtualDesktopEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow31virtualDesktopChangeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindow8unmappedEv@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowC1EPNS0_22PlasmaWindowManagementEP21org_kde_plasma_windowjPKc@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowC2EPNS0_22PlasmaWindowManagementEP21org_kde_plasma_windowjPKc@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12PlasmaWindowcvP21org_kde_plasma_windowEv@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer18parametersObtainedEv@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer5setupEP26org_kde_kwin_remote_buffer@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7Private10s_listenerE@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7Private14paramsCallbackEPvP26org_kde_kwin_remote_bufferijjjj@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7Private5setupEP26org_kde_kwin_remote_buffer@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7PrivateC1EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7PrivateC2EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBufferC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBufferC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBufferD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBufferD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBufferD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12RemoteBuffercvP26org_kde_kwin_remote_bufferEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface10fromWindowEP7QWindow@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11fromQtWinIdEy@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11requestMoveEPNS0_4SeatEj@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11setToplevelEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface11sizeChangedERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface12setMaximizedEPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface12setTransientEPNS0_7SurfaceERK6QPoint6QFlagsINS1_13TransientFlagEE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface13requestResizeEPNS0_4SeatEj6QFlagsIN2Qt4EdgeEE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface13setFullscreenEPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface14setWindowClassERK10QByteArray@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface17setTransientPopupEPNS0_7SurfaceEPNS0_4SeatEjRK6QPoint6QFlagsINS1_13TransientFlagEE@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface3getEP16wl_shell_surface@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface5setupEP16wl_shell_surface@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface6pingedEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface7setSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface8setTitleERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurface9popupDoneEv@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfaceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfaceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12ShellSurfacecvP16wl_shell_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager11createSlideEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager11removeSlideEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager5setupEP26org_kde_kwin_slide_manager@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client12SlideManagercvP26org_kde_kwin_slide_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor5setupEP21zwp_idle_inhibitor_v1@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitor7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13IdleInhibitorcvP21zwp_idle_inhibitor_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer21setCursorPositionHintERK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer5setupEP21zwp_locked_pointer_v1@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer6lockedEv@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer8unlockedEv@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointer9setRegionEPNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13LockedPointercvP21zwp_locked_pointer_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager12createShadowEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager12removeShadowEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager5setupEP27org_kde_kwin_shadow_manager@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13ShadowManagercvP27org_kde_kwin_shadow_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor16createSubSurfaceE8QPointerINS0_7SurfaceEES4_P7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor5setupEP16wl_subcompositor@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositor7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13SubCompositorcvP16wl_subcompositorEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration11modeChangedENS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration5setupEP27zxdg_toplevel_decoration_v1@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration7setModeENS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecoration9unsetModeEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgDecorationcvP27zxdg_toplevel_decoration_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner10setGravityE6QFlagsIN2Qt4EdgeEE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner13setAnchorEdgeE6QFlagsIN2Qt4EdgeEE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner13setAnchorRectERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner14setConstraintsE6QFlagsINS1_10ConstraintEE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner14setInitialSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositioner15setAnchorOffsetERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerC1ERK5QSizeRK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerC1ERKS1_@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerC2ERK5QSizeRK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerC2ERKS1_@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgPositionerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup11requestGrabEPNS0_4SeatEj@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup12ackConfigureEj@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup17setWindowGeometryERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup18configureRequestedERK5QRectj@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup5setupEP11xdg_surfaceP9xdg_popup@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup5setupEP15zxdg_surface_v6P13zxdg_popup_v6@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup5setupEP9xdg_popup@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopup9popupDoneEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupcvP11xdg_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupcvP13zxdg_popup_v6Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupcvP15zxdg_surface_v6Ev@Base 5.24.3-1 + _ZN8KWayland6Client13XdgShellPopupcvP9xdg_popupEv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager5setupEP28org_kde_kwin_appmenu_manager@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager6createEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager7Private5setupEP28org_kde_kwin_appmenu_manager@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client14AppMenuManagercvP28org_kde_kwin_appmenu_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer10unconfinedEv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer5setupEP23zwp_confined_pointer_v1@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer8confinedEv@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointer9setRegionEPNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ConfinedPointercvP23zwp_confined_pointer_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager14createContrastEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager14removeContrastEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager5setupEP29org_kde_kwin_contrast_manager@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15ContrastManagercvP29org_kde_kwin_contrast_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface12requestModalEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface13activeChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface14movableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface15geometryChangedERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface15modalityChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface15requestActivateEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16closeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16keepAboveChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16keepBelowChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16maximizedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16minimizedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16requestKeepAboveEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16requestKeepBelowEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16requestMaximizedEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16requestMinimizedEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16requestResizableEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16resizableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface17fullscreenChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface17requestMinizeableEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface18acceptFocusChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface18requestAcceptFocusEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface19maximizeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface19minimizeableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface19requestMaximizeableEb@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface21fullscreenableChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface25requestNoTitleBarPropertyEi@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface27requestWindowRadiusPropertyE7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface3getEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface5setupEP17dde_shell_surface@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfaceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfaceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15DDEShellSurfacecvP17dde_shell_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell28capabilityCursorPlaneChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell31capabilityArbitraryModesChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell5setupEP20_wl_fullscreen_shell@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell7presentEP10wl_surfaceP9wl_output@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell7presentEPNS0_7SurfaceEPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShell7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShellC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShellC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShellD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShellD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15FullscreenShellD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures18createPinchGestureEPNS0_7PointerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures18createSwipeGestureEPNS0_7PointerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures5setupEP23zwp_pointer_gestures_v1@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGestures7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturesC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturesC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturesD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturesD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturesD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15PointerGesturescvP23zwp_pointer_gestures_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer14relativeMotionERK6QSizeFS4_y@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer5setupEP23zwp_relative_pointer_v1@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15RelativePointercvP23zwp_relative_pointer_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface10setMaxSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface10setMinSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface11requestMoveEPNS0_4SeatEj@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface11sizeChangedERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface12ackConfigureEj@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface12setMaximizedEb@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface13requestResizeEPNS0_4SeatEj6QFlagsIN2Qt4EdgeEE@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface13setFullscreenEbPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface14closeRequestedEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface15requestMinimizeEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface15setTransientForEPS1_@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface17setWindowGeometryERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface18configureRequestedERK5QSize6QFlagsINS1_5StateEEj@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface21requestShowWindowMenuEPNS0_4SeatEjRK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface5setupEP11xdg_surface@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface5setupEP11xdg_surfaceP12xdg_toplevel@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface5setupEP15zxdg_surface_v6P16zxdg_toplevel_v6@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface7setSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface8setAppIdERK10QByteArray@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurface8setTitleERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfaceC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfaceC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfacecvP11xdg_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfacecvP12xdg_toplevelEv@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfacecvP15zxdg_surface_v6Ev@Base 5.24.3-1 + _ZN8KWayland6Client15XdgShellSurfacecvP16zxdg_toplevel_v6Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement16clientManagementEv@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement16getWindowCaptionEiP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement17captionWindowDoneEib@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement19windowStatesChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement5setupEP28com_deepin_client_management@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagement7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ClientManagementcvP28com_deepin_client_managementEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread10eventsReadEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread11connectionsEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread11setSocketFdEi@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread13errorOccurredEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread13setSocketNameERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread14connectionDiedEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread14initConnectionEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread15fromApplicationEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread16doInitConnectionEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread5flushEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread6failedEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread7displayEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread9connectedEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThread9roundtripEv@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadC1EP10wl_displayP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadC2EP10wl_displayP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16ConnectionThreadD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement19createConfigurationEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement5setupEP29org_kde_kwin_outputmanagement@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagement7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16OutputManagementcvP29org_kde_kwin_outputmanagementEv@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivation11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivation11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivation13applicationIdERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivation16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivation8finishedEv@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivationC1EPNS0_24PlasmaActivationFeedbackEP25org_kde_plasma_activation@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivationC2EPNS0_24PlasmaActivationFeedbackEP25org_kde_plasma_activation@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivationD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivationD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16PlasmaActivationD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager15createTextInputEPNS0_4SeatEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager5setupEP21wl_text_input_manager@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager5setupEP25zwp_text_input_manager_v2@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagerC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagerC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagercvP21wl_text_input_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client16TextInputManagercvP25zwp_text_input_manager_v2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager12getXdgOutputEPNS0_6OutputEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager5setupEP22zxdg_output_manager_v1@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager7Private5setupEP22zxdg_output_manager_v1@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client16XdgOutputManagercvP22zxdg_output_manager_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager13getDataDeviceEPNS0_4SeatEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager16createDataSourceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager5setupEP22wl_data_device_manager@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client17DataDeviceManagercvP22wl_data_device_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel11requestMoveEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel12requestCloseEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel13requestResizeEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel15requestActivateEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel19requestToggleShadedEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel20setMinimizedGeometryEiPNS0_7SurfaceERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel21requestVirtualDesktopEij@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel22requestToggleKeepAboveEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel22requestToggleKeepBelowEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel22requestToggleMaximizedEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModel22requestToggleMinimizedEi@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModelC1EPNS0_22PlasmaWindowManagementE@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModelC2EPNS0_22PlasmaWindowManagementE@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModelD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModelD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client17PlasmaWindowModelD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager15createInhibitorEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager5setupEP27zwp_idle_inhibit_manager_v1@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client18IdleInhibitManagercvP27zwp_idle_inhibit_manager_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface11setPositionERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface14setSkipTaskbarEb@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface15setSkipSwitcherEb@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface16setPanelBehaviorENS1_13PanelBehaviorE@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface18autoHidePanelShownEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface18setPanelTakesFocusEb@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface19autoHidePanelHiddenEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface26requestHideAutoHidingPanelEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface26requestShowAutoHidingPanelEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface3getEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface5setupEP22org_kde_plasma_surface@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurface7setRoleENS1_4RoleE@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfaceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfaceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PlasmaShellSurfacecvP22org_kde_plasma_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints11lockPointerEPNS0_7SurfaceEPNS0_7PointerEPNS0_6RegionENS1_8LifeTimeEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints14confinePointerEPNS0_7SurfaceEPNS0_7PointerEPNS0_6RegionENS1_8LifeTimeEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints5setupEP26zwp_pointer_constraints_v1@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraints7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintsC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintsC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintsD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintsD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintsD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client18PointerConstraintscvP26zwp_pointer_constraints_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration10setEnabledEPNS0_12OutputDeviceENS2_10EnablementE@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration11setOverscanEPNS0_12OutputDeviceEj@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration11setPositionEPNS0_12OutputDeviceERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration12setTransformEPNS0_12OutputDeviceENS2_9TransformE@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration12setVrrPolicyEPNS0_12OutputDeviceENS2_9VrrPolicyE@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration13setBrightnessEPNS0_12OutputDeviceEi@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration14setColorCurvesEPNS0_12OutputDeviceE7QVectorItES5_S5_@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration5applyEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration5setupEP32org_kde_kwin_outputconfiguration@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration6failedEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration7appliedEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration7setModeEPNS0_12OutputDeviceEi@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration8setScaleEPNS0_12OutputDeviceEi@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfiguration9setScaleFEPNS0_12OutputDeviceEd@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client19OutputConfigurationcvP32org_kde_kwin_outputconfigurationEv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture5endedEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture5setupEP28zwp_pointer_gesture_pinch_v1@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture7startedEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture7updatedERK6QSizeFddj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesture9cancelledEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGestureC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGestureC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGestureD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGestureD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGestureD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerPinchGesturecvP28zwp_pointer_gesture_pinch_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture5endedEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture5setupEP28zwp_pointer_gesture_swipe_v1@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture7startedEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture7updatedERK6QSizeFj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesture9cancelledEjj@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGestureC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGestureC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGestureD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGestureD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGestureD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client19PointerSwipeGesturecvP28zwp_pointer_gesture_swipe_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager11bufferReadyEPKvPKNS0_12RemoteBufferE@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager5setupEP34org_kde_kwin_remote_access_manager@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7Private10s_listenerE@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7Private19bufferReadyCallbackEPvP34org_kde_kwin_remote_access_manageriP9wl_output@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7Private5setupEP34org_kde_kwin_remote_access_manager@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7PrivateC1EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7PrivateC2EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client19RemoteAccessManagercvP34org_kde_kwin_remote_access_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop11deactivatedEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop15requestActivateEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop4doneEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop5setupEP30org_kde_plasma_virtual_desktop@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktop9activatedEv@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client20PlasmaVirtualDesktopcvP30org_kde_plasma_virtual_desktopEv@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration11modeChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration11requestModeENS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration5setupEP30org_kde_kwin_server_decoration@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecoration7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client20ServerSideDecorationcvP30org_kde_kwin_server_decorationEv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager21getToplevelDecorationEPNS0_15XdgShellSurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager5setupEP26zxdg_decoration_manager_v1@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client20XdgDecorationManagercvP26zxdg_decoration_manager_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement11hideDesktopEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement11showDesktopEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement13windowCreatedEPNS0_12PlasmaWindowE@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement17createWindowModelEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement17setShowingDesktopEb@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement19activeWindowChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement20stackingOrderChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement21showingDesktopChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement25stackingOrderUuidsChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement5setupEP32org_kde_plasma_window_management@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagement7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client22PlasmaWindowManagementcvP32org_kde_plasma_window_managementEv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager21createRelativePointerEPNS0_7PointerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager5setupEP31zwp_relative_pointer_manager_v1@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client22RelativePointerManagercvP31zwp_relative_pointer_manager_v1Ev@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback10activationEPNS0_16PlasmaActivationE@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback5setupEP34org_kde_plasma_activation_feedback@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedback7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client24PlasmaActivationFeedbackcvP34org_kde_plasma_activation_feedbackEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager5setupEP38org_kde_kwin_server_decoration_manager@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager6createEP10wl_surfaceP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager6createEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationManagercvP38org_kde_kwin_server_decoration_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette10setPaletteERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette5setupEP38org_kde_kwin_server_decoration_palette@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette7Private5setupEP38org_kde_kwin_server_decoration_palette@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalette7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPaletteC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPaletteC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPaletteD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPaletteD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPaletteD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client27ServerSideDecorationPalettecvP38org_kde_kwin_server_decoration_paletteEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement11rowsChangedEj@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement14desktopCreatedERK7QStringj@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement14desktopRemovedERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement17getVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement27requestCreateVirtualDesktopERK7QStringj@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement27requestRemoveVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement4doneEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement5setupEP41org_kde_plasma_virtual_desktop_management@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagement7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client30PlasmaVirtualDesktopManagementcvP41org_kde_plasma_virtual_desktop_managementEv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager5setupEP46org_kde_kwin_server_decoration_palette_manager@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager6createEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager7Private5setupEP46org_kde_kwin_server_decoration_palette_manager@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManager7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client34ServerSideDecorationPaletteManagercvP46org_kde_kwin_server_decoration_palette_managerEv@Base 5.24.3-1 + _ZN8KWayland6Client4Blur11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client4Blur11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client4Blur16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client4Blur5setupEP17org_kde_kwin_blur@Base 5.24.3-1 + _ZN8KWayland6Client4Blur6commitEv@Base 5.24.3-1 + _ZN8KWayland6Client4Blur7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client4Blur7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client4Blur9setRegionEPNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client4BlurC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4BlurC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4BlurD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client4BlurD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client4BlurD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client4BlurcvP17org_kde_kwin_blurEv@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms11modeChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms11requestModeENS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms16supportedChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms5setupEP17org_kde_kwin_dpms@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client4Dpms7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client4DpmsC1ERK8QPointerINS0_6OutputEEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4DpmsC2ERK8QPointerINS0_6OutputEEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4DpmsD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client4DpmsD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client4DpmsD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client4DpmscvP17org_kde_kwin_dpmsEv@Base 5.24.3-1 + _ZN8KWayland6Client4Idle10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client4Idle10getTimeoutEjPNS0_4SeatEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4Idle11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client4Idle11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client4Idle13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client4Idle16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client4Idle5setupEP17org_kde_kwin_idle@Base 5.24.3-1 + _ZN8KWayland6Client4Idle7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client4Idle7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client4Idle7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client4IdleC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4IdleC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4IdleD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client4IdleD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client4IdleD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client4IdlecvP17org_kde_kwin_idleEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat11createTouchEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4Seat11nameChangedERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client4Seat11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client4Seat13createPointerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4Seat13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client4Seat14createKeyboardEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4Seat15hasTouchChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client4Seat16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client4Seat17hasPointerChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client4Seat18hasKeyboardChangedEb@Base 5.24.3-1 + _ZN8KWayland6Client4Seat26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat5setupEP7wl_seat@Base 5.24.3-1 + _ZN8KWayland6Client4Seat7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client4Seat7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client4SeatC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4SeatC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client4SeatD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client4SeatD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client4SeatD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client4SeatcvP7wl_seatEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client5Shell13createSurfaceEP10wl_surfaceP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5Shell13createSurfaceEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5Shell13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client5Shell16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client5Shell26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell5setupEP8wl_shell@Base 5.24.3-1 + _ZN8KWayland6Client5Shell7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client5Shell7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client5ShellC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5ShellC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5ShellD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client5ShellD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client5ShellD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client5ShellcvP8wl_shellEv@Base 5.24.3-1 + _ZN8KWayland6Client5Slide11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client5Slide11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client5Slide11setLocationENS1_8LocationE@Base 5.24.3-1 + _ZN8KWayland6Client5Slide16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client5Slide5setupEP18org_kde_kwin_slide@Base 5.24.3-1 + _ZN8KWayland6Client5Slide6commitEv@Base 5.24.3-1 + _ZN8KWayland6Client5Slide7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client5Slide7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client5Slide9setOffsetEi@Base 5.24.3-1 + _ZN8KWayland6Client5SlideC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5SlideC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5SlideD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client5SlideD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client5SlideD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client5SlidecvP18org_kde_kwin_slideEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client5Strut13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client5Strut15setStrutPartialEP10wl_surfaceRNS0_15deepinKwinStrutE@Base 5.24.3-1 + _ZN8KWayland6Client5Strut16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client5Strut26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut5setupEP21com_deepin_kwin_strut@Base 5.24.3-1 + _ZN8KWayland6Client5Strut7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client5Strut7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client5StrutC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5StrutC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5StrutD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client5StrutD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client5StrutD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client5StrutcvP21com_deepin_kwin_strutEv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch10frameEndedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch10pointAddedEPNS0_10TouchPointE@Base 5.24.3-1 + _ZN8KWayland6Client5Touch10pointMovedEPNS0_10TouchPointE@Base 5.24.3-1 + _ZN8KWayland6Client5Touch11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client5Touch12pointRemovedEPNS0_10TouchPointE@Base 5.24.3-1 + _ZN8KWayland6Client5Touch13sequenceEndedEv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch15sequenceStartedEPNS0_10TouchPointE@Base 5.24.3-1 + _ZN8KWayland6Client5Touch16sequenceCanceledEv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client5Touch5setupEP8wl_touch@Base 5.24.3-1 + _ZN8KWayland6Client5Touch7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client5Touch7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client5TouchC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5TouchC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client5TouchD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client5TouchD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client5TouchD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client5TouchcvP8wl_touchEv@Base 5.24.3-1 + _ZN8KWayland6Client6Buffer11setReleasedEb@Base 5.24.3-1 + _ZN8KWayland6Client6Buffer4copyEPKv@Base 5.24.3-1 + _ZN8KWayland6Client6Buffer5getIdEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Buffer7addressEv@Base 5.24.3-1 + _ZN8KWayland6Client6Buffer7setUsedEb@Base 5.24.3-1 + _ZN8KWayland6Client6BufferC1EPNS0_7ShmPoolEP9wl_bufferRK5QSizeimNS1_6FormatE@Base 5.24.3-1 + _ZN8KWayland6Client6BufferC2EPNS0_7ShmPoolEP9wl_bufferRK5QSizeimNS1_6FormatE@Base 5.24.3-1 + _ZN8KWayland6Client6BufferD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client6BufferD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client6BuffercvP9wl_bufferEv@Base 5.24.3-1 + _ZN8KWayland6Client6Output11modeChangedERKNS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client6Output11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client6Output11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client6Output13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client6Output16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client6Output3getEP9wl_output@Base 5.24.3-1 + _ZN8KWayland6Client6Output5setupEP9wl_output@Base 5.24.3-1 + _ZN8KWayland6Client6Output6outputEv@Base 5.24.3-1 + _ZN8KWayland6Client6Output7changedEv@Base 5.24.3-1 + _ZN8KWayland6Client6Output7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client6Output7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client6Output9modeAddedERKNS1_4ModeE@Base 5.24.3-1 + _ZN8KWayland6Client6OutputC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6OutputC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6OutputD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client6OutputD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client6OutputD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client6OutputcvP9wl_outputEv@Base 5.24.3-1 + _ZN8KWayland6Client6Region11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client6Region11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client6Region16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client6Region3addERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client6Region3addERK7QRegion@Base 5.24.3-1 + _ZN8KWayland6Client6Region5setupEP9wl_region@Base 5.24.3-1 + _ZN8KWayland6Client6Region7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client6Region7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client6Region8subtractERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client6Region8subtractERK7QRegion@Base 5.24.3-1 + _ZN8KWayland6Client6RegionC1ERK7QRegionP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6RegionC2ERK7QRegionP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6RegionD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client6RegionD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client6RegionD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client6RegioncvP9wl_regionEv@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow10attachLeftE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow10attachLeftEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow10attachLeftEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow10setOffsetsERK9QMarginsF@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow11attachRightE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow11attachRightEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow11attachRightEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow12attachBottomE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow12attachBottomEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow12attachBottomEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow13attachTopLeftE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow13attachTopLeftEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow13attachTopLeftEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow14attachTopRightE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow14attachTopRightEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow14attachTopRightEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow16attachBottomLeftE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow16attachBottomLeftEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow16attachBottomLeftEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow17attachBottomRightE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow17attachBottomRightEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow17attachBottomRightEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow5setupEP19org_kde_kwin_shadow@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow6commitEv@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow9attachTopE12QWeakPointerINS0_6BufferEE@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow9attachTopEP9wl_buffer@Base 5.24.3-1 + _ZN8KWayland6Client6Shadow9attachTopEPNS0_6BufferE@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client6ShadowcvP19org_kde_kwin_shadowEv@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu10setAddressERK7QStringS4_@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu5setupEP20org_kde_kwin_appmenu@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu7Private5setupEP20org_kde_kwin_appmenu@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenu7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenuC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenuC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenuD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenuD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenuD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client7AppMenucvP20org_kde_kwin_appmenuEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat14createDDETouchEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat16createDDePointerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat17createDDEKeyboardEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat5setupEP8dde_seat@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeat7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client7DDESeatcvP8dde_seatEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer10hideCursorEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer11axisChangedEjNS1_4AxisEd@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer11axisStoppedEjNS1_4AxisE@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer14enteredSurfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer17axisSourceChangedENS1_10AxisSourceE@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer18buttonStateChangedEjjjNS1_11ButtonStateE@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer19axisDiscreteChangedENS1_4AxisEi@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer4leftEj@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer5frameEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer5setupEP10wl_pointer@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer6motionERK7QPointFj@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer7enteredEjRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client7Pointer9setCursorEPNS0_7SurfaceERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client7PointerC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7PointerC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7PointerD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client7PointerD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client7PointerD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client7PointercvP10wl_pointerEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool11poolResizedEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool12createBufferERK5QSizeiPKvNS0_6Buffer6FormatE@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool12createBufferERK6QImage@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool3shmEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool5setupEP6wl_shm@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPool9getBufferERK5QSizeiNS0_6Buffer6FormatE@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPoolC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPoolC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPoolD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPoolD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client7ShmPoolD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client7Surface10fromWindowEP7QWindow@Base 5.24.3-1 + _ZN8KWayland6Client7Surface10outputLeftEPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface11fromQtWinIdEy@Base 5.24.3-1 + _ZN8KWayland6Client7Surface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client7Surface11sizeChangedERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client7Surface12attachBufferE12QWeakPointerINS0_6BufferEERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client7Surface12attachBufferEP9wl_bufferRK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client7Surface12attachBufferEPNS0_6BufferERK6QPoint@Base 5.24.3-1 + _ZN8KWayland6Client7Surface12damageBufferERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client7Surface12damageBufferERK7QRegion@Base 5.24.3-1 + _ZN8KWayland6Client7Surface13frameRenderedEv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface13outputEnteredEPNS0_6OutputE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface14setInputRegionEPKNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface15setOpaqueRegionEPKNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface18setupFrameCallbackEv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface3allEv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface3getEP10wl_surface@Base 5.24.3-1 + _ZN8KWayland6Client7Surface5setupEP10wl_surface@Base 5.24.3-1 + _ZN8KWayland6Client7Surface6commitENS1_10CommitFlagE@Base 5.24.3-1 + _ZN8KWayland6Client7Surface6damageERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client7Surface6damageERK7QRegion@Base 5.24.3-1 + _ZN8KWayland6Client7Surface7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client7Surface7setSizeERK5QSize@Base 5.24.3-1 + _ZN8KWayland6Client7Surface8setScaleEi@Base 5.24.3-1 + _ZN8KWayland6Client7SurfaceC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7SurfaceC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client7SurfaceD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client7SurfaceD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client7SurfaceD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client7SurfacecvP10wl_surfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast11setContrastEd@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast12setIntensityEd@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast13setSaturationEd@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast5setupEP21org_kde_kwin_contrast@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast6commitEv@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast8setFrostE6QColor@Base 5.24.3-1 + _ZN8KWayland6Client8Contrast9setRegionEPNS0_6RegionE@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8ContrastcvP21org_kde_kwin_contrastEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell18createShellSurfaceEP10wl_surfaceP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell18createShellSurfaceEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell26interfaceAboutToBeReleasedEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell27interfaceAboutToBeDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell5setupEP9dde_shell@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShell8ddeShellEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDEShellcvP9dde_shellEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch11touchMotionEiRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch5setupEP9dde_touch@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch7touchUpEi@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouch9touchDownEiRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8DDETouchcvP9dde_touchEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard10keyChangedEjNS1_8KeyStateEj@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard13keymapChangedEij@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard14enteredSurfaceEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard16keyRepeatChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard16modifiersChangedEjjjj@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard4leftEj@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard5setupEP11wl_keyboard@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard7enteredEj@Base 5.24.3-1 + _ZN8KWayland6Client8Keyboard7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8KeyboardcvP11wl_keyboardEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate11fetchStatesEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate12stateChangedENS1_3KeyENS1_5StateE@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate5setupEP21org_kde_kwin_keystate@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8Keystate7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client8KeystateC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8KeystateC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8KeystateD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8KeystateD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8KeystateD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8Registry10createIdleEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry10createSeatEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry10shmRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11blurRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11createShellEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11createStrutEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11dpmsRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11idleRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8Registry11seatRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry12createOutputEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry12shellRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry12shmAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry12slideRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry12strutRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13blurAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13createDDESeatEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13createShmPoolEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13dpmsAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13idleAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13outputRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13seatAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client8Registry13shadowRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14appMenuRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14createDDEShellEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14createKeystateEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14createXdgShellEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14ddeSeatRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14shellAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14slideAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry14strutAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15contrastRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15createFakeInputEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15ddeShellRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15keystateRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15outputAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry15shadowAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16appMenuAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16createCompositorEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16ddeSeatAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16fakeInputRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16interfaceRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8Registry16xdgOutputRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17compositorRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17contrastAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17createBlurManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17createDpmsManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17createPlasmaShellEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17createXdgExporterEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17createXdgImporterEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17ddeShellAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17keystateAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry17registryDestroyedEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18createOutputDeviceEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18createSlideManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18fakeInputAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18interfaceAnnouncedE10QByteArrayjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18plasmaShellRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry18xdgOutputAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry19compositorAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry19createShadowManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry19createSubCompositorEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry19interfacesAnnouncedEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry19outputDeviceRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry20createAppMenuManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry20plasmaShellAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry20subCompositorRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry20xdgDecorationRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry21createContrastManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry21createFullscreenShellEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry21createPointerGesturesEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry21outputDeviceAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry21xdgShellStableRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22createClientManagementEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22createOutputManagementEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22createTextInputManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22createXdgOutputManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22fullscreenShellRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22subCompositorAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry22xdgDecorationAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry23clientManagementRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry23createDataDeviceManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry23outputManagementRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry23xdgShellStableAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry24createIdleInhibitManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry24createPointerConstraintsEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry24dataDeviceManagerRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry24fullscreenShellAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25clientManagementAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25createRemoteAccessManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25exporterUnstableV2RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25importerUnstableV2RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25outputManagementAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25xdgShellUnstableV5RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry25xdgShellUnstableV6RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry26createXdgDecorationManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry26dataDeviceManagerAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry26remoteAccessManagerRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry27exporterUnstableV2AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry27importerUnstableV2AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry27xdgShellUnstableV5AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry27xdgShellUnstableV6AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry28createPlasmaWindowManagementEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry28createRelativePointerManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry28remoteAccessManagerAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry29plasmaWindowManagementRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry30createPlasmaActivationFeedbackEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry31plasmaActivationFeedbackRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry31plasmaWindowManagementAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry32pointerGesturesUnstableV1RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry33createServerSideDecorationManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry33plasmaActivationFeedbackAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry33textInputManagerUnstableV0RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry33textInputManagerUnstableV2RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry34pointerGesturesUnstableV1AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry34serverSideDecorationManagerRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry35idleInhibitManagerUnstableV1RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry35pointerConstraintsUnstableV1RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry35textInputManagerUnstableV0AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry35textInputManagerUnstableV2AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry36createPlasmaVirtualDesktopManagementEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry36serverSideDecorationManagerAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry37idleInhibitManagerUnstableV1AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry37plasmaVirtualDesktopManagementRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry37pointerConstraintsUnstableV1AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry39plasmaVirtualDesktopManagementAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry39relativePointerManagerUnstableV1RemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry40createServerSideDecorationPaletteManagerEjjP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8Registry41relativePointerManagerUnstableV1AnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry41serverSideDecorationPaletteManagerRemovedEj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry43serverSideDecorationPaletteManagerAnnouncedEjj@Base 5.24.3-1 + _ZN8KWayland6Client8Registry5setupEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry6createEP10wl_display@Base 5.24.3-1 + _ZN8KWayland6Client8Registry6createEPNS0_16ConnectionThreadE@Base 5.24.3-1 + _ZN8KWayland6Client8Registry7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8Registry8registryEv@Base 5.24.3-1 + _ZN8KWayland6Client8RegistryC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8RegistryC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8RegistryD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8RegistryD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8RegistryD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8RegistrycvP11wl_registryEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell11createPopupEPNS0_7SurfaceEPNS0_13XdgShellPopupERKNS0_13XdgPositionerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell11createPopupEPNS0_7SurfaceEPNS0_15XdgShellSurfaceERKNS0_13XdgPositionerEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell11createPopupEPNS0_7SurfaceES3_PNS0_4SeatEjRK6QPointP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell13createSurfaceEPNS0_7SurfaceEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell5setupEP11xdg_wm_base@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell5setupEP13zxdg_shell_v6@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell5setupEP9xdg_shell@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShell7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellcvP11xdg_wm_baseEv@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellcvP13zxdg_shell_v6Ev@Base 5.24.3-1 + _ZN8KWayland6Client8XdgShellcvP9xdg_shellEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer15mimeTypeOfferedERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer19dragAndDropFinishedEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer21setDragAndDropActionsE6QFlagsINS0_17DataDeviceManager9DnDActionEES4_@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer31sourceDragAndDropActionsChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer32selectedDragAndDropActionChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer6acceptERK7QStringj@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer6acceptERK9QMimeTypej@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer7receiveERK7QStringi@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer7receiveERK9QMimeTypei@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffer7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client9DataOfferC1EPNS0_10DataDeviceEP13wl_data_offer@Base 5.24.3-1 + _ZN8KWayland6Client9DataOfferC2EPNS0_10DataDeviceEP13wl_data_offer@Base 5.24.3-1 + _ZN8KWayland6Client9DataOfferD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client9DataOfferD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client9DataOfferD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client9DataOffercvP13wl_data_offerEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput10eventQueueEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput12authenticateERK7QStringS4_@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput14requestTouchUpEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput16requestTouchDownEjRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput17requestTouchFrameEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput18requestPointerAxisEN2Qt11OrientationEd@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput18requestPointerMoveERK6QSizeF@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput18requestTouchCancelEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput18requestTouchMotionEjRK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput23requestKeyboardKeyPressEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput25requestKeyboardKeyReleaseEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput25requestPointerButtonClickEN2Qt11MouseButtonE@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput25requestPointerButtonClickEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput25requestPointerButtonPressEN2Qt11MouseButtonE@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput25requestPointerButtonPressEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput26requestPointerMoveAbsoluteERK7QPointF@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput27requestPointerButtonReleaseEN2Qt11MouseButtonE@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput27requestPointerButtonReleaseEj@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput28requestPointerAxisForCaptureEN2Qt11OrientationEd@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput5setupEP23org_kde_kwin_fake_input@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInput7removedEv@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client9FakeInputcvP23org_kde_kwin_fake_inputEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput13setEventQueueEPNS0_10EventQueueE@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput14hideInputPanelEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput14setContentTypeE6QFlagsINS1_11ContentHintEENS1_14ContentPurposeE@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput14showInputPanelEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput15languageChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput18setCursorRectangleERK5QRect@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput18setSurroundingTextERK7QStringjj@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput20composingTextChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput20setPreferredLanguageERK7QString@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput20textDirectionChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput22inputPanelStateChangedEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput4leftEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput5resetEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput6enableEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput7disableEPNS0_7SurfaceE@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput7enteredEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput8keyEventEjNS1_8KeyStateE6QFlagsIN2Qt16KeyboardModifierEEj@Base 5.24.3-1 + _ZN8KWayland6Client9TextInput9committedEv@Base 5.24.3-1 + _ZN8KWayland6Client9TextInputC1EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9TextInputC2EPNS1_7PrivateEP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9TextInputD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client9TextInputD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client9TextInputD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput11qt_metacastEPKc@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput16staticMetaObjectE@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput5setupEP14zxdg_output_v1@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private10s_listenerE@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private12doneCallbackEPvP14zxdg_output_v1@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private12nameCallbackEPvP14zxdg_output_v1PKc@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private19descriptionCallbackEPvP14zxdg_output_v1PKc@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private20logical_sizeCallbackEPvP14zxdg_output_v1ii@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private24logical_positionCallbackEPvP14zxdg_output_v1ii@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7Private5setupEP14zxdg_output_v1@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7PrivateC1EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7PrivateC2EPS1_@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7changedEv@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7destroyEv@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutput7releaseEv@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputC1EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputC2EP7QObject@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputD0Ev@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputD1Ev@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputD2Ev@Base 5.24.3-1 + _ZN8KWayland6Client9XdgOutputcvP14zxdg_output_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client10Compositor10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10Compositor7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client10CompositorcvP13wl_compositorEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DDEPointer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DDEPointer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DDEPointercvP11dde_pointerEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevice10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevice11dragSurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevice16offeredSelectionEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevice7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevice9dragOfferEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataDevicecvP14wl_data_deviceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataSource10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataSource25selectedDragAndDropActionEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataSource7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client10DataSourcecvP14wl_data_sourceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10EventQueue10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10EventQueuecvP14wl_event_queueEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface13parentSurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface4modeEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface7surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurface8positionEv@Base 5.24.3-1 + _ZNK8KWayland6Client10SubSurfacecvP13wl_subsurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint10downSerialEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint10timestampsEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint2idEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint4timeEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint6isDownEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint7surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint8positionEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint8upSerialEv@Base 5.24.3-1 + _ZNK8KWayland6Client10TouchPoint9positionsEv@Base 5.24.3-1 + _ZNK8KWayland6Client11BlurManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11BlurManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11BlurManagercvP25org_kde_kwin_blur_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DDEKeyboard10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DDEKeyboard7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DDEKeyboardcvP12dde_keyboardEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DpmsManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DpmsManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11DpmsManagercvP25org_kde_kwin_dpms_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client11IdleTimeout10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11IdleTimeout7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11IdleTimeoutcvP25org_kde_kwin_idle_timeoutEv@Base 5.24.3-1 + _ZNK8KWayland6Client11PlasmaShell10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11PlasmaShell7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11PlasmaShellcvP20org_kde_plasma_shellEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExported10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExported6handleEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExported7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExportedcvP16zxdg_exported_v2Ev@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExporter10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExporter7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgExportercvP16zxdg_exporter_v2Ev@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImported10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImported7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImportedcvP16zxdg_imported_v2Ev@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImporter10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImporter7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client11XdgImportercvP16zxdg_importer_v2Ev@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice11ColorCurveseqERKS2_@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice11ColorCurvesneERKS2_@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice11colorCurvesEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice11currentModeEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice11refreshRateEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice12capabilitiesEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice12manufacturerEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice12physicalSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice12serialNumberEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice14globalPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice4ModeeqERKS2_@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice4edidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice4uuidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice5modelEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice5modesEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice5scaleEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice6eisaIdEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice6scaleFEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice7enabledEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice8geometryEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice8overscanEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice8subPixelEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice9pixelSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice9transformEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevice9vrrPolicyEv@Base 5.24.3-1 + _ZNK8KWayland6Client12OutputDevicecvP25org_kde_kwin_outputdeviceEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow10internalIdEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isCloseableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isKeepAboveEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isKeepBelowEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isMaximizedEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isMinimizedEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isResizableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11isShadeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow11skipTaskbarEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow12isFullscreenEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow12parentWindowEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow12sendToOutputEPNS0_6OutputE@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow12skipSwitcherEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow14isMaximizeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow14isMinimizeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow14virtualDesktopEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow15isOnAllDesktopsEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow16isFullscreenableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow16plasmaActivitiesEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow20isDemandingAttentionEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow21plasmaVirtualDesktopsEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow25applicationMenuObjectPathEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow26applicationMenuServiceNameEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow26isVirtualDesktopChangeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow3pidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow4iconEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow4uuidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow5appIdEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow5titleEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow8geometryEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow8isActiveEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow8isShadedEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow8windowIdEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindow9isMovableEv@Base 5.24.3-1 + _ZNK8KWayland6Client12PlasmaWindowcvP21org_kde_plasma_windowEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer2fdEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer5widthEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer6formatEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer6heightEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer6strideEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12RemoteBuffercvP26org_kde_kwin_remote_bufferEv@Base 5.24.3-1 + _ZNK8KWayland6Client12ShellSurface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client12ShellSurface4sizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client12ShellSurface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12ShellSurfacecvP16wl_shell_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client12SlideManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client12SlideManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client12SlideManagercvP26org_kde_kwin_slide_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client13IdleInhibitor10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13IdleInhibitor7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13IdleInhibitorcvP21zwp_idle_inhibitor_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client13LockedPointer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13LockedPointer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13LockedPointercvP21zwp_locked_pointer_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client13ShadowManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13ShadowManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13ShadowManagercvP27org_kde_kwin_shadow_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client13SubCompositor10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13SubCompositor7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13SubCompositorcvP16wl_subcompositorEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgDecoration10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgDecoration4modeEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgDecoration7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgDecorationcvP27zxdg_toplevel_decoration_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner10anchorEdgeEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner10anchorRectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner11constraintsEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner11initialSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner12anchorOffsetEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgPositioner7gravityEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopup10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopup7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopupcvP11xdg_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopupcvP13zxdg_popup_v6Ev@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopupcvP15zxdg_surface_v6Ev@Base 5.24.3-1 + _ZNK8KWayland6Client13XdgShellPopupcvP9xdg_popupEv@Base 5.24.3-1 + _ZNK8KWayland6Client14AppMenuManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client14AppMenuManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client14AppMenuManagercvP28org_kde_kwin_appmenu_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client15ConfinedPointer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15ConfinedPointer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15ConfinedPointercvP23zwp_confined_pointer_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client15ContrastManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15ContrastManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15ContrastManagercvP29org_kde_kwin_contrast_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11getGeometryEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isCloseableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isKeepAboveEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isKeepBelowEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isMaximizedEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isMinimizedEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface11isResizableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface12isFullscreenEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface13isAcceptFocusEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface13requestActiveEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface14isMaximizeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface14isMinimizeableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface15requestGeometryEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface16isFullscreenableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface7isModalEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface8isActiveEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurface9isMovableEv@Base 5.24.3-1 + _ZNK8KWayland6Client15DDEShellSurfacecvP17dde_shell_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client15FullscreenShell10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client15FullscreenShell10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15FullscreenShell24hasCapabilityCursorPlaneEv@Base 5.24.3-1 + _ZNK8KWayland6Client15FullscreenShell27hasCapabilityArbitraryModesEv@Base 5.24.3-1 + _ZNK8KWayland6Client15FullscreenShell7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15PointerGestures10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15PointerGestures7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15PointerGesturescvP23zwp_pointer_gestures_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client15RelativePointer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15RelativePointer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15RelativePointercvP23zwp_relative_pointer_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurface4sizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurfacecvP11xdg_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurfacecvP12xdg_toplevelEv@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurfacecvP15zxdg_surface_v6Ev@Base 5.24.3-1 + _ZNK8KWayland6Client15XdgShellSurfacecvP16zxdg_toplevel_v6Ev@Base 5.24.3-1 + _ZNK8KWayland6Client16ClientManagement10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ClientManagement10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ClientManagement15getWindowStatesEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ClientManagement7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ClientManagementcvP28com_deepin_client_managementEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ConnectionThread10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ConnectionThread10socketNameEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ConnectionThread8hasErrorEv@Base 5.24.3-1 + _ZNK8KWayland6Client16ConnectionThread9errorCodeEv@Base 5.24.3-1 + _ZNK8KWayland6Client16OutputManagement10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16OutputManagement7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client16OutputManagementcvP29org_kde_kwin_outputmanagementEv@Base 5.24.3-1 + _ZNK8KWayland6Client16PlasmaActivation10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16TextInputManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16TextInputManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client16TextInputManagercvP21wl_text_input_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client16TextInputManagercvP25zwp_text_input_manager_v2Ev@Base 5.24.3-1 + _ZNK8KWayland6Client16XdgOutputManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client16XdgOutputManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client16XdgOutputManagercvP22zxdg_output_manager_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client17DataDeviceManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client17DataDeviceManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client17DataDeviceManagercvP22wl_data_device_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client17PlasmaWindowModel10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client17PlasmaWindowModel4dataERK11QModelIndexi@Base 5.24.3-1 + _ZNK8KWayland6Client17PlasmaWindowModel5indexEiiRK11QModelIndex@Base 5.24.3-1 + _ZNK8KWayland6Client17PlasmaWindowModel8rowCountERK11QModelIndex@Base 5.24.3-1 + _ZNK8KWayland6Client17PlasmaWindowModel9roleNamesEv@Base 5.24.3-1 + _ZNK8KWayland6Client18IdleInhibitManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client18IdleInhibitManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client18IdleInhibitManagercvP27zwp_idle_inhibit_manager_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client18PlasmaShellSurface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PlasmaShellSurface4roleEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PlasmaShellSurface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PlasmaShellSurfacecvP22org_kde_plasma_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PointerConstraints10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PointerConstraints7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client18PointerConstraintscvP26zwp_pointer_constraints_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client19OutputConfiguration10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client19OutputConfiguration7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client19OutputConfigurationcvP32org_kde_kwin_outputconfigurationEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerPinchGesture10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerPinchGesture11fingerCountEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerPinchGesture7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerPinchGesture7surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerPinchGesturecvP28zwp_pointer_gesture_pinch_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerSwipeGesture10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerSwipeGesture11fingerCountEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerSwipeGesture7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerSwipeGesture7surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client19PointerSwipeGesturecvP28zwp_pointer_gesture_swipe_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client19RemoteAccessManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client19RemoteAccessManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client19RemoteAccessManagercvP34org_kde_kwin_remote_access_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktop10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktop2idEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktop4nameEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktop7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktop8isActiveEv@Base 5.24.3-1 + _ZNK8KWayland6Client20PlasmaVirtualDesktopcvP30org_kde_plasma_virtual_desktopEv@Base 5.24.3-1 + _ZNK8KWayland6Client20ServerSideDecoration10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client20ServerSideDecoration11defaultModeEv@Base 5.24.3-1 + _ZNK8KWayland6Client20ServerSideDecoration4modeEv@Base 5.24.3-1 + _ZNK8KWayland6Client20ServerSideDecoration7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client20ServerSideDecorationcvP30org_kde_kwin_server_decorationEv@Base 5.24.3-1 + _ZNK8KWayland6Client20XdgDecorationManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client20XdgDecorationManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client20XdgDecorationManagercvP26zxdg_decoration_manager_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement12activeWindowEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement13stackingOrderEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement16isShowingDesktopEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement18stackingOrderUuidsEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagement7windowsEv@Base 5.24.3-1 + _ZNK8KWayland6Client22PlasmaWindowManagementcvP32org_kde_plasma_window_managementEv@Base 5.24.3-1 + _ZNK8KWayland6Client22RelativePointerManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client22RelativePointerManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client22RelativePointerManagercvP31zwp_relative_pointer_manager_v1Ev@Base 5.24.3-1 + _ZNK8KWayland6Client24PlasmaActivationFeedback10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client24PlasmaActivationFeedback7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client24PlasmaActivationFeedbackcvP34org_kde_plasma_activation_feedbackEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationManagercvP38org_kde_kwin_server_decoration_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationPalette10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationPalette7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client27ServerSideDecorationPalettecvP38org_kde_kwin_server_decoration_paletteEv@Base 5.24.3-1 + _ZNK8KWayland6Client30PlasmaVirtualDesktopManagement10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client30PlasmaVirtualDesktopManagement4rowsEv@Base 5.24.3-1 + _ZNK8KWayland6Client30PlasmaVirtualDesktopManagement7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client30PlasmaVirtualDesktopManagement8desktopsEv@Base 5.24.3-1 + _ZNK8KWayland6Client30PlasmaVirtualDesktopManagementcvP41org_kde_plasma_virtual_desktop_managementEv@Base 5.24.3-1 + _ZNK8KWayland6Client34ServerSideDecorationPaletteManager10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client34ServerSideDecorationPaletteManager7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client34ServerSideDecorationPaletteManagercvP46org_kde_kwin_server_decoration_palette_managerEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Blur10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Blur7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client4BlurcvP17org_kde_kwin_blurEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Dpms10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Dpms11isSupportedEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Dpms4modeEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Dpms6outputEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Dpms7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client4DpmscvP17org_kde_kwin_dpmsEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Idle10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Idle7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client4IdlecvP17org_kde_kwin_idleEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat10hasPointerEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat11hasKeyboardEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat4nameEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client4Seat8hasTouchEv@Base 5.24.3-1 + _ZNK8KWayland6Client4SeatcvP7wl_seatEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Shell10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Shell7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client5ShellcvP8wl_shellEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Slide10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Slide7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client5SlidecvP18org_kde_kwin_slideEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Strut10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Strut7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client5StrutcvP21com_deepin_kwin_strutEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Touch10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Touch7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client5Touch8sequenceEv@Base 5.24.3-1 + _ZNK8KWayland6Client5TouchcvP8wl_touchEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer10isReleasedEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer4sizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer6bufferEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer6formatEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer6isUsedEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Buffer6strideEv@Base 5.24.3-1 + _ZNK8KWayland6Client6BuffercvP9wl_bufferEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output11refreshRateEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output12manufacturerEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output12physicalSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output14globalPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output4ModeeqERKS2_@Base 5.24.3-1 + _ZNK8KWayland6Client6Output5modelEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output5modesEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output5scaleEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output8geometryEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output8subPixelEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output9pixelSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Output9transformEv@Base 5.24.3-1 + _ZNK8KWayland6Client6OutputcvP9wl_outputEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Region10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Region6regionEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Region7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client6RegioncvP9wl_regionEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Shadow10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client6Shadow7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client6ShadowcvP19org_kde_kwin_shadowEv@Base 5.24.3-1 + _ZNK8KWayland6Client7AppMenu10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client7AppMenu7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client7AppMenucvP20org_kde_kwin_appmenuEv@Base 5.24.3-1 + _ZNK8KWayland6Client7DDESeat10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client7DDESeat10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client7DDESeat7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client7DDESeatcvP8dde_seatEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Pointer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Pointer14enteredSurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Pointer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client7PointercvP10wl_pointerEv@Base 5.24.3-1 + _ZNK8KWayland6Client7ShmPool10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client7ShmPool11poolAddressEv@Base 5.24.3-1 + _ZNK8KWayland6Client7ShmPool7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface2idEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface4sizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface5scaleEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client7Surface7outputsEv@Base 5.24.3-1 + _ZNK8KWayland6Client7SurfacecvP10wl_surfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Contrast10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Contrast7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8ContrastcvP21org_kde_kwin_contrastEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDEShell10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDEShell10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDEShell7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDEShellcvP9dde_shellEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDETouch10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDETouch7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8DDETouchcvP9dde_touchEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard13keyRepeatRateEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard14enteredSurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard14keyRepeatDelayEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard18isKeyRepeatEnabledEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keyboard7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8KeyboardcvP11wl_keyboardEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Keystate10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry10bindOutputEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry10interfacesENS1_9InterfaceE@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry11bindDDESeatEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry12bindDDEShellEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry12bindKeystateEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry12hasInterfaceENS1_9InterfaceE@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry13bindFakeInputEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry14bindCompositorEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry15bindBlurManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry15bindDpmsManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry15bindPlasmaShellEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry16bindOutputDeviceEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry16bindSlideManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry17bindShadowManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry17bindSubCompositorEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry18bindAppMenuManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry18bindXdgShellStableEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry19bindContrastManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry19bindFullscreenShellEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry20bindClientManagementEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry20bindOutputManagementEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry21bindDataDeviceManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry22bindXdgShellUnstableV5Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry22bindXdgShellUnstableV6Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry23bindRemoteAccessManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry23bindXdgOutputUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry25bindXdgExporterUnstableV2Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry25bindXdgImporterUnstableV2Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry26bindPlasmaWindowManagementEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry27bindXdgDecorationUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry28bindPlasmaActivationFeedbackEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry29bindPointerGesturesUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry30bindTextInputManagerUnstableV0Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry30bindTextInputManagerUnstableV2Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry31bindServerSideDecorationManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry32bindIdleInhibitManagerUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry32bindPointerConstraintsUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry34bindPlasmaVirtualDesktopManagementEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry36bindRelativePointerManagerUnstableV1Ejj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry38bindServerSideDecorationPaletteManagerEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry7bindShmEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry8bindIdleEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry8bindSeatEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry9bindShellEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry9bindStrutEjj@Base 5.24.3-1 + _ZNK8KWayland6Client8Registry9interfaceENS1_9InterfaceE@Base 5.24.3-1 + _ZNK8KWayland6Client8RegistrycvP11wl_registryEv@Base 5.24.3-1 + _ZNK8KWayland6Client8XdgShell10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client8XdgShell7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client8XdgShellcvP11xdg_wm_baseEv@Base 5.24.3-1 + _ZNK8KWayland6Client8XdgShellcvP13zxdg_shell_v6Ev@Base 5.24.3-1 + _ZNK8KWayland6Client8XdgShellcvP9xdg_shellEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffer10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffer16offeredMimeTypesEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffer24sourceDragAndDropActionsEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffer25selectedDragAndDropActionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffer7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client9DataOffercvP13wl_data_offerEv@Base 5.24.3-1 + _ZNK8KWayland6Client9FakeInput10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client9FakeInput7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client9FakeInputcvP23org_kde_kwin_fake_inputEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput10commitTextEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput10eventQueueEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput13composingTextEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput13textDirectionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput14anchorPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput14cursorPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput14enteredSurfaceEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput19isInputPanelVisibleEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput21composingFallbackTextEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput21deleteSurroundingTextEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput27composingTextCursorPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client9TextInput8languageEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput10metaObjectEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput11descriptionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput11logicalSizeEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput15logicalPositionEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput4nameEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutput7isValidEv@Base 5.24.3-1 + _ZNK8KWayland6Client9XdgOutputcvP14zxdg_output_v1Ev@Base 5.24.3-1 + _ZTIN8KWayland6Client10CompositorE@Base 5.24.3-1 + _ZTIN8KWayland6Client10DDEPointerE@Base 5.24.3-1 + _ZTIN8KWayland6Client10DataDeviceE@Base 5.24.3-1 + _ZTIN8KWayland6Client10DataSourceE@Base 5.24.3-1 + _ZTIN8KWayland6Client10EventQueueE@Base 5.24.3-1 + _ZTIN8KWayland6Client10SubSurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client10TouchPointE@Base 5.24.3-1 + _ZTIN8KWayland6Client11BlurManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client11DDEKeyboardE@Base 5.24.3-1 + _ZTIN8KWayland6Client11DpmsManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client11IdleTimeoutE@Base 5.24.3-1 + _ZTIN8KWayland6Client11PlasmaShellE@Base 5.24.3-1 + _ZTIN8KWayland6Client11XdgExportedE@Base 5.24.3-1 + _ZTIN8KWayland6Client11XdgExporterE@Base 5.24.3-1 + _ZTIN8KWayland6Client11XdgImportedE@Base 5.24.3-1 + _ZTIN8KWayland6Client11XdgImporterE@Base 5.24.3-1 + _ZTIN8KWayland6Client12OutputDeviceE@Base 5.24.3-1 + _ZTIN8KWayland6Client12PlasmaWindowE@Base 5.24.3-1 + _ZTIN8KWayland6Client12RemoteBufferE@Base 5.24.3-1 + _ZTIN8KWayland6Client12ShellSurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client12SlideManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client13IdleInhibitorE@Base 5.24.3-1 + _ZTIN8KWayland6Client13LockedPointerE@Base 5.24.3-1 + _ZTIN8KWayland6Client13ShadowManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client13SubCompositorE@Base 5.24.3-1 + _ZTIN8KWayland6Client13XdgDecorationE@Base 5.24.3-1 + _ZTIN8KWayland6Client13XdgShellPopupE@Base 5.24.3-1 + _ZTIN8KWayland6Client14AppMenuManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client15ConfinedPointerE@Base 5.24.3-1 + _ZTIN8KWayland6Client15ContrastManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client15DDEShellSurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client15FullscreenShellE@Base 5.24.3-1 + _ZTIN8KWayland6Client15PointerGesturesE@Base 5.24.3-1 + _ZTIN8KWayland6Client15RelativePointerE@Base 5.24.3-1 + _ZTIN8KWayland6Client15XdgShellSurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client16ClientManagementE@Base 5.24.3-1 + _ZTIN8KWayland6Client16ConnectionThreadE@Base 5.24.3-1 + _ZTIN8KWayland6Client16OutputManagementE@Base 5.24.3-1 + _ZTIN8KWayland6Client16PlasmaActivationE@Base 5.24.3-1 + _ZTIN8KWayland6Client16TextInputManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client16XdgOutputManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client17DataDeviceManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client17PlasmaWindowModelE@Base 5.24.3-1 + _ZTIN8KWayland6Client18IdleInhibitManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client18PlasmaShellSurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client18PointerConstraintsE@Base 5.24.3-1 + _ZTIN8KWayland6Client19OutputConfigurationE@Base 5.24.3-1 + _ZTIN8KWayland6Client19PointerPinchGestureE@Base 5.24.3-1 + _ZTIN8KWayland6Client19PointerSwipeGestureE@Base 5.24.3-1 + _ZTIN8KWayland6Client19RemoteAccessManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client20PlasmaVirtualDesktopE@Base 5.24.3-1 + _ZTIN8KWayland6Client20ServerSideDecorationE@Base 5.24.3-1 + _ZTIN8KWayland6Client20XdgDecorationManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client22PlasmaWindowManagementE@Base 5.24.3-1 + _ZTIN8KWayland6Client22RelativePointerManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client24PlasmaActivationFeedbackE@Base 5.24.3-1 + _ZTIN8KWayland6Client27ServerSideDecorationManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client27ServerSideDecorationPaletteE@Base 5.24.3-1 + _ZTIN8KWayland6Client30PlasmaVirtualDesktopManagementE@Base 5.24.3-1 + _ZTIN8KWayland6Client34ServerSideDecorationPaletteManagerE@Base 5.24.3-1 + _ZTIN8KWayland6Client4BlurE@Base 5.24.3-1 + _ZTIN8KWayland6Client4DpmsE@Base 5.24.3-1 + _ZTIN8KWayland6Client4IdleE@Base 5.24.3-1 + _ZTIN8KWayland6Client4SeatE@Base 5.24.3-1 + _ZTIN8KWayland6Client5ShellE@Base 5.24.3-1 + _ZTIN8KWayland6Client5SlideE@Base 5.24.3-1 + _ZTIN8KWayland6Client5StrutE@Base 5.24.3-1 + _ZTIN8KWayland6Client5TouchE@Base 5.24.3-1 + _ZTIN8KWayland6Client6OutputE@Base 5.24.3-1 + _ZTIN8KWayland6Client6RegionE@Base 5.24.3-1 + _ZTIN8KWayland6Client6ShadowE@Base 5.24.3-1 + _ZTIN8KWayland6Client7AppMenuE@Base 5.24.3-1 + _ZTIN8KWayland6Client7DDESeatE@Base 5.24.3-1 + _ZTIN8KWayland6Client7PointerE@Base 5.24.3-1 + _ZTIN8KWayland6Client7ShmPoolE@Base 5.24.3-1 + _ZTIN8KWayland6Client7SurfaceE@Base 5.24.3-1 + _ZTIN8KWayland6Client8ContrastE@Base 5.24.3-1 + _ZTIN8KWayland6Client8DDEShellE@Base 5.24.3-1 + _ZTIN8KWayland6Client8DDETouchE@Base 5.24.3-1 + _ZTIN8KWayland6Client8KeyboardE@Base 5.24.3-1 + _ZTIN8KWayland6Client8KeystateE@Base 5.24.3-1 + _ZTIN8KWayland6Client8RegistryE@Base 5.24.3-1 + _ZTIN8KWayland6Client8XdgShellE@Base 5.24.3-1 + _ZTIN8KWayland6Client9DataOfferE@Base 5.24.3-1 + _ZTIN8KWayland6Client9FakeInputE@Base 5.24.3-1 + _ZTIN8KWayland6Client9TextInputE@Base 5.24.3-1 + _ZTIN8KWayland6Client9XdgOutputE@Base 5.24.3-1 + _ZTSN8KWayland6Client10CompositorE@Base 5.24.3-1 + _ZTSN8KWayland6Client10DDEPointerE@Base 5.24.3-1 + _ZTSN8KWayland6Client10DataDeviceE@Base 5.24.3-1 + _ZTSN8KWayland6Client10DataSourceE@Base 5.24.3-1 + _ZTSN8KWayland6Client10EventQueueE@Base 5.24.3-1 + _ZTSN8KWayland6Client10SubSurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client10TouchPointE@Base 5.24.3-1 + _ZTSN8KWayland6Client11BlurManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client11DDEKeyboardE@Base 5.24.3-1 + _ZTSN8KWayland6Client11DpmsManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client11IdleTimeoutE@Base 5.24.3-1 + _ZTSN8KWayland6Client11PlasmaShellE@Base 5.24.3-1 + _ZTSN8KWayland6Client11XdgExportedE@Base 5.24.3-1 + _ZTSN8KWayland6Client11XdgExporterE@Base 5.24.3-1 + _ZTSN8KWayland6Client11XdgImportedE@Base 5.24.3-1 + _ZTSN8KWayland6Client11XdgImporterE@Base 5.24.3-1 + _ZTSN8KWayland6Client12OutputDeviceE@Base 5.24.3-1 + _ZTSN8KWayland6Client12PlasmaWindowE@Base 5.24.3-1 + _ZTSN8KWayland6Client12RemoteBufferE@Base 5.24.3-1 + _ZTSN8KWayland6Client12ShellSurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client12SlideManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client13IdleInhibitorE@Base 5.24.3-1 + _ZTSN8KWayland6Client13LockedPointerE@Base 5.24.3-1 + _ZTSN8KWayland6Client13ShadowManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client13SubCompositorE@Base 5.24.3-1 + _ZTSN8KWayland6Client13XdgDecorationE@Base 5.24.3-1 + _ZTSN8KWayland6Client13XdgShellPopupE@Base 5.24.3-1 + _ZTSN8KWayland6Client14AppMenuManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client15ConfinedPointerE@Base 5.24.3-1 + _ZTSN8KWayland6Client15ContrastManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client15DDEShellSurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client15FullscreenShellE@Base 5.24.3-1 + _ZTSN8KWayland6Client15PointerGesturesE@Base 5.24.3-1 + _ZTSN8KWayland6Client15RelativePointerE@Base 5.24.3-1 + _ZTSN8KWayland6Client15XdgShellSurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client16ClientManagementE@Base 5.24.3-1 + _ZTSN8KWayland6Client16ConnectionThreadE@Base 5.24.3-1 + _ZTSN8KWayland6Client16OutputManagementE@Base 5.24.3-1 + _ZTSN8KWayland6Client16PlasmaActivationE@Base 5.24.3-1 + _ZTSN8KWayland6Client16TextInputManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client16XdgOutputManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client17DataDeviceManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client17PlasmaWindowModelE@Base 5.24.3-1 + _ZTSN8KWayland6Client18IdleInhibitManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client18PlasmaShellSurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client18PointerConstraintsE@Base 5.24.3-1 + _ZTSN8KWayland6Client19OutputConfigurationE@Base 5.24.3-1 + _ZTSN8KWayland6Client19PointerPinchGestureE@Base 5.24.3-1 + _ZTSN8KWayland6Client19PointerSwipeGestureE@Base 5.24.3-1 + _ZTSN8KWayland6Client19RemoteAccessManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client20PlasmaVirtualDesktopE@Base 5.24.3-1 + _ZTSN8KWayland6Client20ServerSideDecorationE@Base 5.24.3-1 + _ZTSN8KWayland6Client20XdgDecorationManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client22PlasmaWindowManagementE@Base 5.24.3-1 + _ZTSN8KWayland6Client22RelativePointerManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client24PlasmaActivationFeedbackE@Base 5.24.3-1 + _ZTSN8KWayland6Client27ServerSideDecorationManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client27ServerSideDecorationPaletteE@Base 5.24.3-1 + _ZTSN8KWayland6Client30PlasmaVirtualDesktopManagementE@Base 5.24.3-1 + _ZTSN8KWayland6Client34ServerSideDecorationPaletteManagerE@Base 5.24.3-1 + _ZTSN8KWayland6Client4BlurE@Base 5.24.3-1 + _ZTSN8KWayland6Client4DpmsE@Base 5.24.3-1 + _ZTSN8KWayland6Client4IdleE@Base 5.24.3-1 + _ZTSN8KWayland6Client4SeatE@Base 5.24.3-1 + _ZTSN8KWayland6Client5ShellE@Base 5.24.3-1 + _ZTSN8KWayland6Client5SlideE@Base 5.24.3-1 + _ZTSN8KWayland6Client5StrutE@Base 5.24.3-1 + _ZTSN8KWayland6Client5TouchE@Base 5.24.3-1 + _ZTSN8KWayland6Client6OutputE@Base 5.24.3-1 + _ZTSN8KWayland6Client6RegionE@Base 5.24.3-1 + _ZTSN8KWayland6Client6ShadowE@Base 5.24.3-1 + _ZTSN8KWayland6Client7AppMenuE@Base 5.24.3-1 + _ZTSN8KWayland6Client7DDESeatE@Base 5.24.3-1 + _ZTSN8KWayland6Client7PointerE@Base 5.24.3-1 + _ZTSN8KWayland6Client7ShmPoolE@Base 5.24.3-1 + _ZTSN8KWayland6Client7SurfaceE@Base 5.24.3-1 + _ZTSN8KWayland6Client8ContrastE@Base 5.24.3-1 + _ZTSN8KWayland6Client8DDEShellE@Base 5.24.3-1 + _ZTSN8KWayland6Client8DDETouchE@Base 5.24.3-1 + _ZTSN8KWayland6Client8KeyboardE@Base 5.24.3-1 + _ZTSN8KWayland6Client8KeystateE@Base 5.24.3-1 + _ZTSN8KWayland6Client8RegistryE@Base 5.24.3-1 + _ZTSN8KWayland6Client8XdgShellE@Base 5.24.3-1 + _ZTSN8KWayland6Client9DataOfferE@Base 5.24.3-1 + _ZTSN8KWayland6Client9FakeInputE@Base 5.24.3-1 + _ZTSN8KWayland6Client9TextInputE@Base 5.24.3-1 + _ZTSN8KWayland6Client9XdgOutputE@Base 5.24.3-1 + _ZTVN8KWayland6Client10CompositorE@Base 5.24.3-1 + _ZTVN8KWayland6Client10DDEPointerE@Base 5.24.3-1 + _ZTVN8KWayland6Client10DataDeviceE@Base 5.24.3-1 + _ZTVN8KWayland6Client10DataSourceE@Base 5.24.3-1 + _ZTVN8KWayland6Client10EventQueueE@Base 5.24.3-1 + _ZTVN8KWayland6Client10SubSurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client10TouchPointE@Base 5.24.3-1 + _ZTVN8KWayland6Client11BlurManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client11DDEKeyboardE@Base 5.24.3-1 + _ZTVN8KWayland6Client11DpmsManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client11IdleTimeoutE@Base 5.24.3-1 + _ZTVN8KWayland6Client11PlasmaShellE@Base 5.24.3-1 + _ZTVN8KWayland6Client11XdgExportedE@Base 5.24.3-1 + _ZTVN8KWayland6Client11XdgExporterE@Base 5.24.3-1 + _ZTVN8KWayland6Client11XdgImportedE@Base 5.24.3-1 + _ZTVN8KWayland6Client11XdgImporterE@Base 5.24.3-1 + _ZTVN8KWayland6Client12OutputDeviceE@Base 5.24.3-1 + _ZTVN8KWayland6Client12PlasmaWindowE@Base 5.24.3-1 + _ZTVN8KWayland6Client12RemoteBufferE@Base 5.24.3-1 + _ZTVN8KWayland6Client12ShellSurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client12SlideManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client13IdleInhibitorE@Base 5.24.3-1 + _ZTVN8KWayland6Client13LockedPointerE@Base 5.24.3-1 + _ZTVN8KWayland6Client13ShadowManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client13SubCompositorE@Base 5.24.3-1 + _ZTVN8KWayland6Client13XdgDecorationE@Base 5.24.3-1 + _ZTVN8KWayland6Client13XdgShellPopupE@Base 5.24.3-1 + _ZTVN8KWayland6Client14AppMenuManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client15ConfinedPointerE@Base 5.24.3-1 + _ZTVN8KWayland6Client15ContrastManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client15DDEShellSurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client15FullscreenShellE@Base 5.24.3-1 + _ZTVN8KWayland6Client15PointerGesturesE@Base 5.24.3-1 + _ZTVN8KWayland6Client15RelativePointerE@Base 5.24.3-1 + _ZTVN8KWayland6Client15XdgShellSurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client16ClientManagementE@Base 5.24.3-1 + _ZTVN8KWayland6Client16ConnectionThreadE@Base 5.24.3-1 + _ZTVN8KWayland6Client16OutputManagementE@Base 5.24.3-1 + _ZTVN8KWayland6Client16PlasmaActivationE@Base 5.24.3-1 + _ZTVN8KWayland6Client16TextInputManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client16XdgOutputManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client17DataDeviceManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client17PlasmaWindowModelE@Base 5.24.3-1 + _ZTVN8KWayland6Client18IdleInhibitManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client18PlasmaShellSurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client18PointerConstraintsE@Base 5.24.3-1 + _ZTVN8KWayland6Client19OutputConfigurationE@Base 5.24.3-1 + _ZTVN8KWayland6Client19PointerPinchGestureE@Base 5.24.3-1 + _ZTVN8KWayland6Client19PointerSwipeGestureE@Base 5.24.3-1 + _ZTVN8KWayland6Client19RemoteAccessManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client20PlasmaVirtualDesktopE@Base 5.24.3-1 + _ZTVN8KWayland6Client20ServerSideDecorationE@Base 5.24.3-1 + _ZTVN8KWayland6Client20XdgDecorationManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client22PlasmaWindowManagementE@Base 5.24.3-1 + _ZTVN8KWayland6Client22RelativePointerManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client24PlasmaActivationFeedbackE@Base 5.24.3-1 + _ZTVN8KWayland6Client27ServerSideDecorationManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client27ServerSideDecorationPaletteE@Base 5.24.3-1 + _ZTVN8KWayland6Client30PlasmaVirtualDesktopManagementE@Base 5.24.3-1 + _ZTVN8KWayland6Client34ServerSideDecorationPaletteManagerE@Base 5.24.3-1 + _ZTVN8KWayland6Client4BlurE@Base 5.24.3-1 + _ZTVN8KWayland6Client4DpmsE@Base 5.24.3-1 + _ZTVN8KWayland6Client4IdleE@Base 5.24.3-1 + _ZTVN8KWayland6Client4SeatE@Base 5.24.3-1 + _ZTVN8KWayland6Client5ShellE@Base 5.24.3-1 + _ZTVN8KWayland6Client5SlideE@Base 5.24.3-1 + _ZTVN8KWayland6Client5StrutE@Base 5.24.3-1 + _ZTVN8KWayland6Client5TouchE@Base 5.24.3-1 + _ZTVN8KWayland6Client6OutputE@Base 5.24.3-1 + _ZTVN8KWayland6Client6RegionE@Base 5.24.3-1 + _ZTVN8KWayland6Client6ShadowE@Base 5.24.3-1 + _ZTVN8KWayland6Client7AppMenuE@Base 5.24.3-1 + _ZTVN8KWayland6Client7DDESeatE@Base 5.24.3-1 + _ZTVN8KWayland6Client7PointerE@Base 5.24.3-1 + _ZTVN8KWayland6Client7ShmPoolE@Base 5.24.3-1 + _ZTVN8KWayland6Client7SurfaceE@Base 5.24.3-1 + _ZTVN8KWayland6Client8ContrastE@Base 5.24.3-1 + _ZTVN8KWayland6Client8DDEShellE@Base 5.24.3-1 + _ZTVN8KWayland6Client8DDETouchE@Base 5.24.3-1 + _ZTVN8KWayland6Client8KeyboardE@Base 5.24.3-1 + _ZTVN8KWayland6Client8KeystateE@Base 5.24.3-1 + _ZTVN8KWayland6Client8RegistryE@Base 5.24.3-1 + _ZTVN8KWayland6Client8XdgShellE@Base 5.24.3-1 + _ZTVN8KWayland6Client9DataOfferE@Base 5.24.3-1 + _ZTVN8KWayland6Client9FakeInputE@Base 5.24.3-1 + _ZTVN8KWayland6Client9TextInputE@Base 5.24.3-1 + _ZTVN8KWayland6Client9XdgOutputE@Base 5.24.3-1 + _wl_fullscreen_shell_interface@Base 5.24.3-1 + _wl_fullscreen_shell_mode_feedback_interface@Base 5.24.3-1 + com_deepin_client_management_interface@Base 5.24.3-1 + com_deepin_kwin_strut_interface@Base 5.24.3-1 + dde_keyboard_interface@Base 5.24.3-1 + dde_pointer_interface@Base 5.24.3-1 + dde_seat_interface@Base 5.24.3-1 + dde_shell_interface@Base 5.24.3-1 + dde_shell_surface_interface@Base 5.24.3-1 + dde_touch_interface@Base 5.24.3-1 + org_kde_kwin_appmenu_interface@Base 5.24.3-1 + org_kde_kwin_appmenu_manager_interface@Base 5.24.3-1 + org_kde_kwin_blur_interface@Base 5.24.3-1 + org_kde_kwin_blur_manager_interface@Base 5.24.3-1 + org_kde_kwin_contrast_interface@Base 5.24.3-1 + org_kde_kwin_contrast_manager_interface@Base 5.24.3-1 + org_kde_kwin_dpms_interface@Base 5.24.3-1 + org_kde_kwin_dpms_manager_interface@Base 5.24.3-1 + org_kde_kwin_fake_input_interface@Base 5.24.3-1 + org_kde_kwin_idle_interface@Base 5.24.3-1 + org_kde_kwin_idle_timeout_interface@Base 5.24.3-1 + org_kde_kwin_keystate_interface@Base 5.24.3-1 + org_kde_kwin_outputconfiguration_interface@Base 5.24.3-1 + org_kde_kwin_outputdevice_interface@Base 5.24.3-1 + org_kde_kwin_outputmanagement_interface@Base 5.24.3-1 + org_kde_kwin_remote_access_manager_interface@Base 5.24.3-1 + org_kde_kwin_remote_buffer_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_manager_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_palette_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_palette_manager_interface@Base 5.24.3-1 + org_kde_kwin_shadow_interface@Base 5.24.3-1 + org_kde_kwin_shadow_manager_interface@Base 5.24.3-1 + org_kde_kwin_slide_interface@Base 5.24.3-1 + org_kde_kwin_slide_manager_interface@Base 5.24.3-1 + org_kde_plasma_activation_feedback_interface@Base 5.24.3-1 + org_kde_plasma_activation_interface@Base 5.24.3-1 + org_kde_plasma_shell_interface@Base 5.24.3-1 + org_kde_plasma_surface_interface@Base 5.24.3-1 + org_kde_plasma_virtual_desktop_interface@Base 5.24.3-1 + org_kde_plasma_virtual_desktop_management_interface@Base 5.24.3-1 + org_kde_plasma_window_interface@Base 5.24.3-1 + org_kde_plasma_window_management_interface@Base 5.24.3-1 + wl_text_input_interface@Base 5.24.3-1 + wl_text_input_manager_interface@Base 5.24.3-1 + xdg_popup_interface@Base 5.24.3-1 + xdg_positioner_interface@Base 5.24.3-1 + xdg_surface_interface@Base 5.24.3-1 + xdg_toplevel_interface@Base 5.24.3-1 + xdg_wm_base_interface@Base 5.24.3-1 + zwp_confined_pointer_v1_interface@Base 5.24.3-1 + zwp_idle_inhibit_manager_v1_interface@Base 5.24.3-1 + zwp_idle_inhibitor_v1_interface@Base 5.24.3-1 + zwp_locked_pointer_v1_interface@Base 5.24.3-1 + zwp_pointer_constraints_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_hold_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_pinch_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_swipe_v1_interface@Base 5.24.3-1 + zwp_pointer_gestures_v1_interface@Base 5.24.3-1 + zwp_relative_pointer_manager_v1_interface@Base 5.24.3-1 + zwp_relative_pointer_v1_interface@Base 5.24.3-1 + zwp_text_input_manager_v2_interface@Base 5.24.3-1 + zwp_text_input_v2_interface@Base 5.24.3-1 + zxdg_decoration_manager_v1_interface@Base 5.24.3-1 + zxdg_exported_v2_interface@Base 5.24.3-1 + zxdg_exporter_v2_interface@Base 5.24.3-1 + zxdg_imported_v2_interface@Base 5.24.3-1 + zxdg_importer_v2_interface@Base 5.24.3-1 + zxdg_output_manager_v1_interface@Base 5.24.3-1 + zxdg_output_v1_interface@Base 5.24.3-1 + zxdg_popup_v5_interface@Base 5.24.3-1 + zxdg_popup_v6_interface@Base 5.24.3-1 + zxdg_positioner_v6_interface@Base 5.24.3-1 + zxdg_shell_v5_interface@Base 5.24.3-1 + zxdg_shell_v6_interface@Base 5.24.3-1 + zxdg_surface_v5_interface@Base 5.24.3-1 + zxdg_surface_v6_interface@Base 5.24.3-1 + zxdg_toplevel_decoration_v1_interface@Base 5.24.3-1 + zxdg_toplevel_v6_interface@Base 5.24.3-1 \ No newline at end of file diff -Nru dwayland-5.57.0.23/debian/libdwayland-dev.acc.in dwayland-5.57.0.24+really5.24.3/debian/libdwayland-dev.acc.in --- dwayland-5.57.0.23/debian/libdwayland-dev.acc.in 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwayland-dev.acc.in 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,21 @@ + + + + + 5.2.0 + + + + /usr/include/DWayland/ + + + + /usr/lib/@@DEB_HOST_MULTIARCH@@/libDWaylandClient.so + /usr/lib/@@DEB_HOST_MULTIARCH@@/libDWaylandServer.so + + + + -fPIC + + + diff -Nru dwayland-5.57.0.23/debian/libdwayland-dev.install dwayland-5.57.0.24+really5.24.3/debian/libdwayland-dev.install --- dwayland-5.57.0.23/debian/libdwayland-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwayland-dev.install 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,8 @@ +usr/include/DWayland/ +usr/include/dwayland_version.h +usr/lib/*/cmake/DWayland/ +usr/lib/*/libDWaylandClient.so +usr/lib/*/libDWaylandServer.so +#usr/lib/*/libexec/org-kde-kf5-kwayland-testserver +usr/lib/*/qt5/mkspecs/modules/qt_DWaylandClient.pri +#usr/lib/*/qt5/mkspecs/modules/qt_DWaylandServer.pri \ No newline at end of file diff -Nru dwayland-5.57.0.23/debian/libdwayland-doc.install dwayland-5.57.0.24+really5.24.3/debian/libdwayland-doc.install --- dwayland-5.57.0.23/debian/libdwayland-doc.install 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwayland-doc.install 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,2 @@ +usr/share/qt5/doc/DWayland.qch +usr/share/qt5/doc/DWayland.tags diff -Nru dwayland-5.57.0.23/debian/libdwaylandserver5.install dwayland-5.57.0.24+really5.24.3/debian/libdwaylandserver5.install --- dwayland-5.57.0.23/debian/libdwaylandserver5.install 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwaylandserver5.install 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,3 @@ +usr/lib/*/libDWaylandServer.so.5 +usr/lib/*/libDWaylandServer.so.5.* +#usr/share/qlogging-categories5/dwayland.categories diff -Nru dwayland-5.57.0.23/debian/libdwaylandserver5.symbols dwayland-5.57.0.24+really5.24.3/debian/libdwaylandserver5.symbols --- dwayland-5.57.0.23/debian/libdwaylandserver5.symbols 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libdwaylandserver5.symbols 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,2582 @@ +# SymbolsHelper-Confirmed: 4:5.74.0 amd64 +libDWaylandServer.so.5 libdwaylandserver5 #MINVER# + _ZN14KWaylandServer12ClientBuffer10initializeEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer15markAsDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer3refEv@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBuffer5unrefEv@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferC1EP11wl_resourceRNS_19ClientBufferPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferC1ERNS_19ClientBufferPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferC2EP11wl_resourceRNS_19ClientBufferPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferC2ERNS_19ClientBufferPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer12ClientBufferD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterface6regionEv@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterfaceC1EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterfaceC2EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer13BlurInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface16inhibitedChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface20simulateUserActivityEv@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface7inhibitEv@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterface9uninhibitEv@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer13IdleInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface10touchMovedEijRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11dragDroppedEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11dragStartedEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11nameChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface11setHasTouchEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface12setSelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface12setTimestampEj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface13notifyTouchUpEi@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface13setDragTargetEPNS_19AbstractDropHandlerEPNS_16SurfaceInterfaceERK10QMatrix4x4@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface13setDragTargetEPNS_19AbstractDropHandlerEPNS_16SurfaceInterfaceERK7QPointFRK10QMatrix4x4@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface13setHasPointerEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface14setHasKeyboardEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface15hasTouchChangedEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface15notifyTouchDownEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface16notifyTouchFrameEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface16selectionChangedEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface16timestampChangedEj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17hasPointerChangedEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17notifyKeyboardKeyEjNS_16KeyboardKeyStateE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17notifyPointerAxisEN2Qt11OrientationEdiNS_17PointerAxisSourceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17notifyTouchCancelEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17notifyTouchMotionEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface17pointerPosChangedERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface18dragSurfaceChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface18hasKeyboardChangedEb@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface18notifyPointerFrameEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface19notifyPointerButtonEN2Qt11MouseButtonENS_18PointerButtonStateE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface19notifyPointerButtonEjNS_18PointerButtonStateE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface19notifyPointerMotionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface19setPrimarySelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface21endPointerHoldGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface21relativePointerMotionERK6QSizeFS3_y@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface22endPointerPinchGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface22endPointerSwipeGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface22setFocusedTouchSurfaceEPNS_16SurfaceInterfaceERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface23notifyKeyboardModifiersEjjjj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface23primarySelectionChangedEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface23startPointerHoldGestureEj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface24cancelPointerHoldGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface24setFocusedPointerSurfaceEPNS_16SurfaceInterfaceERK10QMatrix4x4@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface24setFocusedPointerSurfaceEPNS_16SurfaceInterfaceERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface24startPointerPinchGestureEj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface24startPointerSwipeGestureEj@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25cancelPointerPinchGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25cancelPointerSwipeGestureEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25notifyPointerAxisToClientEN2Qt11OrientationEiPNS_16SurfaceInterfaceE10QMatrix4x4@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25setFocusedKeyboardSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25updatePointerPinchGestureERK6QSizeFdd@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface25updatePointerSwipeGestureERK6QSizeF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface26setFocusedTextInputSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface30focusedTextInputSurfaceChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface30setFocusedTouchSurfacePositionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface32setFocusedPointerSurfacePositionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface38setFocusedPointerSurfaceTransformationERK10QMatrix4x4@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface7setNameERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface9dragEndedEv@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterface9startDragEPNS_18AbstractDataSourceEPNS_16SurfaceInterfaceEiPNS_15DragAndDropIconE@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer13SeatInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositioner3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC1ERK18QSharedDataPointerINS_17XdgPositionerDataEE@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC1ERKS0_@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC1Ev@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC2ERK18QSharedDataPointerINS_17XdgPositionerDataEE@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC2ERKS0_@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerC2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositionerD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer13XdgPositioneraSERKS0_@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterfaceC1EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterfaceC2EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer14SlideInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterface8setStrutEPNS_16SurfaceInterfaceERNS_15deepinKwinStrutE@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer14StrutInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV211qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV211qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV216staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV27changedEv@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV2C1Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV2C2Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV2D0Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV2D1Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TabletCursorV2D2Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface10sendCancelEv@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface10sendMotionEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface17setFocusedSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface6sendUpEij@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface8sendDownEijRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterface9sendFrameEv@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterfaceC1EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterfaceC2EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer14TouchInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIcon11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIcon11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIcon16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIconC1EPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIconC2EPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIconD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIconD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer15DragAndDropIconD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15DrmClientBuffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15DrmClientBuffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15DrmClientBuffer16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15DrmClientBufferC1EP11wl_resourcePNS_26DrmClientBufferIntegrationE@Base 5.24.3-1 + _ZN14KWaylandServer15DrmClientBufferC2EP11wl_resourcePNS_26DrmClientBufferIntegrationE@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice16touchUpRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice17setAuthenticationEb@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice18touchDownRequestedEjRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice19touchFrameRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice20pointerAxisRequestedEN2Qt11OrientationEd@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice20touchCancelRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice20touchMotionRequestedEjRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice22pointerMotionRequestedERK6QSizeF@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice23authenticationRequestedERK7QStringS3_@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice25keyboardKeyPressRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice27keyboardKeyReleaseRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice27pointerButtonPressRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice29pointerButtonReleaseRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice30pointerAxisRequestedForCaptureEN2Qt11OrientationEd@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice30pointerMotionAbsoluteRequestedERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDevice8resourceEv@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDeviceC1EPNS_18FakeInputInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDeviceC2EPNS_18FakeInputInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDeviceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDeviceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer15FakeInputDeviceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplay11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplay11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplay16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplayC1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplayC2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplayD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplayD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer15FilteredDisplayD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface11modeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface11setDpmsModeENS0_8DpmsModeE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface11setSubPixelENS0_8SubPixelE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface12modelChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface12scaleChangedEi@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface12setTransformENS0_9TransformE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface15dpmsModeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface15setManufacturerERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface15setPhysicalSizeERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface15subPixelChangedENS0_8SubPixelE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface16pixelSizeChangedERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface16setDpmsSupportedEb@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface16transformChangedENS0_9TransformE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface17dpmsModeRequestedENS0_8DpmsModeE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface17setGlobalPositionERK6QPoint@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface18refreshRateChangedEi@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface19manufacturerChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface19physicalSizeChangedERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface20dpmsSupportedChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface21globalPositionChangedERK6QPoint@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface4doneEP9wl_client@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface4doneEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface5boundEPNS_16ClientConnectionEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface6removeEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface7removedEv@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface7setModeERK5QSizei@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface7setModeERKNS0_4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface8setModelERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterface8setScaleEi@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer15OutputInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterfaceC1EPNS_22ShadowManagerInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterfaceC2EPNS_22ShadowManagerInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer15ShadowInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer15ShmClientBuffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer15ShmClientBuffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer15ShmClientBuffer16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer15ShmClientBufferC1EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer15ShmClientBufferC2EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterface14addressChangedENS0_16InterfaceAddressE@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterfaceC1EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterfaceC2EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer16AppMenuInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection12disconnectedEPS0_@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection5flushEv@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnection7destroyEv@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectionC1EP9wl_clientPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectionC2EP9wl_clientPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectionD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectionD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectionD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer16ClientConnectioncvP9wl_clientEv@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface10keyPressedEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11keyReleasedEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11pointerAxisEN2Qt11OrientationEi@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11setHasTouchEb@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface11touchMotionEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface12setTimestampEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface13setHasPointerEb@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface13setPointerPosERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface14setHasKeyboardEb@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface15ddeTouchCreatedEPNS_17DDETouchInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface17ddePointerCreatedEPNS_19DDEPointerInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface17pointerPosChangedERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface17setTouchTimestampEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface18ddeKeyboardCreatedEPNS_20DDEKeyboardInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface20pointerButtonPressedEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface21pointerButtonReleasedEj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface23updateKeyboardModifiersEjjjj@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface7touchUpEi@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface9setKeymapEij@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterface9touchDownEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer16DDESeatInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface10sendButtonEjNS_18PointerButtonStateEj@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface10sendMotionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface13cursorChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface17setFocusedSurfaceEPNS_16SurfaceInterfaceERK7QPointFj@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface21focusedSurfaceChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface8sendAxisEN2Qt11OrientationEdiNS_17PointerAxisSourceE@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterface9sendFrameEv@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterfaceC1EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterfaceC2EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer16PointerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface10setOutputsERK7QVectorIPNS_15OutputInterfaceEE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface11blurChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface11sizeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface12inputChangedERK7QRegion@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface13frameRenderedEj@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface13opaqueChangedERK7QRegion@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface13shadowChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface14inputSurfaceAtERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface15contrastChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface17bufferSizeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface18bufferScaleChangedEi@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface19inhibitsIdleChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface20childSubSurfaceAddedEPNS_19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface22bufferTransformChangedENS_15OutputInterface9TransformE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface22childSubSurfaceRemovedEPNS_19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface22slideOnShowHideChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface23childSubSurfacesChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface25pointerConstraintsChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface28surfaceToBufferMatrixChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface3getEjPKNS_16ClientConnectionE@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface6mappedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface7damagedERK7QRegion@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface8unmappedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface9committedEv@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterface9surfaceAtERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterfaceC1EPNS_19CompositorInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterfaceC2EPNS_19CompositorInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer16SurfaceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterfaceC1EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterfaceC2EP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17ContrastInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterface19shellSurfaceCreatedEPNS_24DDEShellSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDEShellInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface11touchMotionEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface7touchUpEi@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterface9touchDownEiRK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterfaceC1EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterfaceC2EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17DDETouchInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV110sendKeymapERK10QByteArray@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV111qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV111qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV113sendModifiersEjjjjj@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV116staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV17sendKeyEjjjNS_16KeyboardKeyStateE@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV1C1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV1C2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV1D0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV1D1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17InputMethodGrabV1D2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterface8setStateENS0_3KeyENS0_5StateE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyStateInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface13sendModifiersEjjjj@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface13setRepeatInfoEii@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface17setFocusedSurfaceEPNS_16SurfaceInterfaceEj@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface7sendKeyEjNS_16KeyboardKeyStateE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterface9setKeymapERK10QByteArray@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterfaceC1EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterfaceC2EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17KeyboardInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV211qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV211qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV216staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV2C1EPNS_23OutputDeviceV2InterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV2C2EPNS_23OutputDeviceV2InterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV2D0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV2D1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17OutputChangeSetV2D2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2InterfaceC1EjjRK7QStringRK11QStringListP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2InterfaceC2EjjRK7QStringRK11QStringListP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17TabletV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface13grabRequestedEPNS_13SeatInterfaceEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface13sendConfigureERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface13sendPopupDoneEv@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface16sendRepositionedEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface19initializeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface19repositionRequestedEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterfaceC1EPNS_19XdgSurfaceInterfaceEPNS_16SurfaceInterfaceERKNS_13XdgPositionerEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterfaceC2EPNS_19XdgSurfaceInterfaceEPNS_16SurfaceInterfaceERKNS_13XdgPositionerEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgPopupInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface11pingDelayedEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface11pingTimeoutEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface12pongReceivedEj@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface12popupCreatedEPNS_17XdgPopupInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface15toplevelCreatedEPNS_20XdgToplevelInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterface4pingEPNS_19XdgSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer17XdgShellInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource15mimeTypeOfferedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSource34supportedDragAndDropActionsChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSourceC1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer18AbstractDataSourceC2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface13sendAllOffersEv@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface17sendSourceActionsEv@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface25dragAndDropActionsChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterface9dndActionENS_26DataDeviceManagerInterface9DnDActionE@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterfaceC1EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterfaceC2EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer18DataOfferInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterface13deviceCreatedEPNS_15FakeInputDeviceE@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer18FakeInputInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19AbstractDropHandler11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19AbstractDropHandler11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19AbstractDropHandler16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19AbstractDropHandlerC1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19AbstractDropHandlerC2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterface14surfaceCreatedEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19CompositorInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface10sendMotionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface13buttonPressedEj@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface14buttonReleasedEj@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterface4axisEN2Qt11OrientationEi@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterfaceC1EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterfaceC2EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DDEPointerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface11dragStartedEPNS_18AbstractDataSourceEPNS_16SurfaceInterfaceEjPNS_15DragAndDropIconE@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface11updateProxyEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface13sendSelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface16selectionChangedEPNS_19DataSourceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface16selectionClearedEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface16updateDragTargetEPNS_16SurfaceInterfaceEj@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface18sendClearSelectionEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface4dropEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterface6clientEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterfaceC1EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterfaceC2EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataDeviceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface11dndFinishedEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface11requestDataERK7QStringi@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface11setAcceptedEb@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface12dndCancelledEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface13dropPerformedEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface6acceptERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface6cancelEv@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterface9dndActionENS_26DataDeviceManagerInterface9DnDActionE@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterfaceC1EPNS_26DataDeviceManagerInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterfaceC2EPNS_26DataDeviceManagerInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DataSourceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1Interface4denyEv@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1Interface5grantEij@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1InterfaceC1EPNS_32DrmLeaseDeviceV1InterfacePrivateEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1InterfaceC2EPNS_32DrmLeaseDeviceV1InterfacePrivateEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19DrmLeaseV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterface11modeChangedENS0_4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterface15positionChangedERK6QPoint@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterfaceC1EPNS_16SurfaceInterfaceES2_P11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterfaceC2EPNS_16SurfaceInterfaceES2_P11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19SubSurfaceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19ViewporterInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface13resetOccurredEv@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface21configureAcknowledgedEj@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface21windowGeometryChangedERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterfaceC1EPNS_17XdgShellInterfaceEPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterfaceC2EPNS_17XdgShellInterfaceEPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer19XdgSurfaceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterface6removeEv@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20BlurManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface10keyPressedEjj@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface10repeatInfoEii@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface11keyReleasedEjj@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface15updateModifiersEjjjjj@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterface9setKeymapEij@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterfaceC1EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterfaceC2EPNS_16DDESeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DDEKeyboardInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20DpmsManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterface14surfaceCreatedEPNS_27PlasmaShellSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20PlasmaShellInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20SeatInterfacePrivate3getEPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface10sendButtonEjjb@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface17setCurrentSurfaceEPNS_16SurfaceInterfaceEPNS_17TabletV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2Interface8feedbackEPNS_16ClientConnectionEjRK7QStringj@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2InterfaceC1ERK7QStringjjjjjPNS_7DisplayEPNS_21TabletSeatV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2InterfaceC2ERK7QStringjjjjjPNS_7DisplayEPNS_21TabletSeatV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TabletPadV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface11setLanguageERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface12commitStringERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface12stateUpdatedEjNS0_12UpdateReasonE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface13keysymPressedEjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface14enabledChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface14keysymReleasedEjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface14preEditStylingEjjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface15setModifiersMapERK10QByteArray@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface16setPreEditCursorEi@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface16setTextDirectionEN2Qt15LayoutDirectionE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface17setCursorPositionEii@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface18contentTypeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface18setInputPanelStateEbRK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface21deleteSurroundingTextEjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface21requestHideInputPanelEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface21requestShowInputPanelEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface22cursorRectangleChangedERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface22surroundingTextChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface24preferredLanguageChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2Interface7preEditERK7QStringS3_@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2InterfaceC1EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2InterfaceC2EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface12commitStringERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface14enabledChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface14stateCommittedEj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface17sendPreEditStringERK7QStringjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface18contentTypeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface21deleteSurroundingTextEjj@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface22cursorRectangleChangedERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface22surroundingTextChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3Interface4doneEv@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3InterfaceC1EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3InterfaceC2EPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20TextInputV3InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface14setDescriptionERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface14setLogicalSizeERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface18setLogicalPositionERK6QPoint@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface4doneEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1Interface7setNameERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1InterfaceC1EPNS_15OutputInterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1InterfaceC2EPNS_15OutputInterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgOutputV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface13moveRequestedEPNS_13SeatInterfaceEj@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface13resetOccurredEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface13sendConfigureERK5QSizeRK6QFlagsINS0_5StateEE@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface15resizeRequestedEPNS_13SeatInterfaceENS0_12ResizeAnchorEj@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface17maximizeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface17minimizeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface18maximumSizeChangedERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface18minimumSizeChangedERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface18windowClassChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface18windowTitleChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface19fullscreenRequestedEPNS_15OutputInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface19initializeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface19unmaximizeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface19windowMenuRequestedEPNS_13SeatInterfaceERK6QPointj@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface21unfullscreenRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface24parentXdgToplevelChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterface9sendCloseEv@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterfaceC1EPNS_19XdgSurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterfaceC2EPNS_19XdgSurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer20XdgToplevelInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1Interface22inputPanelSurfaceAddedEPNS_28InputPanelSurfaceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21InputPanelV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1Interface14surfaceCreatedEPNS_23LayerSurfaceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LayerShellV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1Feedback11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1Feedback11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1Feedback11setTranchesERK7QVectorINS0_7TrancheEE@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1Feedback16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1FeedbackC1EPNS_43LinuxDmaBufV1ClientBufferIntegrationPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1FeedbackC2EPNS_43LinuxDmaBufV1ClientBufferIntegrationPrivateE@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1FeedbackD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1FeedbackD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21LinuxDmaBufV1FeedbackD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface10setMovableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface11setGeometryERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface11setWindowIdEj@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12sendToOutputEPNS_15OutputInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setCloseableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setKeepAboveEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setKeepBelowEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setMaximizedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setMinimizedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setResizableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface12setShadeableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface13moveRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface13setFullscreenEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface14closeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface14setSkipTaskbarEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15activeRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15resizeRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15setMaximizeableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15setMinimizeableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15setParentWindowEPS0_@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15setSkipSwitcherEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface15shadedRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface16movableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface16setOnAllDesktopsEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface17addPlasmaActivityERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface17setFullscreenableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18closeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18keepAboveRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18keepBelowRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18maximizedRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18minimizedRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18resizableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface18shadeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface19fullscreenRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface19setDemandsAttentionEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface20removePlasmaActivityERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface20skipTaskbarRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface21maximizeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface21minimizeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface21skipSwitcherRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface23addPlasmaVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface23fullscreenableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface23setApplicationMenuPathsERK7QStringS3_@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface25demandsAttentionRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface26minimizedGeometriesChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface26removePlasmaVirtualDesktopERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface27setVirtualDesktopChangeableEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface28enterPlasmaActivityRequestedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface28leavePlasmaActivityRequestedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface33virtualDesktopChangeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface34enterPlasmaVirtualDesktopRequestedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface34leavePlasmaVirtualDesktopRequestedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface37enterNewPlasmaVirtualDesktopRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface5unmapEv@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface6setPidEj@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface7setIconERK5QIcon@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface8setAppIdERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface8setTitleERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface9setActiveEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterface9setShadedEb@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterfaceC1EPNS_31PlasmaWindowManagementInterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterfaceC2EPNS_31PlasmaWindowManagementInterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21PlasmaWindowInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface25outputScreencastRequestedEPNS_27ScreencastStreamV1InterfaceEPNS_15OutputInterfaceENS0_10CursorModeE@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface25windowScreencastRequestedEPNS_27ScreencastStreamV1InterfaceERK7QStringNS0_10CursorModeE@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1Interface32virtualOutputScreencastRequestedEPNS_27ScreencastStreamV1InterfaceERK7QStringRK5QSizedNS0_10CursorModeE@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21ScreencastV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterface6removeEv@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21SlideManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface12addTabletPadERK7QStringS3_RK11QStringListjjjjjPNS_17TabletV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface12removeDeviceERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface7addToolENS_21TabletToolV2Interface4TypeEyyRK7QVectorINS1_10CapabilityEE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2Interface9addTabletEjjRK7QStringS3_RK11QStringList@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletSeatV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface10sendButtonEjb@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface10sendMotionERK7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface10sendSliderEi@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface12sendDistanceEj@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface12sendPressureEj@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface12sendRotationEd@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface15sendProximityInEPNS_17TabletV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface16sendProximityOutEv@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface17setCurrentSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface6sendUpEv@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface8sendDownEv@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface8sendTiltEdd@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface9sendFrameEj@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2Interface9sendWheelEii@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2InterfaceC1EPNS_7DisplayENS0_4TypeEjjjjRK7QVectorINS0_10CapabilityEEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2InterfaceC2EPNS_7DisplayENS0_4TypeEjjjjRK7QVectorINS0_10CapabilityEEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21TabletToolV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2Interface12transientForEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2Interface16transientChangedEPNS_16SurfaceInterfaceES2_@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer21XdgForeignV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1Interface12sendActivateEv@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1Interface14sendDeactivateEv@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer22InputMethodV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer22ShadowManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterface17subSurfaceCreatedEPNS_19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer22SubCompositorInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterface14appMenuCreatedEPNS_16AppMenuInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterface17appMenuForSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer23AppMenuManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegration11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegration12createBufferEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegration16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegrationC1EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegrationC2EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegrationD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegrationD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer23ClientBufferIntegrationD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface10sendClosedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface12layerChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface13anchorChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface13sendConfigureERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface14marginsChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface18desiredSizeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface19acceptsFocusChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface20exclusiveZoneChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1Interface21configureAcknowledgedEj@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1InterfaceC1EPNS_21LayerShellV1InterfaceEPNS_16SurfaceInterfaceEPNS_15OutputInterfaceENS0_5LayerERK7QStringP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1InterfaceC2EPNS_21LayerShellV1InterfaceEPNS_16SurfaceInterfaceEPNS_15OutputInterfaceENS0_5LayerERK7QStringP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer23LayerSurfaceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface10setEnabledEb@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface11setOverscanEj@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface11setRgbRangeENS0_8RgbRangeE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface11setSubPixelENS0_8SubPixelE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface12setTransformENS0_9TransformE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface12setVrrPolicyENS0_9VrrPolicyE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface14setCurrentModeEPNS_27OutputDeviceModeV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface14setCurrentModeERK5QSizei@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface15setCapabilitiesE6QFlagsINS0_10CapabilityEE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface15setManufacturerERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface15setPhysicalSizeERK5QSize@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface15setSerialNumberERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface17setGlobalPositionERK6QPoint@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface6removeEv@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface7setEdidERK10QByteArray@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface7setNameERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface7setUuidERK5QUuid@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface8setModelERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface8setModesERK5QListIPNS_27OutputDeviceModeV2InterfaceEE@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface8setScaleEd@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2Interface9setEisaIdERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer23OutputDeviceV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterface6removeEv@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24ContrastManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface10setMovableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12sendGeometryERK5QRect@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setCloseableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setKeepAboveEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setKeepBelowEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setMaximizedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setMinimizedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface12setResizableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface13setFullscreenEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface14setAcceptFocusEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface15activeRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface15setMaximizeableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface15setMinimizeableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface16movableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface17modalityRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface17setFullscreenableEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18closeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18keepAboveRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18keepBelowRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18maximizedRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18minimizedRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface18resizableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface19activationRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface19fullscreenRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface20acceptFocusRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface21maximizeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface21minimizeableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface23fullscreenableRequestedEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface27noTitleBarPropertyRequestedEi@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface29windowRadiusPropertyRequestedE7QPointF@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface3getEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface8setModalEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterface9setActiveEb@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterfaceC1EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterfaceC2EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24DDEShellSurfaceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface13lockedChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface13regionChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface18aboutToBeDestroyedEv@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface25cursorPositionHintChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1Interface9setLockedEb@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1InterfaceC1ENS0_8LifeTimeERK7QRegionP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1InterfaceC2ENS0_8LifeTimeERK7QRegionP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24LockedPointerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1Interface16setPrimaryOutputERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24PrimaryOutputV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletManagerV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface10sendSourceENS0_6SourceE@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface8sendStopEv@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface9sendAngleEd@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2Interface9sendFrameEj@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2InterfaceC1EPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2InterfaceC2EPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24TabletPadRingV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1Interface17activateRequestedEPNS_16SurfaceInterfaceERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1Interface25setActivationTokenCreatorERKSt8functionIF7QStringPNS_16ClientConnectionEPNS_16SurfaceInterfaceEjPNS_13SeatInterfaceERKS2_EE@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer24XdgActivationV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface15setWindowStatesER5QListIPNS0_11WindowStateEE@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface17sendWindowCaptionEiP11wl_resourcePNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface19windowStatesChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface19windowStatesRequestEv@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface22sendWindowCaptionImageEiP11wl_resource6QImage@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface25captureWindowImageRequestEiP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer25ClientManagementInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface12leaseRevokedEPNS_19DrmLeaseV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface12setDrmMasterEb@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface14leaseRequestedEPNS_19DrmLeaseV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1InterfaceC1EPNS_7DisplayESt8functionIFivEE@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1InterfaceC2EPNS_7DisplayESt8functionIFivEE@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer25DrmLeaseDeviceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBuffer10initializeEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBuffer11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBuffer11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBuffer16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBufferC1ERK5QSizejjRK7QVectorINS_18LinuxDmaBufV1PlaneEE@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBufferC2ERK5QSizejjRK7QVectorINS_18LinuxDmaBufV1PlaneEE@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBufferD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBufferD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer25LinuxDmaBufV1ClientBufferD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2Interface14sendModeSwitchEjjj@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2InterfaceC1EjPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2InterfaceC2EjPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadGroupV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface10sendSourceENS0_6SourceE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface12sendPositionEj@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface8sendStopEv@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2Interface9sendFrameEj@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2InterfaceC1EPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2InterfaceC2EPNS_20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer25TabletPadStripV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface11setConfinedEb@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface13regionChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface15confinedChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1InterfaceC1ENS0_8LifeTimeERK7QRegionP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1InterfaceC2ENS0_8LifeTimeERK7QRegionP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer26ConfinedPointerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterface17dataDeviceCreatedEPNS_19DataDeviceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterface17dataSourceCreatedEPNS_19DataSourceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer26DataDeviceManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegration11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegration12createBufferEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegration16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegrationC1EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer26DrmClientBufferIntegrationC2EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer26PointerGesturesV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1Interface13sendAllOffersEv@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1InterfaceC1EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1InterfaceC2EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27DataControlOfferV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2Interface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2Interface8setFlagsE6QFlagsINS0_8ModeFlagEE@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2InterfaceC1ERK5QSizei6QFlagsINS0_8ModeFlagEEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2InterfaceC2ERK5QSizei6QFlagsINS0_8ModeFlagEEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputDeviceModeV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2Interface28configurationChangeRequestedEPNS_30OutputConfigurationV2InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27OutputManagementV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface11roleChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface15positionChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface16resetPositionSetEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface18skipTaskbarChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface19hideAutoHidingPanelEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface19showAutoHidingPanelEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface19skipSwitcherChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface20panelBehaviorChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface22panelTakesFocusChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface26panelAutoHideHideRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface26panelAutoHideShowRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterface3getEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterfaceC1EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterfaceC2EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27PlasmaShellSurfaceInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface10sendClosedEv@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface10sendFailedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface11sendCreatedEj@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1Interface8finishedEv@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1InterfaceC1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1InterfaceC2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27ScreencastStreamV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27TextInputManagerV3InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1Interface15createXdgOutputEPNS_15OutputInterfaceEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer27XdgOutputManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface13sendSelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface16selectionChangedEPNS_28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface16selectionClearedEv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface18sendClearSelectionEv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface20sendPrimarySelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface23primarySelectionChangedEPNS_28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1Interface25sendClearPrimarySelectionEv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1InterfaceC1EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1InterfaceC2EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlDeviceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface11requestDataERK7QStringi@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1Interface6cancelEv@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1InterfaceC1EPNS_35DataControlDeviceManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1InterfaceC2EPNS_35DataControlDeviceManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DataControlSourceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1Interface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1InterfaceC1EPNS_25DrmLeaseDeviceV1InterfaceEjRK7QStringS5_@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1InterfaceC2EPNS_25DrmLeaseDeviceV1InterfaceEjRK7QStringS5_@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer28DrmLeaseConnectorV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1Interface12overlayPanelEv@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1Interface8topLevelEPNS_15OutputInterfaceENS0_8PositionE@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1InterfaceC1EPNS_16SurfaceInterfaceEjP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1InterfaceC2EPNS_16SurfaceInterfaceEjP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer28InputPanelSurfaceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer29IdleInhibitManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface12commitStringEjRK7QString@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface12modifiersMapERK10QByteArray@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface13preeditCursorEi@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface13preeditStringEjRK7QStringS3_@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface13textDirectionEjN2Qt15LayoutDirectionE@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface14cursorPositionEii@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface14preeditStylingEjjj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface15sendCommitStateEj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface15sendContentTypeE6QFlagsINS_20TextInputContentHintEENS_23TextInputContentPurposeE@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface16sendInvokeActionEjj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface19sendSurroundingTextERK7QStringjj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface21deleteSurroundingTextEij@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface21keyboardGrabRequestedEPNS_17InputMethodGrabV1E@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface21sendPreferredLanguageERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface3keyEjjjb@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface6keysymEjjjbj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface8languageEjRK7QString@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface9modifiersEjjjjj@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1Interface9sendResetEv@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1InterfaceC1EPNS_22InputMethodV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1InterfaceC2EPNS_22InputMethodV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer29InputMethodContextV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface17activateRequestedEv@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface7setNameERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface8sendDoneEv@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterface9setActiveEb@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterfaceC1EPNS_39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterfaceC2EPNS_39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PlasmaVirtualDesktopInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer29PointerConstraintsV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface20preferredModeChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface3getEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterface7setModeENS_36ServerSideDecorationManagerInterface4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterfaceC1EPNS_36ServerSideDecorationManagerInterfaceEPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterfaceC2EPNS_36ServerSideDecorationManagerInterfaceEPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer29ServerSideDecorationInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2Interface10setAppliedEv@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2Interface9setFailedEv@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2InterfaceC1EPNS_27OutputManagementV2InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2InterfaceC2EPNS_27OutputManagementV2InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer30OutputConfigurationV2InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowActivationInterface9sendAppIdERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowActivationInterfaceC1Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowActivationInterfaceC2Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowActivationInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowActivationInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface12createWindowEP7QObjectRK5QUuid@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface16setStackingOrderERK7QVectorIjE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface21setStackingOrderUuidsERK7QVectorI7QStringE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface22setShowingDesktopStateENS0_19ShowingDesktopStateE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface27requestChangeShowingDesktopENS0_19ShowingDesktopStateE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterface42setPlasmaVirtualDesktopManagementInterfaceEPNS_39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer31PlasmaWindowManagementInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1Interface17decorationCreatedEPNS_32XdgToplevelDecorationV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer31XdgDecorationManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1Interface13sendAllOffersEv@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1InterfaceC1EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1InterfaceC2EPNS_18AbstractDataSourceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer32PrimarySelectionOfferV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface13sendConfigureENS0_4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface20preferredModeChangedENS0_4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1Interface3getEPNS_20XdgToplevelInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1InterfaceC1EPNS_20XdgToplevelInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1InterfaceC2EPNS_20XdgToplevelInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer32XdgToplevelDecorationV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface13sendSelectionEPNS_18AbstractDataSourceE@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface16selectionChangedEPNS_33PrimarySelectionSourceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface16selectionClearedEv@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1Interface18sendClearSelectionEv@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1InterfaceC1EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1InterfaceC2EPNS_13SeatInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionDeviceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface11requestDataERK7QStringi@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface3getEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1Interface6cancelEv@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1InterfaceC1EPNS_40PrimarySelectionDeviceManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1InterfaceC2EPNS_40PrimarySelectionDeviceManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer33PrimarySelectionSourceV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer33RelativePointerManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1Interface17dataDeviceCreatedEPNS_28DataControlDeviceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1Interface17dataSourceCreatedEPNS_28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer35DataControlDeviceManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration20setRendererInterfaceEPNS0_17RendererInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration32setSupportedFormatsWithModifiersERK7QVectorINS_21LinuxDmaBufV1Feedback7TrancheEE@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationC1EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationC2EPNS_7DisplayE@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterface14setDefaultModeENS0_4ModeE@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterface17decorationCreatedEPNS_29ServerSideDecorationInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterface14paletteChangedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterfaceC1EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterfaceC2EPNS_16SurfaceInterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer36ServerSideDecorationPaletteInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1Interface9setActiveEb@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceC1EPNS_16SurfaceInterfaceEPNS_13SeatInterfaceEPNS_42KeyboardShortcutsInhibitManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceC2EPNS_16SurfaceInterfaceEPNS_13SeatInterfaceEPNS_42KeyboardShortcutsInhibitManagerV1InterfaceEP11wl_resource@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface13createDesktopERK7QStringj@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface13removeDesktopERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface16desktopActivatedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface22desktopCreateRequestedERK7QStringj@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface22desktopRemoveRequestedERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface7desktopERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface7setRowsEj@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterface8sendDoneEv@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterface16createActivationERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1Interface17dataDeviceCreatedEPNS_33PrimarySelectionDeviceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1Interface17dataSourceCreatedEPNS_33PrimarySelectionSourceV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface15removeInhibitorEPNS_16SurfaceInterfaceEPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface16inhibitorCreatedEPNS_37KeyboardShortcutsInhibitorV1InterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterface11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterface11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterface14paletteCreatedEPNS_36ServerSideDecorationPaletteInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterface16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterface17paletteForSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceC1EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceC2EPNS_7DisplayEP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor14hotspotChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor14surfaceChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor20enteredSerialChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer6Cursor7changedEv@Base 5.24.3-1 + _ZN14KWaylandServer6CursorC1EPNS_16PointerInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer6CursorC2EPNS_16PointerInterfaceE@Base 5.24.3-1 + _ZN14KWaylandServer6CursorD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer6CursorD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer6CursorD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer7Display10nextSerialEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display11qt_metacallEN11QMetaObject4CallEiPPv@Base 5.24.3-1 + _ZN14KWaylandServer7Display11qt_metacastEPKc@Base 5.24.3-1 + _ZN14KWaylandServer7Display12createClientEi@Base 5.24.3-1 + _ZN14KWaylandServer7Display13addSocketNameERK7QString@Base 5.24.3-1 + _ZN14KWaylandServer7Display13getConnectionEP9wl_client@Base 5.24.3-1 + _ZN14KWaylandServer7Display13setEglDisplayEPv@Base 5.24.3-1 + _ZN14KWaylandServer7Display14dispatchEventsEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display14runningChangedEb@Base 5.24.3-1 + _ZN14KWaylandServer7Display15clientConnectedEPNS_16ClientConnectionE@Base 5.24.3-1 + _ZN14KWaylandServer7Display16staticMetaObjectE@Base 5.24.3-1 + _ZN14KWaylandServer7Display18clientDisconnectedEPNS_16ClientConnectionE@Base 5.24.3-1 + _ZN14KWaylandServer7Display18socketNamesChangedEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display23addSocketFileDescriptorEiRK7QString@Base 5.24.3-1 + _ZN14KWaylandServer7Display5flushEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display5startEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display6serialEv@Base 5.24.3-1 + _ZN14KWaylandServer7Display9createShmEv@Base 5.24.3-1 + _ZN14KWaylandServer7DisplayC1EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer7DisplayC2EP7QObject@Base 5.24.3-1 + _ZN14KWaylandServer7DisplayD0Ev@Base 5.24.3-1 + _ZN14KWaylandServer7DisplayD1Ev@Base 5.24.3-1 + _ZN14KWaylandServer7DisplayD2Ev@Base 5.24.3-1 + _ZN14KWaylandServer7DisplaycvP10wl_displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer12ClientBuffer10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer12ClientBuffer11isDestroyedEv@Base 5.24.3-1 + _ZNK14KWaylandServer12ClientBuffer12isReferencedEv@Base 5.24.3-1 + _ZNK14KWaylandServer12ClientBuffer8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13BlurInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer13IdleInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer13IdleInterface11isInhibitedEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface10dragSourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface10hasPointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface10pointerPosEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface11dragSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface11hasKeyboardEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface11isDragTouchEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface11textInputV2Ev@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface11textInputV3Ev@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface13isDragPointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface15isTouchSequenceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface16primarySelectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface19focusedTouchSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface19pointerButtonSerialEN2Qt11MouseButtonE@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface19pointerButtonSerialEj@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface20hasImplicitTouchGrabEj@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface21dropHandlerForSurfaceEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface21focusedPointerSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface22focusedKeyboardSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface22hasImplicitPointerGrabEj@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface22isPointerButtonPressedEN2Qt11MouseButtonE@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface22isPointerButtonPressedEj@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface23firstTouchPointPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface23focusedTextInputSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface25dragSurfaceTransformationEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface27focusedTouchSurfacePositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface29focusedPointerSurfacePositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface35focusedPointerSurfaceTransformationEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface4nameEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface5touchEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface6isDragEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface7pointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface8dragIconEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface8hasTouchEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface8keyboardEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface9selectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer13SeatInterface9timestampEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner10anchorRectEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner10isCompleteEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner10isReactiveEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner10parentSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner11anchorEdgesEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner12gravityEdgesEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner15parentConfigureEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner25flipConstraintAdjustmentsEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner26slideConstraintAdjustmentsEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner27resizeConstraintAdjustmentsEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer13XdgPositioner6offsetEv@Base 5.24.3-1 + _ZNK14KWaylandServer14SlideInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer14SlideInterface6offsetEv@Base 5.24.3-1 + _ZNK14KWaylandServer14SlideInterface8locationEv@Base 5.24.3-1 + _ZNK14KWaylandServer14StrutInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TabletCursorV210metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TabletCursorV213enteredSerialEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TabletCursorV27hotspotEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TabletCursorV27surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TouchInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer14TouchInterface14focusedSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DragAndDropIcon10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DragAndDropIcon7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DragAndDropIcon8positionEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DrmClientBuffer10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DrmClientBuffer13textureFormatEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DrmClientBuffer15hasAlphaChannelEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DrmClientBuffer4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15DrmClientBuffer6originEv@Base 5.24.3-1 + _ZNK14KWaylandServer15FakeInputDevice10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15FakeInputDevice15isAuthenticatedEv@Base 5.24.3-1 + _ZNK14KWaylandServer15FilteredDisplay10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface11refreshRateEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface12manufacturerEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface12physicalSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface14globalPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface15clientResourcesEPNS_16ClientConnectionE@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface15isDpmsSupportedEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface4modeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface5modelEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface5scaleEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface8dpmsModeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface8subPixelEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface9isEnabledEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface9pixelSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15OutputInterface9transformEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface10bottomLeftEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface11bottomRightEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface3topEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface4leftEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface5rightEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface6bottomEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface6offsetEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface7topLeftEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShadowInterface8topRightEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShmClientBuffer10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShmClientBuffer15hasAlphaChannelEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShmClientBuffer4dataEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShmClientBuffer4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer15ShmClientBuffer6originEv@Base 5.24.3-1 + _ZNK14KWaylandServer16AppMenuInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16AppMenuInterface7addressEv@Base 5.24.3-1 + _ZNK14KWaylandServer16AppMenuInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection11getResourceEj@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection14executablePathEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection6userIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection7groupIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnection9processIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer16ClientConnectioncvP9wl_clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface10pointerPosEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface14groupModifiersEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface14touchtimestampEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface15lockedModifiersEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface16latchedModifiersEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface18depressedModifiersEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface19lastModifiersSerialEv@Base 5.24.3-1 + _ZNK14KWaylandServer16DDESeatInterface9timestampEv@Base 5.24.3-1 + _ZNK14KWaylandServer16PointerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16PointerInterface14focusedSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer16PointerInterface4seatEv@Base 5.24.3-1 + _ZNK14KWaylandServer16PointerInterface6cursorEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface10bufferSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface10compositorEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface10mapToChildEPS0_RK7QPointF@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface10subSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface11bufferScaleEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface11mapToBufferERK7QPointF@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface11mapToBufferERK7QRegion@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface12boundingRectEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface12inhibitsIdleEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface13lockedPointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface13mapFromBufferERK7QPointF@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface13mapFromBufferERK7QRegion@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface15bufferTransformEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface15confinedPointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface15slideOnShowHideEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface16dmabufFeedbackV1Ev@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface17hasFrameCallbacksEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface21surfaceToBufferMatrixEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface2idEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface4blurEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface5aboveEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface5belowEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface5inputEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6bufferEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6damageEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6offsetEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6opaqueEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface6shadowEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface7outputsEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface8contrastEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface8isMappedEv@Base 5.24.3-1 + _ZNK14KWaylandServer16SurfaceInterface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface10saturationEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface5frostEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface6regionEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface8contrastEv@Base 5.24.3-1 + _ZNK14KWaylandServer17ContrastInterface9intensityEv@Base 5.24.3-1 + _ZNK14KWaylandServer17DDEShellInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17DDETouchInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17DDETouchInterface7ddeSeatEv@Base 5.24.3-1 + _ZNK14KWaylandServer17InputMethodGrabV110metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17KeyStateInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17KeyboardInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17KeyboardInterface13keyRepeatRateEv@Base 5.24.3-1 + _ZNK14KWaylandServer17KeyboardInterface14focusedSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer17KeyboardInterface14keyRepeatDelayEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV210brightnessEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV210metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV211refreshRateEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV211sizeChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV212scaleChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV214enabledChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV215overscanChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV215positionChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV215rgbRangeChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV216transformChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV216vrrPolicyChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV217brightnessChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV218refreshRateChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV24sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV25scaleEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV27enabledEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV28overscanEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV28positionEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV28rgbRangeEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV29transformEv@Base 5.24.3-1 + _ZNK14KWaylandServer17OutputChangeSetV29vrrPolicyEv@Base 5.24.3-1 + _ZNK14KWaylandServer17TabletV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17TabletV2Interface18isSurfaceSupportedEPNS_16SurfaceInterfaceE@Base 5.24.3-1 + _ZNK14KWaylandServer17TabletV2Interface3padEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface10positionerEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface10xdgSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface12isConfiguredEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface13parentSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgPopupInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgShellInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer17XdgShellInterface7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer18AbstractDataSource10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer18DataOfferInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer18DataOfferInterface26preferredDragAndDropActionEv@Base 5.24.3-1 + _ZNK14KWaylandServer18DataOfferInterface27supportedDragAndDropActionsEv@Base 5.24.3-1 + _ZNK14KWaylandServer18DataOfferInterface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer18FakeInputInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19AbstractDropHandler10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19CompositorInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19CompositorInterface7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DDEPointerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DDEPointerInterface7ddeSeatEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataDeviceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataDeviceInterface4seatEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataDeviceInterface9selectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface10isAcceptedEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface27supportedDragAndDropActionsEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DataSourceInterface9mimeTypesEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DrmLeaseV1Interface10connectorsEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DrmLeaseV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19DrmLeaseV1Interface8lesseeIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface11mainSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface13parentSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface14isSynchronizedEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface4modeEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer19SubSurfaceInterface8positionEv@Base 5.24.3-1 + _ZNK14KWaylandServer19ViewporterInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface12isConfiguredEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface14windowGeometryEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface5popupEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface5shellEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer19XdgSurfaceInterface8toplevelEv@Base 5.24.3-1 + _ZNK14KWaylandServer20BlurManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20DDEKeyboardInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20DDEKeyboardInterface7ddeSeatEv@Base 5.24.3-1 + _ZNK14KWaylandServer20DpmsManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20PlasmaShellInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TabletPadV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TabletPadV2Interface14currentSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TabletPadV2Interface4ringEj@Base 5.24.3-1 + _ZNK14KWaylandServer20TabletPadV2Interface5stripEj@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface12contentHintsEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface14contentPurposeEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface15cursorRectangleEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface15surroundingTextEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface17preferredLanguageEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface29surroundingTextCursorPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface30surroundingTextSelectionAnchorEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV2Interface9isEnabledEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface12contentHintsEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface14contentPurposeEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface15cursorRectangleEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface15surroundingTextEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface29surroundingTextCursorPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface30surroundingTextSelectionAnchorEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer20TextInputV3Interface9isEnabledEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgOutputV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgOutputV1Interface11logicalSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgOutputV1Interface15logicalPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface10xdgSurfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface11maximumSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface11minimumSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface11windowClassEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface11windowTitleEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface12isConfiguredEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface17parentXdgToplevelEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface5shellEv@Base 5.24.3-1 + _ZNK14KWaylandServer20XdgToplevelInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer21InputPanelV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21LayerShellV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21LayerShellV1Interface7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer21LinuxDmaBufV1Feedback10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface10internalIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface16plasmaActivitiesEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface19minimizedGeometriesEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface21plasmaVirtualDesktopsEv@Base 5.24.3-1 + _ZNK14KWaylandServer21PlasmaWindowInterface4uuidEv@Base 5.24.3-1 + _ZNK14KWaylandServer21ScreencastV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21SlideManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletSeatV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletSeatV2Interface16toolByHardwareIdEy@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletSeatV2Interface17isClientSupportedEPNS_16ClientConnectionE@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletSeatV2Interface20toolByHardwareSerialEyNS_21TabletToolV2Interface4TypeE@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletSeatV2Interface9padByNameERK7QString@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletToolV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletToolV2Interface13cursorChangedEPNS_14TabletCursorV2E@Base 5.24.3-1 + _ZNK14KWaylandServer21TabletToolV2Interface17isClientSupportedEv@Base 5.24.3-1 + _ZNK14KWaylandServer21XdgForeignV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer22InputMethodV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer22InputMethodV1Interface7contextEv@Base 5.24.3-1 + _ZNK14KWaylandServer22ShadowManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer22ShadowManagerInterface7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer22SubCompositorInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer23AppMenuManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer23ClientBufferIntegration10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer23ClientBufferIntegration7displayEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface10leftMarginEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface11desiredSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface11isCommittedEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface11rightMarginEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface12acceptsFocusEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface12bottomMarginEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface13exclusiveEdgeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface13exclusiveZoneEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface5layerEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface5scopeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface6anchorEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface6outputEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface7marginsEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer23LayerSurfaceV1Interface9topMarginEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface10brightnessEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface11refreshRateEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface12capabilitiesEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface12manufacturerEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface12physicalSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface12serialNumberEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface14globalPositionEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface4edidEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface4nameEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface4uuidEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface5modelEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface5scaleEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface6eisaIdEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface7enabledEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface8overscanEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface8rgbRangeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface8subPixelEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface9pixelSizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface9transformEv@Base 5.24.3-1 + _ZNK14KWaylandServer23OutputDeviceV2Interface9vrrPolicyEv@Base 5.24.3-1 + _ZNK14KWaylandServer24ContrastManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24DDEShellSurfaceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24DDEShellSurfaceInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer24LockedPointerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24LockedPointerV1Interface18cursorPositionHintEv@Base 5.24.3-1 + _ZNK14KWaylandServer24LockedPointerV1Interface6regionEv@Base 5.24.3-1 + _ZNK14KWaylandServer24LockedPointerV1Interface8isLockedEv@Base 5.24.3-1 + _ZNK14KWaylandServer24LockedPointerV1Interface8lifeTimeEv@Base 5.24.3-1 + _ZNK14KWaylandServer24PrimaryOutputV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24TabletManagerV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24TabletManagerV2Interface4seatEPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZNK14KWaylandServer24TabletPadRingV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer24XdgActivationV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer25ClientManagementInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer25DrmLeaseDeviceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer15hasAlphaChannelEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer5flagsEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer6formatEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer6originEv@Base 5.24.3-1 + _ZNK14KWaylandServer25LinuxDmaBufV1ClientBuffer6planesEv@Base 5.24.3-1 + _ZNK14KWaylandServer25TabletPadGroupV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer25TabletPadStripV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer26ConfinedPointerV1Interface10isConfinedEv@Base 5.24.3-1 + _ZNK14KWaylandServer26ConfinedPointerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer26ConfinedPointerV1Interface6regionEv@Base 5.24.3-1 + _ZNK14KWaylandServer26ConfinedPointerV1Interface8lifeTimeEv@Base 5.24.3-1 + _ZNK14KWaylandServer26DataDeviceManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer26DrmClientBufferIntegration10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer26PointerGesturesV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27DataControlOfferV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27DataControlOfferV1Interface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer27OutputDeviceModeV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27OutputDeviceModeV2Interface11refreshRateEv@Base 5.24.3-1 + _ZNK14KWaylandServer27OutputDeviceModeV2Interface4sizeEv@Base 5.24.3-1 + _ZNK14KWaylandServer27OutputDeviceModeV2Interface5flagsEv@Base 5.24.3-1 + _ZNK14KWaylandServer27OutputManagementV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface11skipTaskbarEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface12skipSwitcherEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface13isPositionSetEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface13panelBehaviorEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface15panelTakesFocusEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface4roleEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer27PlasmaShellSurfaceInterface8positionEv@Base 5.24.3-1 + _ZNK14KWaylandServer27ScreencastStreamV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27TextInputManagerV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27TextInputManagerV3Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer27XdgOutputManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlDeviceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlDeviceV1Interface16primarySelectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlDeviceV1Interface4seatEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlDeviceV1Interface9selectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlSourceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlSourceV1Interface6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DataControlSourceV1Interface9mimeTypesEv@Base 5.24.3-1 + _ZNK14KWaylandServer28DrmLeaseConnectorV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer28InputPanelSurfaceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer28InputPanelSurfaceV1Interface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer29IdleInhibitManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer29InputMethodContextV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer29InputMethodContextV1Interface12keyboardGrabEv@Base 5.24.3-1 + _ZNK14KWaylandServer29PlasmaVirtualDesktopInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer29PlasmaVirtualDesktopInterface2idEv@Base 5.24.3-1 + _ZNK14KWaylandServer29PlasmaVirtualDesktopInterface4nameEv@Base 5.24.3-1 + _ZNK14KWaylandServer29PlasmaVirtualDesktopInterface8isActiveEv@Base 5.24.3-1 + _ZNK14KWaylandServer29PointerConstraintsV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer29ServerSideDecorationInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer29ServerSideDecorationInterface13preferredModeEv@Base 5.24.3-1 + _ZNK14KWaylandServer29ServerSideDecorationInterface4modeEv@Base 5.24.3-1 + _ZNK14KWaylandServer29ServerSideDecorationInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer30OutputConfigurationV2Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer30OutputConfigurationV2Interface14primaryChangedEv@Base 5.24.3-1 + _ZNK14KWaylandServer30OutputConfigurationV2Interface7changesEv@Base 5.24.3-1 + _ZNK14KWaylandServer30OutputConfigurationV2Interface7primaryEv@Base 5.24.3-1 + _ZNK14KWaylandServer31PlasmaWindowManagementInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer31PlasmaWindowManagementInterface39plasmaVirtualDesktopManagementInterfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer31PlasmaWindowManagementInterface7windowsEv@Base 5.24.3-1 + _ZNK14KWaylandServer31XdgDecorationManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer32PrimarySelectionOfferV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer32PrimarySelectionOfferV1Interface8resourceEv@Base 5.24.3-1 + _ZNK14KWaylandServer32XdgToplevelDecorationV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer32XdgToplevelDecorationV1Interface13preferredModeEv@Base 5.24.3-1 + _ZNK14KWaylandServer32XdgToplevelDecorationV1Interface8toplevelEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionDeviceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionDeviceV1Interface4seatEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionDeviceV1Interface6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionDeviceV1Interface9selectionEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionSourceV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionSourceV1Interface6clientEv@Base 5.24.3-1 + _ZNK14KWaylandServer33PrimarySelectionSourceV1Interface9mimeTypesEv@Base 5.24.3-1 + _ZNK14KWaylandServer33RelativePointerManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer35DataControlDeviceManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer36LinuxDmaBufV1ClientBufferIntegration17rendererInterfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer36ServerSideDecorationManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer36ServerSideDecorationManagerInterface11defaultModeEv@Base 5.24.3-1 + _ZNK14KWaylandServer36ServerSideDecorationPaletteInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer36ServerSideDecorationPaletteInterface7paletteEv@Base 5.24.3-1 + _ZNK14KWaylandServer36ServerSideDecorationPaletteInterface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer37KeyboardShortcutsInhibitorV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer37KeyboardShortcutsInhibitorV1Interface4seatEv@Base 5.24.3-1 + _ZNK14KWaylandServer37KeyboardShortcutsInhibitorV1Interface7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer37KeyboardShortcutsInhibitorV1Interface8isActiveEv@Base 5.24.3-1 + _ZNK14KWaylandServer39PlasmaVirtualDesktopManagementInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer39PlasmaVirtualDesktopManagementInterface8desktopsEv@Base 5.24.3-1 + _ZNK14KWaylandServer39PlasmaWindowActivationFeedbackInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer40PrimarySelectionDeviceManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer42KeyboardShortcutsInhibitManagerV1Interface13findInhibitorEPNS_16SurfaceInterfaceEPNS_13SeatInterfaceE@Base 5.24.3-1 + _ZNK14KWaylandServer43ServerSideDecorationPaletteManagerInterface10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer6Cursor10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer6Cursor13enteredSerialEv@Base 5.24.3-1 + _ZNK14KWaylandServer6Cursor7hotspotEv@Base 5.24.3-1 + _ZNK14KWaylandServer6Cursor7pointerEv@Base 5.24.3-1 + _ZNK14KWaylandServer6Cursor7surfaceEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display10eglDisplayEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display10metaObjectEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display11connectionsEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display11socketNamesEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display13outputDevicesEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display19outputsIntersectingERK5QRect@Base 5.24.3-1 + _ZNK14KWaylandServer7Display23clientBufferForResourceEP11wl_resource@Base 5.24.3-1 + _ZNK14KWaylandServer7Display5seatsEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display7outputsEv@Base 5.24.3-1 + _ZNK14KWaylandServer7Display9isRunningEv@Base 5.24.3-1 + _ZNK14KWaylandServer7DisplaycvP10wl_displayEv@Base 5.24.3-1 + _ZTIN14KWaylandServer12ClientBufferE@Base 5.24.3-1 + _ZTIN14KWaylandServer13BlurInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer13IdleInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer13SeatInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer14SlideInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer14StrutInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer14TabletCursorV2E@Base 5.24.3-1 + _ZTIN14KWaylandServer14TouchInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer15DragAndDropIconE@Base 5.24.3-1 + _ZTIN14KWaylandServer15DrmClientBufferE@Base 5.24.3-1 + _ZTIN14KWaylandServer15FakeInputDeviceE@Base 5.24.3-1 + _ZTIN14KWaylandServer15FilteredDisplayE@Base 5.24.3-1 + _ZTIN14KWaylandServer15OutputInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer15ShadowInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer15ShmClientBufferE@Base 5.24.3-1 + _ZTIN14KWaylandServer16AppMenuInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer16ClientConnectionE@Base 5.24.3-1 + _ZTIN14KWaylandServer16DDESeatInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer16PointerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer16SurfaceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17ContrastInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17DDEShellInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17DDETouchInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17InputMethodGrabV1E@Base 5.24.3-1 + _ZTIN14KWaylandServer17KeyStateInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17KeyboardInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17OutputChangeSetV2E@Base 5.24.3-1 + _ZTIN14KWaylandServer17TabletV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17XdgPopupInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer17XdgShellInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer18AbstractDataSourceE@Base 5.24.3-1 + _ZTIN14KWaylandServer18DataOfferInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer18FakeInputInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19AbstractDropHandlerE@Base 5.24.3-1 + _ZTIN14KWaylandServer19CompositorInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19DDEPointerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19DataDeviceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19DataSourceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19DrmLeaseV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19ViewporterInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer19XdgSurfaceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20BlurManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20DDEKeyboardInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20DpmsManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20PlasmaShellInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20TextInputV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20TextInputV3InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20XdgOutputV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer20XdgToplevelInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21InputPanelV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21LayerShellV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21LinuxDmaBufV1FeedbackE@Base 5.24.3-1 + _ZTIN14KWaylandServer21PlasmaWindowInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21ScreencastV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21SlideManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21TabletSeatV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21TabletToolV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer21XdgForeignV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer22InputMethodV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer22ShadowManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer22SubCompositorInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer23AppMenuManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer23ClientBufferIntegrationE@Base 5.24.3-1 + _ZTIN14KWaylandServer23LayerSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer23OutputDeviceV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24ContrastManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24DDEShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24LockedPointerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24PrimaryOutputV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24TabletManagerV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24TabletPadRingV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer24XdgActivationV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer25ClientManagementInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer25DrmLeaseDeviceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer25LinuxDmaBufV1ClientBufferE@Base 5.24.3-1 + _ZTIN14KWaylandServer25TabletPadGroupV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer25TabletPadStripV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer26ConfinedPointerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer26DataDeviceManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer26DrmClientBufferIntegrationE@Base 5.24.3-1 + _ZTIN14KWaylandServer26PointerGesturesV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27DataControlOfferV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27OutputDeviceModeV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27OutputManagementV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27PlasmaShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27ScreencastStreamV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27TextInputManagerV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27TextInputManagerV3InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer27XdgOutputManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer28DataControlDeviceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer28DrmLeaseConnectorV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer28InputPanelSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer29IdleInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer29InputMethodContextV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer29PlasmaVirtualDesktopInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer29PointerConstraintsV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer29ServerSideDecorationInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer30OutputConfigurationV2InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer31PlasmaWindowManagementInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer31XdgDecorationManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer32PrimarySelectionOfferV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer32XdgToplevelDecorationV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer33PrimarySelectionDeviceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer33PrimarySelectionSourceV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer33RelativePointerManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer35DataControlDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationE@Base 5.24.3-1 + _ZTIN14KWaylandServer36ServerSideDecorationManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer36ServerSideDecorationPaletteInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceE@Base 5.24.3-1 + _ZTIN14KWaylandServer6CursorE@Base 5.24.3-1 + _ZTIN14KWaylandServer7DisplayE@Base 5.24.3-1 + _ZTSN14KWaylandServer12ClientBufferE@Base 5.24.3-1 + _ZTSN14KWaylandServer13BlurInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer13IdleInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer13SeatInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer14SlideInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer14StrutInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer14TabletCursorV2E@Base 5.24.3-1 + _ZTSN14KWaylandServer14TouchInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer15DragAndDropIconE@Base 5.24.3-1 + _ZTSN14KWaylandServer15DrmClientBufferE@Base 5.24.3-1 + _ZTSN14KWaylandServer15FakeInputDeviceE@Base 5.24.3-1 + _ZTSN14KWaylandServer15FilteredDisplayE@Base 5.24.3-1 + _ZTSN14KWaylandServer15OutputInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer15ShadowInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer15ShmClientBufferE@Base 5.24.3-1 + _ZTSN14KWaylandServer16AppMenuInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer16ClientConnectionE@Base 5.24.3-1 + _ZTSN14KWaylandServer16DDESeatInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer16PointerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer16SurfaceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17ContrastInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17DDEShellInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17DDETouchInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17InputMethodGrabV1E@Base 5.24.3-1 + _ZTSN14KWaylandServer17KeyStateInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17KeyboardInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17OutputChangeSetV2E@Base 5.24.3-1 + _ZTSN14KWaylandServer17TabletV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17XdgPopupInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer17XdgShellInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer18AbstractDataSourceE@Base 5.24.3-1 + _ZTSN14KWaylandServer18DataOfferInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer18FakeInputInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19AbstractDropHandlerE@Base 5.24.3-1 + _ZTSN14KWaylandServer19CompositorInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19DDEPointerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19DataDeviceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19DataSourceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19DrmLeaseV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19ViewporterInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer19XdgSurfaceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20BlurManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20DDEKeyboardInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20DpmsManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20PlasmaShellInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20TextInputV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20TextInputV3InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20XdgOutputV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer20XdgToplevelInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21InputPanelV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21LayerShellV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21LinuxDmaBufV1FeedbackE@Base 5.24.3-1 + _ZTSN14KWaylandServer21PlasmaWindowInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21ScreencastV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21SlideManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21TabletSeatV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21TabletToolV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer21XdgForeignV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer22InputMethodV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer22ShadowManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer22SubCompositorInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer23AppMenuManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer23ClientBufferIntegrationE@Base 5.24.3-1 + _ZTSN14KWaylandServer23LayerSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer23OutputDeviceV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24ContrastManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24DDEShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24LockedPointerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24PrimaryOutputV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24TabletManagerV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24TabletPadRingV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer24XdgActivationV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer25ClientManagementInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer25DrmLeaseDeviceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer25LinuxDmaBufV1ClientBufferE@Base 5.24.3-1 + _ZTSN14KWaylandServer25TabletPadGroupV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer25TabletPadStripV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer26ConfinedPointerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer26DataDeviceManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer26DrmClientBufferIntegrationE@Base 5.24.3-1 + _ZTSN14KWaylandServer26PointerGesturesV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27DataControlOfferV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27OutputDeviceModeV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27OutputManagementV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27PlasmaShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27ScreencastStreamV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27TextInputManagerV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27TextInputManagerV3InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer27XdgOutputManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer28DataControlDeviceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer28DrmLeaseConnectorV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer28InputPanelSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer29IdleInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer29InputMethodContextV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer29PlasmaVirtualDesktopInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer29PointerConstraintsV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer29ServerSideDecorationInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer30OutputConfigurationV2InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer31PlasmaWindowManagementInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer31XdgDecorationManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer32PrimarySelectionOfferV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer32XdgToplevelDecorationV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer33PrimarySelectionDeviceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer33PrimarySelectionSourceV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer33RelativePointerManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer35DataControlDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationE@Base 5.24.3-1 + _ZTSN14KWaylandServer36ServerSideDecorationManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer36ServerSideDecorationPaletteInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceE@Base 5.24.3-1 + _ZTSN14KWaylandServer6CursorE@Base 5.24.3-1 + _ZTSN14KWaylandServer7DisplayE@Base 5.24.3-1 + _ZTVN14KWaylandServer12ClientBufferE@Base 5.24.3-1 + _ZTVN14KWaylandServer13BlurInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer13IdleInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer13SeatInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer14SlideInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer14StrutInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer14TabletCursorV2E@Base 5.24.3-1 + _ZTVN14KWaylandServer14TouchInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer15DragAndDropIconE@Base 5.24.3-1 + _ZTVN14KWaylandServer15DrmClientBufferE@Base 5.24.3-1 + _ZTVN14KWaylandServer15FakeInputDeviceE@Base 5.24.3-1 + _ZTVN14KWaylandServer15FilteredDisplayE@Base 5.24.3-1 + _ZTVN14KWaylandServer15OutputInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer15ShadowInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer15ShmClientBufferE@Base 5.24.3-1 + _ZTVN14KWaylandServer16AppMenuInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer16ClientConnectionE@Base 5.24.3-1 + _ZTVN14KWaylandServer16DDESeatInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer16PointerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer16SurfaceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17ContrastInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17DDEShellInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17DDETouchInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17InputMethodGrabV1E@Base 5.24.3-1 + _ZTVN14KWaylandServer17KeyStateInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17KeyboardInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17OutputChangeSetV2E@Base 5.24.3-1 + _ZTVN14KWaylandServer17TabletV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17XdgPopupInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer17XdgShellInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer18AbstractDataSourceE@Base 5.24.3-1 + _ZTVN14KWaylandServer18DataOfferInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer18FakeInputInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19AbstractDropHandlerE@Base 5.24.3-1 + _ZTVN14KWaylandServer19CompositorInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19DDEPointerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19DataDeviceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19DataSourceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19DrmLeaseV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19SubSurfaceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19ViewporterInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer19XdgSurfaceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20BlurManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20DDEKeyboardInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20DpmsManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20PlasmaShellInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20TabletPadV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20TextInputV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20TextInputV3InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20XdgOutputV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer20XdgToplevelInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21InputPanelV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21LayerShellV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21LinuxDmaBufV1FeedbackE@Base 5.24.3-1 + _ZTVN14KWaylandServer21PlasmaWindowInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21ScreencastV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21SlideManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21TabletSeatV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21TabletToolV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer21XdgForeignV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer22InputMethodV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer22ShadowManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer22SubCompositorInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer23AppMenuManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer23ClientBufferIntegrationE@Base 5.24.3-1 + _ZTVN14KWaylandServer23LayerSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer23OutputDeviceV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24ContrastManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24DDEShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24LockedPointerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24PrimaryOutputV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24TabletManagerV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24TabletPadRingV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer24XdgActivationV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer25ClientManagementInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer25DrmLeaseDeviceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer25LinuxDmaBufV1ClientBufferE@Base 5.24.3-1 + _ZTVN14KWaylandServer25TabletPadGroupV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer25TabletPadStripV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer26ConfinedPointerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer26DataDeviceManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer26DrmClientBufferIntegrationE@Base 5.24.3-1 + _ZTVN14KWaylandServer26PointerGesturesV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27DataControlOfferV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27OutputDeviceModeV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27OutputManagementV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27PlasmaShellSurfaceInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27ScreencastStreamV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27TextInputManagerV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27TextInputManagerV3InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer27XdgOutputManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer28DataControlDeviceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer28DataControlSourceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer28DrmLeaseConnectorV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer28InputPanelSurfaceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer29IdleInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer29InputMethodContextV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer29PlasmaVirtualDesktopInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer29PointerConstraintsV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer29ServerSideDecorationInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer30OutputConfigurationV2InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer31PlasmaWindowManagementInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer31XdgDecorationManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer32PrimarySelectionOfferV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer32XdgToplevelDecorationV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer33PrimarySelectionDeviceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer33PrimarySelectionSourceV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer33RelativePointerManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer35DataControlDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer36LinuxDmaBufV1ClientBufferIntegrationE@Base 5.24.3-1 + _ZTVN14KWaylandServer36ServerSideDecorationManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer36ServerSideDecorationPaletteInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer37KeyboardShortcutsInhibitorV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer39PlasmaVirtualDesktopManagementInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer39PlasmaWindowActivationFeedbackInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer40PrimarySelectionDeviceManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer42KeyboardShortcutsInhibitManagerV1InterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer43ServerSideDecorationPaletteManagerInterfaceE@Base 5.24.3-1 + _ZTVN14KWaylandServer6CursorE@Base 5.24.3-1 + _ZTVN14KWaylandServer7DisplayE@Base 5.24.3-1 + com_deepin_client_management_interface@Base 5.24.3-1 + com_deepin_kwin_strut_interface@Base 5.24.3-1 + dde_keyboard_interface@Base 5.24.3-1 + dde_pointer_interface@Base 5.24.3-1 + dde_seat_interface@Base 5.24.3-1 + dde_shell_interface@Base 5.24.3-1 + dde_shell_surface_interface@Base 5.24.3-1 + dde_touch_interface@Base 5.24.3-1 + kde_output_configuration_v2_interface@Base 5.24.3-1 + kde_output_device_mode_v2_interface@Base 5.24.3-1 + kde_output_device_v2_interface@Base 5.24.3-1 + kde_output_management_v2_interface@Base 5.24.3-1 + kde_primary_output_v1_interface@Base 5.24.3-1 + org_kde_kwin_appmenu_interface@Base 5.24.3-1 + org_kde_kwin_appmenu_manager_interface@Base 5.24.3-1 + org_kde_kwin_blur_interface@Base 5.24.3-1 + org_kde_kwin_blur_manager_interface@Base 5.24.3-1 + org_kde_kwin_contrast_interface@Base 5.24.3-1 + org_kde_kwin_contrast_manager_interface@Base 5.24.3-1 + org_kde_kwin_dpms_interface@Base 5.24.3-1 + org_kde_kwin_dpms_manager_interface@Base 5.24.3-1 + org_kde_kwin_fake_input_interface@Base 5.24.3-1 + org_kde_kwin_idle_interface@Base 5.24.3-1 + org_kde_kwin_idle_timeout_interface@Base 5.24.3-1 + org_kde_kwin_keystate_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_manager_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_palette_interface@Base 5.24.3-1 + org_kde_kwin_server_decoration_palette_manager_interface@Base 5.24.3-1 + org_kde_kwin_shadow_interface@Base 5.24.3-1 + org_kde_kwin_shadow_manager_interface@Base 5.24.3-1 + org_kde_kwin_slide_interface@Base 5.24.3-1 + org_kde_kwin_slide_manager_interface@Base 5.24.3-1 + org_kde_plasma_activation_feedback_interface@Base 5.24.3-1 + org_kde_plasma_activation_interface@Base 5.24.3-1 + org_kde_plasma_shell_interface@Base 5.24.3-1 + org_kde_plasma_surface_interface@Base 5.24.3-1 + org_kde_plasma_virtual_desktop_interface@Base 5.24.3-1 + org_kde_plasma_virtual_desktop_management_interface@Base 5.24.3-1 + org_kde_plasma_window_interface@Base 5.24.3-1 + org_kde_plasma_window_management_interface@Base 5.24.3-1 + qt_extended_surface_interface@Base 5.24.3-1 + qt_surface_extension_interface@Base 5.24.3-1 + wl_buffer_interface@Base 5.24.3-1 + wl_callback_interface@Base 5.24.3-1 + wl_compositor_interface@Base 5.24.3-1 + wl_data_device_interface@Base 5.24.3-1 + wl_data_device_manager_interface@Base 5.24.3-1 + wl_data_offer_interface@Base 5.24.3-1 + wl_data_source_interface@Base 5.24.3-1 + wl_display_interface@Base 5.24.3-1 + wl_keyboard_interface@Base 5.24.3-1 + wl_output_interface@Base 5.24.3-1 + wl_pointer_interface@Base 5.24.3-1 + wl_region_interface@Base 5.24.3-1 + wl_registry_interface@Base 5.24.3-1 + wl_seat_interface@Base 5.24.3-1 + wl_shell_interface@Base 5.24.3-1 + wl_shell_surface_interface@Base 5.24.3-1 + wl_shm_interface@Base 5.24.3-1 + wl_shm_pool_interface@Base 5.24.3-1 + wl_subcompositor_interface@Base 5.24.3-1 + wl_subsurface_interface@Base 5.24.3-1 + wl_surface_interface@Base 5.24.3-1 + wl_touch_interface@Base 5.24.3-1 + wp_drm_lease_connector_v1_interface@Base 5.24.3-1 + wp_drm_lease_device_v1_interface@Base 5.24.3-1 + wp_drm_lease_request_v1_interface@Base 5.24.3-1 + wp_drm_lease_v1_interface@Base 5.24.3-1 + wp_viewport_interface@Base 5.24.3-1 + wp_viewporter_interface@Base 5.24.3-1 + xdg_activation_token_v1_interface@Base 5.24.3-1 + xdg_activation_v1_interface@Base 5.24.3-1 + xdg_popup_interface@Base 5.24.3-1 + xdg_positioner_interface@Base 5.24.3-1 + xdg_surface_interface@Base 5.24.3-1 + xdg_toplevel_interface@Base 5.24.3-1 + xdg_wm_base_interface@Base 5.24.3-1 + zkde_screencast_stream_unstable_v1_interface@Base 5.24.3-1 + zkde_screencast_unstable_v1_interface@Base 5.24.3-1 + zwlr_data_control_device_v1_interface@Base 5.24.3-1 + zwlr_data_control_manager_v1_interface@Base 5.24.3-1 + zwlr_data_control_offer_v1_interface@Base 5.24.3-1 + zwlr_data_control_source_v1_interface@Base 5.24.3-1 + zwlr_layer_shell_v1_interface@Base 5.24.3-1 + zwlr_layer_surface_v1_interface@Base 5.24.3-1 + zwp_confined_pointer_v1_interface@Base 5.24.3-1 + zwp_idle_inhibit_manager_v1_interface@Base 5.24.3-1 + zwp_idle_inhibitor_v1_interface@Base 5.24.3-1 + zwp_input_method_context_v1_interface@Base 5.24.3-1 + zwp_input_method_v1_interface@Base 5.24.3-1 + zwp_input_panel_surface_v1_interface@Base 5.24.3-1 + zwp_input_panel_v1_interface@Base 5.24.3-1 + zwp_keyboard_shortcuts_inhibit_manager_v1_interface@Base 5.24.3-1 + zwp_keyboard_shortcuts_inhibitor_v1_interface@Base 5.24.3-1 + zwp_linux_buffer_params_v1_interface@Base 5.24.3-1 + zwp_linux_dmabuf_feedback_v1_interface@Base 5.24.3-1 + zwp_linux_dmabuf_v1_interface@Base 5.24.3-1 + zwp_locked_pointer_v1_interface@Base 5.24.3-1 + zwp_pointer_constraints_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_hold_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_pinch_v1_interface@Base 5.24.3-1 + zwp_pointer_gesture_swipe_v1_interface@Base 5.24.3-1 + zwp_pointer_gestures_v1_interface@Base 5.24.3-1 + zwp_primary_selection_device_manager_v1_interface@Base 5.24.3-1 + zwp_primary_selection_device_v1_interface@Base 5.24.3-1 + zwp_primary_selection_offer_v1_interface@Base 5.24.3-1 + zwp_primary_selection_source_v1_interface@Base 5.24.3-1 + zwp_relative_pointer_manager_v1_interface@Base 5.24.3-1 + zwp_relative_pointer_v1_interface@Base 5.24.3-1 + zwp_tablet_manager_v2_interface@Base 5.24.3-1 + zwp_tablet_pad_group_v2_interface@Base 5.24.3-1 + zwp_tablet_pad_ring_v2_interface@Base 5.24.3-1 + zwp_tablet_pad_strip_v2_interface@Base 5.24.3-1 + zwp_tablet_pad_v2_interface@Base 5.24.3-1 + zwp_tablet_seat_v2_interface@Base 5.24.3-1 + zwp_tablet_tool_v2_interface@Base 5.24.3-1 + zwp_tablet_v2_interface@Base 5.24.3-1 + zwp_text_input_manager_v1_interface@Base 5.24.3-1 + zwp_text_input_manager_v2_interface@Base 5.24.3-1 + zwp_text_input_manager_v3_interface@Base 5.24.3-1 + zwp_text_input_v1_interface@Base 5.24.3-1 + zwp_text_input_v2_interface@Base 5.24.3-1 + zwp_text_input_v3_interface@Base 5.24.3-1 + zxdg_decoration_manager_v1_interface@Base 5.24.3-1 + zxdg_exported_v2_interface@Base 5.24.3-1 + zxdg_exporter_v2_interface@Base 5.24.3-1 + zxdg_imported_v2_interface@Base 5.24.3-1 + zxdg_importer_v2_interface@Base 5.24.3-1 + zxdg_output_manager_v1_interface@Base 5.24.3-1 + zxdg_output_v1_interface@Base 5.24.3-1 + zxdg_toplevel_decoration_v1_interface@Base 5.24.3-1 \ No newline at end of file diff -Nru dwayland-5.57.0.23/debian/libkf5waylandclient5.install dwayland-5.57.0.24+really5.24.3/debian/libkf5waylandclient5.install --- dwayland-5.57.0.23/debian/libkf5waylandclient5.install 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libkf5waylandclient5.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/*/libKF5WaylandClient.so.5 -usr/lib/*/libKF5WaylandClient.so.5.* diff -Nru dwayland-5.57.0.23/debian/libkf5wayland-dev.acc.in dwayland-5.57.0.24+really5.24.3/debian/libkf5wayland-dev.acc.in --- dwayland-5.57.0.23/debian/libkf5wayland-dev.acc.in 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libkf5wayland-dev.acc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ - - - - - 5.2.0 - - - - /usr/include/KF5/KWayland/ - - - - /usr/lib/@@DEB_HOST_MULTIARCH@@/libKF5WaylandClient.so - /usr/lib/@@DEB_HOST_MULTIARCH@@/libKF5WaylandServer.so - - - - -fPIC - - - diff -Nru dwayland-5.57.0.23/debian/libkf5wayland-dev.install dwayland-5.57.0.24+really5.24.3/debian/libkf5wayland-dev.install --- dwayland-5.57.0.23/debian/libkf5wayland-dev.install 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libkf5wayland-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -usr/include/KF5/KWayland/ -usr/include/KF5/kwayland_version.h -usr/lib/*/cmake/KF5Wayland/ -usr/lib/*/libKF5WaylandClient.so -usr/lib/*/libKF5WaylandServer.so -usr/lib/*/libexec/org-kde-kf5-kwayland-testserver -usr/lib/*/qt5/mkspecs/modules/qt_KWaylandClient.pri -usr/lib/*/qt5/mkspecs/modules/qt_KWaylandServer.pri diff -Nru dwayland-5.57.0.23/debian/libkf5waylandserver5.install dwayland-5.57.0.24+really5.24.3/debian/libkf5waylandserver5.install --- dwayland-5.57.0.23/debian/libkf5waylandserver5.install 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/libkf5waylandserver5.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/*/libKF5WaylandServer.so.5 -usr/lib/*/libKF5WaylandServer.so.5.* diff -Nru dwayland-5.57.0.23/debian/meta/cmake-ignore dwayland-5.57.0.24+really5.24.3/debian/meta/cmake-ignore --- dwayland-5.57.0.23/debian/meta/cmake-ignore 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/meta/cmake-ignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -- QCH , API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop): - series: xenial diff -Nru dwayland-5.57.0.23/debian/patches/kubuntu_disable-tests.diff dwayland-5.57.0.24+really5.24.3/debian/patches/kubuntu_disable-tests.diff --- dwayland-5.57.0.23/debian/patches/kubuntu_disable-tests.diff 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/patches/kubuntu_disable-tests.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From: Jonathan Riddell -Date: Tue, 15 May 2018 17:44:56 +0200 -Subject: disable failing tests - -=================================================================== ---- - autotests/client/CMakeLists.txt | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/autotests/client/CMakeLists.txt b/autotests/client/CMakeLists.txt -index ad0e457..8c8ede8 100644 ---- a/autotests/client/CMakeLists.txt -+++ b/autotests/client/CMakeLists.txt -@@ -31,8 +31,6 @@ if(Wayland_VERSION VERSION_GREATER "1.4.0") - ) - add_executable(testWaylandFullscreenShell ${testWaylandFullscreenShell_SRCS}) - target_link_libraries( testWaylandFullscreenShell Qt5::Test KF5::WaylandClient Wayland::Client) -- add_test(NAME kwayland-testWaylandFullscreenShell COMMAND testWaylandFullscreenShell) -- ecm_mark_as_test(testWaylandFullscreenShell) - else() - message(STATUS "The weston executable was not found. Some autotests will not be executed.") - endif() -@@ -80,8 +78,6 @@ if (HAVE_LINUX_INPUT_H) - ) - add_executable(testWaylandSeat ${testWaylandSeat_SRCS}) - target_link_libraries( testWaylandSeat Qt5::Test Qt5::Gui KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server) -- add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat) -- ecm_mark_as_test(testWaylandSeat) - endif() - - ######################################################## diff -Nru dwayland-5.57.0.23/debian/patches/series dwayland-5.57.0.24+really5.24.3/debian/patches/series --- dwayland-5.57.0.23/debian/patches/series 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -kubuntu_disable-tests.diff diff -Nru dwayland-5.57.0.23/debian/rules dwayland-5.57.0.24+really5.24.3/debian/rules --- dwayland-5.57.0.23/debian/rules 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/rules 2023-01-11 12:23:55.000000000 +0000 @@ -1,19 +1,22 @@ #!/usr/bin/make -f -# -*- makefile -*- -export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed +include /usr/share/dpkg/pkg-info.mk + +AbiVirtualPackageVersion = $(call dpkg_late_eval,AbiVirtualPackageVersion,echo '${DEB_VERSION_UPSTREAM}' | sed -e 's/\.[0-9]\+$$//') +pkgs_lib = $(filter-out %-%,$(filter lib%,$(shell dh_listpackages))) %: - dh $@ --with kf5,pkgkde_symbolshelper --buildsystem kf5 --without build_stamp + dh $@ --with kf5,pkgkde_symbolshelper -override_dh_auto_configure: - dh_auto_configure -- -DBUILD_TESTING=OFF +override_dh_makeshlibs: + for pkg in $(pkgs_lib); do \ + name=$$( echo "$${pkg}" | sed -e 's/abi[0-9]\+\s*//'); \ + echo "ABI:VirtualPackage=$${name}-$(AbiVirtualPackageVersion)" >> debian/$${pkg}.substvars; \ + dh_makeshlibs -p$${pkg} -V "$${pkg} (>= $(DEB_VERSION_EPOCH_UPSTREAM)), $${name}-$(AbiVirtualPackageVersion)"; \ + done -override_dh_strip: - dh_strip --dbgsym-migration='kwayland-dbg (<= 4:5.5.5-1~~)' +override_dh_auto_configure: + dh_auto_configure -- -DBUILD_QCH=ON -DBUILD_TESTING=OFF -override_dh_shlibdeps: - dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info override_dh_auto_test: - # Disable dh_auto_test at build time : diff -Nru dwayland-5.57.0.23/debian/salsa-ci.yml dwayland-5.57.0.24+really5.24.3/debian/salsa-ci.yml --- dwayland-5.57.0.23/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/salsa-ci.yml 2023-01-11 12:23:55.000000000 +0000 @@ -0,0 +1,7 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml +variables: + SALSA_CI_DISABLE_MISSING_BREAKS: 'no' + SALSA_CI_DISABLE_RC_BUGS: 'no' + SALSA_CI_REPROTEST_ARGS: '--variations=-build-path' diff -Nru dwayland-5.57.0.23/debian/tests/acc dwayland-5.57.0.24+really5.24.3/debian/tests/acc --- dwayland-5.57.0.23/debian/tests/acc 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/tests/acc 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/bin/sh - -DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH) - -for in_file in debian/*.acc.in; do - out_file=${in_file%.in} - sed 's/@@DEB_HOST_MULTIARCH@@/'"${DEB_HOST_MULTIARCH}"'/' \ - "${in_file}" > "${out_file}" -done - -dh_acc diff -Nru dwayland-5.57.0.23/debian/tests/control dwayland-5.57.0.24+really5.24.3/debian/tests/control --- dwayland-5.57.0.23/debian/tests/control 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -Tests: testsuite -Depends: @, @builddeps@, build-essential, - xvfb, xauth, dbus-x11, - libpam-systemd, weston, qtwayland5 -Restrictions: build-needed - -Tests: acc -Depends: @, dh-acc, exuberant-ctags -Restrictions: allow-stderr diff -Nru dwayland-5.57.0.23/debian/tests/testsuite dwayland-5.57.0.24+really5.24.3/debian/tests/testsuite --- dwayland-5.57.0.23/debian/tests/testsuite 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/tests/testsuite 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/bin/sh - -export LANG=C.UTF-8 -export LC_ALL=C.UTF-8 - -if [ -z "$HOME" ] || [ ! -d "$HOME" ]; then - [ -e debian/tests.home ] || mkdir debian/tests.home - export HOME="$(pwd)/debian/tests.home" - trap "rm -rf debian/tests.home" EXIT -fi -mkdir -p "$HOME"/.config || true -mkdir -p "$HOME/runtime" || true -chmod 700 "$HOME/runtime" -export XDG_RUNTIME_DIR="$HOME/runtime" -xvfb-run -a --server-args="-screen 0 1024x768x24+32" \ - dh_auto_test --no-parallel diff -Nru dwayland-5.57.0.23/debian/upstream/metadata dwayland-5.57.0.24+really5.24.3/debian/upstream/metadata --- dwayland-5.57.0.23/debian/upstream/metadata 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/upstream/metadata 2023-01-11 12:23:55.000000000 +0000 @@ -1,7 +1,5 @@ -Name: kwayland -Changelog: https://cgit.kde.org/kwayland.git/log -Contact: plasma-devel@kde.org -Donation: https://www.kde.org/community/donations/index.php -Repository: https://anongit.kde.org/kwayland.git -Repository-Browse: https://cgit.kde.org/kwayland.git -Security-Contact: security@kde.org +--- +Bug-Database: https://invent.kde.org/plasma/kwayland-server/issues +Bug-Submit: https://invent.kde.org/plasma/kwayland-server/issues/new +Repository: https://invent.kde.org/plasma/kwayland-server.git +Repository-Browse: https://invent.kde.org/plasma/kwayland-server diff -Nru dwayland-5.57.0.23/debian/upstream/signing-key.asc dwayland-5.57.0.24+really5.24.3/debian/upstream/signing-key.asc --- dwayland-5.57.0.23/debian/upstream/signing-key.asc 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/upstream/signing-key.asc 2023-01-11 12:23:55.000000000 +0000 @@ -1,30 +1,157 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 -mQENBFfNUR8BCADDjPXScwObp7mWwUnrjqrM0gGg+pId6vqe0a5A4xr+Rgj26quK -2qJLym0mmul/uh2M8z486qDTQYQaTEppFCosH3WqFonTN2LWpHcujeVABXkAe9qo -DHBZZRMw8CXtiEwvJ/xV/MXTR7G0QCqT4HF045SAyyBjusBiiGly32JEDD4FdjHj -KKUrAJyyoc6frake7ZMO0SO3tQNwmi4T5KLSoxhi3Zgez2k9GPZEj4/W7l5Ne0zQ -7C8Tgo8wraqj/8pzjfP6+Dc2LHOTtu8DGDQkXEFa9VvuAotOtI8Kjff+bOd36WTL -L2dk69Bb7WbhRLkkavHZCdKOpfyBtVn+hGWRABEBAAG0G0RhdmlkIEZhdXJlIDxm -YXVyZUBrZGUub3JnPokBPQQTAQgAJwUCV81RHwIbAwUJCWYBgAULCQgHAgYVCAkK -CwIEFgIDAQIeAQIXgAAKCRBY0O5kikizu/01B/46hG+MaTFW1CVevZrGyPacmDRj -pQhx/ODadBkVXXaJyr7aNKT3EvAedyT82SGT/ch+aqXjZK1kEwK6zITqoOZZUt2I -CjBN4+UfLrWwlKldZShbhJ6NMHJIeYQ5EDlMw7TWVn0OPkRuDvLEasgOhxR9ZjWW -c5wlcZXXy8N+wGSR0bThzl0pdFcIy9Z3g411ZOvjUdDuWqtKUH9iy1VdVyba7FXI -x/BqAXIVsAaIFNsJBZZ7C7j1a1IlTykRLiDjh3mpyBfX4xfMTo4z6pjfQsoPebJl -TlCnwAkIxeyatGXm4OCqEA9zPVd1Ju7+XuEr6+15ENYJ4oYsZjfyScHHJdWMuQEN -BFfNUR8BCADe5wRc/QFL92npVAgzPQ9mJKopscRcxs0f2DM7EBPzUFvWGRIGRdB8 -obXfzBp4Pfyzqky7C1X/j7ENzx+Kol1AJ93wjUEfLoZ/zsvoj9ZT3GdjeVQeReKY -d4th7Jqo4qxvi33Pud0jZsENezzgdd4npiNN9bFX0mjNKNHL9o1n5nTm9pfDI/AS -PZz2RoRO7oUJb+aX6hKxTBaKoAiZHybAXQVchtwJx0O4wLbZ3E4ytJdcATlPDNXS -jw2Lmns8aGa6DBGyqiG6g1PlCnOI2Q/cQK1zbkSisfoCbpEq1MgIzuZSoJ00NIEp -eiACoR82565G68yAb+uKHkcFrYkfDT41ABEBAAGJASUEGAEIAA8FAlfNUR8CGwwF -CQlmAYAACgkQWNDuZIpIs7vWkgf9GNUZmD0UgbQmj0nwkEHum1g7LD+MZL0+P2kg -HyEL3Cm01ot9d+X5ed/gAJ6hDR55KYxHi+/wwwkCNDLoQoP+7VZq2fMiGD0/bDar -oWQqbckqDZU4l69u9NbYvVWHUerfwKfi0ZKN5sJqLwIkr57wEX0I/TBGoMuFB27q -2qyloS5m1Q2pke2mmZjKSqE0jxZJ7iFGJO/Buyjgd1B2kr0DaGaCrh0wjfVjAWpt -klK95Phry1jQc7W0Z4ZdWpB79S1yW670eutSC4fMjvsNxROGkPx4dDkyG5nToeau -zhEh/pXho2Eo/aFEqqY42GMSlN9rf7ekaTNo7OxsE7vvCB0fug== -=4o3u +mQENBFG1+bQBCAC3p+fdi9+55LFuKPqW0XrQkQQ2CRfXcM5lqb6B4xQewLorsdX7 +SRDmLzpdDZ9bCpqxMsiFbB+9lxljHNTzx9BIEO9w6aYtVgPsG4L9ZxwBXUTlgtIA +UoOy4lTQnUR0QDFlJQx8c4Cy82htOSCiWO4iaEvMbo+BGe8g4f2/N0tJOrnAc/xl +sdA64GTWId4NB12F+QeRgWWNQs/W/j/kyy37+L0juD06RMKth0uRMN37wEa9KcLa +lOBEUETrImZfx74wagt6WDnJknLf0ceqzfojk82po0C46BJAu49tLehYYKgo0HKZ +fK7CDw53y9SjkI8cU8g48AyUw8Uk/FyJeW1bABEBAAG0N0RhdmlkIEVkbXVuZHNv +biAoRGF2aWQgYXQgS0RFKSA8ZGF2aWRlZG11bmRzb25Aa2RlLm9yZz6JATgEEwEC +ACIFAlG1+bQCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEPVnVgXHTgLP +KD0H/0Cnj1bM6MYV5nKXJhLpd8as2OHFlhdtaU7QG3QcMVqdtP3rdOp1RgjmkYsB +xgwrxvDTLz0L/PH9UTCXjQeZgNR0hG8iy4IBC9ay0PDdkNpjnHoAiUMRstcDODUZ +QdLEOXCbPbRG3q0OlSaOvETL7YkSY8c2N6yqmWaJvudpJ0VVPyIWa2xT53JTXgAD +4m1w8MThAZBZpJi852nQCByCsRC+3cofA7bQd60XLiFWgmnq+rlqryMlWvUmMmat +e7U1NC5UsfH6ToXf/ZNZG+fMGE+ntYiHWRFr2tZMyXfUOrgHsAVMAE8v/xVtwS5e +VCAdM21GNG4d6XiF7T32GDzrEQm5AQ0EUbX5tAEIAL0uLkPxHbg9boIuVdahyy6F +BOcUf8xj3qj8FUGpRkcSSsoyvFTHZRTR+wwTPTaZzzzTFSITRGVv7vdKyl/A+SMw +/nlUVfB9xGvvCgzPGesUk9lmxX2DRVpoq9CyVIw0XXJQtNkC3O1yEws4zuDzHe99 +sfDvXpA1ikfN+Hgn3oLjCHHtWuTyXGKXUimzToDMqWentVkP1rzKPlin9XJ0KDT/ +axrrD9L5s4KCjHdWEQwG3miJDxQnlsAFDBj7Bs8DZZE+xdzx/l8qBKOxmXD9ohFp +4q0wXVV4QJMHtjhvhId9EN965drlYmMfusMCwavklBOWdR1MdSSBIYPS5eISmj0A +EQEAAYkBHwQYAQIACQUCUbX5tAIbDAAKCRD1Z1YFx04Cz4CzCACpN1l39Yzoniqx +laabcOrEbFjhKXlFXPm5TC+nj2iO8BieJLoltTcQL1nbxBHcxMkxUUJAVKBSmlh3 +BPjYJhXBNRvW/gamjaO+LoStXI+0vO4aOhkR0tLqA9/zQFM9uVPu6InS0N98oMaL +azyxnXuqEanCN7yWfKHKxmkKiVMB1RMaE+2TYQBKPfFukiX2vv3qByVez8qYGa98 +80x6fkrqFbPoJ2oDXEGGD0W7fkv1pZV/1XCuXV/qKz3htD3AQDuLijqt6sM9Oe7Y +Lsv5lqTb5DK6g2N9xvhTz64Z+j9bf44fbMReg3ub3GXlf9rFT8eDYfyYLJgWJ/1h +YZximth9 +=QnRI +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBFaTa+4BCACxyJ3oTNhz5oJOCu70mrxFqj/uqDfNm2K8Prr0CQ2I7yXijfTZ +GVIjURIzp+Zhmc1LhZYlNwwI9ivFFvLoS9kH2rkx9EaIuP3ljtxQskRFrX4BepR9 +/EvIoi7tUuOEqCy2pRy/y7Rc7s3Qbu/sPQ17wvRQqzTKsvoh9wxat6990l1MFjlF +/xBOD4Qb9LJGzc6Y8SLEEs7l/vAesL0viOME1hVQk+fG0KFosI32aeNnnLHPZbLi +Z2YETvI5nROMhleSDusqUpVxXzkIBcVLbCyeJooRsZAhJ6AB8qvhOXx2xTBBgMpw +aE/DHF6ZkvmsVB6lRNqMLjGeLOkmqx1vjZynABEBAAG0IkJodXNoYW4gU2hhaCAo +a2RlKSA8YnNoYWhAa2RlLm9yZz6JATcEEwEIACEFAld3rtICGwMFCwkIBwIGFQgJ +CgsCBBYCAwECHgECF4AACgkQ/geEEX+84R1tfwf9GSACMGPFi9AArBwFhaYUKB4B +JqNgCSRvQJ7gtG6YAaW+o919AtmpO+nq0JtvrSXQVLbJ1jxEMXsNJnvZByiACm91 +u8z/LzMoI5C6RK13eGTTBr57LAE8lXI0xhkiSwQUAPQWJXumE1evoHExHrAi+z6a +La6QXwyqmP5amwked6S6R9GxGI2c+UPm9sVh4Lb1L/pEzeCdt7/1R1baAQ+weI1c +Vbfd4b9Qc5r/baq41CesZKz29UgorqiLyBXlWLUCClAXB/nrbAh7hR4pDhSsIExS +Tp8gBnBTpKc2NAzGZTxopcvi/SOAxkdFlfkBewXuvHOxg0S8s8z7Owaeckbj7bQg +Qmh1c2hhbiBTaGFoIDxiaHVzaDk0QGdtYWlsLmNvbT6JATcEEwEIACEFAlaTa+4C +GwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQ/geEEX+84R3CQggAmSPWL+WB +izj5WIcSZ2Ox1jCNnCcZ73K84s7ZSd83mq6fgi4O4/JqoZCMCU2YzMuo7Cs/h1UP +XkARgf/bPFi7XKvEytQd0lOSUSubn27ederXfUuhUo5FNneiyYBX9Ri1RjOPv5oE +3cmYWM34Xvl/O6ucRJ28s8Z9GuWG6NChbbHdkDIhulCzWWiMtIQXG7zGWRdjcqRI +tGVSjEaCdyWEL6i//5n0TiM+PPidmFO4A56blLCHrIe6MPW/fAiWBzWpTxTUpn66 +XC3AMBWdLT/5ZCNea1qXY+I/TBwIiBl1mKFN1j945j216mnX1IHBSR01yrMxsBnJ ++Hx3i32OxhEfjrQyQmh1c2hhbiBTaGFoIChteWtvbGFiIGFkZHJlc3MpIDxic2hh +aEBteWtvbGFiLmNvbT6JAU4EEwEIADgWIQQKrHdbtkN6jZr3o6z+B4QRf7zhHQUC +W4T3zwIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRD+B4QRf7zhHa3OB/0Q +BQ8tc6WukC9ubRd5A1vEe5tSWvzJEB25mc+YfXj3eha9ZhGWSNF7iHQ278aKgyn4 +HS/Mve+A+w7ZQWtGK1sjxC1E7qn1U1Xx5BoadbvEfN8E9Vun0NPLa/FXtz6gTnGP +OkgJ6NjQuEy6aKT9lGbHuxXBLPfGfEQrT16ny0+Nc3Is1cSIWsmyF59vZTH9Z8uJ +u2C04lyMkE6huTdbLm6YAFzN3U2B/96ZG/9GWr1EImuVg9z7vUIlENbG/ARHbdGd +TqwKzjLPMhMRmSQt9pjOA0K2/o9y7t6JgQiMC1DPl21INZHmYES9dlfyEiaLjVYk +VunL/tJHXO9RIoqWx5nPuQENBFaTa+4BCAC8D6XyewOHX+nTc4mBQfLmrmNJu6RX +7kY/cwvAsskevOTNPzgJJtnUJQI1iABWI7U88afjAvU1wzYrBfEfQ43h1cPw6NMY +4/cmHe8YimCgk8cNYKGS0sM3+YJ8hNTSGxKJa7Y3RDxDLK9fSqG1xa6URcctNT57 +rau7xUtVExFpN0qGeTtMAOLDp36wY+jSYBpVZ7/Z/j0SDQf9ShU0G2OZMKsZvcH1 +KadOVW4kT27ISHN7EJbjdMPCmZytJ+5Sxi9PFHYCr/nR1qBY/j0ouKS71uShzcss +z5WgnkmP87fvsfpfCQJl5SkiPavddodZoBCRRKwqQnV7ns3JFmh7U2+lABEBAAGJ +AR8EGAEIAAkFAlaTa+4CGwwACgkQ/geEEX+84R040gf9G+I/AM1ub7UAhPAQPZ25 +SdIaTH96MV5cmWsucTnGUy1XDh8I0hZaEB/kkWHOrmbKyqhg/NtgEqXtP/kqJX5r +uTt9AN3TSlxJ+IrCywCm33kS7yPRADgwNshoCf/HH3VujccN4KfDjIuijLSZbfIb +G6cGo2bgqz6t4p9NaZofcQhFfPwAgfv3IL1DNFqZvUohDPy/j5eU7IdDjytLnhGU +ZTfSrzhWXkCZybKROW05zScMRd5uL3b+in/Zu8rgeE/lLF8nmD42YJ058n+72LjR +7P5DqrblbAhLiQg8CBbrIFJozQUyUDnTzwsGRFuQAx7brypsOSqWfYcVEqXxiJwd +rLkBDQRaK92CAQgAuuXV+Yh0qYO6WQZLnE+X0BivPlRY1vH4B2zDgDBY0qrbIdPl +4/pvbwQLk/Vo2yVZqHfoGhbqnBkXZFpzV9QMOnEdrrMo8unm/02f7buEZ56XkkKT +pelsl63Qu0qu2/ISpfxCxRFLGZdj+VLA0SWhe0ecwgR+91ZvcKE1byfzG9+sbVY0 +v8WQq9Zfx0hUo/0Jf7+FAiUWIgmS6XHuCn+DYBTHrGcGEf+CU64+lfH5CbGz42AK +qsYzZwYWV4RarwNBVDuM6XdqlC9m4WcROos5qyV0XQ5sE/SByuHO1a5ZazFFPbrn +qiBtg1POQs4uQw4wU2RsEM+bGUIRNTFoIpjHsQARAQABiQJsBBgBCAAgFiEECqx3 +W7ZDeo2a96Os/geEEX+84R0FAlor3YICGwIBQAkQ/geEEX+84R3AdCAEGQEIAB0W +IQSzyzZlUlQL4G7prZcRloxEkoyu/AUCWivdggAKCRARloxEkoyu/GVJB/90wdV5 +Bsb53X/ai1HdScE7dP+clhDjVEgU87601F7cntzeo9EASso2YLdkXnNE4Gq8THUp +XLk/PLTlum5z2OrOYbcfrzWU1kLRguDgVciqcyI+4ev5P5wchTrLrROX7uyEGq5f +THYi7xEmolRGXFUEAcsWRGwS6DOq28sDSbho+LRLXyPBFVE6lTmXzjIaw5pxPgMX +HGPjb2vuHP3hcFS38CkbKgFgnvlCzeCea3y6rVs86xVUi/l1C/tAdTFHkxbQQzyo +bNWOF55ujh12iWOPFqlaLXSJcSgRb6JBumPS3X4g3DEOeWLKOXgqXXWdTz9n925G +1s9Zz5EqRGOPg5tUNpoH/iDhWtorPX9ypuWLPmJzq/e/6l7d1YY5p1FP88fG+33L +DOxP69pCqfIoS4h3xtIBtq6ZOD8veVhb4GXSX3o1/rHEur1wj8JdIKTiyLQcc0bE +/qqkU1z2wtPDnpDMiSp+K0XzuerrOkTR3Nvbjq1N3eAT7cp9u+t9jINBe4L36+Dz +QZdwUGvi7ojMPTY2vKM6VZSHEKDmw1C4Ifp9oSEVAlQk2AslldLA/8huA3V752+C +osVz4kO0g/fi1LqkTskFfRVO7Y1Zbs5N4qb/2rdXp4cYEmKNe/II+y9xoCxyobBE +ZBECLHCZfIdO2sB4nt72Y+0/G52cW2Gz2yjbP0MaZp25AQ0EWivdvQEIALOgPIfa +CxMoYYORHfLJsJ56uOGP6YchINfy7wGVvtNPvnbC4Xp6q8UPSijoukjafw5ZPZFu +BZ7E3Qq4Vx/eRTcHoYq40CahxFDmUvt6bnDCFlsMXNXCSOUtnhej5clMjCtm7awt +kOD25JQry3AmmxAeQv807LBciYy+/idRlav1sQyUOgchiS/nsSQX+lktjwXKks7Q +j/3Oplu+D8jTig2qGdNUredkbgZhsVsdvitmuJuBq3Iaw2ilX4l69g9ioxBi7481 +bmaLV1P2BtHsqUpmE7wpw4JdQ+NTBiAPuM+Oqo28mWTVoov5SH9QHOevgVJKCfM7 +RfBj8zGVJ3H/DcsAEQEAAYkBNgQYAQgAIBYhBAqsd1u2Q3qNmvejrP4HhBF/vOEd +BQJaK929AhsgAAoJEP4HhBF/vOEd33QIAIV/Wuhv+KHYKkKzwzJYqEZEKReFqSk9 +1W+etHDf72mPB3J+IfokNYCSgEm4R/570p9uIBBccxLPwTvbJU7v9Utvc0kFcu9t +xNWOge0W046qquRoWIwFZxbLwcSl8Xwlhitrt1TAZPrsIRxyzXzHeE9VTIAWQftn +jvRGp8KfdCXoLglMkb4KRF65pzMPf51hPSQ57b2VhmwZoh9Y4b5FM4cgKdoug2Ch +/gPFWTd0KGWuSRs8xKnUugk3X0j089po81j1DTcMezAz9QZbSs1qM1Phxl/SaJEE +wb/SP6PaGS9MPvfMpshuzz/St5LWesGCOJHMG6cWIm/QAFIuV7WWKpg= +=j9MJ +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGFVmzkBEAC9robLj4ZMjZ/EhHbiYpr2/i/uW38T6qP5mwpAGela3/NWhjzp +2a6rfuLTb6OtXkomcMiwzVXBm2VCoF5z7f23c5yCk4qPFnTNcYxmql1MaRrI4x9Z +b/iV6jit/FkiNPCc/89kvfWVMywCb/0uOGRbzw9lGNQH+2bJkHLDS38PfrABikOK +di75Ux1pOl64GVnKxqfXSB63d9eDtLELEbjvbPRdZJSuFTFLlR+uZKivsCx7LPhp +S/EPyW1SnV9Jy8ZAgMHz0VZnkZnC2W15uM8FP6ARUtxlYMptUuU79iERYKd0xwCH +JT4GI3PFMjAML/XHzkzzXJgkZm1YMjy2dNHKc07glA6efqrb82BzqWp6mfuUnYBl +nO54yDUwUeDWuRvZJwNxv0j31eADYlZoPkkPX6UWqayeAcPEBPofiasxUw5mIfP/ +3HAsJcDjf3Oj5tYyE7ELypqTWPvS2fBYCWwvipfxsOQmA9xvlCY2MGhAtTNceJcb +324bOLpuwA2GWmsyHw+c3bvLD7PDaeLZ7kjqu1NBqgwDESgO7sPrWKM4Gaclgr9s +Atvfr/vlkHRCTZhpluZuW/JIuiprc9O/ZigT9A9lxbQe1Cm0VPNHk+zDl/wPTv7J +EC5OGPAY7G6s7bQLxp7C7FulOZcjKWmnEBWVV1O7iee8YZQ5vZTmTNI2VQARAQAB +tCZKb25hdGhhbiBFc2stUmlkZGVsbCA8anJAanJpZGRlbGwub3JnPokCTgQTAQoA +OBYhBOCj6yAvjldSjhPnL9dXRIO7V7GNBQJhVZs5AhsDBQsJCAcCBhUKCQgLAgQW +AgMBAh4BAheAAAoJENdXRIO7V7GNcZEP/RhsneV30lQg4Qj7Jd/uFhhrvMHTatw8 +F18bMWr7g/sbQ0z7cewT8YM+2W29FC4k3gZHA8Lwfq8g5LAM8Gbvaggn7LrTvglL +i+hX/U4iU7LoqyH1tpyZEPD08qqUkjER8bfLflBElISjGb7xeJMbhS+10vt8QQQl +W7MqRQQo0bYB6foLrmW3avzZz/mb2IL3RAWgowQJ9rxG+oW+3lFCjSGvxXaq/BGc +Dajkq9UeDGCR3RHOjkDVEX6xuS7D76K0Y32bgYbsDzHkDHRm5vR0LXxQKUC59OQE +oNLCdOdFlX4m1Lm2sUa/vXnjrpOPAJvij+LwDt/SB1GygJ/qitO+riTtgSbmyTY8 +4xX4dAh4Nenmk1JF3phfwa3nmJzVu7oiCvKTsVrf8gnJUPq8MsgUuWgQ9qu0UXWR +bFnnckVsj6xBGuPIgrlGk2V9RTqiReJTsU/RdypVzO6rshEyLWS0TCzygHrZk3IS +4pORUt6itUlJSCdvZRDa3AhPUkQt3Iso0S8oZWzP+zlXMvYFvF1pgtzi9cPqbgJJ +4uQJ858uqw0jwjFM3CYyrVrLWNY2kPIPVbeTH6Bh6nQp4Q0KXnDubcUbbpd2xMHl +tHEI6gma9ATha+u/OMjYgXpkAP8UECcF1CD+wIC4c4pbSFnOmhRai92MjbMkb905 +kYzU/1S3qZ9nuQINBGFVmzkBEACU19R68g6TnrnpUCywwCTVZJkY2JVpSlQGYXjd +gC61Kt0vjMCA7sdckSqfE0qTIjxHmDB78F2cpSfDmKEgd8GYdxMuUqTWS7UWRD3R +bvDUBRLG/KMig+6HGe+NzxOv+vwCcnvM3LAZP/k/UMbVAOYQFARvm136UOaTnq1B +vsnDAMoO+US72OWVXzTWcgbJLoLq0HKfCrA0fDKnnh0HPGQ+58qPfoWuatZwg+O6 +0oIE2d5qLrSxAPuUJjaWD1ylNlSbunQNbgHmM1eKK36RUNOc1fDGPWQ1E0+eZuZY +5HfnHFDliZ5rsJsKrqOFhANcRu7BpOWGVSBqms+NjkCUOGwU7ir9jgIBDxdju38u +ri3BCDSYPrDrsuFPSLIab/BuaEcbzLsgAAooMbMHFy2WBqw1WtJatGhg+naoJjha +xbecaOgU140ObnqQdRd2PpLmIRAze5oFvj9TL6NEvkkhWoOW3MUHbV/sgilvN4pu +L+J+ligowbwhny+yfk0XtXZk9nU0/en9UYUFvyQgxi9l+KE6wyl1N74RHvELtPOp +60lOMCB/CAF+q5D3XI4g9LNv3kyCBp40Fq5XiVcMOMamNxq7vc8+2IaSzRiySeQ6 +9hddhKf7Rm7x4ZjW3bVxFu0DAQi4CSAsz3A+/g0z4GDrZDqZyNy0VxcXTE9ZZrih +NvoTvQARAQABiQI2BBgBCgAgFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmFVmzkC +GwwACgkQ11dEg7tXsY0EZRAAh9MbJCBdbVa5h2m3AAbYG+BMZsOeSESQCuy0bM7z +7WShfSafeGE/KhJuAKZtBHopLA1VCF74h3vNwwDxAG+8qbzGxuuzV+Tx18vyiY3d +Wlf30L1ypq6fO53fuZSgPB0gzjCoDcJeSDg7FdTcqMzjumys3ThvOBTHB1gwzQWu +eZ8CSxKvd34J7CQ7bUpxjDvgZpI3gbdW37F11KUgLF+HtD1bO9SzTs9rdpGpFesS +joF2pl2C0plzlB40xgb+CW4GL7T253x1xKejCeas2E4ImmD2ONuOqp7Q31x456cQ +r/WqJe7A4lIDRVza2/Nd0qGBCEILmMlIMD+YpZdQv+WO/d6Gv65wt4O+ufjudKcI +sIryz7bVC28zOiAwmVmnDhOkAakAkIJVTMa9xyFVtquBfj9z9mg6W7LLw96tAVXT +6yKkQRHkQ2/36uBgsrl2z+k+mFWm4IS2RGgDfTtrq4nl/LGwyb9T0MDuFZ8FUPUN +PK28Z1iYWb0tTda5Qc5aCraZcFr0aR4PYToBvt5mvrV+TGvfdVzva/JjcRwtFnwo +RUqSlBSJqC4WqZmkB73i16MljvT0+4v2upmud4JKw2KTowhZjbGLlBgrAMxuDYNv +953PoIbKKuD9uwdPkCrkuL1XQsBDWsHgW9DQ4q0bObr0ZBxJWUzLj/5Ew1iFLz5O +oS4= +=yOFv -----END PGP PUBLIC KEY BLOCK----- diff -Nru dwayland-5.57.0.23/debian/watch dwayland-5.57.0.24+really5.24.3/debian/watch --- dwayland-5.57.0.23/debian/watch 2023-01-11 08:22:02.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/debian/watch 2023-01-11 12:23:55.000000000 +0000 @@ -1,3 +1,2 @@ version=4 - -opts=pgpsigurlmangle=s/$/.sig/ https://download.kde.org/stable/frameworks/([\d.]+)/kwayland-([\d.]+)\.tar\.xz +opts=pgpsigurlmangle=s/$/.sig/ https://download.kde.org/stable/plasma/([\d.]+)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru dwayland-5.57.0.23/DESIGN.md dwayland-5.57.0.24+really5.24.3/DESIGN.md --- dwayland-5.57.0.23/DESIGN.md 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/DESIGN.md 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,84 @@ +# History + +We started out with one method of generting classes. We then ported to a new approach of using QtWaylandScanner to reduce a lot of boiler plate. + +New classes should use the new approach. + +# New Approach + +A public facing PIMPL class which should inherit from QObject. +A private class that should inherit from QtWaylandServer::interface_name which is auto-generated. This will manage individual resources, handle callbacks and QString conversions. + +Class Names should map to the interface name in UpperCamelCase. +Where a V1 exists in the interface name, this should be mirrored in the file and class name. + +An implementation should handle all versions of a given interface, but not different interfaces which represent different versions. + +(i.e zxdg_output_manager_v1 versions 1 2 and 3 would be wrapped in one class XdgOutputManagerV1Interface. A zxdg_output_manager_v2 protocol would be exposed as a new public class XdgOutputManagerV2Interface) + +# Implementations + +There are 3 modes of operation happening within the exported classes of DWayland + +The generated classes can behave in all these modes, it is up to our implementation to use the correct methods. + +## Globals +e.g BlurManager + +This represents an object listed by the Display class. +Use the interface_name::(wl_display*, int version) constructor within the private class to create an instance. + + +## Server-managed multicasting resources +e.g XdgOutput + +This is where one QObject represents multiple Resources. + +Use the method +```cpp +QtWaylandServer::interface_name::add(client, id, version) +``` + +to create a a new Resource instance managed by this object. + +Use the event method with the wl_resource* overload to send events. + +```cpp +for (auto resource : resourceMap()) +{ + send_some_method(resource->handle, arg1, arg2); +} +``` + +methods to send requests to all clients. + +## Client-owned Resources: + +e.g BlurInterface + +This is where one instance of our public class represents a single resource. Typically the lifespan of the exported class matches our resource. + +In the private class use the QtWaylandServer::interface_name(wl_resource*) constructor to create a wrapper bound to a specific resource. + +Use +```cpp +send_some_method(arg1, args2) +``` +methods of the privateClass to send events to the resource set in the constructor + + +## Other hooks + +`_bind_resource` is called whenever a resource is bound. This exists for all generated classes in all the operating modes + +`_destroy_resource` is a hook called whenever a resource has been unbound. +Note one should not call wl_resource_destroy in this hook. + +## Resource destructors + +destructors (tagged with type="destructor" in the XML) are not handled specially in QtWayland it is up to the class implementation to implement the event handler and call +```cpp +wl_resource_destroy(resource->handle) +``` +in the relevant method + diff -Nru dwayland-5.57.0.23/docs/Doxyfile.local dwayland-5.57.0.24+really5.24.3/docs/Doxyfile.local --- dwayland-5.57.0.23/docs/Doxyfile.local 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/docs/Doxyfile.local 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,10 @@ +### KApiDox Project-specific Overrides File + +# define so that deprecated API is not skipped +PREDEFINED += \ + "KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(x, y)=1" \ + "KWAYLANDCLIENT_BUILD_DEPRECATED_SINCE(x, y)=1" \ + "KWAYLANDCLIENT_DEPRECATED_VERSION(x, y, t)=" \ + "KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(x, y)=1" \ + "KWAYLANDSERVER_BUILD_DEPRECATED_SINCE(x, y)=1" \ + "KWAYLANDSERVER_DEPRECATED_VERSION(x, y, t)=" diff -Nru dwayland-5.57.0.23/DWaylandConfig.cmake.in dwayland-5.57.0.24+really5.24.3/DWaylandConfig.cmake.in --- dwayland-5.57.0.23/DWaylandConfig.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/DWaylandConfig.cmake.in 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(Qt5Gui "@QT_MIN_VERSION@") +find_dependency(Wayland "@WAYLAND_MIN_VERSION@") + +include("${CMAKE_CURRENT_LIST_DIR}/DWaylandTargets.cmake") +@PACKAGE_INCLUDE_QCHTARGETS@ diff -Nru dwayland-5.57.0.23/.git-blame-ignore-revs dwayland-5.57.0.24+really5.24.3/.git-blame-ignore-revs --- dwayland-5.57.0.23/.git-blame-ignore-revs 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.git-blame-ignore-revs 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1 @@ +e45fb8342b9fde8ca260418020442a9cc9b12bf7 diff -Nru dwayland-5.57.0.23/.github/workflows/backup-to-gitlab.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/backup-to-gitlab.yml --- dwayland-5.57.0.23/.github/workflows/backup-to-gitlab.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/backup-to-gitlab.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -name: backup to gitlab -on: [push] - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -jobs: - backup-to-gitlabwh: - uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master - secrets: - BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }} - - backup-to-gitee: - uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master - secrets: - GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }} diff -Nru dwayland-5.57.0.23/.github/workflows/call-auto-tag.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-auto-tag.yml --- dwayland-5.57.0.23/.github/workflows/call-auto-tag.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-auto-tag.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -name: auto tag - -on: - pull_request_target: - types: [opened, synchronize, closed] - paths: - - "debian/changelog" - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - auto_tag: - uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master - secrets: inherit diff -Nru dwayland-5.57.0.23/.github/workflows/call-build-deb.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-build-deb.yml --- dwayland-5.57.0.23/.github/workflows/call-build-deb.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-build-deb.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -name: Call build-deb -on: - pull_request_target: - paths-ignore: - - ".github/workflows/**" - types: [ opened, closed, synchronize ] - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - check_job: - if: github.event.action != 'closed' || github.event.pull_request.merged - uses: linuxdeepin/.github/.github/workflows/build-deb.yml@master - secrets: - BridgeToken: ${{ secrets.BridgeToken }} diff -Nru dwayland-5.57.0.23/.github/workflows/call-build-distribution.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-build-distribution.yml --- dwayland-5.57.0.23/.github/workflows/call-build-distribution.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-build-distribution.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -name: Call build-distribution -on: - push: - paths-ignore: - - ".github/workflows/**" - pull_request_target: - paths-ignore: - - ".github/workflows/**" - -jobs: - check_job: - uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master - secrets: - BUILD_GPG_PRIVATE_KEY: ${{ secrets.BUILD_GPG_PRIVATE_KEY }} - BUILD_SSH_PRIVATE_KEY: ${{ secrets.BUILD_SSH_PRIVATE_KEY }} - WEBDAV_PASSWD: ${{ secrets.WEBDAV_PASSWD }} - WEBDAV_USER: ${{ secrets.WEBDAV_USER }} diff -Nru dwayland-5.57.0.23/.github/workflows/call-chatOps.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-chatOps.yml --- dwayland-5.57.0.23/.github/workflows/call-chatOps.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-chatOps.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -name: chatOps -on: - issue_comment: - types: [created] - -jobs: - chatopt: - uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff -Nru dwayland-5.57.0.23/.github/workflows/call-clacheck.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-clacheck.yml --- dwayland-5.57.0.23/.github/workflows/call-clacheck.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-clacheck.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -name: Call CLA check -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened, closed, synchronize] - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - clacheck: - uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff -Nru dwayland-5.57.0.23/.github/workflows/call-commitlint.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-commitlint.yml --- dwayland-5.57.0.23/.github/workflows/call-commitlint.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-commitlint.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -name: Call commitlint -on: - pull_request_target: - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - check_job: - uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master diff -Nru dwayland-5.57.0.23/.github/workflows/call-license-check.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-license-check.yml --- dwayland-5.57.0.23/.github/workflows/call-license-check.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-license-check.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -name: Call License and README Check -on: - pull_request_target: - types: [opened, synchronize, reopened] - -permissions: - pull-requests: write - contents: read - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - license-check: - uses: linuxdeepin/.github/.github/workflows/license-check.yml@master diff -Nru dwayland-5.57.0.23/.github/workflows/call-tag-build.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/call-tag-build.yml --- dwayland-5.57.0.23/.github/workflows/call-tag-build.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/call-tag-build.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -name: tag build -on: - push: - tags: "*" - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -jobs: - build: - uses: linuxdeepin/.github/.github/workflows/tag-build.yml@master - secrets: inherit diff -Nru dwayland-5.57.0.23/.github/workflows/cppcheck.yml dwayland-5.57.0.24+really5.24.3/.github/workflows/cppcheck.yml --- dwayland-5.57.0.23/.github/workflows/cppcheck.yml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.github/workflows/cppcheck.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -name: cppcheck -on: - pull_request_target: - paths-ignore: - - ".github/workflows/**" - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - cppchceck: - name: cppcheck - runs-on: ubuntu-latest - steps: - - run: export - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - persist-credentials: false - - uses: linuxdeepin/action-cppcheck@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - pull_request_id: ${{ github.event.pull_request.number }} - allow_approve: false diff -Nru dwayland-5.57.0.23/.gitignore dwayland-5.57.0.24+really5.24.3/.gitignore --- dwayland-5.57.0.23/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.gitignore 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,28 @@ +# Ignore the following files +*~ +*.[oa] +*.diff +*.kate-swp +*.kdev4 +.kdev_include_paths +*.kdevelop.pcs +*.moc +*.moc.cpp +*.orig +*.user +.*.swp +.swp.* +Doxyfile +Makefile +avail +random_seed +/build*/ +CMakeLists.txt.user* +*.unc-backup* +.cmake/ +/.clang-format +/compile_commands.json +.clangd +.idea +/cmake-build* +.cache diff -Nru dwayland-5.57.0.23/.gitlab-ci.yml dwayland-5.57.0.24+really5.24.3/.gitlab-ci.yml --- dwayland-5.57.0.23/.gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.gitlab-ci.yml 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +include: + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml diff -Nru dwayland-5.57.0.23/.kde-ci.yml dwayland-5.57.0.24+really5.24.3/.kde-ci.yml --- dwayland-5.57.0.23/.kde-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.kde-ci.yml 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +Dependencies: +- 'on': ['@all'] + 'require': + 'frameworks/extra-cmake-modules': '@latest' + 'frameworks/kwayland': '@latest' + 'libraries/plasma-wayland-protocols': '@latest' diff -Nru dwayland-5.57.0.23/KF5WaylandConfig.cmake.in dwayland-5.57.0.24+really5.24.3/KF5WaylandConfig.cmake.in --- dwayland-5.57.0.23/KF5WaylandConfig.cmake.in 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/KF5WaylandConfig.cmake.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) -find_dependency(Qt5Gui @REQUIRED_QT_VERSION@) - -include("${CMAKE_CURRENT_LIST_DIR}/KF5WaylandTargets.cmake") -@PACKAGE_INCLUDE_QCHTARGETS@ - -function(kwaylandtest testBinaryName) - - add_test(NAME ${testBinaryName}-kwayland-test COMMAND - @CMAKE_INSTALL_FULL_LIBEXECDIR@/org-kde-kf5-kwayland-testserver ${CMAKE_CURRENT_BINARY_DIR}/${testBinaryName} - ) -endfunction() diff -Nru dwayland-5.57.0.23/LICENSES/BSD-3-Clause.txt dwayland-5.57.0.24+really5.24.3/LICENSES/BSD-3-Clause.txt --- dwayland-5.57.0.23/LICENSES/BSD-3-Clause.txt 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/BSD-3-Clause.txt 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,26 @@ +Copyright (c) . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru dwayland-5.57.0.23/LICENSES/GPL-2.0-or-later.txt dwayland-5.57.0.24+really5.24.3/LICENSES/GPL-2.0-or-later.txt --- dwayland-5.57.0.23/LICENSES/GPL-2.0-or-later.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/GPL-2.0-or-later.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ -GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. - -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to -most of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software -is covered by the GNU Lesser General Public License instead.) You can apply -it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom -to distribute copies of free software (and charge for this service if you -wish), that you receive source code or can get it if you want it, that you -can change the software or use pieces of it in new free programs; and that -you know you can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to -deny you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of -the software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or -for a fee, you must give the recipients all the rights that you have. You -must make sure that they, too, receive or can get the source code. And you -must show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) -offer you this license which gives you legal permission to copy, distribute -and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If -the software is modified by someone else and passed on, we want its recipients -to know that what they have is not the original, so that any problems introduced -by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We -wish to avoid the danger that redistributors of a free program will individually -obtain patent licenses, in effect making the program proprietary. To prevent -this, we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification -follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms -of this General Public License. The "Program", below, refers to any such program -or work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or translated -into another language. (Hereinafter, translation is included without limitation -in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered -by this License; they are outside its scope. The act of running the Program -is not restricted, and the output from the Program is covered only if its -contents constitute a work based on the Program (independent of having been -made by running the Program). Whether that is true depends on what the Program -does. - -1. You may copy and distribute verbatim copies of the Program's source code -as you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence -of any warranty; and give any other recipients of the Program a copy of this -License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you -may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, -thus forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all -of these conditions: - -a) You must cause the modified files to carry prominent notices stating that -you changed the files and the date of any change. - -b) You must cause any work that you distribute or publish, that in whole or -in part contains or is derived from the Program or any part thereof, to be -licensed as a whole at no charge to all third parties under the terms of this -License. - -c) If the modified program normally reads commands interactively when run, -you must cause it, when started running for such interactive use in the most -ordinary way, to print or display an announcement including an appropriate -copyright notice and a notice that there is no warranty (or else, saying that -you provide a warranty) and that users may redistribute the program under -these conditions, and telling the user how to view a copy of this License. -(Exception: if the Program itself is interactive but does not normally print -such an announcement, your work based on the Program is not required to print -an announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, -and its terms, do not apply to those sections when you distribute them as -separate works. But when you distribute the same sections as part of a whole -which is a work based on the Program, the distribution of the whole must be -on the terms of this License, whose permissions for other licensees extend -to the entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise -the right to control the distribution of derivative or collective works based -on the Program. - -In addition, mere aggregation of another work not based on the Program with -the Program (or with a work based on the Program) on a volume of a storage -or distribution medium does not bring the other work under the scope of this -License. - -3. You may copy and distribute the Program (or a work based on it, under Section -2) in object code or executable form under the terms of Sections 1 and 2 above -provided that you also do one of the following: - -a) Accompany it with the complete corresponding machine-readable source code, -which must be distributed under the terms of Sections 1 and 2 above on a medium -customarily used for software interchange; or, - -b) Accompany it with a written offer, valid for at least three years, to give -any third party, for a charge no more than your cost of physically performing -source distribution, a complete machine-readable copy of the corresponding -source code, to be distributed under the terms of Sections 1 and 2 above on -a medium customarily used for software interchange; or, - -c) Accompany it with the information you received as to the offer to distribute -corresponding source code. (This alternative is allowed only for noncommercial -distribution and only if you received the program in object code or executable -form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all -the source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code distributed -need not include anything that is normally distributed (in either source or -binary form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component itself -accompanies the executable. - -If distribution of executable or object code is made by offering access to -copy from a designated place, then offering equivalent access to copy the -source code from the same place counts as distribution of the source code, -even though third parties are not compelled to copy the source along with -the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except -as expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses terminated -so long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed -it. However, nothing else grants you permission to modify or distribute the -Program or its derivative works. These actions are prohibited by law if you -do not accept this License. Therefore, by modifying or distributing the Program -(or any work based on the Program), you indicate your acceptance of this License -to do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor -to copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of -the rights granted herein. You are not responsible for enforcing compliance -by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement -or for any other reason (not limited to patent issues), conditions are imposed -on you (whether by court order, agreement or otherwise) that contradict the -conditions of this License, they do not excuse you from the conditions of -this License. If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, then as -a consequence you may not distribute the Program at all. For example, if a -patent license would not permit royalty-free redistribution of the Program -by all those who receive copies directly or indirectly through you, then the -only way you could satisfy both it and this License would be to refrain entirely -from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and -the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents -or other property right claims or to contest validity of any such claims; -this section has the sole purpose of protecting the integrity of the free -software distribution system, which is implemented by public license practices. -Many people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose -that choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original copyright -holder who places the Program under this License may add an explicit geographical -distribution limitation excluding those countries, so that distribution is -permitted only in or among countries not thus excluded. In such case, this -License incorporates the limitation as if written in the body of this License. - -9. The Free Software Foundation may publish revised and/or new versions of -the General Public License from time to time. Such new versions will be similar -in spirit to the present version, but may differ in detail to address new -problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies -a version number of this License which applies to it and "any later version", -you have the option of following the terms and conditions either of that version -or of any later version published by the Free Software Foundation. If the -Program does not specify a version number of this License, you may choose -any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing and reuse -of software generally. - - NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR -THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE -STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM -"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE -OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE -OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA -OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES -OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH -HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible -use to the public, the best way to achieve this is to make it free software -which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - - - -Copyright (C) - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 2 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 51 Franklin -Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when -it starts in an interactive mode: - -Gnomovision version 69, Copyright (C) year name of author Gnomovision comes -with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, -and you are welcome to redistribute it under certain conditions; type `show -c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than `show w' and `show c'; they could even be mouse-clicks -or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here -is a sample; alter the names: - -Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' -(which makes passes at compilers) written by James Hacker. - -, 1 April 1989 Ty Coon, President of Vice This General -Public License does not permit incorporating your program into proprietary -programs. If your program is a subroutine library, you may consider it more -useful to permit linking proprietary applications with the library. If this -is what you want to do, use the GNU Lesser General Public License instead -of this License. diff -Nru dwayland-5.57.0.23/LICENSES/LGPL-2.1-only.txt dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-2.1-only.txt --- dwayland-5.57.0.23/LICENSES/LGPL-2.1-only.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-2.1-only.txt 2022-11-18 03:38:26.000000000 +0000 @@ -3,173 +3,465 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. +[This is the first released version of the Lesser GPL. It also counts as the +successor of the GNU Library Public License, version 2, hence the version +number 2.1.] -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. - -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. +Preamble -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software Foundation +and other authors who decide to use it. You can use it too, but we suggest +you first think carefully about whether this license or the ordinary General +Public License is the better strategy to use in any particular case, based +on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you +wish); that you receive source code or can get it if you want it; that you +can change the software and use pieces of it in new free programs; and that +you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors +to deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of +the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for +a fee, you must give the recipients all the rights that we gave you. You must +make sure that they, too, receive or can get the source code. If you link +other code with the library, you must provide complete object files to the +recipients, so that they can relink them with the library after making changes +to the library and recompiling it. And you must show them these terms so they +know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, +and (2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not +the original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order +to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less +to protect the user's freedom than the ordinary General Public License. It +also provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary +General Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library +to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables +many more people to use the whole GNU operating system, as well as its variant, +the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in +order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. - -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - - a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - - e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - - b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". + +A "library" means a collection of software functions and/or data prepared +so as to be conveniently linked with application programs (which use some +of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means either +the Library or any derivative work under copyright law: that is to say, a +work containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, translation +is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications +to it. For a library, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus +the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running a program +using the Library is not restricted, and output from such a program is covered +only if its contents constitute a work based on the Library (independent of +the use of the Library in a tool for writing it). Whether that is true depends +on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to +the absence of any warranty; and distribute a copy of this License along with +the Library. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all +of these conditions: + + a) The modified work must itself be a software library. + +b) You must cause the files modified to carry prominent notices stating that +you changed the files and the date of any change. + +c) You must cause the whole of the work to be licensed at no charge to all +third parties under the terms of this License. + +d) If a facility in the modified Library refers to a function or a table of +data to be supplied by an application program that uses the facility, other +than as an argument passed when the facility is invoked, then you must make +a good faith effort to ensure that, in the event an application does not supply +such function or table, the facility still operates, and performs whatever +part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose +that is entirely well-defined independent of the application. Therefore, Subsection +2d requires that any application-supplied function or table used by this function +must be optional: if the application does not supply it, the square root function +must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Library, and can be reasonably +considered independent and separate works in themselves, then this License, +and its terms, do not apply to those sections when you distribute them as +separate works. But when you distribute the same sections as part of a whole +which is a work based on the Library, the distribution of the whole must be +on the terms of this License, whose permissions for other licensees extend +to the entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works based +on the Library. + +In addition, mere aggregation of another work not based on the Library with +the Library (or with a work based on the Library) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. +(If a newer version than version 2 of the ordinary GNU General Public License +has appeared, then you can specify that version instead if you wish.) Do not +make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated +place, then offering equivalent access to copy the source code from the same +place satisfies the requirement to distribute the source code, even though +third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, +is called a "work that uses the Library". Such a work, in isolation, is not +a derivative work of the Library, and therefore falls outside the scope of +this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions +of the Library), rather than a "work that uses the library". The executable +is therefore covered by this License. Section 6 states terms for distribution +of such executables. + +When a "work that uses the Library" uses material from a header file that +is part of the Library, the object code for the work may be a derivative work +of the Library even though the source code is not. Whether this is true is +especially significant if the work can be linked without the Library, or if +the work is itself a library. The threshold for this to be true is not precisely +defined by law. + +If such an object file uses only numerical parameters, data structure layouts +and accessors, and small macros and small inline functions (ten lines or less +in length), then the use of the object file is unrestricted, regardless of +whether it is legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute +the object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are linked +directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions +of the Library, and distribute that work under terms of your choice, provided +that the terms permit modification of the work for the customer's own use +and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library +is used in it and that the Library and its use are covered by this License. +You must supply a copy of this License. If the work during execution displays +copyright notices, you must include the copyright notice for the Library among +them, as well as a reference directing the user to the copy of this License. +Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source +code for the Library including whatever changes were used in the work (which +must be distributed under Sections 1 and 2 above); and, if the work is an +executable linked with the Library, with the complete machine-readable "work +that uses the Library", as object code and/or source code, so that the user +can modify the Library and then relink to produce a modified executable containing +the modified Library. (It is understood that the user who changes the contents +of definitions files in the Library will not necessarily be able to recompile +the application to use the modified definitions.) + +b) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (1) uses at run time a copy of the library +already present on the user's computer system, rather than copying library +functions into the executable, and (2) will operate properly with a modified +version of the library, if the user installs one, as long as the modified +version is interface-compatible with the version that the work was made with. + +c) Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, for +a charge no more than the cost of performing this distribution. + +d) If distribution of the work is made by offering access to copy from a designated +place, offer equivalent access to copy the above specified materials from +the same place. + +e) Verify that the user has already received a copy of these materials or +that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable +from it. However, as a special exception, the materials to be distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating system. +Such a contradiction means you cannot use both them and the Library together +in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side +in a single library together with other library facilities not covered by +this License, and distribute such a combined library, provided that the separate +distribution of the work based on the Library and of the other library facilities +is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be distributed +under the terms of the Sections above. + +b) Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the accompanying +uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to +copy, modify, sublicense, link with, or distribute the Library is void, and +will automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will not +have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Library or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the Library +(or any work based on the Library), you indicate your acceptance of this License +to do so, and all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor +to copy, distribute, link with or modify the Library subject to these terms +and conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of +this License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as +a consequence you may not distribute the Library at all. For example, if a +patent license would not permit royalty-free redistribution of the Library +by all those who receive copies directly or indirectly through you, then the +only way you could satisfy both it and this License would be to refrain entirely +from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system which is implemented by public license practices. +Many people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose +that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that version +or of any later version published by the Free Software Foundation. If the +Library does not specify a license version number, you may choose any version +ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author +to ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE +OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA +OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES +OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries -If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). - -To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - one line to give the library's name and an idea of what it does. - Copyright (C) year name of author - - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: +If you develop a new library, and you want it to be of the greatest possible +use to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under +these terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the "copyright" +line and a pointer to where the full notice is found. + +< one line to give the library's name and an idea of what it does. > + +Copyright (C) < year > < name of author > + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) +any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 51 +Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information +on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here +is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in + the library `Frob' (a library for tweaking knobs) written + by James Random Hacker. -signature of Ty Coon, 1 April 1990 +< signature of Ty Coon > , 1 April 1990 + Ty Coon, President of Vice + That's all there is to it! diff -Nru dwayland-5.57.0.23/LICENSES/LGPL-2.1-or-later.txt dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-2.1-or-later.txt --- dwayland-5.57.0.23/LICENSES/LGPL-2.1-or-later.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-2.1-or-later.txt 2022-11-18 03:38:26.000000000 +0000 @@ -3,173 +3,466 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. +[This is the first released version of the Lesser GPL. It also counts as the +successor of the GNU Library Public License, version 2, hence the version +number 2.1.] -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. - -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. +Preamble -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software Foundation +and other authors who decide to use it. You can use it too, but we suggest +you first think carefully about whether this license or the ordinary General +Public License is the better strategy to use in any particular case, based +on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you +wish); that you receive source code or can get it if you want it; that you +can change the software and use pieces of it in new free programs; and that +you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors +to deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of +the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for +a fee, you must give the recipients all the rights that we gave you. You must +make sure that they, too, receive or can get the source code. If you link +other code with the library, you must provide complete object files to the +recipients, so that they can relink them with the library after making changes +to the library and recompiling it. And you must show them these terms so they +know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, +and (2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not +the original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order +to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less +to protect the user's freedom than the ordinary General Public License. It +also provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary +General Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library +to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables +many more people to use the whole GNU operating system, as well as its variant, +the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in +order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. - -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - - a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - - e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - - b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". + +A "library" means a collection of software functions and/or data prepared +so as to be conveniently linked with application programs (which use some +of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means either +the Library or any derivative work under copyright law: that is to say, a +work containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, translation +is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications +to it. For a library, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus +the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running a program +using the Library is not restricted, and output from such a program is covered +only if its contents constitute a work based on the Library (independent of +the use of the Library in a tool for writing it). Whether that is true depends +on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to +the absence of any warranty; and distribute a copy of this License along with +the Library. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all +of these conditions: + + a) The modified work must itself be a software library. + +b) You must cause the files modified to carry prominent notices stating that +you changed the files and the date of any change. + +c) You must cause the whole of the work to be licensed at no charge to all +third parties under the terms of this License. + +d) If a facility in the modified Library refers to a function or a table of +data to be supplied by an application program that uses the facility, other +than as an argument passed when the facility is invoked, then you must make +a good faith effort to ensure that, in the event an application does not supply +such function or table, the facility still operates, and performs whatever +part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose +that is entirely well-defined independent of the application. Therefore, Subsection +2d requires that any application-supplied function or table used by this function +must be optional: if the application does not supply it, the square root function +must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Library, and can be reasonably +considered independent and separate works in themselves, then this License, +and its terms, do not apply to those sections when you distribute them as +separate works. But when you distribute the same sections as part of a whole +which is a work based on the Library, the distribution of the whole must be +on the terms of this License, whose permissions for other licensees extend +to the entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works based +on the Library. + +In addition, mere aggregation of another work not based on the Library with +the Library (or with a work based on the Library) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. +(If a newer version than version 2 of the ordinary GNU General Public License +has appeared, then you can specify that version instead if you wish.) Do not +make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated +place, then offering equivalent access to copy the source code from the same +place satisfies the requirement to distribute the source code, even though +third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, +is called a "work that uses the Library". Such a work, in isolation, is not +a derivative work of the Library, and therefore falls outside the scope of +this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions +of the Library), rather than a "work that uses the library". The executable +is therefore covered by this License. Section 6 states terms for distribution +of such executables. + +When a "work that uses the Library" uses material from a header file that +is part of the Library, the object code for the work may be a derivative work +of the Library even though the source code is not. Whether this is true is +especially significant if the work can be linked without the Library, or if +the work is itself a library. The threshold for this to be true is not precisely +defined by law. + +If such an object file uses only numerical parameters, data structure layouts +and accessors, and small macros and small inline functions (ten lines or less +in length), then the use of the object file is unrestricted, regardless of +whether it is legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute +the object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are linked +directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions +of the Library, and distribute that work under terms of your choice, provided +that the terms permit modification of the work for the customer's own use +and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library +is used in it and that the Library and its use are covered by this License. +You must supply a copy of this License. If the work during execution displays +copyright notices, you must include the copyright notice for the Library among +them, as well as a reference directing the user to the copy of this License. +Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source +code for the Library including whatever changes were used in the work (which +must be distributed under Sections 1 and 2 above); and, if the work is an +executable linked with the Library, with the complete machine-readable "work +that uses the Library", as object code and/or source code, so that the user +can modify the Library and then relink to produce a modified executable containing +the modified Library. (It is understood that the user who changes the contents +of definitions files in the Library will not necessarily be able to recompile +the application to use the modified definitions.) + +b) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (1) uses at run time a copy of the library +already present on the user's computer system, rather than copying library +functions into the executable, and (2) will operate properly with a modified +version of the library, if the user installs one, as long as the modified +version is interface-compatible with the version that the work was made with. + +c) Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, for +a charge no more than the cost of performing this distribution. + +d) If distribution of the work is made by offering access to copy from a designated +place, offer equivalent access to copy the above specified materials from +the same place. + +e) Verify that the user has already received a copy of these materials or +that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable +from it. However, as a special exception, the materials to be distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating system. +Such a contradiction means you cannot use both them and the Library together +in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side +in a single library together with other library facilities not covered by +this License, and distribute such a combined library, provided that the separate +distribution of the work based on the Library and of the other library facilities +is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be distributed +under the terms of the Sections above. + +b) Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the accompanying +uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to +copy, modify, sublicense, link with, or distribute the Library is void, and +will automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will not +have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Library or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the Library +(or any work based on the Library), you indicate your acceptance of this License +to do so, and all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor +to copy, distribute, link with or modify the Library subject to these terms +and conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of +this License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as +a consequence you may not distribute the Library at all. For example, if a +patent license would not permit royalty-free redistribution of the Library +by all those who receive copies directly or indirectly through you, then the +only way you could satisfy both it and this License would be to refrain entirely +from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system which is implemented by public license practices. +Many people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose +that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that version +or of any later version published by the Free Software Foundation. If the +Library does not specify a license version number, you may choose any version +ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author +to ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE +OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA +OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES +OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries -If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). - -To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - one line to give the library's name and an idea of what it does. - Copyright (C) year name of author - - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: +If you develop a new library, and you want it to be of the greatest possible +use to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under +these terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the "copyright" +line and a pointer to where the full notice is found. + + + +Copyright (C) + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) +any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 51 +Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here +is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in + the library `Frob' (a library for tweaking knobs) written + by James Random Hacker. -signature of Ty Coon, 1 April 1990 +< signature of Ty Coon > , 1 April 1990 + Ty Coon, President of Vice + That's all there is to it! diff -Nru dwayland-5.57.0.23/LICENSES/LGPL-3.0-only.txt dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-3.0-only.txt --- dwayland-5.57.0.23/LICENSES/LGPL-3.0-only.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/LGPL-3.0-only.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,304 +1,163 @@ GNU LESSER GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright (C) 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - -0. Additional Definitions. - -As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. - -"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. - -An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. - -A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". - -The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. - -The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. - -1. Exception to Section 3 of the GNU GPL. -You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. - -2. Conveying Modified Versions. -If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: - - a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. - -3. Object Code Incorporating Material from Library Header Files. -The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license document. - -4. Combined Works. -You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: - - a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license document. - - c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. - 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. - - e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) - -5. Combined Libraries. -You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -6. Revised Versions of the GNU Lesser General Public License. -The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. - -If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. - -GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -Preamble - -The GNU General Public License is a free, copyleft license for software and other kinds of works. - -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and modification follow. - -TERMS AND CONDITIONS - -0. Definitions. - -“This License” refers to version 3 of the GNU General Public License. - -“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - -“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. - -To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. - -A “covered work” means either the unmodified Program or a work based on the Program. - -To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - -To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - -1. Source Code. -The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. - -A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - -The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - -The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. +Copyright (C) 2007 Free Software Foundation, Inc. -All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. +This version of the GNU Lesser General Public License incorporates the terms +and conditions of version 3 of the GNU General Public License, supplemented +by the additional permissions listed below. -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + 0. Additional Definitions. -8. Termination. -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. +As used herein, "this License" refers to version 3 of the GNU Lesser General +Public License, and the "GNU GPL" refers to version 3 of the GNU General Public +License. -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. +"The Library" refers to a covered work governed by this License, other than +an Application or a Combined Work as defined below. -9. Acceptance Not Required for Having Copies. -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + -10. Automatic Licensing of Downstream Recipients. -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. +An "Application" is any work that makes use of an interface provided by the +Library, but which is not otherwise based on the Library. Defining a subclass +of a class defined by the Library is deemed a mode of using an interface provided +by the Library. -An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. +A "Combined Work" is a work produced by combining or linking an Application +with the Library. The particular version of the Library with which the Combined +Work was made is also called the "Linked Version". -11. Patents. -A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + -A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. +The "Minimal Corresponding Source" for a Combined Work means the Corresponding +Source for the Combined Work, excluding any source code for portions of the +Combined Work that, considered in isolation, are based on the Application, +and not on the Linked Version. -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + -In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. +The "Corresponding Application Code" for a Combined Work means the object +code and/or source code for the Application, including any data and utility +programs needed for reproducing the Combined Work from the Application, but +excluding the System Libraries of the Combined Work. -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + 1. Exception to Section 3 of the GNU GPL. -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. +You may convey a covered work under sections 3 and 4 of this License without +being bound by section 3 of the GNU GPL. -A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + 2. Conveying Modified Versions. -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. +If you modify a copy of the Library, and, in your modifications, a facility +refers to a function or data to be supplied by an Application that uses the +facility (other than as an argument passed when the facility is invoked), +then you may convey a copy of the modified version: -12. No Surrender of Others' Freedom. -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. +a) under this License, provided that you make a good faith effort to ensure +that, in the event an Application does not supply the function or data, the +facility still operates, and performs whatever part of its purpose remains +meaningful, or -13. Use with the GNU Affero General Public License. -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. +b) under the GNU GPL, with none of the additional permissions of this License +applicable to that copy. -14. Revised Versions of this License. -The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + 3. Object Code Incorporating Material from Library Header Files. -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. +The object code form of an Application may incorporate material from a header +file that is part of the Library. You may convey such object code under terms +of your choice, provided that, if the incorporated material is not limited +to numerical parameters, data structure layouts and accessors, or small macros, +inline functions and templates (ten or fewer lines in length), you do both +of the following: -If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. +a) Give prominent notice with each copy of the object code that the Library +is used in it and that the Library and its use are covered by this License. -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. +b) Accompany the object code with a copy of the GNU GPL and this license document. -15. Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 4. Combined Works. -16. Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +You may convey a Combined Work under terms of your choice that, taken together, +effectively do not restrict modification of the portions of the Library contained +in the Combined Work and reverse engineering for debugging such modifications, +if you also do each of the following: -17. Interpretation of Sections 15 and 16. -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. +a) Give prominent notice with each copy of the Combined Work that the Library +is used in it and that the Library and its use are covered by this License. -END OF TERMS AND CONDITIONS +b) Accompany the Combined Work with a copy of the GNU GPL and this license +document. -How to Apply These Terms to Your New Programs +c) For a Combined Work that displays copyright notices during execution, include +the copyright notice for the Library among these notices, as well as a reference +directing the user to the copies of the GNU GPL and this license document. -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + d) Do one of the following: -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. +0) Convey the Minimal Corresponding Source under the terms of this License, +and the Corresponding Application Code in a form suitable for, and under terms +that permit, the user to recombine or relink the Application with a modified +version of the Linked Version to produce a modified Combined Work, in the +manner specified by section 6 of the GNU GPL for conveying Corresponding Source. - - Copyright (C) +1) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (a) uses at run time a copy of the Library +already present on the user's computer system, and (b) will operate properly +with a modified version of the Library that is interface-compatible with the +Linked Version. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +e) Provide Installation Information, but only if you would otherwise be required +to provide such information under section 6 of the GNU GPL, and only to the +extent that such information is necessary to install and execute a modified +version of the Combined Work produced by recombining or relinking the Application +with a modified version of the Linked Version. (If you use option 4d0, the +Installation Information must accompany the Minimal Corresponding Source and +Corresponding Application Code. If you use option 4d1, you must provide the +Installation Information in the manner specified by section 6 of the GNU GPL +for conveying Corresponding Source.) - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + 5. Combined Libraries. - You should have received a copy of the GNU General Public License along with this program. If not, see . +You may place library facilities that are a work based on the Library side +by side in a single library together with other library facilities that are +not Applications and are not covered by this License, and convey such a combined +library under terms of your choice, if you do both of the following: -Also add information on how to contact you by electronic and paper mail. +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities, conveyed under the +terms of this License. -If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: +b) Give prominent notice with the combined library that part of it is a work +based on the Library, and explaining where to find the accompanying uncombined +form of the same work. - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + 6. Revised Versions of the GNU Lesser General Public License. -The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. +The Free Software Foundation may publish revised and/or new versions of the +GNU Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. -You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . +Each version is given a distinguishing version number. If the Library as you +received it specifies that a certain numbered version of the GNU Lesser General +Public License "or any later version" applies to it, you have the option of +following the terms and conditions either of that published version or of +any later version published by the Free Software Foundation. If the Library +as you received it does not specify a version number of the GNU Lesser General +Public License, you may choose any version of the GNU Lesser General Public +License ever published by the Free Software Foundation. -The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . +If the Library as you received it specifies that a proxy can decide whether +future versions of the GNU Lesser General Public License shall apply, that +proxy's public statement of acceptance of any version is permanent authorization +for you to choose that version for the Library. diff -Nru dwayland-5.57.0.23/LICENSES/MIT-CMU.txt dwayland-5.57.0.24+really5.24.3/LICENSES/MIT-CMU.txt --- dwayland-5.57.0.23/LICENSES/MIT-CMU.txt 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/MIT-CMU.txt 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,17 @@ + By obtaining, using, and/or copying this software and/or +its associated documentation, you agree that you have read, understood, and +will comply with the following terms and conditions: + +Permission to use, copy, modify, and distribute this software and its associated +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appears in all copies, and that both that +copyright notice and this permission notice appear in supporting documentation, +and that the name of the copyright holder not be used in advertising or publicity +pertaining to distribution of the software without specific, written permission. + +THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT +SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM THE LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff -Nru dwayland-5.57.0.23/LICENSES/MIT.txt dwayland-5.57.0.24+really5.24.3/LICENSES/MIT.txt --- dwayland-5.57.0.23/LICENSES/MIT.txt 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/LICENSES/MIT.txt 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru dwayland-5.57.0.23/metainfo.yaml dwayland-5.57.0.24+really5.24.3/metainfo.yaml --- dwayland-5.57.0.23/metainfo.yaml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/metainfo.yaml 2022-11-18 03:38:26.000000000 +0000 @@ -1,6 +1,7 @@ maintainer: graesslin -description: Qt-style API to interact with the wayland-client and wayland-server API -tier: 1 +description: Qt-style API to interact with the wayland-server API +irc: kwin +mailinglist: kwin type: integration platforms: - name: Linux @@ -9,12 +10,8 @@ deprecated: false release: true libraries: - - qmake: KWaylandClient - cmake: "KF5::WaylandClient" - - qmake: KWaylandServer - cmake: "KF5::WaylandServer" -cmakename: KF5Wayland + - cmake: "Deepin::DWayland" +cmakename: DWayland +group: plasma public_lib: true -group: Frameworks -subgroup: Tier 1 diff -Nru dwayland-5.57.0.23/README.md dwayland-5.57.0.24+really5.24.3/README.md --- dwayland-5.57.0.23/README.md 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/README.md 2022-11-18 03:38:26.000000000 +0000 @@ -1,13 +1,13 @@ -# KWayland +# DWayland -KWayland is a Qt-style API to interact with the wayland-client and wayland-server API. +DWayland is a Qt-style API to interact with the wayland-client and wayland-server API. ## Introduction -KWayland provides two libraries: +DWayland provides two libraries: -- KWayland::Client -- KWayland::Server +- DWayland::Client +- DWaylandServer As the names suggest they implement a Client respectively a Server API for the Wayland protocol. The API is Qt-styled removing the needs to interact with a for a Qt developer @@ -15,14 +15,14 @@ is replaced by signals; data types are adjusted to be what a Qt developer expects, e.g. two arguments of int are represented by a QPoint or a QSize. -## KWayland Server +## DWayland Server ### Head-less API The server library can be used to implement a Wayland server with Qt. The API is head-less meaning it does not perform any output and does not restrict on the way how one wants to render. This allows to easily integrate in existing rendering code based on e.g. OpenGL or -QPainter. Applications built on top of KWayland Server integrated the graphics with the +QPainter. Applications built on top of DWayland Server integrated the graphics with the following technologies: - OpenGL over DRM/KMS @@ -37,7 +37,7 @@ - QtQuick Although the library does not perform any output, it makes it very easy to enable rendering. -The representation for a [Buffer](@ref KWayland::Server::BufferInterface) allows easy conversion +The representation for a [Buffer](@ref DWaylandServer::BufferInterface) allows easy conversion to a (memory-shared) QImage in case the buffer represents a shared memory buffer. This QImage can be used for rendering in a QPainter based API or to generate an OpenGL texture. @@ -53,15 +53,15 @@ As long as a buffer is attached surface, the surface has it referenced and the user of the API can access the buffer without needing to care about referencing it. -The API of KWayland is hand-crafted to make usage easier. The representation of a -[Surface](@ref KWayland::Server::SurfaceInterface) combines multiple aspects about a Surface even +The API of DWayland is hand-crafted to make usage easier. The representation of a +[Surface](@ref DWaylandServer::SurfaceInterface) combines multiple aspects about a Surface even if in Wayland API it is added to other elements. E.g. a Surface contains all -[SubSurfaces](@ref KWayland::Server::SubSurfaceInterface) attached to it instead of the user +[SubSurfaces](@ref DWaylandServer::SubSurfaceInterface) attached to it instead of the user having to monitor for which Surface a SubSurface got created. -Similar the representation of a [Seat](@ref KWayland::Server::SeatInterface) combines all aspects of +Similar the representation of a [Seat](@ref DWaylandServer::SeatInterface) combines all aspects of the Seat. A user of the API only needs to interact with the Seat, there is no need to track all the -created [keyboards](@ref KWayland::Server::KeyboardInterface), [pointers](@ref KWayland::Server::PointerInterface), etc. The +created [keyboards](@ref DWaylandServer::KeyboardInterface), [pointers](@ref DWaylandServer::PointerInterface), etc. The representation of Seat tracks which keyboards are generated and is able to forward events to the proper focus surface, send enter and leave notifications when needed without the user of the API to care about it. @@ -71,11 +71,11 @@ Just like with output the server API does not restrict on how to get input events. This allows to integrate with existing input handlers and also allows to easily filter the input before it is passed to the server and from there delegated to the client. By that one can filter out e.g. global touch -gestures or keyboard shortcuts without having to implement handlers inside KWayland. The SeatInterface +gestures or keyboard shortcuts without having to implement handlers inside DWayland. The SeatInterface provides a very easy to use API to forward events which can be easily integrated with Qt's own input event system, e.g. there is a mapping from Qt::MouseButton to the Linux input code. -Applications built on top of KWayland Server integrated input events with the following technologies: +Applications built on top of DWayland Server integrated input events with the following technologies: - libinput - X11 @@ -85,9 +85,9 @@ ### Private IPC with child processes -KWayland Server is well suited for having a private IPC with child processes. The [Display](@ref KWayland::Server::Display) can be +DWayland Server is well suited for having a private IPC with child processes. The [Display](@ref DWaylandServer::Display) can be setup in a way that it doesn't create a public socket but only allows connections through socket -pairs. This allows to create a socketpair, pass one file descriptor to KWayland server and the other +pairs. This allows to create a socketpair, pass one file descriptor to DWayland server and the other to the forked process, e.g. through the WAYLAND_SOCKET environment variable. Thus a dedicated IPC is created which can be used even for running your own custom protocol. For example KDE Plasma uses such a dedicated parent-child Wayland server in it's screen locker architecture. @@ -96,9 +96,9 @@ can be used to recognize specific clients and to restrict access to interfaces for only some dedicated clients. -## KWayland Client +## DWayland Client -The idea around KWayland Client is to provide a drop-in API for the Wayland client library which at +The idea around DWayland Client is to provide a drop-in API for the Wayland client library which at the same time provides convenience Qt-style API. It is not intended to be used as a replacement for the QtWayland QPA plugin, but rather as a way to interact with Wayland in case one needs Qt to use a different QPA plugin or in combination with QtWayland to allow a more low-level interaction without @@ -106,11 +106,11 @@ ### Convenience API -The convenience API in KWayland Client provides one class wrapping a Wayland object. Each class can +The convenience API in DWayland Client provides one class wrapping a Wayland object. Each class can be casted into the wrapped Wayland type. The API represents events as signals and provides simple method calls for requests. -Classes representing global Wayland resources can be created through the [Registry](@ref KWayland::Client::Registry). This class eases +Classes representing global Wayland resources can be created through the [Registry](@ref DWayland::Client::Registry). This class eases the interaction with the Wayland registry and emits signals whenever a new global is announced or gets removed. The Registry has a list of known interfaces (e.g. common Wayland protocols like `wl_compositor` or `wl_shell`) which have dedicated announce/removed signals and objects can be factored by the Registry @@ -123,46 +123,46 @@ ### Integration with QtWayland QPA -If the QGuiApplication uses the QtWayland QPA, KWayland allows to integrate with it. That is one does +If the QGuiApplication uses the QtWayland QPA, DWayland allows to integrate with it. That is one does not need to create a new connection to the Wayland server, but can reuse the one used by Qt. If there is a way to get a Wayland object from Qt, the respective class provides a static method normally called `fromApplication`. In addition the API allows to get the Surface from a QWindow. -## Using KWayland in your application +## Using DWayland in your application ### With CMake -KWayland installs a CMake Config file which allows to use KWayland as imported targets. There is +DWayland installs a CMake Config file which allows to use DWayland as imported targets. There is one library for Client and one for Server. To find the package use for example: - find_package(KF5Wayland CONFIG) - set_package_properties(KF5Wayland PROPERTIES TYPE OPTIONAL ) - add_feature_info("KF5Wayland" KF5Wayland_FOUND "Required for the awesome Wayland on Qt demo") + find_package(DWayland CONFIG) + set_package_properties(DWayland PROPERTIES TYPE OPTIONAL ) + add_feature_info("DWayland" DWayland_FOUND "Required for the awesome Wayland on Qt demo") Now to link against the Client library use: add_executable(exampleApp example.cpp) - target_link_libraries(exampleApp KF5::WaylandClient) + target_link_libraries(exampleApp Deepin::WaylandClient) To link against the Server library use: add_executable(exampleServer exampleServer.cpp) - target_link_libraries(exampleServer KF5::WaylandServer) + target_link_libraries(exampleServer Deepin::DWaylandServer) ### With QMake -KWayland installs .pri files for the Client and Server library allowing easy usage in QMake based +DWayland installs .pri files for the Client and Server library allowing easy usage in QMake based applications. Just use: - QT += KWaylandClient + QT += DWaylandClient Respectively: - QT += KWaylandServer + QT += DWaylandServer Please make sure that your project is configured with C++11 support: diff -Nru dwayland-5.57.0.23/.reuse/dep5 dwayland-5.57.0.24+really5.24.3/.reuse/dep5 --- dwayland-5.57.0.23/.reuse/dep5 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/.reuse/dep5 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: deepin-kwin -Upstream-Contact: <> -Source: https://github.com/linuxdeepin/deepin-kwin - -# Sample paragraph, commented out: -# -# Files: src/* -# Copyright: $YEAR $NAME <$CONTACT> -# License: ... - -Files: src/*.h src/*.c src/*.cpp src/*.xml -Copyright: UnionTech Software Technology Co., Ltd. -License: GPL-2.0-or-later - -Files: autotests/client/*.h autotests/client/*.cpp autotests/server/*.h autotests/server/*.cpp tests/*.h tests/*.cpp -Copyright: UnionTech Software Technology Co., Ltd. -License: GPL-2.0-or-later - -Files: src/tools/testserver/CMakeLists.txt src/CMakeLists.txt src/tools/CMakeLists.txt src/tools/testserver/CmakeLists.txt tests/CMakeLists.txt src/client/CMakeLists.txt src/server/CMakeLists.txt CMakeLists.txt autotests/CMakeLists.txt autotests/client/CMakeLists.txt autotests/server/CMakeLists.txt *.cmake debian/* .github/* .arcconfig .arclint .pc/.quilt_patches .pc/.quilt_series .pc/.version -Copyright: UnionTech Software Technology Co., Ltd. -License: GPL-2.0-or-later - -Files: README.md metainfo.yaml src/.krazy src/tools/mapping.txt -Copyright: UnionTech Software Technology Co., Ltd. -License: GPL-2.0-or-later - - diff -Nru dwayland-5.57.0.23/src/client/appmenu.cpp dwayland-5.57.0.24+really5.24.3/src/client/appmenu.cpp --- dwayland-5.57.0.23/src/client/appmenu.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/appmenu.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "appmenu.h" #include "event_queue.h" #include "surface.h" @@ -28,7 +14,6 @@ { namespace Client { - class AppMenuManager::Private { public: @@ -73,11 +58,13 @@ d->appmenumanager.destroy(); } -AppMenuManager::operator org_kde_kwin_appmenu_manager*() { +AppMenuManager::operator org_kde_kwin_appmenu_manager *() +{ return d->appmenumanager; } -AppMenuManager::operator org_kde_kwin_appmenu_manager*() const { +AppMenuManager::operator org_kde_kwin_appmenu_manager *() const +{ return d->appmenumanager; } @@ -111,24 +98,14 @@ class AppMenu::Private { public: - Private(AppMenu *q); - void setup(org_kde_kwin_appmenu *arg); WaylandPointer appmenu; - -private: - AppMenu *q; }; -AppMenu::Private::Private(AppMenu *q) - : q(q) -{ -} - AppMenu::AppMenu(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new Private) { } @@ -159,11 +136,13 @@ d->appmenu.destroy(); } -AppMenu::operator org_kde_kwin_appmenu*() { +AppMenu::operator org_kde_kwin_appmenu *() +{ return d->appmenu; } -AppMenu::operator org_kde_kwin_appmenu*() const { +AppMenu::operator org_kde_kwin_appmenu *() const +{ return d->appmenu; } @@ -178,7 +157,5 @@ org_kde_kwin_appmenu_set_address(d->appmenu, serviceName.toLatin1(), objectPath.toLatin1()); } - } } - diff -Nru dwayland-5.57.0.23/src/client/appmenu.h dwayland-5.57.0.24+really5.24.3/src/client/appmenu.h --- dwayland-5.57.0.23/src/client/appmenu.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/appmenu.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_APPMENU_H #define KWAYLAND_CLIENT_APPMENU_H #include -#include +#include struct org_kde_kwin_appmenu_manager; struct org_kde_kwin_appmenu; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Surface; class AppMenu; @@ -71,7 +56,7 @@ * Registry::createAppMenuManager. **/ explicit AppMenuManager(QObject *parent = nullptr); - virtual ~AppMenuManager(); + ~AppMenuManager() override; /** * Setup this AppMenuManager to manage the @p appmenumanager. @@ -118,8 +103,8 @@ AppMenu *create(Surface *surface, QObject *parent = nullptr); - operator org_kde_kwin_appmenu_manager*(); - operator org_kde_kwin_appmenu_manager*() const; + operator org_kde_kwin_appmenu_manager *(); + operator org_kde_kwin_appmenu_manager *() const; Q_SIGNALS: /** @@ -143,7 +128,7 @@ { Q_OBJECT public: - virtual ~AppMenu(); + ~AppMenu() override; /** * Setup this Appmenu to manage the @p appmenu. @@ -183,10 +168,10 @@ * Sets the appmenu address. The DBus object should be registered before making this call * Strings should be valid DBus formatted names, in latin1. */ - void setAddress(const QString & serviceName, const QString & objectPath); + void setAddress(const QString &serviceName, const QString &objectPath); - operator org_kde_kwin_appmenu*(); - operator org_kde_kwin_appmenu*() const; + operator org_kde_kwin_appmenu *(); + operator org_kde_kwin_appmenu *() const; private: friend class AppMenuManager; @@ -195,7 +180,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/blur.cpp dwayland-5.57.0.24+really5.24.3/src/client/blur.cpp --- dwayland-5.57.0.23/src/client/blur.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/blur.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,9 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "blur.h" #include "event_queue.h" #include "region.h" @@ -28,10 +14,8 @@ namespace KWayland { - namespace Client { - class Q_DECL_HIDDEN BlurManager::Private { public: @@ -102,12 +86,12 @@ org_kde_kwin_blur_manager_unset(d->manager, *surface); } -BlurManager::operator org_kde_kwin_blur_manager*() +BlurManager::operator org_kde_kwin_blur_manager *() { return d->manager; } -BlurManager::operator org_kde_kwin_blur_manager*() const +BlurManager::operator org_kde_kwin_blur_manager *() const { return d->manager; } @@ -162,12 +146,12 @@ org_kde_kwin_blur_set_region(d->blur, *region); } -Blur::operator org_kde_kwin_blur*() +Blur::operator org_kde_kwin_blur *() { return d->blur; } -Blur::operator org_kde_kwin_blur*() const +Blur::operator org_kde_kwin_blur *() const { return d->blur; } diff -Nru dwayland-5.57.0.23/src/client/blur.h dwayland-5.57.0.24+really5.24.3/src/client/blur.h --- dwayland-5.57.0.23/src/client/blur.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/blur.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,9 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_BLUR_H #define KWAYLAND_BLUR_H @@ -27,21 +13,18 @@ #include #include -#include +#include struct wl_buffer; struct wl_region; struct org_kde_kwin_blur; struct org_kde_kwin_blur_manager; -class QMarginsF; -class QWindow; namespace KWayland { namespace Client { - class EventQueue; class Blur; class Surface; @@ -61,7 +44,7 @@ * Registry::createBlurManager. **/ explicit BlurManager(QObject *parent = nullptr); - virtual ~BlurManager(); + ~BlurManager() override; /** * @returns @c true if managing a org_kde_kwin_blur_manager. @@ -114,8 +97,8 @@ Blur *createBlur(Surface *surface, QObject *parent = nullptr); void removeBlur(Surface *surface); - operator org_kde_kwin_blur_manager*(); - operator org_kde_kwin_blur_manager*() const; + operator org_kde_kwin_blur_manager *(); + operator org_kde_kwin_blur_manager *() const; Q_SIGNALS: /** @@ -150,7 +133,7 @@ { Q_OBJECT public: - virtual ~Blur(); + ~Blur() override; /** * Setup this Blur to manage the @p blur. @@ -189,13 +172,13 @@ /** * Sets the area of the window that will have a blurred * background. - * The region will have to be created with + * The region will have to be created with * Compositor::createRegion(QRegion) */ void setRegion(Region *region); - operator org_kde_kwin_blur*(); - operator org_kde_kwin_blur*() const; + operator org_kde_kwin_blur *(); + operator org_kde_kwin_blur *() const; private: friend class BlurManager; @@ -208,4 +191,3 @@ } #endif - diff -Nru dwayland-5.57.0.23/src/client/buffer.cpp dwayland-5.57.0.24+really5.24.3/src/client/buffer.cpp --- dwayland-5.57.0.23/src/client/buffer.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/buffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "buffer.h" #include "buffer_p.h" #include "shm_pool.h" @@ -29,11 +15,8 @@ { namespace Client { - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_buffer_listener Buffer::Private::s_listener = { - Buffer::Private::releasedCallback -}; +#ifndef K_DOXYGEN +const struct wl_buffer_listener Buffer::Private::s_listener = {Buffer::Private::releasedCallback}; #endif Buffer::Private::Private(Buffer *q, ShmPool *parent, wl_buffer *nativeBuffer, const QSize &size, int32_t stride, size_t offset, Format format) @@ -62,7 +45,7 @@ void Buffer::Private::releasedCallback(void *data, wl_buffer *buffer) { - auto b = reinterpret_cast(data); + auto b = reinterpret_cast(data); Q_ASSERT(b->nativeBuffer == buffer); b->q->setReleased(true); } @@ -76,12 +59,12 @@ void Buffer::copy(const void *src) { - memcpy(address(), src, d->size.height()*d->stride); + memcpy(address(), src, d->size.height() * d->stride); } uchar *Buffer::address() { - return reinterpret_cast(d->shm->poolAddress()) + d->offset; + return reinterpret_cast(d->shm->poolAddress()) + d->offset; } wl_buffer *Buffer::buffer() const @@ -89,12 +72,12 @@ return d->nativeBuffer; } -Buffer::operator wl_buffer*() +Buffer::operator wl_buffer *() { return d->nativeBuffer; } -Buffer::operator wl_buffer*() const +Buffer::operator wl_buffer *() const { return d->nativeBuffer; } @@ -136,7 +119,7 @@ quint32 Buffer::getId(wl_buffer *b) { - return wl_proxy_get_id(reinterpret_cast(b)); + return wl_proxy_get_id(reinterpret_cast(b)); } } diff -Nru dwayland-5.57.0.23/src/client/buffer.h dwayland-5.57.0.24+really5.24.3/src/client/buffer.h --- dwayland-5.57.0.23/src/client/buffer.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/buffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,30 +1,16 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_BUFFER_H #define WAYLAND_BUFFER_H -#include #include +#include #include -#include +#include struct wl_buffer; @@ -32,7 +18,6 @@ { namespace Client { - class ShmPool; /** @@ -50,7 +35,7 @@ **/ enum class Format { ARGB32, ///< 32-bit ARGB format, can be used for QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied - RGB32 ///< 32-bit RGB format, can be used for QImage::Format_RGB32 + RGB32, ///< 32-bit RGB format, can be used for QImage::Format_RGB32 }; ~Buffer(); @@ -74,7 +59,7 @@ * * By default a Buffer is not used. * - * @param used Whether the Bufer should be marked as used. + * @param used Whether the Buffer should be marked as used. * @see isUsed **/ void setUsed(bool used); @@ -105,8 +90,8 @@ **/ Format format() const; - operator wl_buffer*(); - operator wl_buffer*() const; + operator wl_buffer *(); + operator wl_buffer *() const; typedef QWeakPointer Ptr; diff -Nru dwayland-5.57.0.23/src/client/buffer_p.h dwayland-5.57.0.24+really5.24.3/src/client/buffer_p.h --- dwayland-5.57.0.23/src/client/buffer_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/buffer_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_BUFFER_P_H #define WAYLAND_BUFFER_P_H #include "buffer.h" @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN Buffer::Private { public: @@ -44,6 +29,7 @@ size_t offset; bool used; Format format; + private: Buffer *q; static const struct wl_buffer_listener s_listener; diff -Nru dwayland-5.57.0.23/src/client/clientmanagement.cpp dwayland-5.57.0.24+really5.24.3/src/client/clientmanagement.cpp --- dwayland-5.57.0.23/src/client/clientmanagement.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/clientmanagement.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -42,6 +42,7 @@ void setup(com_deepin_client_management *o); void get_window_states(); void getWindowCaption(int windowId, wl_buffer *buffer); + void requestSplitWindow(const char *uuid, int splitType); WaylandPointer clientManagement; EventQueue *queue = nullptr; @@ -51,8 +52,10 @@ private: static void windowStatesCallback(void *data, com_deepin_client_management *clientManagement, uint32_t count, wl_array *windowStates); static void windowCaptureCallback(void *data, com_deepin_client_management *clientManagement, int windowId, int succeed, wl_buffer *buffer); + static void splitChangeCallback(void *data, com_deepin_client_management *clientManagement, const char *uuid, uint32_t splitable); void addWindowStates(uint32_t count, wl_array *windowStates); void sendWindowCaptionDone(int windowId, bool succeed, wl_buffer *buffer); + void splitChange(const char* uuid, int splitable); ClientManagement *q; static struct com_deepin_client_management_listener s_clientManagementListener; @@ -75,6 +78,12 @@ com_deepin_client_management_capture_window_image(clientManagement, windowId, buffer); } +void ClientManagement::Private::requestSplitWindow(const char *uuid, int splitType) +{ + Q_ASSERT(clientManagement); + com_deepin_client_management_split_window(clientManagement, uuid, splitType); +} + void ClientManagement::Private::setup(com_deepin_client_management *o) { Q_ASSERT(o); @@ -96,7 +105,8 @@ com_deepin_client_management_listener ClientManagement::Private::s_clientManagementListener = { windowStatesCallback, - windowCaptureCallback + windowCaptureCallback, + splitChangeCallback }; void ClientManagement::Private::addWindowStates(uint32_t count, wl_array *windowStates) @@ -107,7 +117,7 @@ m_windowStates.clear(); m_windowStates.resize(m_windowsCount); memcpy(m_windowStates.data(), windowStates->data, windowStates->size); - emit q->windowStatesChanged(); + Q_EMIT q->windowStatesChanged(); } else { qWarning() << Q_FUNC_INFO << "receive wayland event error"; } @@ -115,7 +125,12 @@ void ClientManagement::Private::sendWindowCaptionDone(int windowId, bool succeed, wl_buffer *buffer) { - emit q->captionWindowDone(windowId, succeed); + Q_EMIT q->captionWindowDone(windowId, succeed); +} + +void ClientManagement::Private::splitChange(const char* uuid, int splitable) +{ + Q_EMIT q->splitStateChange(uuid, splitable); } void ClientManagement::Private::windowStatesCallback(void *data, com_deepin_client_management *clientManagement, @@ -136,6 +151,14 @@ o->sendWindowCaptionDone(windowId, succeed == 1, buffer); } +void ClientManagement::Private::splitChangeCallback(void *data, com_deepin_client_management *clientManagement, + const char *uuid, uint32_t splitable) +{ + Q_UNUSED(clientManagement); + auto o = reinterpret_cast(data); + o->splitChange(uuid, splitable); +} + void ClientManagement::setup(com_deepin_client_management *clientManagement) { d->setup(clientManagement); @@ -184,6 +207,11 @@ return d->m_windowStates; } +void ClientManagement::requestSplitWindow(const char *uuid, ClientManagement::SplitType splitType) +{ + d->requestSplitWindow(uuid, (int)splitType); +} + void ClientManagement::getWindowCaption(int windowId, wl_buffer *buffer) { d->getWindowCaption(windowId, buffer); diff -Nru dwayland-5.57.0.23/src/client/clientmanagement.h dwayland-5.57.0.24+really5.24.3/src/client/clientmanagement.h --- dwayland-5.57.0.23/src/client/clientmanagement.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/clientmanagement.h 2022-11-18 03:38:26.000000000 +0000 @@ -27,7 +27,7 @@ #include -#include +#include struct com_deepin_client_management; class QPoint; @@ -74,7 +74,7 @@ { Q_OBJECT public: - + explicit ClientManagement(QObject *parent = nullptr); virtual ~ClientManagement(); @@ -91,6 +91,20 @@ bool isMinimized; bool isFullScreen; bool isActive; + int32_t splitable; + char uuid[256]; + }; + + enum class SplitType { + None = 0, + Left = 1 << 0, + Right = 1 << 1, + Top = 1 << 2, + Bottom = 1 << 3, + LeftTop = Left | Top, + RightTop = Right | Top, + LeftBottom = Left | Bottom, + RightBottom = Right | Bottom, }; /** @@ -133,6 +147,8 @@ void getWindowCaption(int windowId, wl_buffer* buffer); + void requestSplitWindow(const char *uuid, SplitType splitType); + Q_SIGNALS: /** * Emitted whenever window State changed. @@ -150,6 +166,8 @@ void captionWindowDone(int windowId, bool succeed); + void splitStateChange(const char* uuid, int splitable); + private: class Private; QScopedPointer d; diff -Nru dwayland-5.57.0.23/src/client/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/src/client/CMakeLists.txt --- dwayland-5.57.0.23/src/client/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -32,10 +32,15 @@ idle.cpp idleinhibit.cpp keyboard.cpp + keystate.cpp remote_access.cpp outputconfiguration.cpp + outputconfiguration_v2.cpp outputmanagement.cpp + outputmanagement_v2.cpp outputdevice.cpp + outputdevicemode_v2.cpp + outputdevice_v2.cpp output.cpp pointer.cpp pointerconstraints.cpp @@ -44,6 +49,7 @@ plasmavirtualdesktop.cpp plasmawindowmanagement.cpp plasmawindowmodel.cpp + primaryoutput_v1.cpp region.cpp registry.cpp relativepointer.cpp @@ -54,7 +60,6 @@ shell.cpp shm_pool.cpp strut.cpp - xwayland_keyboard_grab_v1.cpp subcompositor.cpp subsurface.cpp surface.cpp @@ -70,170 +75,191 @@ xdgshell_v6.cpp xdgshell_stable.cpp xdgoutput.cpp - primaryselectiondevice_v1.cpp - primaryselectiondevicemanager_v1.cpp - primaryselectionoffer_v1.cpp - primaryselectionsource_v1.cpp + globalproperty.cpp ../compat/wayland-xdg-shell-v5-protocol.c ) -ecm_qt_declare_logging_category(CLIENT_LIB_SRCS HEADER logging.h IDENTIFIER KWAYLAND_CLIENT CATEGORY_NAME kwayland-client DEFAULT_SEVERITY Critical) +ecm_qt_declare_logging_category(CLIENT_LIB_SRCS + HEADER logging.h + IDENTIFIER KWAYLAND_CLIENT + CATEGORY_NAME dwayland.client + OLD_CATEGORY_NAMES kwayland-client + DEFAULT_SEVERITY Critical + DESCRIPTION "DWayland Client Library" + EXPORT DWAYLAND +) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/fullscreen-shell.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/fullscreen-shell.xml BASENAME fullscreen-shell ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/output-management.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/output-management.xml BASENAME output-management ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/outputdevice.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/outputdevice.xml BASENAME org_kde_kwin_outputdevice ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-shell.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-output-device-v2.xml + BASENAME kde-output-device-v2 +) + +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml + BASENAME kde-output-management-v2 +) + +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-primary-output-v1.xml + BASENAME kde-primary-output-v1 +) + +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-shell.xml BASENAME plasma-shell ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-virtual-desktop.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-virtual-desktop.xml BASENAME plasma-virtual-desktop ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-window-management.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-window-management.xml BASENAME plasma-window-management ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/idle.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/idle.xml BASENAME idle ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/fake-input.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/fake-input.xml BASENAME fake-input ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/shadow.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/shadow.xml BASENAME shadow ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/blur.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/blur.xml BASENAME blur ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/strut.xml - BASENAME strut -) - -ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/contrast.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/contrast.xml BASENAME contrast ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/slide.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/slide.xml BASENAME slide ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dpms.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dpms.xml BASENAME dpms ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/server-decoration.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/server-decoration.xml BASENAME server-decoration ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/text-input.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/text-input.xml BASENAME text-input-v0 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/text-input-unstable-v2.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/text-input-unstable-v2.xml BASENAME text-input-v2 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml - BASENAME xwayland-keyboard-grab-v1 -) -ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-shell-unstable-v6.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml BASENAME xdg-shell-v6 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/relative-pointer-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml BASENAME relativepointer-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/pointer-gestures-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml BASENAME pointer-gestures-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/pointer-constraints-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml BASENAME pointer-constraints-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-foreign-unstable-v2.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml BASENAME xdg-foreign-unstable-v2 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/idle-inhibit-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml BASENAME idle-inhibit-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/appmenu.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/appmenu.xml BASENAME appmenu ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/server-decoration-palette.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml BASENAME server-decoration-palette ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-output-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-output/xdg-output-unstable-v1.xml BASENAME xdg-output-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-shell.xml + PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml BASENAME xdg-shell ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-decoration-unstable-v1.xml + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml BASENAME xdg-decoration-unstable-v1 ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/client-management.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/keystate.xml + BASENAME keystate +) + +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/client-management.xml BASENAME client-management ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dde-seat.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-seat.xml BASENAME dde-seat ) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dde-shell.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-shell.xml BASENAME dde-shell ) -ecm_add_wayland_client_protocol (CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/wp-primary-selection-unstable-v1.xml - BASENAME wp-primary-selection-unstable-v1 +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-globalproperty.xml + BASENAME dde-globalproperty +) + +ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/strut.xml + BASENAME strut ) ecm_add_wayland_client_protocol (CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/wlr-data-control-unstable-v1.xml + PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-data-control-unstable-v1.xml BASENAME wlr-data-control-unstable-v1 ) @@ -256,7 +282,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/wayland-server-decoration-palette-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-input-v0-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-input-v2-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xwayland-keyboard-grab-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-shell-v6-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-relativepointer-unstable-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-pointer-gestures-unstable-v1-client-protocol.h @@ -268,43 +293,49 @@ ${CMAKE_CURRENT_BINARY_DIR}/wayland-client-management-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-seat-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-wp-primary-selection-unstable-v1-protocol.h + ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-globalproperty-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-wlr-data-control-unstable-v1-protocol.h ) set_source_files_properties(${CLIENT_GENERATED_FILES} PROPERTIES SKIP_AUTOMOC ON) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/remote-access.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/remote-access.xml BASENAME remote-access ) -add_library(KF5WaylandClient ${CLIENT_LIB_SRCS}) -generate_export_header(KF5WaylandClient +add_library(DWaylandClient ${CLIENT_LIB_SRCS}) +add_library(Deepin::WaylandClient ALIAS DWaylandClient) +ecm_generate_export_header(DWaylandClient BASE_NAME KWaylandClient EXPORT_FILE_NAME - KWayland/Client/kwaylandclient_export.h + DWayland/Client/kwaylandclient_export.h + GROUP_BASE_NAME KF + VERSION ${PROJECT_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 5.49 5.50 5.52 5.53 5.73 5.82 ) -add_library(KF5::WaylandClient ALIAS KF5WaylandClient) +# TODO: add support for EXCLUDE_DEPRECATED_BEFORE_AND_AT to all KWayland libs +# needs fixing of undeprecated API being still implemented using own deprecated API -target_include_directories(KF5WaylandClient INTERFACE "$") +target_include_directories(DWaylandClient INTERFACE "$/DWayland/Client") -target_link_libraries(KF5WaylandClient +target_link_libraries(DWaylandClient PUBLIC Qt5::Gui PRIVATE Wayland::Client Qt5::Concurrent ) -set_target_properties(KF5WaylandClient PROPERTIES VERSION ${KWAYLAND_VERSION_STRING} - SOVERSION ${KWAYLAND_SOVERSION} +set_target_properties(DWaylandClient PROPERTIES VERSION ${DWAYLAND_VERSION} + SOVERSION ${DWAYLAND_SOVERSION} EXPORT_NAME WaylandClient ) -install(TARGETS KF5WaylandClient EXPORT KF5WaylandTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) +install(TARGETS DWaylandClient EXPORT DWaylandTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) set(CLIENT_LIB_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/KWayland/Client/kwaylandclient_export.h + ${CMAKE_CURRENT_BINARY_DIR}/DWayland/Client/kwaylandclient_export.h appmenu.h blur.h buffer.h @@ -330,10 +361,15 @@ idle.h idleinhibit.h keyboard.h + keystate.h remote_access.h outputconfiguration.h + outputconfiguration_v2.h outputmanagement.h + outputmanagement_v2.h outputdevice.h + outputdevice_v2.h + outputdevicemode_v2.h output.h pointer.h pointerconstraints.h @@ -342,6 +378,7 @@ plasmawindowmanagement.h plasmawindowmodel.h pointergestures.h + primaryoutput_v1.h region.h registry.h relativepointer.h @@ -353,7 +390,6 @@ shm_pool.h slide.h strut.h - xwayland_keyboard_grab_v1.h subcompositor.h subsurface.h surface.h @@ -362,23 +398,20 @@ xdgdecoration.h xdgshell.h xdgforeign.h - xdgforeign_v2.h xdgoutput.h - primaryselectiondevicemanager_v1.h - primaryselectionoffer_v1.h - primaryselectiondevice_v1.h - primaryselectionsource_v1.h + globalproperty.h ) install(FILES ${CLIENT_LIB_HEADERS} - DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KWayland/Client COMPONENT Devel + DESTINATION ${KDE_INSTALL_INCLUDEDIR}/DWayland/Client COMPONENT Devel ) # make available to ecm_add_qch in parent folder -set(KWaylandClient_APIDOX_SRCS ${CLIENT_LIB_HEADERS} PARENT_SCOPE) +set(DWaylandClient_APIDOX_SRCS ${CLIENT_LIB_HEADERS} PARENT_SCOPE) +set(DWaylandClient_APIDOX_BUILD_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) include(ECMGeneratePriFile) -ecm_generate_pri_file(BASE_NAME KWaylandClient LIB_NAME KF5WaylandClient DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}) +ecm_generate_pri_file(BASE_NAME DWaylandClient LIB_NAME DWaylandClient DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff -Nru dwayland-5.57.0.23/src/client/compositor.cpp dwayland-5.57.0.24+really5.24.3/src/client/compositor.cpp --- dwayland-5.57.0.23/src/client/compositor.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/compositor.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "compositor.h" #include "event_queue.h" #include "region.h" @@ -33,7 +19,6 @@ { namespace Client { - class Q_DECL_HIDDEN Compositor::Private { public: @@ -60,7 +45,7 @@ if (!native) { return nullptr; } - wl_compositor *compositor = reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("compositor"))); + wl_compositor *compositor = reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("compositor"))); if (!compositor) { return nullptr; } @@ -125,16 +110,18 @@ return r; } -std::unique_ptr< Region > Compositor::createRegion(const QRegion ®ion) +std::unique_ptr Compositor::createRegion(const QRegion ®ion) { return std::unique_ptr(createRegion(region, nullptr)); } -Compositor::operator wl_compositor*() { +Compositor::operator wl_compositor *() +{ return d->compositor; } -Compositor::operator wl_compositor*() const { +Compositor::operator wl_compositor *() const +{ return d->compositor; } diff -Nru dwayland-5.57.0.23/src/client/compositor.h dwayland-5.57.0.24+really5.24.3/src/client/compositor.h --- dwayland-5.57.0.23/src/client/compositor.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/compositor.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_COMPOSITOR_H #define WAYLAND_COMPOSITOR_H @@ -24,7 +10,7 @@ #include -#include +#include struct wl_compositor; @@ -32,7 +18,6 @@ { namespace Client { - class EventQueue; class Region; class Surface; @@ -72,7 +57,7 @@ * Registry::createCompositor. **/ explicit Compositor(QObject *parent = nullptr); - virtual ~Compositor(); + ~Compositor() override; /** * Creates a Compositor for the used QGuiApplication. @@ -170,8 +155,8 @@ **/ std::unique_ptr createRegion(const QRegion ®ion); - operator wl_compositor*(); - operator wl_compositor*() const; + operator wl_compositor *(); + operator wl_compositor *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/connection_thread.cpp dwayland-5.57.0.24+really5.24.3/src/client/connection_thread.cpp --- dwayland-5.57.0.23/src/client/connection_thread.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/connection_thread.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,30 +1,16 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "connection_thread.h" #include "logging.h" // Qt #include -#include #include #include #include +#include #include #include #include @@ -34,10 +20,8 @@ namespace KWayland { - namespace Client { - class Q_DECL_HIDDEN ConnectionThread::Private { public: @@ -57,15 +41,15 @@ bool foreign = false; QMetaObject::Connection eventDispatcherConnection; int error = 0; - static QVector connections; - static QMutex mutex; + static QVector connections; + static QRecursiveMutex mutex; + private: ConnectionThread *q; }; -QVector ConnectionThread::Private::connections = QVector{}; -QMutex ConnectionThread::Private::mutex{QMutex::Recursive}; - +QVector ConnectionThread::Private::connections = QVector{}; +QRecursiveMutex ConnectionThread::Private::mutex; ConnectionThread::Private::Private(ConnectionThread *q) : socketName(QString::fromUtf8(qgetenv("WAYLAND_DISPLAY"))) @@ -102,7 +86,7 @@ } if (!display) { qCWarning(KWAYLAND_CLIENT) << "Failed connecting to Wayland display"; - emit q->failed(); + Q_EMIT q->failed(); return; } if (fd != -1) { @@ -114,32 +98,30 @@ // setup socket notifier setupSocketNotifier(); setupSocketFileWatcher(); - emit q->connected(); + Q_EMIT q->connected(); } void ConnectionThread::Private::setupSocketNotifier() { const int fd = wl_display_get_fd(display); socketNotifier.reset(new QSocketNotifier(fd, QSocketNotifier::Read)); - QObject::connect(socketNotifier.data(), &QSocketNotifier::activated, q, - [this]() { - if (!display) { - return; - } - if (wl_display_dispatch(display) == -1) { - error = wl_display_get_error(display); - if (error != 0) { - if (display) { - free(display); - display = nullptr; - } - emit q->errorOccurred(); - return; + QObject::connect(socketNotifier.data(), &QSocketNotifier::activated, q, [this]() { + if (!display) { + return; + } + if (wl_display_dispatch(display) == -1) { + error = wl_display_get_error(display); + if (error != 0) { + if (display) { + free(display); + display = nullptr; } + Q_EMIT q->errorOccurred(); + return; } - emit q->eventsRead(); } - ); + Q_EMIT q->eventsRead(); + }); } void ConnectionThread::Private::setupSocketFileWatcher() @@ -149,46 +131,45 @@ } socketWatcher.reset(new QFileSystemWatcher); socketWatcher->addPath(runtimeDir.absoluteFilePath(socketName)); - QObject::connect(socketWatcher.data(), &QFileSystemWatcher::fileChanged, q, - [this] (const QString &file) { - if (QFile::exists(file) || serverDied) { + QObject::connect(socketWatcher.data(), &QFileSystemWatcher::fileChanged, q, [this](const QString &file) { + if (QFile::exists(file) || serverDied) { + return; + } + qCWarning(KWAYLAND_CLIENT) << "Connection to server went away"; + serverDied = true; + if (display) { + free(display); + display = nullptr; + } + socketNotifier.reset(); + + // need a new filesystem watcher + socketWatcher.reset(new QFileSystemWatcher); + socketWatcher->addPath(runtimeDir.absolutePath()); + QObject::connect(socketWatcher.data(), &QFileSystemWatcher::directoryChanged, q, [this]() { + if (!serverDied) { return; } - qCWarning(KWAYLAND_CLIENT) << "Connection to server went away"; - serverDied = true; - if (display) { - free(display); - display = nullptr; + if (runtimeDir.exists(socketName)) { + qCDebug(KWAYLAND_CLIENT) << "Socket reappeared"; + socketWatcher.reset(); + serverDied = false; + error = 0; + q->initConnection(); } - socketNotifier.reset(); - - // need a new filesystem watcher - socketWatcher.reset(new QFileSystemWatcher); - socketWatcher->addPath(runtimeDir.absolutePath()); - QObject::connect(socketWatcher.data(), &QFileSystemWatcher::directoryChanged, q, - [this]() { - if (!serverDied) { - return; - } - if (runtimeDir.exists(socketName)) { - qCDebug(KWAYLAND_CLIENT) << "Socket reappeared"; - socketWatcher.reset(); - serverDied = false; - error = 0; - q->initConnection(); - } - } - ); - emit q->connectionDied(); - } - ); + }); + Q_EMIT q->connectionDied(); + }); } ConnectionThread::ConnectionThread(QObject *parent) : QObject(parent) , d(new Private(this)) { - d->eventDispatcherConnection = connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, + d->eventDispatcherConnection = connect( + QCoreApplication::eventDispatcher(), + &QAbstractEventDispatcher::aboutToBlock, + this, [this] { if (d->display) { wl_display_flush(d->display); @@ -216,7 +197,7 @@ if (!native) { return nullptr; } - wl_display *display = reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("wl_display"))); + wl_display *display = reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("wl_display"))); if (!display) { return nullptr; } @@ -300,7 +281,7 @@ return d->error; } -QVector ConnectionThread::connections() +QVector ConnectionThread::connections() { return Private::connections; } diff -Nru dwayland-5.57.0.23/src/client/connection_thread.h dwayland-5.57.0.24+really5.24.3/src/client/connection_thread.h --- dwayland-5.57.0.23/src/client/connection_thread.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/connection_thread.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_CONNECTION_THREAD_H #define WAYLAND_CONNECTION_THREAD_H #include #include -#include +#include struct wl_display; @@ -54,7 +40,6 @@ **/ namespace Client { - /** * @short Creates and manages the connection to a Wayland server. * @@ -123,7 +108,7 @@ Q_OBJECT public: explicit ConnectionThread(QObject *parent = nullptr); - virtual ~ConnectionThread(); + ~ConnectionThread() override; /** * Creates a ConnectionThread for the used QGuiApplication. @@ -203,7 +188,7 @@ * @returns all connections created in this application * @since 5.37 **/ - static QVector connections(); + static QVector connections(); public Q_SLOTS: /** @@ -252,6 +237,7 @@ * @since 5.23 **/ void errorOccurred(); + protected: /* * Creates a connection thread from an existing wl_display object @@ -272,5 +258,4 @@ } } - #endif diff -Nru dwayland-5.57.0.23/src/client/contrast.cpp dwayland-5.57.0.24+really5.24.3/src/client/contrast.cpp --- dwayland-5.57.0.23/src/client/contrast.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/contrast.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,9 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "contrast.h" #include "event_queue.h" #include "region.h" @@ -28,10 +14,8 @@ namespace KWayland { - namespace Client { - class Q_DECL_HIDDEN ContrastManager::Private { public: @@ -102,12 +86,12 @@ org_kde_kwin_contrast_manager_unset(d->manager, *surface); } -ContrastManager::operator org_kde_kwin_contrast_manager*() +ContrastManager::operator org_kde_kwin_contrast_manager *() { return d->manager; } -ContrastManager::operator org_kde_kwin_contrast_manager*() const +ContrastManager::operator org_kde_kwin_contrast_manager *() const { return d->manager; } @@ -177,12 +161,25 @@ org_kde_kwin_contrast_set_saturation(d->contrast, wl_fixed_from_double(saturation)); } -Contrast::operator org_kde_kwin_contrast*() +void Contrast::setFrost(QColor frost) +{ + if (org_kde_kwin_contrast_get_version(d->contrast) < ORG_KDE_KWIN_CONTRAST_SET_FROST_SINCE_VERSION) { + return; + } + + if (frost.isValid()) { + org_kde_kwin_contrast_set_frost(d->contrast, frost.red(), frost.green(), frost.blue(), frost.alpha()); + } else { + org_kde_kwin_contrast_unset_frost(d->contrast); + } +} + +Contrast::operator org_kde_kwin_contrast *() { return d->contrast; } -Contrast::operator org_kde_kwin_contrast*() const +Contrast::operator org_kde_kwin_contrast *() const { return d->contrast; } diff -Nru dwayland-5.57.0.23/src/client/contrast.h dwayland-5.57.0.24+really5.24.3/src/client/contrast.h --- dwayland-5.57.0.23/src/client/contrast.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/contrast.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,31 +1,20 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CONTRAST_H #define KWAYLAND_CONTRAST_H +#include + #include #include #include +#include -#include +#include struct org_kde_kwin_contrast; struct org_kde_kwin_contrast_manager; @@ -34,7 +23,6 @@ { namespace Client { - class EventQueue; class Contrast; class Surface; @@ -54,7 +42,7 @@ * Registry::createContrastManager. **/ explicit ContrastManager(QObject *parent = nullptr); - virtual ~ContrastManager(); + ~ContrastManager() override; /** * @returns @c true if managing a org_kde_kwin_contrast_manager. @@ -107,8 +95,8 @@ Contrast *createContrast(Surface *surface, QObject *parent = nullptr); void removeContrast(Surface *surface); - operator org_kde_kwin_contrast_manager*(); - operator org_kde_kwin_contrast_manager*() const; + operator org_kde_kwin_contrast_manager *(); + operator org_kde_kwin_contrast_manager *() const; Q_SIGNALS: /** @@ -143,7 +131,7 @@ { Q_OBJECT public: - virtual ~Contrast(); + ~Contrast() override; /** * Setup this Contrast to manage the @p contrast. @@ -190,8 +178,10 @@ void setIntensity(qreal intensity); void setSaturation(qreal saturation); - operator org_kde_kwin_contrast*(); - operator org_kde_kwin_contrast*() const; + void setFrost(QColor frost); + + operator org_kde_kwin_contrast *(); + operator org_kde_kwin_contrast *() const; private: friend class ContrastManager; @@ -204,4 +194,3 @@ } #endif - diff -Nru dwayland-5.57.0.23/src/client/datacontroldevice.cpp dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevice.cpp --- dwayland-5.57.0.23/src/client/datacontroldevice.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevice.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -180,6 +180,12 @@ zwlr_data_control_device_v1_set_selection(d->device, dataControlSource(source)); } +void DataControlDeviceV1::setCachedSelection(quint32 serial, DataControlSourceV1 *source) +{ + Q_UNUSED(serial) + zwlr_data_control_device_v1_set_cached_selection(d->device, dataControlSource(source)); +} + void DataControlDeviceV1::clearSelection(quint32 serial) { setSelection(serial); diff -Nru dwayland-5.57.0.23/src/client/datacontroldevice.h dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevice.h --- dwayland-5.57.0.23/src/client/datacontroldevice.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevice.h 2022-11-18 03:38:26.000000000 +0000 @@ -10,7 +10,7 @@ #include -#include +#include struct zwlr_data_control_device_v1; @@ -69,8 +69,8 @@ **/ bool isValid() const; - void setSelection(quint32 serial, DataControlSourceV1 *source = nullptr); + void setCachedSelection(quint32 serial, DataControlSourceV1 *source = nullptr); void clearSelection(quint32 serial); DataControlOfferV1 *offeredSelection() const; diff -Nru dwayland-5.57.0.23/src/client/datacontroldevicemanager.h dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevicemanager.h --- dwayland-5.57.0.23/src/client/datacontroldevicemanager.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datacontroldevicemanager.h 2022-11-18 03:38:26.000000000 +0000 @@ -8,7 +8,7 @@ #include -#include +#include struct zwlr_data_control_manager_v1; diff -Nru dwayland-5.57.0.23/src/client/datacontroloffer.h dwayland-5.57.0.24+really5.24.3/src/client/datacontroloffer.h --- dwayland-5.57.0.23/src/client/datacontroloffer.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datacontroloffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -8,7 +8,7 @@ #include -#include +#include #include "datacontroldevicemanager.h" diff -Nru dwayland-5.57.0.23/src/client/datacontrolsource.h dwayland-5.57.0.24+really5.24.3/src/client/datacontrolsource.h --- dwayland-5.57.0.23/src/client/datacontrolsource.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datacontrolsource.h 2022-11-18 03:38:26.000000000 +0000 @@ -11,7 +11,7 @@ #include -#include +#include class QMimeType; diff -Nru dwayland-5.57.0.23/src/client/datadevice.cpp dwayland-5.57.0.24+really5.24.3/src/client/datadevice.cpp --- dwayland-5.57.0.23/src/client/datadevice.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datadevice.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,24 +1,9 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datadevice.h" -#include "dataoffer.h" #include "datasource.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -31,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN DataDevice::Private { public: @@ -64,18 +48,12 @@ DataOffer *lastOffer = nullptr; }; -const wl_data_device_listener DataDevice::Private::s_listener = { - dataOfferCallback, - enterCallback, - leaveCallback, - motionCallback, - dropCallback, - selectionCallback -}; +const wl_data_device_listener DataDevice::Private::s_listener = + {dataOfferCallback, enterCallback, leaveCallback, motionCallback, dropCallback, selectionCallback}; void DataDevice::Private::dataOfferCallback(void *data, wl_data_device *dataDevice, wl_data_offer *id) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); d->dataOffer(id); } @@ -85,11 +63,18 @@ Q_ASSERT(!lastOffer); lastOffer = new DataOffer(q, id); Q_ASSERT(lastOffer->isValid()); + Q_EMIT q->dataOffered(lastOffer); } -void DataDevice::Private::enterCallback(void *data, wl_data_device *dataDevice, uint32_t serial, wl_surface *surface, wl_fixed_t x, wl_fixed_t y, wl_data_offer *id) +void DataDevice::Private::enterCallback(void *data, + wl_data_device *dataDevice, + uint32_t serial, + wl_surface *surface, + wl_fixed_t x, + wl_fixed_t y, + wl_data_offer *id) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); d->dragEnter(serial, QPointer(Surface::get(surface)), QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), id); } @@ -100,12 +85,12 @@ Q_ASSERT(*lastOffer == dataOffer); drag.offer = lastOffer; lastOffer = nullptr; - emit q->dragEntered(serial, relativeToSurface); + Q_EMIT q->dragEntered(serial, relativeToSurface); } void DataDevice::Private::leaveCallback(void *data, wl_data_device *dataDevice) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); d->dragLeft(); } @@ -116,26 +101,26 @@ delete drag.offer; } drag = Drag(); - emit q->dragLeft(); + Q_EMIT q->dragLeft(); } void DataDevice::Private::motionCallback(void *data, wl_data_device *dataDevice, uint32_t time, wl_fixed_t x, wl_fixed_t y) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); - emit d->q->dragMotion(QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), time); + Q_EMIT d->q->dragMotion(QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), time); } void DataDevice::Private::dropCallback(void *data, wl_data_device *dataDevice) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); - emit d->q->dropped(); + Q_EMIT d->q->dropped(); } void DataDevice::Private::selectionCallback(void *data, wl_data_device *dataDevice, wl_data_offer *id) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->device == dataDevice); d->selection(id); } @@ -144,13 +129,13 @@ { if (!id) { selectionOffer.reset(); - emit q->selectionCleared(); + Q_EMIT q->selectionCleared(); return; } Q_ASSERT(*lastOffer == id); selectionOffer.reset(lastOffer); lastOffer = nullptr; - emit q->selectionOffered(selectionOffer.data()); + Q_EMIT q->selectionOffered(selectionOffer.data()); } DataDevice::Private::Private(DataDevice *q) @@ -205,7 +190,8 @@ startDrag(serial, nullptr, origin, icon); } -namespace { +namespace +{ static wl_data_source *dataSource(const DataSource *source) { if (!source) { @@ -217,11 +203,7 @@ void DataDevice::startDrag(quint32 serial, DataSource *source, Surface *origin, Surface *icon) { - wl_data_device_start_drag(d->device, - dataSource(source), - *origin, - icon ? (wl_surface*)*icon : nullptr, - serial); + wl_data_device_start_drag(d->device, dataSource(source), *origin, icon ? (wl_surface *)*icon : nullptr, serial); } void DataDevice::setSelection(quint32 serial, DataSource *source) @@ -249,12 +231,12 @@ return d->drag.offer; } -DataDevice::operator wl_data_device*() +DataDevice::operator wl_data_device *() { return d->device; } -DataDevice::operator wl_data_device*() const +DataDevice::operator wl_data_device *() const { return d->device; } diff -Nru dwayland-5.57.0.23/src/client/datadevice.h dwayland-5.57.0.24+really5.24.3/src/client/datadevice.h --- dwayland-5.57.0.23/src/client/datadevice.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datadevice.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_DATADEVICE_H #define WAYLAND_DATADEVICE_H @@ -24,7 +10,7 @@ #include -#include +#include struct wl_data_device; @@ -36,7 +22,7 @@ class Surface; /** - * @short Wrapper for the wl_data_device interface. + * @short DataDevice allows clients to share data by copy-and-paste and drag-and-drop. * * This class is a convenient wrapper for the wl_data_device interface. * To create a DataDevice call DataDeviceManager::getDataDevice. @@ -48,7 +34,7 @@ Q_OBJECT public: explicit DataDevice(QObject *parent = nullptr); - virtual ~DataDevice(); + ~DataDevice() override; /** * Setup this DataDevice to manage the @p dataDevice. @@ -101,11 +87,12 @@ **/ DataOffer *dragOffer() const; - operator wl_data_device*(); - operator wl_data_device*() const; + operator wl_data_device *(); + operator wl_data_device *() const; Q_SIGNALS: - void selectionOffered(KWayland::Client::DataOffer*); + void dataOffered(KWayland::Client::DataOffer *); + void selectionOffered(KWayland::Client::DataOffer *); void selectionCleared(); /** * Notification that a drag'n'drop operation entered a Surface on this DataDevice. diff -Nru dwayland-5.57.0.23/src/client/datadevicemanager.cpp dwayland-5.57.0.24+really5.24.3/src/client/datadevicemanager.cpp --- dwayland-5.57.0.23/src/client/datadevicemanager.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datadevicemanager.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datadevicemanager.h" #include "datadevice.h" #include "datasource.h" @@ -30,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN DataDeviceManager::Private { public: @@ -106,12 +91,12 @@ return device; } -DataDeviceManager::operator wl_data_device_manager*() const +DataDeviceManager::operator wl_data_device_manager *() const { return d->manager; } -DataDeviceManager::operator wl_data_device_manager*() +DataDeviceManager::operator wl_data_device_manager *() { return d->manager; } diff -Nru dwayland-5.57.0.23/src/client/datadevicemanager.h dwayland-5.57.0.24+really5.24.3/src/client/datadevicemanager.h --- dwayland-5.57.0.23/src/client/datadevicemanager.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datadevicemanager.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_DATA_DEVICE_MANAGER_H #define WAYLAND_DATA_DEVICE_MANAGER_H #include -#include +#include struct wl_data_device_manager; @@ -30,7 +16,6 @@ { namespace Client { - class EventQueue; class DataDevice; class DataSource; @@ -71,7 +56,7 @@ None = 0, Copy = 1 << 0, Move = 1 << 1, - Ask = 1 << 2 + Ask = 1 << 2, }; Q_DECLARE_FLAGS(DnDActions, DnDAction) @@ -82,7 +67,7 @@ * Registry::createCompositor. **/ explicit DataDeviceManager(QObject *parent = nullptr); - virtual ~DataDeviceManager(); + ~DataDeviceManager() override; /** * @returns @c true if managing a wl_data_device_manager. @@ -129,8 +114,8 @@ DataDevice *getDataDevice(Seat *seat, QObject *parent = nullptr); - operator wl_data_device_manager*(); - operator wl_data_device_manager*() const; + operator wl_data_device_manager *(); + operator wl_data_device_manager *() const; Q_SIGNALS: /** @@ -148,9 +133,9 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(DataDeviceManager::DnDActions) + } } -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::DataDeviceManager::DnDActions) - #endif diff -Nru dwayland-5.57.0.23/src/client/dataoffer.cpp dwayland-5.57.0.24+really5.24.3/src/client/dataoffer.cpp --- dwayland-5.57.0.23/src/client/dataoffer.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/dataoffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,21 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "dataoffer.h" #include "datadevice.h" #include "wayland_pointer_p.h" // Qt -#include #include +#include // Wayland #include namespace KWayland { - namespace Client { - class Q_DECL_HIDDEN DataOffer::Private { public: @@ -52,12 +36,8 @@ static const struct wl_data_offer_listener s_listener; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_data_offer_listener DataOffer::Private::s_listener = { - offerCallback, - sourceActionsCallback, - actionCallback -}; +#ifndef K_DOXYGEN +const struct wl_data_offer_listener DataOffer::Private::s_listener = {offerCallback, sourceActionsCallback, actionCallback}; #endif DataOffer::Private::Private(wl_data_offer *offer, DataOffer *q) @@ -69,7 +49,7 @@ void DataOffer::Private::offerCallback(void *data, wl_data_offer *dataOffer, const char *mimeType) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->dataOffer == dataOffer); d->offer(QString::fromUtf8(mimeType)); } @@ -80,7 +60,7 @@ const auto &m = db.mimeTypeForName(mimeType); if (m.isValid()) { mimeTypes << m; - emit q->mimeTypeOffered(m.name()); + Q_EMIT q->mimeTypeOffered(m.name()); } } @@ -97,18 +77,18 @@ if (source_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) { actions |= DataDeviceManager::DnDAction::Ask; } - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); if (d->sourceActions != actions) { d->sourceActions = actions; - emit d->q->sourceDragAndDropActionsChanged(); + Q_EMIT d->q->sourceDragAndDropActionsChanged(); } } void DataOffer::Private::actionCallback(void *data, wl_data_offer *wl_data_offer, uint32_t dnd_action) { Q_UNUSED(wl_data_offer) - auto d = reinterpret_cast(data); - switch(dnd_action) { + auto d = reinterpret_cast(data); + switch (dnd_action) { case WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: d->setAction(DataDeviceManager::DnDAction::Copy); break; @@ -132,7 +112,7 @@ return; } selectedAction = action; - emit q->selectedDragAndDropActionChanged(); + Q_EMIT q->selectedDragAndDropActionChanged(); } DataOffer::DataOffer(DataDevice *parent, wl_data_offer *dataOffer) @@ -161,11 +141,21 @@ return d->dataOffer.isValid(); } -QList< QMimeType > DataOffer::offeredMimeTypes() const +QList DataOffer::offeredMimeTypes() const { return d->mimeTypes; } +void DataOffer::accept(const QMimeType &mimeType, quint32 serial) +{ + accept(mimeType.name(), serial); +} + +void DataOffer::accept(const QString &mimeType, quint32 serial) +{ + wl_data_offer_accept(d->dataOffer, serial, mimeType.toUtf8().constData()); +} + void DataOffer::receive(const QMimeType &mimeType, qint32 fd) { receive(mimeType.name(), fd); @@ -177,12 +167,12 @@ wl_data_offer_receive(d->dataOffer, mimeType.toUtf8().constData(), fd); } -DataOffer::operator wl_data_offer*() +DataOffer::operator wl_data_offer *() { return d->dataOffer; } -DataOffer::operator wl_data_offer*() const +DataOffer::operator wl_data_offer *() const { return d->dataOffer; } @@ -206,7 +196,7 @@ if (wl_proxy_get_version(d->dataOffer) < WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION) { return; } - auto toWayland = [] (DataDeviceManager::DnDAction action) { + auto toWayland = [](DataDeviceManager::DnDAction action) { switch (action) { case DataDeviceManager::DnDAction::Copy: return WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; diff -Nru dwayland-5.57.0.23/src/client/dataoffer.h dwayland-5.57.0.24+really5.24.3/src/client/dataoffer.h --- dwayland-5.57.0.23/src/client/dataoffer.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/dataoffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_DATAOFFER_H #define WAYLAND_DATAOFFER_H #include -#include +#include #include "datadevicemanager.h" @@ -48,7 +34,7 @@ { Q_OBJECT public: - virtual ~DataOffer(); + ~DataOffer() override; /** * Releases the wl_data_offer interface. @@ -78,6 +64,23 @@ QList offeredMimeTypes() const; + /** + * Indicates that the client can accept data of the given @a mimeType. + * The @a serial parameter specifies the serial number of the corresponding + * dragEntered() event. + * + * @see DataDevice::dragEntered + */ + void accept(const QMimeType &mimeType, quint32 serial); + /** + * Indicates that the client can accept data of the given @a mimeType. + * The @a serial parameter specifies the serial number of the corresponding + * dragEntered() event. + * + * @see DataDevice::dragEntered + */ + void accept(const QString &mimeType, quint32 serial); + void receive(const QMimeType &mimeType, qint32 fd); void receive(const QString &mimeType, qint32 fd); @@ -111,11 +114,11 @@ **/ DataDeviceManager::DnDAction selectedDragAndDropAction() const; - operator wl_data_offer*(); - operator wl_data_offer*() const; + operator wl_data_offer *(); + operator wl_data_offer *() const; Q_SIGNALS: - void mimeTypeOffered(const QString&); + void mimeTypeOffered(const QString &); /** * Emitted whenever the @link{sourceDragAndDropActions} changed, e.g. on enter or when * the DataSource changes the supported actions. @@ -140,6 +143,6 @@ } } -Q_DECLARE_METATYPE(KWayland::Client::DataOffer*) +Q_DECLARE_METATYPE(KWayland::Client::DataOffer *) #endif diff -Nru dwayland-5.57.0.23/src/client/datasource.cpp dwayland-5.57.0.24+really5.24.3/src/client/datasource.cpp --- dwayland-5.57.0.23/src/client/datasource.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datasource.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datasource.h" #include "wayland_pointer_p.h" // Qt @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN DataSource::Private { public: @@ -52,14 +37,8 @@ DataSource *q; }; -const wl_data_source_listener DataSource::Private::s_listener = { - targetCallback, - sendCallback, - cancelledCallback, - dndDropPerformedCallback, - dndFinishedCallback, - actionCallback -}; +const wl_data_source_listener DataSource::Private::s_listener = + {targetCallback, sendCallback, cancelledCallback, dndDropPerformedCallback, dndFinishedCallback, actionCallback}; DataSource::Private::Private(DataSource *q) : q(q) @@ -68,44 +47,44 @@ void DataSource::Private::targetCallback(void *data, wl_data_source *dataSource, const char *mimeType) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->source == dataSource); - emit d->q->targetAccepts(QString::fromUtf8(mimeType)); + Q_EMIT d->q->targetAccepts(QString::fromUtf8(mimeType)); } void DataSource::Private::sendCallback(void *data, wl_data_source *dataSource, const char *mimeType, int32_t fd) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->source == dataSource); - emit d->q->sendDataRequested(QString::fromUtf8(mimeType), fd); + Q_EMIT d->q->sendDataRequested(QString::fromUtf8(mimeType), fd); } void DataSource::Private::cancelledCallback(void *data, wl_data_source *dataSource) { - auto d = reinterpret_cast(data); + auto d = reinterpret_cast(data); Q_ASSERT(d->source == dataSource); - emit d->q->cancelled(); + Q_EMIT d->q->cancelled(); } void DataSource::Private::dndDropPerformedCallback(void *data, wl_data_source *wl_data_source) { Q_UNUSED(wl_data_source) - auto d = reinterpret_cast(data); - emit d->q->dragAndDropPerformed(); + auto d = reinterpret_cast(data); + Q_EMIT d->q->dragAndDropPerformed(); } void DataSource::Private::dndFinishedCallback(void *data, wl_data_source *wl_data_source) { Q_UNUSED(wl_data_source) - auto d = reinterpret_cast(data); - emit d->q->dragAndDropFinished(); + auto d = reinterpret_cast(data); + Q_EMIT d->q->dragAndDropFinished(); } void DataSource::Private::actionCallback(void *data, wl_data_source *wl_data_source, uint32_t dnd_action) { Q_UNUSED(wl_data_source) - auto d = reinterpret_cast(data); - switch(dnd_action) { + auto d = reinterpret_cast(data); + switch (dnd_action) { case WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: d->setAction(DataDeviceManager::DnDAction::Copy); break; @@ -129,7 +108,7 @@ return; } selectedAction = action; - emit q->selectedDragAndDropActionChanged(); + Q_EMIT q->selectedDragAndDropActionChanged(); } void DataSource::Private::setup(wl_data_source *s) @@ -184,12 +163,12 @@ offer(mimeType.name()); } -DataSource::operator wl_data_source*() const +DataSource::operator wl_data_source *() const { return d->source; } -DataSource::operator wl_data_source*() +DataSource::operator wl_data_source *() { return d->source; } diff -Nru dwayland-5.57.0.23/src/client/datasource.h dwayland-5.57.0.24+really5.24.3/src/client/datasource.h --- dwayland-5.57.0.23/src/client/datasource.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/datasource.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_DATASOURCE_H #define WAYLAND_DATASOURCE_H @@ -25,7 +11,7 @@ #include -#include +#include struct wl_data_source; class QMimeType; @@ -34,8 +20,6 @@ { namespace Client { - - /** * @short Wrapper for the wl_data_source interface. * @@ -49,7 +33,7 @@ Q_OBJECT public: explicit DataSource(QObject *parent = nullptr); - virtual ~DataSource(); + ~DataSource() override; /** * Setup this DataSource to manage the @p dataSource. @@ -105,8 +89,8 @@ **/ DataDeviceManager::DnDAction selectedDragAndDropAction() const; - operator wl_data_source*(); - operator wl_data_source*() const; + operator wl_data_source *(); + operator wl_data_source *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/ddekeyboard.cpp dwayland-5.57.0.24+really5.24.3/src/client/ddekeyboard.cpp --- dwayland-5.57.0.23/src/client/ddekeyboard.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddekeyboard.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -145,7 +145,7 @@ return KeyState::Pressed; } }; - emit k->q->keyChanged(key, toState(), time); + Q_EMIT k->q->keyChanged(key, toState(), time); } void DDEKeyboard::Private::keymapCallback(void *data, dde_keyboard *keyboard, uint32_t format, int fd, uint32_t size) @@ -155,7 +155,7 @@ if (format != DDE_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { return; } - emit k->q->keymapChanged(fd, size); + Q_EMIT k->q->keymapChanged(fd, size); } void DDEKeyboard::Private::modifiersCallback(void *data, dde_keyboard *keyboard, uint32_t serial, uint32_t modsDepressed, @@ -164,7 +164,7 @@ Q_UNUSED(serial) auto k = reinterpret_cast(data); Q_ASSERT(k->ddeKeyboard == keyboard); - emit k->q->modifiersChanged(modsDepressed, modsLatched, modsLocked, group); + Q_EMIT k->q->modifiersChanged(modsDepressed, modsLatched, modsLocked, group); } void DDEKeyboard::Private::repeatInfoCallback(void *data, dde_keyboard *keyboard, int32_t charactersPerSecond, int32_t delay) @@ -173,7 +173,7 @@ Q_ASSERT(k->ddeKeyboard == keyboard); k->repeatInfo.charactersPerSecond = qMax(charactersPerSecond, 0); k->repeatInfo.delay = qMax(delay, 0); - emit k->q->keyRepeatChanged(); + Q_EMIT k->q->keyRepeatChanged(); } } diff -Nru dwayland-5.57.0.23/src/client/ddekeyboard.h dwayland-5.57.0.24+really5.24.3/src/client/ddekeyboard.h --- dwayland-5.57.0.23/src/client/ddekeyboard.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddekeyboard.h 2022-11-18 03:38:26.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#include +#include struct dde_seat; struct dde_keyboard; diff -Nru dwayland-5.57.0.23/src/client/ddeseat.cpp dwayland-5.57.0.24+really5.24.3/src/client/ddeseat.cpp --- dwayland-5.57.0.23/src/client/ddeseat.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddeseat.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -78,7 +78,7 @@ if (!d->ddeSeat) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->ddeSeat.destroy(); } @@ -87,7 +87,7 @@ if (!d->ddeSeat) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->ddeSeat.release(); } @@ -232,7 +232,7 @@ auto p = reinterpret_cast(data); Q_ASSERT(p->ddePointer == ddePointer); p->globalPointerPos = QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy)); - emit p->q->motion(p->globalPointerPos); + Q_EMIT p->q->motion(p->globalPointerPos); } void DDEPointer::Private::buttonCallback(void *data, dde_pointer *ddePointer, wl_fixed_t sx, wl_fixed_t sy, uint32_t button, uint32_t state) @@ -247,7 +247,7 @@ } }; p->globalPointerPos = QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy)); - emit p->q->buttonStateChanged(p->globalPointerPos, button, toState()); + Q_EMIT p->q->buttonStateChanged(p->globalPointerPos, button, toState()); } void DDEPointer::Private::axisCallback(void *data, dde_pointer *ddePointer, uint32_t time, uint32_t axis, wl_fixed_t value) @@ -261,7 +261,7 @@ return Axis::Vertical; } }; - emit p->q->axisChanged(time, toAxis(), wl_fixed_to_double(value)); + Q_EMIT p->q->axisChanged(time, toAxis(), wl_fixed_to_double(value)); } bool DDEPointer::isValid() const @@ -370,21 +370,21 @@ { auto t = reinterpret_cast(data); Q_ASSERT(t->ddeTouch == touch); - emit t->q->touchDown(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); + Q_EMIT t->q->touchDown(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } void DDETouch::Private::motionCallback(void *data, struct dde_touch *touch, int32_t id, uint32_t time, wl_fixed_t x, wl_fixed_t y) { auto t = reinterpret_cast(data); Q_ASSERT(t->ddeTouch == touch); - emit t->q->touchMotion(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); + Q_EMIT t->q->touchMotion(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } void DDETouch::Private::upCallback(void *data, struct dde_touch *touch, int32_t id, uint32_t time) { auto t = reinterpret_cast(data); Q_ASSERT(t->ddeTouch == touch); - emit t->q->touchUp(id); + Q_EMIT t->q->touchUp(id); } } diff -Nru dwayland-5.57.0.23/src/client/ddeseat.h dwayland-5.57.0.24+really5.24.3/src/client/ddeseat.h --- dwayland-5.57.0.23/src/client/ddeseat.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddeseat.h 2022-11-18 03:38:26.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#include +#include struct dde_seat; struct dde_pointer; diff -Nru dwayland-5.57.0.23/src/client/ddeshell.cpp dwayland-5.57.0.24+really5.24.3/src/client/ddeshell.cpp --- dwayland-5.57.0.23/src/client/ddeshell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddeshell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -72,8 +72,8 @@ bool resizable = false; bool acceptFocus = true; bool modality = false; - bool splitable = false; bool onAllDesktops = false; + int splitable = 0; static DDEShellSurface *get(wl_surface *surface); static DDEShellSurface *get(Surface *surface); @@ -81,7 +81,6 @@ private: static void geometryCallback(void *data, dde_shell_surface *dde_shell_surface, int32_t x, int32_t y, uint32_t width, uint32_t height); static void stateChangedCallback(void *data, dde_shell_surface *dde_shell_surface, uint32_t state); - static void splitableCallback(void *data, dde_shell_surface *dde_shell_surface, uint32_t splitable); void setActive(bool set); void setMinimized(bool set); void setMaximized(bool set); @@ -170,7 +169,7 @@ if (!d->ddeShell) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->ddeShell.destroy(); } @@ -179,7 +178,7 @@ if (!d->ddeShell) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->ddeShell.release(); } @@ -274,6 +273,15 @@ p->setResizable(state & DDE_SHELL_STATE_RESIZABLE); p->setAcceptFocus(state * DDE_SHELL_STATE_ACCEPT_FOCUS); p->setModal(state & DDE_SHELL_STATE_MODALITY); + if (state & DDE_SHELL_STATE_TWO_SPLIT) { + p->splitable = 1; + } + if (state & DDE_SHELL_STATE_FOUR_SPLIT) { + p->splitable = 2; + } + if (state & DDE_SHELL_STATE_NO_SPLIT) { + p->splitable = 0; + } } void DDEShellSurface::Private::geometryCallback(void *data, dde_shell_surface *ddeShellSurface, int32_t x, int32_t y, uint32_t width, uint32_t height) @@ -285,21 +293,12 @@ return; } p->geometry = geo; - emit p->q->geometryChanged(geo); -} - -void DDEShellSurface::Private::splitableCallback(void *data, dde_shell_surface *ddeShellSurface, uint32_t splitable) -{ - Q_UNUSED(ddeShellSurface) - Private *p = cast(data); - - p->splitable = splitable; + Q_EMIT p->q->geometryChanged(geo); } const dde_shell_surface_listener DDEShellSurface::Private::s_listener = { geometryCallback, stateChangedCallback, - splitableCallback, }; void DDEShellSurface::Private::setActive(bool set) @@ -308,7 +307,7 @@ return; } active = set; - emit q->activeChanged(); + Q_EMIT q->activeChanged(); } void DDEShellSurface::Private::setOnAllDesktops(bool set) @@ -326,7 +325,7 @@ return; } fullscreen = set; - emit q->fullscreenChanged(); + Q_EMIT q->fullscreenChanged(); } void DDEShellSurface::Private::setKeepAbove(bool set) @@ -335,7 +334,7 @@ return; } keepAbove = set; - emit q->keepAboveChanged(); + Q_EMIT q->keepAboveChanged(); } void DDEShellSurface::Private::setKeepBelow(bool set) @@ -344,7 +343,7 @@ return; } keepBelow = set; - emit q->keepBelowChanged(); + Q_EMIT q->keepBelowChanged(); } void DDEShellSurface::Private::setMaximized(bool set) @@ -353,7 +352,7 @@ return; } maximized = set; - emit q->maximizedChanged(); + Q_EMIT q->maximizedChanged(); } void DDEShellSurface::Private::setMinimized(bool set) @@ -362,7 +361,7 @@ return; } minimized = set; - emit q->minimizedChanged(); + Q_EMIT q->minimizedChanged(); } void DDEShellSurface::Private::setCloseable(bool set) @@ -371,7 +370,7 @@ return; } closeable = set; - emit q->closeableChanged(); + Q_EMIT q->closeableChanged(); } void DDEShellSurface::Private::setFullscreenable(bool set) @@ -380,7 +379,7 @@ return; } fullscreenable = set; - emit q->fullscreenableChanged(); + Q_EMIT q->fullscreenableChanged(); } void DDEShellSurface::Private::setMaximizeable(bool set) @@ -389,7 +388,7 @@ return; } maximizeable = set; - emit q->maximizeableChanged(); + Q_EMIT q->maximizeableChanged(); } void DDEShellSurface::Private::setMinimizeable(bool set) @@ -398,7 +397,7 @@ return; } minimizeable = set; - emit q->minimizeableChanged(); + Q_EMIT q->minimizeableChanged(); } void DDEShellSurface::Private::setMovable(bool set) @@ -407,7 +406,7 @@ return; } movable = set; - emit q->movableChanged(); + Q_EMIT q->movableChanged(); } void DDEShellSurface::Private::setResizable(bool set) @@ -416,7 +415,7 @@ return; } resizable = set; - emit q->resizableChanged(); + Q_EMIT q->resizableChanged(); } void DDEShellSurface::Private::setAcceptFocus(bool set) @@ -425,7 +424,7 @@ return; } acceptFocus = set; - emit q->acceptFocusChanged(); + Q_EMIT q->acceptFocusChanged(); } void DDEShellSurface::Private::setModal(bool set) @@ -434,7 +433,7 @@ return; } modality = set; - emit q->modalityChanged(); + Q_EMIT q->modalityChanged(); } DDEShellSurface::DDEShellSurface(QObject *parent) @@ -704,14 +703,17 @@ return d->modality; } -bool DDEShellSurface::isMovable() const +bool DDEShellSurface::isSplitable() const { - return d->movable; + if (d->splitable) { + return true; + } + return false; } -bool DDEShellSurface::isSplitable() const +bool DDEShellSurface::isMovable() const { - return d->splitable; + return d->movable; } QRect DDEShellSurface::getGeometry() const @@ -719,6 +721,11 @@ return d->geometry; } +int DDEShellSurface::getSplitable() const +{ + return d->splitable; +} + void DDEShellSurface::requestNoTitleBarProperty(qint32 value) { struct wl_array arr; @@ -746,18 +753,18 @@ wl_array_release(&arr); } -void DDEShellSurface::requestSplitWindow(DDEShellSurface::SplitType splitType) +void DDEShellSurface::requestSplitWindow(DDEShellSurface::SplitType splitType, DDEShellSurface::SplitMode mode) { - switch (splitType) { - case SplitType::leftSplit: - dde_shell_surface_request_split_window(d->ddeShellSurface, DDE_SHELL_SPLIT_TYPE_LEFT_SPLIT); - break; - case SplitType::rightSplit: - dde_shell_surface_request_split_window(d->ddeShellSurface, DDE_SHELL_SPLIT_TYPE_RIGHT_SPLIT); - break; - default: - break; - } + struct wl_array arr; + int *arr_data = nullptr; + wl_array_init(&arr); + arr_data = static_cast(wl_array_add(&arr, sizeof(int)*2)); + arr_data[0] = (int)splitType; + arr_data[1] = (int)mode; + dde_shell_surface_set_property(d->ddeShellSurface, + DDE_SHELL_PROPERTY_QUICKTILE, + &arr); + wl_array_release(&arr); } } diff -Nru dwayland-5.57.0.23/src/client/ddeshell.h dwayland-5.57.0.24+really5.24.3/src/client/ddeshell.h --- dwayland-5.57.0.23/src/client/ddeshell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/ddeshell.h 2022-11-18 03:38:26.000000000 +0000 @@ -25,9 +25,8 @@ #include #include #include -#include -#include +#include struct dde_shell; struct dde_shell_surface; @@ -130,6 +129,7 @@ EventQueue *eventQueue() const; void release(); + /** * Destroys the data hold by this DDEShell. * This method is supposed to be used when the connection to the Wayland @@ -202,8 +202,9 @@ bool isResizable() const; bool isAcceptFocus() const; bool isModal() const; - bool isSplitable() const; bool isOnAllDesktops() const; + bool isSplitable() const; + int getSplitable() const; void requestActivate(); void requestKeepAbove(bool set); @@ -225,11 +226,23 @@ void requestWindowRadiusProperty(QPointF windowRadius); enum class SplitType { - leftSplit = 1 << 0, - rightSplit = 1 << 1, + None = 0, + Left = 1 << 0, + Right = 1 << 1, + Top = 1 << 2, + Bottom = 1 << 3, + LeftTop = Left | Top, + RightTop = Right | Top, + LeftBottom = Left | Bottom, + RightBottom = Right | Bottom, + }; + enum class SplitMode { + Two = 1 << 0, + Three = 1 << 1, + Four = 1 << 2, }; - void requestSplitWindow(SplitType splitType); + void requestSplitWindow(SplitType splitType, SplitMode mode = SplitMode::Two); Q_SIGNALS: void geometryChanged(const QRect &geom); void activeChanged(); diff -Nru dwayland-5.57.0.23/src/client/dpms.cpp dwayland-5.57.0.24+really5.24.3/src/client/dpms.cpp --- dwayland-5.57.0.23/src/client/dpms.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/dpms.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "dpms.h" #include "event_queue.h" #include "output.h" @@ -29,7 +15,6 @@ { namespace Client { - class Q_DECL_HIDDEN DpmsManager::Private { public: @@ -93,17 +78,16 @@ return dpms; } -DpmsManager::operator org_kde_kwin_dpms_manager*() const +DpmsManager::operator org_kde_kwin_dpms_manager *() const { return d->manager; } -DpmsManager::operator org_kde_kwin_dpms_manager*() +DpmsManager::operator org_kde_kwin_dpms_manager *() { return d->manager; } - class Q_DECL_HIDDEN Dpms::Private { public: @@ -130,19 +114,14 @@ Dpms *q; }; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const org_kde_kwin_dpms_listener Dpms::Private::s_listener = { - supportedCallback, - modeCallback, - doneCallback -}; +#ifndef K_DOXYGEN +const org_kde_kwin_dpms_listener Dpms::Private::s_listener = {supportedCallback, modeCallback, doneCallback}; #endif void Dpms::Private::supportedCallback(void *data, org_kde_kwin_dpms *org_kde_kwin_dpms, uint32_t supported) { Q_UNUSED(org_kde_kwin_dpms) - Private *p = reinterpret_cast(data); + Private *p = reinterpret_cast(data); p->pending.supported = supported == 0 ? false : true; p->pending.supportedChanged = true; } @@ -167,7 +146,7 @@ default: return; } - Private *p = reinterpret_cast(data); + Private *p = reinterpret_cast(data); p->pending.mode = m; p->pending.modeChanged = true; } @@ -175,16 +154,16 @@ void Dpms::Private::doneCallback(void *data, org_kde_kwin_dpms *org_kde_kwin_dpms) { Q_UNUSED(org_kde_kwin_dpms) - Private *p = reinterpret_cast(data); + Private *p = reinterpret_cast(data); const bool supportedChanged = p->pending.supportedChanged && p->pending.supported != p->current.supported; const bool modeChanged = p->pending.modeChanged && p->pending.mode != p->current.mode; if (modeChanged) { p->current.mode = p->pending.mode; - emit p->q->modeChanged(); + Q_EMIT p->q->modeChanged(); } if (supportedChanged) { p->current.supported = p->pending.supported; - emit p->q->supportedChanged(); + Q_EMIT p->q->supportedChanged(); } p->pending = Data(); } @@ -266,17 +245,17 @@ org_kde_kwin_dpms_set(d->dpms, wlMode); } -QPointer< Output > Dpms::output() const +QPointer Dpms::output() const { return d->output; } -Dpms::operator org_kde_kwin_dpms*() +Dpms::operator org_kde_kwin_dpms *() { return d->dpms; } -Dpms::operator org_kde_kwin_dpms*() const +Dpms::operator org_kde_kwin_dpms *() const { return d->dpms; } diff -Nru dwayland-5.57.0.23/src/client/dpms.h dwayland-5.57.0.24+really5.24.3/src/client/dpms.h --- dwayland-5.57.0.23/src/client/dpms.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/dpms.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_DPMS_H #define KWAYLAND_CLIENT_DPMS_H #include -#include +#include struct org_kde_kwin_dpms; struct org_kde_kwin_dpms_manager; @@ -31,15 +17,14 @@ { namespace Client { - class EventQueue; class Dpms; class Output; /** - * @short Wrapper for the org_kde_kwin_dpms_manager interface. + * @short This class is a factory for Dpms instances. * - * This class provides a convenient wrapper for the org_kde_kwin_dpms_manager interface. + * It is a convenience wrapper for the org_kde_kwin_dpms_manager interface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the DpmsManager interface: @@ -57,7 +42,7 @@ * The DpmsManager can be used as a drop-in replacement for any org_kde_kwin_dpms_manager * pointer as it provides matching cast operators. * - * @see Registry + * @see Registry, Dpms * @since 5.5 **/ class KWAYLANDCLIENT_EXPORT DpmsManager : public QObject @@ -71,7 +56,7 @@ * Registry::createDpmsManager. **/ explicit DpmsManager(QObject *parent = nullptr); - virtual ~DpmsManager(); + ~DpmsManager() override; /** * @returns @c true if managing a org_kde_kwin_dpms_manager. @@ -116,8 +101,8 @@ Dpms *getDpms(Output *output, QObject *parent = nullptr); - operator org_kde_kwin_dpms_manager*(); - operator org_kde_kwin_dpms_manager*() const; + operator org_kde_kwin_dpms_manager *(); + operator org_kde_kwin_dpms_manager *() const; Q_SIGNALS: /** @@ -134,8 +119,9 @@ }; /** - * @short Wrapper for the org_kde_kwin_dpms interface. + * @short Power management for monitors. * + * Display Power Management Signaling allows power management for monitors. * This class is a convenient wrapper for the org_kde_kwin_dpms interface. * To create a Dpms call DpmsManager::getDpms. * @@ -145,13 +131,13 @@ { Q_OBJECT public: - virtual ~Dpms(); + ~Dpms() override; enum class Mode { On, Standby, Suspend, - Off + Off, }; /** @@ -216,8 +202,8 @@ **/ void requestMode(Mode mode); - operator org_kde_kwin_dpms*(); - operator org_kde_kwin_dpms*() const; + operator org_kde_kwin_dpms *(); + operator org_kde_kwin_dpms *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/event_queue.cpp dwayland-5.57.0.24+really5.24.3/src/client/event_queue.cpp --- dwayland-5.57.0.23/src/client/event_queue.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/event_queue.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "event_queue.h" #include "connection_thread.h" #include "wayland_pointer_p.h" @@ -27,27 +13,16 @@ { namespace Client { - class Q_DECL_HIDDEN EventQueue::Private { public: - Private(EventQueue *q); - wl_display *display = nullptr; WaylandPointer queue; - -private: - EventQueue *q; }; -EventQueue::Private::Private(EventQueue *q) - : q(q) -{ -} - EventQueue::EventQueue(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new Private) { } @@ -103,12 +78,12 @@ wl_proxy_set_queue(proxy, d->queue); } -EventQueue::operator wl_event_queue*() const +EventQueue::operator wl_event_queue *() const { return d->queue; } -EventQueue::operator wl_event_queue*() +EventQueue::operator wl_event_queue *() { return d->queue; } diff -Nru dwayland-5.57.0.23/src/client/event_queue.h dwayland-5.57.0.24+really5.24.3/src/client/event_queue.h --- dwayland-5.57.0.23/src/client/event_queue.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/event_queue.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_EVENT_QUEUE_H #define WAYLAND_EVENT_QUEUE_H #include -#include +#include struct wl_display; struct wl_proxy; @@ -32,7 +18,6 @@ { namespace Client { - class ConnectionThread; /** @@ -71,7 +56,7 @@ Q_OBJECT public: explicit EventQueue(QObject *parent = nullptr); - virtual ~EventQueue(); + ~EventQueue() override; /** * Creates the event queue for the @p display. @@ -122,16 +107,16 @@ /** * Adds the @p proxy of type wl_interface (e.g. wl_compositor) to the EventQueue. **/ - template + template void addProxy(wl_interface *proxy); /** * Adds the @p proxy wrapper class of type T referencing the wl_interface to the EventQueue. **/ - template + template void addProxy(T *proxy); - operator wl_event_queue*(); - operator wl_event_queue*() const; + operator wl_event_queue *(); + operator wl_event_queue *() const; public Q_SLOTS: /** @@ -144,18 +129,16 @@ QScopedPointer d; }; -template -inline -void EventQueue::addProxy(wl_interface *proxy) +template +inline void EventQueue::addProxy(wl_interface *proxy) { - addProxy(reinterpret_cast(proxy)); + addProxy(reinterpret_cast(proxy)); } -template -inline -void EventQueue::addProxy(T *proxy) +template +inline void EventQueue::addProxy(T *proxy) { - addProxy(reinterpret_cast((wl_interface*)*(proxy))); + addProxy(reinterpret_cast((wl_interface *)*(proxy))); } } diff -Nru dwayland-5.57.0.23/src/client/fakeinput.cpp dwayland-5.57.0.24+really5.24.3/src/client/fakeinput.cpp --- dwayland-5.57.0.23/src/client/fakeinput.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/fakeinput.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "fakeinput.h" #include "event_queue.h" #include "seat.h" @@ -24,10 +10,7 @@ #include #include -#include -#if HAVE_LINUX_INPUT_H #include -#endif #include @@ -35,7 +18,6 @@ { namespace Client { - class Q_DECL_HIDDEN FakeInput::Private { public: @@ -112,7 +94,6 @@ void FakeInput::Private::sendPointerButtonState(Qt::MouseButton button, quint32 state) { -#if HAVE_LINUX_INPUT_H Q_ASSERT(manager.isValid()); uint32_t b = 0; switch (button) { @@ -131,7 +112,6 @@ return; } org_kde_kwin_fake_input_button(manager, b, state); -#endif } void FakeInput::requestPointerButtonPress(Qt::MouseButton button) @@ -254,12 +234,12 @@ org_kde_kwin_fake_input_keyboard_key(d->manager, linuxKey, WL_KEYBOARD_KEY_STATE_RELEASED); } -FakeInput::operator org_kde_kwin_fake_input*() const +FakeInput::operator org_kde_kwin_fake_input *() const { return d->manager; } -FakeInput::operator org_kde_kwin_fake_input*() +FakeInput::operator org_kde_kwin_fake_input *() { return d->manager; } diff -Nru dwayland-5.57.0.23/src/client/fakeinput.h dwayland-5.57.0.24+really5.24.3/src/client/fakeinput.h --- dwayland-5.57.0.23/src/client/fakeinput.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/fakeinput.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_FAKEINPUT_H #define KWAYLAND_FAKEINPUT_H #include -#include +#include struct org_kde_kwin_fake_input; @@ -30,10 +16,7 @@ { namespace Client { - class EventQueue; -class FakeInputTimeout; -class Seat; /** * @short Wrapper for the org_kde_kwin_fake_input interface. @@ -72,7 +55,7 @@ * Registry::createFakeInput. **/ explicit FakeInput(QObject *parent = nullptr); - virtual ~FakeInput(); + ~FakeInput() override; /** * @returns @c true if managing a org_kde_kwin_fake_input. @@ -229,8 +212,8 @@ **/ void requestKeyboardKeyRelease(quint32 linuxKey); - operator org_kde_kwin_fake_input*(); - operator org_kde_kwin_fake_input*() const; + operator org_kde_kwin_fake_input *(); + operator org_kde_kwin_fake_input *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/fullscreen_shell.cpp dwayland-5.57.0.24+really5.24.3/src/client/fullscreen_shell.cpp --- dwayland-5.57.0.23/src/client/fullscreen_shell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/fullscreen_shell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,22 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "fullscreen_shell.h" -#include "surface.h" #include "output.h" +#include "surface.h" #include "wayland_pointer_p.h" #include // wayland -#include #include +#include namespace KWayland { namespace Client { - class Q_DECL_HIDDEN FullscreenShell::Private { public: @@ -50,9 +35,7 @@ FullscreenShell *q; }; -_wl_fullscreen_shell_listener FullscreenShell::Private::s_fullscreenShellListener = { - FullscreenShell::Private::capabilitiesAnnounce -}; +_wl_fullscreen_shell_listener FullscreenShell::Private::s_fullscreenShellListener = {FullscreenShell::Private::capabilitiesAnnounce}; FullscreenShell::Private::Private(FullscreenShell *q) : q(q) @@ -69,7 +52,7 @@ void FullscreenShell::Private::capabilitiesAnnounce(void *data, _wl_fullscreen_shell *shell, uint32_t capability) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(shell == s->shell); s->handleCapabilities(capability); } @@ -78,11 +61,11 @@ { if (capability & _WL_FULLSCREEN_SHELL_CAPABILITY_ARBITRARY_MODES) { capabilityArbitraryModes = true; - emit q->capabilityArbitraryModesChanged(capabilityArbitraryModes); + Q_EMIT q->capabilityArbitraryModesChanged(capabilityArbitraryModes); } if (capability & _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE) { capabilityCursorPlane = true; - emit q->capabilityCursorPlaneChanged(capabilityCursorPlane); + Q_EMIT q->capabilityCursorPlaneChanged(capabilityCursorPlane); } } diff -Nru dwayland-5.57.0.23/src/client/fullscreen_shell.h dwayland-5.57.0.24+really5.24.3/src/client/fullscreen_shell.h --- dwayland-5.57.0.23/src/client/fullscreen_shell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/fullscreen_shell.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_FULLSCREEN_SHELL_H #define WAYLAND_FULLSCREEN_SHELL_H #include -#include +#include struct _wl_fullscreen_shell; struct wl_output; @@ -32,7 +18,6 @@ { namespace Client { - class EventQueue; class Surface; class Output; @@ -67,7 +52,7 @@ Q_PROPERTY(bool capabilityCursorPlane READ hasCapabilityCursorPlane NOTIFY capabilityCursorPlaneChanged) public: explicit FullscreenShell(QObject *parent = nullptr); - virtual ~FullscreenShell(); + ~FullscreenShell() override; bool isValid() const; void release(); diff -Nru dwayland-5.57.0.23/src/client/globalproperty.cpp dwayland-5.57.0.24+really5.24.3/src/client/globalproperty.cpp --- dwayland-5.57.0.23/src/client/globalproperty.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/globalproperty.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,109 @@ +#include "globalproperty.h" +#include "event_queue.h" +#include "surface.h" +#include "wayland_pointer_p.h" +// Qt + +// wayland +#include "wayland-dde-globalproperty-client-protocol.h" +#include "wayland-client-protocol.h" + +namespace KWayland +{ + +namespace Client +{ + +class Q_DECL_HIDDEN GlobalProperty::Private +{ +public: + Private(GlobalProperty *q); + void setup(dde_globalproperty *o); + + WaylandPointer ddeglobalproperty; + EventQueue *queue = nullptr; + +private: + GlobalProperty *q; +}; + +GlobalProperty::Private::Private(GlobalProperty *q) + : q(q) +{ + +} + +void GlobalProperty::Private::setup(dde_globalproperty *o) +{ + Q_ASSERT(o); + Q_ASSERT(!ddeglobalproperty); + ddeglobalproperty.setup(o); +} + +GlobalProperty::GlobalProperty(QObject *parent) + : QObject(parent) + , d(new Private(this)) +{ + +} + +GlobalProperty::~GlobalProperty() +{ + +} + +void GlobalProperty::setup(dde_globalproperty *ddeglobalproperty) +{ + d->setup(ddeglobalproperty); +} + +bool GlobalProperty::isValid() const +{ + return d->ddeglobalproperty.isValid(); +} + +GlobalProperty::operator dde_globalproperty*() { + return d->ddeglobalproperty; +} + +GlobalProperty::operator dde_globalproperty*() const { + return d->ddeglobalproperty; +} + +EventQueue *GlobalProperty::eventQueue() const +{ + return d->queue; +} + +void GlobalProperty::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +void GlobalProperty::setProperty(const QString &module, const QString &function, wl_surface *surface, const int32_t &type, const QString &data) +{ + dde_globalproperty_set_property(d->ddeglobalproperty, module.toStdString().c_str(), function.toStdString().c_str(), surface, type, data.toStdString().c_str()); +} + +void GlobalProperty::setProperty(const QString &module, const QString &function, Surface *surface, const int32_t &type, const QString &data) +{ + setProperty(module, function, *surface, type, data); +} + +QString GlobalProperty::getProperty(const QString &module, const QString &function) +{ + return QString(); +} + +void GlobalProperty::destroy() +{ + if (!d->ddeglobalproperty) { + return; + } + emit interfaceAboutToBeDestroyed(); + d->ddeglobalproperty.destroy(); +} + +} + +} diff -Nru dwayland-5.57.0.23/src/client/globalproperty.h dwayland-5.57.0.24+really5.24.3/src/client/globalproperty.h --- dwayland-5.57.0.23/src/client/globalproperty.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/globalproperty.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,113 @@ +/******************************************************************** +Copyright 2022 diguoliang + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) version 3, or any +later version accepted by the membership of KDE e.V. (or its +successor approved by the membership of KDE e.V.), which shall +act as a proxy defined in Section 6 of version 3 of the license. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library. If not, see . +*********************************************************************/ +#pragma once + +#include +#include +#include +#include + +#include + +struct wl_surface; +struct dde_globalproperty; + +namespace KWayland +{ + +namespace Client +{ + +class EventQueue; +class Surface; + +class KWAYLANDCLIENT_EXPORT GlobalProperty : public QObject +{ + Q_OBJECT +public: + explicit GlobalProperty(QObject *parent = nullptr); + virtual ~GlobalProperty(); + + /** + * Setup this Compositor to manage the @p GlobalProperty. + * When using Registry::createGlobalProperty there is no need to call this + * method. + **/ + void setup(dde_globalproperty *ddeglobalproperty); + + bool isValid() const; + + operator dde_globalproperty*(); + operator dde_globalproperty*() const; + dde_globalproperty *ddeGlobalProperty(); + + /** + * Sets the @p queue to use for bound proxies. + **/ + void setEventQueue(EventQueue *queue); + /** + * @returns The event queue to use for bound proxies. + **/ + EventQueue *eventQueue() const; + + void setProperty(const QString &module, const QString &function, wl_surface *surface, const int32_t &type, const QString &data); + void setProperty(const QString &module, const QString &function, Surface *surface, const int32_t &type, const QString &data); + QString getProperty(const QString &module, const QString &function); + + /** + * Destroys the data hold by this GlobalProperty. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. + * + * This method is automatically invoked when the Registry which created this + * GlobalProperty gets destroyed. + **/ + void destroy(); + +Q_SIGNALS: + /** + * This signal is emitted right before the interface is released. + **/ + void interfaceAboutToBeReleased(); + /** + * This signal is emitted right before the data is destroyed. + **/ + void interfaceAboutToBeDestroyed(); + + /** + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the GlobalProperty got created by + * Registry::createGlobalProperty + * + * @since 5.5 + **/ + void removed(); + +private: + class Private; + QScopedPointer d; +}; + +} + +} diff -Nru dwayland-5.57.0.23/src/client/idle.cpp dwayland-5.57.0.24+really5.24.3/src/client/idle.cpp --- dwayland-5.57.0.23/src/client/idle.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/idle.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "idle.h" #include "event_queue.h" #include "seat.h" @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN Idle::Private { public: @@ -92,12 +77,12 @@ return idle; } -Idle::operator org_kde_kwin_idle*() const +Idle::operator org_kde_kwin_idle *() const { return d->manager; } -Idle::operator org_kde_kwin_idle*() +Idle::operator org_kde_kwin_idle *() { return d->manager; } @@ -118,21 +103,18 @@ IdleTimeout *q; }; -const org_kde_kwin_idle_timeout_listener IdleTimeout::Private::s_listener = { - idleCallback, - resumedCallback -}; +const org_kde_kwin_idle_timeout_listener IdleTimeout::Private::s_listener = {idleCallback, resumedCallback}; void IdleTimeout::Private::idleCallback(void *data, org_kde_kwin_idle_timeout *org_kde_kwin_idle_timeout) { Q_UNUSED(org_kde_kwin_idle_timeout) - emit reinterpret_cast(data)->q->idle(); + Q_EMIT reinterpret_cast(data)->q->idle(); } void IdleTimeout::Private::resumedCallback(void *data, org_kde_kwin_idle_timeout *org_kde_kwin_idle_timeout) { Q_UNUSED(org_kde_kwin_idle_timeout) - emit reinterpret_cast(data)->q->resumeFromIdle(); + Q_EMIT reinterpret_cast(data)->q->resumeFromIdle(); } IdleTimeout::Private::Private(IdleTimeout *q) @@ -185,12 +167,12 @@ org_kde_kwin_idle_timeout_simulate_user_activity(d->timeout); } -IdleTimeout::operator org_kde_kwin_idle_timeout*() +IdleTimeout::operator org_kde_kwin_idle_timeout *() { return d->timeout; } -IdleTimeout::operator org_kde_kwin_idle_timeout*() const +IdleTimeout::operator org_kde_kwin_idle_timeout *() const { return d->timeout; } diff -Nru dwayland-5.57.0.23/src/client/idle.h dwayland-5.57.0.24+really5.24.3/src/client/idle.h --- dwayland-5.57.0.23/src/client/idle.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/idle.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_IDLE_H #define KWAYLAND_IDLE_H #include -#include +#include struct org_kde_kwin_idle; struct org_kde_kwin_idle_timeout; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class IdleTimeout; class Seat; @@ -75,7 +60,7 @@ * Registry::createIdle. **/ explicit Idle(QObject *parent = nullptr); - virtual ~Idle(); + ~Idle() override; /** * @returns @c true if managing a org_kde_kwin_idle. @@ -132,8 +117,8 @@ **/ IdleTimeout *getTimeout(quint32 msecs, Seat *seat, QObject *parent = nullptr); - operator org_kde_kwin_idle*(); - operator org_kde_kwin_idle*() const; + operator org_kde_kwin_idle *(); + operator org_kde_kwin_idle *() const; Q_SIGNALS: /** @@ -168,7 +153,7 @@ * IdleTimeout to be fully functional. **/ explicit IdleTimeout(QObject *parent = nullptr); - virtual ~IdleTimeout(); + ~IdleTimeout() override; /** * Setup this IdleTimeout to manage the @p timeout. @@ -204,8 +189,8 @@ **/ bool isValid() const; - operator org_kde_kwin_idle_timeout*(); - operator org_kde_kwin_idle_timeout*() const; + operator org_kde_kwin_idle_timeout *(); + operator org_kde_kwin_idle_timeout *() const; /** * Simulates user activity. If the IdleTimeout is in idle state this will trigger the diff -Nru dwayland-5.57.0.23/src/client/idleinhibit.cpp dwayland-5.57.0.24+really5.24.3/src/client/idleinhibit.cpp --- dwayland-5.57.0.23/src/client/idleinhibit.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/idleinhibit.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser +/* + SPDX-FileCopyrightText: 2017 Martin Flöser -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "idleinhibit.h" #include "event_queue.h" #include "surface.h" @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN IdleInhibitManager::Private { public: @@ -73,11 +58,13 @@ d->idleinhibitmanager.destroy(); } -IdleInhibitManager::operator zwp_idle_inhibit_manager_v1*() { +IdleInhibitManager::operator zwp_idle_inhibit_manager_v1 *() +{ return d->idleinhibitmanager; } -IdleInhibitManager::operator zwp_idle_inhibit_manager_v1*() const { +IdleInhibitManager::operator zwp_idle_inhibit_manager_v1 *() const +{ return d->idleinhibitmanager; } @@ -111,24 +98,14 @@ class Q_DECL_HIDDEN IdleInhibitor::Private { public: - Private(IdleInhibitor *q); - void setup(zwp_idle_inhibitor_v1 *arg); WaylandPointer idleinhibitor; - -private: - IdleInhibitor *q; }; -IdleInhibitor::Private::Private(IdleInhibitor *q) - : q(q) -{ -} - IdleInhibitor::IdleInhibitor(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new Private) { } @@ -159,11 +136,13 @@ d->idleinhibitor.destroy(); } -IdleInhibitor::operator zwp_idle_inhibitor_v1*() { +IdleInhibitor::operator zwp_idle_inhibitor_v1 *() +{ return d->idleinhibitor; } -IdleInhibitor::operator zwp_idle_inhibitor_v1*() const { +IdleInhibitor::operator zwp_idle_inhibitor_v1 *() const +{ return d->idleinhibitor; } diff -Nru dwayland-5.57.0.23/src/client/idleinhibit.h dwayland-5.57.0.24+really5.24.3/src/client/idleinhibit.h --- dwayland-5.57.0.23/src/client/idleinhibit.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/idleinhibit.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser +/* + SPDX-FileCopyrightText: 2017 Martin Flöser -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_IDLEINHIBIT_H #define KWAYLAND_CLIENT_IDLEINHIBIT_H #include -#include +#include struct zwp_idle_inhibit_manager_v1; struct zwp_idle_inhibitor_v1; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Surface; class IdleInhibitor; @@ -71,7 +56,7 @@ * Registry::createIdleInhibitManager. **/ explicit IdleInhibitManager(QObject *parent = nullptr); - virtual ~IdleInhibitManager(); + ~IdleInhibitManager() override; /** * Setup this IdleInhibitManager to manage the @p idleinhibitmanager. @@ -125,8 +110,8 @@ **/ IdleInhibitor *createInhibitor(Surface *surface, QObject *parent = nullptr); - operator zwp_idle_inhibit_manager_v1*(); - operator zwp_idle_inhibit_manager_v1*() const; + operator zwp_idle_inhibit_manager_v1 *(); + operator zwp_idle_inhibit_manager_v1 *() const; Q_SIGNALS: /** @@ -164,7 +149,7 @@ { Q_OBJECT public: - virtual ~IdleInhibitor(); + ~IdleInhibitor() override; /** * Setup this IdleInhibitor to manage the @p idleinhibitor. @@ -200,8 +185,8 @@ **/ void destroy(); - operator zwp_idle_inhibitor_v1*(); - operator zwp_idle_inhibitor_v1*() const; + operator zwp_idle_inhibitor_v1 *(); + operator zwp_idle_inhibitor_v1 *() const; private: friend class IdleInhibitManager; @@ -210,7 +195,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/keyboard.cpp dwayland-5.57.0.24+really5.24.3/src/client/keyboard.cpp --- dwayland-5.57.0.23/src/client/keyboard.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/keyboard.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "keyboard.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN Keyboard::Private { public: @@ -42,6 +27,7 @@ qint32 charactersPerSecond = 0; qint32 delay = 0; } repeatInfo; + private: void enter(uint32_t serial, wl_surface *surface, wl_array *keys); void leave(uint32_t serial); @@ -49,8 +35,8 @@ static void enterCallback(void *data, wl_keyboard *keyboard, uint32_t serial, wl_surface *surface, wl_array *keys); static void leaveCallback(void *data, wl_keyboard *keyboard, uint32_t serial, wl_surface *surface); static void keyCallback(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); - static void modifiersCallback(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t modsDepressed, - uint32_t modsLatched, uint32_t modsLocked, uint32_t group); + static void + modifiersCallback(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group); static void repeatInfoCallback(void *data, wl_keyboard *keyboard, int32_t charactersPerSecond, int32_t delay); Keyboard *q; static const wl_keyboard_listener s_listener; @@ -69,14 +55,7 @@ wl_keyboard_add_listener(keyboard, &s_listener, this); } -const wl_keyboard_listener Keyboard::Private::s_listener = { - keymapCallback, - enterCallback, - leaveCallback, - keyCallback, - modifiersCallback, - repeatInfoCallback -}; +const wl_keyboard_listener Keyboard::Private::s_listener = {keymapCallback, enterCallback, leaveCallback, keyCallback, modifiersCallback, repeatInfoCallback}; Keyboard::Keyboard(QObject *parent) : QObject(parent) @@ -106,7 +85,7 @@ void Keyboard::Private::enterCallback(void *data, wl_keyboard *keyboard, uint32_t serial, wl_surface *surface, wl_array *keys) { - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); k->enter(serial, surface, keys); } @@ -115,13 +94,13 @@ { Q_UNUSED(keys) enteredSurface = Surface::get(surface); - emit q->entered(serial); + Q_EMIT q->entered(serial); } void Keyboard::Private::leaveCallback(void *data, wl_keyboard *keyboard, uint32_t serial, wl_surface *surface) { Q_UNUSED(surface) - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); k->leave(serial); } @@ -129,13 +108,13 @@ void Keyboard::Private::leave(uint32_t serial) { enteredSurface.clear(); - emit q->left(serial); + Q_EMIT q->left(serial); } void Keyboard::Private::keyCallback(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { Q_UNUSED(serial) - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); auto toState = [state] { if (state == WL_KEYBOARD_KEY_STATE_RELEASED) { @@ -144,35 +123,40 @@ return KeyState::Pressed; } }; - emit k->q->keyChanged(key, toState(), time); + Q_EMIT k->q->keyChanged(key, toState(), time); } void Keyboard::Private::keymapCallback(void *data, wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { return; } - emit k->q->keymapChanged(fd, size); + Q_EMIT k->q->keymapChanged(fd, size); } -void Keyboard::Private::modifiersCallback(void *data, wl_keyboard *keyboard, uint32_t serial, uint32_t modsDepressed, - uint32_t modsLatched, uint32_t modsLocked, uint32_t group) +void Keyboard::Private::modifiersCallback(void *data, + wl_keyboard *keyboard, + uint32_t serial, + uint32_t modsDepressed, + uint32_t modsLatched, + uint32_t modsLocked, + uint32_t group) { Q_UNUSED(serial) - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); - emit k->q->modifiersChanged(modsDepressed, modsLatched, modsLocked, group); + Q_EMIT k->q->modifiersChanged(modsDepressed, modsLatched, modsLocked, group); } void Keyboard::Private::repeatInfoCallback(void *data, wl_keyboard *keyboard, int32_t charactersPerSecond, int32_t delay) { - auto k = reinterpret_cast(data); + auto k = reinterpret_cast(data); Q_ASSERT(k->keyboard == keyboard); k->repeatInfo.charactersPerSecond = qMax(charactersPerSecond, 0); k->repeatInfo.delay = qMax(delay, 0); - emit k->q->keyRepeatChanged(); + Q_EMIT k->q->keyRepeatChanged(); } Surface *Keyboard::enteredSurface() @@ -205,12 +189,12 @@ return d->repeatInfo.charactersPerSecond; } -Keyboard::operator wl_keyboard*() +Keyboard::operator wl_keyboard *() { return d->keyboard; } -Keyboard::operator wl_keyboard*() const +Keyboard::operator wl_keyboard *() const { return d->keyboard; } diff -Nru dwayland-5.57.0.23/src/client/keyboard.h dwayland-5.57.0.24+really5.24.3/src/client/keyboard.h --- dwayland-5.57.0.23/src/client/keyboard.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/keyboard.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_KEYBOARD_H #define WAYLAND_KEYBOARD_H #include -#include +#include struct wl_keyboard; @@ -30,7 +16,6 @@ { namespace Client { - class Surface; /** @@ -48,10 +33,10 @@ public: enum class KeyState { Released, - Pressed + Pressed, }; explicit Keyboard(QObject *parent = nullptr); - virtual ~Keyboard(); + ~Keyboard() override; /** * @returns @c true if managing a wl_keyboard. @@ -122,8 +107,8 @@ **/ qint32 keyRepeatDelay() const; - operator wl_keyboard*(); - operator wl_keyboard*() const; + operator wl_keyboard *(); + operator wl_keyboard *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/keystate.cpp dwayland-5.57.0.24+really5.24.3/src/client/keystate.cpp --- dwayland-5.57.0.23/src/client/keystate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/keystate.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,66 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "keystate.h" +#include "wayland_pointer_p.h" +#include +#include +#include +#include + +namespace KWayland +{ +namespace Client +{ +class Q_DECL_HIDDEN Keystate::Private +{ +public: + Private() + { + } + + WaylandPointer keystate; + + static void org_kde_kwin_keystate_stateChanged(void *data, struct org_kde_kwin_keystate * /*keystate*/, uint32_t k, uint32_t s) + { + auto q = static_cast(data); + q->stateChanged(Key(k), State(s)); + } + + static const org_kde_kwin_keystate_listener s_listener; +}; + +const org_kde_kwin_keystate_listener Keystate::Private::s_listener = {org_kde_kwin_keystate_stateChanged}; + +Keystate::Keystate(QObject *parent) + : QObject(parent) + , d(new Private()) +{ +} + +Keystate::~Keystate() = default; + +void Keystate::fetchStates() +{ + org_kde_kwin_keystate_fetchStates(d->keystate); +} + +void Keystate::setup(org_kde_kwin_keystate *keystate) +{ + d->keystate.setup(keystate); + org_kde_kwin_keystate_add_listener(keystate, &Keystate::Private::s_listener, this); +} + +void Keystate::destroy() +{ + d->keystate.destroy(); +} + +void Keystate::setEventQueue(KWayland::Client::EventQueue * /*queue*/) +{ +} + +} +} diff -Nru dwayland-5.57.0.23/src/client/keystate.h dwayland-5.57.0.24+really5.24.3/src/client/keystate.h --- dwayland-5.57.0.23/src/client/keystate.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/keystate.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,67 @@ +/* + SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef WAYLAND_KEYSTATE_H +#define WAYLAND_KEYSTATE_H + +#include + +#include + +struct org_kde_kwin_keystate; + +namespace KWayland +{ +namespace Client +{ +class EventQueue; + +class KWAYLANDCLIENT_EXPORT Keystate : public QObject +{ + Q_OBJECT +public: + enum class Key { + CapsLock = 0, + NumLock = 1, + ScrollLock = 2, + }; + Q_ENUM(Key); + enum State { + Unlocked = 0, + Latched = 1, + Locked = 2, + }; + Q_ENUM(State) + + Keystate(QObject *parent); + ~Keystate() override; + + void setEventQueue(EventQueue *queue); + + void destroy(); + void setup(org_kde_kwin_keystate *keystate); + + void fetchStates(); + +Q_SIGNALS: + /** + * State of the @p key changed to @p state + */ + void stateChanged(Key key, State state); + + /** + * The corresponding global for this interface on the Registry got removed. + **/ + void removed(); + +private: + class Private; + QScopedPointer d; +}; + +} +} + +#endif diff -Nru dwayland-5.57.0.23/src/client/outputconfiguration.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration.cpp --- dwayland-5.57.0.23/src/client/outputconfiguration.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,20 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "outputconfiguration.h" -#include "outputdevice.h" -#include "outputmanagement.h" #include "event_queue.h" +#include "outputmanagement.h" #include "wayland_pointer_p.h" -#include "wayland-output-management-client-protocol.h" #include "wayland-org_kde_kwin_outputdevice-client-protocol.h" +#include "wayland-output-management-client-protocol.h" namespace KWayland { namespace Client { - - class Q_DECL_HIDDEN OutputConfiguration::Private { public: @@ -51,8 +34,8 @@ }; OutputConfiguration::OutputConfiguration(QObject *parent) -: QObject(parent) -, d(new Private) + : QObject(parent) + , d(new Private) { d->q = this; } @@ -70,12 +53,11 @@ d->setup(outputconfiguration); } -void OutputConfiguration::Private::setup(org_kde_kwin_outputconfiguration* outputconfiguration) +void OutputConfiguration::Private::setup(org_kde_kwin_outputconfiguration *outputconfiguration) { org_kde_kwin_outputconfiguration_add_listener(outputconfiguration, &s_outputconfigurationListener, this); } - void OutputConfiguration::release() { d->outputconfiguration.release(); @@ -96,11 +78,13 @@ return d->queue; } -OutputConfiguration::operator org_kde_kwin_outputconfiguration*() { +OutputConfiguration::operator org_kde_kwin_outputconfiguration *() +{ return d->outputconfiguration; } -OutputConfiguration::operator org_kde_kwin_outputconfiguration*() const { +OutputConfiguration::operator org_kde_kwin_outputconfiguration *() const +{ return d->outputconfiguration; } @@ -121,11 +105,10 @@ org_kde_kwin_outputconfiguration_enable(d->outputconfiguration, od, _enable); } -void OutputConfiguration::setMode(OutputDevice* outputdevice, const int modeId) +void OutputConfiguration::setMode(OutputDevice *outputdevice, const int modeId) { org_kde_kwin_outputdevice *od = outputdevice->output(); - org_kde_kwin_outputconfiguration_mode(d->outputconfiguration, od, - modeId); + org_kde_kwin_outputconfiguration_mode(d->outputconfiguration, od, modeId); } void OutputConfiguration::setBrightness(OutputDevice *outputdevice, const int brightness) @@ -140,22 +123,22 @@ auto toTransform = [transform]() { switch (transform) { using KWayland::Client::OutputDevice; - case KWayland::Client::OutputDevice::Transform::Normal: - return WL_OUTPUT_TRANSFORM_NORMAL; - case KWayland::Client::OutputDevice::Transform::Rotated90: - return WL_OUTPUT_TRANSFORM_90; - case KWayland::Client::OutputDevice::Transform::Rotated180: - return WL_OUTPUT_TRANSFORM_180; - case KWayland::Client::OutputDevice::Transform::Rotated270: - return WL_OUTPUT_TRANSFORM_270; - case KWayland::Client::OutputDevice::Transform::Flipped: - return WL_OUTPUT_TRANSFORM_FLIPPED; - case KWayland::Client::OutputDevice::Transform::Flipped90: - return WL_OUTPUT_TRANSFORM_FLIPPED_90; - case KWayland::Client::OutputDevice::Transform::Flipped180: - return WL_OUTPUT_TRANSFORM_FLIPPED_180; - case KWayland::Client::OutputDevice::Transform::Flipped270: - return WL_OUTPUT_TRANSFORM_FLIPPED_270; + case KWayland::Client::OutputDevice::Transform::Normal: + return WL_OUTPUT_TRANSFORM_NORMAL; + case KWayland::Client::OutputDevice::Transform::Rotated90: + return WL_OUTPUT_TRANSFORM_90; + case KWayland::Client::OutputDevice::Transform::Rotated180: + return WL_OUTPUT_TRANSFORM_180; + case KWayland::Client::OutputDevice::Transform::Rotated270: + return WL_OUTPUT_TRANSFORM_270; + case KWayland::Client::OutputDevice::Transform::Flipped: + return WL_OUTPUT_TRANSFORM_FLIPPED; + case KWayland::Client::OutputDevice::Transform::Flipped90: + return WL_OUTPUT_TRANSFORM_FLIPPED_90; + case KWayland::Client::OutputDevice::Transform::Flipped180: + return WL_OUTPUT_TRANSFORM_FLIPPED_180; + case KWayland::Client::OutputDevice::Transform::Flipped270: + return WL_OUTPUT_TRANSFORM_FLIPPED_270; } abort(); }; @@ -184,12 +167,13 @@ } } -void OutputConfiguration::setColorCurves(OutputDevice *outputdevice, - QVector red, QVector green, QVector blue) +void OutputConfiguration::setColorCurves(OutputDevice *outputdevice, QVector red, QVector green, QVector blue) { org_kde_kwin_outputdevice *od = outputdevice->output(); - wl_array wlRed, wlGreen, wlBlue; + wl_array wlRed; + wl_array wlGreen; + wl_array wlBlue; auto fillArray = [](QVector &origin, wl_array *dest) { wl_array_init(dest); @@ -208,32 +192,43 @@ wl_array_release(&wlBlue); } +void OutputConfiguration::setOverscan(OutputDevice *outputdevice, uint32_t overscan) +{ + org_kde_kwin_outputdevice *od = outputdevice->output(); + if (wl_proxy_get_version(d->outputconfiguration) >= ORG_KDE_KWIN_OUTPUTCONFIGURATION_OVERSCAN_SINCE_VERSION) { + org_kde_kwin_outputconfiguration_overscan(d->outputconfiguration, od, overscan); + } +} + +void OutputConfiguration::setVrrPolicy(OutputDevice *outputdevice, OutputDevice::VrrPolicy policy) +{ + if (wl_proxy_get_version(d->outputconfiguration) >= ORG_KDE_KWIN_OUTPUTCONFIGURATION_SET_VRR_POLICY_SINCE_VERSION) { + org_kde_kwin_outputdevice *od = outputdevice->output(); + org_kde_kwin_outputconfiguration_set_vrr_policy(d->outputconfiguration, od, static_cast(policy)); + } +} + void OutputConfiguration::apply() { org_kde_kwin_outputconfiguration_apply(d->outputconfiguration); } // Callbacks -org_kde_kwin_outputconfiguration_listener OutputConfiguration::Private::s_outputconfigurationListener = { - appliedCallback, - failedCallback -}; +org_kde_kwin_outputconfiguration_listener OutputConfiguration::Private::s_outputconfigurationListener = {appliedCallback, failedCallback}; -void OutputConfiguration::Private::appliedCallback(void* data, org_kde_kwin_outputconfiguration* config) +void OutputConfiguration::Private::appliedCallback(void *data, org_kde_kwin_outputconfiguration *config) { Q_UNUSED(config); - auto o = reinterpret_cast(data); - emit o->q->applied(); + auto o = reinterpret_cast(data); + Q_EMIT o->q->applied(); } -void OutputConfiguration::Private::failedCallback(void* data, org_kde_kwin_outputconfiguration* config) +void OutputConfiguration::Private::failedCallback(void *data, org_kde_kwin_outputconfiguration *config) { Q_UNUSED(config); - auto o = reinterpret_cast(data); - emit o->q->failed(); + auto o = reinterpret_cast(data); + Q_EMIT o->q->failed(); } - } } - diff -Nru dwayland-5.57.0.23/src/client/outputconfiguration.h dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration.h --- dwayland-5.57.0.23/src/client/outputconfiguration.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -* Copyright 2015 Sebastian Kügler -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) version 3, or any -* later version accepted by the membership of KDE e.V. (or its -* successor approved by the membership of KDE e.V.), which shall -* act as a proxy defined in Section 6 of version 3 of the license. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see . -****************************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_OUTPUTCONFIGURATION_H #define KWAYLAND_CLIENT_OUTPUTCONFIGURATION_H @@ -25,7 +11,7 @@ #include #include "outputdevice.h" -#include +#include struct org_kde_kwin_outputmanagement; struct org_kde_kwin_outputconfiguration; @@ -34,7 +20,6 @@ { namespace Client { - class EventQueue; /** @class OutputConfiguration @@ -98,40 +83,40 @@ { Q_OBJECT public: - virtual ~OutputConfiguration(); + ~OutputConfiguration() override; /** - * Setup this OutputConfiguration to manage the @p outputconfiguration. - * When using OutputManagement::createOutputConfiguration there is no need to call this - * method. - * @param outputconfiguration the outputconfiguration object to set up. - **/ + * Setup this OutputConfiguration to manage the @p outputconfiguration. + * When using OutputManagement::createOutputConfiguration there is no need to call this + * method. + * @param outputconfiguration the outputconfiguration object to set up. + **/ void setup(org_kde_kwin_outputconfiguration *outputconfiguration); /** - * @returns @c true if managing a org_kde_kwin_outputconfiguration. - **/ + * @returns @c true if managing a org_kde_kwin_outputconfiguration. + **/ bool isValid() const; /** - * Releases the org_kde_kwin_outputconfiguration interface. - * After the interface has been released the OutputConfiguration instance is no - * longer valid and can be setup with another org_kde_kwin_outputconfiguration interface. - **/ + * Releases the org_kde_kwin_outputconfiguration interface. + * After the interface has been released the OutputConfiguration instance is no + * longer valid and can be setup with another org_kde_kwin_outputconfiguration interface. + **/ void release(); /** - * Destroys the data held by this OutputConfiguration. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid any more, it's not - * possible to call release any more as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or setup to a new org_kde_kwin_outputconfiguration interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * OutputConfiguration gets destroyed. - * - * - * @see release - **/ + * Destroys the data held by this OutputConfiguration. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or setup to a new org_kde_kwin_outputconfiguration interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * OutputConfiguration gets destroyed. + * + * + * @see release + **/ void destroy(); /** * Sets the @p queue to use for creating a OutputConfiguration. @@ -197,16 +182,19 @@ */ void setPosition(OutputDevice *outputdevice, const QPoint &pos); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) /** * Scale rendering of this output. * The changes done in this call will be recorded in the * OutputDevice and only applied after apply() has been called. - * @deprecated see setScaleF(qreal) * * @param scale the scaling factor for this output device. * @param outputdevice the OutputDevice this change applies to. + * @deprecated Since 5.50, use setScaleF(OutputDevice *, qreal) */ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputConfiguration::setScaleF(OutputDevice *, qreal)") void setScale(OutputDevice *outputdevice, qint32 scale); +#endif /** * Scale rendering of this output. @@ -235,6 +223,20 @@ void setColorCurves(OutputDevice *outputdevice, QVector red, QVector green, QVector blue); /** + * Set overscan in % for this output. + * + * @since 5.82 + */ + void setOverscan(OutputDevice *outputdevice, uint32_t overscan); + + /** + * Set the VRR policy for this output + * + * @since 5.82 + */ + void setVrrPolicy(OutputDevice *outputdevice, OutputDevice::VrrPolicy policy); + + /** * Ask the compositor to apply the changes. * This results in the compositor looking at all outputdevices and if they have * pending changes from the set* calls, these changes will be tested with the @@ -248,8 +250,8 @@ */ void apply(); - operator org_kde_kwin_outputconfiguration*(); - operator org_kde_kwin_outputconfiguration*() const; + operator org_kde_kwin_outputconfiguration *(); + operator org_kde_kwin_outputconfiguration *() const; Q_SIGNALS: /** @@ -272,11 +274,9 @@ QScopedPointer d; }; - } } -Q_DECLARE_METATYPE(KWayland::Client::OutputConfiguration*) - +Q_DECLARE_METATYPE(KWayland::Client::OutputConfiguration *) #endif diff -Nru dwayland-5.57.0.23/src/client/outputconfiguration_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration_v2.cpp --- dwayland-5.57.0.23/src/client/outputconfiguration_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,244 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "outputconfiguration_v2.h" +#include "event_queue.h" +#include "outputmanagement_v2.h" +#include "wayland_pointer_p.h" + +#include "wayland-kde-output-device-v2-client-protocol.h" +#include "wayland-kde-output-management-v2-client-protocol.h" + +namespace KWayland +{ +namespace Client +{ +class Q_DECL_HIDDEN OutputConfigurationV2::Private +{ +public: + Private() = default; + + void setup(kde_output_configuration_v2 *outputconfiguration); + + WaylandPointer outputconfiguration; + static struct kde_output_configuration_v2_listener s_outputconfigurationListener; + EventQueue *queue = nullptr; + + OutputConfigurationV2 *q; + +private: + static void appliedCallback(void *data, kde_output_configuration_v2 *config); + static void failedCallback(void *data, kde_output_configuration_v2 *config); +}; + +OutputConfigurationV2::OutputConfigurationV2(QObject *parent) + : QObject(parent) + , d(new Private) +{ + d->q = this; +} + +OutputConfigurationV2::~OutputConfigurationV2() +{ + release(); +} + +void OutputConfigurationV2::setup(kde_output_configuration_v2 *outputconfiguration) +{ + Q_ASSERT(outputconfiguration); + Q_ASSERT(!d->outputconfiguration); + d->outputconfiguration.setup(outputconfiguration); + d->setup(outputconfiguration); +} + +void OutputConfigurationV2::Private::setup(kde_output_configuration_v2 *outputconfiguration) +{ + kde_output_configuration_v2_add_listener(outputconfiguration, &s_outputconfigurationListener, this); +} + +void OutputConfigurationV2::release() +{ + d->outputconfiguration.release(); +} + +void OutputConfigurationV2::destroy() +{ + d->outputconfiguration.destroy(); +} + +void OutputConfigurationV2::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +EventQueue *OutputConfigurationV2::eventQueue() +{ + return d->queue; +} + +OutputConfigurationV2::operator kde_output_configuration_v2 *() +{ + return d->outputconfiguration; +} + +OutputConfigurationV2::operator kde_output_configuration_v2 *() const +{ + return d->outputconfiguration; +} + +bool OutputConfigurationV2::isValid() const +{ + return d->outputconfiguration.isValid(); +} + +// Requests + +void OutputConfigurationV2::setEnabled(OutputDeviceV2 *outputdevice, OutputDeviceV2::Enablement enable) +{ + qint32 _enable = 0; + if (enable == OutputDeviceV2::Enablement::Enabled) { + _enable = 1; + } + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_enable(d->outputconfiguration, od, _enable); +} + +void OutputConfigurationV2::setMode(OutputDeviceV2 *outputdevice, const int modeId) +{ + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_mode(d->outputconfiguration, od, *outputdevice->deviceModeFromId(modeId)); +} + +void OutputConfigurationV2::setBrightness(OutputDeviceV2 *outputdevice, const int brightness) +{ + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_brightness(d->outputconfiguration, od, + brightness); +} + +void OutputConfigurationV2::setTransform(OutputDeviceV2 *outputdevice, KWayland::Client::OutputDeviceV2::Transform transform) +{ + auto toTransform = [transform]() { + switch (transform) { + using KWayland::Client::OutputDeviceV2; + case KWayland::Client::OutputDeviceV2::Transform::Normal: + return WL_OUTPUT_TRANSFORM_NORMAL; + case KWayland::Client::OutputDeviceV2::Transform::Rotated90: + return WL_OUTPUT_TRANSFORM_90; + case KWayland::Client::OutputDeviceV2::Transform::Rotated180: + return WL_OUTPUT_TRANSFORM_180; + case KWayland::Client::OutputDeviceV2::Transform::Rotated270: + return WL_OUTPUT_TRANSFORM_270; + case KWayland::Client::OutputDeviceV2::Transform::Flipped: + return WL_OUTPUT_TRANSFORM_FLIPPED; + case KWayland::Client::OutputDeviceV2::Transform::Flipped90: + return WL_OUTPUT_TRANSFORM_FLIPPED_90; + case KWayland::Client::OutputDeviceV2::Transform::Flipped180: + return WL_OUTPUT_TRANSFORM_FLIPPED_180; + case KWayland::Client::OutputDeviceV2::Transform::Flipped270: + return WL_OUTPUT_TRANSFORM_FLIPPED_270; + } + abort(); + }; + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_transform(d->outputconfiguration, od, toTransform()); +} + +void OutputConfigurationV2::setPosition(OutputDeviceV2 *outputdevice, const QPoint &pos) +{ + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_position(d->outputconfiguration, od, pos.x(), pos.y()); +} + +void OutputConfigurationV2::setScale(OutputDeviceV2 *outputdevice, qint32 scale) +{ + setScaleF(outputdevice, scale); +} + +void OutputConfigurationV2::setScaleF(OutputDeviceV2 *outputdevice, qreal scale) +{ + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_scale(d->outputconfiguration, od, wl_fixed_from_double(scale)); +} + +void OutputConfigurationV2::setColorCurves(OutputDeviceV2 *outputdevice, QVector red, QVector green, QVector blue) +{ + kde_output_device_v2 *od = outputdevice->output(); + + wl_array wlRed; + wl_array wlGreen; + wl_array wlBlue; + + auto fillArray = [](QVector &origin, wl_array *dest) { + wl_array_init(dest); + const size_t memLength = sizeof(uint16_t) * origin.size(); + void *s = wl_array_add(dest, memLength); + memcpy(s, origin.data(), memLength); + }; + fillArray(red, &wlRed); + fillArray(green, &wlGreen); + fillArray(blue, &wlBlue); + + //kde_output_configuration_v2_colorcurves(d->outputconfiguration, od, &wlRed, &wlGreen, &wlBlue); + + wl_array_release(&wlRed); + wl_array_release(&wlGreen); + wl_array_release(&wlBlue); +} + +void OutputConfigurationV2::setOverscan(OutputDeviceV2 *outputdevice, uint32_t overscan) +{ + kde_output_device_v2 *od = outputdevice->output(); + if (wl_proxy_get_version(d->outputconfiguration) >= KDE_OUTPUT_CONFIGURATION_V2_OVERSCAN_SINCE_VERSION) { + kde_output_configuration_v2_overscan(d->outputconfiguration, od, overscan); + } +} + +void OutputConfigurationV2::setVrrPolicy(OutputDeviceV2 *outputdevice, OutputDeviceV2::VrrPolicy policy) +{ + if (wl_proxy_get_version(d->outputconfiguration) >= KDE_OUTPUT_CONFIGURATION_V2_SET_VRR_POLICY_SINCE_VERSION) { + kde_output_device_v2 *od = outputdevice->output(); + kde_output_configuration_v2_set_vrr_policy(d->outputconfiguration, od, static_cast(policy)); + } +} + +void OutputConfigurationV2::setRgbRange(OutputDeviceV2 *outputdevice, uint32_t rgbRange) +{ + if (wl_proxy_get_version(d->outputconfiguration) >= KDE_OUTPUT_CONFIGURATION_V2_SET_RGB_RANGE_SINCE_VERSION) { + kde_output_configuration_v2_set_rgb_range(d->outputconfiguration, outputdevice->output(), rgbRange); + } +} + +void OutputConfigurationV2::setPrimaryOutput(OutputDeviceV2 *outputdevice) +{ + if (wl_proxy_get_version(d->outputconfiguration) >= KDE_OUTPUT_CONFIGURATION_V2_SET_PRIMARY_OUTPUT_SINCE_VERSION) { + kde_output_configuration_v2_set_primary_output(d->outputconfiguration, outputdevice->output()); + } +} + +void OutputConfigurationV2::apply() +{ + kde_output_configuration_v2_apply(d->outputconfiguration); +} + +// Callbacks +kde_output_configuration_v2_listener OutputConfigurationV2::Private::s_outputconfigurationListener = {appliedCallback, failedCallback}; + +void OutputConfigurationV2::Private::appliedCallback(void *data, kde_output_configuration_v2 *config) +{ + Q_UNUSED(config); + auto o = reinterpret_cast(data); + Q_EMIT o->q->applied(); +} + +void OutputConfigurationV2::Private::failedCallback(void *data, kde_output_configuration_v2 *config) +{ + Q_UNUSED(config); + auto o = reinterpret_cast(data); + Q_EMIT o->q->failed(); +} + +} +} diff -Nru dwayland-5.57.0.23/src/client/outputconfiguration_v2.h dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration_v2.h --- dwayland-5.57.0.23/src/client/outputconfiguration_v2.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputconfiguration_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,286 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef KWAYLAND_CLIENT_OUTPUTCONFIGURATION_V2_H +#define KWAYLAND_CLIENT_OUTPUTCONFIGURATION_V2_H + +#include +#include +#include + +#include "outputdevice_v2.h" +#include + +struct kde_output_management_v2; +struct kde_output_configuration_v2; + +namespace KWayland +{ +namespace Client +{ +class EventQueue; + +/** @class OutputConfigurationV2 + * + * OutputConfigurationV2 provides access to changing OutputDevices. The interface is async + * and atomic. An OutputConfigurationV2 is created through OutputConfigurationV2::createConfiguration(). + * + * The overall mechanism is to get a new OutputConfigurationV2 from the OutputConfigurationV2 global and + * apply changes through the OutputConfigurationV2::set* calls. When all changes are set, the client + * calls apply, which asks the server to look at the changes and apply them. The server will then + * signal back whether the changes have been applied successfully (@c applied()) or were rejected + * or failed to apply (@c failed()). + * + * The current settings for outputdevices can be gotten from @c Registry::outputDevices(), these + * are used in the set* calls to identify the output the setting applies to. + * + * These KWayland classes will not apply changes to the OutputDevices, this is the compositor's + * task. As such, the configuration set through this interface can be seen as a hint what the + * compositor should set up, but whether or not the compositor does it (based on hardware or + * rendering policies, for example), is up to the compositor. The mode setting is passed on to + * the DRM subsystem through the compositor. The compositor also saves this configuration and reads + * it on startup, this interface is not involved in that process. + * + * @c apply() should only be called after changes to all output devices have been made, not after + * each change. This allows to test the new configuration as a whole, and is a lot faster since + * hardware changes can be tested in their new combination, they done in parallel.and rolled back + * as a whole. + * + * \verbatim + // We're just picking the first of our outputdevices + KWayland::Client::OutputDeviceV2 *output = m_clientOutputs.first(); + + // Create a new configuration object + auto config = m_outputManagement.createConfiguration(); + + // handle applied and failed signals + connect(config, &OutputConfigurationV2::applied, []() { + qDebug() << "Configuration applied!"; + }); + connect(config, &OutputConfigurationV2::failed, []() { + qDebug() << "Configuration failed!"; + }); + + // Change settings + config->setMode(output, m_clientOutputs.first()->modes().last().id); + config->setTransform(output, OutputDeviceV2::Transform::Normal); + config->setPosition(output, QPoint(0, 1920)); + config->setScale(output, 2); + + // Now ask the compositor to apply the changes + config->apply(); + // You may wait for the applied() or failed() signal here + \endverbatim + + * @see OutputDeviceV2 + * @see OutputConfigurationV2 + * @see OutputConfigurationV2::createConfiguration() + * @since 5.5 + */ +class KWAYLANDCLIENT_EXPORT OutputConfigurationV2 : public QObject +{ + Q_OBJECT +public: + ~OutputConfigurationV2() override; + + /** + * Setup this OutputConfigurationV2 to manage the @p outputconfiguration. + * When using OutputConfigurationV2::createOutputConfiguration there is no need to call this + * method. + * @param outputconfiguration the outputconfiguration object to set up. + **/ + void setup(kde_output_configuration_v2 *outputconfiguration); + /** + * @returns @c true if managing a kde_output_configuration_v2. + **/ + bool isValid() const; + /** + * Releases the kde_output_configuration_v2 interface. + * After the interface has been released the OutputConfigurationV2 instance is no + * longer valid and can be setup with another kde_output_configuration_v2 interface. + **/ + void release(); + /** + * Destroys the data held by this OutputConfigurationV2. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or setup to a new kde_output_configuration_v2 interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * OutputConfigurationV2 gets destroyed. + * + * + * @see release + **/ + void destroy(); + /** + * Sets the @p queue to use for creating a OutputConfigurationV2. + **/ + void setEventQueue(EventQueue *queue); + /** + * @returns The event queue to use for creating a OutputConfigurationV2 + **/ + EventQueue *eventQueue(); + + /** + * Enable or disable an output. Enabled means it's used by the + * compositor for rendering, Disabled means, that no wl_output + * is connected to this, and the device is sitting there unused + * by this compositor. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param outputdevice the OutputDeviceV2 this change applies to. + * @param enable new Enablement state of this output device. + */ + void setEnabled(OutputDeviceV2 *outputdevice, OutputDeviceV2::Enablement enable); + + /** + * Set the mode of this output, identified by its mode id. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param outputdevice the OutputDeviceV2 this change applies to. + * @param modeId the id of the mode. + */ + void setMode(OutputDeviceV2 *outputdevice, const int modeId); + /** + * Set brightness for this output, for example rotated or flipped. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param outputdevice the OutputDeviceV2 this change applies to. + * @param brightness the brightnessing factor for this output device. + */ + void setBrightness(OutputDeviceV2 *outputdevice, const int brightness); + /** + * Set transformation for this output, for example rotated or flipped. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param outputdevice the OutputDeviceV2 this change applies to. + * @param scale the scaling factor for this output device. + */ + void setTransform(OutputDeviceV2 *outputdevice, KWayland::Client::OutputDeviceV2::Transform transform); + + /** + * Position this output in the global space, relative to other outputs. + * QPoint(0, 0) for top-left. The position is the top-left corner of this output. + * There may not be gaps between outputs, they have to be positioned adjacent to + * each other. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param outputdevice the OutputDeviceV2 this change applies to. + * @param pos the OutputDeviceV2 global position relative to other outputs, + * + */ + void setPosition(OutputDeviceV2 *outputdevice, const QPoint &pos); + +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) + /** + * Scale rendering of this output. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param scale the scaling factor for this output device. + * @param outputdevice the OutputDeviceV2 this change applies to. + * @deprecated Since 5.50, use setScaleF(OutputDeviceV2 *, qreal) + */ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputConfigurationV2::setScaleF(OutputDeviceV2 *, qreal)") + void setScale(OutputDeviceV2 *outputdevice, qint32 scale); +#endif + + /** + * Scale rendering of this output. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param scale the scaling factor for this output device. + * @param outputdevice the OutputDeviceV2 this change applies to. + * @since 5.50 + */ + void setScaleF(OutputDeviceV2 *outputdevice, qreal scale); + + /* Set color curves for this output. The respective color curve vector + * lengths must equal the current ones in the OutputDeviceV2. The codomain + * of the curves is always the full uint16 value range, such that any vector + * is accepted as long as it has the right size. + * The changes done in this call will be recorded in the + * OutputDeviceV2 and only applied after apply() has been called. + * + * @param red color curve of red channel. + * @param green color curve of green channel. + * @param blue color curve of blue channel. + * @param outputdevice the OutputDeviceV2 this change applies to. + * @since 5.50 + */ + void setColorCurves(OutputDeviceV2 *outputdevice, QVector red, QVector green, QVector blue); + + /** + * Set overscan in % for this output. + * + * @since 5.82 + */ + void setOverscan(OutputDeviceV2 *outputdevice, uint32_t overscan); + + /** + * Set the VRR policy for this output + * + * @since 5.82 + */ + void setVrrPolicy(OutputDeviceV2 *outputdevice, OutputDeviceV2::VrrPolicy policy); + + void setRgbRange(OutputDeviceV2 *outputdevice, uint32_t rgbRange); + + void setPrimaryOutput(OutputDeviceV2 *outputdevice); + + /** + * Ask the compositor to apply the changes. + * This results in the compositor looking at all outputdevices and if they have + * pending changes from the set* calls, these changes will be tested with the + * hardware and applied if possible. The compositor will react to these changes + * with the applied() or failed() signals. Note that mode setting may take a + * while, so the interval between calling apply() and receiving the applied() + * signal may be considerable, depending on the hardware. + * + * @see applied() + * @see failed() + */ + void apply(); + + operator kde_output_configuration_v2 *(); + operator kde_output_configuration_v2 *() const; + +Q_SIGNALS: + /** + * The server has applied all settings successfully. Pending changes in the + * OutputDevices have been cleared, changed signals from the OutputDeviceV2 have + * been emitted. + */ + void applied(); + /** + * The server has failed to apply the settings or rejected them. Pending changes + * in the * OutputDevices have been cleared. No changes have been applied to the + * OutputDevices. + */ + void failed(); + +private: + friend class OutputManagementV2; + explicit OutputConfigurationV2(QObject *parent = nullptr); + class Private; + QScopedPointer d; +}; + +} +} + +Q_DECLARE_METATYPE(KWayland::Client::OutputConfigurationV2 *) + +#endif diff -Nru dwayland-5.57.0.23/src/client/output.cpp dwayland-5.57.0.24+really5.24.3/src/client/output.cpp --- dwayland-5.57.0.23/src/client/output.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/output.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,39 +1,23 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "output.h" #include "wayland_pointer_p.h" // Qt #include #include -#include #include // wayland #include namespace KWayland { - namespace Client { - -namespace { +namespace +{ typedef QList Modes; } @@ -59,9 +43,16 @@ static Output *get(wl_output *o); private: - static void geometryCallback(void *data, wl_output *output, int32_t x, int32_t y, - int32_t physicalWidth, int32_t physicalHeight, int32_t subPixel, - const char *make, const char *model, int32_t transform); + static void geometryCallback(void *data, + wl_output *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform); static void modeCallback(void *data, wl_output *output, uint32_t flags, int32_t width, int32_t height, int32_t refresh); static void doneCallback(void *data, wl_output *output); static void scaleCallback(void *data, wl_output *output, int32_t scale); @@ -77,10 +68,10 @@ Output *q; static struct wl_output_listener s_outputListener; - static QVector s_allOutputs; + static QVector s_allOutputs; }; -QVector Output::Private::s_allOutputs; +QVector Output::Private::s_allOutputs; Output::Private::Private(Output *q) : q(q) @@ -95,12 +86,10 @@ Output *Output::Private::get(wl_output *o) { - auto it = std::find_if(s_allOutputs.constBegin(), s_allOutputs.constEnd(), - [o] (Private *p) { - const wl_output *reference = p->output; - return reference == o; - } - ); + auto it = std::find_if(s_allOutputs.constBegin(), s_allOutputs.constEnd(), [o](Private *p) { + const wl_output *reference = p->output; + return reference == o; + }); if (it != s_allOutputs.constEnd()) { return (*it)->q; } @@ -117,10 +106,7 @@ bool Output::Mode::operator==(const Output::Mode &m) const { - return size == m.size - && refreshRate == m.refreshRate - && flags == m.flags - && output == m.output; + return size == m.size && refreshRate == m.refreshRate && flags == m.flags && output == m.output; } Output::Output(QObject *parent) @@ -134,20 +120,21 @@ d->output.release(); } -wl_output_listener Output::Private::s_outputListener = { - geometryCallback, - modeCallback, - doneCallback, - scaleCallback -}; +wl_output_listener Output::Private::s_outputListener = {geometryCallback, modeCallback, doneCallback, scaleCallback}; -void Output::Private::geometryCallback(void *data, wl_output *output, - int32_t x, int32_t y, - int32_t physicalWidth, int32_t physicalHeight, - int32_t subPixel, const char *make, const char *model, int32_t transform) +void Output::Private::geometryCallback(void *data, + wl_output *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform) { Q_UNUSED(transform) - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->setGlobalPosition(QPoint(x, y)); o->setManufacturer(make); @@ -197,7 +184,7 @@ void Output::Private::modeCallback(void *data, wl_output *output, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->addMode(flags, width, height, refresh); } @@ -222,7 +209,7 @@ auto &m = (*it); if (m.flags.testFlag(Mode::Flag::Current)) { m.flags &= ~Mode::Flags(Mode::Flag::Current); - emit q->modeChanged(m); + Q_EMIT q->modeChanged(m); } if (m.refreshRate == mode.refreshRate && m.size == mode.size) { it = modes.erase(it); @@ -234,24 +221,24 @@ currentMode = currentIt; } if (existing) { - emit q->modeChanged(mode); + Q_EMIT q->modeChanged(mode); } else { - emit q->modeAdded(mode); + Q_EMIT q->modeAdded(mode); } } void Output::Private::scaleCallback(void *data, wl_output *output, int32_t scale) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->setScale(scale); } void Output::Private::doneCallback(void *data, wl_output *output) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); - emit o->q->changed(); + Q_EMIT o->q->changed(); } void Output::setup(wl_output *output) @@ -373,16 +360,18 @@ return d->transform; } -QList< Output::Mode > Output::modes() const +QList Output::modes() const { return d->modes; } -Output::operator wl_output*() { +Output::operator wl_output *() +{ return d->output; } -Output::operator wl_output*() const { +Output::operator wl_output *() const +{ return d->output; } diff -Nru dwayland-5.57.0.23/src/client/outputdevice.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputdevice.cpp --- dwayland-5.57.0.23/src/client/outputdevice.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevice.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,9 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin -Copyright 2018 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin + SPDX-FileCopyrightText: 2018 Roman Gilg + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "outputdevice.h" #include "logging.h" #include "wayland_pointer_p.h" @@ -25,17 +11,14 @@ #include #include #include -#include // wayland #include "wayland-org_kde_kwin_outputdevice-client-protocol.h" #include namespace KWayland { - namespace Client { - typedef QList Modes; class Q_DECL_HIDDEN OutputDevice::Private @@ -63,12 +46,23 @@ ColorCurves colorCurves; + Capabilities capabilities; + uint32_t overscan = 0; + VrrPolicy vrrPolicy = VrrPolicy::Automatic; + bool done = false; private: - static void geometryCallback(void *data, org_kde_kwin_outputdevice *output, int32_t x, int32_t y, - int32_t physicalWidth, int32_t physicalHeight, int32_t subPixel, - const char *make, const char *model, int32_t transform); + static void geometryCallback(void *data, + org_kde_kwin_outputdevice *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform); static void modeCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t flags, int32_t width, int32_t height, int32_t refresh, int32_t mode_id); static void doneCallback(void *data, org_kde_kwin_outputdevice *output); static void scaleCallback(void *data, org_kde_kwin_outputdevice *output, int32_t scale); @@ -78,11 +72,13 @@ static void enabledCallback(void *data, org_kde_kwin_outputdevice *output, int32_t enabled); static void uuidCallback(void *data, org_kde_kwin_outputdevice *output, const char *uuid); - static void colorcurvesCallback(void *data, org_kde_kwin_outputdevice *output, - wl_array *red, wl_array *green, wl_array *blue); + static void colorcurvesCallback(void *data, org_kde_kwin_outputdevice *output, wl_array *red, wl_array *green, wl_array *blue); static void serialNumberCallback(void *data, org_kde_kwin_outputdevice *output, const char *serialNumber); static void eisaIdCallback(void *data, org_kde_kwin_outputdevice *output, const char *eisa); + static void capabilitiesCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t capabilities); + static void overscanCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t overscan); + static void vrrPolicyCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t vrrPolicy); void setPhysicalSize(const QSize &size); void setGlobalPosition(const QPoint &pos); @@ -114,17 +110,15 @@ bool OutputDevice::Mode::operator==(const OutputDevice::Mode &m) const { - return size == m.size - && refreshRate == m.refreshRate - && flags == m.flags - && output == m.output; + return size == m.size && refreshRate == m.refreshRate && flags == m.flags && output == m.output; } bool OutputDevice::ColorCurves::operator==(const OutputDevice::ColorCurves &cc) const { return red == cc.red && green == cc.green && blue == cc.blue; } -bool OutputDevice::ColorCurves::operator!=(const ColorCurves &cc) const { +bool OutputDevice::ColorCurves::operator!=(const ColorCurves &cc) const +{ return !operator==(cc); } @@ -150,16 +144,25 @@ scaleFCallback, colorcurvesCallback, serialNumberCallback, - eisaIdCallback + eisaIdCallback, + capabilitiesCallback, + overscanCallback, + vrrPolicyCallback }; -void OutputDevice::Private::geometryCallback(void *data, org_kde_kwin_outputdevice *output, - int32_t x, int32_t y, - int32_t physicalWidth, int32_t physicalHeight, - int32_t subPixel, const char *make, const char *model, int32_t transform) +void OutputDevice::Private::geometryCallback(void *data, + org_kde_kwin_outputdevice *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform) { Q_UNUSED(transform) - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->setGlobalPosition(QPoint(x, y)); o->setManufacturer(make); @@ -207,9 +210,15 @@ o->setTransform(toTransform()); } -void OutputDevice::Private::modeCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t flags, int32_t width, int32_t height, int32_t refresh, int32_t mode_id) +void OutputDevice::Private::modeCallback(void *data, + org_kde_kwin_outputdevice *output, + uint32_t flags, + int32_t width, + int32_t height, + int32_t refresh, + int32_t mode_id) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->addMode(flags, width, height, refresh, mode_id); } @@ -231,13 +240,11 @@ bool existing = false; if (flags & WL_OUTPUT_MODE_CURRENT) { auto it = modes.begin(); - // because we may call modes.erase() which means modes.end() maybe changed - // so here we use (it != modes.end()) to replace of (it != currentIt) while (it != modes.end()) { auto &m = (*it); if (m.flags.testFlag(Mode::Flag::Current)) { m.flags &= ~Mode::Flags(Mode::Flag::Current); - emit q->modeChanged(m); + Q_EMIT q->modeChanged(m); } if (m.refreshRate == mode.refreshRate && m.size == mode.size) { it = modes.erase(it); @@ -248,19 +255,19 @@ } } - // insert new mode after erase old mode + // insert new mode after erase all repeat old mode modes.insert(modes.end(), mode); if (existing) { - emit q->modeChanged(mode); + Q_EMIT q->modeChanged(mode); } else { - emit q->modeAdded(mode); + Q_EMIT q->modeAdded(mode); } } KWayland::Client::OutputDevice::Mode OutputDevice::currentMode() const { - for (const auto &m: modes()) { + for (const auto &m : modes()) { if (m.flags.testFlag(KWayland::Client::OutputDevice::Mode::Flag::Current)) { return m; } @@ -271,38 +278,38 @@ void OutputDevice::Private::scaleCallback(void *data, org_kde_kwin_outputdevice *output, int32_t scale) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->setScale(scale); } void OutputDevice::Private::scaleFCallback(void *data, org_kde_kwin_outputdevice *output, wl_fixed_t scale_fixed) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->setScale(wl_fixed_to_double(scale_fixed)); } void OutputDevice::Private::doneCallback(void *data, org_kde_kwin_outputdevice *output) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_ASSERT(o->output == output); o->done = true; - emit o->q->changed(); - emit o->q->done(); + Q_EMIT o->q->changed(); + Q_EMIT o->q->done(); } -void OutputDevice::Private::edidCallback(void* data, org_kde_kwin_outputdevice* output, const char* raw) +void OutputDevice::Private::edidCallback(void *data, org_kde_kwin_outputdevice *output, const char *raw) { Q_UNUSED(output); - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); o->edid = QByteArray::fromBase64(raw); } -void OutputDevice::Private::enabledCallback(void* data, org_kde_kwin_outputdevice* output, int32_t enabled) +void OutputDevice::Private::enabledCallback(void *data, org_kde_kwin_outputdevice *output, int32_t enabled) { Q_UNUSED(output); - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); OutputDevice::Enablement _enabled = OutputDevice::Enablement::Disabled; if (enabled == ORG_KDE_KWIN_OUTPUTDEVICE_ENABLEMENT_ENABLED) { @@ -310,33 +317,30 @@ } if (o->enabled != _enabled) { o->enabled = _enabled; - emit o->q->enabledChanged(o->enabled); + Q_EMIT o->q->enabledChanged(o->enabled); if (o->done) { - emit o->q->changed(); + Q_EMIT o->q->changed(); } } } -void OutputDevice::Private::uuidCallback(void* data, org_kde_kwin_outputdevice* output, const char *uuid) +void OutputDevice::Private::uuidCallback(void *data, org_kde_kwin_outputdevice *output, const char *uuid) { Q_UNUSED(output); - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); if (o->uuid != uuid) { o->uuid = uuid; - emit o->q->uuidChanged(o->uuid); + Q_EMIT o->q->uuidChanged(o->uuid); if (o->done) { - emit o->q->changed(); + Q_EMIT o->q->changed(); } } } -void OutputDevice::Private::colorcurvesCallback(void *data, org_kde_kwin_outputdevice *output, - wl_array *red, - wl_array *green, - wl_array *blue) +void OutputDevice::Private::colorcurvesCallback(void *data, org_kde_kwin_outputdevice *output, wl_array *red, wl_array *green, wl_array *blue) { Q_UNUSED(output); - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); auto cc = ColorCurves(); @@ -350,27 +354,68 @@ if (o->colorCurves != cc) { o->colorCurves = cc; - emit o->q->colorCurvesChanged(); + Q_EMIT o->q->colorCurvesChanged(); if (o->done) { - emit o->q->changed(); + Q_EMIT o->q->changed(); } } } void OutputDevice::Private::serialNumberCallback(void *data, org_kde_kwin_outputdevice *output, const char *raw) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_UNUSED(output); o->setSerialNumber(raw); } void OutputDevice::Private::eisaIdCallback(void *data, org_kde_kwin_outputdevice *output, const char *raw) { - auto o = reinterpret_cast(data); + auto o = reinterpret_cast(data); Q_UNUSED(output); o->setEisaId(raw); } +void OutputDevice::Private::capabilitiesCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t capabilities) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + auto caps = static_cast(capabilities); + if (o->capabilities != caps) { + o->capabilities = caps; + Q_EMIT o->q->capabilitiesChanged(caps); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDevice::Private::overscanCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t overscan) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + if (o->overscan != overscan) { + o->overscan = overscan; + Q_EMIT o->q->overscanChanged(overscan); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDevice::Private::vrrPolicyCallback(void *data, org_kde_kwin_outputdevice *output, uint32_t vrr_policy) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + auto vrrPolicy = static_cast(vrr_policy); + if (o->vrrPolicy != vrrPolicy) { + o->vrrPolicy = vrrPolicy; + Q_EMIT o->q->vrrPolicyChanged(vrrPolicy); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + void OutputDevice::setup(org_kde_kwin_outputdevice *output) { d->setup(output); @@ -494,7 +539,6 @@ return d->scale; } - bool OutputDevice::isValid() const { return d->output.isValid(); @@ -510,16 +554,18 @@ return d->transform; } -QList< OutputDevice::Mode > OutputDevice::modes() const +QList OutputDevice::modes() const { return d->modes; } -OutputDevice::operator org_kde_kwin_outputdevice*() { +OutputDevice::operator org_kde_kwin_outputdevice *() +{ return d->output; } -OutputDevice::operator org_kde_kwin_outputdevice*() const { +OutputDevice::operator org_kde_kwin_outputdevice *() const +{ return d->output; } @@ -543,10 +589,24 @@ return d->colorCurves; } +OutputDevice::Capabilities OutputDevice::capabilities() const +{ + return d->capabilities; +} + +uint32_t OutputDevice::overscan() const +{ + return d->overscan; +} + +OutputDevice::VrrPolicy OutputDevice::vrrPolicy() const +{ + return d->vrrPolicy; +} + void OutputDevice::destroy() { d->output.destroy(); - } } diff -Nru dwayland-5.57.0.23/src/client/outputdevice.h dwayland-5.57.0.24+really5.24.3/src/client/outputdevice.h --- dwayland-5.57.0.23/src/client/outputdevice.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevice.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,9 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin -Copyright 2018 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin + SPDX-FileCopyrightText: 2018 Roman Gilg + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_OUTPUTDEVICE_H #define WAYLAND_OUTPUTDEVICE_H @@ -26,7 +12,7 @@ #include #include -#include +#include struct org_kde_kwin_outputdevice; class QPoint; @@ -36,7 +22,6 @@ { namespace Client { - class EventQueue; /** @@ -79,8 +64,9 @@ HorizontalRGB, HorizontalBGR, VerticalRGB, - VerticalBGR + VerticalBGR, }; + Q_ENUM(SubPixel) enum class Transform { Normal, Rotated90, @@ -89,17 +75,19 @@ Flipped, Flipped90, Flipped180, - Flipped270 + Flipped270, }; + Q_ENUM(Transform) enum class Enablement { Disabled = 0, - Enabled = 1 + Enabled = 1, }; + Q_ENUM(Enablement) struct Mode { enum class Flag { None = 0, Current = 1 << 0, - Preferred = 1 << 1 + Preferred = 1 << 1, }; Q_DECLARE_FLAGS(Flags, Flag) /** @@ -134,8 +122,19 @@ bool operator==(const ColorCurves &cc) const; bool operator!=(const ColorCurves &cc) const; }; + enum class Capability { + Overscan = 0x1, + Vrr = 0x2, + }; + Q_DECLARE_FLAGS(Capabilities, Capability) + enum class VrrPolicy { + Never = 0, + Always = 1, + Automatic = 2 + }; + explicit OutputDevice(QObject *parent = nullptr); - virtual ~OutputDevice(); + ~OutputDevice() override; /** * Setup this Compositor to manage the @p output. @@ -148,8 +147,8 @@ * @returns @c true if managing a org_kde_kwin_outputdevice. **/ bool isValid() const; - operator org_kde_kwin_outputdevice*(); - operator org_kde_kwin_outputdevice*() const; + operator org_kde_kwin_outputdevice *(); + operator org_kde_kwin_outputdevice *() const; org_kde_kwin_outputdevice *output(); /** * Size in millimeters. @@ -190,15 +189,19 @@ * Refresh rate in mHz of the current mode. **/ int refreshRate() const; + +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) /** * Scaling factor of this output. * * A scale larger than 1 means that the compositor will automatically scale surface buffers * by this amount when rendering. This is used for very high resolution displays where * applications rendering at the native resolution would be too small to be legible. - * @deprecated see scaleF + * @deprecated Since 5.50, use scaleF() **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputDevice::scaleF()") int scale() const; +#endif /** * Scaling factor of this output. @@ -234,7 +237,6 @@ KWayland::Client::OutputDevice::Mode currentMode() const; - /** * Sets the @p queue to use for bound proxies. **/ @@ -260,15 +262,33 @@ QByteArray uuid() const; /** - * Destroys the data hold by this OutputDevice. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid any more, it's not - * possible to call release any more as that calls into the Wayland - * connection and the call would fail. - * - * This method is automatically invoked when the Registry which created this - * Output gets destroyed. - **/ + * @returns the capabilities of this outputdevice + * @since 5.82 + **/ + Capabilities capabilities() const; + + /** + * @returns what overscan value this outputdevice is using + * @since 5.82 + **/ + uint32_t overscan() const; + + /** + * @returns the compositors policy regarding vrr on this output + * @since 5.82 + */ + VrrPolicy vrrPolicy() const; + + /** + * Destroys the data hold by this OutputDevice. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. + * + * This method is automatically invoked when the Registry which created this + * Output gets destroyed. + **/ void destroy(); Q_SIGNALS: @@ -309,6 +329,24 @@ **/ void colorCurvesChanged(); /** + * Emitted whenever the capabilities change + * @param capabilities the new capabilities + * @since 5.82 + **/ + void capabilitiesChanged(const Capabilities &capabilities); + /** + * Emitted whenever the overscan changes + * @param overscan the new overscan value + * @since 5.82 + **/ + void overscanChanged(uint32_t overscan); + /** + * Emitted whenever the variable refresh rate policy for this output changes + * + * @since 5.82 + **/ + void vrrPolicyChanged(VrrPolicy vrrPolicy); + /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the OutputDevice got created by @@ -323,6 +361,8 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(OutputDevice::Mode::Flags) + } } @@ -331,6 +371,5 @@ Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Enablement) Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Mode) Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::ColorCurves) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::OutputDevice::Mode::Flags) #endif diff -Nru dwayland-5.57.0.23/src/client/outputdevicemode_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputdevicemode_v2.cpp --- dwayland-5.57.0.23/src/client/outputdevicemode_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevicemode_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,172 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "outputdevicemode_v2.h" +#include "logging.h" +#include "wayland_pointer_p.h" +// Qt +#include +#include +#include +// wayland +#include +#include + +namespace KWayland +{ +namespace Client +{ + +class Q_DECL_HIDDEN DeviceModeV2::Private +{ +public: + Private(DeviceModeV2 *q, kde_output_device_mode_v2 *m); + void setup(kde_output_device_mode_v2 *m); + + static DeviceModeV2 *get(kde_output_device_mode_v2 *object); + + WaylandPointer mode; + + int refreshRate = 60000; + QSize size; + bool preferred = false; + +private: + static void handleSizeCallback(void *data, kde_output_device_mode_v2 *object, int32_t width, int32_t height); + static void handleRefreshCallback(void *data, kde_output_device_mode_v2 *object, int32_t refresh); + static void handlePreferredCallback(void *data, kde_output_device_mode_v2 *object); + static void handleRemovedCallback(void *data, kde_output_device_mode_v2 *object); + + void kde_output_device_mode_v2_size(int32_t width, int32_t height); + void kde_output_device_mode_v2_refresh(int32_t refresh); + void kde_output_device_mode_v2_preferred(); + void kde_output_device_mode_v2_removed(); + + DeviceModeV2 *q; + static struct kde_output_device_mode_v2_listener s_modeListener; +}; + +DeviceModeV2::Private::Private(DeviceModeV2 *q, kde_output_device_mode_v2 *m) + : q(q) +{ + setup(m); +} + +void DeviceModeV2::Private::setup(kde_output_device_mode_v2 *m) +{ + Q_ASSERT(m); + Q_ASSERT(!mode); + mode.setup(m); + kde_output_device_mode_v2_add_listener(m, &s_modeListener, this); +} + +kde_output_device_mode_v2_listener DeviceModeV2::Private::s_modeListener = { + handleSizeCallback, + handleRefreshCallback, + handlePreferredCallback, + handleRemovedCallback +}; + +void DeviceModeV2::Private::handleSizeCallback(void *data, kde_output_device_mode_v2 *object, int32_t width, int32_t height) +{ + Q_UNUSED(object); + auto m = reinterpret_cast(data); + m->kde_output_device_mode_v2_size(width, height); +} + +void DeviceModeV2::Private::handleRefreshCallback(void *data, kde_output_device_mode_v2 *object, int32_t refresh) +{ + Q_UNUSED(object); + auto m = reinterpret_cast(data); + m->kde_output_device_mode_v2_refresh(refresh); +} + +void DeviceModeV2::Private::handlePreferredCallback(void *data, kde_output_device_mode_v2 *object) +{ + Q_UNUSED(object); + auto m = reinterpret_cast(data); + m->kde_output_device_mode_v2_preferred(); +} + +void DeviceModeV2::Private::handleRemovedCallback(void *data, kde_output_device_mode_v2 *object) +{ + Q_UNUSED(object); + auto m = reinterpret_cast(data); + m->kde_output_device_mode_v2_removed(); +} + +void DeviceModeV2::Private::kde_output_device_mode_v2_size(int32_t width, int32_t height) +{ + size = QSize(width, height); +} + +void DeviceModeV2::Private::kde_output_device_mode_v2_refresh(int32_t refresh) +{ + refreshRate = refresh; +} + +void DeviceModeV2::Private::kde_output_device_mode_v2_preferred() +{ + preferred = true; +} + +void DeviceModeV2::Private::kde_output_device_mode_v2_removed() +{ + Q_EMIT q->removed(); +} + +DeviceModeV2 *DeviceModeV2::Private::get(kde_output_device_mode_v2 *object) +{ + return reinterpret_cast(kde_output_device_mode_v2_get_user_data(object))->q; +} + +DeviceModeV2::DeviceModeV2(QObject *parent, kde_output_device_mode_v2 *m) + : QObject(parent) + , d(new Private(this, m)) +{ +} + +DeviceModeV2::~DeviceModeV2() +{ + d->mode.release(); +} + +int DeviceModeV2::refreshRate() const +{ + return d->refreshRate; +} + +QSize DeviceModeV2::size() const +{ + return d->size; +} + +bool DeviceModeV2::preferred() const +{ + return d->preferred; +} + +bool DeviceModeV2::operator==(const DeviceModeV2 &other) +{ + return d->size == other.d->size && d->refreshRate == other.d->refreshRate && d->preferred == other.d->preferred; +} + +DeviceModeV2::operator kde_output_device_mode_v2 *() +{ + return d->mode; +} + +DeviceModeV2::operator kde_output_device_mode_v2 *() const +{ + return d->mode; +} + +DeviceModeV2 *DeviceModeV2::get(kde_output_device_mode_v2 *object) +{ + return Private::get(object); +} + +} +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/client/outputdevicemode_v2.h dwayland-5.57.0.24+really5.24.3/src/client/outputdevicemode_v2.h --- dwayland-5.57.0.23/src/client/outputdevicemode_v2.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevicemode_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,49 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef WAYLAND_OUTPUTDEVICEMODE_V2_H +#define WAYLAND_OUTPUTDEVICEMODE_V2_H + +#include +#include + +#include + +struct kde_output_device_mode_v2; + +namespace KWayland +{ +namespace Client +{ +class KWAYLANDCLIENT_EXPORT DeviceModeV2 : public QObject +{ + Q_OBJECT +public: + DeviceModeV2(QObject *parent, kde_output_device_mode_v2 *m); + + ~DeviceModeV2(); + + int refreshRate() const; + QSize size() const; + bool preferred() const; + + bool operator==(const DeviceModeV2 &other); + + operator kde_output_device_mode_v2 *(); + operator kde_output_device_mode_v2 *() const; + + static DeviceModeV2 *get(kde_output_device_mode_v2 *object); + + class Private; + QScopedPointer d; + +Q_SIGNALS: + void removed(); +}; + +} +} + +#endif // WAYLAND_OUTPUTDEVICEMODE_V2_H diff -Nru dwayland-5.57.0.23/src/client/outputdevice_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputdevice_v2.cpp --- dwayland-5.57.0.23/src/client/outputdevice_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevice_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,588 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "outputdevice_v2.h" +#include "logging.h" +#include "wayland_pointer_p.h" +// Qt +#include +#include +#include +// wayland +#include +#include + +namespace KWayland +{ +namespace Client +{ +class Q_DECL_HIDDEN OutputDeviceV2::Private : public QObject +{ + Q_OBJECT +public: + Private(OutputDeviceV2 *q); + void setup(kde_output_device_v2 *o); + + WaylandPointer output; + EventQueue *queue = nullptr; + QSize physicalSize; + QPoint globalPosition; + QString manufacturer; + QString model; + qreal scale = 1.0; + QString serialNumber; + QString eisaId; + SubPixel subPixel = SubPixel::Unknown; + Transform transform = Transform::Normal; + + QByteArray edid; + OutputDeviceV2::Enablement enabled = OutputDeviceV2::Enablement::Enabled; + QByteArray uuid; + + Capabilities capabilities; + uint32_t overscan = 0; + VrrPolicy vrrPolicy = VrrPolicy::Automatic; + + uint32_t rgbRange; + QString outputName; + + bool done = false; + + DeviceModeV2 *m_mode; + QList m_modes; + +private: + static void geometryCallback(void *data, + kde_output_device_v2 *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform); + static void currentModeCallback(void *data, kde_output_device_v2 *output, kde_output_device_mode_v2 *mode); + static void modeCallback(void *data, kde_output_device_v2 *output, kde_output_device_mode_v2 *mode); + static void doneCallback(void *data, kde_output_device_v2 *output); + static void scaleCallback(void *data, kde_output_device_v2 *output, wl_fixed_t scale); + + static void edidCallback(void *data, kde_output_device_v2 *output, const char *raw); + static void enabledCallback(void *data, kde_output_device_v2 *output, int32_t enabled); + static void uuidCallback(void *data, kde_output_device_v2 *output, const char *uuid); + + static void serialNumberCallback(void *data, kde_output_device_v2 *output, const char *serialNumber); + static void eisaIdCallback(void *data, kde_output_device_v2 *output, const char *eisa); + + static void capabilitiesCallback(void *data, kde_output_device_v2 *output, uint32_t capabilities); + static void overscanCallback(void *data, kde_output_device_v2 *output, uint32_t overscan); + static void vrrPolicyCallback(void *data, kde_output_device_v2 *output, uint32_t vrrPolicy); + + static void colorRgbRangeCallback(void *data, kde_output_device_v2 *output, uint32_t rgb_range); + static void nameCallback(void *data, kde_output_device_v2 *output, const char *name); + + void setPhysicalSize(const QSize &size); + void setGlobalPosition(const QPoint &pos); + void setManufacturer(const QString &manufacturer); + void setModel(const QString &model); + void setScale(qreal scale); + void setSerialNumber(const QString &serialNumber); + void setEisaId(const QString &eisaId); + void setSubPixel(SubPixel subPixel); + void setTransform(Transform transform); + void handleCurrentMode(kde_output_device_mode_v2 *mode); + void addMode(kde_output_device_mode_v2 *mode); + + OutputDeviceV2 *q; + static struct kde_output_device_v2_listener s_outputListener; +}; + +OutputDeviceV2::Private::Private(OutputDeviceV2 *q) + : QObject(q), q(q) +{ +} + +void OutputDeviceV2::Private::setup(kde_output_device_v2 *o) +{ + Q_ASSERT(o); + Q_ASSERT(!output); + output.setup(o); + kde_output_device_v2_add_listener(output, &s_outputListener, this); +} + +OutputDeviceV2::OutputDeviceV2(QObject *parent) + : QObject(parent) + , d(new Private(this)) +{ +} + +OutputDeviceV2::~OutputDeviceV2() +{ + d->output.release(); +} + +kde_output_device_v2_listener OutputDeviceV2::Private::s_outputListener = { + geometryCallback, + currentModeCallback, + modeCallback, + doneCallback, + scaleCallback, + edidCallback, + enabledCallback, + uuidCallback, + serialNumberCallback, + eisaIdCallback, + capabilitiesCallback, + overscanCallback, + vrrPolicyCallback, + colorRgbRangeCallback, + nameCallback +}; + +void OutputDeviceV2::Private::geometryCallback(void *data, + kde_output_device_v2 *output, + int32_t x, + int32_t y, + int32_t physicalWidth, + int32_t physicalHeight, + int32_t subPixel, + const char *make, + const char *model, + int32_t transform) +{ + Q_UNUSED(transform) + auto o = reinterpret_cast(data); + Q_ASSERT(o->output == output); + o->setGlobalPosition(QPoint(x, y)); + o->setManufacturer(make); + o->setModel(model); + o->setPhysicalSize(QSize(physicalWidth, physicalHeight)); + auto toSubPixel = [subPixel]() { + switch (subPixel) { + case WL_OUTPUT_SUBPIXEL_NONE: + return SubPixel::None; + case WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB: + return SubPixel::HorizontalRGB; + case WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR: + return SubPixel::HorizontalBGR; + case WL_OUTPUT_SUBPIXEL_VERTICAL_RGB: + return SubPixel::VerticalRGB; + case WL_OUTPUT_SUBPIXEL_VERTICAL_BGR: + return SubPixel::VerticalBGR; + case WL_OUTPUT_SUBPIXEL_UNKNOWN: + default: + return SubPixel::Unknown; + } + }; + o->setSubPixel(toSubPixel()); + auto toTransform = [transform]() { + switch (transform) { + case WL_OUTPUT_TRANSFORM_90: + return Transform::Rotated90; + case WL_OUTPUT_TRANSFORM_180: + return Transform::Rotated180; + case WL_OUTPUT_TRANSFORM_270: + return Transform::Rotated270; + case WL_OUTPUT_TRANSFORM_FLIPPED: + return Transform::Flipped; + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + return Transform::Flipped90; + case WL_OUTPUT_TRANSFORM_FLIPPED_180: + return Transform::Flipped180; + case WL_OUTPUT_TRANSFORM_FLIPPED_270: + return Transform::Flipped270; + case WL_OUTPUT_TRANSFORM_NORMAL: + default: + return Transform::Normal; + } + }; + o->setTransform(toTransform()); +} + +void OutputDeviceV2::Private::currentModeCallback(void *data, kde_output_device_v2 *output, kde_output_device_mode_v2 *mode) +{ + auto o = reinterpret_cast(data); + Q_ASSERT(o->output == output); + o->handleCurrentMode(mode); +} + +void OutputDeviceV2::Private::handleCurrentMode(kde_output_device_mode_v2 *mode) +{ + auto m = DeviceModeV2::get(mode); + + if (*m == *m_mode) { + // unchanged + return; + } + m_mode = m; + + Q_EMIT q->currentModeChanged(m); +} + +void OutputDeviceV2::Private::modeCallback(void *data, kde_output_device_v2 *output, kde_output_device_mode_v2 *mode) +{ + auto o = reinterpret_cast(data); + Q_ASSERT(o->output == output); + o->addMode(mode); +} + +void OutputDeviceV2::Private::addMode(kde_output_device_mode_v2 *mode) +{ + DeviceModeV2 *m = new DeviceModeV2(this, mode); + // last mode sent is the current one + m_mode = m; + m_modes.append(m); + + connect(m, &DeviceModeV2::removed, this, [this, m]() { + m_modes.removeOne(m); + if (m_mode == m) { + if (!m_modes.isEmpty()) { + m_mode = m_modes.first(); + } else { + // was last mode + qFatal("KWaylandBackend: no output modes available anymore, this seems like a compositor bug"); + } + } + + delete m; + }); + Q_EMIT q->modeAdded(m); +} + +DeviceModeV2* OutputDeviceV2::currentMode() const +{ + return d->m_mode; +} + +void OutputDeviceV2::Private::scaleCallback(void *data, kde_output_device_v2 *output, int32_t scale) +{ + auto o = reinterpret_cast(data); + Q_ASSERT(o->output == output); + o->setScale(scale); +} + +void OutputDeviceV2::Private::doneCallback(void *data, kde_output_device_v2 *output) +{ + auto o = reinterpret_cast(data); + Q_ASSERT(o->output == output); + o->done = true; + Q_EMIT o->q->changed(); + Q_EMIT o->q->done(); +} + +void OutputDeviceV2::Private::edidCallback(void *data, kde_output_device_v2 *output, const char *raw) +{ + Q_UNUSED(output); + auto o = reinterpret_cast(data); + o->edid = QByteArray::fromBase64(raw); +} + +void OutputDeviceV2::Private::enabledCallback(void *data, kde_output_device_v2 *output, int32_t enabled) +{ + Q_UNUSED(output); + auto o = reinterpret_cast(data); + + OutputDeviceV2::Enablement _enabled = OutputDeviceV2::Enablement::Disabled; + if (enabled) { + _enabled = OutputDeviceV2::Enablement::Enabled; + } + if (o->enabled != _enabled) { + o->enabled = _enabled; + Q_EMIT o->q->enabledChanged(o->enabled); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDeviceV2::Private::uuidCallback(void *data, kde_output_device_v2 *output, const char *uuid) +{ + Q_UNUSED(output); + auto o = reinterpret_cast(data); + if (o->uuid != uuid) { + o->uuid = uuid; + Q_EMIT o->q->uuidChanged(o->uuid); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDeviceV2::Private::serialNumberCallback(void *data, kde_output_device_v2 *output, const char *raw) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + o->setSerialNumber(raw); +} + +void OutputDeviceV2::Private::eisaIdCallback(void *data, kde_output_device_v2 *output, const char *raw) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + o->setEisaId(raw); +} + +void OutputDeviceV2::Private::capabilitiesCallback(void *data, kde_output_device_v2 *output, uint32_t capabilities) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + auto caps = static_cast(capabilities); + if (o->capabilities != caps) { + o->capabilities = caps; + Q_EMIT o->q->capabilitiesChanged(caps); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDeviceV2::Private::overscanCallback(void *data, kde_output_device_v2 *output, uint32_t overscan) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + if (o->overscan != overscan) { + o->overscan = overscan; + Q_EMIT o->q->overscanChanged(overscan); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDeviceV2::Private::vrrPolicyCallback(void *data, kde_output_device_v2 *output, uint32_t vrr_policy) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + auto vrrPolicy = static_cast(vrr_policy); + if (o->vrrPolicy != vrrPolicy) { + o->vrrPolicy = vrrPolicy; + Q_EMIT o->q->vrrPolicyChanged(vrrPolicy); + if (o->done) { + Q_EMIT o->q->changed(); + } + } +} + +void OutputDeviceV2::Private::colorRgbRangeCallback(void *data, kde_output_device_v2 *output, uint32_t rgb_range) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + o->rgbRange = rgb_range; +} + +void OutputDeviceV2::Private::nameCallback(void *data, kde_output_device_v2 *output, const char *name) +{ + auto o = reinterpret_cast(data); + Q_UNUSED(output); + o->outputName = name; +} + +void OutputDeviceV2::setup(kde_output_device_v2 *output) +{ + d->setup(output); +} + +EventQueue *OutputDeviceV2::eventQueue() const +{ + return d->queue; +} + +void OutputDeviceV2::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +void OutputDeviceV2::Private::setGlobalPosition(const QPoint &pos) +{ + globalPosition = pos; +} + +void OutputDeviceV2::Private::setManufacturer(const QString &m) +{ + manufacturer = m; +} + +void OutputDeviceV2::Private::setModel(const QString &m) +{ + model = m; +} + +void OutputDeviceV2::Private::setSerialNumber(const QString &sn) +{ + serialNumber = sn; +} + +void OutputDeviceV2::Private::setEisaId(const QString &e) +{ + eisaId = e; +} + +void OutputDeviceV2::Private::setPhysicalSize(const QSize &size) +{ + physicalSize = size; +} + +void OutputDeviceV2::Private::setScale(qreal s) +{ + scale = s; +} + +QRect OutputDeviceV2::geometry() const +{ + if (!currentMode()) { + return QRect(); + } + return QRect(d->globalPosition, currentMode()->size()); +} + +void OutputDeviceV2::Private::setSubPixel(OutputDeviceV2::SubPixel s) +{ + subPixel = s; +} + +void OutputDeviceV2::Private::setTransform(OutputDeviceV2::Transform t) +{ + transform = t; +} + +QPoint OutputDeviceV2::globalPosition() const +{ + return d->globalPosition; +} + +QString OutputDeviceV2::manufacturer() const +{ + return d->manufacturer; +} + +QString OutputDeviceV2::model() const +{ + return d->model; +} + +QString OutputDeviceV2::serialNumber() const +{ + return d->serialNumber; +} + +QString OutputDeviceV2::eisaId() const +{ + return d->eisaId; +} + +kde_output_device_v2 *OutputDeviceV2::output() +{ + return d->output; +} + +QSize OutputDeviceV2::physicalSize() const +{ + return d->physicalSize; +} + +QSize OutputDeviceV2::pixelSize() const +{ + return currentMode()->size(); +} + +int OutputDeviceV2::refreshRate() const +{ + return currentMode()->refreshRate(); +} + +int OutputDeviceV2::scale() const +{ + return qRound(d->scale); +} + +qreal OutputDeviceV2::scaleF() const +{ + return d->scale; +} + +bool OutputDeviceV2::isValid() const +{ + return d->output.isValid(); +} + +OutputDeviceV2::SubPixel OutputDeviceV2::subPixel() const +{ + return d->subPixel; +} + +OutputDeviceV2::Transform OutputDeviceV2::transform() const +{ + return d->transform; +} + +QList OutputDeviceV2::modes() const +{ + return d->m_modes; +} + +OutputDeviceV2::operator kde_output_device_v2 *() +{ + return d->output; +} + +OutputDeviceV2::operator kde_output_device_v2 *() const +{ + return d->output; +} + +QByteArray OutputDeviceV2::edid() const +{ + return d->edid; +} + +OutputDeviceV2::Enablement OutputDeviceV2::enabled() const +{ + return d->enabled; +} + +QByteArray OutputDeviceV2::uuid() const +{ + return d->uuid; +} + +OutputDeviceV2::Capabilities OutputDeviceV2::capabilities() const +{ + return d->capabilities; +} + +uint32_t OutputDeviceV2::overscan() const +{ + return d->overscan; +} + +OutputDeviceV2::VrrPolicy OutputDeviceV2::vrrPolicy() const +{ + return d->vrrPolicy; +} + +uint32_t OutputDeviceV2::rgbRange() const +{ + return d->rgbRange; +} + +QString OutputDeviceV2::outputName() const +{ + return d->outputName; +} + +void OutputDeviceV2::destroy() +{ + d->output.destroy(); +} + +DeviceModeV2 *OutputDeviceV2::deviceModeFromId(const int modeId) const +{ + return d->m_modes.at(modeId); +} + +} +} + +#include "outputdevice_v2.moc" diff -Nru dwayland-5.57.0.23/src/client/outputdevice_v2.h dwayland-5.57.0.24+really5.24.3/src/client/outputdevice_v2.h --- dwayland-5.57.0.23/src/client/outputdevice_v2.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputdevice_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,336 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef WAYLAND_KDE_OUTPUT_DEVICE_V2_H +#define WAYLAND_KDE_OUTPUT_DEVICE_V2_H + +#include +#include +#include +#include + +#include + +#include "outputdevicemode_v2.h" + +struct kde_output_device_v2; +class QPoint; +class QRect; + +namespace KWayland +{ +namespace Client +{ +class EventQueue; + +/** + * @short Wrapper for the kde_output_device_v2 interface. + * + * This class provides a convenient wrapper for the kde_output_device_v2 interface. + * Its main purpose is to hold the information about one OutputDeviceV2. + * + * To use this class one needs to interact with the Registry. There are two + * possible ways to create an OutputDeviceV2 interface: + * @code + * OutputDeviceV2 *c = registry->createOutputDevice(name, version); + * @endcode + * + * This creates the OutputDeviceV2 and sets it up directly. As an alternative this + * can also be done in a more low level way: + * @code + * OutputDeviceV2 *c = new OutputDeviceV2; + * c->setup(registry->bindOutputDevice(name, version)); + * @endcode + * + * The OutputDeviceV2 can be used as a drop-in replacement for any kde_output_device_v2 + * pointer as it provides matching cast operators. + * + * Please note that all properties of OutputDeviceV2 are not valid until the + * changed signal has been emitted. The wayland server is pushing the + * information in an async way to the OutputDeviceV2 instance. By emitting changed + * the OutputDeviceV2 indicates that all relevant information is available. + * + * @see Registry + * @since 5.5 + **/ +class KWAYLANDCLIENT_EXPORT OutputDeviceV2 : public QObject +{ + Q_OBJECT +public: + enum class SubPixel { + Unknown, + None, + HorizontalRGB, + HorizontalBGR, + VerticalRGB, + VerticalBGR, + }; + Q_ENUM(SubPixel) + enum class Transform { + Normal, + Rotated90, + Rotated180, + Rotated270, + Flipped, + Flipped90, + Flipped180, + Flipped270, + }; + Q_ENUM(Transform) + enum class Enablement { + Disabled = 0, + Enabled = 1, + }; + Q_ENUM(Enablement) + enum class Capability { + Overscan = 0x1, + Vrr = 0x2, + }; + Q_DECLARE_FLAGS(Capabilities, Capability) + enum class VrrPolicy { + Never = 0, + Always = 1, + Automatic = 2 + }; + + explicit OutputDeviceV2(QObject *parent = nullptr); + ~OutputDeviceV2() override; + + /** + * Setup this Compositor to manage the @p output. + * When using Registry::createOutputDevice there is no need to call this + * method. + **/ + void setup(kde_output_device_v2 *output); + + /** + * @returns @c true if managing a kde_output_device_v2. + **/ + bool isValid() const; + operator kde_output_device_v2 *(); + operator kde_output_device_v2 *() const; + kde_output_device_v2 *output(); + /** + * Size in millimeters. + **/ + QSize physicalSize() const; + /** + * Position within the global compositor space. + **/ + QPoint globalPosition() const; + /** + * Textual description of the manufacturer. + **/ + QString manufacturer() const; + /** + * Textual description of the model. + **/ + QString model() const; + /** + * Textual representation of serial number. + */ + QString serialNumber() const; + /** + * Textual representation of EISA identifier. + */ + QString eisaId() const; + /** + * Size in the current mode. + **/ + QSize pixelSize() const; + /** + * The geometry of this OutputDeviceV2 in pixels. + * Convenient for QRect(globalPosition(), pixelSize()). + * @see globalPosition + * @see pixelSize + **/ + QRect geometry() const; + /** + * Refresh rate in mHz of the current mode. + **/ + int refreshRate() const; + +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) + /** + * Scaling factor of this output. + * + * A scale larger than 1 means that the compositor will automatically scale surface buffers + * by this amount when rendering. This is used for very high resolution displays where + * applications rendering at the native resolution would be too small to be legible. + * @deprecated Since 5.50, use scaleF() + **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputDeviceV2::scaleF()") + int scale() const; +#endif + + /** + * Scaling factor of this output. + * + * A scale larger than 1 means that the compositor will automatically scale surface buffers + * by this amount when rendering. This is used for very high resolution displays where + * applications rendering at the native resolution would be too small to be legible. + * @since 5.50 + **/ + qreal scaleF() const; + /** + * Subpixel orientation of this OutputDeviceV2. + **/ + SubPixel subPixel() const; + /** + * Transform that maps framebuffer to OutputDeviceV2. + * + * The purpose is mainly to allow clients render accordingly and tell the compositor, + * so that for fullscreen surfaces, the compositor will still be able to scan out + * directly from client surfaces. + **/ + Transform transform() const; + + /** + * @returns The Modes of this OutputDeviceV2. + **/ + QList modes() const; + + DeviceModeV2* currentMode() const; + + /** + * Sets the @p queue to use for bound proxies. + **/ + void setEventQueue(EventQueue *queue); + /** + * @returns The event queue to use for bound proxies. + **/ + EventQueue *eventQueue() const; + + /** + * @returns The EDID information for this output. + **/ + QByteArray edid() const; + + /** + * @returns Whether this output is enabled or not. + **/ + OutputDeviceV2::Enablement enabled() const; + + /** + * @returns A unique identifier for this outputdevice, determined by the server. + **/ + QByteArray uuid() const; + + /** + * @returns the capabilities of this outputdevice + * @since 5.82 + **/ + Capabilities capabilities() const; + + /** + * @returns what overscan value this outputdevice is using + * @since 5.82 + **/ + uint32_t overscan() const; + + /** + * @returns the compositors policy regarding vrr on this output + * @since 5.82 + */ + VrrPolicy vrrPolicy() const; + + uint32_t rgbRange() const; + + QString outputName() const; + + /** + * Destroys the data hold by this OutputDeviceV2. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. + * + * This method is automatically invoked when the Registry which created this + * Output gets destroyed. + **/ + void destroy(); + + DeviceModeV2 *deviceModeFromId(const int modeId) const; + +Q_SIGNALS: + /** + * Emitted when the output is fully initialized. + **/ + void done(); + /** + * Emitted whenever at least one of the data changed. + **/ + void changed(); + /** + * Emitted whenever the enabled property changes. + **/ + void enabledChanged(OutputDeviceV2::Enablement enabled); + /** + * Emitted whenever the id property changes. + **/ + void uuidChanged(const QByteArray &uuid); + /** + * Emitted whenever a new Mode is added. + * This normally only happens during the initial promoting of modes. + * Afterwards only modeChanged should be emitted. + * @param mode The newly added Mode. + * @see modeChanged + **/ + void modeAdded(const KWayland::Client::DeviceModeV2 *mode); + /** + * Emitted whenever a Mode changes. + * This normally means that the @c Mode::Flag::Current is added or removed. + * @param mode The changed Mode + **/ + void modeChanged(const KWayland::Client::DeviceModeV2 *mode); + + void currentModeChanged(const KWayland::Client::DeviceModeV2 *mode); + /** + * Emitted whenever the color curves changed. + * + * @since 5.TODO + **/ + void colorCurvesChanged(); + /** + * Emitted whenever the capabilities change + * @param capabilities the new capabilities + * @since 5.82 + **/ + void capabilitiesChanged(const Capabilities &capabilities); + /** + * Emitted whenever the overscan changes + * @param overscan the new overscan value + * @since 5.82 + **/ + void overscanChanged(uint32_t overscan); + /** + * Emitted whenever the variable refresh rate policy for this output changes + * + * @since 5.82 + **/ + void vrrPolicyChanged(VrrPolicy vrrPolicy); + /** + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the OutputDeviceV2 got created by + * Registry::createOutputDevice + * + * @since 5.5 + **/ + void removed(); + +private: + class Private; + QScopedPointer d; +}; + +} +} + +Q_DECLARE_METATYPE(KWayland::Client::OutputDeviceV2::SubPixel) +Q_DECLARE_METATYPE(KWayland::Client::OutputDeviceV2::Transform) +Q_DECLARE_METATYPE(KWayland::Client::OutputDeviceV2::Enablement) + +#endif diff -Nru dwayland-5.57.0.23/src/client/output.h dwayland-5.57.0.24+really5.24.3/src/client/output.h --- dwayland-5.57.0.23/src/client/output.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/output.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_OUTPUT_H #define WAYLAND_OUTPUT_H @@ -24,7 +10,7 @@ #include #include -#include +#include struct wl_output; class QPoint; @@ -34,7 +20,6 @@ { namespace Client { - class EventQueue; /** @@ -76,7 +61,7 @@ HorizontalRGB, HorizontalBGR, VerticalRGB, - VerticalBGR + VerticalBGR, }; enum class Transform { Normal, @@ -86,13 +71,13 @@ Flipped, Flipped90, Flipped180, - Flipped270 + Flipped270, }; struct Mode { enum class Flag { None = 0, Current = 1 << 0, - Preferred = 1 << 1 + Preferred = 1 << 1, }; Q_DECLARE_FLAGS(Flags, Flag) /** @@ -116,7 +101,7 @@ bool operator==(const Mode &m) const; }; explicit Output(QObject *parent = nullptr); - virtual ~Output(); + ~Output() override; /** * Setup this Compositor to manage the @p output. @@ -129,8 +114,8 @@ * @returns @c true if managing a wl_output. **/ bool isValid() const; - operator wl_output*(); - operator wl_output*() const; + operator wl_output *(); + operator wl_output *() const; wl_output *output(); /** * Size in millimeters. @@ -205,16 +190,16 @@ static Output *get(wl_output *native); /** - * Destroys the data hold by this Output. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid any more, it's not - * possible to call release any more as that calls into the Wayland - * connection and the call would fail. - * - * This method is automatically invoked when the Registry which created this - * Output gets destroyed. - * - **/ + * Destroys the data hold by this Output. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. + * + * This method is automatically invoked when the Registry which created this + * Output gets destroyed. + * + **/ void destroy(); Q_SIGNALS: @@ -252,13 +237,14 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(Output::Mode::Flags) + } } -Q_DECLARE_METATYPE(KWayland::Client::Output*) +Q_DECLARE_METATYPE(KWayland::Client::Output *) Q_DECLARE_METATYPE(KWayland::Client::Output::SubPixel) Q_DECLARE_METATYPE(KWayland::Client::Output::Transform) Q_DECLARE_METATYPE(KWayland::Client::Output::Mode) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::Output::Mode::Flags) #endif diff -Nru dwayland-5.57.0.23/src/client/outputmanagement.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement.cpp --- dwayland-5.57.0.23/src/client/outputmanagement.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,34 +1,18 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "outputmanagement.h" -#include "outputconfiguration.h" #include "event_queue.h" -#include "wayland_pointer_p.h" +#include "outputconfiguration.h" #include "wayland-output-management-client-protocol.h" - +#include "wayland_pointer_p.h" namespace KWayland { namespace Client { - class Q_DECL_HIDDEN OutputManagement::Private { public: @@ -39,8 +23,8 @@ }; OutputManagement::OutputManagement(QObject *parent) -: QObject(parent) -, d(new Private) + : QObject(parent) + , d(new Private) { } @@ -76,11 +60,13 @@ return d->queue; } -OutputManagement::operator org_kde_kwin_outputmanagement*() { +OutputManagement::operator org_kde_kwin_outputmanagement *() +{ return d->outputmanagement; } -OutputManagement::operator org_kde_kwin_outputmanagement*() const { +OutputManagement::operator org_kde_kwin_outputmanagement *() const +{ return d->outputmanagement; } @@ -103,6 +89,5 @@ return config; } - } } diff -Nru dwayland-5.57.0.23/src/client/outputmanagement.h dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement.h --- dwayland-5.57.0.23/src/client/outputmanagement.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -* Copyright 2015 Sebastian Kügler -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) version 3, or any -* later version accepted by the membership of KDE e.V. (or its -* successor approved by the membership of KDE e.V.), which shall -* act as a proxy defined in Section 6 of version 3 of the license. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see . -****************************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_OUTPUTMANAGEMENT_H #define KWAYLAND_CLIENT_OUTPUTMANAGEMENT_H #include -#include +#include struct org_kde_kwin_outputmanagement; struct org_kde_kwin_outputconfiguration; @@ -31,101 +17,99 @@ { namespace Client { - class EventQueue; -class OutputDevice; class OutputConfiguration; /** -* @short Wrapper for the org_kde_kwin_outputmanagement interface. -* -* This class provides a convenient wrapper for the org_kde_kwin_outputmanagement interface. -* -* To use this class one needs to interact with the Registry. There are two -* possible ways to create the OutputManagement interface: -* @code -* OutputManagement *c = registry->createOutputManagement(name, version); -* @endcode -* -* This creates the OutputManagement and sets it up directly. As an alternative this -* can also be done in a more low level way: -* @code -* OutputManagement *c = new OutputManagement; -* c->setup(registry->bindOutputManagement(name, version)); -* @endcode -* -* The OutputManagement can be used as a drop-in replacement for any org_kde_kwin_outputmanagement -* pointer as it provides matching cast operators. -* -* @see Registry -* @since 5.5 -**/ + * @short Wrapper for the org_kde_kwin_outputmanagement interface. + * + * This class provides a convenient wrapper for the org_kde_kwin_outputmanagement interface. + * + * To use this class one needs to interact with the Registry. There are two + * possible ways to create the OutputManagement interface: + * @code + * OutputManagement *c = registry->createOutputManagement(name, version); + * @endcode + * + * This creates the OutputManagement and sets it up directly. As an alternative this + * can also be done in a more low level way: + * @code + * OutputManagement *c = new OutputManagement; + * c->setup(registry->bindOutputManagement(name, version)); + * @endcode + * + * The OutputManagement can be used as a drop-in replacement for any org_kde_kwin_outputmanagement + * pointer as it provides matching cast operators. + * + * @see Registry + * @since 5.5 + **/ class KWAYLANDCLIENT_EXPORT OutputManagement : public QObject { Q_OBJECT public: /** - * Creates a new OutputManagement. - * Note: after constructing the OutputManagement it is not yet valid and one needs - * to call setup. In order to get a ready to use OutputManagement prefer using - * Registry::createOutputManagement. - **/ + * Creates a new OutputManagement. + * Note: after constructing the OutputManagement it is not yet valid and one needs + * to call setup. In order to get a ready to use OutputManagement prefer using + * Registry::createOutputManagement. + **/ explicit OutputManagement(QObject *parent = nullptr); - virtual ~OutputManagement(); + ~OutputManagement() override; /** - * Setup this OutputManagement to manage the @p outputmanagement. - * When using Registry::createOutputManagement there is no need to call this - * method. - **/ + * Setup this OutputManagement to manage the @p outputmanagement. + * When using Registry::createOutputManagement there is no need to call this + * method. + **/ void setup(org_kde_kwin_outputmanagement *outputmanagement); /** - * @returns @c true if managing a org_kde_kwin_outputmanagement. - **/ + * @returns @c true if managing a org_kde_kwin_outputmanagement. + **/ bool isValid() const; /** - * Releases the org_kde_kwin_outputmanagement interface. - * After the interface has been released the OutputManagement instance is no - * longer valid and can be setup with another org_kde_kwin_outputmanagement interface. - **/ + * Releases the org_kde_kwin_outputmanagement interface. + * After the interface has been released the OutputManagement instance is no + * longer valid and can be setup with another org_kde_kwin_outputmanagement interface. + **/ void release(); /** - * Destroys the data hold by this OutputManagement. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid any more, it's not - * possible to call release any more as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or setup to a new org_kde_kwin_outputmanagement interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * OutputManagement gets destroyed. - * - * @see release - **/ + * Destroys the data hold by this OutputManagement. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or setup to a new org_kde_kwin_outputmanagement interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * OutputManagement gets destroyed. + * + * @see release + **/ void destroy(); /** - * Sets the @p queue to use for creating objects with this OutputManagement. - **/ + * Sets the @p queue to use for creating objects with this OutputManagement. + **/ void setEventQueue(EventQueue *queue); /** - * @returns The event queue to use for creating objects with this OutputManagement. - **/ + * @returns The event queue to use for creating objects with this OutputManagement. + **/ EventQueue *eventQueue(); OutputConfiguration *createConfiguration(QObject *parent = nullptr); - operator org_kde_kwin_outputmanagement*(); - operator org_kde_kwin_outputmanagement*() const; + operator org_kde_kwin_outputmanagement *(); + operator org_kde_kwin_outputmanagement *() const; Q_SIGNALS: /** - * The corresponding global for this interface on the Registry got removed. - * - * This signal gets only emitted if the OutputManagement got created by - * Registry::createOutputManagement - **/ + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the OutputManagement got created by + * Registry::createOutputManagement + **/ void removed(); private: @@ -133,7 +117,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/outputmanagement_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement_v2.cpp --- dwayland-5.57.0.23/src/client/outputmanagement_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,93 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "outputmanagement_v2.h" +#include "event_queue.h" +#include "outputconfiguration_v2.h" +#include "wayland-kde-output-management-v2-client-protocol.h" +#include "wayland_pointer_p.h" + +namespace KWayland +{ +namespace Client +{ +class Q_DECL_HIDDEN OutputManagementV2::Private +{ +public: + Private() = default; + + WaylandPointer outputmanagement; + EventQueue *queue = nullptr; +}; + +OutputManagementV2::OutputManagementV2(QObject *parent) + : QObject(parent) + , d(new Private) +{ +} + +OutputManagementV2::~OutputManagementV2() +{ + d->outputmanagement.release(); +} + +void OutputManagementV2::setup(kde_output_management_v2 *outputmanagement) +{ + Q_ASSERT(outputmanagement); + Q_ASSERT(!d->outputmanagement); + d->outputmanagement.setup(outputmanagement); +} + +void OutputManagementV2::release() +{ + d->outputmanagement.release(); +} + +void OutputManagementV2::destroy() +{ + d->outputmanagement.destroy(); +} + +void OutputManagementV2::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +EventQueue *OutputManagementV2::eventQueue() +{ + return d->queue; +} + +OutputManagementV2::operator kde_output_management_v2 *() +{ + return d->outputmanagement; +} + +OutputManagementV2::operator kde_output_management_v2 *() const +{ + return d->outputmanagement; +} + +bool OutputManagementV2::isValid() const +{ + return d->outputmanagement.isValid(); +} + +OutputConfigurationV2 *OutputManagementV2::createConfiguration(QObject *parent) +{ + Q_UNUSED(parent); + OutputConfigurationV2 *config = new OutputConfigurationV2(this); + auto w = kde_output_management_v2_create_configuration(d->outputmanagement); + + if (d->queue) { + d->queue->addProxy(w); + } + + config->setup(w); + return config; +} + +} +} diff -Nru dwayland-5.57.0.23/src/client/outputmanagement_v2.h dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement_v2.h --- dwayland-5.57.0.23/src/client/outputmanagement_v2.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/outputmanagement_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,123 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef KWAYLAND_CLIENT_OUTPUTMANAGEMENT_V2_H +#define KWAYLAND_CLIENT_OUTPUTMANAGEMENT_V2_H + +#include + +#include + +struct kde_output_management_v2; +struct kde_output_configuration_v2; + +namespace KWayland +{ +namespace Client +{ +class EventQueue; +class OutputConfigurationV2; + +/** + * @short Wrapper for the kde_output_management_v2 interface. + * + * This class provides a convenient wrapper for the kde_output_management_v2 interface. + * + * To use this class one needs to interact with the Registry. There are two + * possible ways to create the OutputManagementV2 interface: + * @code + * OutputManagementV2 *c = registry->createOutputManagement(name, version); + * @endcode + * + * This creates the OutputManagementV2 and sets it up directly. As an alternative this + * can also be done in a more low level way: + * @code + * OutputManagementV2 *c = new OutputManagementV2; + * c->setup(registry->bindOutputManagement(name, version)); + * @endcode + * + * The OutputManagementV2 can be used as a drop-in replacement for any kde_output_management_v2 + * pointer as it provides matching cast operators. + * + * @see Registry + * @since 5.5 + **/ +class KWAYLANDCLIENT_EXPORT OutputManagementV2 : public QObject +{ + Q_OBJECT +public: + /** + * Creates a new OutputManagementV2. + * Note: after constructing the OutputManagementV2 it is not yet valid and one needs + * to call setup. In order to get a ready to use OutputManagementV2 prefer using + * Registry::createOutputManagement. + **/ + explicit OutputManagementV2(QObject *parent = nullptr); + ~OutputManagementV2() override; + + /** + * Setup this OutputManagementV2 to manage the @p outputmanagement. + * When using Registry::createOutputManagement there is no need to call this + * method. + **/ + void setup(kde_output_management_v2 *outputmanagement); + /** + * @returns @c true if managing a kde_output_management_v2. + **/ + bool isValid() const; + /** + * Releases the kde_output_management_v2 interface. + * After the interface has been released the OutputManagementV2 instance is no + * longer valid and can be setup with another kde_output_management_v2 interface. + **/ + void release(); + /** + * Destroys the data hold by this OutputManagementV2. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or setup to a new kde_output_management_v2 interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * OutputManagementV2 gets destroyed. + * + * @see release + **/ + void destroy(); + + /** + * Sets the @p queue to use for creating objects with this OutputManagementV2. + **/ + void setEventQueue(EventQueue *queue); + /** + * @returns The event queue to use for creating objects with this OutputManagementV2. + **/ + EventQueue *eventQueue(); + + OutputConfigurationV2 *createConfiguration(QObject *parent = nullptr); + + operator kde_output_management_v2 *(); + operator kde_output_management_v2 *() const; + +Q_SIGNALS: + /** + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the OutputManagementV2 got created by + * Registry::createOutputManagement + **/ + void removed(); + +private: + class Private; + QScopedPointer d; +}; + +} +} + +#endif diff -Nru dwayland-5.57.0.23/src/client/plasmashell.cpp dwayland-5.57.0.24+really5.24.3/src/client/plasmashell.cpp --- dwayland-5.57.0.23/src/client/plasmashell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmashell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmashell.h" #include "event_queue.h" #include "output.h" @@ -29,7 +15,6 @@ { namespace Client { - class Q_DECL_HIDDEN PlasmaShell::Private { public: @@ -56,11 +41,11 @@ static void autoHidingPanelShownCallback(void *data, org_kde_plasma_surface *org_kde_plasma_surface); PlasmaShellSurface *q; - static QVector s_surfaces; + static QVector s_surfaces; static const org_kde_plasma_surface_listener s_listener; }; -QVector PlasmaShellSurface::Private::s_surfaces; +QVector PlasmaShellSurface::Private::s_surfaces; PlasmaShell::PlasmaShell(QObject *parent) : QObject(parent) @@ -78,7 +63,7 @@ if (!d->shell) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->shell.destroy(); } @@ -87,7 +72,7 @@ if (!d->shell) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->shell.release(); } @@ -139,19 +124,19 @@ return d->shell.isValid(); } -PlasmaShell::operator org_kde_plasma_shell*() +PlasmaShell::operator org_kde_plasma_shell *() { return d->shell; } -PlasmaShell::operator org_kde_plasma_shell*() const +PlasmaShell::operator org_kde_plasma_shell *() const { return d->shell; } PlasmaShellSurface::Private::Private(PlasmaShellSurface *q) - : role(PlasmaShellSurface::Role::Normal), - q(q) + : role(PlasmaShellSurface::Role::Normal) + , q(q) { s_surfaces << this; } @@ -182,23 +167,20 @@ org_kde_plasma_surface_add_listener(surface, &s_listener, this); } -const org_kde_plasma_surface_listener PlasmaShellSurface::Private::s_listener = { - autoHidingPanelHiddenCallback, - autoHidingPanelShownCallback -}; +const org_kde_plasma_surface_listener PlasmaShellSurface::Private::s_listener = {autoHidingPanelHiddenCallback, autoHidingPanelShownCallback}; void PlasmaShellSurface::Private::autoHidingPanelHiddenCallback(void *data, org_kde_plasma_surface *org_kde_plasma_surface) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->surface == org_kde_plasma_surface); - emit p->q->autoHidePanelHidden(); + Q_EMIT p->q->autoHidePanelHidden(); } void PlasmaShellSurface::Private::autoHidingPanelShownCallback(void *data, org_kde_plasma_surface *org_kde_plasma_surface) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->surface == org_kde_plasma_surface); - emit p->q->autoHidePanelShown(); + Q_EMIT p->q->autoHidePanelShown(); } PlasmaShellSurface::PlasmaShellSurface(QObject *parent) @@ -241,17 +223,17 @@ return d->surface.isValid(); } -PlasmaShellSurface::operator org_kde_plasma_surface*() +PlasmaShellSurface::operator org_kde_plasma_surface *() { return d->surface; } -PlasmaShellSurface::operator org_kde_plasma_surface*() const +PlasmaShellSurface::operator org_kde_plasma_surface *() const { return d->surface; } -void PlasmaShellSurface::setPosition(const QPoint& point) +void PlasmaShellSurface::setPosition(const QPoint &point) { Q_ASSERT(isValid()); org_kde_plasma_surface_set_position(d->surface, point.x(), point.y()); @@ -280,6 +262,14 @@ case Role::ToolTip: wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_TOOLTIP; break; + case Role::CriticalNotification: + if (wl_proxy_get_version(d->surface) < ORG_KDE_PLASMA_SURFACE_ROLE_CRITICALNOTIFICATION_SINCE_VERSION) { + // Fall back to generic notification type if not supported + wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_NOTIFICATION; + } else { + wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_CRITICALNOTIFICATION; + } + break; case Role::StandAlone: wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_STANDALONE; break; diff -Nru dwayland-5.57.0.23/src/client/plasmashell.h dwayland-5.57.0.24+really5.24.3/src/client/plasmashell.h --- dwayland-5.57.0.23/src/client/plasmashell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmashell.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_PLASMASHELL_H #define WAYLAND_PLASMASHELL_H #include #include -#include +#include struct wl_surface; struct org_kde_plasma_shell; @@ -67,7 +53,7 @@ Q_OBJECT public: explicit PlasmaShell(QObject *parent = nullptr); - virtual ~PlasmaShell(); + ~PlasmaShell() override; /** * @returns @c true if managing a org_kde_plasma_shell. @@ -139,8 +125,8 @@ **/ PlasmaShellSurface *createSurface(Surface *surface, QObject *parent = nullptr); - operator org_kde_plasma_shell*(); - operator org_kde_plasma_shell*() const; + operator org_kde_plasma_shell *(); + operator org_kde_plasma_shell *() const; Q_SIGNALS: /** @@ -189,7 +175,7 @@ Q_OBJECT public: explicit PlasmaShellSurface(QObject *parent); - virtual ~PlasmaShellSurface(); + ~PlasmaShellSurface() override; /** * Releases the org_kde_plasma_surface interface. @@ -233,8 +219,8 @@ * @returns @c true if managing a org_kde_plasma_surface. **/ bool isValid() const; - operator org_kde_plasma_surface*(); - operator org_kde_plasma_surface*() const; + operator org_kde_plasma_surface *(); + operator org_kde_plasma_surface *() const; /** * Describes possible roles this PlasmaShellSurface can have. @@ -247,6 +233,7 @@ OnScreenDisplay, ///< The Surface represents an on screen display, like a volume changed notification Notification, ///< The Surface represents a notification @since 5.24 ToolTip, ///< The Surface represents a tooltip @since 5.24 + CriticalNotification, ///< The Surface represents a critical notification, like battery is running out @since 5.58 StandAlone, ///< The Surface represents a special surface which the same as normal surface but can not be move/resize by window manager Override, ///< The Surface represents a special surface which unmanaged by wm ActiveFullScreen, // The surfce used for wallpaper @@ -274,7 +261,7 @@ AlwaysVisible, AutoHide, WindowsCanCover, - WindowsGoBelow + WindowsGoBelow, }; /** * Sets the PanelBehavior for a PlasmaShellSurface with Role @c Role::Panel @@ -326,19 +313,20 @@ void requestShowAutoHidingPanel(); /** - * Set whether a PlasmaShellSurface with Role Panel should get focus or not. + * Set whether a PlasmaShellSurface should get focus or not. * - * By default a Panel does not take focus. With this request the compositor - * can be instructed to also pass focus to a panel + * By default some roles do not take focus. With this request the compositor + * can be instructed to also pass focus. * - * @param takesFocus Set to @c true if the Panel should gain focus. + * @param takesFocus Set to @c true if the surface should gain focus. * @since 5.28 **/ + // KF6 TODO rename to make it generic void setPanelTakesFocus(bool takesFocus); Q_SIGNALS: /** - * Emitted when the compositor hided an auto hiding panel. + * Emitted when the compositor hid an auto hiding panel. * @see requestHideAutoHidingPanel * @see autoHidePanelShown * @see requestShowAutoHidingPanel diff -Nru dwayland-5.57.0.23/src/client/plasmavirtualdesktop.cpp dwayland-5.57.0.24+really5.24.3/src/client/plasmavirtualdesktop.cpp --- dwayland-5.57.0.23/src/client/plasmavirtualdesktop.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmavirtualdesktop.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2018 Marco Martin +/* + SPDX-FileCopyrightText: 2018 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmavirtualdesktop.h" #include "event_queue.h" #include "wayland_pointer_p.h" -#include #include +#include #include @@ -30,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN PlasmaVirtualDesktopManagement::Private { public: @@ -41,14 +26,17 @@ WaylandPointer plasmavirtualdesktopmanagement; EventQueue *queue = nullptr; + quint32 rows = 1; QList desktops; - inline QList::const_iterator constFindDesktop(const QString &id); - inline QList::iterator findDesktop(const QString &id); + inline QList::const_iterator constFindDesktop(const QString &id); + inline QList::iterator findDesktop(const QString &id); private: - static void createdCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, const char *id, uint32_t position); + static void + createdCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, const char *id, uint32_t position); static void removedCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, const char *id); + static void rowsCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, uint32_t rows); static void doneCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management); PlasmaVirtualDesktopManagement *q; @@ -73,8 +61,8 @@ PlasmaVirtualDesktop *q; private: - static void idCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char * id); - static void nameCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char * name); + static void idCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char *id); + static void nameCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char *name); static void activatedCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop); static void deactivatedCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop); @@ -84,63 +72,78 @@ static const org_kde_plasma_virtual_desktop_listener s_listener; }; - - -inline QList::const_iterator PlasmaVirtualDesktopManagement::Private::constFindDesktop(const QString &id) +inline QList::const_iterator PlasmaVirtualDesktopManagement::Private::constFindDesktop(const QString &id) { - return std::find_if( desktops.constBegin(), - desktops.constEnd(), - [id]( const PlasmaVirtualDesktop *desk ){ return desk->id() == id; } ); + return std::find_if(desktops.constBegin(), desktops.constEnd(), [id](const PlasmaVirtualDesktop *desk) { + return desk->id() == id; + }); } -inline QList::iterator PlasmaVirtualDesktopManagement::Private::findDesktop(const QString &id) +inline QList::iterator PlasmaVirtualDesktopManagement::Private::findDesktop(const QString &id) { - return std::find_if( desktops.begin(), - desktops.end(), - [id]( const PlasmaVirtualDesktop *desk ){ return desk->id() == id; } ); + return std::find_if(desktops.begin(), desktops.end(), [id](const PlasmaVirtualDesktop *desk) { + return desk->id() == id; + }); } -const org_kde_plasma_virtual_desktop_management_listener PlasmaVirtualDesktopManagement::Private::s_listener = { - createdCallback, - removedCallback, - doneCallback -}; +const org_kde_plasma_virtual_desktop_management_listener PlasmaVirtualDesktopManagement::Private::s_listener = {createdCallback, + removedCallback, + doneCallback, + rowsCallback}; -void PlasmaVirtualDesktopManagement::Private::createdCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, const char *id, uint32_t position) +void PlasmaVirtualDesktopManagement::Private::createdCallback(void *data, + org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, + const char *id, + uint32_t position) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktopmanagement == org_kde_plasma_virtual_desktop_management); const QString stringId = QString::fromUtf8(id); PlasmaVirtualDesktop *vd = p->q->getVirtualDesktop(stringId); Q_ASSERT(vd); p->desktops.insert(position, vd); - //TODO: emit a lot of desktopMoved? + // TODO: emit a lot of desktopMoved? - emit p->q->desktopCreated(stringId, position); + Q_EMIT p->q->desktopCreated(stringId, position); } -void PlasmaVirtualDesktopManagement::Private::removedCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, const char *id) +void PlasmaVirtualDesktopManagement::Private::removedCallback(void *data, + org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, + const char *id) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktopmanagement == org_kde_plasma_virtual_desktop_management); const QString stringId = QString::fromUtf8(id); PlasmaVirtualDesktop *vd = p->q->getVirtualDesktop(stringId); - //TODO: emit a lot of desktopMoved? + // TODO: emit a lot of desktopMoved? Q_ASSERT(vd); auto i = p->findDesktop(stringId); p->desktops.erase(i); vd->release(); vd->destroy(); vd->deleteLater(); - emit p->q->desktopRemoved(stringId); + Q_EMIT p->q->desktopRemoved(stringId); +} + +void PlasmaVirtualDesktopManagement::Private::rowsCallback(void *data, + org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management, + uint32_t rows) +{ + auto p = reinterpret_cast(data); + Q_ASSERT(p->plasmavirtualdesktopmanagement == org_kde_plasma_virtual_desktop_management); + if (rows == 0) { + return; + } + p->rows = rows; + Q_EMIT p->q->rowsChanged(rows); } void PlasmaVirtualDesktopManagement::Private::doneCallback(void *data, org_kde_plasma_virtual_desktop_management *org_kde_plasma_virtual_desktop_management) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktopmanagement == org_kde_plasma_virtual_desktop_management); - emit p->q->done(); + Q_EMIT p->q->done(); } PlasmaVirtualDesktopManagement::PlasmaVirtualDesktopManagement(QObject *parent) @@ -151,7 +154,8 @@ PlasmaVirtualDesktopManagement::Private::Private(PlasmaVirtualDesktopManagement *q) : q(q) -{} +{ +} void PlasmaVirtualDesktopManagement::Private::setup(org_kde_plasma_virtual_desktop_management *arg) { @@ -181,11 +185,13 @@ d->plasmavirtualdesktopmanagement.destroy(); } -PlasmaVirtualDesktopManagement::operator org_kde_plasma_virtual_desktop_management*() { +PlasmaVirtualDesktopManagement::operator org_kde_plasma_virtual_desktop_management *() +{ return d->plasmavirtualdesktopmanagement; } -PlasmaVirtualDesktopManagement::operator org_kde_plasma_virtual_desktop_management*() const { +PlasmaVirtualDesktopManagement::operator org_kde_plasma_virtual_desktop_management *() const +{ return d->plasmavirtualdesktopmanagement; } @@ -248,62 +254,61 @@ org_kde_plasma_virtual_desktop_management_request_create_virtual_desktop(d->plasmavirtualdesktopmanagement, name.toUtf8(), position); } -QList PlasmaVirtualDesktopManagement::desktops() const +QList PlasmaVirtualDesktopManagement::desktops() const { return d->desktops; } -const org_kde_plasma_virtual_desktop_listener PlasmaVirtualDesktop::Private::s_listener = { - idCallback, - nameCallback, - activatedCallback, - deactivatedCallback, - doneCallback, - removedCallback -}; +quint32 PlasmaVirtualDesktopManagement::rows() const +{ + return d->rows; +} + +const org_kde_plasma_virtual_desktop_listener PlasmaVirtualDesktop::Private::s_listener = + {idCallback, nameCallback, activatedCallback, deactivatedCallback, doneCallback, removedCallback}; -void PlasmaVirtualDesktop::Private::idCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char * id) +void PlasmaVirtualDesktop::Private::idCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char *id) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); p->id = QString::fromUtf8(id); } -void PlasmaVirtualDesktop::Private::nameCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char * name) +void PlasmaVirtualDesktop::Private::nameCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop, const char *name) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); p->name = QString::fromUtf8(name); } void PlasmaVirtualDesktop::Private::activatedCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); p->active = true; - emit p->q->activated(); + Q_EMIT p->q->activated(); } void PlasmaVirtualDesktop::Private::deactivatedCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); p->active = false; - emit p->q->deactivated(); + Q_EMIT p->q->deactivated(); } void PlasmaVirtualDesktop::Private::doneCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); - emit p->q->done(); + Q_EMIT p->q->done(); } void PlasmaVirtualDesktop::Private::removedCallback(void *data, org_kde_plasma_virtual_desktop *org_kde_plasma_virtual_desktop) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->plasmavirtualdesktop == org_kde_plasma_virtual_desktop); - emit p->q->removed(); + Q_EMIT p->q->removed(); } PlasmaVirtualDesktop::Private::Private(PlasmaVirtualDesktop *q) @@ -345,11 +350,13 @@ d->plasmavirtualdesktop.destroy(); } -PlasmaVirtualDesktop::operator org_kde_plasma_virtual_desktop*() { +PlasmaVirtualDesktop::operator org_kde_plasma_virtual_desktop *() +{ return d->plasmavirtualdesktop; } -PlasmaVirtualDesktop::operator org_kde_plasma_virtual_desktop*() const { +PlasmaVirtualDesktop::operator org_kde_plasma_virtual_desktop *() const +{ return d->plasmavirtualdesktop; } @@ -381,4 +388,3 @@ } } - diff -Nru dwayland-5.57.0.23/src/client/plasmavirtualdesktop.h dwayland-5.57.0.24+really5.24.3/src/client/plasmavirtualdesktop.h --- dwayland-5.57.0.23/src/client/plasmavirtualdesktop.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmavirtualdesktop.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2018 Marco Martin +/* + SPDX-FileCopyrightText: 2018 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_PLASMAVIRTUALDESKTOP_H #define KWAYLAND_CLIENT_PLASMAVIRTUALDESKTOP_H #include -#include +#include struct org_kde_plasma_virtual_desktop_management; struct org_kde_plasma_virtual_desktop; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class PlasmaVirtualDesktop; @@ -70,7 +55,7 @@ * Registry::createPlasmaVirtualDesktopManagement. **/ explicit PlasmaVirtualDesktopManagement(QObject *parent = nullptr); - virtual ~PlasmaVirtualDesktopManagement(); + ~PlasmaVirtualDesktopManagement() override; /** * Setup this PlasmaVirtualDesktopManagement to manage the @p plasmavirtualdesktopmanagement. @@ -130,7 +115,7 @@ void requestRemoveVirtualDesktop(const QString &id); /** - * Ask the server to create a new virtual desktop, and position it at a specified position. + * Ask the server to create a new virtual desktop, and position it at a specified position. * If the position is zero or less, it will be positioned at the beginning, * if the cosition is the count or more, it will be positioned at the end. * @param name The name we want for the desktop @@ -141,10 +126,16 @@ /** * @returns All the existent virtual desktops */ - QList desktops() const; + QList desktops() const; - operator org_kde_plasma_virtual_desktop_management*(); - operator org_kde_plasma_virtual_desktop_management*() const; + /** + * @returns How many rows the virtual desktops should be laid out into + * @since 5.55 + */ + quint32 rows() const; + + operator org_kde_plasma_virtual_desktop_management *(); + operator org_kde_plasma_virtual_desktop_management *() const; Q_SIGNALS: void removed(); @@ -160,6 +151,12 @@ void desktopRemoved(const QString &id); /** + * Emitted when the number of rows of virtual desktops has been changed by the server + * @since 5.55 + */ + void rowsChanged(quint32 rows); + + /** * This event is sent after all other properties has been * sent after binding to the desktop manager object and after any * other property changes done after that. This allows @@ -177,7 +174,7 @@ { Q_OBJECT public: - virtual ~PlasmaVirtualDesktop(); + ~PlasmaVirtualDesktop() override; /** * Setup this PlasmaVirtualDesktop to manage the @p plasmavirtualdesktop. @@ -227,7 +224,6 @@ */ QString id() const; - /** * @returns User readable name for the desktop. */ @@ -241,8 +237,8 @@ */ bool isActive() const; - operator org_kde_plasma_virtual_desktop*(); - operator org_kde_plasma_virtual_desktop*() const; + operator org_kde_plasma_virtual_desktop *(); + operator org_kde_plasma_virtual_desktop *() const; Q_SIGNALS: /** @@ -279,7 +275,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/plasmawindowmanagement.cpp dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmanagement.cpp --- dwayland-5.57.0.23/src/client/plasmawindowmanagement.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmanagement.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,43 +1,29 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmawindowmanagement.h" -#include "plasmawindowmodel.h" -#include "plasmavirtualdesktop.h" #include "event_queue.h" #include "output.h" +#include "plasmavirtualdesktop.h" +#include "plasmawindowmodel.h" #include "surface.h" #include "wayland_pointer_p.h" // Wayland #include -#include #include #include +#include #include -#include + +#include namespace KWayland { namespace Client { - class Q_DECL_HIDDEN PlasmaWindowManagement::Private { public: @@ -45,16 +31,23 @@ WaylandPointer wm; EventQueue *queue = nullptr; bool showingDesktop = false; - QList windows; + QList windows; PlasmaWindow *activeWindow = nullptr; + QVector stackingOrder; + QVector stackingOrderUuids; void setup(org_kde_plasma_window_management *wm); private: static void showDesktopCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t state); static void windowCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t id); + static void windowWithUuidCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t id, const char *uuid); + static void stackingOrderCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, wl_array *ids); + static void stackingOrderUuidsCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, const char *uuids); void setShowDesktop(bool set); - void windowCreated(org_kde_plasma_window *id, quint32 internalId); + void windowCreated(org_kde_plasma_window *id, quint32 internalId, const char *uuid); + void setStackingOrder(const QVector &ids); + void setStackingOrder(const QVector &uuids); static struct org_kde_plasma_window_management_listener s_listener; PlasmaWindowManagement *q; @@ -63,9 +56,10 @@ class Q_DECL_HIDDEN PlasmaWindow::Private { public: - Private(org_kde_plasma_window *window, quint32 internalId, PlasmaWindow *q); + Private(org_kde_plasma_window *window, quint32 internalId, const char *uuid, PlasmaWindow *q); WaylandPointer window; - quint32 internalId; + quint32 internalId; ///< @deprecated + QByteArray uuid; QString title; QString appId; quint32 desktop = 0; @@ -94,9 +88,13 @@ QPointer parentWindow; QMetaObject::Connection parentWindowUnmappedConnection; QStringList plasmaVirtualDesktops; + QStringList plasmaActivities; QRect geometry; quint32 pid = 0; + QString applicationMenuServiceName; + QString applicationMenuObjectPath; quint32 windowId = 0; + private: static void titleChangedCallback(void *data, org_kde_plasma_window *window, const char *title); static void appIdChangedCallback(void *data, org_kde_plasma_window *window, const char *app_id); @@ -111,6 +109,9 @@ static void iconChangedCallback(void *data, org_kde_plasma_window *org_kde_plasma_window); static void virtualDesktopEnteredCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id); static void virtualDesktopLeftCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id); + static void appmenuChangedCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *service_name, const char *object_path); + static void activityEnteredCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id); + static void activityLeftCallback(void *data, org_kde_plasma_window *org_kde_plasma_window, const char *id); static void windowIdCallback(void *data, org_kde_plasma_window *window, uint32_t winid); void setActive(bool set); void setMinimized(bool set); @@ -134,8 +135,9 @@ void setParentWindow(PlasmaWindow *parentWindow); void setPid(const quint32 pid); - static Private *cast(void *data) { - return reinterpret_cast(data); + static Private *cast(void *data) + { + return reinterpret_cast(data); } PlasmaWindow *q; @@ -150,7 +152,10 @@ org_kde_plasma_window_management_listener PlasmaWindowManagement::Private::s_listener = { showDesktopCallback, - windowCallback + windowCallback, + stackingOrderCallback, + stackingOrderUuidsCallback, + windowWithUuidCallback, }; void PlasmaWindowManagement::Private::setup(org_kde_plasma_window_management *windowManagement) @@ -163,7 +168,7 @@ void PlasmaWindowManagement::Private::showDesktopCallback(void *data, org_kde_plasma_window_management *org_kde_plasma_window_management, uint32_t state) { - auto wm = reinterpret_cast(data); + auto wm = reinterpret_cast(data); Q_ASSERT(wm->wm == org_kde_plasma_window_management); switch (state) { case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED: @@ -184,66 +189,118 @@ return; } showingDesktop = set; - emit q->showingDesktopChanged(showingDesktop); + Q_EMIT q->showingDesktopChanged(showingDesktop); } void PlasmaWindowManagement::Private::windowCallback(void *data, org_kde_plasma_window_management *interface, uint32_t id) { - auto wm = reinterpret_cast(data); + auto wm = reinterpret_cast(data); Q_ASSERT(wm->wm == interface); QTimer *timer = new QTimer(); timer->setSingleShot(true); timer->setInterval(0); - QObject::connect(timer, &QTimer::timeout, wm->q, + QObject::connect( + timer, + &QTimer::timeout, + wm->q, [timer, wm, id] { - wm->windowCreated(org_kde_plasma_window_management_get_window(wm->wm, id), id); + wm->windowCreated(org_kde_plasma_window_management_get_window(wm->wm, id), id, "unavailable"); + timer->deleteLater(); + }, + Qt::QueuedConnection); + timer->start(); +} + +void PlasmaWindowManagement::Private::windowWithUuidCallback(void *data, org_kde_plasma_window_management *interface, uint32_t id, const char *_uuid) +{ + QByteArray uuid(_uuid); + auto wm = reinterpret_cast(data); + Q_ASSERT(wm->wm == interface); + QTimer *timer = new QTimer(); + timer->setSingleShot(true); + timer->setInterval(0); + QObject::connect( + timer, + &QTimer::timeout, + wm->q, + [timer, wm, id, uuid] { + wm->windowCreated(org_kde_plasma_window_management_get_window_by_uuid(wm->wm, uuid), id, uuid); timer->deleteLater(); - }, Qt::QueuedConnection - ); + }, + Qt::QueuedConnection); timer->start(); } -void PlasmaWindowManagement::Private::windowCreated(org_kde_plasma_window *id, quint32 internalId) +void PlasmaWindowManagement::Private::windowCreated(org_kde_plasma_window *id, quint32 internalId, const char *uuid) { if (queue) { queue->addProxy(id); } - PlasmaWindow *window = new PlasmaWindow(q, id, internalId); + PlasmaWindow *window = new PlasmaWindow(q, id, internalId, uuid); window->d->wm = q; windows << window; - QObject::connect(window, &QObject::destroyed, q, - [this, window] { - windows.removeAll(window); + QObject::connect(window, &QObject::destroyed, q, [this, window] { + windows.removeAll(window); + if (activeWindow == window) { + activeWindow = nullptr; + Q_EMIT q->activeWindowChanged(); + } + }); + QObject::connect(window, &PlasmaWindow::unmapped, q, [this, window] { + if (activeWindow == window) { + activeWindow = nullptr; + Q_EMIT q->activeWindowChanged(); + } + }); + QObject::connect(window, &PlasmaWindow::activeChanged, q, [this, window] { + if (window->isActive()) { if (activeWindow == window) { - activeWindow = nullptr; - emit q->activeWindowChanged(); + return; } - } - ); - QObject::connect(window, &PlasmaWindow::unmapped, q, - [this, window] { + activeWindow = window; + Q_EMIT q->activeWindowChanged(); + } else { if (activeWindow == window) { activeWindow = nullptr; - emit q->activeWindowChanged(); - } - } - ); - QObject::connect(window, &PlasmaWindow::activeChanged, q, - [this, window] { - if (window->isActive()) { - if (activeWindow == window) { - return; - } - activeWindow = window; - emit q->activeWindowChanged(); - } else { - if (activeWindow == window) { - activeWindow = nullptr; - emit q->activeWindowChanged(); - } + Q_EMIT q->activeWindowChanged(); } } - ); + }); +} + +void PlasmaWindowManagement::Private::stackingOrderCallback(void *data, org_kde_plasma_window_management *interface, wl_array *ids) +{ + auto wm = reinterpret_cast(data); + Q_ASSERT(wm->wm == interface); + QVector destination; + destination.resize(ids->size / sizeof(uint32_t)); + memcpy(destination.data(), ids->data, ids->size); + wm->setStackingOrder(destination); +} + +void PlasmaWindowManagement::Private::stackingOrderUuidsCallback(void *data, org_kde_plasma_window_management *interface, const char *uuids) +{ + auto wm = reinterpret_cast(data); + Q_ASSERT(wm->wm == interface); + wm->setStackingOrder(QByteArray(uuids).split(';').toVector()); +} + +void PlasmaWindowManagement::Private::setStackingOrder(const QVector &ids) +{ + if (stackingOrder == ids) { + return; + } + stackingOrder = ids; + Q_EMIT q->stackingOrderChanged(); +} + +void PlasmaWindowManagement::Private::setStackingOrder(const QVector &uuids) +{ + if (stackingOrderUuids == uuids) { + return; + } + stackingOrderUuids = uuids; + Q_EMIT q->stackingOrderUuidsChanged(); } PlasmaWindowManagement::PlasmaWindowManagement(QObject *parent) @@ -262,7 +319,7 @@ if (!d->wm) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->wm.destroy(); } @@ -271,7 +328,7 @@ if (!d->wm) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->wm.release(); } @@ -295,12 +352,12 @@ return d->wm.isValid(); } -PlasmaWindowManagement::operator org_kde_plasma_window_management*() +PlasmaWindowManagement::operator org_kde_plasma_window_management *() { return d->wm; } -PlasmaWindowManagement::operator org_kde_plasma_window_management*() const +PlasmaWindowManagement::operator org_kde_plasma_window_management *() const { return d->wm; } @@ -317,7 +374,9 @@ void PlasmaWindowManagement::setShowingDesktop(bool show) { - org_kde_plasma_window_management_show_desktop(d->wm, show ? ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED : ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED); + org_kde_plasma_window_management_show_desktop(d->wm, + show ? ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED + : ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED); } bool PlasmaWindowManagement::isShowingDesktop() const @@ -325,7 +384,7 @@ return d->showingDesktop; } -QList< PlasmaWindow* > PlasmaWindowManagement::windows() const +QList PlasmaWindowManagement::windows() const { return d->windows; } @@ -340,6 +399,16 @@ return new PlasmaWindowModel(this); } +QVector PlasmaWindowManagement::stackingOrder() const +{ + return d->stackingOrder; +} + +QVector PlasmaWindowManagement::stackingOrderUuids() const +{ + return d->stackingOrderUuids; +} + org_kde_plasma_window_listener PlasmaWindow::Private::s_listener = { titleChangedCallback, appIdChangedCallback, @@ -354,20 +423,33 @@ pidChangedCallback, virtualDesktopEnteredCallback, virtualDesktopLeftCallback, - windowIdCallback + appmenuChangedCallback, + activityEnteredCallback, + activityLeftCallback, + windowIdCallback, }; +void PlasmaWindow::Private::appmenuChangedCallback(void *data, org_kde_plasma_window *window, const char *service_name, const char *object_path) +{ + Q_UNUSED(window) + + Private *p = cast(data); + + p->applicationMenuServiceName = QString::fromUtf8(service_name); + p->applicationMenuObjectPath = QString::fromUtf8(object_path); + + Q_EMIT p->q->applicationMenuChanged(); +} + void PlasmaWindow::Private::parentWindowCallback(void *data, org_kde_plasma_window *window, org_kde_plasma_window *parent) { Q_UNUSED(window) Private *p = cast(data); const auto windows = p->wm->windows(); - auto it = std::find_if(windows.begin(), windows.end(), - [parent] (const PlasmaWindow *w) { - return *w == parent; - } - ); - p->setParentWindow(it != windows.end() ? *it : nullptr); + auto it = std::find_if(windows.constBegin(), windows.constEnd(), [parent](const PlasmaWindow *w) { + return *w == parent; + }); + p->setParentWindow(it != windows.constEnd() ? *it : nullptr); } void PlasmaWindow::Private::windowGeometryCallback(void *data, org_kde_plasma_window *window, int32_t x, int32_t y, uint32_t width, uint32_t height) @@ -379,7 +461,7 @@ return; } p->geometry = geo; - emit p->q->geometryChanged(); + Q_EMIT p->q->geometryChanged(); } void PlasmaWindow::Private::setParentWindow(PlasmaWindow *parent) @@ -388,17 +470,15 @@ QObject::disconnect(parentWindowUnmappedConnection); if (parent && !parent->d->unmapped) { parentWindow = QPointer(parent); - parentWindowUnmappedConnection = QObject::connect(parent, &PlasmaWindow::unmapped, q, - [this] { - setParentWindow(nullptr); - } - ); + parentWindowUnmappedConnection = QObject::connect(parent, &PlasmaWindow::unmapped, q, [this] { + setParentWindow(nullptr); + }); } else { parentWindow = QPointer(); parentWindowUnmappedConnection = QMetaObject::Connection(); } if (parentWindow.data() != old.data()) { - emit q->parentWindowChanged(); + Q_EMIT q->parentWindowChanged(); } } @@ -407,7 +487,7 @@ Q_UNUSED(window) Private *p = cast(data); if (!p->unmapped) { - emit p->wm->windowCreated(p->q); + Q_EMIT p->wm->windowCreated(p->q); } } @@ -420,7 +500,7 @@ return; } p->title = t; - emit p->q->titleChanged(); + Q_EMIT p->q->titleChanged(); } void PlasmaWindow::Private::appIdChangedCallback(void *data, org_kde_plasma_window *window, const char *appId) @@ -432,7 +512,7 @@ return; } p->appId = s; - emit p->q->appIdChanged(); + Q_EMIT p->q->appIdChanged(); } void PlasmaWindow::Private::pidChangedCallback(void *data, org_kde_plasma_window *window, uint32_t pid) @@ -453,7 +533,7 @@ return; } p->desktop = number; - emit p->q->virtualDesktopChanged(); + Q_EMIT p->q->virtualDesktopChanged(); } void PlasmaWindow::Private::unmappedCallback(void *data, org_kde_plasma_window *window) @@ -461,7 +541,7 @@ auto p = cast(data); Q_UNUSED(window); p->unmapped = true; - emit p->q->unmapped(); + Q_EMIT p->q->unmapped(); p->q->deleteLater(); } @@ -471,9 +551,9 @@ Q_UNUSED(window); const QString stringId(QString::fromUtf8(id)); p->plasmaVirtualDesktops << stringId; - emit p->q->plasmaVirtualDesktopEntered(stringId); + Q_EMIT p->q->plasmaVirtualDesktopEntered(stringId); if (p->plasmaVirtualDesktops.count() == 1) { - emit p->q->onAllDesktopsChanged(); + Q_EMIT p->q->onAllDesktopsChanged(); } } @@ -483,12 +563,30 @@ Q_UNUSED(window); const QString stringId(QString::fromUtf8(id)); p->plasmaVirtualDesktops.removeAll(stringId); - emit p->q->plasmaVirtualDesktopLeft(stringId); + Q_EMIT p->q->plasmaVirtualDesktopLeft(stringId); if (p->plasmaVirtualDesktops.isEmpty()) { - emit p->q->onAllDesktopsChanged(); + Q_EMIT p->q->onAllDesktopsChanged(); } } +void PlasmaWindow::Private::activityEnteredCallback(void *data, org_kde_plasma_window *window, const char *id) +{ + auto p = cast(data); + Q_UNUSED(window); + const QString stringId(QString::fromUtf8(id)); + p->plasmaActivities << stringId; + Q_EMIT p->q->plasmaActivityEntered(stringId); +} + +void PlasmaWindow::Private::activityLeftCallback(void *data, org_kde_plasma_window *window, const char *id) +{ + auto p = cast(data); + Q_UNUSED(window); + const QString stringId(QString::fromUtf8(id)); + p->plasmaActivities.removeAll(stringId); + Q_EMIT p->q->plasmaActivityLeft(stringId); +} + void PlasmaWindow::Private::windowIdCallback(void *data, org_kde_plasma_window *window, uint32_t winid) { Q_UNUSED(window) @@ -532,7 +630,7 @@ } else { p->icon = QIcon(); } - emit p->q->iconChanged(); + Q_EMIT p->q->iconChanged(); } static int readData(int fd, QByteArray &data) @@ -561,13 +659,13 @@ auto p = cast(data); Q_UNUSED(window); int pipeFds[2]; - if (pipe2(pipeFds, O_CLOEXEC|O_NONBLOCK) != 0) { + if (pipe2(pipeFds, O_CLOEXEC | O_NONBLOCK) != 0) { return; } org_kde_plasma_window_get_icon(p->window, pipeFds[1]); close(pipeFds[1]); const int pipeFd = pipeFds[0]; - auto readIcon = [pipeFd] () -> QIcon { + auto readIcon = [pipeFd]() -> QIcon { QByteArray content; if (readData(pipeFd, content) != 0) { close(pipeFd); @@ -580,18 +678,16 @@ return icon; }; QFutureWatcher *watcher = new QFutureWatcher(p->q); - QObject::connect(watcher, &QFutureWatcher::finished, p->q, - [p, watcher] { - watcher->deleteLater(); - QIcon icon = watcher->result(); - if (!icon.isNull()) { - p->icon = icon; - } else { - p->icon = QIcon::fromTheme(QStringLiteral("wayland")); - } - emit p->q->iconChanged(); + QObject::connect(watcher, &QFutureWatcher::finished, p->q, [p, watcher] { + watcher->deleteLater(); + QIcon icon = watcher->result(); + if (!icon.isNull()) { + p->icon = icon; + } else { + p->icon = QIcon::fromTheme(QStringLiteral("wayland")); } - ); + Q_EMIT p->q->iconChanged(); + }); watcher->setFuture(QtConcurrent::run(readIcon)); } @@ -601,7 +697,7 @@ return; } active = set; - emit q->activeChanged(); + Q_EMIT q->activeChanged(); } void PlasmaWindow::Private::setFullscreen(bool set) @@ -610,7 +706,7 @@ return; } fullscreen = set; - emit q->fullscreenChanged(); + Q_EMIT q->fullscreenChanged(); } void PlasmaWindow::Private::setKeepAbove(bool set) @@ -619,7 +715,7 @@ return; } keepAbove = set; - emit q->keepAboveChanged(); + Q_EMIT q->keepAboveChanged(); } void PlasmaWindow::Private::setKeepBelow(bool set) @@ -628,7 +724,7 @@ return; } keepBelow = set; - emit q->keepBelowChanged(); + Q_EMIT q->keepBelowChanged(); } void PlasmaWindow::Private::setMaximized(bool set) @@ -637,7 +733,7 @@ return; } maximized = set; - emit q->maximizedChanged(); + Q_EMIT q->maximizedChanged(); } void PlasmaWindow::Private::setMinimized(bool set) @@ -646,7 +742,7 @@ return; } minimized = set; - emit q->minimizedChanged(); + Q_EMIT q->minimizedChanged(); } void PlasmaWindow::Private::setOnAllDesktops(bool set) @@ -655,7 +751,7 @@ return; } onAllDesktops = set; - emit q->onAllDesktopsChanged(); + Q_EMIT q->onAllDesktopsChanged(); } void PlasmaWindow::Private::setDemandsAttention(bool set) @@ -664,7 +760,7 @@ return; } demandsAttention = set; - emit q->demandsAttentionChanged(); + Q_EMIT q->demandsAttentionChanged(); } void PlasmaWindow::Private::setCloseable(bool set) @@ -673,7 +769,7 @@ return; } closeable = set; - emit q->closeableChanged(); + Q_EMIT q->closeableChanged(); } void PlasmaWindow::Private::setFullscreenable(bool set) @@ -682,7 +778,7 @@ return; } fullscreenable = set; - emit q->fullscreenableChanged(); + Q_EMIT q->fullscreenableChanged(); } void PlasmaWindow::Private::setMaximizeable(bool set) @@ -691,7 +787,7 @@ return; } maximizeable = set; - emit q->maximizeableChanged(); + Q_EMIT q->maximizeableChanged(); } void PlasmaWindow::Private::setMinimizeable(bool set) @@ -700,7 +796,7 @@ return; } minimizeable = set; - emit q->minimizeableChanged(); + Q_EMIT q->minimizeableChanged(); } void PlasmaWindow::Private::setSkipTaskbar(bool skip) @@ -709,7 +805,7 @@ return; } skipTaskbar = skip; - emit q->skipTaskbarChanged(); + Q_EMIT q->skipTaskbarChanged(); } void PlasmaWindow::Private::setSkipSwitcher(bool skip) @@ -718,7 +814,7 @@ return; } skipSwitcher = skip; - emit q->skipSwitcherChanged(); + Q_EMIT q->skipSwitcherChanged(); } void PlasmaWindow::Private::setShadeable(bool set) @@ -727,7 +823,7 @@ return; } shadeable = set; - emit q->shadeableChanged(); + Q_EMIT q->shadeableChanged(); } void PlasmaWindow::Private::setShaded(bool set) @@ -736,7 +832,7 @@ return; } shaded = set; - emit q->shadedChanged(); + Q_EMIT q->shadedChanged(); } void PlasmaWindow::Private::setMovable(bool set) @@ -745,7 +841,7 @@ return; } movable = set; - emit q->movableChanged(); + Q_EMIT q->movableChanged(); } void PlasmaWindow::Private::setResizable(bool set) @@ -754,7 +850,7 @@ return; } resizable = set; - emit q->resizableChanged(); + Q_EMIT q->resizableChanged(); } void PlasmaWindow::Private::setVirtualDesktopChangeable(bool set) @@ -763,20 +859,22 @@ return; } virtualDesktopChangeable = set; - emit q->virtualDesktopChangeableChanged(); + Q_EMIT q->virtualDesktopChangeableChanged(); } -PlasmaWindow::Private::Private(org_kde_plasma_window *w, quint32 internalId, PlasmaWindow *q) +PlasmaWindow::Private::Private(org_kde_plasma_window *w, quint32 internalId, const char *uuid, PlasmaWindow *q) : internalId(internalId) + , uuid(uuid) , q(q) { + Q_ASSERT(!this->uuid.isEmpty()); window.setup(w); org_kde_plasma_window_add_listener(w, &s_listener, this); } -PlasmaWindow::PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *window, quint32 internalId) +PlasmaWindow::PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *window, quint32 internalId, const char *uuid) : QObject(parent) - , d(new Private(window, internalId, this)) + , d(new Private(window, internalId, uuid, this)) { } @@ -800,12 +898,12 @@ return d->window.isValid(); } -PlasmaWindow::operator org_kde_plasma_window*() const +PlasmaWindow::operator org_kde_plasma_window *() const { return d->window; } -PlasmaWindow::operator org_kde_plasma_window*() +PlasmaWindow::operator org_kde_plasma_window *() { return d->window; } @@ -867,13 +965,12 @@ bool PlasmaWindow::isOnAllDesktops() const { - //from protocol version 8 virtual desktops are managed by plasmaVirtualDesktops + // from protocol version 8 virtual desktops are managed by plasmaVirtualDesktops if (org_kde_plasma_window_get_version(d->window) < 8) { return d->onAllDesktops; } else { return d->plasmaVirtualDesktops.isEmpty(); } - } bool PlasmaWindow::isDemandingAttention() const @@ -941,11 +1038,19 @@ return d->virtualDesktopChangeable; } +QString PlasmaWindow::applicationMenuObjectPath() const +{ + return d->applicationMenuObjectPath; +} + +QString PlasmaWindow::applicationMenuServiceName() const +{ + return d->applicationMenuServiceName; +} + void PlasmaWindow::requestActivate() { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); } void PlasmaWindow::requestClose() @@ -971,52 +1076,36 @@ void PlasmaWindow::requestToggleKeepAbove() { if (d->keepAbove) { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, - 0); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, 0); } else { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE); } } void PlasmaWindow::requestToggleKeepBelow() { if (d->keepBelow) { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, - 0); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, 0); } else { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW); } } void PlasmaWindow::requestToggleMinimized() { if (d->minimized) { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, - 0); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, 0); } else { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED); } } void PlasmaWindow::requestToggleMaximized() { if (d->maximized) { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, - 0); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, 0); } else { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED); } } @@ -1033,13 +1122,9 @@ void PlasmaWindow::requestToggleShaded() { if (d->shaded) { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, - 0); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, 0); } else { - org_kde_plasma_window_set_state(d->window, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); + org_kde_plasma_window_set_state(d->window, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); } } @@ -1048,6 +1133,11 @@ return d->internalId; } +QByteArray PlasmaWindow::uuid() const +{ + return d->uuid; +} + QPointer PlasmaWindow::parentWindow() const { return d->parentWindow; @@ -1078,5 +1168,173 @@ return d->plasmaVirtualDesktops; } +void PlasmaWindow::requestEnterActivity(const QString &id) +{ + org_kde_plasma_window_request_enter_activity(d->window, id.toUtf8()); +} + +void PlasmaWindow::requestLeaveActivity(const QString &id) +{ + org_kde_plasma_window_request_leave_activity(d->window, id.toUtf8()); +} + +QStringList PlasmaWindow::plasmaActivities() const +{ + return d->plasmaActivities; +} + +void PlasmaWindow::sendToOutput(KWayland::Client::Output *output) const +{ + if (org_kde_plasma_window_get_version(d->window) >= ORG_KDE_PLASMA_WINDOW_SEND_TO_OUTPUT_SINCE_VERSION) { + org_kde_plasma_window_send_to_output(d->window, *output); + } +} + +class Q_DECL_HIDDEN PlasmaActivationFeedback::Private +{ +public: + Private(PlasmaActivationFeedback *q); + WaylandPointer feedback; + EventQueue *queue = nullptr; + + void setup(org_kde_plasma_activation_feedback *feedback); + +private: + static void activationCallback(void *data, struct org_kde_plasma_activation_feedback *feedback, struct org_kde_plasma_activation *id); + + static struct org_kde_plasma_activation_feedback_listener s_listener; + PlasmaActivationFeedback *q; +}; + +PlasmaActivationFeedback::Private::Private(PlasmaActivationFeedback *q) + : q(q) +{ +} + +org_kde_plasma_activation_feedback_listener PlasmaActivationFeedback::Private::s_listener = { + activationCallback, +}; + +void PlasmaActivationFeedback::Private::activationCallback(void *data, org_kde_plasma_activation_feedback *interface, struct org_kde_plasma_activation *id) +{ + auto feedbackPrivate = reinterpret_cast(data); + Q_ASSERT(feedbackPrivate->feedback == interface); + auto activation = new PlasmaActivation(feedbackPrivate->q, id); + Q_EMIT feedbackPrivate->q->activation(activation); +} + +void PlasmaActivationFeedback::Private::setup(org_kde_plasma_activation_feedback *m) +{ + Q_ASSERT(!feedback); + Q_ASSERT(m); + feedback.setup(m); + org_kde_plasma_activation_feedback_add_listener(m, &s_listener, this); +} + +PlasmaActivationFeedback::PlasmaActivationFeedback(QObject *parent) + : QObject(parent) + , d(new Private(this)) +{ +} + +PlasmaActivationFeedback::~PlasmaActivationFeedback() +{ + release(); +} + +void PlasmaActivationFeedback::destroy() +{ + if (!d->feedback) { + return; + } + Q_EMIT interfaceAboutToBeDestroyed(); + d->feedback.destroy(); +} + +void PlasmaActivationFeedback::release() +{ + if (!d->feedback) { + return; + } + Q_EMIT interfaceAboutToBeReleased(); + d->feedback.release(); +} + +void PlasmaActivationFeedback::setup(org_kde_plasma_activation_feedback *wm) +{ + d->setup(wm); +} + +void PlasmaActivationFeedback::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +EventQueue *PlasmaActivationFeedback::eventQueue() +{ + return d->queue; +} + +bool PlasmaActivationFeedback::isValid() const +{ + return d->feedback.isValid(); +} + +PlasmaActivationFeedback::operator org_kde_plasma_activation_feedback *() +{ + return d->feedback; +} + +PlasmaActivationFeedback::operator org_kde_plasma_activation_feedback *() const +{ + return d->feedback; +} + +class Q_DECL_HIDDEN PlasmaActivation::Private +{ +public: + Private(org_kde_plasma_activation *activation, PlasmaActivation *q) + : activation(activation) + { + org_kde_plasma_activation_add_listener(activation, &s_listener, q); + } + + static PlasmaActivation *cast(void *data) + { + return reinterpret_cast(data); + } + WaylandPointer activation; + + static org_kde_plasma_activation_listener s_listener; + static void app_idCallback(void *data, struct org_kde_plasma_activation *org_kde_plasma_activation, const char *app_id); + static void finishedCallback(void *data, struct org_kde_plasma_activation *org_kde_plasma_activation); +}; + +org_kde_plasma_activation_listener PlasmaActivation::Private::s_listener = { + app_idCallback, + finishedCallback, +}; + +void PlasmaActivation::Private::app_idCallback(void *data, org_kde_plasma_activation *activation, const char *appId) +{ + Q_UNUSED(activation) + Q_EMIT cast(data)->applicationId(QString::fromUtf8(appId)); +} + +void PlasmaActivation::Private::finishedCallback(void *data, org_kde_plasma_activation *) +{ + auto q = cast(data); + Q_EMIT q->finished(); + Q_EMIT q->deleteLater(); + q->d->activation.release(); +} + +PlasmaActivation::PlasmaActivation(PlasmaActivationFeedback *parent, org_kde_plasma_activation *activation) + : QObject(parent) + , d(new PlasmaActivation::Private(activation, this)) +{ +} + +PlasmaActivation::~PlasmaActivation() = default; } } diff -Nru dwayland-5.57.0.23/src/client/plasmawindowmanagement.h dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmanagement.h --- dwayland-5.57.0.23/src/client/plasmawindowmanagement.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmanagement.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,31 +1,19 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_PLASMAWINDOWMANAGEMENT_H #define WAYLAND_PLASMAWINDOWMANAGEMENT_H -#include #include +#include #include -#include +#include +struct org_kde_plasma_activation_feedback; +struct org_kde_plasma_activation; struct org_kde_plasma_window_management; struct org_kde_plasma_window; @@ -34,10 +22,11 @@ namespace Client { class EventQueue; +class Output; +class PlasmaActivationFeedback; class PlasmaWindow; class PlasmaWindowModel; class Surface; -class PlasmaVirtualDesktop; /** * @short Wrapper for the org_kde_plasma_window_management interface. @@ -74,7 +63,7 @@ Q_OBJECT public: explicit PlasmaWindowManagement(QObject *parent = nullptr); - virtual ~PlasmaWindowManagement(); + ~PlasmaWindowManagement() override; /** * @returns @c true if managing a org_kde_plasma_window_management. @@ -123,8 +112,8 @@ **/ EventQueue *eventQueue(); - operator org_kde_plasma_window_management*(); - operator org_kde_plasma_window_management*() const; + operator org_kde_plasma_window_management *(); + operator org_kde_plasma_window_management *() const; /** * Whether the system is currently showing the desktop. @@ -157,7 +146,7 @@ * @returns All windows currently known to the PlasmaWindowManagement * @see windowCreated **/ - QList windows() const; + QList windows() const; /** * @returns The currently active PlasmaWindow, the PlasmaWindow which * returns @c true in {@link PlasmaWindow::isActive} or @c nullptr in case @@ -170,6 +159,23 @@ **/ PlasmaWindowModel *createWindowModel(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73) + /** + * @returns windows stacking order + * + * @deprecated Since 5.73, use stackingOrderUuids() + */ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuids()") + QVector stackingOrder() const; +#endif + + /** + * @returns windows stacking order + * + * @since 5.73 + */ + QVector stackingOrderUuids() const; + Q_SIGNALS: /** * This signal is emitted right before the interface is released. @@ -206,8 +212,26 @@ **/ void removed(); -private: +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73) + /** + * The stacking order changed + * @since 5.70 + * @deprecated Since 5.73, use stackingOrderUuidsChanged() + **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::stackingOrderUuidsChanged()") + void stackingOrderChanged(); +#endif + + /** + * The stacking order uuids changed + * @since 5.73 + **/ + void stackingOrderUuidsChanged(); + +public: class Private; + +private: QScopedPointer d; }; @@ -229,7 +253,7 @@ { Q_OBJECT public: - virtual ~PlasmaWindow(); + ~PlasmaWindow() override; /** * Releases the org_kde_plasma_window interface. @@ -259,8 +283,8 @@ **/ bool isValid() const; - operator org_kde_plasma_window*(); - operator org_kde_plasma_window*() const; + operator org_kde_plasma_window *(); + operator org_kde_plasma_window *() const; /** * @returns the window title. @@ -272,18 +296,22 @@ * @see appIdChanged **/ QString appId() const; - /** - * @deprecated: use plasmaVirtualDesktops instead - * @see plasmaVirtualDesktops - * @returns the id of the virtual desktop this PlasmaWindow is on - * @see virtualDesktopChanged - **/ - quint32 virtualDesktop() const; + /** * @returns the id of the window created * @see windowIdCallback **/ quint32 windowId() const; + +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) + /** + * @returns the id of the virtual desktop this PlasmaWindow is on + * @see virtualDesktopChanged + * @deprecated: Since 5.52, use plasmaVirtualDesktops instead + **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktops()") + quint32 virtualDesktop() const; +#endif /** * @returns Whether the window is currently the active Window. * @see activeChanged @@ -351,8 +379,8 @@ **/ bool skipTaskbar() const; /** - * @returns Whether the window should be ignored by a switcher. - * @see skipSwitcherChanged + * @returns Whether the window should be ignored by a switcher. + * @see skipSwitcherChanged **/ bool skipSwitcher() const; /** @@ -416,11 +444,14 @@ * @since 5.22 */ void requestResize(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated: use requestEnterVirtualDesktop instead * Requests to send the window to virtual @p desktop. + * @deprecated: Since 5.52, use requestEnterVirtualDesktop instead **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::requestEnterVirtualDesktop(const QString &)") void requestVirtualDesktop(quint32 desktop); +#endif /** * Requests the window at this model row index have its keep above state toggled. @@ -463,12 +494,25 @@ */ void requestToggleShaded(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 73) /** * An internal window identifier. * This is not a global window identifier. * This identifier does not correspond to QWindow::winId in any way. - **/ + * + * @deprecated Since 5.73, use uuid(const QString &) instead + */ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 73, "Use PlasmaWindow::uuid(const QString &)") quint32 internalId() const; +#endif + + /** + * A unique identifier for the window + * + * @see QUuid + * @since 5.73 + */ + QByteArray uuid() const; /** * The parent window of this PlasmaWindow. @@ -523,6 +567,55 @@ */ QStringList plasmaVirtualDesktops() const; + /** + * Ask the server to make the window enter an activity. + * The server may or may not consent. + * A window can enter more than one activity. + * + * @since 5.81 + */ + void requestEnterActivity(const QString &id); + + /** + * Ask the server to make the window exit an activity. + * The server may or may not consent. + * If it exits all activities it will be considered on all of them. + * + * @since 5.81 + */ + void requestLeaveActivity(const QString &id); + + /** + * Return all the activity ids this window is associated to. + * When an activity gets deleted, it will be automatically removed from this list. + * If this list is empty, assume it's on all activities. + * + * @since 5.81 + */ + QStringList plasmaActivities() const; + + /** + * Return the D-BUS service name for a window's + * application menu. + * + * @since 5.69 + */ + QString applicationMenuServiceName() const; + /** + * Return the D-BUS object path to a windows's + * application menu. + * + * @since 5.69 + */ + QString applicationMenuObjectPath() const; + + /** + * Sends the current window to @p output + * + * @since 5.86 + */ + void sendToOutput(KWayland::Client::Output *output) const; + Q_SIGNALS: /** * The window title changed. @@ -534,11 +627,17 @@ * @see appId **/ void appIdChanged(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead * The virtual desktop changed. + * @deprecated Since 5.52, use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead **/ + KWAYLANDCLIENT_DEPRECATED_VERSION( + 5, + 52, + "Use PlasmaWindow::plasmaVirtualDesktopEntered(const QString &) and PlasmaWindow::plasmaVirtualDesktopLeft(const QString &)") void virtualDesktopChanged(); +#endif /** * The window became active or inactive. * @see isActive @@ -677,16 +776,161 @@ * @since 5.46 */ void plasmaVirtualDesktopLeft(const QString &id); + + /** + * This signal is emitted when the window has entered an activity. + * The window can be on more than one activity, or none: then is considered on all of them. + * @since 5.81 + */ + void plasmaActivityEntered(const QString &id); + + /** + * This signal is emitted when the window left an activity. + * If the window leaves all activities, it can be considered on all. + * + * @since 5.81 + */ + void plasmaActivityLeft(const QString &id); + + /** + * This signal is emitted when either the D-BUS service name or + * object path for the window's application menu changes. + * + * @since 5.69 + **/ + void applicationMenuChanged(); + private: friend class PlasmaWindowManagement; - explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *dataOffer, quint32 internalId); + explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *activation, quint32 internalId, const char *uuid); + class Private; + QScopedPointer d; +}; + +/** + * @since 5.86 + */ +class KWAYLANDCLIENT_EXPORT PlasmaActivation : public QObject +{ + Q_OBJECT +public: + ~PlasmaActivation() override; + +Q_SIGNALS: + /** + * Informs about which application this activation is representing + * + * The @p appId can be used to infer how to decorate this activation. + */ + void applicationId(const QString &appId); + + /** + * Notifies that the activation is done with. + * + * It might happen either because it's over or because it timed out. + */ + void finished(); + +private: + friend class PlasmaActivationFeedback; + explicit PlasmaActivation(PlasmaActivationFeedback *parent, org_kde_plasma_activation *activation); class Private; QScopedPointer d; }; +/** + * @since 5.86 + */ +class KWAYLANDCLIENT_EXPORT PlasmaActivationFeedback : public QObject +{ + Q_OBJECT + +public: + explicit PlasmaActivationFeedback(QObject *parent = nullptr); + ~PlasmaActivationFeedback() override; + + /** + * @returns @c true if managing a org_kde_plasma_activation_feedback. + **/ + bool isValid() const; + + /** + * Releases the org_kde_plasma_activation_feedback interface. + * After the interface has been released the PlasmaActivationFeedback instance is no + * longer valid and can be setup with another org_kde_plasma_activation_feedback interface. + * + * Right before the interface is released the signal interfaceAboutToBeReleased is emitted. + * @see interfaceAboutToBeReleased + **/ + void release(); + + /** + * Destroys the data held by this PlasmaActivationFeedback. + * This method is supposed to be used when the connection to the Wayland + * server goes away. Once the connection becomes invalid, it's not + * possible to call release anymore as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or set up to a new org_kde_plasma_activation_feedback interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * PlasmaActivationFeedback gets destroyed. + * + * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted. + * + * @see release + * @see interfaceAboutToBeDestroyed + **/ + void destroy(); + + /** + * Setup this PlasmaActivationFeedback to manage the @p manager. + * When using Registry::createPlasmaActivationFeedback there is no need to call this + * method. + **/ + void setup(org_kde_plasma_activation_feedback *manager); + + /** + * Sets the @p queue to use for creating a PlasmaActivationFeedback. + **/ + void setEventQueue(EventQueue *queue); + + /** + * @returns The event queue to use for creating a PlasmaActivationFeedback. + **/ + EventQueue *eventQueue(); + + operator org_kde_plasma_activation_feedback *(); + operator org_kde_plasma_activation_feedback *() const; + +Q_SIGNALS: + /** + * This signal is emitted right before the interface is released. + **/ + void interfaceAboutToBeReleased(); + + /** + * This signal is emitted right before the data is destroyed. + **/ + void interfaceAboutToBeDestroyed(); + + /** + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the Compositor got created by + * Registry::createPlasmaActivationFeedback + **/ + void removed(); + + void activation(KWayland::Client::PlasmaActivation *activation); + +private: + class Private; + QScopedPointer d; +}; } } -Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow*) +Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow *) #endif diff -Nru dwayland-5.57.0.23/src/client/plasmawindowmodel.cpp dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmodel.cpp --- dwayland-5.57.0.23/src/client/plasmawindowmodel.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmodel.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Eike Hein +/* + SPDX-FileCopyrightText: 2015 Eike Hein -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmawindowmodel.h" #include "plasmawindowmanagement.h" @@ -26,12 +12,11 @@ { namespace Client { - class Q_DECL_HIDDEN PlasmaWindowModel::Private { public: Private(PlasmaWindowModel *q); - QList windows; + QList windows; PlasmaWindow *window = nullptr; void addWindow(PlasmaWindow *window); @@ -69,134 +54,130 @@ QObject::connect(window, &PlasmaWindow::unmapped, q, removeWindow); QObject::connect(window, &QObject::destroyed, q, removeWindow); - QObject::connect(window, &PlasmaWindow::titleChanged, q, - [window, this] { this->dataChanged(window, Qt::DisplayRole); } - ); - - QObject::connect(window, &PlasmaWindow::iconChanged, q, - [window, this] { this->dataChanged(window, Qt::DecorationRole); } - ); - - QObject::connect(window, &PlasmaWindow::appIdChanged, q, - [window, this] { this->dataChanged(window, PlasmaWindowModel::AppId); } - ); - - QObject::connect(window, &PlasmaWindow::activeChanged, q, - [window, this] { this->dataChanged(window, IsActive); } - ); - - QObject::connect(window, &PlasmaWindow::fullscreenableChanged, q, - [window, this] { this->dataChanged(window, IsFullscreenable); } - ); - - QObject::connect(window, &PlasmaWindow::fullscreenChanged, q, - [window, this] { this->dataChanged(window, IsFullscreen); } - ); - - QObject::connect(window, &PlasmaWindow::maximizeableChanged, q, - [window, this] { this->dataChanged(window, IsMaximizable); } - ); - - QObject::connect(window, &PlasmaWindow::maximizedChanged, q, - [window, this] { this->dataChanged(window, IsMaximized); } - ); - - QObject::connect(window, &PlasmaWindow::minimizeableChanged, q, - [window, this] { this->dataChanged(window, IsMinimizable); } - ); - - QObject::connect(window, &PlasmaWindow::minimizedChanged, q, - [window, this] { this->dataChanged(window, IsMinimized); } - ); - - QObject::connect(window, &PlasmaWindow::keepAboveChanged, q, - [window, this] { this->dataChanged(window, IsKeepAbove); } - ); - - QObject::connect(window, &PlasmaWindow::keepBelowChanged, q, - [window, this] { this->dataChanged(window, IsKeepBelow); } - ); - - QObject::connect(window, &PlasmaWindow::virtualDesktopChanged, q, - [window, this] { this->dataChanged(window, VirtualDesktop); } - ); - - QObject::connect(window, &PlasmaWindow::onAllDesktopsChanged, q, - [window, this] { this->dataChanged(window, IsOnAllDesktops); } - ); - - QObject::connect(window, &PlasmaWindow::demandsAttentionChanged, q, - [window, this] { this->dataChanged(window, IsDemandingAttention); } - ); - - QObject::connect(window, &PlasmaWindow::skipTaskbarChanged, q, - [window, this] { this->dataChanged(window, SkipTaskbar); } - ); - - QObject::connect(window, &PlasmaWindow::skipSwitcherChanged, q, - [window, this] { this->dataChanged(window, SkipSwitcher); } - ); - - QObject::connect(window, &PlasmaWindow::shadeableChanged, q, - [window, this] { this->dataChanged(window, IsShadeable); } - ); - - QObject::connect(window, &PlasmaWindow::shadedChanged, q, - [window, this] { this->dataChanged(window, IsShaded); } - ); - - QObject::connect(window, &PlasmaWindow::movableChanged, q, - [window, this] { this->dataChanged(window, IsMovable); } - ); - - QObject::connect(window, &PlasmaWindow::resizableChanged, q, - [window, this] { this->dataChanged(window, IsResizable); } - ); - - QObject::connect(window, &PlasmaWindow::virtualDesktopChangeableChanged, q, - [window, this] { this->dataChanged(window, IsVirtualDesktopChangeable); } - ); - - QObject::connect(window, &PlasmaWindow::closeableChanged, q, - [window, this] { this->dataChanged(window, IsCloseable); } - ); - - QObject::connect(window, &PlasmaWindow::geometryChanged, q, - [window, this] { this->dataChanged(window, Geometry); } - ); - - QObject::connect(window, &PlasmaWindow::plasmaVirtualDesktopEntered, q, - [window, this] { this->dataChanged(window, VirtualDesktops); } - ); - - QObject::connect(window, &PlasmaWindow::plasmaVirtualDesktopLeft, q, - [window, this] { this->dataChanged(window, VirtualDesktops); } - ); + QObject::connect(window, &PlasmaWindow::titleChanged, q, [window, this] { + this->dataChanged(window, Qt::DisplayRole); + }); + + QObject::connect(window, &PlasmaWindow::iconChanged, q, [window, this] { + this->dataChanged(window, Qt::DecorationRole); + }); + + QObject::connect(window, &PlasmaWindow::appIdChanged, q, [window, this] { + this->dataChanged(window, PlasmaWindowModel::AppId); + }); + + QObject::connect(window, &PlasmaWindow::activeChanged, q, [window, this] { + this->dataChanged(window, IsActive); + }); + + QObject::connect(window, &PlasmaWindow::fullscreenableChanged, q, [window, this] { + this->dataChanged(window, IsFullscreenable); + }); + + QObject::connect(window, &PlasmaWindow::fullscreenChanged, q, [window, this] { + this->dataChanged(window, IsFullscreen); + }); + + QObject::connect(window, &PlasmaWindow::maximizeableChanged, q, [window, this] { + this->dataChanged(window, IsMaximizable); + }); + + QObject::connect(window, &PlasmaWindow::maximizedChanged, q, [window, this] { + this->dataChanged(window, IsMaximized); + }); + + QObject::connect(window, &PlasmaWindow::minimizeableChanged, q, [window, this] { + this->dataChanged(window, IsMinimizable); + }); + + QObject::connect(window, &PlasmaWindow::minimizedChanged, q, [window, this] { + this->dataChanged(window, IsMinimized); + }); + + QObject::connect(window, &PlasmaWindow::keepAboveChanged, q, [window, this] { + this->dataChanged(window, IsKeepAbove); + }); + + QObject::connect(window, &PlasmaWindow::keepBelowChanged, q, [window, this] { + this->dataChanged(window, IsKeepBelow); + }); + + QObject::connect(window, &PlasmaWindow::virtualDesktopChanged, q, [window, this] { + this->dataChanged(window, VirtualDesktop); + }); + + QObject::connect(window, &PlasmaWindow::onAllDesktopsChanged, q, [window, this] { + this->dataChanged(window, IsOnAllDesktops); + }); + + QObject::connect(window, &PlasmaWindow::demandsAttentionChanged, q, [window, this] { + this->dataChanged(window, IsDemandingAttention); + }); + + QObject::connect(window, &PlasmaWindow::skipTaskbarChanged, q, [window, this] { + this->dataChanged(window, SkipTaskbar); + }); + + QObject::connect(window, &PlasmaWindow::skipSwitcherChanged, q, [window, this] { + this->dataChanged(window, SkipSwitcher); + }); + + QObject::connect(window, &PlasmaWindow::shadeableChanged, q, [window, this] { + this->dataChanged(window, IsShadeable); + }); + + QObject::connect(window, &PlasmaWindow::shadedChanged, q, [window, this] { + this->dataChanged(window, IsShaded); + }); + + QObject::connect(window, &PlasmaWindow::movableChanged, q, [window, this] { + this->dataChanged(window, IsMovable); + }); + + QObject::connect(window, &PlasmaWindow::resizableChanged, q, [window, this] { + this->dataChanged(window, IsResizable); + }); + + QObject::connect(window, &PlasmaWindow::virtualDesktopChangeableChanged, q, [window, this] { + this->dataChanged(window, IsVirtualDesktopChangeable); + }); + + QObject::connect(window, &PlasmaWindow::closeableChanged, q, [window, this] { + this->dataChanged(window, IsCloseable); + }); + + QObject::connect(window, &PlasmaWindow::geometryChanged, q, [window, this] { + this->dataChanged(window, Geometry); + }); + + QObject::connect(window, &PlasmaWindow::plasmaVirtualDesktopEntered, q, [window, this] { + this->dataChanged(window, VirtualDesktops); + }); + + QObject::connect(window, &PlasmaWindow::plasmaVirtualDesktopLeft, q, [window, this] { + this->dataChanged(window, VirtualDesktops); + }); } void PlasmaWindowModel::Private::dataChanged(PlasmaWindow *window, int role) { QModelIndex idx = q->index(windows.indexOf(window)); - emit q->dataChanged(idx, idx, QVector() << role); + Q_EMIT q->dataChanged(idx, idx, QVector() << role); } PlasmaWindowModel::PlasmaWindowModel(PlasmaWindowManagement *parent) : QAbstractListModel(parent) , d(new Private(this)) { - connect(parent, &PlasmaWindowManagement::interfaceAboutToBeReleased, this, - [this] { - beginResetModel(); - d->windows.clear(); - endResetModel(); - } - ); - - connect(parent, &PlasmaWindowManagement::windowCreated, this, - [this](PlasmaWindow *window) { - d->addWindow(window); - } - ); + connect(parent, &PlasmaWindowManagement::interfaceAboutToBeReleased, this, [this] { + beginResetModel(); + d->windows.clear(); + endResetModel(); + }); + + connect(parent, &PlasmaWindowManagement::windowCreated, this, [this](PlasmaWindow *window) { + d->addWindow(window); + }); for (auto it = parent->windows().constBegin(); it != parent->windows().constEnd(); ++it) { d->addWindow(*it); @@ -283,6 +264,8 @@ return window->geometry(); } else if (role == VirtualDesktops) { return window->plasmaVirtualDesktops(); + } else if (role == Uuid) { + return window->uuid(); } return QVariant(); diff -Nru dwayland-5.57.0.23/src/client/plasmawindowmodel.h dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmodel.h --- dwayland-5.57.0.23/src/client/plasmawindowmodel.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/plasmawindowmodel.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,34 +1,19 @@ -/******************************************************************** -Copyright 2015 Eike Hein +/* + SPDX-FileCopyrightText: 2015 Eike Hein -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_PLASMAWINDOWMODEL_H #define WAYLAND_PLASMAWINDOWMODEL_H #include -#include +#include namespace KWayland { namespace Client { - class PlasmaWindowManagement; class Surface; @@ -70,40 +55,44 @@ IsMinimized, IsKeepAbove, IsKeepBelow, +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 53) /** - @deprecated @see VirtualDesktops + @deprecated Since 5.53, use VirtualDesktops */ - VirtualDesktop, + VirtualDesktop KWAYLANDCLIENT_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 53, "Use VirtualDesktops"), +#else + VirtualDesktop_DEPRECATED_DO_NOT_USE, +#endif IsOnAllDesktops, IsDemandingAttention, SkipTaskbar, /** - * @since 5.22 - */ + * @since 5.22 + */ IsShadeable, /** - * @since 5.22 - */ + * @since 5.22 + */ IsShaded, /** - * @since 5.22 - */ + * @since 5.22 + */ IsMovable, /** - * @since 5.22 - */ + * @since 5.22 + */ IsResizable, /** - * @since 5.22 - */ + * @since 5.22 + */ IsVirtualDesktopChangeable, /** - * @since 5.22 - */ + * @since 5.22 + */ IsCloseable, /** - * @since 5.25 - */ + * @since 5.25 + */ Geometry, /** * @since 5.35 @@ -114,14 +103,18 @@ */ SkipSwitcher, /** - * @since 5.55 + * @since 5.53 */ - VirtualDesktops + VirtualDesktops, + /** + * @since 5.73 + */ + Uuid, }; Q_ENUM(AdditionalRoles) explicit PlasmaWindowModel(PlasmaWindowManagement *parent); - virtual ~PlasmaWindowModel(); + ~PlasmaWindowModel() override; QHash roleNames() const override; @@ -131,8 +124,7 @@ /** * Returns an index with internalPointer() pointing to a PlasmaWindow instance. **/ - QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override; - + QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override; /** * Request the window at this model row index be activated. diff -Nru dwayland-5.57.0.23/src/client/pointerconstraints.cpp dwayland-5.57.0.24+really5.24.3/src/client/pointerconstraints.cpp --- dwayland-5.57.0.23/src/client/pointerconstraints.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointerconstraints.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "pointerconstraints.h" #include "event_queue.h" #include "pointer.h" @@ -30,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN PointerConstraints::Private { public: @@ -75,11 +60,13 @@ d->pointerconstraints.destroy(); } -PointerConstraints::operator zwp_pointer_constraints_v1*() { +PointerConstraints::operator zwp_pointer_constraints_v1 *() +{ return d->pointerconstraints; } -PointerConstraints::operator zwp_pointer_constraints_v1*() const { +PointerConstraints::operator zwp_pointer_constraints_v1 *() const +{ return d->pointerconstraints; } @@ -173,23 +160,20 @@ static const zwp_locked_pointer_v1_listener s_listener; }; -const zwp_locked_pointer_v1_listener LockedPointer::Private::s_listener = { - lockedCallback, - unlockedCallback -}; +const zwp_locked_pointer_v1_listener LockedPointer::Private::s_listener = {lockedCallback, unlockedCallback}; void LockedPointer::Private::lockedCallback(void *data, zwp_locked_pointer_v1 *zwp_locked_pointer_v1) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->lockedpointer == zwp_locked_pointer_v1); - emit p->q->locked(); + Q_EMIT p->q->locked(); } void LockedPointer::Private::unlockedCallback(void *data, zwp_locked_pointer_v1 *zwp_locked_pointer_v1) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->lockedpointer == zwp_locked_pointer_v1); - emit p->q->unlocked(); + Q_EMIT p->q->unlocked(); } LockedPointer::Private::Private(LockedPointer *q) @@ -231,11 +215,13 @@ d->lockedpointer.destroy(); } -LockedPointer::operator zwp_locked_pointer_v1*() { +LockedPointer::operator zwp_locked_pointer_v1 *() +{ return d->lockedpointer; } -LockedPointer::operator zwp_locked_pointer_v1*() const { +LockedPointer::operator zwp_locked_pointer_v1 *() const +{ return d->lockedpointer; } @@ -279,23 +265,20 @@ static const zwp_confined_pointer_v1_listener s_listener; }; -const zwp_confined_pointer_v1_listener ConfinedPointer::Private::s_listener = { - confinedCallback, - unconfinedCallback -}; +const zwp_confined_pointer_v1_listener ConfinedPointer::Private::s_listener = {confinedCallback, unconfinedCallback}; void ConfinedPointer::Private::confinedCallback(void *data, zwp_confined_pointer_v1 *zwp_confined_pointer_v1) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->confinedpointer == zwp_confined_pointer_v1); - emit p->q->confined(); + Q_EMIT p->q->confined(); } void ConfinedPointer::Private::unconfinedCallback(void *data, zwp_confined_pointer_v1 *zwp_confined_pointer_v1) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->confinedpointer == zwp_confined_pointer_v1); - emit p->q->unconfined(); + Q_EMIT p->q->unconfined(); } ConfinedPointer::Private::Private(ConfinedPointer *q) @@ -337,11 +320,13 @@ d->confinedpointer.destroy(); } -ConfinedPointer::operator zwp_confined_pointer_v1*() { +ConfinedPointer::operator zwp_confined_pointer_v1 *() +{ return d->confinedpointer; } -ConfinedPointer::operator zwp_confined_pointer_v1*() const { +ConfinedPointer::operator zwp_confined_pointer_v1 *() const +{ return d->confinedpointer; } diff -Nru dwayland-5.57.0.23/src/client/pointerconstraints.h dwayland-5.57.0.24+really5.24.3/src/client/pointerconstraints.h --- dwayland-5.57.0.23/src/client/pointerconstraints.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointerconstraints.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_POINTERCONSTRAINTS_H #define KWAYLAND_CLIENT_POINTERCONSTRAINTS_H #include -#include +#include struct zwp_pointer_constraints_v1; struct zwp_locked_pointer_v1; @@ -34,7 +20,6 @@ { namespace Client { - class EventQueue; class LockedPointer; class Surface; @@ -77,7 +62,7 @@ * Registry::createPointerConstraints. **/ explicit PointerConstraints(QObject *parent = nullptr); - virtual ~PointerConstraints(); + ~PointerConstraints() override; /** * Setup this PointerConstraints to manage the @p pointerconstraints. @@ -139,7 +124,7 @@ * A persistent pointer constraint may again reactivate once it has * been deactivated. **/ - Persistent + Persistent, }; /** @@ -212,8 +197,8 @@ **/ ConfinedPointer *confinePointer(Surface *surface, Pointer *pointer, Region *region, LifeTime lifetime, QObject *parent = nullptr); - operator zwp_pointer_constraints_v1*(); - operator zwp_pointer_constraints_v1*() const; + operator zwp_pointer_constraints_v1 *(); + operator zwp_pointer_constraints_v1 *() const; Q_SIGNALS: /** @@ -262,7 +247,7 @@ { Q_OBJECT public: - virtual ~LockedPointer(); + ~LockedPointer() override; /** * Setup this LockedPointer to manage the @p lockedpointer. @@ -328,8 +313,8 @@ **/ void setRegion(Region *region); - operator zwp_locked_pointer_v1*(); - operator zwp_locked_pointer_v1*() const; + operator zwp_locked_pointer_v1 *(); + operator zwp_locked_pointer_v1 *() const; Q_SIGNALS: /** @@ -380,7 +365,7 @@ { Q_OBJECT public: - virtual ~ConfinedPointer(); + ~ConfinedPointer() override; /** * Setup this ConfinedPointer to manage the @p confinedpointer. @@ -436,8 +421,8 @@ **/ void setRegion(Region *region); - operator zwp_confined_pointer_v1*(); - operator zwp_confined_pointer_v1*() const; + operator zwp_confined_pointer_v1 *(); + operator zwp_confined_pointer_v1 *() const; Q_SIGNALS: /** @@ -464,7 +449,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/pointer.cpp dwayland-5.57.0.24+really5.24.3/src/client/pointer.cpp --- dwayland-5.57.0.23/src/client/pointer.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "pointer.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -30,6 +16,17 @@ { namespace Client { +static Pointer::Axis wlAxisToPointerAxis(uint32_t axis) +{ + switch (axis) { + case WL_POINTER_AXIS_VERTICAL_SCROLL: + return Pointer::Axis::Vertical; + case WL_POINTER_AXIS_HORIZONTAL_SCROLL: + return Pointer::Axis::Horizontal; + } + + Q_UNREACHABLE(); +} class Q_DECL_HIDDEN Pointer::Private { @@ -40,15 +37,14 @@ WaylandPointer pointer; QPointer enteredSurface; quint32 enteredSerial = 0; + private: void enter(uint32_t serial, wl_surface *surface, const QPointF &relativeToSurface); void leave(uint32_t serial); - static void enterCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface, - wl_fixed_t sx, wl_fixed_t sy); + static void enterCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy); static void leaveCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface); static void motionCallback(void *data, wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy); - static void buttonCallback(void *data, wl_pointer *pointer, uint32_t serial, uint32_t time, - uint32_t button, uint32_t state); + static void buttonCallback(void *data, wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state); static void axisCallback(void *data, wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value); static void frameCallback(void *data, wl_pointer *pointer); static void axisSourceCallback(void *data, wl_pointer *pointer, uint32_t axis_source); @@ -72,17 +68,8 @@ wl_pointer_add_listener(pointer, &s_listener, this); } -const wl_pointer_listener Pointer::Private::s_listener = { - enterCallback, - leaveCallback, - motionCallback, - buttonCallback, - axisCallback, - frameCallback, - axisSourceCallback, - axisStopCallback, - axisDiscreteCallback -}; +const wl_pointer_listener Pointer::Private::s_listener = + {enterCallback, leaveCallback, motionCallback, buttonCallback, axisCallback, frameCallback, axisSourceCallback, axisStopCallback, axisDiscreteCallback}; Pointer::Pointer(QObject *parent) : QObject(parent) @@ -110,10 +97,9 @@ d->setup(pointer); } -void Pointer::Private::enterCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface, - wl_fixed_t sx, wl_fixed_t sy) +void Pointer::Private::enterCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); p->enter(serial, surface, QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy))); } @@ -122,12 +108,12 @@ { enteredSurface = QPointer(Surface::get(surface)); enteredSerial = serial; - emit q->entered(serial, relativeToSurface); + Q_EMIT q->entered(serial, relativeToSurface); } void Pointer::Private::leaveCallback(void *data, wl_pointer *pointer, uint32_t serial, wl_surface *surface) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); Q_UNUSED(surface) p->leave(serial); @@ -136,19 +122,19 @@ void Pointer::Private::leave(uint32_t serial) { enteredSurface.clear(); - emit q->left(serial); + Q_EMIT q->left(serial); } void Pointer::Private::motionCallback(void *data, wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); - emit p->q->motion(QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy)), time); + Q_EMIT p->q->motion(QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy)), time); } void Pointer::Private::buttonCallback(void *data, wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); auto toState = [state] { if (state == WL_POINTER_BUTTON_STATE_RELEASED) { @@ -157,54 +143,60 @@ return ButtonState::Pressed; } }; - emit p->q->buttonStateChanged(serial, time, button, toState()); + Q_EMIT p->q->buttonStateChanged(serial, time, button, toState()); } void Pointer::Private::axisCallback(void *data, wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); - auto toAxis = [axis] { - if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) { - return Axis::Horizontal; - } else { - return Axis::Vertical; - } - }; - emit p->q->axisChanged(time, toAxis(), wl_fixed_to_double(value)); + Q_EMIT p->q->axisChanged(time, wlAxisToPointerAxis(axis), wl_fixed_to_double(value)); } void Pointer::Private::frameCallback(void *data, wl_pointer *pointer) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointer == pointer); - emit p->q->frame(); + Q_EMIT p->q->frame(); } void Pointer::Private::axisSourceCallback(void *data, wl_pointer *pointer, uint32_t axis_source) { - Q_UNUSED(data) - Q_UNUSED(pointer) - Q_UNUSED(axis_source) - // TODO: implement + auto p = reinterpret_cast(data); + Q_ASSERT(p->pointer == pointer); + AxisSource source; + switch (axis_source) { + case WL_POINTER_AXIS_SOURCE_WHEEL: + source = AxisSource::Wheel; + break; + case WL_POINTER_AXIS_SOURCE_FINGER: + source = AxisSource::Finger; + break; + case WL_POINTER_AXIS_SOURCE_CONTINUOUS: + source = AxisSource::Continuous; + break; + case WL_POINTER_AXIS_SOURCE_WHEEL_TILT: + source = AxisSource::WheelTilt; + break; + default: + Q_UNREACHABLE(); + break; + } + Q_EMIT p->q->axisSourceChanged(source); } void Pointer::Private::axisStopCallback(void *data, wl_pointer *pointer, uint32_t time, uint32_t axis) { - Q_UNUSED(data) - Q_UNUSED(pointer) - Q_UNUSED(time) - Q_UNUSED(axis) - // TODO: implement + auto p = reinterpret_cast(data); + Q_ASSERT(p->pointer == pointer); + Q_EMIT p->q->axisStopped(time, wlAxisToPointerAxis(axis)); } void Pointer::Private::axisDiscreteCallback(void *data, wl_pointer *pointer, uint32_t axis, int32_t discrete) { - Q_UNUSED(data) - Q_UNUSED(pointer) - Q_UNUSED(axis) - Q_UNUSED(discrete) - // TODO: implement + auto p = reinterpret_cast(data); + Q_ASSERT(p->pointer == pointer); + Q_EMIT p->q->axisDiscreteChanged(wlAxisToPointerAxis(axis), discrete); } void Pointer::setCursor(Surface *surface, const QPoint &hotspot) @@ -237,12 +229,12 @@ return d->pointer.isValid(); } -Pointer::operator wl_pointer*() const +Pointer::operator wl_pointer *() const { return d->pointer; } -Pointer::operator wl_pointer*() +Pointer::operator wl_pointer *() { return d->pointer; } diff -Nru dwayland-5.57.0.23/src/client/pointergestures.cpp dwayland-5.57.0.24+really5.24.3/src/client/pointergestures.cpp --- dwayland-5.57.0.23/src/client/pointergestures.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointergestures.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,25 +1,11 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "pointergestures.h" -#include "pointer.h" #include "event_queue.h" +#include "pointer.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -31,7 +17,6 @@ { namespace Client { - class Q_DECL_HIDDEN PointerGestures::Private { public: @@ -69,11 +54,13 @@ d->pointergestures.destroy(); } -PointerGestures::operator zwp_pointer_gestures_v1*() { +PointerGestures::operator zwp_pointer_gestures_v1 *() +{ return d->pointergestures; } -PointerGestures::operator zwp_pointer_gestures_v1*() const { +PointerGestures::operator zwp_pointer_gestures_v1 *() const +{ return d->pointergestures; } @@ -128,7 +115,12 @@ QPointer surface; private: - static void beginCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers); + static void beginCallback(void *data, + zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, + uint32_t serial, + uint32_t time, + wl_surface *surface, + uint32_t fingers); static void updateCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t time, wl_fixed_t dx, wl_fixed_t dy); static void endCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t serial, uint32_t time, int32_t cancelled); @@ -136,36 +128,45 @@ static const zwp_pointer_gesture_swipe_v1_listener s_listener; }; -const zwp_pointer_gesture_swipe_v1_listener PointerSwipeGesture::Private::s_listener = { - beginCallback, - updateCallback, - endCallback -}; +const zwp_pointer_gesture_swipe_v1_listener PointerSwipeGesture::Private::s_listener = {beginCallback, updateCallback, endCallback}; -void PointerSwipeGesture::Private::beginCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) +void PointerSwipeGesture::Private::beginCallback(void *data, + zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, + uint32_t serial, + uint32_t time, + wl_surface *surface, + uint32_t fingers) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerswipegesture == zwp_pointer_gesture_swipe_v1); p->fingerCount = fingers; p->surface = QPointer(Surface::get(surface)); - emit p->q->started(serial, time); + Q_EMIT p->q->started(serial, time); } -void PointerSwipeGesture::Private::updateCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t time, wl_fixed_t dx, wl_fixed_t dy) +void PointerSwipeGesture::Private::updateCallback(void *data, + zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, + uint32_t time, + wl_fixed_t dx, + wl_fixed_t dy) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerswipegesture == zwp_pointer_gesture_swipe_v1); - emit p->q->updated(QSizeF(wl_fixed_to_double(dx), wl_fixed_to_double(dy)), time); + Q_EMIT p->q->updated(QSizeF(wl_fixed_to_double(dx), wl_fixed_to_double(dy)), time); } -void PointerSwipeGesture::Private::endCallback(void *data, zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, uint32_t serial, uint32_t time, int32_t cancelled) +void PointerSwipeGesture::Private::endCallback(void *data, + zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, + uint32_t serial, + uint32_t time, + int32_t cancelled) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerswipegesture == zwp_pointer_gesture_swipe_v1); if (cancelled) { - emit p->q->cancelled(serial, time); + Q_EMIT p->q->cancelled(serial, time); } else { - emit p->q->ended(serial, time); + Q_EMIT p->q->ended(serial, time); } p->fingerCount = 0; p->surface.clear(); @@ -220,11 +221,13 @@ d->pointerswipegesture.destroy(); } -PointerSwipeGesture::operator zwp_pointer_gesture_swipe_v1*() { +PointerSwipeGesture::operator zwp_pointer_gesture_swipe_v1 *() +{ return d->pointerswipegesture; } -PointerSwipeGesture::operator zwp_pointer_gesture_swipe_v1*() const { +PointerSwipeGesture::operator zwp_pointer_gesture_swipe_v1 *() const +{ return d->pointerswipegesture; } @@ -245,44 +248,62 @@ QPointer surface; private: - static void beginCallback(void *data, zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers); - static void updateCallback(void *data, zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, wl_fixed_t rotation); + static void beginCallback(void *data, + zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, + uint32_t serial, + uint32_t time, + wl_surface *surface, + uint32_t fingers); + static void updateCallback(void *data, + zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, + uint32_t time, + wl_fixed_t dx, + wl_fixed_t dy, + wl_fixed_t scale, + wl_fixed_t rotation); static void endCallback(void *data, zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, uint32_t serial, uint32_t time, int32_t cancelled); PointerPinchGesture *q; static const zwp_pointer_gesture_pinch_v1_listener s_listener; }; -const zwp_pointer_gesture_pinch_v1_listener PointerPinchGesture::Private::s_listener = { - beginCallback, - updateCallback, - endCallback -}; +const zwp_pointer_gesture_pinch_v1_listener PointerPinchGesture::Private::s_listener = {beginCallback, updateCallback, endCallback}; -void PointerPinchGesture::Private::beginCallback(void *data, zwp_pointer_gesture_pinch_v1 *pg, uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) +void PointerPinchGesture::Private::beginCallback(void *data, + zwp_pointer_gesture_pinch_v1 *pg, + uint32_t serial, + uint32_t time, + wl_surface *surface, + uint32_t fingers) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerpinchgesture == pg); p->fingerCount = fingers; p->surface = QPointer(Surface::get(surface)); - emit p->q->started(serial, time); + Q_EMIT p->q->started(serial, time); } -void PointerPinchGesture::Private::updateCallback(void *data, zwp_pointer_gesture_pinch_v1 *pg, uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, wl_fixed_t rotation) +void PointerPinchGesture::Private::updateCallback(void *data, + zwp_pointer_gesture_pinch_v1 *pg, + uint32_t time, + wl_fixed_t dx, + wl_fixed_t dy, + wl_fixed_t scale, + wl_fixed_t rotation) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerpinchgesture == pg); - emit p->q->updated(QSizeF(wl_fixed_to_double(dx), wl_fixed_to_double(dy)), wl_fixed_to_double(scale), wl_fixed_to_double(rotation), time); + Q_EMIT p->q->updated(QSizeF(wl_fixed_to_double(dx), wl_fixed_to_double(dy)), wl_fixed_to_double(scale), wl_fixed_to_double(rotation), time); } void PointerPinchGesture::Private::endCallback(void *data, zwp_pointer_gesture_pinch_v1 *pg, uint32_t serial, uint32_t time, int32_t cancelled) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->pointerpinchgesture == pg); if (cancelled) { - emit p->q->cancelled(serial, time); + Q_EMIT p->q->cancelled(serial, time); } else { - emit p->q->ended(serial, time); + Q_EMIT p->q->ended(serial, time); } p->fingerCount = 0; p->surface.clear(); @@ -327,11 +348,13 @@ d->pointerpinchgesture.destroy(); } -PointerPinchGesture::operator zwp_pointer_gesture_pinch_v1*() { +PointerPinchGesture::operator zwp_pointer_gesture_pinch_v1 *() +{ return d->pointerpinchgesture; } -PointerPinchGesture::operator zwp_pointer_gesture_pinch_v1*() const { +PointerPinchGesture::operator zwp_pointer_gesture_pinch_v1 *() const +{ return d->pointerpinchgesture; } diff -Nru dwayland-5.57.0.23/src/client/pointergestures.h dwayland-5.57.0.24+really5.24.3/src/client/pointergestures.h --- dwayland-5.57.0.23/src/client/pointergestures.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointergestures.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_POINTERGESTURES_H #define KWAYLAND_CLIENT_POINTERGESTURES_H #include #include -#include +#include struct zwp_pointer_gestures_v1; struct zwp_pointer_gesture_swipe_v1; @@ -35,7 +21,6 @@ { namespace Client { - class EventQueue; class PointerPinchGesture; class Pointer; @@ -79,7 +64,7 @@ * Registry::createPointerGestures. **/ explicit PointerGestures(QObject *parent = nullptr); - virtual ~PointerGestures(); + ~PointerGestures() override; /** * Setup this PointerGestures to manage the @p pointergestures. @@ -133,8 +118,8 @@ **/ PointerPinchGesture *createPinchGesture(Pointer *pointer, QObject *parent = nullptr); - operator zwp_pointer_gestures_v1*(); - operator zwp_pointer_gestures_v1*() const; + operator zwp_pointer_gestures_v1 *(); + operator zwp_pointer_gestures_v1 *() const; Q_SIGNALS: /** @@ -177,7 +162,7 @@ { Q_OBJECT public: - virtual ~PointerSwipeGesture(); + ~PointerSwipeGesture() override; /** * Setup this PointerSwipeGesture to manage the @p pointerswipegesture. @@ -225,8 +210,8 @@ **/ QPointer surface() const; - operator zwp_pointer_gesture_swipe_v1*(); - operator zwp_pointer_gesture_swipe_v1*() const; + operator zwp_pointer_gesture_swipe_v1 *(); + operator zwp_pointer_gesture_swipe_v1 *() const; Q_SIGNALS: /** @@ -305,7 +290,7 @@ { Q_OBJECT public: - virtual ~PointerPinchGesture(); + ~PointerPinchGesture() override; /** * Setup this PointerPinchGesture to manage the @p pointerpinchgesture. @@ -353,8 +338,8 @@ **/ QPointer surface() const; - operator zwp_pointer_gesture_pinch_v1*(); - operator zwp_pointer_gesture_pinch_v1*() const; + operator zwp_pointer_gesture_pinch_v1 *(); + operator zwp_pointer_gesture_pinch_v1 *() const; Q_SIGNALS: /** @@ -408,7 +393,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/pointer.h dwayland-5.57.0.24+really5.24.3/src/client/pointer.h --- dwayland-5.57.0.23/src/client/pointer.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/pointer.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_POINTER_H #define WAYLAND_POINTER_H #include #include -#include +#include struct wl_pointer; @@ -31,7 +17,6 @@ { namespace Client { - class Surface; /** @@ -49,14 +34,20 @@ public: enum class ButtonState { Released, - Pressed + Pressed, }; enum class Axis { Vertical, - Horizontal + Horizontal, + }; + enum class AxisSource { + Wheel, + Finger, + Continuous, + WheelTilt, }; explicit Pointer(QObject *parent = nullptr); - virtual ~Pointer(); + ~Pointer() override; /** * @returns @c true if managing a wl_pointer. @@ -120,8 +111,8 @@ **/ Surface *enteredSurface(); - operator wl_pointer*(); - operator wl_pointer*() const; + operator wl_pointer *(); + operator wl_pointer *() const; Q_SIGNALS: /** @@ -169,6 +160,24 @@ * @param delta **/ void axisChanged(quint32 time, KWayland::Client::Pointer::Axis axis, qreal delta); + /** + * Indicates the source of scroll and other axes. + * + * @since 5.59 + **/ + void axisSourceChanged(KWayland::Client::Pointer::AxisSource source); + /** + * Discrete step information for scroll and other axes. + * + * @since 5.59 + **/ + void axisDiscreteChanged(KWayland::Client::Pointer::Axis axis, qint32 discreteDelta); + /** + * Stop notification for scroll and other axes. + * + * @since 5.59 + **/ + void axisStopped(quint32 time, KWayland::Client::Pointer::Axis axis); /** * Indicates the end of a set of events that logically belong together. @@ -188,5 +197,6 @@ Q_DECLARE_METATYPE(KWayland::Client::Pointer::ButtonState) Q_DECLARE_METATYPE(KWayland::Client::Pointer::Axis) +Q_DECLARE_METATYPE(KWayland::Client::Pointer::AxisSource) #endif diff -Nru dwayland-5.57.0.23/src/client/primaryoutput_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/primaryoutput_v1.cpp --- dwayland-5.57.0.23/src/client/primaryoutput_v1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryoutput_v1.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,107 @@ +#include "primaryoutput_v1.h" +#include "event_queue.h" +#include "wayland_pointer_p.h" + +#include +#include + +namespace KWayland +{ +namespace Client +{ + +class Q_DECL_HIDDEN PrimaryOutputV1::Private : public QObject +{ + Q_OBJECT +public: + Private(PrimaryOutputV1 *q); + + void setup(kde_primary_output_v1 *primaryOutput); + + WaylandPointer primaryOutput; + static struct kde_primary_output_v1_listener s_primaryOutputListener; + EventQueue *queue = nullptr; + + PrimaryOutputV1 *q; + +private: + static void primaryOutputCallback(void *data, kde_primary_output_v1 *primaryOutput, const char *name); +}; + +kde_primary_output_v1_listener PrimaryOutputV1::Private::s_primaryOutputListener = {primaryOutputCallback}; + +void PrimaryOutputV1::Private::setup(kde_primary_output_v1 *primaryOutput) +{ + kde_primary_output_v1_add_listener(primaryOutput, &s_primaryOutputListener, this); +} + +void PrimaryOutputV1::Private::primaryOutputCallback(void *data, kde_primary_output_v1 *primaryOutput, const char *outputName) +{ + Q_UNUSED(primaryOutput); + auto o = reinterpret_cast(data); + Q_EMIT o->q->primaryOutputChanged(QString::fromUtf8(outputName)); +} + +PrimaryOutputV1::PrimaryOutputV1(QObject *parent) + : QObject(parent) + , d(new Private(this)) +{ +} + +PrimaryOutputV1::~PrimaryOutputV1() +{ + release(); +} + +PrimaryOutputV1::Private::Private(PrimaryOutputV1 *q) + : QObject(q), q(q) +{ +} + +void PrimaryOutputV1::setup(kde_primary_output_v1 *primaryOutput) +{ + Q_ASSERT(primaryOutput); + Q_ASSERT(!d->primaryOutput); + d->primaryOutput.setup(primaryOutput); + d->setup(primaryOutput); +} + +void PrimaryOutputV1::release() +{ + d->primaryOutput.release(); +} + +void PrimaryOutputV1::destroy() +{ + d->primaryOutput.destroy(); +} + +void PrimaryOutputV1::setEventQueue(EventQueue *queue) +{ + d->queue = queue; +} + +EventQueue *PrimaryOutputV1::eventQueue() +{ + return d->queue; +} + +PrimaryOutputV1::operator kde_primary_output_v1 *() +{ + return d->primaryOutput; +} + +PrimaryOutputV1::operator kde_primary_output_v1 *() const +{ + return d->primaryOutput; +} + +bool PrimaryOutputV1::isValid() const +{ + return d->primaryOutput.isValid(); +} + +} +} + +#include "primaryoutput_v1.moc" \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/client/primaryoutput_v1.h dwayland-5.57.0.24+really5.24.3/src/client/primaryoutput_v1.h --- dwayland-5.57.0.23/src/client/primaryoutput_v1.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryoutput_v1.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,96 @@ +/* + SPDX-FileCopyrightText: 2022 JccKevin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef KWAYLAND_CLIENT_PRIMARY_OUTPUT_V1_H +#define KWAYLAND_CLIENT_PRIMARY_OUTPUT_V1_H + +#include + +#include + +struct kde_primary_output_v1; + +namespace KWayland +{ +namespace Client +{ +class EventQueue; + +class KWAYLANDCLIENT_EXPORT PrimaryOutputV1 : public QObject +{ + Q_OBJECT +public: + /** + * Creates a new PrimaryOutputV1. + * Note: after constructing the PrimaryOutputV1 it is not yet valid and one needs + * to call setup. In order to get a ready to use PrimaryOutputV1 prefer using + * Registry::createOutputManagement. + **/ + explicit PrimaryOutputV1(QObject *parent = nullptr); + ~PrimaryOutputV1() override; + + /** + * Setup this PrimaryOutputV1 to manage the @p outputmanagement. + * When using Registry::createOutputManagement there is no need to call this + * method. + **/ + void setup(kde_primary_output_v1 *outputmanagement); + /** + * @returns @c true if managing a kde_primary_output_v1. + **/ + bool isValid() const; + /** + * Releases the kde_primary_output_v1 interface. + * After the interface has been released the PrimaryOutputV1 instance is no + * longer valid and can be setup with another kde_primary_output_v1 interface. + **/ + void release(); + /** + * Destroys the data hold by this PrimaryOutputV1. + * This method is supposed to be used when the connection to the Wayland + * server goes away. If the connection is not valid any more, it's not + * possible to call release any more as that calls into the Wayland + * connection and the call would fail. This method cleans up the data, so + * that the instance can be deleted or setup to a new kde_primary_output_v1 interface + * once there is a new connection available. + * + * This method is automatically invoked when the Registry which created this + * PrimaryOutputV1 gets destroyed. + * + * @see release + **/ + void destroy(); + + /** + * Sets the @p queue to use for creating objects with this PrimaryOutputV1. + **/ + void setEventQueue(EventQueue *queue); + /** + * @returns The event queue to use for creating objects with this PrimaryOutputV1. + **/ + EventQueue *eventQueue(); + + operator kde_primary_output_v1 *(); + operator kde_primary_output_v1 *() const; + +Q_SIGNALS: + /** + * The corresponding global for this interface on the Registry got removed. + * + * This signal gets only emitted if the PrimaryOutputV1 got created by + * Registry::createOutputManagement + **/ + void removed(); + + void primaryOutputChanged(const QString &outputName); + +private: + class Private; + QScopedPointer d; +}; +} +} + +#endif \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/client/primaryselectiondevicemanager_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevicemanager_v1.cpp --- dwayland-5.57.0.23/src/client/primaryselectiondevicemanager_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevicemanager_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "primaryselectiondevicemanager_v1.h" -#include "primaryselectiondevice_v1.h" -#include "primaryselectionsource_v1.h" -#include "event_queue.h" -#include "seat.h" -#include "wayland_pointer_p.h" - -#include "wayland-wp-primary-selection-unstable-v1-client-protocol.h" - -namespace KWayland -{ -namespace Client -{ - -class Q_DECL_HIDDEN PrimarySelectionDeviceManagerV1::Private -{ -public: - WaylandPointer manager; - EventQueue *queue = nullptr; -}; - -PrimarySelectionDeviceManagerV1::PrimarySelectionDeviceManagerV1(QObject *parent) - : QObject(parent) - , d(new Private) -{ -} - -PrimarySelectionDeviceManagerV1::~PrimarySelectionDeviceManagerV1() -{ - release(); -} - -void PrimarySelectionDeviceManagerV1::release() -{ - d->manager.release(); -} - -void PrimarySelectionDeviceManagerV1::destroy() -{ - d->manager.destroy(); -} - -bool PrimarySelectionDeviceManagerV1::isValid() const -{ - return d->manager.isValid(); -} - -void PrimarySelectionDeviceManagerV1::setup(zwp_primary_selection_device_manager_v1 *manager) -{ - Q_ASSERT(manager); - Q_ASSERT(!d->manager.isValid()); - d->manager.setup(manager); -} - -EventQueue *PrimarySelectionDeviceManagerV1::eventQueue() -{ - return d->queue; -} - -void PrimarySelectionDeviceManagerV1::setEventQueue(EventQueue *queue) -{ - d->queue = queue; -} - -PrimarySelectionSourceV1 *PrimarySelectionDeviceManagerV1::createPrimarySelectSource(QObject *parent) -{ - Q_ASSERT(isValid()); - PrimarySelectionSourceV1 *s = new PrimarySelectionSourceV1(parent); - auto w = zwp_primary_selection_device_manager_v1_create_source(d->manager); - if (d->queue) { - d->queue->addProxy(w); - } - s->setup(w); - return s; -} - -PrimarySelectionDeviceV1 *PrimarySelectionDeviceManagerV1::getPrimarySelectDevice(Seat *seat, QObject *parent) -{ - Q_ASSERT(isValid()); - Q_ASSERT(seat); - PrimarySelectionDeviceV1 *device = new PrimarySelectionDeviceV1(parent); - auto w = zwp_primary_selection_device_manager_v1_get_device(d->manager, *seat); - if (d->queue) { - d->queue->addProxy(w); - } - device->setup(w); - return device; -} - -PrimarySelectionDeviceManagerV1::operator zwp_primary_selection_device_manager_v1*() const -{ - return d->manager; -} - -PrimarySelectionDeviceManagerV1::operator zwp_primary_selection_device_manager_v1*() -{ - return d->manager; -} - -} -} diff -Nru dwayland-5.57.0.23/src/client/primaryselectiondevicemanager_v1.h dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevicemanager_v1.h --- dwayland-5.57.0.23/src/client/primaryselectiondevicemanager_v1.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevicemanager_v1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_PRIMARY_SELECTION_DEVICE_MANAGER_V1_H -#define WAYLAND_PRIMARY_SELECTION_DEVICE_MANAGER_V1_H - -#include - -#include - -struct zwp_primary_selection_device_manager_v1; - -namespace KWayland -{ -namespace Client -{ - -class EventQueue; -class PrimarySelectionDeviceV1; -class PrimarySelectionSourceV1; -class Seat; - -/** - * @short Wrapper for the wl_data_device_manager interface. - * - * This class provides a convenient wrapper for the wl_data_device_manager interface. - * - * To use this class one needs to interact with the Registry. There are two - * possible ways to create the DataDeviceManager interface: - * @code - * DataDeviceManager *m = registry->createDataDeviceManager(name, version); - * @endcode - * - * This creates the DataDeviceManager and sets it up directly. As an alternative this - * can also be done in a more low level way: - * @code - * DataDeviceManager *m = new DataDeviceManager; - * m->setup(registry->bindDataDeviceManager(name, version)); - * @endcode - * - * The DataDeviceManager can be used as a drop-in replacement for any wl_data_device_manager - * pointer as it provides matching cast operators. - * - * @see Registry - **/ -class KWAYLANDCLIENT_EXPORT PrimarySelectionDeviceManagerV1 : public QObject -{ - Q_OBJECT -public: - - /** - * Creates a new Compositor. - * Note: after constructing the Compositor it is not yet valid and one needs - * to call setup. In order to get a ready to use Compositor prefer using - * Registry::createCompositor. - **/ - explicit PrimarySelectionDeviceManagerV1(QObject *parent = nullptr); - virtual ~PrimarySelectionDeviceManagerV1(); - - /** - * @returns @c true if managing a wl_data_device_manager. - **/ - bool isValid() const; - /** - * Setup this DataDeviceManager to manage the @p manager. - * When using Registry::createDataDeviceManager there is no need to call this - * method. - **/ - void setup(zwp_primary_selection_device_manager_v1 *manager); - /** - * Releases the wl_data_device_manager interface. - * After the interface has been released the DataDeviceManager instance is no - * longer valid and can be setup with another wl_data_device_manager interface. - **/ - void release(); - /** - * Destroys the data held by this DataDeviceManager. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid anymore, it's not - * possible to call release anymore as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or set up to a new wl_data_device_manager interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * DataDeviceManager gets destroyed. - * - * @see release - **/ - void destroy(); - - /** - * Sets the @p queue to use for creating a DataSource. - **/ - void setEventQueue(EventQueue *queue); - /** - * @returns The event queue to use for creating a DataSource. - **/ - EventQueue *eventQueue(); - - PrimarySelectionSourceV1 *createPrimarySelectSource(QObject *parent = nullptr); - - PrimarySelectionDeviceV1 *getPrimarySelectDevice(Seat *seat, QObject *parent = nullptr); - - operator zwp_primary_selection_device_manager_v1*(); - operator zwp_primary_selection_device_manager_v1*() const; - -Q_SIGNALS: - /** - * The corresponding global for this interface on the Registry got removed. - * - * This signal gets only emitted if the Compositor got created by - * Registry::createDataDeviceManager - * - * @since 5.5 - **/ - void removed(); - -private: - class Private; - QScopedPointer d; -}; - -} -} - - -#endif diff -Nru dwayland-5.57.0.23/src/client/primaryselectiondevice_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevice_v1.cpp --- dwayland-5.57.0.23/src/client/primaryselectiondevice_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevice_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "primaryselectiondevice_v1.h" -#include "primaryselectionoffer_v1.h" -#include "primaryselectionsource_v1.h" -#include "surface.h" -#include "wayland_pointer_p.h" -// Qt -#include -// Wayland -#include "wayland-wp-primary-selection-unstable-v1-client-protocol.h" - - -namespace KWayland -{ -namespace Client -{ - -class Q_DECL_HIDDEN PrimarySelectionDeviceV1::Private -{ -public: - explicit Private(PrimarySelectionDeviceV1 *q); - void setup(zwp_primary_selection_device_v1 *d); - - WaylandPointer device; - QScopedPointer primarySelectionOffer; -private: - void primarySelectOffer(zwp_primary_selection_offer_v1 *id); - void selection(zwp_primary_selection_offer_v1 *id); - static void primarySelectOfferCallback(void *data, zwp_primary_selection_device_v1 *primarySelectDevice, zwp_primary_selection_offer_v1 *id); - static void selectionCallback(void *data, zwp_primary_selection_device_v1 *primarySelectDevice, zwp_primary_selection_offer_v1 *id); - - static const struct zwp_primary_selection_device_v1_listener s_listener; - - PrimarySelectionDeviceV1 *q; - PrimarySelectionOfferV1 *lastOffer = nullptr; -}; - -const zwp_primary_selection_device_v1_listener PrimarySelectionDeviceV1::Private::s_listener = { - primarySelectOfferCallback, - selectionCallback -}; - -void PrimarySelectionDeviceV1::Private::primarySelectOfferCallback(void *data, zwp_primary_selection_device_v1 *primarySelectDevice, zwp_primary_selection_offer_v1 *id) -{ - Q_ASSERT(data); - auto d = reinterpret_cast(data); - Q_ASSERT(d->device == primarySelectDevice); - d->primarySelectOffer(id); -} - -void PrimarySelectionDeviceV1::Private::primarySelectOffer(zwp_primary_selection_offer_v1 *id) -{ - Q_ASSERT(!lastOffer); - lastOffer = new PrimarySelectionOfferV1(q, id); - Q_ASSERT(lastOffer->isValid()); -} - -void PrimarySelectionDeviceV1::Private::selectionCallback(void *data, zwp_primary_selection_device_v1 *primarySelectDevice, zwp_primary_selection_offer_v1 *id) -{ - auto d = reinterpret_cast(data); - Q_ASSERT(d->device == primarySelectDevice); - d->selection(id); -} - -void PrimarySelectionDeviceV1::Private::selection(zwp_primary_selection_offer_v1 *id) -{ - if (!id) { - primarySelectionOffer.reset(); - emit q->selectionCleared(); - return; - } - Q_ASSERT(*lastOffer == id); - primarySelectionOffer.reset(lastOffer); - lastOffer = nullptr; - emit q->selectionOffered(primarySelectionOffer.data()); -} - -PrimarySelectionDeviceV1::Private::Private(PrimarySelectionDeviceV1 *q) - : q(q) -{ -} - -void PrimarySelectionDeviceV1::Private::setup(zwp_primary_selection_device_v1 *d) -{ - Q_ASSERT(d); - Q_ASSERT(!device.isValid()); - device.setup(d); - zwp_primary_selection_device_v1_add_listener(device, &s_listener, this); -} - -PrimarySelectionDeviceV1::PrimarySelectionDeviceV1(QObject *parent) - : QObject(parent) - , d(new Private(this)) -{ -} - -PrimarySelectionDeviceV1::~PrimarySelectionDeviceV1() -{ - release(); -} - -void PrimarySelectionDeviceV1::destroy() -{ - d->device.destroy(); -} - -void PrimarySelectionDeviceV1::release() -{ - d->device.release(); -} - -bool PrimarySelectionDeviceV1::isValid() const -{ - return d->device.isValid(); -} - -void PrimarySelectionDeviceV1::setup(zwp_primary_selection_device_v1 *primarySelectDevice) -{ - d->setup(primarySelectDevice); -} - -namespace { -static zwp_primary_selection_source_v1 *primarySelectSource(const PrimarySelectionSourceV1 *source) -{ - if (!source) { - return nullptr; - } - return *source; -} -} - - -void PrimarySelectionDeviceV1::setSelection(quint32 serial, PrimarySelectionSourceV1 *source) -{ - zwp_primary_selection_device_v1_set_selection(d->device, primarySelectSource(source), serial); -} - -void PrimarySelectionDeviceV1::clearSelection(quint32 serial) -{ - setSelection(serial); -} - -PrimarySelectionOfferV1 *PrimarySelectionDeviceV1::offeredSelection() const -{ - return d->primarySelectionOffer.data(); -} - -PrimarySelectionDeviceV1::operator zwp_primary_selection_device_v1*() -{ - return d->device; -} - -PrimarySelectionDeviceV1::operator zwp_primary_selection_device_v1*() const -{ - return d->device; -} - -} -} diff -Nru dwayland-5.57.0.23/src/client/primaryselectiondevice_v1.h dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevice_v1.h --- dwayland-5.57.0.23/src/client/primaryselectiondevice_v1.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectiondevice_v1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_PRIMARY_SELECTION_OFFER_V1_H -#define WAYLAND_PRIMARY_SELECTION_OFFER_V1_H - -#include "primaryselectionoffer_v1.h" - -#include - -#include - -struct zwp_primary_selection_device_v1; - -namespace KWayland -{ -namespace Client -{ -class PrimarySelectionSourceV1; - -class Surface; - -/** - * @short Wrapper for the wl_data_device interface. - * - * This class is a convenient wrapper for the wl_data_device interface. - * To create a DataDevice call DataDeviceManager::getDataDevice. - * - * @see DataDeviceManager - **/ -class KWAYLANDCLIENT_EXPORT PrimarySelectionDeviceV1 : public QObject -{ - Q_OBJECT -public: - explicit PrimarySelectionDeviceV1(QObject *parent = nullptr); - virtual ~PrimarySelectionDeviceV1(); - - /** - * Setup this PrimarySelectionDeviceV1 to manage the @p dataDevice. - * When using DataDeviceManager::createDataDevice there is no need to call this - * method. - **/ - void setup(zwp_primary_selection_device_v1 *primarySelectDevice); - /** - * Releases the wl_data_device interface. - * After the interface has been released the DataDevice instance is no - * longer valid and can be setup with another wl_data_device interface. - **/ - void release(); - /** - * Destroys the data held by this DataDevice. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid anymore, it's not - * possible to call release anymore as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or set up to a new wl_data_device interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * DataDevice gets destroyed. - * - * @see release - **/ - void destroy(); - /** - * @returns @c true if managing a wl_data_device. - **/ - bool isValid() const; - - - void setSelection(quint32 serial, PrimarySelectionSourceV1 *source = nullptr); - void clearSelection(quint32 serial); - - PrimarySelectionOfferV1 *offeredSelection() const; - - operator zwp_primary_selection_device_v1*(); - operator zwp_primary_selection_device_v1*() const; - -Q_SIGNALS: - void selectionOffered(KWayland::Client::PrimarySelectionOfferV1*); - void selectionCleared(); - -private: - class Private; - QScopedPointer d; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/client/primaryselectionoffer_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionoffer_v1.cpp --- dwayland-5.57.0.23/src/client/primaryselectionoffer_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionoffer_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "primaryselectionoffer_v1.h" -#include "primaryselectiondevice_v1.h" -#include "wayland_pointer_p.h" - -// Qt -#include -#include -// Wayland -#include "wayland-wp-primary-selection-unstable-v1-client-protocol.h" - -namespace KWayland -{ - -namespace Client -{ - -class Q_DECL_HIDDEN PrimarySelectionOfferV1::Private -{ -public: - Private(zwp_primary_selection_offer_v1 *offer, PrimarySelectionOfferV1 *q); - WaylandPointer primarySelectionOffer; - QList mimeTypes; - -private: - void offer(const QString &mimeType); - static void offerCallback(void *data, zwp_primary_selection_offer_v1 *primarySelectOffer, const char *mimeType); - PrimarySelectionOfferV1 *q; - - static const struct zwp_primary_selection_offer_v1_listener s_listener; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_primary_selection_offer_v1_listener PrimarySelectionOfferV1::Private::s_listener = { - offerCallback, -}; -#endif - -PrimarySelectionOfferV1::Private::Private(zwp_primary_selection_offer_v1 *offer, PrimarySelectionOfferV1 *q) - : q(q) -{ - primarySelectionOffer.setup(offer); - zwp_primary_selection_offer_v1_add_listener(offer, &s_listener, this); -} - -void PrimarySelectionOfferV1::Private::offerCallback(void *data, zwp_primary_selection_offer_v1 *primarySelectOffer, const char *mimeType) -{ - auto d = reinterpret_cast(data); - Q_ASSERT(d->primarySelectionOffer == primarySelectOffer); - d->offer(QString::fromUtf8(mimeType)); -} - -void PrimarySelectionOfferV1::Private::offer(const QString &mimeType) -{ - QMimeDatabase db; - const auto &m = db.mimeTypeForName(mimeType); - if (m.isValid()) { - mimeTypes << m; - emit q->mimeTypeOffered(m.name()); - } -} - - -PrimarySelectionOfferV1::PrimarySelectionOfferV1(PrimarySelectionDeviceV1 *parent, zwp_primary_selection_offer_v1 *dataOffer) - : QObject(parent) - , d(new Private(dataOffer, this)) -{ -} - -PrimarySelectionOfferV1::~PrimarySelectionOfferV1() -{ - release(); -} - -void PrimarySelectionOfferV1::release() -{ - d->primarySelectionOffer.release(); -} - -void PrimarySelectionOfferV1::destroy() -{ - d->primarySelectionOffer.destroy(); -} - -bool PrimarySelectionOfferV1::isValid() const -{ - return d->primarySelectionOffer.isValid(); -} - -QList< QMimeType > PrimarySelectionOfferV1::offeredMimeTypes() const -{ - return d->mimeTypes; -} - -void PrimarySelectionOfferV1::receive(const QMimeType &mimeType, qint32 fd) -{ - receive(mimeType.name(), fd); -} - -void PrimarySelectionOfferV1::receive(const QString &mimeType, qint32 fd) -{ - Q_ASSERT(isValid()); - zwp_primary_selection_offer_v1_receive(d->primarySelectionOffer, mimeType.toUtf8().constData(), fd); -} - -PrimarySelectionOfferV1::operator zwp_primary_selection_offer_v1*() -{ - return d->primarySelectionOffer; -} - -PrimarySelectionOfferV1::operator zwp_primary_selection_offer_v1*() const -{ - return d->primarySelectionOffer; -} - -} -} diff -Nru dwayland-5.57.0.23/src/client/primaryselectionoffer_v1.h dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionoffer_v1.h --- dwayland-5.57.0.23/src/client/primaryselectionoffer_v1.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionoffer_v1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_PRIMARY_SELECTOPM_OFFER_V1_H -#define WAYLAND_PRIMARY_SELECTOPM_OFFER_V1_H - -#include - -#include - -#include "primaryselectiondevicemanager_v1.h" - -struct zwp_primary_selection_offer_v1; - -class QMimeType; - -namespace KWayland -{ -namespace Client -{ -class PrimarySelectionDeviceV1; - -/** - * @short Wrapper for the wl_data_offer interface. - * - * This class is a convenient wrapper for the wl_data_offer interface. - * The DataOffer gets created by DataDevice. - * - * @see DataOfferManager - **/ -class KWAYLANDCLIENT_EXPORT PrimarySelectionOfferV1 : public QObject -{ - Q_OBJECT -public: - virtual ~PrimarySelectionOfferV1(); - - /** - * Releases the wl_data_offer interface. - * After the interface has been released the DataOffer instance is no - * longer valid and can be setup with another wl_data_offer interface. - **/ - void release(); - /** - * Destroys the data held by this DataOffer. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid anymore, it's not - * possible to call release anymore as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or set up to a new wl_data_offer interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * DataOffer gets destroyed. - * - * @see release - **/ - void destroy(); - /** - * @returns @c true if managing a wl_data_offer. - **/ - bool isValid() const; - - QList offeredMimeTypes() const; - - void receive(const QMimeType &mimeType, qint32 fd); - void receive(const QString &mimeType, qint32 fd); - - operator zwp_primary_selection_offer_v1*(); - operator zwp_primary_selection_offer_v1*() const; - -Q_SIGNALS: - void mimeTypeOffered(const QString&); - - -private: - friend class PrimarySelectionDeviceV1; - explicit PrimarySelectionOfferV1(PrimarySelectionDeviceV1 *parent, zwp_primary_selection_offer_v1 *dataOffer); - class Private; - QScopedPointer d; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Client::PrimarySelectionOfferV1*) - -#endif diff -Nru dwayland-5.57.0.23/src/client/primaryselectionsource_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionsource_v1.cpp --- dwayland-5.57.0.23/src/client/primaryselectionsource_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionsource_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "primaryselectionsource_v1.h" -#include "wayland_pointer_p.h" -// Qt -#include -// Wayland -#include "wayland-wp-primary-selection-unstable-v1-client-protocol.h" - - - -namespace KWayland -{ -namespace Client -{ - -class Q_DECL_HIDDEN PrimarySelectionSourceV1::Private -{ -public: - explicit Private(PrimarySelectionSourceV1 *q); - void setup(zwp_primary_selection_source_v1 *s); - - WaylandPointer source; - - -private: - - static void sendCallback(void *data, zwp_primary_selection_source_v1 *primarySelectSource, const char *mimeType, int32_t fd); - static void cancelledCallback(void *data, zwp_primary_selection_source_v1 *primarySelectSource); - - static const struct zwp_primary_selection_source_v1_listener s_listener; - - PrimarySelectionSourceV1 *q; -}; - -const zwp_primary_selection_source_v1_listener PrimarySelectionSourceV1::Private::s_listener = { - sendCallback, - cancelledCallback, -}; - -PrimarySelectionSourceV1::Private::Private(PrimarySelectionSourceV1 *q) - : q(q) -{ -} - -void PrimarySelectionSourceV1::Private::sendCallback(void *data, zwp_primary_selection_source_v1 *primarySelectSource, const char *mimeType, int32_t fd) -{ - Q_ASSERT(data); - auto d = reinterpret_cast(data); - Q_ASSERT(d->source == primarySelectSource); - emit d->q->sendDataRequested(QString::fromUtf8(mimeType), fd); -} - -void PrimarySelectionSourceV1::Private::cancelledCallback(void *data, zwp_primary_selection_source_v1 *primarySelectSource) -{ - auto d = reinterpret_cast(data); - Q_ASSERT(d->source == primarySelectSource); - emit d->q->cancelled(); -} - - -void PrimarySelectionSourceV1::Private::setup(zwp_primary_selection_source_v1 *s) -{ - Q_ASSERT(!source.isValid()); - Q_ASSERT(s); - source.setup(s); - zwp_primary_selection_source_v1_add_listener(s, &s_listener, this); -} - -PrimarySelectionSourceV1::PrimarySelectionSourceV1(QObject *parent) - : QObject(parent) - , d(new Private(this)) -{ -} - -PrimarySelectionSourceV1::~PrimarySelectionSourceV1() -{ - release(); -} - -void PrimarySelectionSourceV1::release() -{ - d->source.release(); -} - -void PrimarySelectionSourceV1::destroy() -{ - d->source.destroy(); -} - -bool PrimarySelectionSourceV1::isValid() const -{ - return d->source.isValid(); -} - -void PrimarySelectionSourceV1::setup(zwp_primary_selection_source_v1 *dataSource) -{ - if (dataSource) - d->setup(dataSource); -} - -void PrimarySelectionSourceV1::offer(const QString &mimeType) -{ - zwp_primary_selection_source_v1_offer(d->source, mimeType.toUtf8().constData()); -} - -void PrimarySelectionSourceV1::offer(const QMimeType &mimeType) -{ - if (!mimeType.isValid()) { - return; - } - offer(mimeType.name()); -} - -PrimarySelectionSourceV1::operator zwp_primary_selection_source_v1*() const -{ - return d->source; -} - -PrimarySelectionSourceV1::operator zwp_primary_selection_source_v1*() -{ - return d->source; -} - -} -} diff -Nru dwayland-5.57.0.23/src/client/primaryselectionsource_v1.h dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionsource_v1.h --- dwayland-5.57.0.23/src/client/primaryselectionsource_v1.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/primaryselectionsource_v1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_PRIMARY_SELECTION_SOURCE_V1_H -#define WAYLAND_PRIMARY_SELECTION_SOURCE_V1_H - -#include "buffer.h" -#include "primaryselectiondevicemanager_v1.h" - -#include - -#include - -struct zwp_primary_selection_source_v1; -class QMimeType; - -namespace KWayland -{ -namespace Client -{ - - -/** - * @short Wrapper for the zwp_primary_selection_source_v1 interface. - * - * This class is a convenient wrapper for the zwp_primary_selection_source_v1 interface. - * To create a DataSource call DataDeviceManager::createDataSource. - * - * @see DataDeviceManager - **/ -class KWAYLANDCLIENT_EXPORT PrimarySelectionSourceV1 : public QObject -{ - Q_OBJECT -public: - explicit PrimarySelectionSourceV1(QObject *parent = nullptr); - virtual ~PrimarySelectionSourceV1(); - - /** - * Setup this DataSource to manage the @p dataSource. - * When using DataDeviceManager::createDataSource there is no need to call this - * method. - **/ - void setup(zwp_primary_selection_source_v1 *dataSource); - /** - * Releases the zwp_primary_selection_source_v1 interface. - * After the interface has been released the DataSource instance is no - * longer valid and can be setup with another zwp_primary_selection_source_v1 interface. - **/ - void release(); - /** - * Destroys the data held by this DataSource. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid anymore, it's not - * possible to call release anymore as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or set up to a new zwp_primary_selection_source_v1 interface - * once there is a new connection available. - * - * This method is automatically invoked when the Registry which created this - * DataSource gets destroyed. - * - * @see release - **/ - void destroy(); - /** - * @returns @c true if managing a zwp_primary_selection_source_v1. - **/ - bool isValid() const; - - void offer(const QString &mimeType); - void offer(const QMimeType &mimeType); - - operator zwp_primary_selection_source_v1*(); - operator zwp_primary_selection_source_v1*() const; - -Q_SIGNALS: - - /** - * Request for data from the client. Send the data as the - * specified @p mimeType over the passed file descriptor @p fd, then close - * it. - **/ - void sendDataRequested(const QString &mimeType, qint32 fd); - /** - * This DataSource has been replaced by another DataSource. - * The client should clean up and destroy this DataSource. - **/ - void cancelled(); - - -private: - class Private; - QScopedPointer d; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/client/protocols/appmenu.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/appmenu.xml --- dwayland-5.57.0.23/src/client/protocols/appmenu.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/appmenu.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - - . - ]]> - - - This interface allows a client to link a window (or wl_surface) to an com.canonical.dbusmenu - interface registered on DBus. - - - - - - - - - The DBus service name and object path where the appmenu interface is present - The object should be registered on the session bus before sending this request. - If not applicable, clients should remove this object. - - - - Set or update the service name and object path. - Strings should be formatted in Latin-1 matching the relevant DBus specifications. - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/blur.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/blur.xml --- dwayland-5.57.0.23/src/client/protocols/blur.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/blur.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/client-management.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/client-management.xml --- dwayland-5.57.0.23/src/client/protocols/client-management.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/client-management.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - - - - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - ]]> - - - - - This interface enables clients to get properties of all windows shown on screen via the server. - The server registers one clientmanagement object as a global object. - - - - - request window state of all clients, will notify by "windows_state" event. - - - - - - windows information such as pid/window_id/property - - - - - - - - request window state of all clients, will notify by "windows_state" event. - - - - - - - - windows information such as pid/window_id/property - - - - - - - - \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/client/protocols/contrast.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/contrast.xml --- dwayland-5.57.0.23/src/client/protocols/contrast.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/contrast.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/dde-seat.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/dde-seat.xml --- dwayland-5.57.0.23/src/client/protocols/dde-seat.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/dde-seat.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,317 +0,0 @@ - - - - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - ]]> - - - - - - - A global interface used for getting the global seat object for a - given input device. - - - - - get a pointer through a global seat object - - - - - - - The ID provided will be initialized to the dde_keyboard interface - for this seat. - - This request only takes effect if the seat has the keyboard - capability, or has had the keyboard capability in the past. - It is a protocol violation to issue this request on a seat that has - never had the keyboard capability. The missing_capability error will - be sent in this case. - - - - - - - get a touch through a global seat object - - - - - - - - A dde_pointer object is an extension to the wl_pointer interface - used for emitting global pointer events. - - - - - - client request server to send a global cursor position - - - - - server send a global cursor position to client - - - - - - - - Describes the physical state of a button that produced the button - event. - - - - - - - - Mouse button click and release notifications. - - The button is a button code as defined in the Linux kernel's - linux/input-event-codes.h header file, e.g. BTN_LEFT. - - Any 16-bit button code value is reserved for future additions to the - kernel's event code list. All other button codes above 0xFFFF are - currently undefined but may be used in future versions of this - protocol. - - - - - - - - - - Describes the axis types of scroll events. - - - - - - - - Scroll and other axis notifications. - - For scroll events (vertical and horizontal scroll axes), the - value parameter is the length of a vector along the specified - axis in a coordinate space identical to those of motion events, - representing a relative movement along the specified axis. - - For devices that support movements non-parallel to axes multiple - axis events will be emitted. - - When applicable, for example for touch pads, the server can - choose to emit scroll events where the motion vector is - equivalent to a motion event vector. - - When applicable, a client can transform its content relative to the - scroll distance. - - - - - - - - - - - The wl_keyboard interface represents one or more keyboards - associated with a seat. - - - - - This specifies the format of the keymap provided to the - client with the wl_keyboard.keymap event. - - - - - - - - This event provides a file descriptor to the client which can be - memory-mapped to provide a keyboard mapping description. - - From version 7 onwards, the fd must be mapped with MAP_PRIVATE by - the recipient, as MAP_SHARED may fail. - - - - - - - - - Notification that this seat's keyboard focus is on a certain - surface. - - The compositor must send the wl_keyboard.modifiers event after this - event. - - - - - - - - - Notification that this seat's keyboard focus is no longer on - a certain surface. - - The leave notification is sent before the enter notification - for the new focus. - - After this event client must assume that all keys, including modifiers, - are lifted and also it must stop key repeating if there's some going on. - - - - - - - - Describes the physical state of a key that produced the key event. - - - - - - - - A key was pressed or released. - The time argument is a timestamp with millisecond - granularity, with an undefined base. - - The key is a platform-specific key code that can be interpreted - by feeding it to the keyboard mapping (see the keymap event). - - If this event produces a change in modifiers, then the resulting - wl_keyboard.modifiers event must be sent after this event. - - - - - - - - - - Notifies clients that the modifier and/or group state has - changed, and it should update its local state. - - - - - - - - - - - - - - - - - - - Informs the client about the keyboard's repeat rate and delay. - - This event is sent as soon as the wl_keyboard object has been created, - and is guaranteed to be received by the client before any key press - event. - - Negative values for either rate or delay are illegal. A rate of zero - will disable any repeating (regardless of the value of delay). - - This event can be sent later on as well with a new value if necessary, - so clients should continue listening for the event past the creation - of wl_keyboard. - - - - - - - - - The wl_touch interface represents one or more touchs - associated with a seat. - - - - - Notification that this seat's touch down. - The time argument is a timestamp with millisecond - granularity, with an undefined base. - - - - - - - - - - Notification that this seat's touch up. - The time argument is a timestamp with millisecond - granularity, with an undefined base. - - - - - - - - Notification that this seat's touch motion. - The time argument is a timestamp with millisecond - granularity, with an undefined base. - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/dde-shell.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/dde-shell.xml --- dwayland-5.57.0.23/src/client/protocols/dde-shell.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/dde-shell.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ - - - - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - ]]> - - - - - Eg: window position. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - reques windo geometry, will notify by "geometry" event. - - - - - - request to activate current shell if it's not active - - - - - - Set window state. - - Values for state argument are described by dde_shell.state - and can be used together in a bitfield. The flags bitfield describes which flags are - supposed to be set, the state bitfield the value for the set flags - - - - - - - - Send geometry to client everytime the window geometry changed - - - - - - - - - - - This event will be sent as soon as the window state changes. - - Values for state argument are described by dde_shell.state. - - - - - - - This event will be sent as soon as the window splitable. - - - - - - - Set window property. - - Values for property argument are described by dde_shell.property - and can be used together in a bitfield. The flags bitfield describes which property are - supposed to be set. - - - - - - - - Request split window. - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/dpms.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/dpms.xml --- dwayland-5.57.0.23/src/client/protocols/dpms.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/dpms.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ - - - . - ]]> - - - The Dpms manager allows to get a org_kde_kwin_dpms for a given wl_output. - The org_kde_kwin_dpms provides the currently used VESA Display Power Management - Signaling state (see https://en.wikipedia.org/wiki/VESA_Display_Power_Management_Signaling ). - In addition it allows to request a state change. A compositor is not obliged to honor it - and will normally automatically switch back to on state. - - - - Factory request to get the org_kde_kwin_dpms for a given wl_output. - - - - - - - - This interface provides information about the VESA DPMS state for a wl_output. - It gets created through the request get on the org_kde_kwin_dpms_manager interface. - - On creating the resource the server will push whether DPSM is supported for the output, - the currently used DPMS state and notifies the client through the done event once all - states are pushed. Whenever a state changes the set of changes is committed with the - done event. - - - - This event gets pushed on binding the resource and indicates whether the wl_output - supports DPMS. There are operation modes of a Wayland server where DPMS might not - make sense (e.g. nested compositors). - - - - - - - - - - - - This mode gets pushed on binding the resource and provides the currently used - DPMS mode. It also gets pushed if DPMS is not supported for the wl_output, in that - case the value will be On. - - The event is also pushed whenever the state changes. - - - - - - This event gets pushed on binding the resource once all other states are pushed. - - In addition it gets pushed whenever a state changes to tell the client that all - state changes have been pushed. - - - - - Requests that the compositor puts the wl_output into the passed mode. The compositor - is not obliged to change the state. In addition the compositor might leave the mode - whenever it seems suitable. E.g. the compositor might return to On state on user input. - - The client should not assume that the mode changed after requesting a new mode. - Instead the client should listen for the mode event. - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/fake-input.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/fake-input.xml --- dwayland-5.57.0.23/src/client/protocols/fake-input.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/fake-input.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ - - - . - ]]> - - - This interface allows other processes to provide fake input events. - Purpose is on the one hand side to provide testing facilities like XTest on X11. - But also to support use case like kdeconnect's mouse pad interface. - - A compositor should not trust the input received from this interface. - Clients should not expect that the compositor honors the requests from this - interface. - - - - A client should use this request to tell the compositor why it wants to - use this interface. The compositor might use the information to decide - whether it wants to grant the request. The data might also be passed to - the user to decide whether the application should get granted access to - this very privileged interface. - - - - - - - - - - - - - - - - - - - - - - - A client should use this request to send touch down event at specific - co-ordinates. - - - - - - - - A client should use this request to send touch motion to specific position. - - - - - - - - A client should use this request to send touch up event. - - - - - - A client should use this request to cancel the current - touch event. - - - - - A client should use this request to send touch frame event. - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/fullscreen-shell.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/fullscreen-shell.xml --- dwayland-5.57.0.23/src/client/protocols/fullscreen-shell.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/fullscreen-shell.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ - - - - Displays a single surface per output. - - This interface provides a mechanism for a single client to display - simple full-screen surfaces. While there technically may be multiple - clients bound to this interface, only one of those clients should be - shown at a time. - - To present a surface, the client uses either the present_surface or - present_surface_for_mode requests. Presenting a surface takes effect - on the next wl_surface.commit. See the individual requests for - details about scaling and mode switches. - - The client can have at most one surface per output at any time. - Requesting a surface be presented on an output that already has a - surface replaces the previously presented surface. Presenting a null - surface removes its content and effectively disables the output. - Exactly what happens when an output is "disabled" is - compositor-specific. The same surface may be presented on multiple - outputs simultaneously. - - Once a surface is presented on an output, it stays on that output - until either the client removes it or the compositor destroys the - output. This way, the client can update the output's contents by - simply attaching a new buffer. - - - - - Release the binding from the wl_fullscreen_shell interface - - This destroys the server-side object and frees this binding. If - the client binds to wl_fullscreen_shell multiple times, it may wish - to free some of those bindings. - - - - - - Various capabilities that can be advertised by the compositor. They - are advertised one-at-a-time when the wl_fullscreen_shell interface is - bound. See the wl_fullscreen_shell.capability event for more details. - - ARBITRARY_MODE: - This is a hint to the client that indicates that the compositor is - capable of setting practically any mode on its outputs. If this - capability is provided, wl_fullscreen_shell.present_surface_for_mode - will almost never fail and clients should feel free to set whatever - mode they like. If the compositor does not advertise this, it may - still support some modes that are not advertised through wl_global.mode - but it is less likely. - - CURSOR_PLANE: - This is a hint to the client that indicates that the compositor can - handle a cursor surface from the client without actually compositing. - This may be because of a hardware cursor plane or some other mechanism. - If the compositor does not advertise this capability then setting - wl_pointer.cursor may degrade performance or be ignored entirely. If - CURSOR_PLANE is not advertised, it is recommended that the client draw - its own cursor and set wl_pointer.cursor(NULL). - - - - - - - - Advertises a single capability of the compositor. - - When the wl_fullscreen_shell interface is bound, this event is emitted - once for each capability advertised. Valid capabilities are given by - the wl_fullscreen_shell.capability enum. If clients want to take - advantage of any of these capabilities, they sould use a - wl_display.sync request immediately after binding to ensure that they - receive all the capability events. - - - - - - - Hints to indicate to the compositor how to deal with a conflict - between the dimensions of the surface and the dimensions of the - output. The compositor is free to ignore this parameter. - - - - - - - - - - - Present a surface on the given output. - - If the output is null, the compositor will present the surface on - whatever display (or displays) it thinks best. In particular, this - may replace any or all surfaces currently presented so it should - not be used in combination with placing surfaces on specific - outputs. - - The method parameter is a hint to the compositor for how the surface - is to be presented. In particular, it tells the compostior how to - handle a size mismatch between the presented surface and the - output. The compositor is free to ignore this parameter. - - The "zoom", "zoom_crop", and "stretch" methods imply a scaling - operation on the surface. This will override any kind of output - scaling, so the buffer_scale property of the surface is effectively - ignored. - - - - - - - - - Presents a surface on the given output for a particular mode. - - If the current size of the output differs from that of the surface, - the compositor will attempt to change the size of the output to - match the surface. The result of the mode-switch operation will be - returned via the provided wl_fullscreen_shell_mode_feedback object. - - If the current output mode matches the one requested or if the - compositor successfully switches the mode to match the surface, - then the mode_successful event will be sent and the output will - contain the contents of the given surface. If the compositor - cannot match the output size to the surface size, the mode_failed - will be sent and the output will contain the contents of the - previously presented surface (if any). If another surface is - presented on the given output before either of these has a chance - to happen, the present_cancelled event will be sent. - - Due to race conditions and other issues unknown to the client, no - mode-switch operation is guaranteed to succeed. However, if the - mode is one advertised by wl_output.mode or if the compositor - advertises the ARBITRARY_MODES capability, then the client should - expect that the mode-switch operation will usually succeed. - - If the size of the presented surface changes, the resulting output - is undefined. The compositor may attempt to change the output mode - to compensate. However, there is no guarantee that a suitable mode - will be found and the client has no way to be notified of success - or failure. - - The framerate parameter specifies the desired framerate for the - output in mHz. The compositor is free to ignore this parameter. A - value of 0 indicates that the client has no preference. - - If the value of wl_output.scale differs from wl_surface.buffer_scale, - then the compositor may choose a mode that matches either the buffer - size or the surface size. In either case, the surface will fill the - output. - - - - - - - - - - These errors can be emitted in response to wl_fullscreen_shell requests - - - - - - - - - This event indicates that the attempted mode switch operation was - successful. A surface of the size requested in the mode switch - will fill the output without scaling. - - Upon receiving this event, the client should destroy the - wl_fullscreen_shell_mode_feedback object. - - - - - This event indicates that the attempted mode switch operation - failed. This may be because the requested output mode is not - possible or it may mean that the compositor does not want to allow it. - - Upon receiving this event, the client should destroy the - wl_fullscreen_shell_mode_feedback object. - - - - - This event indicates that the attempted mode switch operation was - cancelled. Most likely this is because the client requested a - second mode switch before the first one completed. - - Upon receiving this event, the client should destroy the - wl_fullscreen_shell_mode_feedback object. - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/idle-inhibit-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/idle-inhibit-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/idle-inhibit-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/idle-inhibit-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ - - - - - Copyright © 2015 Samsung Electronics Co., Ltd - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - This interface permits inhibiting the idle behavior such as screen - blanking, locking, and screensaving. The client binds the idle manager - globally, then creates idle-inhibitor objects for each surface. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - Destroy the inhibit manager. - - - - - - Create a new inhibitor object associated with the given surface. - - - - - - - - - - An idle inhibitor prevents the output that the associated surface is - visible on from being set to a state where it is not visually usable due - to lack of user interaction (e.g. blanked, dimmed, locked, set to power - save, etc.) Any screensaver processes are also blocked from displaying. - - If the surface is destroyed, unmapped, becomes occluded, loses - visibility, or otherwise becomes not visually relevant for the user, the - idle inhibitor will not be honored by the compositor; if the surface - subsequently regains visibility the inhibitor takes effect once again. - Likewise, the inhibitor isn't honored if the system was already idled at - the time the inhibitor was established, although if the system later - de-idles and re-idles the inhibitor will take effect. - - - - - Remove the inhibitor effect from the associated wl_surface. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/idle.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/idle.xml --- dwayland-5.57.0.23/src/client/protocols/idle.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/idle.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ - - - . - ]]> - - - This interface allows to monitor user idle time on a given seat. The interface - allows to register timers which trigger after no user activity was registered - on the seat for a given interval. It notifies when user activity resumes. - - This is useful for applications wanting to perform actions when the user is not - interacting with the system, e.g. chat applications setting the user as away, power - management features to dim screen, etc.. - - - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/linux-dmabuf-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/linux-dmabuf-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/linux-dmabuf-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/linux-dmabuf-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ - - - - - Copyright © 2014, 2015 Collabora, Ltd. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - Following the interfaces from: - https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt - https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt - and the Linux DRM sub-system's AddFb2 ioctl. - - This interface offers ways to create generic dmabuf-based - wl_buffers. Immediately after a client binds to this interface, - the set of supported formats and format modifiers is sent with - 'format' and 'modifier' events. - - The following are required from clients: - - - Clients must ensure that either all data in the dma-buf is - coherent for all subsequent read access or that coherency is - correctly handled by the underlying kernel-side dma-buf - implementation. - - - Don't make any more attachments after sending the buffer to the - compositor. Making more attachments later increases the risk of - the compositor not being able to use (re-import) an existing - dmabuf-based wl_buffer. - - The underlying graphics stack must ensure the following: - - - The dmabuf file descriptors relayed to the server will stay valid - for the whole lifetime of the wl_buffer. This means the server may - at any time use those fds to import the dmabuf into any kernel - sub-system that might accept it. - - However, when the underlying graphics stack fails to deliver the - promise, because of e.g. a device hot-unplug which raises internal - errors, after the wl_buffer has been successfully created the - compositor must not raise protocol errors to the client when dmabuf - import later fails. - - To create a wl_buffer from one or more dmabufs, a client creates a - zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params - request. All planes required by the intended format are added with - the 'add' request. Finally, a 'create' or 'create_immed' request is - issued, which has the following outcome depending on the import success. - - The 'create' request, - - on success, triggers a 'created' event which provides the final - wl_buffer to the client. - - on failure, triggers a 'failed' event to convey that the server - cannot use the dmabufs received from the client. - - For the 'create_immed' request, - - on success, the server immediately imports the added dmabufs to - create a wl_buffer. No event is sent from the server in this case. - - on failure, the server can choose to either: - - terminate the client by raising a fatal error. - - mark the wl_buffer as failed, and send a 'failed' event to the - client. If the client uses a failed wl_buffer as an argument to any - request, the behaviour is compositor implementation-defined. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - Objects created through this interface, especially wl_buffers, will - remain valid. - - - - - - This temporary object is used to collect multiple dmabuf handles into - a single batch to create a wl_buffer. It can only be used once and - should be destroyed after a 'created' or 'failed' event has been - received. - - - - - - - This event advertises one buffer format that the server supports. - All the supported formats are advertised once when the client - binds to this interface. A roundtrip after binding guarantees - that the client has received all supported formats. - - For the definition of the format codes, see the - zwp_linux_buffer_params_v1::create request. - - Warning: the 'format' event is likely to be deprecated and replaced - with the 'modifier' event introduced in zwp_linux_dmabuf_v1 - version 3, described below. Please refrain from using the information - received from this event. - - - - - - - This event advertises the formats that the server supports, along with - the modifiers supported for each format. All the supported modifiers - for all the supported formats are advertised once when the client - binds to this interface. A roundtrip after binding guarantees that - the client has received all supported format-modifier pairs. - - For legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi == - 0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event. - It indicates that the server can support the format with an implicit - modifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it - is as if no explicit modifier is specified. The effective modifier - will be derived from the dmabuf. - - A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for - a given format supports both explicit modifiers and implicit modifiers. - - For the definition of the format and modifier codes, see the - zwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add - requests. - - - - - - - - - - This temporary object is a collection of dmabufs and other - parameters that together form a single logical buffer. The temporary - object may eventually create one wl_buffer unless cancelled by - destroying it before requesting 'create'. - - Single-planar formats only require one dmabuf, however - multi-planar formats may require more than one dmabuf. For all - formats, an 'add' request must be called once per plane (even if the - underlying dmabuf fd is identical). - - You must use consecutive plane indices ('plane_idx' argument for 'add') - from zero to the number of planes used by the drm_fourcc format code. - All planes required by the format must be given exactly once, but can - be given in any order. Each plane index can be set only once. - - - - - - - - - - - - - - - - Cleans up the temporary data sent to the server for dmabuf-based - wl_buffer creation. - - - - - - This request adds one dmabuf to the set in this - zwp_linux_buffer_params_v1. - - The 64-bit unsigned value combined from modifier_hi and modifier_lo - is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the - fb modifier, which is defined in drm_mode.h of Linux UAPI. - This is an opaque token. Drivers use this token to express tiling, - compression, etc. driver-specific modifications to the base format - defined by the DRM fourcc code. - - Warning: It should be an error if the format/modifier pair was not - advertised with the modifier event. This is not enforced yet because - some implementations always accept DRM_FORMAT_MOD_INVALID. Also - version 2 of this protocol does not have the modifier event. - - This request raises the PLANE_IDX error if plane_idx is too large. - The error PLANE_SET is raised if attempting to set a plane that - was already set. - - - - - - - - - - - - - - - - - - This asks for creation of a wl_buffer from the added dmabuf - buffers. The wl_buffer is not created immediately but returned via - the 'created' event if the dmabuf sharing succeeds. The sharing - may fail at runtime for reasons a client cannot predict, in - which case the 'failed' event is triggered. - - The 'format' argument is a DRM_FORMAT code, as defined by the - libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the - authoritative source on how the format codes should work. - - The 'flags' is a bitfield of the flags defined in enum "flags". - 'y_invert' means the that the image needs to be y-flipped. - - Flag 'interlaced' means that the frame in the buffer is not - progressive as usual, but interlaced. An interlaced buffer as - supported here must always contain both top and bottom fields. - The top field always begins on the first pixel row. The temporal - ordering between the two fields is top field first, unless - 'bottom_first' is specified. It is undefined whether 'bottom_first' - is ignored if 'interlaced' is not set. - - This protocol does not convey any information about field rate, - duration, or timing, other than the relative ordering between the - two fields in one buffer. A compositor may have to estimate the - intended field rate from the incoming buffer rate. It is undefined - whether the time of receiving wl_surface.commit with a new buffer - attached, applying the wl_surface state, wl_surface.frame callback - trigger, presentation, or any other point in the compositor cycle - is used to measure the frame or field times. There is no support - for detecting missed or late frames/fields/buffers either, and - there is no support whatsoever for cooperating with interlaced - compositor output. - - The composited image quality resulting from the use of interlaced - buffers is explicitly undefined. A compositor may use elaborate - hardware features or software to deinterlace and create progressive - output frames from a sequence of interlaced input buffers, or it - may produce substandard image quality. However, compositors that - cannot guarantee reasonable image quality in all cases are recommended - to just reject all interlaced buffers. - - Any argument errors, including non-positive width or height, - mismatch between the number of planes and the format, bad - format, bad offset or stride, may be indicated by fatal protocol - errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, - OUT_OF_BOUNDS. - - Dmabuf import errors in the server that are not obvious client - bugs are returned via the 'failed' event as non-fatal. This - allows attempting dmabuf sharing and falling back in the client - if it fails. - - This request can be sent only once in the object's lifetime, after - which the only legal request is destroy. This object should be - destroyed after issuing a 'create' request. Attempting to use this - object after issuing 'create' raises ALREADY_USED protocol error. - - It is not mandatory to issue 'create'. If a client wants to - cancel the buffer creation, it can just destroy this object. - - - - - - - - - - This event indicates that the attempted buffer creation was - successful. It provides the new wl_buffer referencing the dmabuf(s). - - Upon receiving this event, the client should destroy the - zlinux_dmabuf_params object. - - - - - - - This event indicates that the attempted buffer creation has - failed. It usually means that one of the dmabuf constraints - has not been fulfilled. - - Upon receiving this event, the client should destroy the - zlinux_buffer_params object. - - - - - - This asks for immediate creation of a wl_buffer by importing the - added dmabufs. - - In case of import success, no event is sent from the server, and the - wl_buffer is ready to be used by the client. - - Upon import failure, either of the following may happen, as seen fit - by the implementation: - - the client is terminated with one of the following fatal protocol - errors: - - INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, - in case of argument errors such as mismatch between the number - of planes and the format, bad format, non-positive width or - height, or bad offset or stride. - - INVALID_WL_BUFFER, in case the cause for failure is unknown or - plaform specific. - - the server creates an invalid wl_buffer, marks it as failed and - sends a 'failed' event to the client. The result of using this - invalid wl_buffer as an argument in any request by the client is - defined by the compositor implementation. - - This takes the same arguments as a 'create' request, and obeys the - same restrictions. - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/outputdevice.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/outputdevice.xml --- dwayland-5.57.0.23/src/client/protocols/outputdevice.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/outputdevice.xml 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,16 @@ - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. + SPDX-FileCopyrightText: 2008-2011 Kristian Høgsberg + SPDX-FileCopyrightText: 2010-2011 Intel Corporation + SPDX-FileCopyrightText: 2012-2013 Collabora, Ltd. + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: MIT-CMU ]]> - + An outputdevice describes a display device available to the compositor. outputdevice is similar to wl_output, but focuses on output @@ -288,6 +269,50 @@ summary="textual representation of EISA identifier"/> + + + Describes what capabilities this device has. + + + + + + + + What capabilities this device has, sent on startup before the first + done event. + + + + + + + Overscan value of the monitor in percent, sent on startup before the + first done event. + + + + + + + Describes when the compositor may employ variable refresh rate + + + + + + + + + What policy the compositor will employ regarding its use of variable + refresh rate. + + + + diff -Nru dwayland-5.57.0.23/src/client/protocols/output-management.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/output-management.xml --- dwayland-5.57.0.23/src/client/protocols/output-management.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/output-management.xml 2022-11-18 03:38:26.000000000 +0000 @@ -1,34 +1,15 @@ - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. + SPDX-FileCopyrightText: 2008-2011 Kristian Høgsberg + SPDX-FileCopyrightText: 2010-2011 Intel Corporation + SPDX-FileCopyrightText: 2012-2013 Collabora, Ltd. + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: MIT-CMU ]]> - + This interface enables clients to set properties of output devices for screen configuration purposes via the server. To this end output devices are referenced @@ -80,7 +61,7 @@ - + outputconfiguration is a client-specific resource that can be used to ask the server to apply changes to available output devices. @@ -190,6 +171,32 @@ + + + Set the overscan value of this output device with a value in percent. + + + + + + + + Describes when the compositor may employ variable refresh rate + + + + + + + + + Set what policy the compositor should employ regarding its use of + variable refresh rate. + + + + + Sets the just a test. diff -Nru dwayland-5.57.0.23/src/client/protocols/plasma-effects.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-effects.xml --- dwayland-5.57.0.23/src/client/protocols/plasma-effects.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-effects.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - - Ask the compositor to move the surface from a location to another - with a slide animation. - - The from argument provides a clue about where the slide animation - begins, destination coordinates are specified with x and y. - - - - - - - - - - - This request sets the region of the surface that will allow to see - through with a blur effect. - - Pass a null region to disable blur behind. - - - - - - - - This request sets the region of the surface with a different - contrast. - - Pass a null region to disable this effect. - - When a null region is passed the contrast, intensity and saturation - arguments are not taken into account. - - The contrast, intensity and saturation parameters are in - the 0-255 range. - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/plasma-shell.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-shell.xml --- dwayland-5.57.0.23/src/client/protocols/plasma-shell.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-shell.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,400 +0,0 @@ - - - . - ]]> - - - - This interface is used by KF5 powered Wayland shells to communicate with - the compositor and can only be bound one time. - - - - - - - Create a shell surface for an existing surface. - - Only one shell surface can be associated with a given - surface. - - - - - - - - - - - - - - - - - - - - - - - - An interface that may be implemented by a wl_surface, for - implementations that provide the shell user interface. - - It provides requests to set surface roles, assign an output - or set the position in output coordinates. - - On the server side the object is automatically destroyed when - the related wl_surface is destroyed. On client side, - org_kde_plasma_surface.destroy() must be called before - destroying the wl_surface object. - - - - - - - The org_kde_plasma_surface interface is removed from the - wl_surface object that was turned into a shell surface with the - org_kde_plasma_shell.get_surface request. - The shell surface role is lost and wl_surface is unmapped. - - - - - - - - Assign an output to this shell surface. - The compositor will use this information to set the position - when org_kde_plasma_surface.set_position request is - called. - - - - - - - Move the surface to new coordinates. - - Coordinates are global, for example 50,50 for a 1920,0+1920x1080 output - is 1970,50 in global coordinates space. - - Use org_kde_plasma_surface.set_output to assign an output - to this surface. - - - - - - - - - - - - - - - - - - - - - - - Assign a role to a shell surface. - - The compositor handles surfaces depending on their role. - See the explanation below. - - This request fails if the surface already has a role, this means - the surface role may be assigned only once. - - == Surfaces with splash role == - - Splash surfaces are placed above every other surface during the - shell startup phase. - - The surfaces are placed according to the output coordinates. - No size is imposed to those surfaces, the shell has to resize - them according to output size. - - These surfaces are meant to hide the desktop during the startup - phase so that the user will always see a ready to work desktop. - - A shell might not create splash surfaces if the compositor reveals - the desktop in an alternative fashion, for example with a fade - in effect. - - That depends on how much time the desktop usually need to prepare - the workspace or specific design decisions. - This specification doesn't impose any particular design. - - When the startup phase is finished, the shell will send the - org_kde_plasma.desktop_ready request to the compositor. - - == Surfaces with desktop role == - - Desktop surfaces are placed below all other surfaces and are used - to show the actual desktop view with icons, search results or - controls the user will interact with. What to show depends on the - shell implementation. - - The surfaces are placed according to the output coordinates. - No size is imposed to those surfaces, the shell has to resize - them according to output size. - - Only one surface per output can have the desktop role. - - == Surfaces with dashboard role == - - Dashboard surfaces are placed above desktop surfaces and are used to - show additional widgets and controls. - - The surfaces are placed according to the output coordinates. - No size is imposed to those surfaces, the shell has to resize - them according to output size. - - Only one surface per output can have the dashboard role. - - == Surfaces with config role == - - A configuration surface is shown when the user wants to configure - panel or desktop views. - - Only one surface per output can have the config role. - - TODO: This should grab the input like popup menus, right? - - == Surfaces with overlay role == - - Overlays are special surfaces that shows for a limited amount - of time. Such surfaces are useful to display things like volume, - brightness and status changes. - - Compositors may decide to show those surfaces in a layer above - all surfaces, even full screen ones if so is desired. - - == Surfaces with notification role == - - Notification surfaces display informative content for a limited - amount of time. The compositor may decide to show them in a corner - depending on the configuration. - - These surfaces are shown in a layer above all other surfaces except - for full screen ones. - - == Surfaces with lock role == - - The lock surface is shown by the compositor when the session is - locked, users interact with it to unlock the session. - - Compositors should move lock surfaces to 0,0 in output - coordinates space and hide all other surfaces for security sake. - For the same reason it is recommended that clients make the - lock surface as big as the screen. - - Only one surface per output can have the lock role. - - - - - - - - - - - The panel is on top of other surfaces, windows cannot cover (full screen - windows excluded). - - - The panel is hidden automatically and restored when the mouse is over. - - - Windows can cover the panel. - - - Maximized windows take the whole screen space but the panel is above - the windows. - - - - - - Set flags bitmask as described by the flag enum. - Pass 0 to unset any flag, the surface will adjust its behavior to - the default. - - - - - - - - Setting this bit to the window, will make it say it prefers to not be listed in the taskbar. Taskbar implementations may or may not follow this hint. - - - - - - - - - - - A panel surface with panel_behavior auto_hide can perform this request to hide the panel - on a screen edge without unmapping it. The compositor informs the client about the panel - being hidden with the event auto_hidden_panel_hidden. - - The compositor will restore the visibility state of the - surface when the pointer touches the screen edge the panel borders. Once the compositor restores - the visibility the event auto_hidden_panel_shown will be sent. This event will also be sent - if the compositor is unable to hide the panel. - - The client can also request to show the panel again with the request panel_auto_hide_show. - - - - - - A panel surface with panel_behavior auto_hide can perform this request to show the panel - again which got hidden with panel_auto_hide_hide. - - - - - - By default a org_kde_plasma_surface with role panel does not take focus and cannot be - activated. With this request the compositor can be instructed to pass focus also to this - org_kde_plasma_surface. - - For org_kde_plasma_surface with another role than panel the request does not have any effect. - - - - - - - An auto-hiding panel got hidden by the compositor. - - - - - - An auto-hiding panel got shown by the compositor. - - - - - - - Setting this bit will indicate that the window prefers not to be listed in a switcher. - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/plasma-virtual-desktop.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-virtual-desktop.xml --- dwayland-5.57.0.23/src/client/protocols/plasma-virtual-desktop.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-virtual-desktop.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - - . - ]]> - - - - - Given the id of a particular virtual desktop, get the corresponding org_kde_plasma_virtual_desktop which represents only the desktop with that id; - - - - - - - - Ask the server to create a new virtual desktop, and position it at a specified position. If the position is zero or less, it will be positioned at the beginning, if the cosition is the count or more, it will be positioned at the end. - - - - - - - - Ask the server to get rid of a virtual desktop, the server may or may not acconsent to the request. - - - - - - - - - - - - - - - - - - - This event is sent after all other properties has been - sent after binding to the desktop manager object and after any - other property changes done after that. This allows - changes to the org_kde_plasma_virtual_desktop_management properties to be seen as - atomic, even if they happen via multiple events. - - - - - - - - - Request the server to set the status of this desktop to active: The server is free to consent or deny the request. This will be the new "current" virtual desktop of the system. - - - - - - The format of the id is decided by the compositor implementation. A desktop id univocally identifies a virtual desktop and must be guaranteed to never exist two desktops with the same id. The format of the string id is up to the server implementation. - - - - - - - - - - - The desktop will be the new "current" desktop of the system. The server may support either one virtual desktop active at a time, or other combinations such as one virtual desktop active per screen. - Windows associated to this virtual desktop will be shown. - - - - - - Windows that were associated only to this desktop will be hidden. - - - - - - This event is sent after all other properties has been - sent after binding to the desktop object and after any - other property changes done after that. This allows - changes to the org_kde_plasma_virtual_desktop properties to be seen as - atomic, even if they happen via multiple events. - - - - - - This virtual desktop has just been removed by the server: - All windows will lose the association to this desktop. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/plasma-window-management.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-window-management.xml --- dwayland-5.57.0.23/src/client/protocols/plasma-window-management.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/plasma-window-management.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ - - - . - ]]> - - - - This interface manages application windows. - It provides requests to show and hide the desktop and emits - an event every time a window is created so that the client can - use it to manage the window. - - Only one client can bind this interface at a time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tell the compositor to show/hide the desktop. - - - - - - - - - - - - This event will be sent whenever the show desktop mode changes. E.g. when it is entered - or left. - - On binding the interface the current state is sent. - - - - - - - This event will be sent immediately after a window is mapped. - - - - - - - - Manages and control an application window. - - Only one client can bind this interface at a time. - - - - - Set window state. - - Values for state argument are described by org_kde_plasma_window_management.state - and can be used together in a bitfield. The flags bitfield describes which flags are - supposed to be set, the state bitfield the value for the set flags - - - - - - - - Deprecated: use enter_virtual_desktop - Maps the window to a different virtual desktop. - - To show the window on all virtual desktops, call the - org_kde_plasma_window.set_state request and specify a on_all_desktops - state in the bitfield. - - - - - - - Sets the geometry of the taskbar entry for this window. - The geometry is relative to a panel in particular. - - - - - - - - - - - Remove the task geometry information for a particular panel. - - - - - - - - - Close this window. - - - - - - Request an interactive move for this window. - - - - - - Request an interactive resize for this window. - - - - - - Removes the resource bound for this org_kde_plasma_window. - - - - - - The compositor will write the window icon into the provided file descriptor. - The data is a serialized QIcon with QDataStream. - - - - - - - This event will be sent as soon as the window title is changed. - - - - - - - This event will be sent as soon as the application - identifier is changed. - - - - - - - This event will be sent as soon as the window state changes. - - Values for state argument are described by org_kde_plasma_window_management.state. - - - - - - - DEPRECATED: use virtual_desktop_entered and virtual_desktop_left instead - This event will be sent when a window is moved to another - virtual desktop. - - It is not sent if it becomes visible on all virtual desktops though. - - - - - - - This event will be sent whenever the themed icon name changes. May be null. - - - - - - - This event will be sent immediately after the window is closed - and its surface is unmapped. - - - - - - This event will be sent immediately after all initial state been sent to the client. - If the Plasma window is already unmapped, the unmapped event will be sent before the - initial_state event. - - - - - - This event will be sent whenever the parent window of this org_kde_plasma_window changes. - The passed parent is another org_kde_plasma_window and this org_kde_plasma_window is a - transient window to the parent window. If the parent argument is null, this - org_kde_plasma_window does not have a parent window. - - - - - - - This event will be sent whenever the window geometry of this org_kde_plasma_window changes. - The coordinates are in absolute coordinates of the windowing system. - - - - - - - - - - This event will be sent whenever the icon of the window changes, but there is no themed - icon name. Common examples are Xwayland windows which have a pixmap based icon. - - The client can request the icon using get_icon. - - - - - - This event will be sent when the compositor has set the process id this window belongs to. - This should be set once before the initial_state is sent. - - - - - - - - - - Make the window enter a virtual desktop. A window can enter more - than one virtual desktop. if the id is empty or invalid, no action will be performed. - - - - - - RFC: do this with an empty id to request_enter_virtual_desktop? - Make the window enter a new virtual desktop. If the server consents the request, - it will create a new virtual desktop and assign the window to it. - - - - - - Make the window exit a virtual desktop. If it exits all desktops it will be considered on all of them. - - - - - - - This event will be sent when the window has entered a new virtual desktop. The window can be on more than one desktop, or none: then is considered on all of them. - - - - - - - This event will be sent when the window left a virtual desktop. If the window leaves all desktops, it can be considered on all. - If the window gets manually added on all desktops, the server has to send virtual_desktop_left for every previous desktop it was in for the window to be really considered on all desktops. - - - - - - - This event will be sent immediately after a window is mapped. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/pointer-constraints-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/pointer-constraints-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/pointer-constraints-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/pointer-constraints-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,344 +0,0 @@ - - - - - Copyright © 2014 Jonas Ådahl - Copyright © 2015 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol specifies a set of interfaces used for adding constraints to - the motion of a pointer. Possible constraints include confining pointer - motions to a given region, or locking it to its current position. - - In order to constrain the pointer, a client must first bind the global - interface "wp_pointer_constraints" which, if a compositor supports pointer - constraints, is exposed by the registry. Using the bound global object, the - client uses the request that corresponds to the type of constraint it wants - to make. See wp_pointer_constraints for more details. - - Warning! The protocol described in this file is experimental and backward - incompatible changes may be made. Backward compatible changes may be added - together with the corresponding interface version bump. Backward - incompatible changes are done by bumping the version number in the protocol - and interface names and resetting the interface version. Once the protocol - is to be declared stable, the 'z' prefix and the version number in the - protocol and interface names are removed and the interface version number is - reset. - - - - - The global interface exposing pointer constraining functionality. It - exposes two requests: lock_pointer for locking the pointer to its - position, and confine_pointer for locking the pointer to a region. - - The lock_pointer and confine_pointer requests create the objects - wp_locked_pointer and wp_confined_pointer respectively, and the client can - use these objects to interact with the lock. - - For any surface, only one lock or confinement may be active across all - wl_pointer objects of the same seat. If a lock or confinement is requested - when another lock or confinement is active or requested on the same surface - and with any of the wl_pointer objects of the same seat, an - 'already_constrained' error will be raised. - - - - - These errors can be emitted in response to wp_pointer_constraints - requests. - - - - - - - These values represent different lifetime semantics. They are passed - as arguments to the factory requests to specify how the constraint - lifetimes should be managed. - - - - A oneshot pointer constraint will never reactivate once it has been - deactivated. See the corresponding deactivation event - (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for - details. - - - - - A persistent pointer constraint may again reactivate once it has - been deactivated. See the corresponding deactivation event - (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for - details. - - - - - - - Used by the client to notify the server that it will no longer use this - pointer constraints object. - - - - - - The lock_pointer request lets the client request to disable movements of - the virtual pointer (i.e. the cursor), effectively locking the pointer - to a position. This request may not take effect immediately; in the - future, when the compositor deems implementation-specific constraints - are satisfied, the pointer lock will be activated and the compositor - sends a locked event. - - The protocol provides no guarantee that the constraints are ever - satisfied, and does not require the compositor to send an error if the - constraints cannot ever be satisfied. It is thus possible to request a - lock that will never activate. - - There may not be another pointer constraint of any kind requested or - active on the surface for any of the wl_pointer objects of the seat of - the passed pointer when requesting a lock. If there is, an error will be - raised. See general pointer lock documentation for more details. - - The intersection of the region passed with this request and the input - region of the surface is used to determine where the pointer must be - in order for the lock to activate. It is up to the compositor whether to - warp the pointer or require some kind of user interaction for the lock - to activate. If the region is null the surface input region is used. - - A surface may receive pointer focus without the lock being activated. - - The request creates a new object wp_locked_pointer which is used to - interact with the lock as well as receive updates about its state. See - the description of wp_locked_pointer for further information. - - Note that while a pointer is locked, the wl_pointer objects of the - corresponding seat will not emit any wl_pointer.motion events, but - relative motion events will still be emitted via wp_relative_pointer - objects of the same seat. wl_pointer.axis and wl_pointer.button events - are unaffected. - - - - - - - - - - - - The confine_pointer request lets the client request to confine the - pointer cursor to a given region. This request may not take effect - immediately; in the future, when the compositor deems implementation- - specific constraints are satisfied, the pointer confinement will be - activated and the compositor sends a confined event. - - The intersection of the region passed with this request and the input - region of the surface is used to determine where the pointer must be - in order for the confinement to activate. It is up to the compositor - whether to warp the pointer or require some kind of user interaction for - the confinement to activate. If the region is null the surface input - region is used. - - The request will create a new object wp_confined_pointer which is used - to interact with the confinement as well as receive updates about its - state. See the description of wp_confined_pointer for further - information. - - - - - - - - - - - - - The wp_locked_pointer interface represents a locked pointer state. - - While the lock of this object is active, the wl_pointer objects of the - associated seat will not emit any wl_pointer.motion events. - - This object will send the event 'locked' when the lock is activated. - Whenever the lock is activated, it is guaranteed that the locked surface - will already have received pointer focus and that the pointer will be - within the region passed to the request creating this object. - - To unlock the pointer, send the destroy request. This will also destroy - the wp_locked_pointer object. - - If the compositor decides to unlock the pointer the unlocked event is - sent. See wp_locked_pointer.unlock for details. - - When unlocking, the compositor may warp the cursor position to the set - cursor position hint. If it does, it will not result in any relative - motion events emitted via wp_relative_pointer. - - If the surface the lock was requested on is destroyed and the lock is not - yet activated, the wp_locked_pointer object is now defunct and must be - destroyed. - - - - - Destroy the locked pointer object. If applicable, the compositor will - unlock the pointer. - - - - - - Set the cursor position hint relative to the top left corner of the - surface. - - If the client is drawing its own cursor, it should update the position - hint to the position of its own cursor. A compositor may use this - information to warp the pointer upon unlock in order to avoid pointer - jumps. - - The cursor position hint is double buffered. The new hint will only take - effect when the associated surface gets it pending state applied. See - wl_surface.commit for details. - - - - - - - - - Set a new region used to lock the pointer. - - The new lock region is double-buffered. The new lock region will - only take effect when the associated surface gets its pending state - applied. See wl_surface.commit for details. - - For details about the lock region, see wp_locked_pointer. - - - - - - - - Notification that the pointer lock of the seat's pointer is activated. - - - - - - Notification that the pointer lock of the seat's pointer is no longer - active. If this is a oneshot pointer lock (see - wp_pointer_constraints.lifetime) this object is now defunct and should - be destroyed. If this is a persistent pointer lock (see - wp_pointer_constraints.lifetime) this pointer lock may again - reactivate in the future. - - - - - - - The wp_confined_pointer interface represents a confined pointer state. - - This object will send the event 'confined' when the confinement is - activated. Whenever the confinement is activated, it is guaranteed that - the surface the pointer is confined to will already have received pointer - focus and that the pointer will be within the region passed to the request - creating this object. It is up to the compositor to decide whether this - requires some user interaction and if the pointer will warp to within the - passed region if outside. - - To unconfine the pointer, send the destroy request. This will also destroy - the wp_confined_pointer object. - - If the compositor decides to unconfine the pointer the unconfined event is - sent. The wp_confined_pointer object is at this point defunct and should - be destroyed. - - - - - Destroy the confined pointer object. If applicable, the compositor will - unconfine the pointer. - - - - - - Set a new region used to confine the pointer. - - The new confine region is double-buffered. The new confine region will - only take effect when the associated surface gets its pending state - applied. See wl_surface.commit for details. - - If the confinement is active when the new confinement region is applied - and the pointer ends up outside of newly applied region, the pointer may - warped to a position within the new confinement region. If warped, a - wl_pointer.motion event will be emitted, but no - wp_relative_pointer.relative_motion event. - - The compositor may also, instead of using the new region, unconfine the - pointer. - - For details about the confine region, see wp_confined_pointer. - - - - - - - - Notification that the pointer confinement of the seat's pointer is - activated. - - - - - - Notification that the pointer confinement of the seat's pointer is no - longer active. If this is a oneshot pointer confinement (see - wp_pointer_constraints.lifetime) this object is now defunct and should - be destroyed. If this is a persistent pointer confinement (see - wp_pointer_constraints.lifetime) this pointer confinement may again - reactivate in the future. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/pointer-gestures-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/pointer-gestures-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/pointer-gestures-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/pointer-gestures-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ - - - - - - A global interface to provide semantic touchpad gestures for a given - pointer. - - Two gestures are currently supported: swipe and zoom/rotate. - All gestures follow a three-stage cycle: begin, update, end and - are identified by a unique id. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - Create a swipe gesture object. See the - wl_pointer_gesture_swipe interface for details. - - - - - - - - Create a pinch gesture object. See the - wl_pointer_gesture_pinch interface for details. - - - - - - - - - A swipe gesture object notifies a client about a multi-finger swipe - gesture detected on an indirect input device such as a touchpad. - The gesture is usually initiated by multiple fingers moving in the - same direction but once initiated the direction may change. - The precise conditions of when such a gesture is detected are - implementation-dependent. - - A gesture consists of three stages: begin, update (optional) and end. - There cannot be multiple simultaneous pinch or swipe gestures on a - same pointer/seat, how compositors prevent these situations is - implementation-dependent. - - A gesture may be cancelled by the compositor or the hardware. - Clients should not consider performing permanent or irreversible - actions until the end of a gesture has been received. - - - - - - - - - This event is sent when a multi-finger swipe gesture is detected - on the device. - - - - - - - - - - This event is sent when a multi-finger swipe gesture changes the - position of the logical center. - - The dx and dy coordinates are relative coordinates of the logical - center of the gesture compared to the previous event. - - - - - - - - - This event is sent when a multi-finger swipe gesture ceases to - be valid. This may happen when one or more fingers are lifted or - the gesture is cancelled. - - When a gesture is cancelled, the client should undo state changes - caused by this gesture. What causes a gesture to be cancelled is - implementation-dependent. - - - - - - - - - - A pinch gesture object notifies a client about a multi-finger pinch - gesture detected on an indirect input device such as a touchpad. - The gesture is usually initiated by multiple fingers moving towards - each other or away from each other, or by two or more fingers rotating - around a logical center of gravity. The precise conditions of when - such a gesture is detected are implementation-dependent. - - A gesture consists of three stages: begin, update (optional) and end. - There cannot be multiple simultaneous pinch or swipe gestures on a - same pointer/seat, how compositors prevent these situations is - implementation-dependent. - - A gesture may be cancelled by the compositor or the hardware. - Clients should not consider performing permanent or irreversible - actions until the end of a gesture has been received. - - - - - - - - - This event is sent when a multi-finger pinch gesture is detected - on the device. - - - - - - - - - - This event is sent when a multi-finger pinch gesture changes the - position of the logical center, the rotation or the relative scale. - - The dx and dy coordinates are relative coordinates in the - surface coordinate space of the logical center of the gesture. - - The scale factor is an absolute scale compared to the - pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers - are now twice as far apart as on pointer_gesture_pinch.begin. - - The rotation is the relative angle in degrees clockwise compared to the previous - pointer_gesture_pinch.begin or pointer_gesture_pinch.update event. - - - - - - - - - - - This event is sent when a multi-finger pinch gesture ceases to - be valid. This may happen when one or more fingers are lifted or - the gesture is cancelled. - - When a gesture is cancelled, the client should undo state changes - caused by this gesture. What causes a gesture to be cancelled is - implementation-dependent. - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/relative-pointer-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/relative-pointer-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/relative-pointer-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/relative-pointer-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ - - - - - Copyright © 2014 Jonas Ådahl - Copyright © 2015 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol specifies a set of interfaces used for making clients able to - receive relative pointer events not obstructed by barriers (such as the - monitor edge or other pointer barriers). - - To start receiving relative pointer events, a client must first bind the - global interface "wp_relative_pointer_manager" which, if a compositor - supports relative pointer motion events, is exposed by the registry. After - having created the relative pointer manager proxy object, the client uses - it to create the actual relative pointer object using the - "get_relative_pointer" request given a wl_pointer. The relative pointer - motion events will then, when applicable, be transmitted via the proxy of - the newly created relative pointer object. See the documentation of the - relative pointer interface for more details. - - Warning! The protocol described in this file is experimental and backward - incompatible changes may be made. Backward compatible changes may be added - together with the corresponding interface version bump. Backward - incompatible changes are done by bumping the version number in the protocol - and interface names and resetting the interface version. Once the protocol - is to be declared stable, the 'z' prefix and the version number in the - protocol and interface names are removed and the interface version number is - reset. - - - - - A global interface used for getting the relative pointer object for a - given pointer. - - - - - Used by the client to notify the server that it will no longer use this - relative pointer manager object. - - - - - - Create a relative pointer interface given a wl_pointer object. See the - wp_relative_pointer interface for more details. - - - - - - - - - - A wp_relative_pointer object is an extension to the wl_pointer interface - used for emitting relative pointer events. It shares the same focus as - wl_pointer objects of the same seat and will only emit events when it has - focus. - - - - - - - - - Relative x/y pointer motion from the pointer of the seat associated with - this object. - - A relative motion is in the same dimension as regular wl_pointer motion - events, except they do not represent an absolute position. For example, - moving a pointer from (x, y) to (x', y') would have the equivalent - relative motion (x' - x, y' - y). If a pointer motion caused the - absolute pointer position to be clipped by for example the edge of the - monitor, the relative motion is unaffected by the clipping and will - represent the unclipped motion. - - This event also contains non-accelerated motion deltas. The - non-accelerated delta is, when applicable, the regular pointer motion - delta as it was before having applied motion acceleration and other - transformations such as normalization. - - Note that the non-accelerated delta does not represent 'raw' events as - they were read from some device. Pointer motion acceleration is device- - and configuration-specific and non-accelerated deltas and accelerated - deltas may have the same value on some devices. - - Relative motions are not coupled to wl_pointer.motion events, and can be - sent in combination with such events, but also independently. There may - also be scenarios where wl_pointer.motion is sent, but there is no - relative motion. The order of an absolute and relative motion event - originating from the same physical motion is not guaranteed. - - If the client needs button events or focus state, it can receive them - from a wl_pointer object of the same seat that the wp_relative_pointer - object is associated with. - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/remote-access.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/remote-access.xml --- dwayland-5.57.0.23/src/client/protocols/remote-access.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/remote-access.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/screencast.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/screencast.xml --- dwayland-5.57.0.23/src/client/protocols/screencast.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/screencast.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - - - - SPDX-License-Identifier: LGPL-2.1-or-later - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - Destroy the zkde_screencast_unstable_v1 object. - - - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/server-decoration-palette.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/server-decoration-palette.xml --- dwayland-5.57.0.23/src/client/protocols/server-decoration-palette.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/server-decoration-palette.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ - - - . - ]]> - -l - This interface allows a client to alter the palette of a server side decoration. - - - - - - - - - This interface allows a client to alter the palette of a server side decoration. - - - - Color scheme that should be applied to the window decoration. - Absolute file path, or name of palette in the user's config directory. - The server may choose not to follow the requested style. - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/server-decoration.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/server-decoration.xml --- dwayland-5.57.0.23/src/client/protocols/server-decoration.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/server-decoration.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ - - - . - ]]> - - - This interface allows to coordinate whether the server should create - a server-side window decoration around a wl_surface representing a - shell surface (wl_shell_surface or similar). By announcing support - for this interface the server indicates that it supports server - side decorations. - - Use in conjunction with zxdg_decoration_manager_v1 is undefined. - - - - When a client creates a server-side decoration object it indicates - that it supports the protocol. The client is supposed to tell the - server whether it wants server-side decorations or will provide - client-side decorations. - - If the client does not create a server-side decoration object for - a surface the server interprets this as lack of support for this - protocol and considers it as client-side decorated. Nevertheless a - client-side decorated surface should use this protocol to indicate - to the server that it does not want a server-side deco. - - - - - - - - - - - - - This event is emitted directly after binding the interface. It contains - the default mode for the decoration. When a new server decoration object - is created this new object will be in the default mode until the first - request_mode is requested. - - The server may change the default mode at any time. - - - - - - - - - - - - - - - - - - - - - This event is emitted directly after the decoration is created and - represents the base decoration policy by the server. E.g. a server - which wants all surfaces to be client-side decorated will send Client, - a server which wants server-side decoration will send Server. - - The client can request a different mode through the decoration request. - The server will acknowledge this by another event with the same mode. So - even if a server prefers server-side decoration it's possible to force a - client-side decoration. - - The server may emit this event at any time. In this case the client can - again request a different mode. It's the responsibility of the server to - prevent a feedback loop. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/shadow.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/shadow.xml --- dwayland-5.57.0.23/src/client/protocols/shadow.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/shadow.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ - - - . - ]]> - - - - - - - - - - - Destroy the org_kde_kwin_shadow_manager object. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Destroy the org_kde_kwin_shadow object. If the org_kde_kwin_shadow is - still set on a wl_surface the shadow will be immediately removed. - Prefer to first call the request unset on the org_kde_kwin_shadow_manager and - commit the wl_surface to apply the change. - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/slide.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/slide.xml --- dwayland-5.57.0.23/src/client/protocols/slide.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/slide.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - Ask the compositor to move the surface from a location to another - with a slide animation. - - The from argument provides a clue about where the slide animation - begins, offset is the distance from screen edge to begin the animation. - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/strut.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/strut.xml --- dwayland-5.57.0.23/src/client/protocols/strut.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/strut.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - . - ]]> - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/client/protocols/surface-extension.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/surface-extension.xml --- dwayland-5.57.0.23/src/client/protocols/surface-extension.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/surface-extension.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ - - - - Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). - Contact: http://www.qt-project.org/legal - - This file is part of the plugins of the Qt Toolkit. - - $QT_BEGIN_LICENSE:BSD$ - You may use this file under the terms of the BSD license as follows: - - "Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names - of its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - - $QT_END_LICENSE$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/text-input-unstable-v2.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/text-input-unstable-v2.xml --- dwayland-5.57.0.23/src/client/protocols/text-input-unstable-v2.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/text-input-unstable-v2.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,478 +0,0 @@ - - - - - Copyright © 2012, 2013 Intel Corporation - Copyright © 2015, 2016 Jan Arne Petersen - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - - - - - The zwp_text_input_v2 interface represents text input and input methods - associated with a seat. It provides enter/leave events to follow the - text input focus for a seat. - - Requests are used to enable/disable the text-input object and set - state information like surrounding and selected text or the content type. - The information about the entered text is sent to the text-input object - via the pre-edit and commit events. Using this interface removes the need - for applications to directly process hardware key events and compose text - out of them. - - Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices - have to always point to the first byte of an UTF-8 encoded code point. - Lengths are not allowed to contain just a part of an UTF-8 encoded code - point. - - State is sent by the state requests (set_surrounding_text, - set_content_type, set_cursor_rectangle and set_preferred_language) and - an update_state request. After an enter or an input_method_change event - all state information is invalidated and needs to be resent from the - client. A reset or entering a new widget on client side also - invalidates all current state information. - - - - - Destroy the wp_text_input object. Also disables all surfaces enabled - through this wp_text_input object - - - - - - Enable text input in a surface (usually when a text entry inside of it - has focus). - - This can be called before or after a surface gets text (or keyboard) - focus via the enter event. Text input to a surface is only active - when it has the current text (or keyboard) focus and is enabled. - - - - - - - Disable text input in a surface (typically when there is no focus on any - text entry inside the surface). - - - - - - - Requests input panels (virtual keyboard) to show. - - This should be used for example to show a virtual keyboard again - (with a tap) after it was closed by pressing on a close button on the - keyboard. - - - - - - Requests input panels (virtual keyboard) to hide. - - - - - - Sets the plain surrounding text around the input position. Text is - UTF-8 encoded. Cursor is the byte offset within the surrounding text. - Anchor is the byte offset of the selection anchor within the - surrounding text. If there is no selected text, anchor is the same as - cursor. - - Make sure to always send some text before and after the cursor - except when the cursor is at the beginning or end of text. - - When there was a configure_surrounding_text event take the - before_cursor and after_cursor arguments into account for picking how - much surrounding text to send. - - There is a maximum length of wayland messages so text can not be - longer than 4000 bytes. - - - - - - - - - Content hint is a bitmask to allow to modify the behavior of the text - input. - - - - - - - - - - - - - - - - - The content purpose allows to specify the primary purpose of a text - input. - - This allows an input method to show special purpose input panels with - extra characters or to disallow some characters. - - - - - - - - - - - - - - - - - - - Sets the content purpose and content hint. While the purpose is the - basic purpose of an input field, the hint flags allow to modify some - of the behavior. - - When no content type is explicitly set, a normal content purpose with - none hint should be assumed. - - - - - - - - Sets the cursor outline as a x, y, width, height rectangle in surface - local coordinates. - - Allows the compositor to put a window with word suggestions near the - cursor. - - - - - - - - - - Sets a specific language. This allows for example a virtual keyboard to - show a language specific layout. The "language" argument is a RFC-3066 - format language tag. - - It could be used for example in a word processor to indicate language of - currently edited document or in an instant message application which - tracks languages of contacts. - - - - - - - Defines the reason for sending an updated state. - - - - - - - - - - Allows to atomically send state updates from client. - - This request should follow after a batch of state updating requests - like set_surrounding_text, set_content_type, set_cursor_rectangle and - set_preferred_language. - - The flags field indicates why an updated state is sent to the input - method. - - Reset should be used by an editor widget after the text was changed - outside of the normal input method flow. - - For "change" it is enough to send the changed state, else the full - state should be send. - - Serial should be set to the serial from the last enter or - input_method_changed event. - - To make sure to not receive outdated input method events after a - reset or switching to a new widget wl_display_sync() should be used - after update_state in these cases. - - - - - - - - Notification that this seat's text-input focus is on a certain surface. - - When the seat has the keyboard capability the text-input focus follows - the keyboard focus. - - - - - - - - Notification that this seat's text-input focus is no longer on - a certain surface. - - The leave notification is sent before the enter notification - for the new focus. - - When the seat has the keyboard capabillity the text-input focus follows - the keyboard focus. - - - - - - - - - - - - - Notification that the visibility of the input panel (virtual keyboard) - changed. - - The rectangle x, y, width, height defines the area overlapped by the - input panel (virtual keyboard) on the surface having the text - focus in surface local coordinates. - - That can be used to make sure widgets are visible and not covered by - a virtual keyboard. - - - - - - - - - - - Notify when a new composing text (pre-edit) should be set around the - current cursor position. Any previously set composing text should - be removed. - - The commit text can be used to replace the composing text in some cases - (for example when losing focus). - - The text input should also handle all preedit_style and preedit_cursor - events occurring directly before preedit_string. - - - - - - - - - - - - - - - - - - - Sets styling information on composing text. The style is applied for - length bytes from index relative to the beginning of the composing - text (as byte offset). Multiple styles can be applied to a composing - text by sending multiple preedit_styling events. - - This event is handled as part of a following preedit_string event. - - - - - - - - - Sets the cursor position inside the composing text (as byte - offset) relative to the start of the composing text. When index is a - negative number no cursor is shown. - - When no preedit_cursor event is sent the cursor will be at the end of - the composing text by default. - - This event is handled as part of a following preedit_string event. - - - - - - - Notify when text should be inserted into the editor widget. The text to - commit could be either just a single character after a key press or the - result of some composing (pre-edit). It could be also an empty text - when some text should be removed (see delete_surrounding_text) or when - the input cursor should be moved (see cursor_position). - - Any previously set composing text should be removed. - - - - - - - Notify when the cursor or anchor position should be modified. - - This event should be handled as part of a following commit_string - event. - - The text between anchor and index should be selected. - - - - - - - - Notify when the text around the current cursor position should be - deleted. BeforeLength and afterLength is the length (in bytes) of text - before and after the current cursor position (excluding the selection) - to delete. - - This event should be handled as part of a following commit_string - or preedit_string event. - - - - - - - - Transfer an array of 0-terminated modifiers names. The position in - the array is the index of the modifier as used in the modifiers - bitmask in the keysym event. - - - - - - - Notify when a key event was sent. Key events should not be used - for normal text input operations, which should be done with - commit_string, delete_surrounding_text, etc. The key event follows - the wl_keyboard key event convention. Sym is a XKB keysym, state a - wl_keyboard key_state. Modifiers are a mask for effective modifiers - (where the modifier indices are set by the modifiers_map event) - - - - - - - - - - Sets the language of the input text. The "language" argument is a RFC-3066 - format language tag. - - - - - - - - - - - - - Sets the text direction of input text. - - It is mainly needed for showing input cursor on correct side of the - editor when there is no input yet done and making sure neutral - direction text is laid out properly. - - - - - - - Configure what amount of surrounding text is expected by the - input method. The surrounding text will be sent in the - set_surrounding_text request on the following state information updates. - - - - - - - - The input method changed on compositor side, which invalidates all - current state information. New state information should be sent from - the client via state requests (set_surrounding_text, - set_content_hint, ...) and update_state. - - - - - - - - - A factory for text-input objects. This object is a global singleton. - - - - - Destroy the wp_text_input_manager object. - - - - - - Creates a new text-input object for a given seat. - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/text-input.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/text-input.xml --- dwayland-5.57.0.23/src/client/protocols/text-input.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/text-input.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,346 +0,0 @@ - - - - - Copyright © 2012, 2013 Intel Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - - - - - An object used for text input. Adds support for text input and input - methods to applications. A text-input object is created from a - wl_text_input_manager and corresponds typically to a text entry in an - application. - Requests are used to activate/deactivate the text-input object and set - state information like surrounding and selected text or the content type. - The information about entered text is sent to the text-input object via - the pre-edit and commit events. Using this interface removes the need - for applications to directly process hardware key events and compose text - out of them. - - Text is generally UTF-8 encoded, indices and lengths are in bytes. - - Serials are used to synchronize the state between the text input and - an input method. New serials are sent by the text input in the - commit_state request and are used by the input method to indicate - the known text input state in events like preedit_string, commit_string, - and keysym. The text input can then ignore events from the input method - which are based on an outdated state (for example after a reset). - - - - Requests the text-input object to be activated (typically when the - text entry gets focus). - The seat argument is a wl_seat which maintains the focus for this - activation. The surface argument is a wl_surface assigned to the - text-input object and tracked for focus lost. The enter event - is emitted on successful activation. - - - - - - - Requests the text-input object to be deactivated (typically when the - text entry lost focus). The seat argument is a wl_seat which was used - for activation. - - - - - - Requests input panels (virtual keyboard) to show. - - - - - Requests input panels (virtual keyboard) to hide. - - - - - Should be called by an editor widget when the input state should be - reset, for example after the text was changed outside of the normal - input method flow. - - - - - Sets the plain surrounding text around the input position. Text is - UTF-8 encoded. Cursor is the byte offset within the - surrounding text. Anchor is the byte offset of the - selection anchor within the surrounding text. If there is no selected - text anchor is the same as cursor. - - - - - - - - Content hint is a bitmask to allow to modify the behavior of the text - input. - - - - - - - - - - - - - - - - - - The content purpose allows to specify the primary purpose of a text - input. - - This allows an input method to show special purpose input panels with - extra characters or to disallow some characters. - - - - - - - - - - - - - - - - - - Sets the content purpose and content hint. While the purpose is the - basic purpose of an input field, the hint flags allow to modify some - of the behavior. - - When no content type is explicitly set, a normal content purpose with - default hints (auto completion, auto correction, auto capitalization) - should be assumed. - - - - - - - - - - - - - Sets a specific language. This allows for example a virtual keyboard to - show a language specific layout. The "language" argument is a RFC-3066 - format language tag. - - It could be used for example in a word processor to indicate language of - currently edited document or in an instant message application which tracks - languages of contacts. - - - - - - - - - - - - - Notify the text-input object when it received focus. Typically in - response to an activate request. - - - - - - Notify the text-input object when it lost focus. Either in response - to a deactivate request or when the assigned surface lost focus or was - destroyed. - - - - - Transfer an array of 0-terminated modifiers names. The position in - the array is the index of the modifier as used in the modifiers - bitmask in the keysym event. - - - - - - Notify when the visibility state of the input panel changed. - - - - - - Notify when a new composing text (pre-edit) should be set around the - current cursor position. Any previously set composing text should - be removed. - - The commit text can be used to replace the preedit text on reset - (for example on unfocus). - - The text input should also handle all preedit_style and preedit_cursor - events occuring directly before preedit_string. - - - - - - - - - - - - - - - - - - Sets styling information on composing text. The style is applied for - length bytes from index relative to the beginning of the composing - text (as byte offset). Multiple styles can - be applied to a composing text by sending multiple preedit_styling - events. - - This event is handled as part of a following preedit_string event. - - - - - - - - Sets the cursor position inside the composing text (as byte - offset) relative to the start of the composing text. When index is a - negative number no cursor is shown. - - This event is handled as part of a following preedit_string event. - - - - - - Notify when text should be inserted into the editor widget. The text to - commit could be either just a single character after a key press or the - result of some composing (pre-edit). It could be also an empty text - when some text should be removed (see delete_surrounding_text) or when - the input cursor should be moved (see cursor_position). - - Any previously set composing text should be removed. - - - - - - - Notify when the cursor or anchor position should be modified. - - This event should be handled as part of a following commit_string - event. - - - - - - - Notify when the text around the current cursor position should be - deleted. - - Index is relative to the current cursor (in bytes). - Length is the length of deleted text (in bytes). - - This event should be handled as part of a following commit_string - event. - - - - - - - Notify when a key event was sent. Key events should not be used - for normal text input operations, which should be done with - commit_string, delete_surrounding_text, etc. The key event follows - the wl_keyboard key event convention. Sym is a XKB keysym, state a - wl_keyboard key_state. Modifiers are a mask for effective modifiers - (where the modifier indices are set by the modifiers_map event) - - - - - - - - - - Sets the language of the input text. The "language" argument is a RFC-3066 - format language tag. - - - - - - - - - - - - Sets the text direction of input text. - - It is mainly needed for showing input cursor on correct side of the - editor when there is no input yet done and making sure neutral - direction text is laid out properly. - - - - - - - - - A factory for text-input objects. This object is a global singleton. - - - - Creates a new text-input object. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/wlr-data-control-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/wlr-data-control-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/wlr-data-control-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/wlr-data-control-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,279 +0,0 @@ - - - - Copyright © 2018 Simon Ser - Copyright © 2019 Ivan Molodetskikh - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - - - - This protocol allows a privileged client to control data devices. In - particular, the client will be able to manage the current selection and take - the role of a clipboard manager. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - This interface is a manager that allows creating per-seat data device - controls. - - - - - Create a new data source. - - - - - - - Create a data device that can be used to manage a seat's selection. - - - - - - - - All objects created by the manager will still remain valid, until their - appropriate destroy request has been called. - - - - - - - This interface allows a client to manage a seat's selection. - - When the seat is destroyed, this object becomes inert. - - - - - This request asks the compositor to set the selection to the data from - the source on behalf of the client. - - The given source may not be used in any further set_selection or - set_primary_selection requests. Attempting to use a previously used - source is a protocol error. - - To unset the selection, set the source to NULL. - - - - - - - Destroys the data device object. - - - - - - The data_offer event introduces a new wlr_data_control_offer object, - which will subsequently be used in either the - wlr_data_control_device.selection event (for the regular clipboard - selections) or the wlr_data_control_device.primary_selection event (for - the primary clipboard selections). Immediately following the - wlr_data_control_device.data_offer event, the new data_offer object - will send out wlr_data_control_offer.offer events to describe the MIME - types it offers. - - - - - - - The selection event is sent out to notify the client of a new - wlr_data_control_offer for the selection for this device. The - wlr_data_control_device.data_offer and the wlr_data_control_offer.offer - events are sent out immediately before this event to introduce the data - offer object. The selection event is sent to a client when a new - selection is set. The wlr_data_control_offer is valid until a new - wlr_data_control_offer or NULL is received. The client must destroy the - previous selection wlr_data_control_offer, if any, upon receiving this - event. - - The first selection event is sent upon binding the - wlr_data_control_device object. - - - - - - - This data control object is no longer valid and should be destroyed by - the client. - - - - - - - - The primary_selection event is sent out to notify the client of a new - wlr_data_control_offer for the primary selection for this device. The - wlr_data_control_device.data_offer and the wlr_data_control_offer.offer - events are sent out immediately before this event to introduce the data - offer object. The primary_selection event is sent to a client when a - new primary selection is set. The wlr_data_control_offer is valid until - a new wlr_data_control_offer or NULL is received. The client must - destroy the previous primary selection wlr_data_control_offer, if any, - upon receiving this event. - - If the compositor supports primary selection, the first - primary_selection event is sent upon binding the - wlr_data_control_device object. - - - - - - - This request asks the compositor to set the primary selection to the - data from the source on behalf of the client. - - The given source may not be used in any further set_selection or - set_primary_selection requests. Attempting to use a previously used - source is a protocol error. - - To unset the primary selection, set the source to NULL. - - The compositor will ignore this request if it does not support primary - selection. - - - - - - - - - - - - The wlr_data_control_source object is the source side of a - wlr_data_control_offer. It is created by the source client in a data - transfer and provides a way to describe the offered data and a way to - respond to requests to transfer the data. - - - - - - - - - This request adds a MIME type to the set of MIME types advertised to - targets. Can be called several times to offer multiple types. - - Calling this after wlr_data_control_device.set_selection is a protocol - error. - - - - - - - Destroys the data source object. - - - - - - Request for data from the client. Send the data as the specified MIME - type over the passed file descriptor, then close it. - - - - - - - - This data source is no longer valid. The data source has been replaced - by another data source. - - The client should clean up and destroy this data source. - - - - - - - A wlr_data_control_offer represents a piece of data offered for transfer - by another client (the source client). The offer describes the different - MIME types that the data can be converted to and provides the mechanism - for transferring the data directly from the source client. - - - - - To transfer the offered data, the client issues this request and - indicates the MIME type it wants to receive. The transfer happens - through the passed file descriptor (typically created with the pipe - system call). The source client writes the data in the MIME type - representation requested and then closes the file descriptor. - - The receiving client reads from the read end of the pipe until EOF and - then closes its end, at which point the transfer is complete. - - This request may happen multiple times for different MIME types. - - - - - - - - Destroys the data offer object. - - - - - - Sent immediately after creating the wlr_data_control_offer object. - One event per offered MIME type. - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/wp-primary-selection-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/wp-primary-selection-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/wp-primary-selection-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/wp-primary-selection-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ - - - - Copyright © 2015, 2016 Red Hat - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol provides the ability to have a primary selection device to - match that of the X server. This primary selection is a shortcut to the - common clipboard selection, where text just needs to be selected in order - to allow copying it elsewhere. The de facto way to perform this action - is the middle mouse button, although it is not limited to this one. - - Clients wishing to honor primary selection should create a primary - selection source and set it as the selection through - wp_primary_selection_device.set_selection whenever the text selection - changes. In order to minimize calls in pointer-driven text selection, - it should happen only once after the operation finished. Similarly, - a NULL source should be set when text is unselected. - - wp_primary_selection_offer objects are first announced through the - wp_primary_selection_device.data_offer event. Immediately after this event, - the primary data offer will emit wp_primary_selection_offer.offer events - to let know of the mime types being offered. - - When the primary selection changes, the client with the keyboard focus - will receive wp_primary_selection_device.selection events. Only the client - with the keyboard focus will receive such events with a non-NULL - wp_primary_selection_offer. Across keyboard focus changes, previously - focused clients will receive wp_primary_selection_device.events with a - NULL wp_primary_selection_offer. - - In order to request the primary selection data, the client must pass - a recent serial pertaining to the press event that is triggering the - operation, if the compositor deems the serial valid and recent, the - wp_primary_selection_source.send event will happen in the other end - to let the transfer begin. The client owning the primary selection - should write the requested data, and close the file descriptor - immediately. - - If the primary selection owner client disappeared during the transfer, - the client reading the data will receive a - wp_primary_selection_device.selection event with a NULL - wp_primary_selection_offer, the client should take this as a hint - to finish the reads related to the no longer existing offer. - - The primary selection owner should be checking for errors during - writes, merely cancelling the ongoing transfer if any happened. - - - - - The primary selection device manager is a singleton global object that - provides access to the primary selection. It allows to create - wp_primary_selection_source objects, as well as retrieving the per-seat - wp_primary_selection_device objects. - - - - - Create a new primary selection source. - - - - - - - Create a new data device for a given seat. - - - - - - - - Destroy the primary selection device manager. - - - - - - - - Replaces the current selection. The previous owner of the primary - selection will receive a wp_primary_selection_source.cancelled event. - - To unset the selection, set the source to NULL. - - - - - - - - Introduces a new wp_primary_selection_offer object that may be used - to receive the current primary selection. Immediately following this - event, the new wp_primary_selection_offer object will send - wp_primary_selection_offer.offer events to describe the offered mime - types. - - - - - - - The wp_primary_selection_device.selection event is sent to notify the - client of a new primary selection. This event is sent after the - wp_primary_selection.data_offer event introducing this object, and after - the offer has announced its mimetypes through - wp_primary_selection_offer.offer. - - The data_offer is valid until a new offer or NULL is received - or until the client loses keyboard focus. The client must destroy the - previous selection data_offer, if any, upon receiving this event. - - - - - - - Destroy the primary selection device. - - - - - - - A wp_primary_selection_offer represents an offer to transfer the contents - of the primary selection clipboard to the client. Similar to - wl_data_offer, the offer also describes the mime types that the data can - be converted to and provides the mechanisms for transferring the data - directly to the client. - - - - - To transfer the contents of the primary selection clipboard, the client - issues this request and indicates the mime type that it wants to - receive. The transfer happens through the passed file descriptor - (typically created with the pipe system call). The source client writes - the data in the mime type representation requested and then closes the - file descriptor. - - The receiving client reads from the read end of the pipe until EOF and - closes its end, at which point the transfer is complete. - - - - - - - - Destroy the primary selection offer. - - - - - - Sent immediately after creating announcing the - wp_primary_selection_offer through - wp_primary_selection_device.data_offer. One event is sent per offered - mime type. - - - - - - - - The source side of a wp_primary_selection_offer, it provides a way to - describe the offered data and respond to requests to transfer the - requested contents of the primary selection clipboard. - - - - - This request adds a mime type to the set of mime types advertised to - targets. Can be called several times to offer multiple types. - - - - - - - Destroy the primary selection source. - - - - - - Request for the current primary selection contents from the client. - Send the specified mime type over the passed file descriptor, then - close it. - - - - - - - - This primary selection source is no longer valid. The client should - clean up and destroy this primary selection source. - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-decoration-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-decoration-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-decoration-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-decoration-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ - - - - Copyright © 2018 Simon Ser - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - This interface allows a compositor to announce support for server-side - decorations. - - A window decoration is a set of window controls as deemed appropriate by - the party managing them, such as user interface components used to move, - resize and change a window's state. - - A client can use this protocol to request being decorated by a supporting - compositor. - - If compositor and client do not negotiate the use of a server-side - decoration using this protocol, clients continue to self-decorate as they - see fit. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible changes - may be added together with the corresponding interface version bump. - Backward incompatible changes are done by bumping the version number in - the protocol and interface names and resetting the interface version. - Once the protocol is to be declared stable, the 'z' prefix and the - version number in the protocol and interface names are removed and the - interface version number is reset. - - - - - Destroy the decoration manager. This doesn't destroy objects created - with the manager. - - - - - - Create a new decoration object associated with the given toplevel. - - Creating an xdg_toplevel_decoration from an xdg_toplevel which has a - buffer attached or committed is a client error, and any attempts by a - client to attach or manipulate a buffer prior to the first - xdg_toplevel_decoration.configure event must also be treated as - errors. - - - - - - - - - The decoration object allows the compositor to toggle server-side window - decorations for a toplevel surface. The client can request to switch to - another mode. - - The xdg_toplevel_decoration object must be destroyed before its - xdg_toplevel. - - - - - - - - - - - Switch back to a mode without any server-side decorations at the next - commit. - - - - - - These values describe window decoration modes. - - - - - - - - Set the toplevel surface decoration mode. This informs the compositor - that the client prefers the provided decoration mode. - - After requesting a decoration mode, the compositor will respond by - emitting a xdg_surface.configure event. The client should then update - its content, drawing it without decorations if the received mode is - server-side decorations. The client must also acknowledge the configure - when committing the new content (see xdg_surface.ack_configure). - - The compositor can decide not to use the client's mode and enforce a - different mode instead. - - Clients whose decoration mode depend on the xdg_toplevel state may send - a set_mode request in response to a xdg_surface.configure event and wait - for the next xdg_surface.configure event to prevent unwanted state. - Such clients are responsible for preventing configure loops and must - make sure not to send multiple successive set_mode requests with the - same decoration mode. - - - - - - - Unset the toplevel surface decoration mode. This informs the compositor - that the client doesn't prefer a particular decoration mode. - - This request has the same semantics as set_mode. - - - - - - The configure event asks the client to change its decoration mode. The - configured state should not be applied immediately. Clients must send an - ack_configure in response to this event. See xdg_surface.configure and - xdg_surface.ack_configure for details. - - A configure event can be sent at any time. The specified mode must be - obeyed by the client. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-foreign-unstable-v2.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-foreign-unstable-v2.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-foreign-unstable-v2.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-foreign-unstable-v2.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,182 +0,0 @@ - - - - - Copyright © 2015-2016 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol specifies a way for making it possible to reference a surface - of a different client. With such a reference, a client can, by using the - interfaces provided by this protocol, manipulate the relationship between - its own surfaces and the surface of some other client. For example, stack - some of its own surface above the other clients surface. - - In order for a client A to get a reference of a surface of client B, client - B must first export its surface using xdg_exporter.export_toplevel. Upon - doing this, client B will receive a handle (a unique string) that it may - share with client A in some way (for example D-Bus). After client A has - received the handle from client B, it may use xdg_importer.import_toplevel - to create a reference to the surface client B just exported. See the - corresponding requests for details. - - A possible use case for this is out-of-process dialogs. For example when a - sandboxed client without file system access needs the user to select a file - on the file system, given sandbox environment support, it can export its - surface, passing the exported surface handle to an unsandboxed process that - can show a file browser dialog and stack it above the sandboxed client's - surface. - - Warning! The protocol described in this file is experimental and backward - incompatible changes may be made. Backward compatible changes may be added - together with the corresponding interface version bump. Backward - incompatible changes are done by bumping the version number in the protocol - and interface names and resetting the interface version. Once the protocol - is to be declared stable, the 'z' prefix and the version number in the - protocol and interface names are removed and the interface version number is - reset. - - - - - A global interface used for exporting surfaces that can later be imported - using xdg_importer. - - - - - Notify the compositor that the xdg_exporter object will no longer be - used. - - - - - - The export_toplevel request exports the passed surface so that it can later be - imported via xdg_importer. When called, a new xdg_exported object will - be created and xdg_exported.handle will be sent immediately. See the - corresponding interface and event for details. - - A surface may be exported multiple times, and each exported handle may - be used to create a xdg_imported multiple times. Only xdg_toplevel - equivalent surfaces may be exported. - - - - - - - - - A global interface used for importing surfaces exported by xdg_exporter. - With this interface, a client can create a reference to a surface of - another client. - - - - - Notify the compositor that the xdg_importer object will no longer be - used. - - - - - - The import_toplevel request imports a surface from any client given a handle - retrieved by exporting said surface using xdg_exporter.export_toplevel. - When called, a new xdg_imported object will be created. This new object - represents the imported surface, and the importing client can - manipulate its relationship using it. See xdg_imported for details. - - - - - - - - - A xdg_exported object represents an exported reference to a surface. The - exported surface may be referenced as long as the xdg_exported object not - destroyed. Destroying the xdg_exported invalidates any relationship the - importer may have established using xdg_imported. - - - - - Revoke the previously exported surface. This invalidates any - relationship the importer may have set up using the xdg_imported created - given the handle sent via xdg_exported.handle. - - - - - - The handle event contains the unique handle of this exported surface - reference. It may be shared with any client, which then can use it to - import the surface by calling xdg_importer.import_toplevel. A handle - may be used to import the surface multiple times. - - - - - - - - A xdg_imported object represents an imported reference to surface exported - by some client. A client can use this interface to manipulate - relationships between its own surfaces and the imported surface. - - - - - Notify the compositor that it will no longer use the xdg_imported - object. Any relationship that may have been set up will at this point - be invalidated. - - - - - - Set the imported surface as the parent of some surface of the client. - The passed surface must be a xdg_toplevel equivalent. Calling this - function sets up a surface to surface relation with the same stacking - and positioning semantics as xdg_toplevel.set_parent. - - - - - - - The imported surface handle has been destroyed and any relationship set - up has been invalidated. This may happen for various reasons, for - example if the exported surface or the exported surface handle has been - destroyed, if the handle used for importing was invalid. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-output-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-output-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-output-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-output-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ - - - - - Copyright © 2017 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol aims at describing outputs in a way which is more in line - with the concept of an output on desktop oriented systems. - - Some information are more specific to the concept of an output for - a desktop oriented system and may not make sense in other applications, - such as IVI systems for example. - - Typically, the global compositor space on a desktop system is made of - a contiguous or overlapping set of rectangular regions. - - Some of the information provided in this protocol might be identical - to their counterparts already available from wl_output, in which case - the information provided by this protocol should be preferred to their - equivalent in wl_output. The goal is to move the desktop specific - concepts (such as output location within the global compositor space, - the connector name and types, etc.) out of the core wl_output protocol. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible - changes may be added together with the corresponding interface - version bump. - Backward incompatible changes are done by bumping the version - number in the protocol and interface names and resetting the - interface version. Once the protocol is to be declared stable, - the 'z' prefix and the version number in the protocol and - interface names are removed and the interface version number is - reset. - - - - - A global factory interface for xdg_output objects. - - - - - Using this request a client can tell the server that it is not - going to use the xdg_output_manager object anymore. - - Any objects already created through this instance are not affected. - - - - - - This creates a new xdg_output object for the given wl_output. - - - - - - - - - An xdg_output describes part of the compositor geometry. - - This typically corresponds to a monitor that displays part of the - compositor space. - - For objects version 3 onwards, after all xdg_output properties have been - sent (when the object is created and when properties are updated), a - wl_output.done event is sent. This allows changes to the output - properties to be seen as atomic, even if they happen via multiple events. - - - - - Using this request a client can tell the server that it is not - going to use the xdg_output object anymore. - - - - - - The position event describes the location of the wl_output within - the global compositor space. - - The logical_position event is sent after creating an xdg_output - (see xdg_output_manager.get_xdg_output) and whenever the location - of the output changes within the global compositor space. - - - - - - - - The logical_size event describes the size of the output in the - global compositor space. - - For example, a surface without any buffer scale, transformation - nor rotation set, with the size matching the logical_size will - have the same size as the corresponding output when displayed. - - Most regular Wayland clients should not pay attention to the - logical size and would rather rely on xdg_shell interfaces. - - Some clients such as Xwayland, however, need this to configure - their surfaces in the global compositor space as the compositor - may apply a different scale from what is advertised by the output - scaling property (to achieve fractional scaling, for example). - - For example, for a wl_output mode 3840×2160 and a scale factor 2: - - - A compositor not scaling the surface buffers will advertise a - logical size of 3840×2160, - - - A compositor automatically scaling the surface buffers will - advertise a logical size of 1920×1080, - - - A compositor using a fractional scale of 1.5 will advertise a - logical size of 2560×1440. - - For example, for a wl_output mode 1920×1080 and a 90 degree rotation, - the compositor will advertise a logical size of 1080x1920. - - The logical_size event is sent after creating an xdg_output - (see xdg_output_manager.get_xdg_output) and whenever the logical - size of the output changes, either as a result of a change in the - applied scale or because of a change in the corresponding output - mode(see wl_output.mode) or transform (see wl_output.transform). - - - - - - - - This event is sent after all other properties of an xdg_output - have been sent. - - This allows changes to the xdg_output properties to be seen as - atomic, even if they happen via multiple events. - - For objects version 3 onwards, this event is deprecated. Compositors - are not required to send it anymore and must send wl_output.done - instead. - - - - - - - - Many compositors will assign names to their outputs, show them to the - user, allow them to be configured by name, etc. The client may wish to - know this name as well to offer the user similar behaviors. - - The naming convention is compositor defined, but limited to - alphanumeric characters and dashes (-). Each name is unique among all - wl_output globals, but if a wl_output global is destroyed the same name - may be reused later. The names will also remain consistent across - sessions with the same hardware and software configuration. - - Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do - not assume that the name is a reflection of an underlying DRM - connector, X11 connection, etc. - - The name event is sent after creating an xdg_output (see - xdg_output_manager.get_xdg_output). This event is only sent once per - xdg_output, and the name does not change over the lifetime of the - wl_output global. - - - - - - - Many compositors can produce human-readable descriptions of their - outputs. The client may wish to know this description as well, to - communicate the user for various purposes. - - The description is a UTF-8 string with no convention defined for its - contents. Examples might include 'Foocorp 11" Display' or 'Virtual X11 - output via :1'. - - The description event is sent after creating an xdg_output (see - xdg_output_manager.get_xdg_output) and whenever the description - changes. The description is optional, and may not be sent at all. - - For objects of version 2 and lower, this event is only sent once per - xdg_output, and the description does not change over the lifetime of - the wl_output global. - - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-shell-unstable-v5.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell-unstable-v5.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-shell-unstable-v5.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell-unstable-v5.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,625 +0,0 @@ - - - - - Copyright © 2008-2013 Kristian Høgsberg - Copyright © 2013 Rafael Antognolli - Copyright © 2013 Jasper St. Pierre - Copyright © 2010-2013 Intel Corporation - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - xdg_shell allows clients to turn a wl_surface into a "real window" - which can be dragged, resized, stacked, and moved around by the - user. Everything about this interface is suited towards traditional - desktop environments. - - - - - The 'current' member of this enum gives the version of the - protocol. Implementations can compare this to the version - they implement using static_assert to ensure the protocol and - implementation versions match. - - - - - - - - - - - - - - Destroy this xdg_shell object. - - Destroying a bound xdg_shell object while there are surfaces - still alive created by this xdg_shell object instance is illegal - and will result in a protocol error. - - - - - - Negotiate the unstable version of the interface. This - mechanism is in place to ensure client and server agree on the - unstable versions of the protocol that they speak or exit - cleanly if they don't agree. This request will go away once - the xdg-shell protocol is stable. - - - - - - - This creates an xdg_surface for the given surface and gives it the - xdg_surface role. A wl_surface can only be given an xdg_surface role - once. If get_xdg_surface is called with a wl_surface that already has - an active xdg_surface associated with it, or if it had any other role, - an error is raised. - - See the documentation of xdg_surface for more details about what an - xdg_surface is and how it is used. - - - - - - - - This creates an xdg_popup for the given surface and gives it the - xdg_popup role. A wl_surface can only be given an xdg_popup role - once. If get_xdg_popup is called with a wl_surface that already has - an active xdg_popup associated with it, or if it had any other role, - an error is raised. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. - - See the documentation of xdg_popup for more details about what an - xdg_popup is and how it is used. - - - - - - - - - - - - - The ping event asks the client if it's still alive. Pass the - serial specified in the event back to the compositor by sending - a "pong" request back with the specified serial. - - Compositors can use this to determine if the client is still - alive. It's unspecified what will happen if the client doesn't - respond to the ping request, or in what timeframe. Clients should - try to respond in a reasonable amount of time. - - A compositor is free to ping in any way it wants, but a client must - always respond to any xdg_shell object it created. - - - - - - - A client must respond to a ping event with a pong request or - the client may be deemed unresponsive. - - - - - - - - An interface that may be implemented by a wl_surface, for - implementations that provide a desktop-style user interface. - - It provides requests to treat surfaces like windows, allowing to set - properties like maximized, fullscreen, minimized, and to move and resize - them, and associate metadata like title and app id. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_surface state to take effect. Prior to committing the new - state, it can set up initial configuration, such as maximizing or setting - a window geometry. - - Even without attaching a buffer the compositor must respond to initial - committed configuration, for instance sending a configure event with - expected window geometry if the client maximized its surface during - initialization. - - For a surface to be mapped by the compositor the client must have - committed both an xdg_surface state and a buffer. - - - - - Unmap and destroy the window. The window will be effectively - hidden from the user's point of view, and all state like - maximization, fullscreen, and so on, will be lost. - - - - - - Set the "parent" of this surface. This window should be stacked - above a parent. The parent surface must be mapped as long as this - surface is mapped. - - Parent windows should be set on dialogs, toolboxes, or other - "auxiliary" surfaces, so that the parent is raised when the dialog - is raised. - - - - - - - Set a short title for the surface. - - This string may be used to identify the surface in a task bar, - window list, or other user interface elements provided by the - compositor. - - The string must be encoded in UTF-8. - - - - - - - Set an application identifier for the surface. - - The app ID identifies the general class of applications to which - the surface belongs. The compositor can use this to group multiple - surfaces together, or to determine how to launch a new application. - - For D-Bus activatable applications, the app ID is used as the D-Bus - service name. - - The compositor shell will try to group application surfaces together - by their app ID. As a best practice, it is suggested to select app - ID's that match the basename of the application's .desktop file. - For example, "org.freedesktop.FooViewer" where the .desktop file is - "org.freedesktop.FooViewer.desktop". - - See the desktop-entry specification [0] for more details on - application identifiers and how they relate to well-known D-Bus - names and .desktop files. - - [0] http://standards.freedesktop.org/desktop-entry-spec/ - - - - - - - Clients implementing client-side decorations might want to show - a context menu when right-clicking on the decorations, giving the - user a menu that they can use to maximize or minimize the window. - - This request asks the compositor to pop up such a window menu at - the given position, relative to the local surface coordinates of - the parent surface. There are no guarantees as to what menu items - the window menu contains. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. - - - - - - - - - - - Start an interactive, user-driven move of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive move (touch, - pointer, etc). - - The server may ignore move requests depending on the state of - the surface (e.g. fullscreen or maximized), or if the passed serial - is no longer valid. - - If triggered, the surface will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the move. It is up to the - compositor to visually indicate that the move is taking place, such as - updating a pointer cursor, during the move. There is no guarantee - that the device focus will return when the move is completed. - - - - - - - - These values are used to indicate which edge of a surface - is being dragged in a resize operation. - - - - - - - - - - - - - - - Start a user-driven, interactive resize of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive resize (touch, - pointer, etc). - - The server may ignore resize requests depending on the state of - the surface (e.g. fullscreen or maximized). - - If triggered, the client will receive configure events with the - "resize" state enum value and the expected sizes. See the "resize" - enum value for more details about what is required. The client - must also acknowledge configure events using "ack_configure". After - the resize is completed, the client will receive another "configure" - event without the resize state. - - If triggered, the surface also will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the resize. It is up to the - compositor to visually indicate that the resize is taking place, - such as updating a pointer cursor, during the resize. There is no - guarantee that the device focus will return when the resize is - completed. - - The edges parameter specifies how the surface should be resized, - and is one of the values of the resize_edge enum. The compositor - may use this information to update the surface position for - example when dragging the top left corner. The compositor may also - use this information to adapt its behavior, e.g. choose an - appropriate cursor image. - - - - - - - - - The different state values used on the surface. This is designed for - state values like maximized, fullscreen. It is paired with the - configure event to ensure that both the client and the compositor - setting the state can be synchronized. - - States set in this way are double-buffered. They will get applied on - the next commit. - - Desktop environments may extend this enum by taking up a range of - values and documenting the range they chose in this description. - They are not required to document the values for the range that they - chose. Ideally, any good extensions from a desktop environment should - make its way into standardization into this enum. - - The current reserved ranges are: - - 0x0000 - 0x0FFF: xdg-shell core values, documented below. - 0x1000 - 0x1FFF: GNOME - 0x2000 - 0x2FFF: EFL - - - - The surface is maximized. The window geometry specified in the configure - event must be obeyed by the client. - - - - - The surface is fullscreen. The window geometry specified in the configure - event must be obeyed by the client. - - - - - The surface is being resized. The window geometry specified in the - configure event is a maximum; the client cannot resize beyond it. - Clients that have aspect ratio or cell sizing configuration can use - a smaller size, however. - - - - - Client window decorations should be painted as if the window is - active. Do not assume this means that the window actually has - keyboard or pointer focus. - - - - - - - The configure event asks the client to resize its surface or to - change its state. - - The width and height arguments specify a hint to the window - about how its surface should be resized in window geometry - coordinates. See set_window_geometry. - - If the width or height arguments are zero, it means the client - should decide its own window dimension. This may happen when the - compositor need to configure the state of the surface but doesn't - have any information about any previous or expected dimension. - - The states listed in the event specify how the width/height - arguments should be interpreted, and possibly how it should be - drawn. - - Clients should arrange their surface for the new size and - states, and then send a ack_configure request with the serial - sent in this configure event at some point before committing - the new surface. - - If the client receives multiple configure events before it - can respond to one, it is free to discard all but the last - event it received. - - - - - - - - - - - When a configure event is received, if a client commits the - surface in response to the configure event, then the client - must make an ack_configure request sometime before the commit - request, passing along the serial of the configure event. - - For instance, the compositor might use this information to move - a surface to the top left only when the client has drawn itself - for the maximized or fullscreen state. - - If the client receives multiple configure events before it - can respond to one, it only has to ack the last configure event. - - A client is not required to commit immediately after sending - an ack_configure request - it may even ack_configure several times - before its next surface commit. - - The compositor expects that the most recently received - ack_configure request at the time of a commit indicates which - configure event the client is responding to. - - - - - - - The window geometry of a window is its "visible bounds" from the - user's perspective. Client-side decorations often have invisible - portions like drop-shadows which should be ignored for the - purposes of aligning, placing and constraining windows. - - The window geometry is double buffered, and will be applied at the - time wl_surface.commit of the corresponding wl_surface is called. - - Once the window geometry of the surface is set once, it is not - possible to unset it, and it will remain the same until - set_window_geometry is called again, even if a new subsurface or - buffer is attached. - - If never set, the value is the full bounds of the surface, - including any subsurfaces. This updates dynamically on every - commit. This unset mode is meant for extremely simple clients. - - If responding to a configure event, the window geometry in here - must respect the sizing negotiations specified by the states in - the configure event. - - The arguments are given in the surface local coordinate space of - the wl_surface associated with this xdg_surface. - - The width and height must be greater than zero. - - - - - - - - - - Maximize the surface. - - After requesting that the surface should be maximized, the compositor - will respond by emitting a configure event with the "maximized" state - and the required window geometry. The client should then update its - content, drawing it in a maximized state, i.e. without shadow or other - decoration outside of the window geometry. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to decide how and where to maximize the - surface, for example which output and what region of the screen should - be used. - - If the surface was already maximized, the compositor will still emit - a configure event with the "maximized" state. - - - - - - Unmaximize the surface. - - After requesting that the surface should be unmaximized, the compositor - will respond by emitting a configure event without the "maximized" - state. If available, the compositor will include the window geometry - dimensions the window had prior to being maximized in the configure - request. The client must then update its content, drawing it in a - regular state, i.e. potentially with shadow, etc. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to position the surface after it was - unmaximized; usually the position the surface had before maximizing, if - applicable. - - If the surface was already not maximized, the compositor will still - emit a configure event without the "maximized" state. - - - - - - Make the surface fullscreen. - - You can specify an output that you would prefer to be fullscreen. - If this value is NULL, it's up to the compositor to choose which - display will be used to map this surface. - - If the surface doesn't cover the whole output, the compositor will - position the surface in the center of the output and compensate with - black borders filling the rest of the output. - - - - - - - - Request that the compositor minimize your surface. There is no - way to know if the surface is currently minimized, nor is there - any way to unset minimization on this surface. - - If you are looking to throttle redrawing when minimized, please - instead use the wl_surface.frame event for this, as this will - also work with live previews on windows in Alt-Tab, Expose or - similar compositor features. - - - - - - The close event is sent by the compositor when the user - wants the surface to be closed. This should be equivalent to - the user clicking the close button in client-side decorations, - if your application has any... - - This is only a request that the user intends to close your - window. The client may choose to ignore this request, or show - a dialog to ask the user to save their data... - - - - - - - A popup surface is a short-lived, temporary surface that can be - used to implement menus. It takes an explicit grab on the surface - that will be dismissed when the user dismisses the popup. This can - be done by the user clicking outside the surface, using the keyboard, - or even locking the screen through closing the lid or a timeout. - - When the popup is dismissed, a popup_done event will be sent out, - and at the same time the surface will be unmapped. The xdg_popup - object is now inert and cannot be reactivated, so clients should - destroy it. Explicitly destroying the xdg_popup object will also - dismiss the popup and unmap the surface. - - Clients will receive events for all their surfaces during this - grab (which is an "owner-events" grab in X11 parlance). This is - done so that users can navigate through submenus and other - "nested" popup windows without having to dismiss the topmost - popup. - - Clients that want to dismiss the popup when another surface of - their own is clicked should dismiss the popup using the destroy - request. - - The parent surface must have either an xdg_surface or xdg_popup - role. - - Specifying an xdg_popup for the parent means that the popups are - nested, with this popup now being the topmost popup. Nested - popups must be destroyed in the reverse order they were created - in, e.g. the only popup you are allowed to destroy at all times - is the topmost one. - - If there is an existing popup when creating a new popup, the - parent must be the current topmost popup. - - A parent surface must be mapped before the new popup is mapped. - - When compositors choose to dismiss a popup, they will likely - dismiss every nested popup as well. When a compositor dismisses - popups, it will follow the same dismissing order as required - from the client. - - The x and y arguments passed when creating the popup object specify - where the top left of the popup should be placed, relative to the - local surface coordinates of the parent surface. See - xdg_shell.get_xdg_popup. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_popup state to take effect. - - For a surface to be mapped by the compositor the client must have - committed both the xdg_popup state and a buffer. - - - - - This destroys the popup. Explicitly destroying the xdg_popup - object will also dismiss the popup, and unmap the surface. - - If this xdg_popup is not the "topmost" popup, a protocol error - will be sent. - - - - - - The popup_done event is sent out when a popup is dismissed by the - compositor. The client should destroy the xdg_popup object at this - point. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-shell-unstable-v6.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell-unstable-v6.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-shell-unstable-v6.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell-unstable-v6.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,1044 +0,0 @@ - - - - - Copyright © 2008-2013 Kristian Høgsberg - Copyright © 2013 Rafael Antognolli - Copyright © 2013 Jasper St. Pierre - Copyright © 2010-2013 Intel Corporation - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - xdg_shell allows clients to turn a wl_surface into a "real window" - which can be dragged, resized, stacked, and moved around by the - user. Everything about this interface is suited towards traditional - desktop environments. - - - - - - - - - - - - - - Destroy this xdg_shell object. - - Destroying a bound xdg_shell object while there are surfaces - still alive created by this xdg_shell object instance is illegal - and will result in a protocol error. - - - - - - Create a positioner object. A positioner object is used to position - surfaces relative to some parent surface. See the interface description - and xdg_surface.get_popup for details. - - - - - - - This creates an xdg_surface for the given surface. While xdg_surface - itself is not a role, the corresponding surface may only be assigned - a role extending xdg_surface, such as xdg_toplevel or xdg_popup. - - This creates an xdg_surface for the given surface. An xdg_surface is - used as basis to define a role to a given surface, such as xdg_toplevel - or xdg_popup. It also manages functionality shared between xdg_surface - based surface roles. - - See the documentation of xdg_surface for more details about what an - xdg_surface is and how it is used. - - - - - - - - A client must respond to a ping event with a pong request or - the client may be deemed unresponsive. See xdg_shell.ping. - - - - - - - The ping event asks the client if it's still alive. Pass the - serial specified in the event back to the compositor by sending - a "pong" request back with the specified serial. See xdg_shell.ping. - - Compositors can use this to determine if the client is still - alive. It's unspecified what will happen if the client doesn't - respond to the ping request, or in what timeframe. Clients should - try to respond in a reasonable amount of time. - - A compositor is free to ping in any way it wants, but a client must - always respond to any xdg_shell object it created. - - - - - - - - The xdg_positioner provides a collection of rules for the placement of a - child surface relative to a parent surface. Rules can be defined to ensure - the child surface remains within the visible area's borders, and to - specify how the child surface changes its position, such as sliding along - an axis, or flipping around a rectangle. These positioner-created rules are - constrained by the requirement that a child surface must intersect with or - be at least partially adjacent to its parent surface. - - See the various requests for details about possible rules. - - At the time of the request, the compositor makes a copy of the rules - specified by the xdg_positioner. Thus, after the request is complete the - xdg_positioner object can be destroyed or reused; further changes to the - object will have no effect on previous usages. - - For an xdg_positioner object to be considered complete, it must have a - non-zero size set by set_size, and a non-zero anchor rectangle set by - set_anchor_rect. Passing an incomplete xdg_positioner object when - positioning a surface raises an error. - - - - - - - - - Notify the compositor that the xdg_positioner will no longer be used. - - - - - - Set the size of the surface that is to be positioned with the positioner - object. The size is in surface-local coordinates and corresponds to the - window geometry. See xdg_surface.set_window_geometry. - - If a zero or negative size is set the invalid_input error is raised. - - - - - - - - Specify the anchor rectangle within the parent surface that the child - surface will be placed relative to. The rectangle is relative to the - window geometry as defined by xdg_surface.set_window_geometry of the - parent surface. The rectangle must be at least 1x1 large. - - When the xdg_positioner object is used to position a child surface, the - anchor rectangle may not extend outside the window geometry of the - positioned child's parent surface. - - If a zero or negative size is set the invalid_input error is raised. - - - - - - - - - - - - - - - - - - Defines a set of edges for the anchor rectangle. These are used to - derive an anchor point that the child surface will be positioned - relative to. If two orthogonal edges are specified (e.g. 'top' and - 'left'), then the anchor point will be the intersection of the edges - (e.g. the top left position of the rectangle); otherwise, the derived - anchor point will be centered on the specified edge, or in the center of - the anchor rectangle if no edge is specified. - - If two parallel anchor edges are specified (e.g. 'left' and 'right'), - the invalid_input error is raised. - - - - - - - - - - - - - - - Defines in what direction a surface should be positioned, relative to - the anchor point of the parent surface. If two orthogonal gravities are - specified (e.g. 'bottom' and 'right'), then the child surface will be - placed in the specified direction; otherwise, the child surface will be - centered over the anchor point on any axis that had no gravity - specified. - - If two parallel gravities are specified (e.g. 'left' and 'right'), the - invalid_input error is raised. - - - - - - - The constraint adjustment value define ways the compositor will adjust - the position of the surface, if the unadjusted position would result - in the surface being partly constrained. - - Whether a surface is considered 'constrained' is left to the compositor - to determine. For example, the surface may be partly outside the - compositor's defined 'work area', thus necessitating the child surface's - position be adjusted until it is entirely inside the work area. - - The adjustments can be combined, according to a defined precedence: 1) - Flip, 2) Slide, 3) Resize. - - - - Don't alter the surface position even if it is constrained on some - axis, for example partially outside the edge of a monitor. - - - - - Slide the surface along the x axis until it is no longer constrained. - - First try to slide towards the direction of the gravity on the x axis - until either the edge in the opposite direction of the gravity is - unconstrained or the edge in the direction of the gravity is - constrained. - - Then try to slide towards the opposite direction of the gravity on the - x axis until either the edge in the direction of the gravity is - unconstrained or the edge in the opposite direction of the gravity is - constrained. - - - - - Slide the surface along the y axis until it is no longer constrained. - - First try to slide towards the direction of the gravity on the y axis - until either the edge in the opposite direction of the gravity is - unconstrained or the edge in the direction of the gravity is - constrained. - - Then try to slide towards the opposite direction of the gravity on the - y axis until either the edge in the direction of the gravity is - unconstrained or the edge in the opposite direction of the gravity is - constrained. - - - - - Invert the anchor and gravity on the x axis if the surface is - constrained on the x axis. For example, if the left edge of the - surface is constrained, the gravity is 'left' and the anchor is - 'left', change the gravity to 'right' and the anchor to 'right'. - - If the adjusted position also ends up being constrained, the resulting - position of the flip_x adjustment will be the one before the - adjustment. - - - - - Invert the anchor and gravity on the y axis if the surface is - constrained on the y axis. For example, if the bottom edge of the - surface is constrained, the gravity is 'bottom' and the anchor is - 'bottom', change the gravity to 'top' and the anchor to 'top'. - - If the adjusted position also ends up being constrained, the resulting - position of the flip_y adjustment will be the one before the - adjustment. - - - - - Resize the surface horizontally so that it is completely - unconstrained. - - - - - Resize the surface vertically so that it is completely unconstrained. - - - - - - - Specify how the window should be positioned if the originally intended - position caused the surface to be constrained, meaning at least - partially outside positioning boundaries set by the compositor. The - adjustment is set by constructing a bitmask describing the adjustment to - be made when the surface is constrained on that axis. - - If no bit for one axis is set, the compositor will assume that the child - surface should not change its position on that axis when constrained. - - If more than one bit for one axis is set, the order of how adjustments - are applied is specified in the corresponding adjustment descriptions. - - The default adjustment is none. - - - - - - - Specify the surface position offset relative to the position of the - anchor on the anchor rectangle and the anchor on the surface. For - example if the anchor of the anchor rectangle is at (x, y), the surface - has the gravity bottom|right, and the offset is (ox, oy), the calculated - surface position will be (x + ox, y + oy). The offset position of the - surface is the one used for constraint testing. See - set_constraint_adjustment. - - An example use case is placing a popup menu on top of a user interface - element, while aligning the user interface element of the parent surface - with some user interface element placed somewhere in the popup surface. - - - - - - - - - An interface that may be implemented by a wl_surface, for - implementations that provide a desktop-style user interface. - - It provides a base set of functionality required to construct user - interface elements requiring management by the compositor, such as - toplevel windows, menus, etc. The types of functionality are split into - xdg_surface roles. - - Creating an xdg_surface does not set the role for a wl_surface. In order - to map an xdg_surface, the client must create a role-specific object - using, e.g., get_toplevel, get_popup. The wl_surface for any given - xdg_surface can have at most one role, and may not be assigned any role - not based on xdg_surface. - - A role must be assigned before any other requests are made to the - xdg_surface object. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_surface state to take effect. - - Creating an xdg_surface from a wl_surface which has a buffer attached or - committed is a client error, and any attempts by a client to attach or - manipulate a buffer prior to the first xdg_surface.configure call must - also be treated as errors. - - For a surface to be mapped by the compositor, the following conditions - must be met: (1) the client has assigned a xdg_surface based role to the - surface, (2) the client has set and committed the xdg_surface state and - the role dependent state to the surface and (3) the client has committed a - buffer to the surface. - - - - - - - - - - - Destroy the xdg_surface object. An xdg_surface must only be destroyed - after its role object has been destroyed. - - - - - - This creates an xdg_toplevel object for the given xdg_surface and gives - the associated wl_surface the xdg_toplevel role. - - See the documentation of xdg_toplevel for more details about what an - xdg_toplevel is and how it is used. - - - - - - - This creates an xdg_popup object for the given xdg_surface and gives the - associated wl_surface the xdg_popup role. - - See the documentation of xdg_popup for more details about what an - xdg_popup is and how it is used. - - - - - - - - - The window geometry of a surface is its "visible bounds" from the - user's perspective. Client-side decorations often have invisible - portions like drop-shadows which should be ignored for the - purposes of aligning, placing and constraining windows. - - The window geometry is double buffered, and will be applied at the - time wl_surface.commit of the corresponding wl_surface is called. - - Once the window geometry of the surface is set, it is not possible to - unset it, and it will remain the same until set_window_geometry is - called again, even if a new subsurface or buffer is attached. - - If never set, the value is the full bounds of the surface, - including any subsurfaces. This updates dynamically on every - commit. This unset is meant for extremely simple clients. - - The arguments are given in the surface-local coordinate space of - the wl_surface associated with this xdg_surface. - - The width and height must be greater than zero. Setting an invalid size - will raise an error. When applied, the effective window geometry will be - the set window geometry clamped to the bounding rectangle of the - combined geometry of the surface of the xdg_surface and the associated - subsurfaces. - - - - - - - - - - When a configure event is received, if a client commits the - surface in response to the configure event, then the client - must make an ack_configure request sometime before the commit - request, passing along the serial of the configure event. - - For instance, for toplevel surfaces the compositor might use this - information to move a surface to the top left only when the client has - drawn itself for the maximized or fullscreen state. - - If the client receives multiple configure events before it - can respond to one, it only has to ack the last configure event. - - A client is not required to commit immediately after sending - an ack_configure request - it may even ack_configure several times - before its next surface commit. - - A client may send multiple ack_configure requests before committing, but - only the last request sent before a commit indicates which configure - event the client really is responding to. - - - - - - - The configure event marks the end of a configure sequence. A configure - sequence is a set of one or more events configuring the state of the - xdg_surface, including the final xdg_surface.configure event. - - Where applicable, xdg_surface surface roles will during a configure - sequence extend this event as a latched state sent as events before the - xdg_surface.configure event. Such events should be considered to make up - a set of atomically applied configuration states, where the - xdg_surface.configure commits the accumulated state. - - Clients should arrange their surface for the new states, and then send - an ack_configure request with the serial sent in this configure event at - some point before committing the new surface. - - If the client receives multiple configure events before it can respond - to one, it is free to discard all but the last event it received. - - - - - - - - This interface defines an xdg_surface role which allows a surface to, - among other things, set window-like properties such as maximize, - fullscreen, and minimize, set application-specific metadata like title and - id, and well as trigger user interactive operations such as interactive - resize and move. - - - - - Unmap and destroy the window. The window will be effectively - hidden from the user's point of view, and all state like - maximization, fullscreen, and so on, will be lost. - - - - - - Set the "parent" of this surface. This window should be stacked - above a parent. The parent surface must be mapped as long as this - surface is mapped. - - Parent windows should be set on dialogs, toolboxes, or other - "auxiliary" surfaces, so that the parent is raised when the dialog - is raised. - - - - - - - Set a short title for the surface. - - This string may be used to identify the surface in a task bar, - window list, or other user interface elements provided by the - compositor. - - The string must be encoded in UTF-8. - - - - - - - Set an application identifier for the surface. - - The app ID identifies the general class of applications to which - the surface belongs. The compositor can use this to group multiple - surfaces together, or to determine how to launch a new application. - - For D-Bus activatable applications, the app ID is used as the D-Bus - service name. - - The compositor shell will try to group application surfaces together - by their app ID. As a best practice, it is suggested to select app - ID's that match the basename of the application's .desktop file. - For example, "org.freedesktop.FooViewer" where the .desktop file is - "org.freedesktop.FooViewer.desktop". - - See the desktop-entry specification [0] for more details on - application identifiers and how they relate to well-known D-Bus - names and .desktop files. - - [0] http://standards.freedesktop.org/desktop-entry-spec/ - - - - - - - Clients implementing client-side decorations might want to show - a context menu when right-clicking on the decorations, giving the - user a menu that they can use to maximize or minimize the window. - - This request asks the compositor to pop up such a window menu at - the given position, relative to the local surface coordinates of - the parent surface. There are no guarantees as to what menu items - the window menu contains. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. - - - - - - - - - - Start an interactive, user-driven move of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive move (touch, - pointer, etc). - - The server may ignore move requests depending on the state of - the surface (e.g. fullscreen or maximized), or if the passed serial - is no longer valid. - - If triggered, the surface will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the move. It is up to the - compositor to visually indicate that the move is taking place, such as - updating a pointer cursor, during the move. There is no guarantee - that the device focus will return when the move is completed. - - - - - - - - These values are used to indicate which edge of a surface - is being dragged in a resize operation. - - - - - - - - - - - - - - - Start a user-driven, interactive resize of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive resize (touch, - pointer, etc). - - The server may ignore resize requests depending on the state of - the surface (e.g. fullscreen or maximized). - - If triggered, the client will receive configure events with the - "resize" state enum value and the expected sizes. See the "resize" - enum value for more details about what is required. The client - must also acknowledge configure events using "ack_configure". After - the resize is completed, the client will receive another "configure" - event without the resize state. - - If triggered, the surface also will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the resize. It is up to the - compositor to visually indicate that the resize is taking place, - such as updating a pointer cursor, during the resize. There is no - guarantee that the device focus will return when the resize is - completed. - - The edges parameter specifies how the surface should be resized, - and is one of the values of the resize_edge enum. The compositor - may use this information to update the surface position for - example when dragging the top left corner. The compositor may also - use this information to adapt its behavior, e.g. choose an - appropriate cursor image. - - - - - - - - - The different state values used on the surface. This is designed for - state values like maximized, fullscreen. It is paired with the - configure event to ensure that both the client and the compositor - setting the state can be synchronized. - - States set in this way are double-buffered. They will get applied on - the next commit. - - - - The surface is maximized. The window geometry specified in the configure - event must be obeyed by the client. - - - - - The surface is fullscreen. The window geometry specified in the configure - event must be obeyed by the client. - - - - - The surface is being resized. The window geometry specified in the - configure event is a maximum; the client cannot resize beyond it. - Clients that have aspect ratio or cell sizing configuration can use - a smaller size, however. - - - - - Client window decorations should be painted as if the window is - active. Do not assume this means that the window actually has - keyboard or pointer focus. - - - - - - - Set a maximum size for the window. - - The client can specify a maximum size so that the compositor does - not try to configure the window beyond this size. - - The width and height arguments are in window geometry coordinates. - See xdg_surface.set_window_geometry. - - Values set in this way are double-buffered. They will get applied - on the next commit. - - The compositor can use this information to allow or disallow - different states like maximize or fullscreen and draw accurate - animations. - - Similarly, a tiling window manager may use this information to - place and resize client windows in a more effective way. - - The client should not rely on the compositor to obey the maximum - size. The compositor may decide to ignore the values set by the - client and request a larger size. - - If never set, or a value of zero in the request, means that the - client has no expected maximum size in the given dimension. - As a result, a client wishing to reset the maximum size - to an unspecified state can use zero for width and height in the - request. - - Requesting a maximum size to be smaller than the minimum size of - a surface is illegal and will result in a protocol error. - - The width and height must be greater than or equal to zero. Using - strictly negative values for width and height will result in a - protocol error. - - - - - - - - Set a minimum size for the window. - - The client can specify a minimum size so that the compositor does - not try to configure the window below this size. - - The width and height arguments are in window geometry coordinates. - See xdg_surface.set_window_geometry. - - Values set in this way are double-buffered. They will get applied - on the next commit. - - The compositor can use this information to allow or disallow - different states like maximize or fullscreen and draw accurate - animations. - - Similarly, a tiling window manager may use this information to - place and resize client windows in a more effective way. - - The client should not rely on the compositor to obey the minimum - size. The compositor may decide to ignore the values set by the - client and request a smaller size. - - If never set, or a value of zero in the request, means that the - client has no expected minimum size in the given dimension. - As a result, a client wishing to reset the minimum size - to an unspecified state can use zero for width and height in the - request. - - Requesting a minimum size to be larger than the maximum size of - a surface is illegal and will result in a protocol error. - - The width and height must be greater than or equal to zero. Using - strictly negative values for width and height will result in a - protocol error. - - - - - - - - Maximize the surface. - - After requesting that the surface should be maximized, the compositor - will respond by emitting a configure event with the "maximized" state - and the required window geometry. The client should then update its - content, drawing it in a maximized state, i.e. without shadow or other - decoration outside of the window geometry. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to decide how and where to maximize the - surface, for example which output and what region of the screen should - be used. - - If the surface was already maximized, the compositor will still emit - a configure event with the "maximized" state. - - - - - - Unmaximize the surface. - - After requesting that the surface should be unmaximized, the compositor - will respond by emitting a configure event without the "maximized" - state. If available, the compositor will include the window geometry - dimensions the window had prior to being maximized in the configure - request. The client must then update its content, drawing it in a - regular state, i.e. potentially with shadow, etc. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to position the surface after it was - unmaximized; usually the position the surface had before maximizing, if - applicable. - - If the surface was already not maximized, the compositor will still - emit a configure event without the "maximized" state. - - - - - - Make the surface fullscreen. - - You can specify an output that you would prefer to be fullscreen. - If this value is NULL, it's up to the compositor to choose which - display will be used to map this surface. - - If the surface doesn't cover the whole output, the compositor will - position the surface in the center of the output and compensate with - black borders filling the rest of the output. - - - - - - - - Request that the compositor minimize your surface. There is no - way to know if the surface is currently minimized, nor is there - any way to unset minimization on this surface. - - If you are looking to throttle redrawing when minimized, please - instead use the wl_surface.frame event for this, as this will - also work with live previews on windows in Alt-Tab, Expose or - similar compositor features. - - - - - - This configure event asks the client to resize its toplevel surface or - to change its state. The configured state should not be applied - immediately. See xdg_surface.configure for details. - - The width and height arguments specify a hint to the window - about how its surface should be resized in window geometry - coordinates. See set_window_geometry. - - If the width or height arguments are zero, it means the client - should decide its own window dimension. This may happen when the - compositor needs to configure the state of the surface but doesn't - have any information about any previous or expected dimension. - - The states listed in the event specify how the width/height - arguments should be interpreted, and possibly how it should be - drawn. - - Clients must send an ack_configure in response to this event. See - xdg_surface.configure and xdg_surface.ack_configure for details. - - - - - - - - - The close event is sent by the compositor when the user - wants the surface to be closed. This should be equivalent to - the user clicking the close button in client-side decorations, - if your application has any. - - This is only a request that the user intends to close the - window. The client may choose to ignore this request, or show - a dialog to ask the user to save their data, etc. - - - - - - - A popup surface is a short-lived, temporary surface. It can be used to - implement for example menus, popovers, tooltips and other similar user - interface concepts. - - A popup can be made to take an explicit grab. See xdg_popup.grab for - details. - - When the popup is dismissed, a popup_done event will be sent out, and at - the same time the surface will be unmapped. See the xdg_popup.popup_done - event for details. - - Explicitly destroying the xdg_popup object will also dismiss the popup and - unmap the surface. Clients that want to dismiss the popup when another - surface of their own is clicked should dismiss the popup using the destroy - request. - - The parent surface must have either the xdg_toplevel or xdg_popup surface - role. - - A newly created xdg_popup will be stacked on top of all previously created - xdg_popup surfaces associated with the same xdg_toplevel. - - The parent of an xdg_popup must be mapped (see the xdg_surface - description) before the xdg_popup itself. - - The x and y arguments passed when creating the popup object specify - where the top left of the popup should be placed, relative to the - local surface coordinates of the parent surface. See - xdg_surface.get_popup. An xdg_popup must intersect with or be at least - partially adjacent to its parent surface. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_popup state to take effect. - - - - - - - - - This destroys the popup. Explicitly destroying the xdg_popup - object will also dismiss the popup, and unmap the surface. - - If this xdg_popup is not the "topmost" popup, a protocol error - will be sent. - - - - - - This request makes the created popup take an explicit grab. An explicit - grab will be dismissed when the user dismisses the popup, or when the - client destroys the xdg_popup. This can be done by the user clicking - outside the surface, using the keyboard, or even locking the screen - through closing the lid or a timeout. - - If the compositor denies the grab, the popup will be immediately - dismissed. - - This request must be used in response to some sort of user action like a - button press, key press, or touch down event. The serial number of the - event should be passed as 'serial'. - - The parent of a grabbing popup must either be an xdg_toplevel surface or - another xdg_popup with an explicit grab. If the parent is another - xdg_popup it means that the popups are nested, with this popup now being - the topmost popup. - - Nested popups must be destroyed in the reverse order they were created - in, e.g. the only popup you are allowed to destroy at all times is the - topmost one. - - When compositors choose to dismiss a popup, they may dismiss every - nested grabbing popup as well. When a compositor dismisses popups, it - will follow the same dismissing order as required from the client. - - The parent of a grabbing popup must either be another xdg_popup with an - active explicit grab, or an xdg_popup or xdg_toplevel, if there are no - explicit grabs already taken. - - If the topmost grabbing popup is destroyed, the grab will be returned to - the parent of the popup, if that parent previously had an explicit grab. - - If the parent is a grabbing popup which has already been dismissed, this - popup will be immediately dismissed. If the parent is a popup that did - not take an explicit grab, an error will be raised. - - During a popup grab, the client owning the grab will receive pointer - and touch events for all their surfaces as normal (similar to an - "owner-events" grab in X11 parlance), while the top most grabbing popup - will always have keyboard focus. - - - - - - - - This event asks the popup surface to configure itself given the - configuration. The configured state should not be applied immediately. - See xdg_surface.configure for details. - - The x and y arguments represent the position the popup was placed at - given the xdg_positioner rule, relative to the upper left corner of the - window geometry of the parent surface. - - - - - - - - - - The popup_done event is sent out when a popup is dismissed by the - compositor. The client should destroy the xdg_popup object at this - point. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xdg-shell.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell.xml --- dwayland-5.57.0.23/src/client/protocols/xdg-shell.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xdg-shell.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,1120 +0,0 @@ - - - - - Copyright © 2008-2013 Kristian Høgsberg - Copyright © 2013 Rafael Antognolli - Copyright © 2013 Jasper St. Pierre - Copyright © 2010-2013 Intel Corporation - Copyright © 2015-2017 Samsung Electronics Co., Ltd - Copyright © 2015-2017 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - - The xdg_wm_base interface is exposed as a global object enabling clients - to turn their wl_surfaces into windows in a desktop environment. It - defines the basic functionality needed for clients and the compositor to - create windows that can be dragged, resized, maximized, etc, as well as - creating transient windows such as popup menus. - - - - - - - - - - - - - - Destroy this xdg_wm_base object. - - Destroying a bound xdg_wm_base object while there are surfaces - still alive created by this xdg_wm_base object instance is illegal - and will result in a protocol error. - - - - - - Create a positioner object. A positioner object is used to position - surfaces relative to some parent surface. See the interface description - and xdg_surface.get_popup for details. - - - - - - - This creates an xdg_surface for the given surface. While xdg_surface - itself is not a role, the corresponding surface may only be assigned - a role extending xdg_surface, such as xdg_toplevel or xdg_popup. - - This creates an xdg_surface for the given surface. An xdg_surface is - used as basis to define a role to a given surface, such as xdg_toplevel - or xdg_popup. It also manages functionality shared between xdg_surface - based surface roles. - - See the documentation of xdg_surface for more details about what an - xdg_surface is and how it is used. - - - - - - - - A client must respond to a ping event with a pong request or - the client may be deemed unresponsive. See xdg_wm_base.ping. - - - - - - - The ping event asks the client if it's still alive. Pass the - serial specified in the event back to the compositor by sending - a "pong" request back with the specified serial. See xdg_wm_base.ping. - - Compositors can use this to determine if the client is still - alive. It's unspecified what will happen if the client doesn't - respond to the ping request, or in what timeframe. Clients should - try to respond in a reasonable amount of time. - - A compositor is free to ping in any way it wants, but a client must - always respond to any xdg_wm_base object it created. - - - - - - - - The xdg_positioner provides a collection of rules for the placement of a - child surface relative to a parent surface. Rules can be defined to ensure - the child surface remains within the visible area's borders, and to - specify how the child surface changes its position, such as sliding along - an axis, or flipping around a rectangle. These positioner-created rules are - constrained by the requirement that a child surface must intersect with or - be at least partially adjacent to its parent surface. - - See the various requests for details about possible rules. - - At the time of the request, the compositor makes a copy of the rules - specified by the xdg_positioner. Thus, after the request is complete the - xdg_positioner object can be destroyed or reused; further changes to the - object will have no effect on previous usages. - - For an xdg_positioner object to be considered complete, it must have a - non-zero size set by set_size, and a non-zero anchor rectangle set by - set_anchor_rect. Passing an incomplete xdg_positioner object when - positioning a surface raises an error. - - - - - - - - - Notify the compositor that the xdg_positioner will no longer be used. - - - - - - Set the size of the surface that is to be positioned with the positioner - object. The size is in surface-local coordinates and corresponds to the - window geometry. See xdg_surface.set_window_geometry. - - If a zero or negative size is set the invalid_input error is raised. - - - - - - - - Specify the anchor rectangle within the parent surface that the child - surface will be placed relative to. The rectangle is relative to the - window geometry as defined by xdg_surface.set_window_geometry of the - parent surface. - - When the xdg_positioner object is used to position a child surface, the - anchor rectangle may not extend outside the window geometry of the - positioned child's parent surface. - - If a negative size is set the invalid_input error is raised. - - - - - - - - - - - - - - - - - - - - - - Defines the anchor point for the anchor rectangle. The specified anchor - is used derive an anchor point that the child surface will be - positioned relative to. If a corner anchor is set (e.g. 'top_left' or - 'bottom_right'), the anchor point will be at the specified corner; - otherwise, the derived anchor point will be centered on the specified - edge, or in the center of the anchor rectangle if no edge is specified. - - - - - - - - - - - - - - - - - - - Defines in what direction a surface should be positioned, relative to - the anchor point of the parent surface. If a corner gravity is - specified (e.g. 'bottom_right' or 'top_left'), then the child surface - will be placed towards the specified gravity; otherwise, the child - surface will be centered over the anchor point on any axis that had no - gravity specified. - - - - - - - The constraint adjustment value define ways the compositor will adjust - the position of the surface, if the unadjusted position would result - in the surface being partly constrained. - - Whether a surface is considered 'constrained' is left to the compositor - to determine. For example, the surface may be partly outside the - compositor's defined 'work area', thus necessitating the child surface's - position be adjusted until it is entirely inside the work area. - - The adjustments can be combined, according to a defined precedence: 1) - Flip, 2) Slide, 3) Resize. - - - - Don't alter the surface position even if it is constrained on some - axis, for example partially outside the edge of an output. - - - - - Slide the surface along the x axis until it is no longer constrained. - - First try to slide towards the direction of the gravity on the x axis - until either the edge in the opposite direction of the gravity is - unconstrained or the edge in the direction of the gravity is - constrained. - - Then try to slide towards the opposite direction of the gravity on the - x axis until either the edge in the direction of the gravity is - unconstrained or the edge in the opposite direction of the gravity is - constrained. - - - - - Slide the surface along the y axis until it is no longer constrained. - - First try to slide towards the direction of the gravity on the y axis - until either the edge in the opposite direction of the gravity is - unconstrained or the edge in the direction of the gravity is - constrained. - - Then try to slide towards the opposite direction of the gravity on the - y axis until either the edge in the direction of the gravity is - unconstrained or the edge in the opposite direction of the gravity is - constrained. - - - - - Invert the anchor and gravity on the x axis if the surface is - constrained on the x axis. For example, if the left edge of the - surface is constrained, the gravity is 'left' and the anchor is - 'left', change the gravity to 'right' and the anchor to 'right'. - - If the adjusted position also ends up being constrained, the resulting - position of the flip_x adjustment will be the one before the - adjustment. - - - - - Invert the anchor and gravity on the y axis if the surface is - constrained on the y axis. For example, if the bottom edge of the - surface is constrained, the gravity is 'bottom' and the anchor is - 'bottom', change the gravity to 'top' and the anchor to 'top'. - - The adjusted position is calculated given the original anchor - rectangle and offset, but with the new flipped anchor and gravity - values. - - If the adjusted position also ends up being constrained, the resulting - position of the flip_y adjustment will be the one before the - adjustment. - - - - - Resize the surface horizontally so that it is completely - unconstrained. - - - - - Resize the surface vertically so that it is completely unconstrained. - - - - - - - Specify how the window should be positioned if the originally intended - position caused the surface to be constrained, meaning at least - partially outside positioning boundaries set by the compositor. The - adjustment is set by constructing a bitmask describing the adjustment to - be made when the surface is constrained on that axis. - - If no bit for one axis is set, the compositor will assume that the child - surface should not change its position on that axis when constrained. - - If more than one bit for one axis is set, the order of how adjustments - are applied is specified in the corresponding adjustment descriptions. - - The default adjustment is none. - - - - - - - Specify the surface position offset relative to the position of the - anchor on the anchor rectangle and the anchor on the surface. For - example if the anchor of the anchor rectangle is at (x, y), the surface - has the gravity bottom|right, and the offset is (ox, oy), the calculated - surface position will be (x + ox, y + oy). The offset position of the - surface is the one used for constraint testing. See - set_constraint_adjustment. - - An example use case is placing a popup menu on top of a user interface - element, while aligning the user interface element of the parent surface - with some user interface element placed somewhere in the popup surface. - - - - - - - - - An interface that may be implemented by a wl_surface, for - implementations that provide a desktop-style user interface. - - It provides a base set of functionality required to construct user - interface elements requiring management by the compositor, such as - toplevel windows, menus, etc. The types of functionality are split into - xdg_surface roles. - - Creating an xdg_surface does not set the role for a wl_surface. In order - to map an xdg_surface, the client must create a role-specific object - using, e.g., get_toplevel, get_popup. The wl_surface for any given - xdg_surface can have at most one role, and may not be assigned any role - not based on xdg_surface. - - A role must be assigned before any other requests are made to the - xdg_surface object. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_surface state to take effect. - - Creating an xdg_surface from a wl_surface which has a buffer attached or - committed is a client error, and any attempts by a client to attach or - manipulate a buffer prior to the first xdg_surface.configure call must - also be treated as errors. - - Mapping an xdg_surface-based role surface is defined as making it - possible for the surface to be shown by the compositor. Note that - a mapped surface is not guaranteed to be visible once it is mapped. - - For an xdg_surface to be mapped by the compositor, the following - conditions must be met: - (1) the client has assigned an xdg_surface-based role to the surface - (2) the client has set and committed the xdg_surface state and the - role-dependent state to the surface - (3) the client has committed a buffer to the surface - - A newly-unmapped surface is considered to have met condition (1) out - of the 3 required conditions for mapping a surface if its role surface - has not been destroyed. - - - - - - - - - - - Destroy the xdg_surface object. An xdg_surface must only be destroyed - after its role object has been destroyed. - - - - - - This creates an xdg_toplevel object for the given xdg_surface and gives - the associated wl_surface the xdg_toplevel role. - - See the documentation of xdg_toplevel for more details about what an - xdg_toplevel is and how it is used. - - - - - - - This creates an xdg_popup object for the given xdg_surface and gives - the associated wl_surface the xdg_popup role. - - If null is passed as a parent, a parent surface must be specified using - some other protocol, before committing the initial state. - - See the documentation of xdg_popup for more details about what an - xdg_popup is and how it is used. - - - - - - - - - The window geometry of a surface is its "visible bounds" from the - user's perspective. Client-side decorations often have invisible - portions like drop-shadows which should be ignored for the - purposes of aligning, placing and constraining windows. - - The window geometry is double buffered, and will be applied at the - time wl_surface.commit of the corresponding wl_surface is called. - - When maintaining a position, the compositor should treat the (x, y) - coordinate of the window geometry as the top left corner of the window. - A client changing the (x, y) window geometry coordinate should in - general not alter the position of the window. - - Once the window geometry of the surface is set, it is not possible to - unset it, and it will remain the same until set_window_geometry is - called again, even if a new subsurface or buffer is attached. - - If never set, the value is the full bounds of the surface, - including any subsurfaces. This updates dynamically on every - commit. This unset is meant for extremely simple clients. - - The arguments are given in the surface-local coordinate space of - the wl_surface associated with this xdg_surface. - - The width and height must be greater than zero. Setting an invalid size - will raise an error. When applied, the effective window geometry will be - the set window geometry clamped to the bounding rectangle of the - combined geometry of the surface of the xdg_surface and the associated - subsurfaces. - - - - - - - - - - When a configure event is received, if a client commits the - surface in response to the configure event, then the client - must make an ack_configure request sometime before the commit - request, passing along the serial of the configure event. - - For instance, for toplevel surfaces the compositor might use this - information to move a surface to the top left only when the client has - drawn itself for the maximized or fullscreen state. - - If the client receives multiple configure events before it - can respond to one, it only has to ack the last configure event. - - A client is not required to commit immediately after sending - an ack_configure request - it may even ack_configure several times - before its next surface commit. - - A client may send multiple ack_configure requests before committing, but - only the last request sent before a commit indicates which configure - event the client really is responding to. - - - - - - - The configure event marks the end of a configure sequence. A configure - sequence is a set of one or more events configuring the state of the - xdg_surface, including the final xdg_surface.configure event. - - Where applicable, xdg_surface surface roles will during a configure - sequence extend this event as a latched state sent as events before the - xdg_surface.configure event. Such events should be considered to make up - a set of atomically applied configuration states, where the - xdg_surface.configure commits the accumulated state. - - Clients should arrange their surface for the new states, and then send - an ack_configure request with the serial sent in this configure event at - some point before committing the new surface. - - If the client receives multiple configure events before it can respond - to one, it is free to discard all but the last event it received. - - - - - - - - This interface defines an xdg_surface role which allows a surface to, - among other things, set window-like properties such as maximize, - fullscreen, and minimize, set application-specific metadata like title and - id, and well as trigger user interactive operations such as interactive - resize and move. - - Unmapping an xdg_toplevel means that the surface cannot be shown - by the compositor until it is explicitly mapped again. - All active operations (e.g., move, resize) are canceled and all - attributes (e.g. title, state, stacking, ...) are discarded for - an xdg_toplevel surface when it is unmapped. - - Attaching a null buffer to a toplevel unmaps the surface. - - - - - This request destroys the role surface and unmaps the surface; - see "Unmapping" behavior in interface section for details. - - - - - - Set the "parent" of this surface. This surface should be stacked - above the parent surface and all other ancestor surfaces. - - Parent windows should be set on dialogs, toolboxes, or other - "auxiliary" surfaces, so that the parent is raised when the dialog - is raised. - - Setting a null parent for a child window removes any parent-child - relationship for the child. Setting a null parent for a window which - currently has no parent is a no-op. - - If the parent is unmapped then its children are managed as - though the parent of the now-unmapped parent has become the - parent of this surface. If no parent exists for the now-unmapped - parent then the children are managed as though they have no - parent surface. - - - - - - - Set a short title for the surface. - - This string may be used to identify the surface in a task bar, - window list, or other user interface elements provided by the - compositor. - - The string must be encoded in UTF-8. - - - - - - - Set an application identifier for the surface. - - The app ID identifies the general class of applications to which - the surface belongs. The compositor can use this to group multiple - surfaces together, or to determine how to launch a new application. - - For D-Bus activatable applications, the app ID is used as the D-Bus - service name. - - The compositor shell will try to group application surfaces together - by their app ID. As a best practice, it is suggested to select app - ID's that match the basename of the application's .desktop file. - For example, "org.freedesktop.FooViewer" where the .desktop file is - "org.freedesktop.FooViewer.desktop". - - See the desktop-entry specification [0] for more details on - application identifiers and how they relate to well-known D-Bus - names and .desktop files. - - [0] http://standards.freedesktop.org/desktop-entry-spec/ - - - - - - - Clients implementing client-side decorations might want to show - a context menu when right-clicking on the decorations, giving the - user a menu that they can use to maximize or minimize the window. - - This request asks the compositor to pop up such a window menu at - the given position, relative to the local surface coordinates of - the parent surface. There are no guarantees as to what menu items - the window menu contains. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. - - - - - - - - - - Start an interactive, user-driven move of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive move (touch, - pointer, etc). - - The server may ignore move requests depending on the state of - the surface (e.g. fullscreen or maximized), or if the passed serial - is no longer valid. - - If triggered, the surface will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the move. It is up to the - compositor to visually indicate that the move is taking place, such as - updating a pointer cursor, during the move. There is no guarantee - that the device focus will return when the move is completed. - - - - - - - - These values are used to indicate which edge of a surface - is being dragged in a resize operation. - - - - - - - - - - - - - - - Start a user-driven, interactive resize of the surface. - - This request must be used in response to some sort of user action - like a button press, key press, or touch down event. The passed - serial is used to determine the type of interactive resize (touch, - pointer, etc). - - The server may ignore resize requests depending on the state of - the surface (e.g. fullscreen or maximized). - - If triggered, the client will receive configure events with the - "resize" state enum value and the expected sizes. See the "resize" - enum value for more details about what is required. The client - must also acknowledge configure events using "ack_configure". After - the resize is completed, the client will receive another "configure" - event without the resize state. - - If triggered, the surface also will lose the focus of the device - (wl_pointer, wl_touch, etc) used for the resize. It is up to the - compositor to visually indicate that the resize is taking place, - such as updating a pointer cursor, during the resize. There is no - guarantee that the device focus will return when the resize is - completed. - - The edges parameter specifies how the surface should be resized, - and is one of the values of the resize_edge enum. The compositor - may use this information to update the surface position for - example when dragging the top left corner. The compositor may also - use this information to adapt its behavior, e.g. choose an - appropriate cursor image. - - - - - - - - - The different state values used on the surface. This is designed for - state values like maximized, fullscreen. It is paired with the - configure event to ensure that both the client and the compositor - setting the state can be synchronized. - - States set in this way are double-buffered. They will get applied on - the next commit. - - - - The surface is maximized. The window geometry specified in the configure - event must be obeyed by the client. - - - - - The surface is fullscreen. The window geometry specified in the - configure event is a maximum; the client cannot resize beyond it. For - a surface to cover the whole fullscreened area, the geometry - dimensions must be obeyed by the client. For more details, see - xdg_toplevel.set_fullscreen. - - - - - The surface is being resized. The window geometry specified in the - configure event is a maximum; the client cannot resize beyond it. - Clients that have aspect ratio or cell sizing configuration can use - a smaller size, however. - - - - - Client window decorations should be painted as if the window is - active. Do not assume this means that the window actually has - keyboard or pointer focus. - - - - - - - Set a maximum size for the window. - - The client can specify a maximum size so that the compositor does - not try to configure the window beyond this size. - - The width and height arguments are in window geometry coordinates. - See xdg_surface.set_window_geometry. - - Values set in this way are double-buffered. They will get applied - on the next commit. - - The compositor can use this information to allow or disallow - different states like maximize or fullscreen and draw accurate - animations. - - Similarly, a tiling window manager may use this information to - place and resize client windows in a more effective way. - - The client should not rely on the compositor to obey the maximum - size. The compositor may decide to ignore the values set by the - client and request a larger size. - - If never set, or a value of zero in the request, means that the - client has no expected maximum size in the given dimension. - As a result, a client wishing to reset the maximum size - to an unspecified state can use zero for width and height in the - request. - - Requesting a maximum size to be smaller than the minimum size of - a surface is illegal and will result in a protocol error. - - The width and height must be greater than or equal to zero. Using - strictly negative values for width and height will result in a - protocol error. - - - - - - - - Set a minimum size for the window. - - The client can specify a minimum size so that the compositor does - not try to configure the window below this size. - - The width and height arguments are in window geometry coordinates. - See xdg_surface.set_window_geometry. - - Values set in this way are double-buffered. They will get applied - on the next commit. - - The compositor can use this information to allow or disallow - different states like maximize or fullscreen and draw accurate - animations. - - Similarly, a tiling window manager may use this information to - place and resize client windows in a more effective way. - - The client should not rely on the compositor to obey the minimum - size. The compositor may decide to ignore the values set by the - client and request a smaller size. - - If never set, or a value of zero in the request, means that the - client has no expected minimum size in the given dimension. - As a result, a client wishing to reset the minimum size - to an unspecified state can use zero for width and height in the - request. - - Requesting a minimum size to be larger than the maximum size of - a surface is illegal and will result in a protocol error. - - The width and height must be greater than or equal to zero. Using - strictly negative values for width and height will result in a - protocol error. - - - - - - - - Maximize the surface. - - After requesting that the surface should be maximized, the compositor - will respond by emitting a configure event with the "maximized" state - and the required window geometry. The client should then update its - content, drawing it in a maximized state, i.e. without shadow or other - decoration outside of the window geometry. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to decide how and where to maximize the - surface, for example which output and what region of the screen should - be used. - - If the surface was already maximized, the compositor will still emit - a configure event with the "maximized" state. - - If the surface is in a fullscreen state, this request has no direct - effect. It will alter the state the surface is returned to when - unmaximized if not overridden by the compositor. - - - - - - Unmaximize the surface. - - After requesting that the surface should be unmaximized, the compositor - will respond by emitting a configure event without the "maximized" - state. If available, the compositor will include the window geometry - dimensions the window had prior to being maximized in the configure - event. The client must then update its content, drawing it in a - regular state, i.e. potentially with shadow, etc. The client must also - acknowledge the configure when committing the new content (see - ack_configure). - - It is up to the compositor to position the surface after it was - unmaximized; usually the position the surface had before maximizing, if - applicable. - - If the surface was already not maximized, the compositor will still - emit a configure event without the "maximized" state. - - If the surface is in a fullscreen state, this request has no direct - effect. It will alter the state the surface is returned to when - unmaximized if not overridden by the compositor. - - - - - - Make the surface fullscreen. - - After requesting that the surface should be fullscreened, the - compositor will respond by emitting a configure event with the - "fullscreen" state and the fullscreen window geometry. The client must - also acknowledge the configure when committing the new content (see - ack_configure). - - The output passed by the request indicates the client's preference as - to which display it should be set fullscreen on. If this value is NULL, - it's up to the compositor to choose which display will be used to map - this surface. - - If the surface doesn't cover the whole output, the compositor will - position the surface in the center of the output and compensate with - with border fill covering the rest of the output. The content of the - border fill is undefined, but should be assumed to be in some way that - attempts to blend into the surrounding area (e.g. solid black). - - If the fullscreened surface is not opaque, the compositor must make - sure that other screen content not part of the same surface tree (made - up of subsurfaces, popups or similarly coupled surfaces) are not - visible below the fullscreened surface. - - - - - - - Make the surface no longer fullscreen. - - After requesting that the surface should be unfullscreened, the - compositor will respond by emitting a configure event without the - "fullscreen" state. - - Making a surface unfullscreen sets states for the surface based on the following: - * the state(s) it may have had before becoming fullscreen - * any state(s) decided by the compositor - * any state(s) requested by the client while the surface was fullscreen - - The compositor may include the previous window geometry dimensions in - the configure event, if applicable. - - The client must also acknowledge the configure when committing the new - content (see ack_configure). - - - - - - Request that the compositor minimize your surface. There is no - way to know if the surface is currently minimized, nor is there - any way to unset minimization on this surface. - - If you are looking to throttle redrawing when minimized, please - instead use the wl_surface.frame event for this, as this will - also work with live previews on windows in Alt-Tab, Expose or - similar compositor features. - - - - - - This configure event asks the client to resize its toplevel surface or - to change its state. The configured state should not be applied - immediately. See xdg_surface.configure for details. - - The width and height arguments specify a hint to the window - about how its surface should be resized in window geometry - coordinates. See set_window_geometry. - - If the width or height arguments are zero, it means the client - should decide its own window dimension. This may happen when the - compositor needs to configure the state of the surface but doesn't - have any information about any previous or expected dimension. - - The states listed in the event specify how the width/height - arguments should be interpreted, and possibly how it should be - drawn. - - Clients must send an ack_configure in response to this event. See - xdg_surface.configure and xdg_surface.ack_configure for details. - - - - - - - - - The close event is sent by the compositor when the user - wants the surface to be closed. This should be equivalent to - the user clicking the close button in client-side decorations, - if your application has any. - - This is only a request that the user intends to close the - window. The client may choose to ignore this request, or show - a dialog to ask the user to save their data, etc. - - - - - - - A popup surface is a short-lived, temporary surface. It can be used to - implement for example menus, popovers, tooltips and other similar user - interface concepts. - - A popup can be made to take an explicit grab. See xdg_popup.grab for - details. - - When the popup is dismissed, a popup_done event will be sent out, and at - the same time the surface will be unmapped. See the xdg_popup.popup_done - event for details. - - Explicitly destroying the xdg_popup object will also dismiss the popup and - unmap the surface. Clients that want to dismiss the popup when another - surface of their own is clicked should dismiss the popup using the destroy - request. - - The parent surface must have either the xdg_toplevel or xdg_popup surface - role. - - A newly created xdg_popup will be stacked on top of all previously created - xdg_popup surfaces associated with the same xdg_toplevel. - - The parent of an xdg_popup must be mapped (see the xdg_surface - description) before the xdg_popup itself. - - The x and y arguments passed when creating the popup object specify - where the top left of the popup should be placed, relative to the - local surface coordinates of the parent surface. See - xdg_surface.get_popup. An xdg_popup must intersect with or be at least - partially adjacent to its parent surface. - - The client must call wl_surface.commit on the corresponding wl_surface - for the xdg_popup state to take effect. - - - - - - - - - This destroys the popup. Explicitly destroying the xdg_popup - object will also dismiss the popup, and unmap the surface. - - If this xdg_popup is not the "topmost" popup, a protocol error - will be sent. - - - - - - This request makes the created popup take an explicit grab. An explicit - grab will be dismissed when the user dismisses the popup, or when the - client destroys the xdg_popup. This can be done by the user clicking - outside the surface, using the keyboard, or even locking the screen - through closing the lid or a timeout. - - If the compositor denies the grab, the popup will be immediately - dismissed. - - This request must be used in response to some sort of user action like a - button press, key press, or touch down event. The serial number of the - event should be passed as 'serial'. - - The parent of a grabbing popup must either be an xdg_toplevel surface or - another xdg_popup with an explicit grab. If the parent is another - xdg_popup it means that the popups are nested, with this popup now being - the topmost popup. - - Nested popups must be destroyed in the reverse order they were created - in, e.g. the only popup you are allowed to destroy at all times is the - topmost one. - - When compositors choose to dismiss a popup, they may dismiss every - nested grabbing popup as well. When a compositor dismisses popups, it - will follow the same dismissing order as required from the client. - - The parent of a grabbing popup must either be another xdg_popup with an - active explicit grab, or an xdg_popup or xdg_toplevel, if there are no - explicit grabs already taken. - - If the topmost grabbing popup is destroyed, the grab will be returned to - the parent of the popup, if that parent previously had an explicit grab. - - If the parent is a grabbing popup which has already been dismissed, this - popup will be immediately dismissed. If the parent is a popup that did - not take an explicit grab, an error will be raised. - - During a popup grab, the client owning the grab will receive pointer - and touch events for all their surfaces as normal (similar to an - "owner-events" grab in X11 parlance), while the top most grabbing popup - will always have keyboard focus. - - - - - - - - This event asks the popup surface to configure itself given the - configuration. The configured state should not be applied immediately. - See xdg_surface.configure for details. - - The x and y arguments represent the position the popup was placed at - given the xdg_positioner rule, relative to the upper left corner of the - window geometry of the parent surface. - - - - - - - - - - The popup_done event is sent out when a popup is dismissed by the - compositor. The client should destroy the xdg_popup object at this - point. - - - - - diff -Nru dwayland-5.57.0.23/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml --- dwayland-5.57.0.23/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ - - - - - Copyright © 2017 Red Hat Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - - - This protocol is application-specific to meet the needs of the X11 - protocol through Xwayland. It provides a way for Xwayland to request - all keyboard events to be forwarded to a surface even when the - surface does not have keyboard focus. - - In the X11 protocol, a client may request an "active grab" on the - keyboard. On success, all key events are reported only to the - grabbing X11 client. For details, see XGrabKeyboard(3). - - The core Wayland protocol does not have a notion of an active - keyboard grab. When running in Xwayland, X11 applications may - acquire an active grab inside Xwayland but that cannot be translated - to the Wayland compositor who may set the input focus to some other - surface. In doing so, it breaks the X11 client assumption that all - key events are reported to the grabbing client. - - This protocol specifies a way for Xwayland to request all keyboard - be directed to the given surface. The protocol does not guarantee - that the compositor will honor this request and it does not - prescribe user interfaces on how to handle the respond. For example, - a compositor may inform the user that all key events are now - forwarded to the given client surface, or it may ask the user for - permission to do so. - - Compositors are required to restrict access to this application - specific protocol to Xwayland alone. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible - changes may be added together with the corresponding interface - version bump. - Backward incompatible changes are done by bumping the version - number in the protocol and interface names and resetting the - interface version. Once the protocol is to be declared stable, - the 'z' prefix and the version number in the protocol and - interface names are removed and the interface version number is - reset. - - - - - A global interface used for grabbing the keyboard. - - - - - Destroy the keyboard grab manager. - - - - - - The grab_keyboard request asks for a grab of the keyboard, forcing - the keyboard focus for the given seat upon the given surface. - - The protocol provides no guarantee that the grab is ever satisfied, - and does not require the compositor to send an error if the grab - cannot ever be satisfied. It is thus possible to request a keyboard - grab that will never be effective. - - The protocol: - - * does not guarantee that the grab itself is applied for a surface, - the grab request may be silently ignored by the compositor, - * does not guarantee that any events are sent to this client even - if the grab is applied to a surface, - * does not guarantee that events sent to this client are exhaustive, - a compositor may filter some events for its own consumption, - * does not guarantee that events sent to this client are continuous, - a compositor may change and reroute keyboard events while the grab - is nominally active. - - - - - - - - - - - A global interface used for grabbing the keyboard. - - - - - Destroy the grabbed keyboard object. If applicable, the compositor - will ungrab the keyboard. - - - - diff -Nru dwayland-5.57.0.23/src/client/region.cpp dwayland-5.57.0.24+really5.24.3/src/client/region.cpp --- dwayland-5.57.0.23/src/client/region.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/region.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "region.h" #include "wayland_pointer_p.h" // Qt @@ -29,7 +15,6 @@ { namespace Client { - class Q_DECL_HIDDEN Region::Private { public: @@ -58,7 +43,7 @@ void Region::Private::installRegion(const QRegion ®ion) { - for (const auto &rect : region.rects()) { + for (const QRect &rect : region) { installRegion(rect); } } @@ -73,7 +58,7 @@ void Region::Private::uninstallRegion(const QRegion ®ion) { - for (const auto &rect : region.rects()) { + for (const QRect &rect : region) { uninstallRegion(rect); } } @@ -140,12 +125,12 @@ return d->qtRegion; } -Region::operator wl_region*() const +Region::operator wl_region *() const { return d->region; } -Region::operator wl_region*() +Region::operator wl_region *() { return d->region; } diff -Nru dwayland-5.57.0.23/src/client/region.h dwayland-5.57.0.24+really5.24.3/src/client/region.h --- dwayland-5.57.0.23/src/client/region.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/region.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_REGION_H #define WAYLAND_REGION_H #include -#include +#include struct wl_region; @@ -30,7 +16,6 @@ { namespace Client { - /** * @short Wrapper for the wl_region interface. * @@ -48,7 +33,7 @@ Q_OBJECT public: explicit Region(const QRegion ®ion, QObject *parent = nullptr); - virtual ~Region(); + ~Region() override; /** * Setup this Surface to manage the @p region. @@ -106,8 +91,8 @@ **/ QRegion region() const; - operator wl_region*(); - operator wl_region*() const; + operator wl_region *(); + operator wl_region *() const; private: class Private; diff -Nru dwayland-5.57.0.23/src/client/registry.cpp dwayland-5.57.0.24+really5.24.3/src/client/registry.cpp --- dwayland-5.57.0.23/src/client/registry.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/registry.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2018 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "registry.h" +#include "appmenu.h" +#include "blur.h" #include "compositor.h" #include "connection_thread.h" +#include "contrast.h" #include "datacontroldevicemanager.h" #include "datadevicemanager.h" #include "dpms.h" @@ -29,81 +18,84 @@ #include "fullscreen_shell.h" #include "idle.h" #include "idleinhibit.h" -#include "remote_access.h" +#include "keystate.h" #include "logging.h" +#include "output.h" #include "outputconfiguration.h" -#include "outputmanagement.h" #include "outputdevice.h" -#include "output.h" +#include "outputdevice_v2.h" +#include "outputmanagement.h" +#include "outputmanagement_v2.h" #include "plasmashell.h" #include "plasmavirtualdesktop.h" #include "plasmawindowmanagement.h" #include "pointerconstraints.h" #include "pointergestures.h" -#include "primaryselectiondevicemanager_v1.h" -#include "seat.h" -#include "shadow.h" -#include "blur.h" -#include "contrast.h" +#include "primaryoutput_v1.h" #include "relativepointer.h" +#include "remote_access.h" +#include "seat.h" #include "server_decoration.h" -#include "slide.h" +#include "server_decoration_palette.h" +#include "shadow.h" #include "shell.h" #include "shm_pool.h" +#include "slide.h" #include "subcompositor.h" #include "textinput_p.h" -#include "xdgshell.h" -#include "xdgshell_p.h" #include "wayland_pointer_p.h" +#include "xdgdecoration.h" #include "xdgforeign_v2.h" -#include "appmenu.h" -#include "server_decoration_palette.h" #include "xdgoutput.h" -#include "xdgdecoration.h" +#include "xdgshell.h" +#include "xdgshell_p.h" #include "clientmanagement.h" #include "ddeseat.h" #include "ddeshell.h" #include "strut.h" -#include "xwayland_keyboard_grab_v1.h" +#include "globalproperty.h" // Qt #include // wayland +#include "../compat/wayland-xdg-shell-v5-client-protocol.h" +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include "wayland-kde-output-management-v2-client-protocol.h" #include #include #include -#include -#include +#include +#include +#include #include -#include +#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include #include #include -#include "../compat/wayland-xdg-shell-v5-client-protocol.h" -#include -#include -#include -#include -#include +#include #include -#include -#include #include -#include +#include +#include #include #include #include -#include -#include +#include +#include #include /***** @@ -123,8 +115,8 @@ { namespace Client { - -namespace { +namespace +{ struct SuppertedInterfaceData { quint32 maxVersion; QByteArray name; @@ -132,9 +124,10 @@ void (Registry::*announcedSignal)(quint32, quint32); void (Registry::*removedSignal)(quint32); }; +// clang-format off static const QMap s_interfaces = { {Registry::Interface::Compositor, { - 3, + 4, QByteArrayLiteral("wl_compositor"), &wl_compositor_interface, &Registry::compositorAnnounced, @@ -183,21 +176,21 @@ &Registry::subCompositorRemoved }}, {Registry::Interface::PlasmaShell, { - 5, + 6, QByteArrayLiteral("org_kde_plasma_shell"), &org_kde_plasma_shell_interface, &Registry::plasmaShellAnnounced, &Registry::plasmaShellRemoved }}, {Registry::Interface::PlasmaVirtualDesktopManagement, { - 1, + 2, QByteArrayLiteral("org_kde_plasma_virtual_desktop_management"), &org_kde_plasma_virtual_desktop_management_interface, &Registry::plasmaVirtualDesktopManagementAnnounced, &Registry::plasmaVirtualDesktopManagementRemoved }}, {Registry::Interface::PlasmaWindowManagement, { - 9, + 15, QByteArrayLiteral("org_kde_plasma_window_management"), &org_kde_plasma_window_management_interface, &Registry::plasmaWindowManagementAnnounced, @@ -211,33 +204,54 @@ &Registry::idleRemoved }}, {Registry::Interface::RemoteAccessManager, { - 2, + 1, QByteArrayLiteral("org_kde_kwin_remote_access_manager"), &org_kde_kwin_remote_access_manager_interface, &Registry::remoteAccessManagerAnnounced, &Registry::remoteAccessManagerRemoved }}, {Registry::Interface::FakeInput, { - 3, + 4, QByteArrayLiteral("org_kde_kwin_fake_input"), &org_kde_kwin_fake_input_interface, &Registry::fakeInputAnnounced, &Registry::fakeInputRemoved }}, {Registry::Interface::OutputManagement, { - 2, + 4, QByteArrayLiteral("org_kde_kwin_outputmanagement"), &org_kde_kwin_outputmanagement_interface, &Registry::outputManagementAnnounced, &Registry::outputManagementRemoved }}, - {Registry::Interface::OutputDevice, { + {Registry::Interface::OutputManagementV2, { 2, + QByteArrayLiteral("kde_output_management_v2"), + &kde_output_management_v2_interface, + &Registry::outputManagementV2Announced, + &Registry::outputManagementV2Removed + }}, + {Registry::Interface::OutputDevice, { + 4, QByteArrayLiteral("org_kde_kwin_outputdevice"), &org_kde_kwin_outputdevice_interface, &Registry::outputDeviceAnnounced, &Registry::outputDeviceRemoved }}, + {Registry::Interface::OutputDeviceV2, { + 2, + QByteArrayLiteral("kde_output_device_v2"), + &kde_output_device_v2_interface, + &Registry::outputDeviceV2Announced, + &Registry::outputDeviceV2Removed + }}, + {Registry::Interface::PrimaryOutputV1, { + 1, + QByteArrayLiteral("kde_primary_output_v1"), + &kde_primary_output_v1_interface, + &Registry::primaryOutputV1Announced, + &Registry::primaryOutputV1Removed + }}, {Registry::Interface::Shadow, { 2, QByteArrayLiteral("org_kde_kwin_shadow_manager"), @@ -253,7 +267,7 @@ &Registry::blurRemoved }}, {Registry::Interface::Contrast, { - 1, + 2, QByteArrayLiteral("org_kde_kwin_contrast_manager"), &org_kde_kwin_contrast_manager_interface, &Registry::contrastAnnounced, @@ -392,6 +406,20 @@ &Registry::xdgDecorationAnnounced, &Registry::xdgDecorationRemoved }}, + {Registry::Interface::Keystate, { + 1, + QByteArrayLiteral("org_kde_kwin_keystate"), + &org_kde_kwin_keystate_interface, + &Registry::keystateAnnounced, + &Registry::keystateRemoved + }}, + {Registry::Interface::PlasmaActivationFeedback, { + 1, + QByteArrayLiteral("org_kde_plasma_activation_feedback"), + &org_kde_plasma_activation_feedback_interface, + &Registry::plasmaActivationFeedbackAnnounced, + &Registry::plasmaActivationFeedbackRemoved + }}, {Registry::Interface::ClientManagement, { 1, QByteArrayLiteral("com_deepin_client_management"), @@ -399,13 +427,6 @@ &Registry::clientManagementAnnounced, &Registry::clientManagementRemoved }}, - {Registry::Interface::DDESeat, { - 1, - QByteArrayLiteral("dde_seat"), - &dde_seat_interface, - &Registry::ddeSeatAnnounced, - &Registry::ddeSeatRemoved - }}, {Registry::Interface::DDEShell, { 1, QByteArrayLiteral("dde_shell"), @@ -413,6 +434,20 @@ &Registry::ddeShellAnnounced, &Registry::ddeShellRemoved }}, + {Registry::Interface::GlobalProperty, { + 1, + QByteArrayLiteral("dde_globalproperty"), + &dde_globalproperty_interface, + &Registry::ddeGlobalPropertyAnnounced, + &Registry::ddeGlobalPropertyRemoved + }}, + {Registry::Interface::DDESeat, { + 1, + QByteArrayLiteral("dde_seat"), + &dde_seat_interface, + &Registry::ddeSeatAnnounced, + &Registry::ddeSeatRemoved + }}, {Registry::Interface::Strut, { 1, QByteArrayLiteral("com_deepin_kwin_strut"), @@ -420,20 +455,6 @@ &Registry::strutAnnounced, &Registry::strutRemoved }}, - {Registry::Interface::ZWPXwaylandKeyboardGrabV1, { - 1, - QByteArrayLiteral("zwp_xwayland_keyboard_grab_manager_v1"), - &zwp_xwayland_keyboard_grab_manager_v1_interface, - &Registry::xwaylandKeyboardGrabV1Announced, - &Registry::xwaylandKeyboardGrabV1Removed - }}, - {Registry::Interface::PrimarySelectionDeviceManagerV1, { - 1, - QByteArrayLiteral("zwp_primary_selection_device_manager_v1"), - &zwp_primary_selection_device_manager_v1_interface, - &Registry::primarySelectDeviceManagerAnnounced, - &Registry::primarySelectionDeviceManagerV1Removed - }}, {Registry::Interface::DataControlDeviceManager, { 1, QByteArrayLiteral("zwlr_data_control_manager_v1"), @@ -442,6 +463,7 @@ &Registry::dataControlDeviceManagerRemoved }}, }; +// clang-format on static quint32 maxVersion(const Registry::Interface &interface) { @@ -462,9 +484,9 @@ AnnouncedInterface interface(Interface interface) const; QVector interfaces(Interface interface) const; Interface interfaceForName(quint32 name) const; - template + template T *bind(Interface interface, uint32_t name, uint32_t version) const; - template + template T *create(quint32 name, quint32 version, QObject *parent, WL *(Registry::*bindMethod)(uint32_t, uint32_t) const); WaylandPointer registry; @@ -520,7 +542,7 @@ void Registry::destroy() { - emit registryDestroyed(); + Q_EMIT registryDestroyed(); d->registry.destroy(); d->callback.destroy(); } @@ -568,49 +590,45 @@ return d->queue; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_registry_listener Registry::Private::s_registryListener = { - globalAnnounce, - globalRemove -}; +#ifndef K_DOXYGEN +const struct wl_registry_listener Registry::Private::s_registryListener = {globalAnnounce, globalRemove}; -const struct wl_callback_listener Registry::Private::s_callbackListener = { - globalSync -}; +const struct wl_callback_listener Registry::Private::s_callbackListener = {globalSync}; #endif void Registry::Private::globalAnnounce(void *data, wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { - auto r = reinterpret_cast(data); + auto r = reinterpret_cast(data); Q_ASSERT(registry == r->registry); r->handleAnnounce(name, interface, version); } void Registry::Private::globalRemove(void *data, wl_registry *registry, uint32_t name) { - auto r = reinterpret_cast(data); + auto r = reinterpret_cast(data); Q_ASSERT(registry == r->registry); r->handleRemove(name); } -void Registry::Private::globalSync(void* data, wl_callback* callback, uint32_t serial) +void Registry::Private::globalSync(void *data, wl_callback *callback, uint32_t serial) { Q_UNUSED(serial) - auto r = reinterpret_cast(data); + auto r = reinterpret_cast(data); Q_ASSERT(r->callback == callback); r->handleGlobalSync(); - r->callback.destroy(); + r->callback.release(); } void Registry::Private::handleGlobalSync() { - emit q->interfacesAnnounced(); + Q_EMIT q->interfacesAnnounced(); } -namespace { +namespace +{ static Registry::Interface nameToInterface(const char *interface) { - for (auto it = s_interfaces.begin(); it != s_interfaces.end(); ++it) { + for (auto it = s_interfaces.constBegin(); it != s_interfaces.constEnd(); ++it) { if (qstrcmp(interface, it.value().name) == 0) { return it.key(); } @@ -622,7 +640,7 @@ void Registry::Private::handleAnnounce(uint32_t name, const char *interface, uint32_t version) { Interface i = nameToInterface(interface); - emit q->interfaceAnnounced(QByteArray(interface), name, version); + Q_EMIT q->interfaceAnnounced(QByteArray(interface), name, version); if (i == Interface::Unknown) { qCDebug(KWAYLAND_CLIENT) << "Unknown interface announced: " << interface << "/" << name << "/" << version; return; @@ -631,36 +649,32 @@ m_interfaces.append({i, name, version}); auto it = s_interfaces.constFind(i); if (it != s_interfaces.end()) { - emit (q->*it.value().announcedSignal)(name, version); + Q_EMIT(q->*it.value().announcedSignal)(name, version); } } void Registry::Private::handleRemove(uint32_t name) { - auto it = std::find_if(m_interfaces.begin(), m_interfaces.end(), - [name](const InterfaceData &data) { - return data.name == name; - } - ); + auto it = std::find_if(m_interfaces.begin(), m_interfaces.end(), [name](const InterfaceData &data) { + return data.name == name; + }); if (it != m_interfaces.end()) { InterfaceData data = *(it); m_interfaces.erase(it); auto sit = s_interfaces.find(data.interface); if (sit != s_interfaces.end()) { - emit (q->*sit.value().removedSignal)(data.name); + Q_EMIT(q->*sit.value().removedSignal)(data.name); } } - emit q->interfaceRemoved(name); + Q_EMIT q->interfaceRemoved(name); } bool Registry::Private::hasInterface(Registry::Interface interface) const { - auto it = std::find_if(m_interfaces.begin(), m_interfaces.end(), - [interface](const InterfaceData &data) { - return data.interface == interface; - } - ); - return it != m_interfaces.end(); + auto it = std::find_if(m_interfaces.constBegin(), m_interfaces.constEnd(), [interface](const InterfaceData &data) { + return data.interface == interface; + }); + return it != m_interfaces.constEnd(); } QVector Registry::Private::interfaces(Interface interface) const @@ -686,10 +700,9 @@ Registry::Interface Registry::Private::interfaceForName(quint32 name) const { - auto it = std::find_if(m_interfaces.constBegin(), m_interfaces.constEnd(), - [name] (const InterfaceData &data) { - return data.name == name; - }); + auto it = std::find_if(m_interfaces.constBegin(), m_interfaces.constEnd(), [name](const InterfaceData &data) { + return data.name == name; + }); if (it == m_interfaces.constEnd()) { return Interface::Unknown; } @@ -711,6 +724,7 @@ return d->interface(interface); } +// clang-format off #define BIND2(__NAME__, __INAME__, __WL__) \ __WL__ *Registry::bind##__NAME__(uint32_t name, uint32_t version) const \ { \ @@ -718,6 +732,7 @@ } #define BIND(__NAME__, __WL__) BIND2(__NAME__, __NAME__, __WL__) +// clang-format on BIND(Compositor, wl_compositor) BIND(Output, wl_output) @@ -728,13 +743,17 @@ BIND(FullscreenShell, _wl_fullscreen_shell) BIND(DataDeviceManager, wl_data_device_manager) BIND(PlasmaShell, org_kde_plasma_shell) +BIND(PlasmaActivationFeedback, org_kde_plasma_activation_feedback) BIND(PlasmaVirtualDesktopManagement, org_kde_plasma_virtual_desktop_management) BIND(PlasmaWindowManagement, org_kde_plasma_window_management) BIND(Idle, org_kde_kwin_idle) BIND(RemoteAccessManager, org_kde_kwin_remote_access_manager) BIND(FakeInput, org_kde_kwin_fake_input) BIND(OutputManagement, org_kde_kwin_outputmanagement) +BIND(OutputManagementV2, kde_output_management_v2) BIND(OutputDevice, org_kde_kwin_outputdevice) +BIND(OutputDeviceV2, kde_output_device_v2) +BIND(PrimaryOutputV1, kde_primary_output_v1) BIND(ServerSideDecorationManager, org_kde_kwin_server_decoration_manager) BIND(TextInputManagerUnstableV0, wl_text_input_manager) BIND(TextInputManagerUnstableV2, zwp_text_input_manager_v2) @@ -747,6 +766,7 @@ BIND(XdgExporterUnstableV2, zxdg_exporter_v2) BIND(XdgImporterUnstableV2, zxdg_importer_v2) BIND(IdleInhibitManagerUnstableV1, zwp_idle_inhibit_manager_v1) +BIND(Keystate, org_kde_kwin_keystate) BIND2(ShadowManager, Shadow, org_kde_kwin_shadow_manager) BIND2(BlurManager, Blur, org_kde_kwin_blur_manager) BIND2(ContrastManager, Contrast, org_kde_kwin_contrast_manager) @@ -760,30 +780,28 @@ BIND(DDESeat, dde_seat) BIND(DDEShell, dde_shell) BIND(Strut, com_deepin_kwin_strut) -BIND2(ZWPXwaylandKeyboardGrabManagerV1, ZWPXwaylandKeyboardGrabV1, zwp_xwayland_keyboard_grab_manager_v1) -BIND(PrimarySelectionDeviceManagerV1, zwp_primary_selection_device_manager_v1) +BIND(GlobalProperty, dde_globalproperty) BIND(DataControlDeviceManager, zwlr_data_control_manager_v1) #undef BIND #undef BIND2 -template +template T *Registry::Private::create(quint32 name, quint32 version, QObject *parent, WL *(Registry::*bindMethod)(uint32_t, uint32_t) const) { T *t = new T(parent); t->setEventQueue(queue); t->setup((q->*bindMethod)(name, version)); - QObject::connect(q, &Registry::interfaceRemoved, t, - [t, name] (quint32 removed) { - if (name == removed) { - emit t->removed(); - } + QObject::connect(q, &Registry::interfaceRemoved, t, [t, name](quint32 removed) { + if (name == removed) { + Q_EMIT t->removed(); } - ); + }); QObject::connect(q, &Registry::registryDestroyed, t, &T::destroy); return t; } +// clang-format off #define CREATE2(__NAME__, __BINDNAME__) \ __NAME__ *Registry::create##__NAME__(quint32 name, quint32 version, QObject *parent) \ { \ @@ -791,6 +809,7 @@ } #define CREATE(__NAME__) CREATE2(__NAME__, __NAME__) +// clang-format on CREATE(Compositor) CREATE(Seat) @@ -800,13 +819,17 @@ CREATE(Output) CREATE(DataDeviceManager) CREATE(PlasmaShell) +CREATE(PlasmaActivationFeedback) CREATE(PlasmaVirtualDesktopManagement) CREATE(PlasmaWindowManagement) CREATE(Idle) CREATE(RemoteAccessManager) CREATE(FakeInput) CREATE(OutputManagement) +CREATE(OutputManagementV2) CREATE(OutputDevice) +CREATE(OutputDeviceV2) +CREATE(PrimaryOutputV1) CREATE(ShadowManager) CREATE(BlurManager) CREATE(ContrastManager) @@ -815,25 +838,26 @@ CREATE(ServerSideDecorationManager) CREATE2(ShmPool, Shm) CREATE(AppMenuManager) +CREATE(Keystate) CREATE(ServerSideDecorationPaletteManager) CREATE(ClientManagement) CREATE(DDESeat) CREATE(DDEShell) CREATE(Strut) -CREATE(ZWPXwaylandKeyboardGrabManagerV1) +CREATE(GlobalProperty) #undef CREATE #undef CREATE2 XdgExporter *Registry::createXdgExporter(quint32 name, quint32 version, QObject *parent) { - //only V1 supported for now + // only V1 supported for now return d->create(name, version, parent, &Registry::bindXdgExporterUnstableV2); } XdgImporter *Registry::createXdgImporter(quint32 name, quint32 version, QObject *parent) { - //only V1 supported for now + // only V1 supported for now return d->create(name, version, parent, &Registry::bindXdgImporterUnstableV2); } @@ -905,7 +929,7 @@ XdgOutputManager *Registry::createXdgOutputManager(quint32 name, quint32 version, QObject *parent) { - switch(d->interfaceForName(name)) { + switch (d->interfaceForName(name)) { case Interface::XdgOutputUnstableV1: return d->create(name, version, parent, &Registry::bindXdgOutputUnstableV1); default: @@ -915,7 +939,7 @@ XdgDecorationManager *Registry::createXdgDecorationManager(quint32 name, quint32 version, QObject *parent) { - switch(d->interfaceForName(name)) { + switch (d->interfaceForName(name)) { case Interface::XdgDecorationUnstableV1: return d->create(name, version, parent, &Registry::bindXdgDecorationUnstableV1); default: @@ -923,16 +947,6 @@ } } -PrimarySelectionDeviceManagerV1 *Registry::createPrimarySelectionDeviceManagerV1(quint32 name, quint32 version, QObject *parent) -{ - switch(d->interfaceForName(name)) { - case Interface::PrimarySelectionDeviceManagerV1: - return d->create(name, version, parent, &Registry::bindPrimarySelectionDeviceManagerV1); - default: - return nullptr; - } -} - DataControlDeviceManager *Registry::createDataControlDeviceManager(quint32 name, quint32 version, QObject *parent) { switch(d->interfaceForName(name)) { @@ -943,7 +957,8 @@ } } -namespace { +namespace +{ static const wl_interface *wlInterface(Registry::Interface interface) { auto it = s_interfaces.find(interface); @@ -954,17 +969,17 @@ } } -template +template T *Registry::Private::bind(Registry::Interface interface, uint32_t name, uint32_t version) const { - auto it = std::find_if(m_interfaces.begin(), m_interfaces.end(), [=](const InterfaceData &data) { + auto it = std::find_if(m_interfaces.constBegin(), m_interfaces.constEnd(), [=](const InterfaceData &data) { return data.interface == interface && data.name == name && data.version >= version; }); - if (it == m_interfaces.end()) { + if (it == m_interfaces.constEnd()) { qCDebug(KWAYLAND_CLIENT) << "Don't have interface " << int(interface) << "with name " << name << "and minimum version" << version; return nullptr; } - auto t = reinterpret_cast(wl_registry_bind(registry, name, wlInterface(interface), version)); + auto t = reinterpret_cast(wl_registry_bind(registry, name, wlInterface(interface), version)); if (queue) { queue->addProxy(t); } @@ -981,12 +996,12 @@ return d->registry; } -Registry::operator wl_registry*() const +Registry::operator wl_registry *() const { return d->registry; } -Registry::operator wl_registry*() +Registry::operator wl_registry *() { return d->registry; } diff -Nru dwayland-5.57.0.23/src/client/registry.h dwayland-5.57.0.24+really5.24.3/src/client/registry.h --- dwayland-5.57.0.23/src/client/registry.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/registry.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,30 +1,16 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2018 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_REGISTRY_H #define WAYLAND_REGISTRY_H #include #include -#include +#include struct wl_compositor; struct wl_data_device_manager; @@ -40,15 +26,20 @@ struct _wl_fullscreen_shell; struct org_kde_kwin_appmenu_manager; struct org_kde_kwin_outputmanagement; +struct kde_output_management_v2; struct org_kde_kwin_outputdevice; +struct kde_output_device_v2; +struct kde_primary_output_v1; struct org_kde_kwin_fake_input; struct org_kde_kwin_idle; +struct org_kde_kwin_keystate; struct org_kde_kwin_remote_access_manager; struct org_kde_kwin_dpms_manager; struct org_kde_kwin_shadow_manager; struct org_kde_kwin_blur_manager; struct org_kde_kwin_contrast_manager; struct org_kde_kwin_slide_manager; +struct org_kde_plasma_activation_feedback; struct org_kde_plasma_shell; struct org_kde_plasma_virtual_desktop_management; struct org_kde_plasma_window_management; @@ -69,15 +60,13 @@ struct dde_seat; struct dde_shell; struct com_deepin_kwin_strut; -struct zwp_xwayland_keyboard_grab_manager_v1; -struct zwp_primary_selection_device_manager_v1; +struct dde_globalproperty; struct zwlr_data_control_manager_v1; namespace KWayland { namespace Client { - class AppMenuManager; class Compositor; class ConnectionThread; @@ -87,16 +76,21 @@ class FakeInput; class FullscreenShell; class OutputManagement; +class OutputManagementV2; class OutputDevice; +class OutputDeviceV2; class Idle; class IdleInhibitManager; +class Keystate; class RemoteAccessManager; class Output; +class PlasmaActivationFeedback; class PlasmaShell; class PlasmaVirtualDesktopManagement; class PlasmaWindowManagement; class PointerConstraints; class PointerGestures; +class PrimaryOutputV1; class Seat; class ShadowManager; class BlurManager; @@ -122,9 +116,9 @@ class DDESeat; class DDEShell; class Strut; -class ZWPXwaylandKeyboardGrabManagerV1; -class PrimarySelectionDeviceManagerV1; +class GlobalProperty; class DataControlDeviceManager; + /** * @short Wrapper for the wl_registry interface. * @@ -160,12 +154,12 @@ * object. **/ enum class Interface { - Unknown, ///< Refers to an Unknown interface + Unknown, ///< Refers to an Unknown interface Compositor, ///< Refers to the wl_compositor interface - Shell, ///< Refers to the wl_shell interface - Seat, ///< Refers to the wl_seat interface - Shm, ///< Refers to the wl_shm interface - Output, ///< Refers to the wl_output interface + Shell, ///< Refers to the wl_shell interface + Seat, ///< Refers to the wl_seat interface + Shm, ///< Refers to the wl_shm interface + Output, ///< Refers to the wl_output interface FullscreenShell, ///< Refers to the _wl_fullscreen_shell interface SubCompositor, ///< Refers to the wl_subcompositor interface; DataDeviceManager, ///< Refers to the wl_data_device_manager interface @@ -179,35 +173,39 @@ Slide, ///< refers to org_kde_kwin_slide_manager Dpms, ///< Refers to org_kde_kwin_dpms_manager interface OutputManagement, ///< Refers to the wl_data_device_manager interface - OutputDevice, ///< Refers to the org_kde_kwin_outputdevice interface + OutputManagementV2, + OutputDevice, ///< Refers to the org_kde_kwin_outputdevice interface + OutputDeviceV2, + PrimaryOutputV1, ServerSideDecorationManager, ///< Refers to org_kde_kwin_server_decoration_manager - TextInputManagerUnstableV0, ///< Refers to wl_text_input_manager, @since 5.23 - TextInputManagerUnstableV2, ///< Refers to zwp_text_input_manager_v2, @since 5.23 - XdgShellUnstableV5, ///< Refers to xdg_shell (unstable version 5), @since 5.25 - RelativePointerManagerUnstableV1, ///< Refers to zwp_relative_pointer_manager_v1, @since 5.28 - PointerGesturesUnstableV1, ///< Refers to zwp_pointer_gestures_v1, @since 5.29 - PointerConstraintsUnstableV1, ///< Refers to zwp_pointer_constraints_v1, @since 5.29 - XdgExporterUnstableV2, ///< refers to zxdg_exporter_v2, @since 5.40 - XdgImporterUnstableV2, ///< refers to zxdg_importer_v2, @since 5.40 - XdgShellUnstableV6, ///< Refers to zxdg_shell_v6 (unstable version 6), @since 5.39 - IdleInhibitManagerUnstableV1, ///< Refers to zwp_idle_inhibit_manager_v1 (unstable version 1), @since 5.41 - AppMenu, ///Refers to org_kde_kwin_appmenu @since 5.42 - ServerSideDecorationPalette, ///Refers to org_kde_kwin_server_decoration_palette_manager @since 5.42 - RemoteAccessManager, ///< Refers to org_kde_kwin_remote_access_manager interface, @since 5.45 + TextInputManagerUnstableV0, ///< Refers to wl_text_input_manager @since 5.23 + TextInputManagerUnstableV2, ///< Refers to zwp_text_input_manager_v2 @since 5.23 + XdgShellUnstableV5, ///< Refers to xdg_shell (unstable version 5) @since 5.25 + RelativePointerManagerUnstableV1, ///< Refers to zwp_relative_pointer_manager_v1 @since 5.28 + PointerGesturesUnstableV1, ///< Refers to zwp_pointer_gestures_v1 @since 5.29 + PointerConstraintsUnstableV1, ///< Refers to zwp_pointer_constraints_v1 @since 5.29 + XdgExporterUnstableV2, ///< refers to zxdg_exporter_v2 @since 5.40 + XdgImporterUnstableV2, ///< refers to zxdg_importer_v2 @since 5.40 + XdgShellUnstableV6, ///< Refers to zxdg_shell_v6 (unstable version 6) @since 5.39 + IdleInhibitManagerUnstableV1, ///< Refers to zwp_idle_inhibit_manager_v1 (unstable version 1) @since 5.41 + AppMenu, ///< Refers to org_kde_kwin_appmenu @since 5.42 + ServerSideDecorationPalette, ///< Refers to org_kde_kwin_server_decoration_palette_manager @since 5.42 + RemoteAccessManager, ///< Refers to org_kde_kwin_remote_access_manager interface @since 5.45 PlasmaVirtualDesktopManagement, ///< Refers to org_kde_plasma_virtual_desktop_management interface @since 5.52 - XdgOutputUnstableV1, ///refers to zxdg_output_v1, @since 5.47 - XdgShellStable, ///refers to xdg_wm_base @since 5.48 - XdgDecorationUnstableV1, ///refers to zxdg_decoration_manager_v1, @since 5.54 - ClientManagement, ///refers to com_deepin_client_management, @since 5.54 + XdgOutputUnstableV1, ///< refers to zxdg_output_v1 @since 5.47 + XdgShellStable, ///< refers to xdg_wm_base @since 5.48 + XdgDecorationUnstableV1, ///< refers to zxdg_decoration_manager_v1 @since 5.54 + Keystate, ///< refers to org_kwin_keystate @since 5.60 + PlasmaActivationFeedback, ///< Refers to org_kde_plasma_activation_feedback interface, @since 5.83 + ClientManagement,///refers to com_deepin_client_management, @since 5.83 DDESeat, ///refers to dde_shell, @since 5.54 - DDEShell, ///refers to dde_shell, @since 5.54 + DDEShell, /// +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "relativepointer.h" #include "event_queue.h" #include "pointer.h" #include "wayland_pointer_p.h" -#include #include +#include namespace KWayland { namespace Client { - class Q_DECL_HIDDEN RelativePointerManager::Private { public: @@ -76,11 +61,13 @@ return d->queue; } -RelativePointerManager::operator zwp_relative_pointer_manager_v1*() { +RelativePointerManager::operator zwp_relative_pointer_manager_v1 *() +{ return d->relativepointermanagerunstablev1; } -RelativePointerManager::operator zwp_relative_pointer_manager_v1*() const { +RelativePointerManager::operator zwp_relative_pointer_manager_v1 *() const +{ return d->relativepointermanagerunstablev1; } @@ -111,10 +98,14 @@ WaylandPointer relativepointerunstablev1; private: - static void relativeMotionCallback(void *data, zwp_relative_pointer_v1 *zwp_relative_pointer_v1, - uint32_t utime_hi, uint32_t utime_lo, - wl_fixed_t dx, wl_fixed_t dy, - wl_fixed_t dx_unaccel, wl_fixed_t dy_unaccel); + static void relativeMotionCallback(void *data, + zwp_relative_pointer_v1 *zwp_relative_pointer_v1, + uint32_t utime_hi, + uint32_t utime_lo, + wl_fixed_t dx, + wl_fixed_t dy, + wl_fixed_t dx_unaccel, + wl_fixed_t dy_unaccel); RelativePointer *q; @@ -126,21 +117,23 @@ { } -const zwp_relative_pointer_v1_listener RelativePointer::Private::s_listener = { - relativeMotionCallback -}; +const zwp_relative_pointer_v1_listener RelativePointer::Private::s_listener = {relativeMotionCallback}; -void RelativePointer::Private::relativeMotionCallback(void *data, zwp_relative_pointer_v1 *zwp_relative_pointer_v1, - uint32_t utime_hi, uint32_t utime_lo, - wl_fixed_t dx, wl_fixed_t dy, - wl_fixed_t dx_unaccel, wl_fixed_t dy_unaccel) +void RelativePointer::Private::relativeMotionCallback(void *data, + zwp_relative_pointer_v1 *zwp_relative_pointer_v1, + uint32_t utime_hi, + uint32_t utime_lo, + wl_fixed_t dx, + wl_fixed_t dy, + wl_fixed_t dx_unaccel, + wl_fixed_t dy_unaccel) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->relativepointerunstablev1 == zwp_relative_pointer_v1); const QSizeF delta(wl_fixed_to_double(dx), wl_fixed_to_double(dy)); const QSizeF deltaNonAccel(wl_fixed_to_double(dx_unaccel), wl_fixed_to_double(dy_unaccel)); const quint64 timestamp = quint64(utime_lo) | (quint64(utime_hi) << 32); - emit p->q->relativeMotion(delta, deltaNonAccel, timestamp); + Q_EMIT p->q->relativeMotion(delta, deltaNonAccel, timestamp); } void RelativePointer::Private::setup(zwp_relative_pointer_v1 *v1) @@ -177,11 +170,13 @@ d->relativepointerunstablev1.destroy(); } -RelativePointer::operator zwp_relative_pointer_v1*() { +RelativePointer::operator zwp_relative_pointer_v1 *() +{ return d->relativepointerunstablev1; } -RelativePointer::operator zwp_relative_pointer_v1*() const { +RelativePointer::operator zwp_relative_pointer_v1 *() const +{ return d->relativepointerunstablev1; } diff -Nru dwayland-5.57.0.23/src/client/relativepointer.h dwayland-5.57.0.24+really5.24.3/src/client/relativepointer.h --- dwayland-5.57.0.23/src/client/relativepointer.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/relativepointer.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_RELATIVEPOINTER_H #define KWAYLAND_CLIENT_RELATIVEPOINTER_H #include -#include +#include struct zwp_relative_pointer_manager_v1; struct zwp_relative_pointer_v1; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Pointer; class RelativePointer; @@ -71,7 +56,7 @@ * Registry::createRelativePointerManagerUnstableV1. **/ explicit RelativePointerManager(QObject *parent = nullptr); - virtual ~RelativePointerManager(); + ~RelativePointerManager() override; /** * Setup this RelativePointerManagerUnstableV1 to manage the @p relativepointermanagerunstablev1. @@ -121,8 +106,8 @@ **/ RelativePointer *createRelativePointer(Pointer *pointer, QObject *parent = nullptr); - operator zwp_relative_pointer_manager_v1*(); - operator zwp_relative_pointer_manager_v1*() const; + operator zwp_relative_pointer_manager_v1 *(); + operator zwp_relative_pointer_manager_v1 *() const; Q_SIGNALS: /** @@ -151,7 +136,7 @@ { Q_OBJECT public: - virtual ~RelativePointer(); + ~RelativePointer() override; /** * Setup this RelativePointerUnstableV1 to manage the @p relativepointerunstablev1. @@ -185,8 +170,8 @@ **/ void destroy(); - operator zwp_relative_pointer_v1*(); - operator zwp_relative_pointer_v1*() const; + operator zwp_relative_pointer_v1 *(); + operator zwp_relative_pointer_v1 *() const; Q_SIGNALS: /** @@ -229,7 +214,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/remote_access.cpp dwayland-5.57.0.24+really5.24.3/src/client/remote_access.cpp --- dwayland-5.57.0.23/src/client/remote_access.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/remote_access.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2016 Oleg Chernovskiy +/* + SPDX-FileCopyrightText: 2016 Oleg Chernovskiy -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "remote_access.h" #include "event_queue.h" #include "wayland_pointer_p.h" @@ -164,7 +150,7 @@ WaylandPointer remotebuffer; RemoteBuffer *q; - + qint32 fd = 0; quint32 width = 0; quint32 height = 0; diff -Nru dwayland-5.57.0.23/src/client/remote_access.h dwayland-5.57.0.24+really5.24.3/src/client/remote_access.h --- dwayland-5.57.0.23/src/client/remote_access.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/remote_access.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2016 Oleg Chernovskiy +/* + SPDX-FileCopyrightText: 2016 Oleg Chernovskiy -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_REMOTE_ACCESS_H #define KWAYLAND_CLIENT_REMOTE_ACCESS_H #include -#include +#include struct org_kde_kwin_remote_access_manager; struct org_kde_kwin_remote_buffer; @@ -188,7 +174,7 @@ operator org_kde_kwin_remote_buffer*(); operator org_kde_kwin_remote_buffer*() const; - + qint32 fd() const; quint32 width() const; quint32 height() const; diff -Nru dwayland-5.57.0.23/src/client/seat.cpp dwayland-5.57.0.24+really5.24.3/src/client/seat.cpp --- dwayland-5.57.0.23/src/client/seat.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/seat.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "seat.h" #include "event_queue.h" #include "keyboard.h" @@ -30,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN Seat::Private { public: @@ -71,10 +56,7 @@ wl_seat_add_listener(seat, &s_listener, this); } -const wl_seat_listener Seat::Private::s_listener = { - capabilitiesCallback, - nameCallback -}; +const wl_seat_listener Seat::Private::s_listener = {capabilitiesCallback, nameCallback}; Seat::Seat(QObject *parent) : QObject(parent) @@ -92,7 +74,7 @@ if (!d->seat) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->seat.release(); d->resetSeat(); } @@ -102,7 +84,7 @@ if (!d->seat) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->seat.destroy(); d->resetSeat(); } @@ -131,7 +113,7 @@ return; } capabilityKeyboard = has; - emit q->hasKeyboardChanged(capabilityKeyboard); + Q_EMIT q->hasKeyboardChanged(capabilityKeyboard); } void Seat::Private::setHasPointer(bool has) @@ -140,7 +122,7 @@ return; } capabilityPointer = has; - emit q->hasPointerChanged(capabilityPointer); + Q_EMIT q->hasPointerChanged(capabilityPointer); } void Seat::Private::setHasTouch(bool has) @@ -149,7 +131,7 @@ return; } capabilityTouch = has; - emit q->hasTouchChanged(capabilityTouch); + Q_EMIT q->hasTouchChanged(capabilityTouch); } void Seat::setup(wl_seat *seat) @@ -159,14 +141,14 @@ void Seat::Private::capabilitiesCallback(void *data, wl_seat *seat, uint32_t capabilities) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->seat == seat); s->capabilitiesChanged(capabilities); } void Seat::Private::nameCallback(void *data, wl_seat *seat, const char *name) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->seat == seat); s->setName(QString::fromUtf8(name)); } @@ -229,7 +211,7 @@ return; } name = n; - emit q->nameChanged(name); + Q_EMIT q->nameChanged(name); } bool Seat::isValid() const @@ -257,12 +239,12 @@ return d->name; } -Seat::operator wl_seat*() +Seat::operator wl_seat *() { return d->seat; } -Seat::operator wl_seat*() const +Seat::operator wl_seat *() const { return d->seat; } diff -Nru dwayland-5.57.0.23/src/client/seat.h dwayland-5.57.0.24+really5.24.3/src/client/seat.h --- dwayland-5.57.0.23/src/client/seat.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/seat.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SEAT_H #define WAYLAND_SEAT_H #include -#include +#include struct wl_seat; struct wl_touch; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Keyboard; class Pointer; @@ -86,7 +71,7 @@ Q_PROPERTY(QString name READ name NOTIFY nameChanged) public: explicit Seat(QObject *parent = nullptr); - virtual ~Seat(); + ~Seat() override; /** * @returns @c true if managing a wl_seat. @@ -139,8 +124,8 @@ bool hasPointer() const; bool hasTouch() const; QString name() const; - operator wl_seat*(); - operator wl_seat*() const; + operator wl_seat *(); + operator wl_seat *() const; /** * Creates a Keyboard. diff -Nru dwayland-5.57.0.23/src/client/server_decoration.cpp dwayland-5.57.0.24+really5.24.3/src/client/server_decoration.cpp --- dwayland-5.57.0.23/src/client/server_decoration.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/server_decoration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "server_decoration.h" #include "event_queue.h" #include "logging.h" @@ -31,7 +17,6 @@ { namespace Client { - class Q_DECL_HIDDEN ServerSideDecorationManager::Private { public: @@ -42,7 +27,7 @@ WaylandPointer serversidedecorationmanager; EventQueue *queue = nullptr; ServerSideDecoration::Mode defaultMode = ServerSideDecoration::Mode::None; - QVector decorations; + QVector decorations; private: static void defaultModeCallback(void *data, org_kde_kwin_server_decoration_manager *manager, uint32_t mode); @@ -67,15 +52,13 @@ ServerSideDecoration *q; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const org_kde_kwin_server_decoration_manager_listener ServerSideDecorationManager::Private::s_listener = { - defaultModeCallback -}; +#ifndef K_DOXYGEN +const org_kde_kwin_server_decoration_manager_listener ServerSideDecorationManager::Private::s_listener = {defaultModeCallback}; #endif void ServerSideDecorationManager::Private::defaultModeCallback(void *data, org_kde_kwin_server_decoration_manager *manager, uint32_t mode) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->serversidedecorationmanager == manager); ServerSideDecoration::Mode m; @@ -146,11 +129,13 @@ return d->queue; } -ServerSideDecorationManager::operator org_kde_kwin_server_decoration_manager*() { +ServerSideDecorationManager::operator org_kde_kwin_server_decoration_manager *() +{ return d->serversidedecorationmanager; } -ServerSideDecorationManager::operator org_kde_kwin_server_decoration_manager*() const { +ServerSideDecorationManager::operator org_kde_kwin_server_decoration_manager *() const +{ return d->serversidedecorationmanager; } @@ -178,10 +163,8 @@ return deco; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const org_kde_kwin_server_decoration_listener ServerSideDecoration::Private::s_listener = { - modeCallback -}; +#ifndef K_DOXYGEN +const org_kde_kwin_server_decoration_listener ServerSideDecoration::Private::s_listener = {modeCallback}; #endif ServerSideDecoration::Private::Private(ServerSideDecoration *q) @@ -192,7 +175,7 @@ void ServerSideDecoration::Private::modeCallback(void *data, org_kde_kwin_server_decoration *decoration, uint32_t mode) { Q_UNUSED(decoration) - Private *p = reinterpret_cast(data); + Private *p = reinterpret_cast(data); Mode m; switch (mode) { case ORG_KDE_KWIN_SERVER_DECORATION_MODE_NONE: @@ -210,7 +193,7 @@ return; } p->mode = m; - emit p->q->modeChanged(); + Q_EMIT p->q->modeChanged(); } ServerSideDecoration::ServerSideDecoration(QObject *parent) @@ -247,11 +230,13 @@ d->serversidedecoration.destroy(); } -ServerSideDecoration::operator org_kde_kwin_server_decoration*() { +ServerSideDecoration::operator org_kde_kwin_server_decoration *() +{ return d->serversidedecoration; } -ServerSideDecoration::operator org_kde_kwin_server_decoration*() const { +ServerSideDecoration::operator org_kde_kwin_server_decoration *() const +{ return d->serversidedecoration; } diff -Nru dwayland-5.57.0.23/src/client/server_decoration.h dwayland-5.57.0.24+really5.24.3/src/client/server_decoration.h --- dwayland-5.57.0.23/src/client/server_decoration.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/server_decoration.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_SERVER_DECORATION_H #define KWAYLAND_CLIENT_SERVER_DECORATION_H #include -#include +#include struct org_kde_kwin_server_decoration_manager; struct org_kde_kwin_server_decoration; @@ -32,7 +18,6 @@ { namespace Client { - class EventQueue; class Surface; class ServerSideDecoration; @@ -72,7 +57,7 @@ * Registry::createServerSideDecorationManager. **/ explicit ServerSideDecorationManager(QObject *parent = nullptr); - virtual ~ServerSideDecorationManager(); + ~ServerSideDecorationManager() override; /** * Setup this ServerSideDecorationManager to manage the @p serversidedecorationmanager. @@ -120,8 +105,8 @@ ServerSideDecoration *create(Surface *surface, QObject *parent = nullptr); ServerSideDecoration *create(wl_surface *surface, QObject *parent = nullptr); - operator org_kde_kwin_server_decoration_manager*(); - operator org_kde_kwin_server_decoration_manager*() const; + operator org_kde_kwin_server_decoration_manager *(); + operator org_kde_kwin_server_decoration_manager *() const; Q_SIGNALS: /** @@ -149,7 +134,7 @@ { Q_OBJECT public: - virtual ~ServerSideDecoration(); + ~ServerSideDecoration() override; /** * Setup this ServerSideDecoration to manage the @p serversidedecoration. @@ -227,8 +212,8 @@ **/ Mode defaultMode() const; - operator org_kde_kwin_server_decoration*(); - operator org_kde_kwin_server_decoration*() const; + operator org_kde_kwin_server_decoration *(); + operator org_kde_kwin_server_decoration *() const; Q_SIGNALS: /** @@ -245,7 +230,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/server_decoration_palette.cpp dwayland-5.57.0.24+really5.24.3/src/client/server_decoration_palette.cpp --- dwayland-5.57.0.23/src/client/server_decoration_palette.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/server_decoration_palette.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "server_decoration_palette.h" #include "event_queue.h" #include "surface.h" @@ -30,7 +16,6 @@ { namespace Client { - class ServerSideDecorationPaletteManager::Private { public: @@ -75,11 +60,13 @@ d->serverdecomanager.destroy(); } -ServerSideDecorationPaletteManager::operator org_kde_kwin_server_decoration_palette_manager*() { +ServerSideDecorationPaletteManager::operator org_kde_kwin_server_decoration_palette_manager *() +{ return d->serverdecomanager; } -ServerSideDecorationPaletteManager::operator org_kde_kwin_server_decoration_palette_manager*() const { +ServerSideDecorationPaletteManager::operator org_kde_kwin_server_decoration_palette_manager *() const +{ return d->serverdecomanager; } @@ -114,24 +101,14 @@ class ServerSideDecorationPalette::Private { public: - Private(ServerSideDecorationPalette *q); - void setup(org_kde_kwin_server_decoration_palette *arg); WaylandPointer decoration_palette; - -private: - ServerSideDecorationPalette *q; }; -ServerSideDecorationPalette::Private::Private(ServerSideDecorationPalette *q) - : q(q) -{ -} - ServerSideDecorationPalette::ServerSideDecorationPalette(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new Private) { } @@ -162,11 +139,13 @@ d->decoration_palette.destroy(); } -ServerSideDecorationPalette::operator org_kde_kwin_server_decoration_palette*() { +ServerSideDecorationPalette::operator org_kde_kwin_server_decoration_palette *() +{ return d->decoration_palette; } -ServerSideDecorationPalette::operator org_kde_kwin_server_decoration_palette*() const { +ServerSideDecorationPalette::operator org_kde_kwin_server_decoration_palette *() const +{ return d->decoration_palette; } diff -Nru dwayland-5.57.0.23/src/client/server_decoration_palette.h dwayland-5.57.0.24+really5.24.3/src/client/server_decoration_palette.h --- dwayland-5.57.0.23/src/client/server_decoration_palette.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/server_decoration_palette.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_SERVER_DECORATION_PALETTE_H #define KWAYLAND_CLIENT_SERVER_DECORATION_PALETTE_H #include -#include +#include struct org_kde_kwin_server_decoration_palette_manager; struct org_kde_kwin_server_decoration_palette; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Surface; class ServerSideDecorationPalette; @@ -70,7 +55,7 @@ * Registry::createServerSideDecorationPaletteManager. **/ explicit ServerSideDecorationPaletteManager(QObject *parent = nullptr); - virtual ~ServerSideDecorationPaletteManager(); + ~ServerSideDecorationPaletteManager() override; /** * Setup this ServerSideDecorationPaletteManager to manage the @p serverSideDecorationPaletteManager. @@ -117,8 +102,8 @@ ServerSideDecorationPalette *create(Surface *surface, QObject *parent = nullptr); - operator org_kde_kwin_server_decoration_palette_manager*(); - operator org_kde_kwin_server_decoration_palette_manager*() const; + operator org_kde_kwin_server_decoration_palette_manager *(); + operator org_kde_kwin_server_decoration_palette_manager *() const; Q_SIGNALS: /** @@ -138,7 +123,7 @@ { Q_OBJECT public: - virtual ~ServerSideDecorationPalette(); + ~ServerSideDecorationPalette() override; /** * Setup this ServerSideDecorationPalette to manage the @p serversidedecorationpalette. @@ -181,8 +166,8 @@ */ void setPalette(const QString &palette); - operator org_kde_kwin_server_decoration_palette*(); - operator org_kde_kwin_server_decoration_palette*() const; + operator org_kde_kwin_server_decoration_palette *(); + operator org_kde_kwin_server_decoration_palette *() const; private: friend class ServerSideDecorationPaletteManager; @@ -191,7 +176,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/shadow.cpp dwayland-5.57.0.24+really5.24.3/src/client/shadow.cpp --- dwayland-5.57.0.23/src/client/shadow.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shadow.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "shadow.h" #include "event_queue.h" #include "surface.h" @@ -28,10 +14,8 @@ namespace KWayland { - namespace Client { - class Q_DECL_HIDDEN ShadowManager::Private { public: @@ -102,12 +86,12 @@ org_kde_kwin_shadow_manager_unset(d->manager, *surface); } -ShadowManager::operator org_kde_kwin_shadow_manager*() +ShadowManager::operator org_kde_kwin_shadow_manager *() { return d->manager; } -ShadowManager::operator org_kde_kwin_shadow_manager*() const +ShadowManager::operator org_kde_kwin_shadow_manager *() const { return d->manager; } @@ -166,7 +150,8 @@ org_kde_kwin_shadow_commit(d->shadow); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS +// clang-format off +#ifndef K_DOXYGEN #define attach( __PART__, __WAYLAND_PART__ ) \ void Shadow::attach##__PART__(wl_buffer *buffer) \ { \ @@ -184,25 +169,20 @@ { \ attach##__PART__(buffer.toStrongRef().data()); \ } +// clang-format on -attach(Left, left) -attach(TopLeft, top_left) -attach(Top, top) -attach(TopRight, top_right) -attach(Right, right) -attach(BottomRight, bottom_right) -attach(Bottom, bottom) -attach(BottomLeft, bottom_left) +attach(Left, left) attach(TopLeft, top_left) attach(Top, top) attach(TopRight, top_right) attach(Right, right) attach(BottomRight, bottom_right) + attach(Bottom, bottom) attach(BottomLeft, bottom_left) #undef attach #endif -Shadow::operator org_kde_kwin_shadow*() + Shadow::operator org_kde_kwin_shadow *() { return d->shadow; } -Shadow::operator org_kde_kwin_shadow*() const +Shadow::operator org_kde_kwin_shadow *() const { return d->shadow; } diff -Nru dwayland-5.57.0.23/src/client/shadow.h dwayland-5.57.0.24+really5.24.3/src/client/shadow.h --- dwayland-5.57.0.23/src/client/shadow.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shadow.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_SHADOW_H #define KWAYLAND_SHADOW_H @@ -26,20 +12,18 @@ #include #include -#include +#include struct wl_buffer; struct org_kde_kwin_shadow; struct org_kde_kwin_shadow_manager; class QMarginsF; -class QWindow; namespace KWayland { namespace Client { - class EventQueue; class Shadow; class Surface; @@ -79,7 +63,7 @@ * Registry::createShadowManager. **/ explicit ShadowManager(QObject *parent = nullptr); - virtual ~ShadowManager(); + ~ShadowManager() override; /** * @returns @c true if managing a org_kde_kwin_shadow_manager. @@ -130,8 +114,8 @@ Shadow *createShadow(Surface *surface, QObject *parent = nullptr); void removeShadow(Surface *surface); - operator org_kde_kwin_shadow_manager*(); - operator org_kde_kwin_shadow_manager*() const; + operator org_kde_kwin_shadow_manager *(); + operator org_kde_kwin_shadow_manager *() const; Q_SIGNALS: /** @@ -166,7 +150,7 @@ { Q_OBJECT public: - virtual ~Shadow(); + ~Shadow() override; /** * Setup this Shadow to manage the @p shadow. @@ -229,8 +213,8 @@ void attachBottomLeft(Buffer::Ptr buffer); void setOffsets(const QMarginsF &margins); - operator org_kde_kwin_shadow*(); - operator org_kde_kwin_shadow*() const; + operator org_kde_kwin_shadow *(); + operator org_kde_kwin_shadow *() const; private: friend class ShadowManager; @@ -243,4 +227,3 @@ } #endif - diff -Nru dwayland-5.57.0.23/src/client/shell.cpp dwayland-5.57.0.24+really5.24.3/src/client/shell.cpp --- dwayland-5.57.0.23/src/client/shell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "shell.h" #include "event_queue.h" #include "output.h" @@ -26,7 +12,6 @@ // Qt #include #include -#include #include // Wayland #include @@ -35,7 +20,6 @@ { namespace Client { - class Q_DECL_HIDDEN Shell::Private { public: @@ -59,7 +43,7 @@ if (!d->shell) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->shell.destroy(); } @@ -68,7 +52,7 @@ if (!d->shell) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->shell.release(); } @@ -114,12 +98,12 @@ return d->shell.isValid(); } -Shell::operator wl_shell*() +Shell::operator wl_shell *() { return d->shell; } -Shell::operator wl_shell*() const +Shell::operator wl_shell *() const { return d->shell; } @@ -132,7 +116,7 @@ WaylandPointer surface; QSize size; - static QVector s_surfaces; + static QVector s_surfaces; private: void ping(uint32_t serial); @@ -144,7 +128,7 @@ static const struct wl_shell_surface_listener s_listener; }; -QVector ShellSurface::Private::s_surfaces = QVector(); +QVector ShellSurface::Private::s_surfaces = QVector(); ShellSurface::Private::Private(ShellSurface *q) : q(q) @@ -169,7 +153,7 @@ return nullptr; } window->create(); - wl_shell_surface *s = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("wl_shell_surface"), window)); + wl_shell_surface *s = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("wl_shell_surface"), window)); if (!s) { return nullptr; } @@ -200,11 +184,9 @@ ShellSurface *ShellSurface::get(wl_shell_surface *native) { - auto it = std::find_if(Private::s_surfaces.constBegin(), Private::s_surfaces.constEnd(), - [native](ShellSurface *s) { - return s->d->surface == native; - } - ); + auto it = std::find_if(Private::s_surfaces.constBegin(), Private::s_surfaces.constEnd(), [native](ShellSurface *s) { + return s->d->surface == native; + }); if (it != Private::s_surfaces.constEnd()) { return *(it); } @@ -234,34 +216,30 @@ d->surface.destroy(); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_shell_surface_listener ShellSurface::Private::s_listener = { - pingCallback, - configureCallback, - popupDoneCallback -}; +#ifndef K_DOXYGEN +const struct wl_shell_surface_listener ShellSurface::Private::s_listener = {pingCallback, configureCallback, popupDoneCallback}; #endif void ShellSurface::Private::configureCallback(void *data, wl_shell_surface *shellSurface, uint32_t edges, int32_t width, int32_t height) { Q_UNUSED(edges) - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->surface == shellSurface); s->q->setSize(QSize(width, height)); } void ShellSurface::Private::pingCallback(void *data, wl_shell_surface *shellSurface, uint32_t serial) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->surface == shellSurface); s->ping(serial); } void ShellSurface::Private::popupDoneCallback(void *data, wl_shell_surface *shellSurface) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->surface == shellSurface); - emit s->q->popupDone(); + Q_EMIT s->q->popupDone(); } void ShellSurface::setup(wl_shell_surface *surface) @@ -272,7 +250,7 @@ void ShellSurface::Private::ping(uint32_t serial) { wl_shell_surface_pong(surface, serial); - emit q->pinged(); + Q_EMIT q->pinged(); } void ShellSurface::setSize(const QSize &size) @@ -281,7 +259,7 @@ return; } d->size = size; - emit sizeChanged(size); + Q_EMIT sizeChanged(size); } void ShellSurface::setFullscreen(Output *output) @@ -363,6 +341,16 @@ wl_shell_surface_resize(d->surface, *seat, serial, wlEdge); } +void ShellSurface::setTitle(const QString &title) +{ + wl_shell_surface_set_title(d->surface, title.toUtf8().constData()); +} + +void ShellSurface::setWindowClass(const QByteArray &windowClass) +{ + wl_shell_surface_set_class(d->surface, windowClass.constData()); +} + QSize ShellSurface::size() const { return d->size; @@ -373,12 +361,12 @@ return d->surface.isValid(); } -ShellSurface::operator wl_shell_surface*() +ShellSurface::operator wl_shell_surface *() { return d->surface; } -ShellSurface::operator wl_shell_surface*() const +ShellSurface::operator wl_shell_surface *() const { return d->surface; } diff -Nru dwayland-5.57.0.23/src/client/shell.h dwayland-5.57.0.24+really5.24.3/src/client/shell.h --- dwayland-5.57.0.23/src/client/shell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shell.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SHELL_H #define WAYLAND_SHELL_H @@ -25,7 +11,7 @@ #include #include -#include +#include struct wl_surface; struct wl_shell; @@ -71,7 +57,7 @@ Q_OBJECT public: explicit Shell(QObject *parent = nullptr); - virtual ~Shell(); + ~Shell() override; /** * @returns @c true if managing a wl_shell. @@ -139,8 +125,8 @@ **/ ShellSurface *createSurface(Surface *surface, QObject *parent = nullptr); - operator wl_shell*(); - operator wl_shell*() const; + operator wl_shell *(); + operator wl_shell *() const; Q_SIGNALS: /** @@ -186,7 +172,7 @@ Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged) public: explicit ShellSurface(QObject *parent); - virtual ~ShellSurface(); + ~ShellSurface() override; /** * Releases the wl_shell_surface interface. @@ -234,7 +220,7 @@ **/ enum class TransientFlag { Default = 0x0, ///< Default: transient surface accepts keyboard focus - NoFocus = 0x1 ///< Transient surface does not accept keyboard focus + NoFocus = 0x1, ///< Transient surface does not accept keyboard focus }; Q_DECLARE_FLAGS(TransientFlags, TransientFlag) /** @@ -265,7 +251,8 @@ * @param flags The flags for the transient * @since 5.33 **/ - void setTransientPopup(Surface *parent, Seat *grabbedSeat, quint32 grabSerial, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default); + void + setTransientPopup(Surface *parent, Seat *grabbedSeat, quint32 grabSerial, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default); bool isValid() const; @@ -289,6 +276,27 @@ void requestResize(Seat *seat, quint32 serial, Qt::Edges edges); /** + * Sets a short title for the surface. + * + * This string may be used to identify the surface in a task bar, window list, or other user + * interface elements provided by the compositor. + * + * @since 5.55 + **/ + void setTitle(const QString &title); + + /** + * Sets a window class for the surface. + * + * The surface class identifies the general class of applications to which the surface belongs. + * A common convention is to use the file name (or the full path if it is a non-standard location) + * of the application's .desktop file as the class. + * + * @since 5.55 + **/ + void setWindowClass(const QByteArray &windowClass); + + /** * Creates a ShellSurface for the given @p window. * This is an integration feature for QtWayland. On non-wayland platforms this method returns * @c nullptr as well as for not created QWindows. @@ -317,8 +325,8 @@ **/ static ShellSurface *get(wl_shell_surface *native); - operator wl_shell_surface*(); - operator wl_shell_surface*() const; + operator wl_shell_surface *(); + operator wl_shell_surface *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/shm_pool.cpp dwayland-5.57.0.24+really5.24.3/src/client/shm_pool.cpp --- dwayland-5.57.0.23/src/client/shm_pool.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shm_pool.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,11 @@ -/******************************************************************** -Copyright 2013 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2013 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "shm_pool.h" -#include "event_queue.h" -#include "buffer.h" #include "buffer_p.h" +#include "event_queue.h" #include "logging.h" #include "wayland_pointer_p.h" // Qt @@ -28,8 +13,8 @@ #include #include // system -#include #include +#include // wayland #include @@ -37,7 +22,6 @@ { namespace Client { - class Q_DECL_HIDDEN ShmPool::Private { public: @@ -54,6 +38,7 @@ int offset = 0; QList> buffers; EventQueue *queue = nullptr; + private: ShmPool *q; }; @@ -64,7 +49,6 @@ { } - ShmPool::ShmPool(QObject *parent) : QObject(parent) , d(new Private(this)) @@ -141,7 +125,7 @@ poolData = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, tmpFile->handle(), 0); pool.setup(wl_shm_create_pool(shm, tmpFile->handle(), size)); - if (!poolData || !pool) { + if (poolData == MAP_FAILED || !pool) { qCDebug(KWAYLAND_CLIENT) << "Creating Shm pool failed"; return false; } @@ -158,15 +142,16 @@ munmap(poolData, size); poolData = mmap(nullptr, newSize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpFile->handle(), 0); size = newSize; - if (!poolData) { + if (poolData == MAP_FAILED) { qCDebug(KWAYLAND_CLIENT) << "Resizing Shm pool failed"; return false; } - emit q->poolResized(); + Q_EMIT q->poolResized(); return true; } -namespace { +namespace +{ static Buffer::Format toBufferFormat(const QImage &image) { switch (image.format()) { @@ -184,7 +169,7 @@ } } -Buffer::Ptr ShmPool::createBuffer(const QImage& image) +Buffer::Ptr ShmPool::createBuffer(const QImage &image) { if (image.isNull() || !d->valid) { return QWeakPointer(); @@ -216,7 +201,8 @@ return QWeakPointer(*it); } -namespace { +namespace +{ static wl_shm_format toWaylandFormat(Buffer::Format format) { switch (format) { @@ -258,8 +244,7 @@ } } // we don't have a buffer which we could reuse - need to create a new one - wl_buffer *native = wl_shm_pool_create_buffer(pool, offset, s.width(), s.height(), - stride, toWaylandFormat(format)); + wl_buffer *native = wl_shm_pool_create_buffer(pool, offset, s.width(), s.height(), stride, toWaylandFormat(format)); if (!native) { return buffers.end(); } @@ -277,7 +262,7 @@ return d->valid; } -void* ShmPool::poolAddress() const +void *ShmPool::poolAddress() const { return d->poolData; } diff -Nru dwayland-5.57.0.23/src/client/shm_pool.h dwayland-5.57.0.24+really5.24.3/src/client/shm_pool.h --- dwayland-5.57.0.23/src/client/shm_pool.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/shm_pool.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SHM_POOL_H #define WAYLAND_SHM_POOL_H #include #include "buffer.h" -#include +#include class QImage; class QSize; @@ -34,7 +20,6 @@ { namespace Client { - class EventQueue; /** @@ -132,7 +117,7 @@ Q_OBJECT public: explicit ShmPool(QObject *parent = nullptr); - virtual ~ShmPool(); + ~ShmPool() override; /** * @returns @c true if the ShmPool references a wl_shm interface and the shared memory pool * is setup. diff -Nru dwayland-5.57.0.23/src/client/slide.cpp dwayland-5.57.0.24+really5.24.3/src/client/slide.cpp --- dwayland-5.57.0.23/src/client/slide.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/slide.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,12 @@ -/**************************************************************************** -Copyright 2015 Marco Martin +/* + SPDX-FileCopyrightText: 2015 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "slide.h" #include "event_queue.h" -#include "wayland_pointer_p.h" #include "surface.h" +#include "wayland_pointer_p.h" #include @@ -28,7 +14,6 @@ { namespace Client { - class Q_DECL_HIDDEN SlideManager::Private { public: @@ -76,11 +61,13 @@ return d->queue; } -SlideManager::operator org_kde_kwin_slide_manager*() { +SlideManager::operator org_kde_kwin_slide_manager *() +{ return d->slidemanager; } -SlideManager::operator org_kde_kwin_slide_manager*() const { +SlideManager::operator org_kde_kwin_slide_manager *() const +{ return d->slidemanager; } @@ -142,11 +129,13 @@ d->slide.destroy(); } -Slide::operator org_kde_kwin_slide*() { +Slide::operator org_kde_kwin_slide *() +{ return d->slide; } -Slide::operator org_kde_kwin_slide*() const { +Slide::operator org_kde_kwin_slide *() const +{ return d->slide; } @@ -171,7 +160,5 @@ org_kde_kwin_slide_set_offset(d->slide, offset); } - } } - diff -Nru dwayland-5.57.0.23/src/client/slide.h dwayland-5.57.0.24+really5.24.3/src/client/slide.h --- dwayland-5.57.0.23/src/client/slide.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/slide.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2015 Marco Martin +/* + SPDX-FileCopyrightText: 2015 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_SLIDE_H #define KWAYLAND_CLIENT_SLIDE_H #include -#include +#include struct org_kde_kwin_slide_manager; struct org_kde_kwin_slide; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class Slide; class Surface; @@ -77,7 +62,7 @@ * Registry::createSlideManager. **/ explicit SlideManager(QObject *parent = nullptr); - virtual ~SlideManager(); + ~SlideManager() override; /** * Setup this SlideManager to manage the @p slidemanager. @@ -124,8 +109,8 @@ void removeSlide(Surface *surface); - operator org_kde_kwin_slide_manager*(); - operator org_kde_kwin_slide_manager*() const; + operator org_kde_kwin_slide_manager *(); + operator org_kde_kwin_slide_manager *() const; Q_SIGNALS: /** @@ -152,10 +137,10 @@ Left = 0, /**< Slide from the left edge of the screen */ Top, /**< Slide from the top edge of the screen */ Right, /**< Slide from the bottom edge of the screen */ - Bottom /**< Slide from the bottom edge of the screen */ + Bottom, /**< Slide from the bottom edge of the screen */ }; - virtual ~Slide(); + ~Slide() override; /** * Setup this Slide to manage the @p slide. @@ -207,8 +192,8 @@ */ void setOffset(qint32 offset); - operator org_kde_kwin_slide*(); - operator org_kde_kwin_slide*() const; + operator org_kde_kwin_slide *(); + operator org_kde_kwin_slide *() const; private: friend class SlideManager; @@ -217,7 +202,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/strut.cpp dwayland-5.57.0.24+really5.24.3/src/client/strut.cpp --- dwayland-5.57.0.23/src/client/strut.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/strut.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -65,7 +65,7 @@ if (!d->strut) { return; } - emit interfaceAboutToBeReleased(); + Q_EMIT interfaceAboutToBeReleased(); d->strut.release(); } @@ -74,7 +74,7 @@ if (!d->strut) { return; } - emit interfaceAboutToBeDestroyed(); + Q_EMIT interfaceAboutToBeDestroyed(); d->strut.destroy(); } diff -Nru dwayland-5.57.0.23/src/client/strut.h dwayland-5.57.0.24+really5.24.3/src/client/strut.h --- dwayland-5.57.0.23/src/client/strut.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/strut.h 2022-11-18 03:38:26.000000000 +0000 @@ -21,7 +21,7 @@ #define KWAYLAND_STRUT_H #include -#include +#include struct wl_surface; struct com_deepin_kwin_strut; diff -Nru dwayland-5.57.0.23/src/client/subcompositor.cpp dwayland-5.57.0.24+really5.24.3/src/client/subcompositor.cpp --- dwayland-5.57.0.23/src/client/subcompositor.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/subcompositor.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "subcompositor.h" #include "event_queue.h" #include "subsurface.h" @@ -29,7 +15,6 @@ { namespace Client { - class Q_DECL_HIDDEN SubCompositor::Private { public: @@ -82,12 +67,12 @@ return d->subCompositor.isValid(); } -SubCompositor::operator wl_subcompositor*() +SubCompositor::operator wl_subcompositor *() { return d->subCompositor; } -SubCompositor::operator wl_subcompositor*() const +SubCompositor::operator wl_subcompositor *() const { return d->subCompositor; } diff -Nru dwayland-5.57.0.23/src/client/subcompositor.h dwayland-5.57.0.24+really5.24.3/src/client/subcompositor.h --- dwayland-5.57.0.23/src/client/subcompositor.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/subcompositor.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SUBCOMPOSITOR_H #define WAYLAND_SUBCOMPOSITOR_H #include #include -#include +#include struct wl_subcompositor; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class SubSurface; class Surface; @@ -51,7 +36,7 @@ Q_OBJECT public: explicit SubCompositor(QObject *parent = nullptr); - virtual ~SubCompositor(); + ~SubCompositor() override; /** * @returns @c true if managing a wl_subcompositor. @@ -98,8 +83,8 @@ **/ SubSurface *createSubSurface(QPointer surface, QPointer parentSurface, QObject *parent = nullptr); - operator wl_subcompositor*(); - operator wl_subcompositor*() const; + operator wl_subcompositor *(); + operator wl_subcompositor *() const; Q_SIGNALS: /** diff -Nru dwayland-5.57.0.23/src/client/subsurface.cpp dwayland-5.57.0.24+really5.24.3/src/client/subsurface.cpp --- dwayland-5.57.0.23/src/client/subsurface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/subsurface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "subsurface.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -27,7 +13,6 @@ { namespace Client { - class Q_DECL_HIDDEN SubSurface::Private { public: @@ -46,7 +31,7 @@ SubSurface *q; }; -SubSurface::Private::Private(QPointer< Surface > surface, QPointer< Surface > parentSurface, SubSurface *q) +SubSurface::Private::Private(QPointer surface, QPointer parentSurface, SubSurface *q) : surface(surface) , parentSurface(parentSurface) , q(q) @@ -63,10 +48,10 @@ SubSurface *SubSurface::Private::cast(wl_subsurface *native) { - return reinterpret_cast(wl_subsurface_get_user_data(native))->q; + return reinterpret_cast(wl_subsurface_get_user_data(native))->q; } -SubSurface::SubSurface(QPointer< Surface > surface, QPointer< Surface > parentSurface, QObject *parent) +SubSurface::SubSurface(QPointer surface, QPointer parentSurface, QObject *parent) : QObject(parent) , d(new Private(surface, parentSurface, this)) { @@ -97,12 +82,12 @@ return d->subSurface.isValid(); } -QPointer< Surface > SubSurface::surface() const +QPointer SubSurface::surface() const { return d->surface; } -QPointer< Surface > SubSurface::parentSurface() const +QPointer SubSurface::parentSurface() const { return d->parentSurface; } @@ -147,7 +132,7 @@ placeAbove(d->parentSurface); } -void SubSurface::placeAbove(QPointer< SubSurface > sibling) +void SubSurface::placeAbove(QPointer sibling) { if (sibling.isNull()) { return; @@ -155,7 +140,7 @@ placeAbove(sibling->surface()); } -void SubSurface::placeAbove(QPointer< Surface > sibling) +void SubSurface::placeAbove(QPointer sibling) { if (sibling.isNull()) { return; @@ -168,7 +153,7 @@ placeBelow(d->parentSurface); } -void SubSurface::placeBelow(QPointer< Surface > sibling) +void SubSurface::placeBelow(QPointer sibling) { if (sibling.isNull()) { return; @@ -176,7 +161,7 @@ wl_subsurface_place_below(d->subSurface, *sibling); } -void SubSurface::placeBelow(QPointer< SubSurface > sibling) +void SubSurface::placeBelow(QPointer sibling) { if (sibling.isNull()) { return; @@ -184,17 +169,17 @@ placeBelow(sibling->surface()); } -QPointer< SubSurface > SubSurface::get(wl_subsurface *native) +QPointer SubSurface::get(wl_subsurface *native) { return QPointer(Private::cast(native)); } -SubSurface::operator wl_subsurface*() const +SubSurface::operator wl_subsurface *() const { return d->subSurface; } -SubSurface::operator wl_subsurface*() +SubSurface::operator wl_subsurface *() { return d->subSurface; } diff -Nru dwayland-5.57.0.23/src/client/subsurface.h dwayland-5.57.0.24+really5.24.3/src/client/subsurface.h --- dwayland-5.57.0.23/src/client/subsurface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/subsurface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SUBSURFACE_H #define WAYLAND_SUBSURFACE_H #include #include -#include +#include struct wl_subsurface; @@ -31,7 +17,6 @@ { namespace Client { - class Surface; /** @@ -57,7 +42,7 @@ Q_OBJECT public: explicit SubSurface(QPointer surface, QPointer parentSurface, QObject *parent = nullptr); - virtual ~SubSurface(); + ~SubSurface() override; /** * @returns @c true if managing a wl_subsurface. @@ -93,7 +78,7 @@ **/ enum class Mode { Synchronized, - Desynchronized + Desynchronized, }; /** @@ -178,8 +163,8 @@ static QPointer get(wl_subsurface *native); - operator wl_subsurface*(); - operator wl_subsurface*() const; + operator wl_subsurface *(); + operator wl_subsurface *() const; private: class Private; diff -Nru dwayland-5.57.0.23/src/client/surface.cpp dwayland-5.57.0.24+really5.24.3/src/client/surface.cpp --- dwayland-5.57.0.23/src/client/surface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/surface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,32 +1,16 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "surface.h" -#include "buffer.h" -#include "region.h" #include "output.h" +#include "region.h" #include "wayland_pointer_p.h" #include #include #include -#include #include // Wayland #include @@ -35,7 +19,6 @@ { namespace Client { - class Q_DECL_HIDDEN Surface::Private { public: @@ -51,19 +34,21 @@ void setup(wl_surface *s); - static QList s_surfaces; + static QList s_surfaces; + private: void handleFrameCallback(); static void frameCallback(void *data, wl_callback *callback, uint32_t time); static void enterCallback(void *data, wl_surface *wl_surface, wl_output *output); static void leaveCallback(void *data, wl_surface *wl_surface, wl_output *output); + void removeOutput(Output *o); Surface *q; static const wl_callback_listener s_listener; static const wl_surface_listener s_surfaceListener; }; -QList Surface::Private::s_surfaces = QList(); +QList Surface::Private::s_surfaces = QList(); Surface::Private::Private(Surface *q) : q(q) @@ -93,7 +78,7 @@ return nullptr; } window->create(); - wl_surface *s = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window)); + wl_surface *s = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window)); if (!s) { return nullptr; } @@ -148,7 +133,7 @@ void Surface::Private::frameCallback(void *data, wl_callback *callback, uint32_t time) { Q_UNUSED(time) - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); if (callback) { wl_callback_destroy(callback); } @@ -158,49 +143,42 @@ void Surface::Private::handleFrameCallback() { frameCallbackInstalled = false; - emit q->frameRendered(); + Q_EMIT q->frameRendered(); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_callback_listener Surface::Private::s_listener = { - frameCallback -}; +#ifndef K_DOXYGEN +const struct wl_callback_listener Surface::Private::s_listener = {frameCallback}; -const struct wl_surface_listener Surface::Private::s_surfaceListener = { - enterCallback, - leaveCallback -}; +const struct wl_surface_listener Surface::Private::s_surfaceListener = {enterCallback, leaveCallback}; #endif +void Surface::Private::removeOutput(Output *o) +{ + if (o && outputs.removeOne(o)) { + Q_EMIT q->outputLeft(o); + } +} + void Surface::Private::enterCallback(void *data, wl_surface *surface, wl_output *output) { Q_UNUSED(surface); - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Output *o = Output::get(output); if (!o) { return; } s->outputs << o; QObject::connect(o, &Output::removed, s->q, [s, o]() { - if (!s->outputs.contains(o)) { - return; - } - s->outputs.removeOne(o); - s->q->outputLeft(o); + s->removeOutput(o); }); - emit s->q->outputEntered(o); + Q_EMIT s->q->outputEntered(o); } void Surface::Private::leaveCallback(void *data, wl_surface *surface, wl_output *output) { Q_UNUSED(surface); - auto s = reinterpret_cast(data); - Output *o = Output::get(output); - if (!o) { - return; - } - s->outputs.removeOne(o); - emit s->q->outputLeft(o); + auto s = reinterpret_cast(data); + s->removeOutput(Output::get(output)); } void Surface::Private::setupFrameCallback() @@ -228,8 +206,8 @@ void Surface::damage(const QRegion ®ion) { - for (const QRect &r : region.rects()) { - damage(r); + for (const QRect &rect : region) { + damage(rect); } } @@ -239,6 +217,19 @@ wl_surface_damage(d->surface, rect.x(), rect.y(), rect.width(), rect.height()); } +void Surface::damageBuffer(const QRegion ®ion) +{ + for (const QRect &r : region) { + damageBuffer(r); + } +} + +void Surface::damageBuffer(const QRect &rect) +{ + Q_ASSERT(isValid()); + wl_surface_damage_buffer(d->surface, rect.x(), rect.y(), rect.width(), rect.height()); +} + void Surface::attachBuffer(wl_buffer *buffer, const QPoint &offset) { Q_ASSERT(isValid()); @@ -281,23 +272,21 @@ return; } d->size = size; - emit sizeChanged(d->size); + Q_EMIT sizeChanged(d->size); } Surface *Surface::get(wl_surface *native) { - auto it = std::find_if(Private::s_surfaces.constBegin(), Private::s_surfaces.constEnd(), - [native](Surface *s) { - return s->d->surface == native; - } - ); + auto it = std::find_if(Private::s_surfaces.constBegin(), Private::s_surfaces.constEnd(), [native](Surface *s) { + return s->d->surface == native; + }); if (it != Private::s_surfaces.constEnd()) { return *(it); } return nullptr; } -const QList< Surface* > &Surface::all() +const QList &Surface::all() { return Private::s_surfaces; } @@ -312,12 +301,12 @@ return d->size; } -Surface::operator wl_surface*() +Surface::operator wl_surface *() { return d->surface; } -Surface::operator wl_surface*() const +Surface::operator wl_surface *() const { return d->surface; } @@ -325,7 +314,7 @@ quint32 Surface::id() const { wl_surface *s = *this; - return wl_proxy_get_id(reinterpret_cast(s)); + return wl_proxy_get_id(reinterpret_cast(s)); } qint32 Surface::scale() const diff -Nru dwayland-5.57.0.23/src/client/surface.h dwayland-5.57.0.24+really5.24.3/src/client/surface.h --- dwayland-5.57.0.23/src/client/surface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/surface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_SURFACE_H #define WAYLAND_SURFACE_H @@ -27,7 +13,7 @@ #include #include -#include +#include struct wl_buffer; struct wl_surface; @@ -38,7 +24,6 @@ { namespace Client { - class Output; class Region; @@ -60,7 +45,7 @@ Q_OBJECT public: explicit Surface(QObject *parent = nullptr); - virtual ~Surface(); + ~Surface() override; /** * Creates a Surface for the given @p window. @@ -144,18 +129,32 @@ **/ enum class CommitFlag { None, - FrameCallback + FrameCallback, }; void commit(CommitFlag flag = CommitFlag::FrameCallback); /** * Mark @p rect as damaged for the next frame. + * @see damageBuffer **/ void damage(const QRect &rect); /** * Mark @p region as damaged for the next frame. + * @see damageBuffer **/ void damage(const QRegion ®ion); /** + * Mark @p rect in buffer coordinates as damaged for the next frame. + * @see damage + * @since 5.59 + **/ + void damageBuffer(const QRect &rect); + /** + * Mark @p region in buffer coordinates as damaged for the next frame. + * @see damage + * @since 5.59 + **/ + void damageBuffer(const QRegion ®ion); + /** * Attaches the @p buffer to this Surface for the next frame. * @param buffer The buffer to attach to this Surface * @param offset Position of the new upper-left corner in relation to previous frame @@ -227,8 +226,8 @@ **/ qint32 scale() const; - operator wl_surface*(); - operator wl_surface*() const; + operator wl_surface *(); + operator wl_surface *() const; /** * @returns the id of the referenced wl_proxy. @@ -248,7 +247,7 @@ * All Surfaces which are currently created. * TODO: KF6 return QList instead of const-ref **/ - static const QList &all(); // krazy:exclude=constref + static const QList &all(); // krazy:exclude=constref /** * @returns The Surface referencing the @p native wl_surface or @c null if there is no such Surface. **/ @@ -263,7 +262,7 @@ * @see commit **/ void frameRendered(); - void sizeChanged(const QSize&); + void sizeChanged(const QSize &); /** * Emitted whenever a change in the Surface (e.g. creation, movement, resize) results in diff -Nru dwayland-5.57.0.23/src/client/textinput.cpp dwayland-5.57.0.24+really5.24.3/src/client/textinput.cpp --- dwayland-5.57.0.23/src/client/textinput.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/textinput.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,14 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "textinput_p.h" namespace KWayland { namespace Client { - TextInput::Private::Private(Seat *seat) : seat(seat) { @@ -194,22 +179,22 @@ return d->queue; } -TextInputManager::operator wl_text_input_manager*() +TextInputManager::operator wl_text_input_manager *() { return *(d.data()); } -TextInputManager::operator wl_text_input_manager*() const +TextInputManager::operator wl_text_input_manager *() const { return *(d.data()); } -TextInputManager::operator zwp_text_input_manager_v2*() +TextInputManager::operator zwp_text_input_manager_v2 *() { return *(d.data()); } -TextInputManager::operator zwp_text_input_manager_v2*() const +TextInputManager::operator zwp_text_input_manager_v2 *() const { return *(d.data()); } diff -Nru dwayland-5.57.0.23/src/client/textinput.h dwayland-5.57.0.24+really5.24.3/src/client/textinput.h --- dwayland-5.57.0.23/src/client/textinput.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/textinput.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_TEXTINPUT_H #define KWAYLAND_CLIENT_TEXTINPUT_H #include -#include +#include struct wl_text_input; struct wl_text_input_manager; @@ -32,9 +18,7 @@ { namespace Client { - class EventQueue; -class TextInputUnstableV0; class Surface; class Seat; @@ -55,7 +39,7 @@ { Q_OBJECT public: - virtual ~TextInput(); + ~TextInput() override; /** * @returns @c true if managing a resource. **/ @@ -128,7 +112,7 @@ **/ enum class KeyState { Pressed, - Released + Released, }; /** @@ -178,7 +162,7 @@ /** * the text input is multi line */ - MultiLine = 1 << 9 + MultiLine = 1 << 9, }; Q_DECLARE_FLAGS(ContentHints, ContentHint) @@ -240,7 +224,7 @@ /** * input for a terminal */ - Terminal + Terminal, }; /** * Sets the content @p purpose and content @p hints. @@ -366,7 +350,7 @@ **/ void inputPanelStateChanged(); /** - * Emitted whenver the text direction changes. + * Emitted whenever the text direction changes. * @see textDirection **/ void textDirectionChanged(); @@ -432,7 +416,7 @@ { Q_OBJECT public: - virtual ~TextInputManager(); + ~TextInputManager() override; /** * Setup this TextInputManager to manage the @p textinputmanagerunstablev0. @@ -492,19 +476,19 @@ /** * @returns @c null if not for a wl_text_input_manager **/ - operator wl_text_input_manager*(); + operator wl_text_input_manager *(); /** * @returns @c null if not for a wl_text_input_manager **/ - operator wl_text_input_manager*() const; + operator wl_text_input_manager *() const; /** * @returns @c null if not for a zwp_text_input_manager_v2 **/ - operator zwp_text_input_manager_v2*(); + operator zwp_text_input_manager_v2 *(); /** * @returns @c null if not for a zwp_text_input_manager_v2 **/ - operator zwp_text_input_manager_v2*() const; + operator zwp_text_input_manager_v2 *() const; Q_SIGNALS: /** @@ -522,6 +506,8 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(TextInput::ContentHints) + } } @@ -529,6 +515,5 @@ Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentHint) Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentPurpose) Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentHints) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::TextInput::ContentHints) #endif diff -Nru dwayland-5.57.0.23/src/client/textinput_p.h dwayland-5.57.0.24+really5.24.3/src/client/textinput_p.h --- dwayland-5.57.0.23/src/client/textinput_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/textinput_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_TEXTINPUT_P_H #define KWAYLAND_CLIENT_TEXTINPUT_P_H #include "textinput.h" @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class TextInputUnstableV0; class Surface; @@ -48,7 +33,7 @@ * Registry::createTextInputManagerUnstableV0. **/ explicit TextInputManagerUnstableV0(QObject *parent = nullptr); - virtual ~TextInputManagerUnstableV0(); + ~TextInputManagerUnstableV0() override; private: class Private; @@ -66,7 +51,7 @@ * Registry::createTextInputManagerUnstableV0. **/ explicit TextInputManagerUnstableV2(QObject *parent = nullptr); - virtual ~TextInputManagerUnstableV2(); + ~TextInputManagerUnstableV2() override; private: class Private; @@ -82,23 +67,29 @@ virtual void release() = 0; virtual void destroy() = 0; virtual bool isValid() = 0; - virtual void setupV0(wl_text_input_manager *textinputmanagerunstablev0) { + virtual void setupV0(wl_text_input_manager *textinputmanagerunstablev0) + { Q_UNUSED(textinputmanagerunstablev0) } - virtual void setupV2(zwp_text_input_manager_v2 *textinputmanagerunstablev2) { + virtual void setupV2(zwp_text_input_manager_v2 *textinputmanagerunstablev2) + { Q_UNUSED(textinputmanagerunstablev2) } virtual TextInput *createTextInput(Seat *seat, QObject *parent = nullptr) = 0; - virtual operator wl_text_input_manager*() { + virtual operator wl_text_input_manager *() + { return nullptr; } - virtual operator wl_text_input_manager*() const { + virtual operator wl_text_input_manager *() const + { return nullptr; } - virtual operator zwp_text_input_manager_v2*() { + virtual operator zwp_text_input_manager_v2 *() + { return nullptr; } - virtual operator zwp_text_input_manager_v2*() const { + virtual operator zwp_text_input_manager_v2 *() const + { return nullptr; } @@ -154,7 +145,7 @@ Q_OBJECT public: explicit TextInputUnstableV0(Seat *seat, QObject *parent = nullptr); - virtual ~TextInputUnstableV0(); + ~TextInputUnstableV0() override; /** * Setup this TextInputUnstableV0 to manage the @p textinputunstablev0. @@ -186,8 +177,8 @@ **/ void destroy(); - operator wl_text_input*(); - operator wl_text_input*() const; + operator wl_text_input *(); + operator wl_text_input *() const; private: class Private; @@ -199,7 +190,7 @@ Q_OBJECT public: explicit TextInputUnstableV2(Seat *seat, QObject *parent = nullptr); - virtual ~TextInputUnstableV2(); + ~TextInputUnstableV2() override; /** * Setup this TextInputUnstableV2 to manage the @p textinputunstablev2. @@ -231,8 +222,8 @@ **/ void destroy(); - operator zwp_text_input_v2*(); - operator zwp_text_input_v2*() const; + operator zwp_text_input_v2 *(); + operator zwp_text_input_v2 *() const; private: class Private; diff -Nru dwayland-5.57.0.23/src/client/textinput_v0.cpp dwayland-5.57.0.24+really5.24.3/src/client/textinput_v0.cpp --- dwayland-5.57.0.23/src/client/textinput_v0.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/textinput_v0.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,12 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "textinput_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "event_queue.h" #include "seat.h" #include "surface.h" +#include "textinput_p.h" #include "wayland_pointer_p.h" #include @@ -29,7 +15,6 @@ { namespace Client { - class TextInputUnstableV0::Private : public TextInput::Private { public: @@ -39,7 +24,7 @@ bool isValid() const override; void enable(Surface *surface) override; - void disable(Surface * surface) override; + void disable(Surface *surface) override; void showInputPanel() override; void hideInputPanel() override; void setCursorRectangle(const QRect &rect) override; @@ -70,60 +55,58 @@ static const wl_text_input_listener s_listener; }; -const wl_text_input_listener TextInputUnstableV0::Private::s_listener = { - enterCallaback, - leaveCallback, - modifiersMapCallback, - inputPanelStateCallback, - preeditStringCallback, - preeditStylingCallback, - preeditCursorCallback, - commitStringCallback, - cursorPositionCallback, - deleteSurroundingTextCallback, - keysymCallback, - languageCallback, - textDirectionCallback -}; +const wl_text_input_listener TextInputUnstableV0::Private::s_listener = {enterCallaback, + leaveCallback, + modifiersMapCallback, + inputPanelStateCallback, + preeditStringCallback, + preeditStylingCallback, + preeditCursorCallback, + commitStringCallback, + cursorPositionCallback, + deleteSurroundingTextCallback, + keysymCallback, + languageCallback, + textDirectionCallback}; void TextInputUnstableV0::Private::enterCallaback(void *data, wl_text_input *wl_text_input, wl_surface *surface) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->enteredSurface = Surface::get(surface); - emit t->q->entered(); + Q_EMIT t->q->entered(); } void TextInputUnstableV0::Private::leaveCallback(void *data, wl_text_input *wl_text_input) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->enteredSurface = nullptr; - emit t->q->left(); + Q_EMIT t->q->left(); } void TextInputUnstableV0::Private::modifiersMapCallback(void *data, wl_text_input *wl_text_input, wl_array *map) { Q_UNUSED(map) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); // TODO: implement } void TextInputUnstableV0::Private::inputPanelStateCallback(void *data, wl_text_input *wl_text_input, uint32_t state) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); if (t->inputPanelVisible != state) { t->inputPanelVisible = state; - emit t->q->inputPanelStateChanged(); + Q_EMIT t->q->inputPanelStateChanged(); } } void TextInputUnstableV0::Private::preeditStringCallback(void *data, wl_text_input *wl_text_input, uint32_t serial, const char *text, const char *commit) { Q_UNUSED(serial) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->pendingPreEdit.commitText = QByteArray(commit); t->pendingPreEdit.text = QByteArray(text); @@ -132,7 +115,7 @@ } t->currentPreEdit = t->pendingPreEdit; t->pendingPreEdit = TextInput::Private::PreEdit(); - emit t->q->composingTextChanged(); + Q_EMIT t->q->composingTextChanged(); } void TextInputUnstableV0::Private::preeditStylingCallback(void *data, wl_text_input *wl_text_input, uint32_t index, uint32_t length, uint32_t style) @@ -141,13 +124,13 @@ Q_UNUSED(length) Q_UNUSED(style) // TODO: implement - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); } void TextInputUnstableV0::Private::preeditCursorCallback(void *data, wl_text_input *wl_text_input, int32_t index) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->pendingPreEdit.cursor = index; t->pendingPreEdit.cursorSet = true; @@ -156,7 +139,7 @@ void TextInputUnstableV0::Private::commitStringCallback(void *data, wl_text_input *wl_text_input, uint32_t serial, const char *text) { Q_UNUSED(serial) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->pendingCommit.text = QByteArray(text); t->currentCommit = t->pendingCommit; @@ -164,12 +147,12 @@ t->pendingCommit = TextInput::Private::Commit(); t->pendingCommit.deleteSurrounding.beforeLength = 0; t->pendingCommit.deleteSurrounding.afterLength = 0; - emit t->q->committed(); + Q_EMIT t->q->committed(); } void TextInputUnstableV0::Private::cursorPositionCallback(void *data, wl_text_input *wl_text_input, int32_t index, int32_t anchor) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->pendingCommit.cursor = index; t->pendingCommit.anchor = anchor; @@ -177,18 +160,24 @@ void TextInputUnstableV0::Private::deleteSurroundingTextCallback(void *data, wl_text_input *wl_text_input, int32_t index, uint32_t length) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); t->pendingCommit.deleteSurrounding.beforeLength = qAbs(index); t->pendingCommit.deleteSurrounding.afterLength = length - t->pendingCommit.deleteSurrounding.beforeLength; } -void TextInputUnstableV0::Private::keysymCallback(void *data, wl_text_input *wl_text_input, uint32_t serial, uint32_t time, uint32_t sym, uint32_t wlState, uint32_t modifiers) +void TextInputUnstableV0::Private::keysymCallback(void *data, + wl_text_input *wl_text_input, + uint32_t serial, + uint32_t time, + uint32_t sym, + uint32_t wlState, + uint32_t modifiers) { Q_UNUSED(serial) // TODO: add support for modifiers Q_UNUSED(modifiers) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); TextInput::KeyState state; switch (wlState) { @@ -202,24 +191,24 @@ // invalid return; } - emit t->q->keyEvent(sym, state, Qt::KeyboardModifiers(), time); + Q_EMIT t->q->keyEvent(sym, state, Qt::KeyboardModifiers(), time); } void TextInputUnstableV0::Private::languageCallback(void *data, wl_text_input *wl_text_input, uint32_t serial, const char *language) { Q_UNUSED(serial) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); if (qstrcmp(t->language, language) != 0) { t->language = QByteArray(language); - emit t->q->languageChanged(); + Q_EMIT t->q->languageChanged(); } } void TextInputUnstableV0::Private::textDirectionCallback(void *data, wl_text_input *wl_text_input, uint32_t serial, uint32_t wlDirection) { Q_UNUSED(serial) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev0 == wl_text_input); Qt::LayoutDirection direction; switch (wlDirection) { @@ -238,7 +227,7 @@ } if (direction != t->textDirection) { t->textDirection = direction; - emit t->q->textDirectionChanged(); + Q_EMIT t->q->textDirectionChanged(); } } @@ -294,9 +283,12 @@ void TextInputUnstableV0::Private::setSurroundingText(const QString &text, quint32 cursor, quint32 anchor) { - wl_text_input_set_surrounding_text(textinputunstablev0, text.toUtf8().constData(), - text.leftRef(cursor).toUtf8().length(), - text.leftRef(anchor).toUtf8().length()); + const QStringView strView(text); + + wl_text_input_set_surrounding_text(textinputunstablev0, + text.toUtf8().constData(), + strView.left(cursor).toUtf8().length(), + strView.left(anchor).toUtf8().length()); } void TextInputUnstableV0::Private::reset() @@ -394,7 +386,7 @@ TextInputUnstableV0::Private *TextInputUnstableV0::d_func() const { - return reinterpret_cast(d.data()); + return reinterpret_cast(d.data()); } void TextInputUnstableV0::setup(wl_text_input *textinputunstablev0) @@ -415,13 +407,13 @@ d->textinputunstablev0.destroy(); } -TextInputUnstableV0::operator wl_text_input*() +TextInputUnstableV0::operator wl_text_input *() { Q_D(); return d->textinputunstablev0; } -TextInputUnstableV0::operator wl_text_input*() const +TextInputUnstableV0::operator wl_text_input *() const { Q_D(); return d->textinputunstablev0; @@ -437,11 +429,14 @@ bool isValid() override; void setupV0(wl_text_input_manager *ti) override; TextInput *createTextInput(Seat *seat, QObject *parent = nullptr) override; - using TextInputManager::Private::operator zwp_text_input_manager_v2*; //overriding only one overload results in a compiler warning. This tells GCC we're doing it deliberately - operator wl_text_input_manager*() override { + using TextInputManager::Private::operator zwp_text_input_manager_v2 *; // overriding only one overload results in a compiler warning. This tells GCC we're + // doing it deliberately + operator wl_text_input_manager *() override + { return textinputmanagerunstablev0; } - operator wl_text_input_manager*() const override { + operator wl_text_input_manager *() const override + { return textinputmanagerunstablev0; } @@ -470,7 +465,7 @@ TextInputManagerUnstableV0::Private *TextInputManagerUnstableV0::d_func() const { - return reinterpret_cast(d.data()); + return reinterpret_cast(d.data()); } TextInputManagerUnstableV0::~TextInputManagerUnstableV0() diff -Nru dwayland-5.57.0.23/src/client/textinput_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/textinput_v2.cpp --- dwayland-5.57.0.23/src/client/textinput_v2.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/textinput_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,12 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "textinput_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "event_queue.h" #include "seat.h" #include "surface.h" +#include "textinput_p.h" #include "wayland_pointer_p.h" #include @@ -29,7 +15,6 @@ { namespace Client { - class TextInputUnstableV2::Private : public TextInput::Private { public: @@ -39,7 +24,7 @@ bool isValid() const override; void enable(Surface *surface) override; - void disable(Surface * surface) override; + void disable(Surface *surface) override; void showInputPanel() override; void hideInputPanel() override; void setCursorRectangle(const QRect &rect) override; @@ -72,61 +57,65 @@ static const zwp_text_input_v2_listener s_listener; }; -const zwp_text_input_v2_listener TextInputUnstableV2::Private::s_listener = { - enterCallback, - leaveCallback, - inputPanelStateCallback, - preeditStringCallback, - preeditStylingCallback, - preeditCursorCallback, - commitStringCallback, - cursorPositionCallback, - deleteSurroundingTextCallback, - modifiersMapCallback, - keysymCallback, - languageCallback, - textDirectionCallback, - configureSurroundingTextCallback, - inputMethodChangedCallback -}; +const zwp_text_input_v2_listener TextInputUnstableV2::Private::s_listener = {enterCallback, + leaveCallback, + inputPanelStateCallback, + preeditStringCallback, + preeditStylingCallback, + preeditCursorCallback, + commitStringCallback, + cursorPositionCallback, + deleteSurroundingTextCallback, + modifiersMapCallback, + keysymCallback, + languageCallback, + textDirectionCallback, + configureSurroundingTextCallback, + inputMethodChangedCallback}; void TextInputUnstableV2::Private::enterCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, wl_surface *surface) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->latestSerial = serial; t->enteredSurface = Surface::get(surface); - emit t->q->entered(); + Q_EMIT t->q->entered(); } void TextInputUnstableV2::Private::leaveCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, wl_surface *surface) { Q_UNUSED(surface) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->enteredSurface = nullptr; t->latestSerial = serial; - emit t->q->left(); + Q_EMIT t->q->left(); } -void TextInputUnstableV2::Private::inputPanelStateCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height) +void TextInputUnstableV2::Private::inputPanelStateCallback(void *data, + zwp_text_input_v2 *zwp_text_input_v2, + uint32_t state, + int32_t x, + int32_t y, + int32_t width, + int32_t height) { Q_UNUSED(x) Q_UNUSED(y) Q_UNUSED(width) Q_UNUSED(height) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); // TODO: add rect if (t->inputPanelVisible != state) { t->inputPanelVisible = state; - emit t->q->inputPanelStateChanged(); + Q_EMIT t->q->inputPanelStateChanged(); } } void TextInputUnstableV2::Private::preeditStringCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, const char *text, const char *commit) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->pendingPreEdit.commitText = QByteArray(commit); t->pendingPreEdit.text = QByteArray(text); @@ -135,7 +124,7 @@ } t->currentPreEdit = t->pendingPreEdit; t->pendingPreEdit = TextInput::Private::PreEdit(); - emit t->q->composingTextChanged(); + Q_EMIT t->q->composingTextChanged(); } void TextInputUnstableV2::Private::preeditStylingCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t index, uint32_t length, uint32_t style) @@ -144,13 +133,13 @@ Q_UNUSED(length) Q_UNUSED(style) // TODO: implement - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); } void TextInputUnstableV2::Private::preeditCursorCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, int32_t index) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->pendingPreEdit.cursor = index; t->pendingPreEdit.cursorSet = true; @@ -158,7 +147,7 @@ void TextInputUnstableV2::Private::commitStringCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, const char *text) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->pendingCommit.text = QByteArray(text); t->currentCommit = t->pendingCommit; @@ -166,20 +155,23 @@ t->pendingCommit = TextInput::Private::Commit(); t->pendingCommit.deleteSurrounding.beforeLength = 0; t->pendingCommit.deleteSurrounding.afterLength = 0; - emit t->q->committed(); + Q_EMIT t->q->committed(); } void TextInputUnstableV2::Private::cursorPositionCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, int32_t index, int32_t anchor) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->pendingCommit.cursor = index; t->pendingCommit.anchor = anchor; } -void TextInputUnstableV2::Private::deleteSurroundingTextCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t before_length, uint32_t after_length) +void TextInputUnstableV2::Private::deleteSurroundingTextCallback(void *data, + zwp_text_input_v2 *zwp_text_input_v2, + uint32_t before_length, + uint32_t after_length) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); t->pendingCommit.deleteSurrounding.beforeLength = before_length; t->pendingCommit.deleteSurrounding.afterLength = after_length; @@ -189,15 +181,20 @@ { // TODO: implement Q_UNUSED(map) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); } -void TextInputUnstableV2::Private::keysymCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t time, uint32_t sym, uint32_t wlState, uint32_t modifiers) +void TextInputUnstableV2::Private::keysymCallback(void *data, + zwp_text_input_v2 *zwp_text_input_v2, + uint32_t time, + uint32_t sym, + uint32_t wlState, + uint32_t modifiers) { // TODO: add support for modifiers Q_UNUSED(modifiers) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); TextInput::KeyState state; switch (wlState) { @@ -211,22 +208,22 @@ // invalid return; } - emit t->q->keyEvent(sym, state, Qt::KeyboardModifiers(), time); + Q_EMIT t->q->keyEvent(sym, state, Qt::KeyboardModifiers(), time); } void TextInputUnstableV2::Private::languageCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, const char *language) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); if (qstrcmp(t->language, language) != 0) { t->language = QByteArray(language); - emit t->q->languageChanged(); + Q_EMIT t->q->languageChanged(); } } void TextInputUnstableV2::Private::textDirectionCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, uint32_t wlDirection) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); Qt::LayoutDirection direction; switch (wlDirection) { @@ -245,16 +242,19 @@ } if (direction != t->textDirection) { t->textDirection = direction; - emit t->q->textDirectionChanged(); + Q_EMIT t->q->textDirectionChanged(); } } -void TextInputUnstableV2::Private::configureSurroundingTextCallback(void *data, zwp_text_input_v2 *zwp_text_input_v2, int32_t before_cursor, int32_t after_cursor) +void TextInputUnstableV2::Private::configureSurroundingTextCallback(void *data, + zwp_text_input_v2 *zwp_text_input_v2, + int32_t before_cursor, + int32_t after_cursor) { // TODO: implement Q_UNUSED(before_cursor) Q_UNUSED(after_cursor) - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); } @@ -263,7 +263,7 @@ Q_UNUSED(serial) Q_UNUSED(flags) // TODO: implement - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->textinputunstablev2 == zwp_text_input_v2); } @@ -291,7 +291,7 @@ zwp_text_input_v2_enable(textinputunstablev2, *surface); } -void TextInputUnstableV2::Private::disable(Surface * surface) +void TextInputUnstableV2::Private::disable(Surface *surface) { zwp_text_input_v2_disable(textinputunstablev2, *surface); } @@ -318,9 +318,12 @@ void TextInputUnstableV2::Private::setSurroundingText(const QString &text, quint32 cursor, quint32 anchor) { - zwp_text_input_v2_set_surrounding_text(textinputunstablev2, text.toUtf8().constData(), - text.leftRef(cursor).toUtf8().length(), - text.leftRef(anchor).toUtf8().length()); + const QStringView strView(text); + + zwp_text_input_v2_set_surrounding_text(textinputunstablev2, + text.toUtf8().constData(), + strView.left(cursor).toUtf8().length(), + strView.left(anchor).toUtf8().length()); } void TextInputUnstableV2::Private::reset() @@ -418,7 +421,7 @@ TextInputUnstableV2::Private *TextInputUnstableV2::d_func() const { - return reinterpret_cast(d.data()); + return reinterpret_cast(d.data()); } void TextInputUnstableV2::setup(zwp_text_input_v2 *textinputunstablev2) @@ -439,13 +442,13 @@ d->textinputunstablev2.destroy(); } -TextInputUnstableV2::operator zwp_text_input_v2*() +TextInputUnstableV2::operator zwp_text_input_v2 *() { Q_D(); return d->textinputunstablev2; } -TextInputUnstableV2::operator zwp_text_input_v2*() const +TextInputUnstableV2::operator zwp_text_input_v2 *() const { Q_D(); return d->textinputunstablev2; @@ -461,11 +464,13 @@ bool isValid() override; void setupV2(zwp_text_input_manager_v2 *ti) override; TextInput *createTextInput(Seat *seat, QObject *parent = nullptr) override; - using TextInputManager::Private::operator wl_text_input_manager*; - operator zwp_text_input_manager_v2*() override { + using TextInputManager::Private::operator wl_text_input_manager *; + operator zwp_text_input_manager_v2 *() override + { return textinputmanagerunstablev2; } - operator zwp_text_input_manager_v2*() const override { + operator zwp_text_input_manager_v2 *() const override + { return textinputmanagerunstablev2; } diff -Nru dwayland-5.57.0.23/src/client/touch.cpp dwayland-5.57.0.24+really5.24.3/src/client/touch.cpp --- dwayland-5.57.0.23/src/client/touch.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/touch.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "touch.h" #include "surface.h" #include "wayland_pointer_p.h" @@ -31,7 +17,6 @@ { namespace Client { - class Q_DECL_HIDDEN Touch::Private { public: @@ -39,7 +24,7 @@ void setup(wl_touch *t); WaylandPointer touch; bool active = false; - QVector sequence; + QVector sequence; TouchPoint *getActivePoint(qint32 id) const; private: @@ -83,7 +68,7 @@ return d->positions.last(); } -QVector< QPointF > TouchPoint::positions() const +QVector TouchPoint::positions() const { return d->positions; } @@ -98,7 +83,7 @@ return d->upSerial; } -QPointer< Surface > TouchPoint::surface() const +QPointer TouchPoint::surface() const { return d->surface; } @@ -111,7 +96,7 @@ return d->timestamps.last(); } -QVector< quint32 > TouchPoint::timestamps() const +QVector TouchPoint::timestamps() const { return d->timestamps; } @@ -139,22 +124,16 @@ wl_touch_add_listener(touch, &s_listener, this); } -const wl_touch_listener Touch::Private::s_listener = { - downCallback, - upCallback, - motionCallback, - frameCallback, - cancelCallback -}; +const wl_touch_listener Touch::Private::s_listener = {downCallback, upCallback, motionCallback, frameCallback, cancelCallback}; void Touch::Private::downCallback(void *data, wl_touch *touch, uint32_t serial, uint32_t time, wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->touch == touch); t->down(serial, time, id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), QPointer(Surface::get(surface))); } -void Touch::Private::down(quint32 serial, quint32 time, qint32 id, const QPointF &position, const QPointer< Surface> &surface) +void Touch::Private::down(quint32 serial, quint32 time, qint32 id, const QPointF &position, const QPointer &surface) { TouchPoint *p = new TouchPoint; p->d->downSerial = serial; @@ -164,23 +143,21 @@ p->d->timestamps << time; if (active) { sequence << p; - emit q->pointAdded(p); + Q_EMIT q->pointAdded(p); } else { qDeleteAll(sequence); sequence.clear(); sequence << p; active = true; - emit q->sequenceStarted(p); + Q_EMIT q->sequenceStarted(p); } } TouchPoint *Touch::Private::getActivePoint(qint32 id) const { - auto it = std::find_if(sequence.constBegin(), sequence.constEnd(), - [id] (TouchPoint *p) { - return p->id() == id && p->isDown(); - } - ); + auto it = std::find_if(sequence.constBegin(), sequence.constEnd(), [id](TouchPoint *p) { + return p->id() == id && p->isDown(); + }); if (it == sequence.constEnd()) { return nullptr; } @@ -189,7 +166,7 @@ void Touch::Private::upCallback(void *data, wl_touch *touch, uint32_t serial, uint32_t time, int32_t id) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->touch == touch); t->up(serial, time, id); } @@ -203,7 +180,7 @@ p->d->timestamps << time; p->d->upSerial = serial; p->d->down = false; - emit q->pointRemoved(p); + Q_EMIT q->pointRemoved(p); // check whether the sequence ended for (auto it = sequence.constBegin(); it != sequence.constEnd(); ++it) { if ((*it)->isDown()) { @@ -212,12 +189,12 @@ } // no touch point is down active = false; - emit q->sequenceEnded(); + Q_EMIT q->sequenceEnded(); } void Touch::Private::motionCallback(void *data, wl_touch *touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->touch == touch); t->motion(time, id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } @@ -230,22 +207,22 @@ } p->d->positions << position; p->d->timestamps << time; - emit q->pointMoved(p); + Q_EMIT q->pointMoved(p); } void Touch::Private::frameCallback(void *data, wl_touch *touch) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->touch == touch); - emit t->q->frameEnded(); + Q_EMIT t->q->frameEnded(); } void Touch::Private::cancelCallback(void *data, wl_touch *touch) { - auto t = reinterpret_cast(data); + auto t = reinterpret_cast(data); Q_ASSERT(t->touch == touch); t->active = false; - emit t->q->sequenceCanceled(); + Q_EMIT t->q->sequenceCanceled(); } Touch::Touch(QObject *parent) @@ -289,7 +266,7 @@ return d->touch; } -QVector< TouchPoint* > Touch::sequence() const +QVector Touch::sequence() const { return d->sequence; } diff -Nru dwayland-5.57.0.23/src/client/touch.h dwayland-5.57.0.24+really5.24.3/src/client/touch.h --- dwayland-5.57.0.23/src/client/touch.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/touch.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_TOUCH_H #define WAYLAND_TOUCH_H #include #include -#include +#include struct wl_touch; @@ -31,7 +17,6 @@ { namespace Client { - class Surface; class Touch; @@ -104,7 +89,7 @@ Q_OBJECT public: explicit Touch(QObject *parent = nullptr); - virtual ~Touch(); + ~Touch() override; /** * @returns @c true if managing a wl_pointer. @@ -145,10 +130,10 @@ * The TouchPoints of the latest touch event sequence. * Only valid till the next touch event sequence is started **/ - QVector sequence() const; + QVector sequence() const; - operator wl_touch*(); - operator wl_touch*() const; + operator wl_touch *(); + operator wl_touch *() const; Q_SIGNALS: /** @@ -191,6 +176,6 @@ } } -Q_DECLARE_METATYPE(KWayland::Client::TouchPoint*) +Q_DECLARE_METATYPE(KWayland::Client::TouchPoint *) #endif diff -Nru dwayland-5.57.0.23/src/client/wayland_pointer_p.h dwayland-5.57.0.24+really5.24.3/src/client/wayland_pointer_p.h --- dwayland-5.57.0.23/src/client/wayland_pointer_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/wayland_pointer_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef WAYLAND_POINTER_P_H #define WAYLAND_POINTER_P_H @@ -26,26 +12,31 @@ { namespace Client { - template class WaylandPointer { public: WaylandPointer() = default; - WaylandPointer(Pointer *p) : m_pointer(p) {} + WaylandPointer(Pointer *p) + : m_pointer(p) + { + } WaylandPointer(const WaylandPointer &other) = delete; - virtual ~WaylandPointer() { + virtual ~WaylandPointer() + { release(); } - void setup(Pointer *pointer, bool foreign = false) { + void setup(Pointer *pointer, bool foreign = false) + { Q_ASSERT(pointer); Q_ASSERT(!m_pointer); m_pointer = pointer; m_foreign = foreign; } - void release() { + void release() + { if (!m_pointer) { return; } @@ -55,7 +46,8 @@ m_pointer = nullptr; } - void destroy() { + void destroy() + { if (!m_pointer) { return; } @@ -65,31 +57,38 @@ m_pointer = nullptr; } - bool isValid() const { + bool isValid() const + { return m_pointer != nullptr; } - operator Pointer*() { + operator Pointer *() + { return m_pointer; } - operator Pointer*() const { + operator Pointer *() const + { return m_pointer; } - operator wl_proxy*() { - return reinterpret_cast(m_pointer); + operator wl_proxy *() + { + return reinterpret_cast(m_pointer); } - Pointer *operator->() { + Pointer *operator->() + { return m_pointer; } - operator bool() { + operator bool() + { return isValid(); } - operator bool() const { + operator bool() const + { return isValid(); } diff -Nru dwayland-5.57.0.23/src/client/xdgdecoration.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgdecoration.cpp --- dwayland-5.57.0.23/src/client/xdgdecoration.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgdecoration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "xdgdecoration.h" #include "event_queue.h" @@ -31,7 +17,6 @@ { namespace Client { - class Q_DECL_HIDDEN XdgDecorationManager::Private { public: @@ -76,11 +61,13 @@ d->xdgdecorationmanager.destroy(); } -XdgDecorationManager::operator zxdg_decoration_manager_v1*() { +XdgDecorationManager::operator zxdg_decoration_manager_v1 *() +{ return d->xdgdecorationmanager; } -XdgDecorationManager::operator zxdg_decoration_manager_v1*() const { +XdgDecorationManager::operator zxdg_decoration_manager_v1 *() const +{ return d->xdgdecorationmanager; } @@ -103,7 +90,7 @@ { Q_ASSERT(isValid()); xdg_toplevel *toplevel_resource = *toplevel; - if (!toplevel_resource) { //i.e using XDGShellV5 + if (!toplevel_resource) { // i.e using XDGShellV5 qWarning() << "Trying to create an XdgDecoration without an XDGShell stable toplevel object"; return nullptr; } @@ -126,6 +113,7 @@ WaylandPointer xdgdecoration; XdgDecoration::Mode m_mode = XdgDecoration::Mode::ClientSide; + private: XdgDecoration *q; @@ -135,13 +123,11 @@ static const zxdg_toplevel_decoration_v1_listener s_listener; }; -const zxdg_toplevel_decoration_v1_listener XdgDecoration::Private::s_listener = { - configureCallback -}; +const zxdg_toplevel_decoration_v1_listener XdgDecoration::Private::s_listener = {configureCallback}; void XdgDecoration::Private::configureCallback(void *data, zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t m) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->xdgdecoration == zxdg_toplevel_decoration_v1); switch (m) { case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE: @@ -151,7 +137,7 @@ p->m_mode = XdgDecoration::Mode::ServerSide; break; } - emit p->q->modeChanged(p->m_mode); + Q_EMIT p->q->modeChanged(p->m_mode); } XdgDecoration::Private::Private(XdgDecoration *q) @@ -193,11 +179,13 @@ d->xdgdecoration.destroy(); } -XdgDecoration::operator zxdg_toplevel_decoration_v1*() { +XdgDecoration::operator zxdg_toplevel_decoration_v1 *() +{ return d->xdgdecoration; } -XdgDecoration::operator zxdg_toplevel_decoration_v1*() const { +XdgDecoration::operator zxdg_toplevel_decoration_v1 *() const +{ return d->xdgdecoration; } @@ -232,7 +220,5 @@ return d->m_mode; } - } } - diff -Nru dwayland-5.57.0.23/src/client/xdgdecoration.h dwayland-5.57.0.24+really5.24.3/src/client/xdgdecoration.h --- dwayland-5.57.0.23/src/client/xdgdecoration.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgdecoration.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDG_DECORATION_UNSTABLE_V1_H #define KWAYLAND_CLIENT_XDG_DECORATION_UNSTABLE_V1_H #include -#include +#include struct zxdg_decoration_manager_v1; struct zxdg_toplevel_decoration_v1; @@ -31,7 +17,6 @@ { namespace Client { - class EventQueue; class XdgDecoration; class XdgShellSurface; @@ -73,7 +58,7 @@ * Registry::createXdgDecorationManager. **/ explicit XdgDecorationManager(QObject *parent = nullptr); - virtual ~XdgDecorationManager(); + ~XdgDecorationManager() override; /** * Setup this XdgDecorationManager to manage the @p xdgdecorationmanager. @@ -120,8 +105,8 @@ XdgDecoration *getToplevelDecoration(XdgShellSurface *toplevel, QObject *parent = nullptr); - operator zxdg_decoration_manager_v1*(); - operator zxdg_decoration_manager_v1*() const; + operator zxdg_decoration_manager_v1 *(); + operator zxdg_decoration_manager_v1 *() const; Q_SIGNALS: /** @@ -143,12 +128,12 @@ public: enum class Mode { ClientSide, - ServerSide + ServerSide, }; Q_ENUM(Mode) - virtual ~XdgDecoration(); + ~XdgDecoration() override; /** * Setup this XdgDecoration to manage the @p xdgdecoration. @@ -185,9 +170,9 @@ void destroy(); /** - * @brief Request that the server puts us in a given mode. The compositor will respond with a modeChange - * The compositor may ignore this request. - */ + * @brief Request that the server puts us in a given mode. The compositor will respond with a modeChange + * The compositor may ignore this request. + */ void setMode(Mode mode); /** @@ -200,8 +185,8 @@ */ Mode mode() const; - operator zxdg_toplevel_decoration_v1*(); - operator zxdg_toplevel_decoration_v1*() const; + operator zxdg_toplevel_decoration_v1 *(); + operator zxdg_toplevel_decoration_v1 *() const; Q_SIGNALS: void modeChanged(KWayland::Client::XdgDecoration::Mode mode); @@ -213,7 +198,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/xdgforeign.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign.cpp --- dwayland-5.57.0.23/src/client/xdgforeign.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,12 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "xdgforeign.h" -#include "xdgforeign_p.h" #include "event_queue.h" #include "wayland_pointer_p.h" +#include "xdgforeign_p.h" #include @@ -30,7 +16,6 @@ { namespace Client { - XdgExporter::Private::Private() { } @@ -65,11 +50,13 @@ d->destroy(); } -XdgExporter::operator zxdg_exporter_v2*() { +XdgExporter::operator zxdg_exporter_v2 *() +{ return d->exporterV2(); } -XdgExporter::operator zxdg_exporter_v2*() const { +XdgExporter::operator zxdg_exporter_v2 *() const +{ return d->exporterV2(); } @@ -93,8 +80,6 @@ return d->exportTopLevelV2(surface, parent); } - - XdgImporter::Private::Private() { } @@ -129,11 +114,13 @@ d->destroy(); } -XdgImporter::operator zxdg_importer_v2*() { +XdgImporter::operator zxdg_importer_v2 *() +{ return d->importerV2(); } -XdgImporter::operator zxdg_importer_v2*() const { +XdgImporter::operator zxdg_importer_v2 *() const +{ return d->importerV2(); } @@ -152,7 +139,7 @@ return d->queue; } -XdgImported *XdgImporter::importTopLevel(const QString & handle, QObject *parent) +XdgImported *XdgImporter::importTopLevel(const QString &handle, QObject *parent) { Q_ASSERT(isValid()); return d->importTopLevelV2(handle, parent); @@ -198,11 +185,13 @@ return d->handle; } -XdgExported::operator zxdg_exported_v2*() { +XdgExported::operator zxdg_exported_v2 *() +{ return d->exportedV2(); } -XdgExported::operator zxdg_exported_v2*() const { +XdgExported::operator zxdg_exported_v2 *() const +{ return d->exportedV2(); } @@ -246,11 +235,13 @@ d->destroy(); } -XdgImported::operator zxdg_imported_v2*() { +XdgImported::operator zxdg_imported_v2 *() +{ return d->importedV2(); } -XdgImported::operator zxdg_imported_v2*() const { +XdgImported::operator zxdg_imported_v2 *() const +{ return d->importedV2(); } @@ -265,7 +256,5 @@ d->setParentOf(surface); } - } } - diff -Nru dwayland-5.57.0.23/src/client/xdgforeign.h dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign.h --- dwayland-5.57.0.23/src/client/xdgforeign.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDGFOREIGN_H #define KWAYLAND_CLIENT_XDGFOREIGN_H @@ -24,7 +10,7 @@ #include -#include +#include struct zxdg_exporter_v2; struct zxdg_importer_v2; @@ -35,7 +21,6 @@ { namespace Client { - class EventQueue; class Surface; class XdgExported; @@ -68,7 +53,7 @@ { Q_OBJECT public: - virtual ~XdgExporter(); + ~XdgExporter() override; /** * Setup this to manage the @p . @@ -123,8 +108,8 @@ */ XdgExported *exportTopLevel(Surface *surface, QObject *parent = nullptr); - operator zxdg_exporter_v2*(); - operator zxdg_exporter_v2*() const; + operator zxdg_exporter_v2 *(); + operator zxdg_exporter_v2 *() const; Q_SIGNALS: /** @@ -168,7 +153,7 @@ { Q_OBJECT public: - virtual ~XdgImporter(); + ~XdgImporter() override; /** * Setup this to manage the @p . @@ -226,10 +211,10 @@ * in some way, such as command line or a DBus call) * @param parent the parent in the QObject's hierarchy of the new XdgImported */ - XdgImported *importTopLevel(const QString & handle, QObject *parent = nullptr); + XdgImported *importTopLevel(const QString &handle, QObject *parent = nullptr); - operator zxdg_importer_v2*(); - operator zxdg_importer_v2*() const; + operator zxdg_importer_v2 *(); + operator zxdg_importer_v2 *() const; Q_SIGNALS: /** @@ -250,7 +235,7 @@ { Q_OBJECT public: - virtual ~XdgExported(); + ~XdgExported() override; /** * Setup this to manage the @p . @@ -293,8 +278,8 @@ */ QString handle() const; - operator zxdg_exported_v2*(); - operator zxdg_exported_v2*() const; + operator zxdg_exported_v2 *(); + operator zxdg_exported_v2 *() const; Q_SIGNALS: /** @@ -314,7 +299,7 @@ { Q_OBJECT public: - virtual ~XdgImported(); + ~XdgImported() override; /** * Setup this to manage the @p . @@ -360,8 +345,8 @@ */ void setParentOf(Surface *surface); - operator zxdg_imported_v2*(); - operator zxdg_imported_v2*() const; + operator zxdg_imported_v2 *(); + operator zxdg_imported_v2 *() const; Q_SIGNALS: /** @@ -377,7 +362,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/xdgforeign_p.h dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_p.h --- dwayland-5.57.0.23/src/client/xdgforeign_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDGFOREIGN_P_H #define KWAYLAND_CLIENT_XDGFOREIGN_P_H @@ -28,9 +14,6 @@ namespace Client { -class XdgExportedUnstableV2; -class XdgImportedUnstableV2; - class Q_DECL_HIDDEN XdgExporter::Private { public: @@ -55,7 +38,7 @@ Private(); virtual ~Private(); - virtual XdgImported *importTopLevelV2(const QString & handle, QObject *parent) = 0; + virtual XdgImported *importTopLevelV2(const QString &handle, QObject *parent) = 0; virtual void setupV2(zxdg_importer_v2 *arg) = 0; virtual zxdg_importer_v2 *importerV2() = 0; @@ -67,7 +50,6 @@ EventQueue *queue = nullptr; }; - class Q_DECL_HIDDEN XdgExported::Private { public: @@ -85,10 +67,8 @@ protected: XdgExported *q; - }; - class Q_DECL_HIDDEN XdgImported::Private { public: diff -Nru dwayland-5.57.0.23/src/client/xdgforeign_v2.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_v2.cpp --- dwayland-5.57.0.23/src/client/xdgforeign_v2.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,26 +1,12 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "xdgforeign_v2.h" -#include "xdgforeign_p.h" #include "event_queue.h" #include "wayland_pointer_p.h" +#include "xdgforeign_p.h" #include @@ -30,7 +16,6 @@ { namespace Client { - class Q_DECL_HIDDEN XdgExporterUnstableV2::Private : public XdgExporter::Private { public: @@ -49,7 +34,8 @@ XdgExporterUnstableV2::Private::Private() : XdgExporter::Private() -{} +{ +} zxdg_exporter_v2 *XdgExporterUnstableV2::Private::exporterV2() { @@ -83,7 +69,6 @@ return p; } - XdgExporterUnstableV2::XdgExporterUnstableV2(QObject *parent) : XdgExporter(new Private, parent) { @@ -105,7 +90,7 @@ public: Private(); - XdgImported *importTopLevelV2(const QString & handle, QObject *parent) override; + XdgImported *importTopLevelV2(const QString &handle, QObject *parent) override; void setupV2(zxdg_importer_v2 *arg) override; zxdg_importer_v2 *importerV2() override; @@ -119,7 +104,8 @@ XdgImporterUnstableV2::Private::Private() : XdgImporter::Private() -{} +{ +} zxdg_importer_v2 *XdgImporterUnstableV2::Private::importerV2() { @@ -141,7 +127,7 @@ return importer.isValid(); } -XdgImported *XdgImporterUnstableV2::Private::importTopLevelV2(const QString & handle, QObject *parent) +XdgImported *XdgImporterUnstableV2::Private::importTopLevelV2(const QString &handle, QObject *parent) { Q_ASSERT(isValid()); auto p = new XdgImportedUnstableV2(parent); @@ -153,7 +139,6 @@ return p; } - XdgImporterUnstableV2::XdgImporterUnstableV2(QObject *parent) : XdgImporter(new Private, parent) { @@ -170,7 +155,6 @@ { } - class Q_DECL_HIDDEN XdgExportedUnstableV2::Private : public XdgExported::Private { public: @@ -186,7 +170,7 @@ WaylandPointer exported; private: - static void handleCallback(void *data, zxdg_exported_v2 *zxdg_exported_v2, const char * handle); + static void handleCallback(void *data, zxdg_exported_v2 *zxdg_exported_v2, const char *handle); static const zxdg_exported_v2_listener s_listener; }; @@ -211,18 +195,15 @@ return exported.isValid(); } +const zxdg_exported_v2_listener XdgExportedUnstableV2::Private::s_listener = {handleCallback}; -const zxdg_exported_v2_listener XdgExportedUnstableV2::Private::s_listener = { - handleCallback -}; - -void XdgExportedUnstableV2::Private::handleCallback(void *data, zxdg_exported_v2 *zxdg_exported_v2, const char * handle) +void XdgExportedUnstableV2::Private::handleCallback(void *data, zxdg_exported_v2 *zxdg_exported_v2, const char *handle) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->exported == zxdg_exported_v2); p->handle = handle; - emit p->q->done(); + Q_EMIT p->q->done(); } XdgExportedUnstableV2::XdgExportedUnstableV2(QObject *parent) @@ -299,21 +280,17 @@ zxdg_imported_v2_set_parent_of(imported, *surface); } -const zxdg_imported_v2_listener XdgImportedUnstableV2::Private::s_listener = { - destroyedCallback -}; +const zxdg_imported_v2_listener XdgImportedUnstableV2::Private::s_listener = {destroyedCallback}; void XdgImportedUnstableV2::Private::destroyedCallback(void *data, zxdg_imported_v2 *zxdg_imported_v2) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->imported == zxdg_imported_v2); p->q->release(); - emit p->q->importedDestroyed(); + Q_EMIT p->q->importedDestroyed(); } - - XdgImportedUnstableV2::XdgImportedUnstableV2(QObject *parent) : XdgImported(new Private(this), parent) { @@ -331,7 +308,5 @@ { } - } } - diff -Nru dwayland-5.57.0.23/src/client/xdgforeign_v2.h dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_v2.h --- dwayland-5.57.0.23/src/client/xdgforeign_v2.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgforeign_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,31 +1,17 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDGFOREIGN_V2_H #define KWAYLAND_CLIENT_XDGFOREIGN_V2_H -#include "xdgforeign.h" #include "surface.h" +#include "xdgforeign.h" #include -#include +#include struct zxdg_exporter_v2; struct zxdg_importer_v2; @@ -36,9 +22,6 @@ { namespace Client { - -class EventQueue; -class Surface; class XdgExportedUnstableV2; class XdgImportedUnstableV2; @@ -76,7 +59,7 @@ * Registry::create. **/ explicit XdgExporterUnstableV2(QObject *parent = nullptr); - virtual ~XdgExporterUnstableV2(); + ~XdgExporterUnstableV2() override; private: class Private; @@ -116,7 +99,7 @@ * Registry::create. **/ explicit XdgImporterUnstableV2(QObject *parent = nullptr); - virtual ~XdgImporterUnstableV2(); + ~XdgImporterUnstableV2() override; private: class Private; @@ -126,7 +109,7 @@ { Q_OBJECT public: - virtual ~XdgExportedUnstableV2(); + ~XdgExportedUnstableV2() override; private: friend class XdgExporterUnstableV2; @@ -138,7 +121,7 @@ { Q_OBJECT public: - virtual ~XdgImportedUnstableV2(); + ~XdgImportedUnstableV2() override; private: friend class XdgImporterUnstableV2; @@ -146,7 +129,6 @@ class Private; }; - } } diff -Nru dwayland-5.57.0.23/src/client/xdgoutput.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgoutput.cpp --- dwayland-5.57.0.23/src/client/xdgoutput.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgoutput.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,29 +1,15 @@ -/**************************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "xdgoutput.h" #include "event_queue.h" -#include "wayland_pointer_p.h" #include "output.h" +#include "wayland_pointer_p.h" -#include #include +#include #include @@ -31,7 +17,6 @@ { namespace Client { - class XdgOutputManager::Private { public: @@ -76,11 +61,13 @@ d->xdgoutputmanager.destroy(); } -XdgOutputManager::operator zxdg_output_manager_v1*() { +XdgOutputManager::operator zxdg_output_manager_v1 *() +{ return d->xdgoutputmanager; } -XdgOutputManager::operator zxdg_output_manager_v1*() const { +XdgOutputManager::operator zxdg_output_manager_v1 *() const +{ return d->xdgoutputmanager; } @@ -111,8 +98,7 @@ return p; } -struct XdgOutputBuffer -{ +struct XdgOutputBuffer { QPoint logicalPosition; QSize logicalSize; QString name; @@ -144,26 +130,24 @@ static const zxdg_output_v1_listener s_listener; }; -const zxdg_output_v1_listener XdgOutput::Private::s_listener = { - logical_positionCallback, - logical_sizeCallback, - doneCallback, - nameCallback, - descriptionCallback -}; +const zxdg_output_v1_listener XdgOutput::Private::s_listener = {logical_positionCallback, + logical_sizeCallback, + doneCallback, + nameCallback, + descriptionCallback}; void XdgOutput::Private::logical_positionCallback(void *data, zxdg_output_v1 *zxdg_output_v1, int32_t x, int32_t y) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->xdgoutput == zxdg_output_v1); - p->pending.logicalPosition = QPoint(x,y); + p->pending.logicalPosition = QPoint(x, y); } void XdgOutput::Private::logical_sizeCallback(void *data, zxdg_output_v1 *zxdg_output_v1, int32_t width, int32_t height) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->xdgoutput == zxdg_output_v1); - p->pending.logicalSize = QSize(width,height); + p->pending.logicalSize = QSize(width, height); } void XdgOutput::Private::nameCallback(void *data, zxdg_output_v1 *zxdg_output_v1, const char *name) @@ -182,14 +166,11 @@ void XdgOutput::Private::doneCallback(void *data, zxdg_output_v1 *zxdg_output_v1) { - auto p = reinterpret_cast(data); + auto p = reinterpret_cast(data); Q_ASSERT(p->xdgoutput == zxdg_output_v1); std::swap(p->current, p->pending); - if (p->current.logicalSize != p->pending.logicalSize || - p->current.logicalPosition != p->pending.logicalPosition) { - emit p->q->changed(); - } + Q_EMIT p->q->changed(); } XdgOutput::Private::Private(XdgOutput *qptr) @@ -251,11 +232,13 @@ return d->current.description; } -XdgOutput::operator zxdg_output_v1*() { +XdgOutput::operator zxdg_output_v1 *() +{ return d->xdgoutput; } -XdgOutput::operator zxdg_output_v1*() const { +XdgOutput::operator zxdg_output_v1 *() const +{ return d->xdgoutput; } @@ -264,7 +247,5 @@ return d->xdgoutput.isValid(); } - } } - diff -Nru dwayland-5.57.0.23/src/client/xdgoutput.h dwayland-5.57.0.24+really5.24.3/src/client/xdgoutput.h --- dwayland-5.57.0.23/src/client/xdgoutput.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgoutput.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,30 +1,16 @@ -/**************************************************************************** -Copyright 2018 David Edmundson +/* + SPDX-FileCopyrightText: 2018 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDGOUTPUT_H #define KWAYLAND_CLIENT_XDGOUTPUT_H #include -#include #include +#include -#include +#include struct zxdg_output_manager_v1; struct zxdg_output_v1; @@ -33,7 +19,6 @@ { namespace Client { - class EventQueue; class XdgOutput; class Output; @@ -77,7 +62,7 @@ * Registry::createXdgOutputManager. **/ explicit XdgOutputManager(QObject *parent = nullptr); - virtual ~XdgOutputManager(); + ~XdgOutputManager() override; /** * Setup this XdgOutputManager to manage the @p xdgoutputmanager. @@ -124,8 +109,8 @@ XdgOutput *getXdgOutput(Output *output, QObject *parent = nullptr); - operator zxdg_output_manager_v1*(); - operator zxdg_output_manager_v1*() const; + operator zxdg_output_manager_v1 *(); + operator zxdg_output_manager_v1 *() const; Q_SIGNALS: /** @@ -159,7 +144,7 @@ { Q_OBJECT public: - virtual ~XdgOutput(); + ~XdgOutput() override; /** * Setup this XdgOutput to manage the @p xdgoutput. @@ -195,16 +180,16 @@ **/ void destroy(); - operator zxdg_output_v1*(); - operator zxdg_output_v1*() const; + operator zxdg_output_v1 *(); + operator zxdg_output_v1 *() const; /** - * The top left position of the output in compositor co-ordinates + * The top left position of the output in compositor coordinates */ QPoint logicalPosition() const; /** - * The size of the output in compositor co-ordinates + * The size of the output in compositor coordinates * (i.e pixel size / output scale) */ QSize logicalSize() const; @@ -223,7 +208,7 @@ Q_SIGNALS: /** - * Emitted when the logical position or size changes + * Emitted when any of the attributes have changed */ void changed(); @@ -234,7 +219,6 @@ QScopedPointer d; }; - } } diff -Nru dwayland-5.57.0.23/src/client/xdgshell.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgshell.cpp --- dwayland-5.57.0.23/src/client/xdgshell.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,20 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../compat/wayland-xdg-shell-v5-client-protocol.h" #include "event_queue.h" -#include "wayland_pointer_p.h" +#include "output.h" #include "seat.h" #include "surface.h" -#include "output.h" -#include "../compat/wayland-xdg-shell-v5-client-protocol.h" +#include "wayland_pointer_p.h" +#include "xdgshell_p.h" namespace KWayland { namespace Client { - XdgShell::Private::~Private() = default; XdgShell::XdgShell(Private *p, QObject *parent) @@ -78,31 +63,36 @@ return d->queue; } -XdgShell::operator xdg_shell*() { +XdgShell::operator xdg_shell *() +{ return *(d.data()); } -XdgShell::operator xdg_shell*() const { +XdgShell::operator xdg_shell *() const +{ return *(d.data()); } -XdgShell::operator zxdg_shell_v6*() { +XdgShell::operator zxdg_shell_v6 *() +{ return *(d.data()); } -XdgShell::operator zxdg_shell_v6*() const { +XdgShell::operator zxdg_shell_v6 *() const +{ return *(d.data()); } -XdgShell::operator xdg_wm_base*() { +XdgShell::operator xdg_wm_base *() +{ return *(d.data()); } -XdgShell::operator xdg_wm_base*() const { +XdgShell::operator xdg_wm_base *() const +{ return *(d.data()); } - bool XdgShell::isValid() const { return d->isValid(); @@ -161,7 +151,6 @@ d->setup(xdgsurface, xdgtoplevel); } - void XdgShellSurface::release() { d->release(); @@ -182,35 +171,43 @@ return d->queue; } -XdgShellSurface::operator xdg_surface*() { +XdgShellSurface::operator xdg_surface *() +{ return *(d.data()); } -XdgShellSurface::operator xdg_surface*() const { +XdgShellSurface::operator xdg_surface *() const +{ return *(d.data()); } -XdgShellSurface::operator xdg_toplevel*() { +XdgShellSurface::operator xdg_toplevel *() +{ return *(d.data()); } -XdgShellSurface::operator xdg_toplevel*() const { +XdgShellSurface::operator xdg_toplevel *() const +{ return *(d.data()); } -XdgShellSurface::operator zxdg_surface_v6*() { +XdgShellSurface::operator zxdg_surface_v6 *() +{ return *(d.data()); } -XdgShellSurface::operator zxdg_surface_v6*() const { +XdgShellSurface::operator zxdg_surface_v6 *() const +{ return *(d.data()); } -XdgShellSurface::operator zxdg_toplevel_v6*() { +XdgShellSurface::operator zxdg_toplevel_v6 *() +{ return *(d.data()); } -XdgShellSurface::operator zxdg_toplevel_v6*() const { +XdgShellSurface::operator zxdg_toplevel_v6 *() const +{ return *(d.data()); } @@ -282,6 +279,11 @@ d->setMinSize(size); } +void XdgShellSurface::setWindowGeometry(const QRect &windowGeometry) +{ + d->setWindowGeometry(windowGeometry); +} + void XdgShellSurface::requestMinimize() { d->setMinimized(); @@ -293,7 +295,7 @@ return; } d->size = size; - emit sizeChanged(size); + Q_EMIT sizeChanged(size); } QSize XdgShellSurface::size() const @@ -303,7 +305,6 @@ XdgShellPopup::Private::~Private() = default; - XdgShellPopup::Private::Private(XdgShellPopup *q) : q(q) { @@ -355,40 +356,58 @@ return d->queue; } -void XdgShellPopup::requestGrab(KWayland::Client::Seat* seat, quint32 serial) +void XdgShellPopup::requestGrab(KWayland::Client::Seat *seat, quint32 serial) { d->requestGrab(seat, serial); } -XdgShellPopup::operator xdg_surface*() { +void XdgShellPopup::ackConfigure(quint32 serial) +{ + d->ackConfigure(serial); +} + +void XdgShellPopup::setWindowGeometry(const QRect &windowGeometry) +{ + d->setWindowGeometry(windowGeometry); +} + +XdgShellPopup::operator xdg_surface *() +{ return *(d.data()); } -XdgShellPopup::operator xdg_surface*() const { +XdgShellPopup::operator xdg_surface *() const +{ return *(d.data()); } -XdgShellPopup::operator xdg_popup*() { +XdgShellPopup::operator xdg_popup *() +{ return *(d.data()); } -XdgShellPopup::operator xdg_popup*() const { +XdgShellPopup::operator xdg_popup *() const +{ return *(d.data()); } -XdgShellPopup::operator zxdg_surface_v6*() { +XdgShellPopup::operator zxdg_surface_v6 *() +{ return *(d.data()); } -XdgShellPopup::operator zxdg_surface_v6*() const { +XdgShellPopup::operator zxdg_surface_v6 *() const +{ return *(d.data()); } -XdgShellPopup::operator zxdg_popup_v6*() { +XdgShellPopup::operator zxdg_popup_v6 *() +{ return *(d.data()); } -XdgShellPopup::operator zxdg_popup_v6*() const { +XdgShellPopup::operator zxdg_popup_v6 *() const +{ return *(d.data()); } @@ -397,16 +416,15 @@ return d->isValid(); } -XdgPositioner::XdgPositioner(const QSize& initialSize, const QRect& anchor) -:d (new Private) +XdgPositioner::XdgPositioner(const QSize &initialSize, const QRect &anchor) + : d(new Private) { d->initialSize = initialSize; d->anchorRect = anchor; } - XdgPositioner::XdgPositioner(const XdgPositioner &other) -:d (new Private) + : d(new Private) { *d = *other.d; } @@ -415,7 +433,7 @@ { } -void XdgPositioner::setInitialSize(const QSize& size) +void XdgPositioner::setInitialSize(const QSize &size) { d->initialSize = size; } @@ -425,7 +443,7 @@ return d->initialSize; } -void XdgPositioner::setAnchorRect(const QRect& anchor) +void XdgPositioner::setAnchorRect(const QRect &anchor) { d->anchorRect = anchor; } @@ -445,7 +463,7 @@ return d->anchorEdge; } -void XdgPositioner::setAnchorOffset(const QPoint& offset) +void XdgPositioner::setAnchorOffset(const QPoint &offset) { d->anchorOffset = offset; } @@ -475,7 +493,5 @@ return d->constraints; } - } } - diff -Nru dwayland-5.57.0.23/src/client/xdgshell.h dwayland-5.57.0.24+really5.24.3/src/client/xdgshell.h --- dwayland-5.57.0.23/src/client/xdgshell.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,31 +1,17 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDG_SHELL_H #define KWAYLAND_CLIENT_XDG_SHELL_H +#include #include -#include #include -#include +#include -//This is a mix of structs for both xdgshell unstable v5 AND xdg wm base stable +// This is a mix of structs for both xdgshell unstable v5 AND xdg wm base stable struct xdg_wm_base; struct xdg_shell; struct xdg_surface; @@ -42,7 +28,6 @@ { namespace Client { - class EventQueue; class Output; class Surface; @@ -60,33 +45,33 @@ { public: /* - * Flags describing how a popup should be reposition if constrained - */ + * Flags describing how a popup should be reposition if constrained + */ enum class Constraint { /* - * Slide the popup on the X axis until there is room - */ + * Slide the popup on the X axis until there is room + */ SlideX = 1 << 0, /* - * Slide the popup on the Y axis until there is room - */ + * Slide the popup on the Y axis until there is room + */ SlideY = 1 << 1, /* - * Invert the anchor and gravity on the X axis - */ + * Invert the anchor and gravity on the X axis + */ FlipX = 1 << 2, /* - * Invert the anchor and gravity on the Y axis - */ + * Invert the anchor and gravity on the Y axis + */ FlipY = 1 << 3, /* - * Resize the popup in the X axis - */ + * Resize the popup in the X axis + */ ResizeX = 1 << 4, /* - * Resize the popup in the Y axis - */ - ResizeY = 1 << 5 + * Resize the popup in the Y axis + */ + ResizeY = 1 << 5, }; Q_DECLARE_FLAGS(Constraints, Constraint) @@ -98,7 +83,7 @@ /** * Which edge of the anchor should the popup be positioned around */ - //KF6 TODO use a better data type (enum of 8 options) rather than flags which allow invalid values + // KF6 TODO use a better data type (enum of 8 options) rather than flags which allow invalid values Qt::Edges anchorEdge() const; void setAnchorEdge(Qt::Edges edge); @@ -108,7 +93,7 @@ * if the gravity is top, then the bottom of the popup will be at the anchor edge * */ - //KF6 TODO use a better data type (enum of 8 options) rather than flags which allow invalid values + // KF6 TODO use a better data type (enum of 8 options) rather than flags which allow invalid values Qt::Edges gravity() const; void setGravity(Qt::Edges edge); @@ -141,6 +126,8 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(XdgPositioner::Constraints) + /** * @short Wrapper for the xdg_shell interface. * @@ -169,7 +156,7 @@ { Q_OBJECT public: - virtual ~XdgShell(); + ~XdgShell() override; /** * Setup this XdgShell to manage the @p xdgshellv5. @@ -250,12 +237,12 @@ **/ XdgShellPopup *createPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent = nullptr); - operator xdg_wm_base*(); - operator xdg_wm_base*() const; - operator xdg_shell*(); - operator xdg_shell*() const; - operator zxdg_shell_v6*(); - operator zxdg_shell_v6*() const; + operator xdg_wm_base *(); + operator xdg_wm_base *() const; + operator xdg_shell *(); + operator xdg_shell *() const; + operator zxdg_shell_v6 *(); + operator zxdg_shell_v6 *() const; Q_SIGNALS: /** @@ -288,7 +275,7 @@ { Q_OBJECT public: - virtual ~XdgShellSurface(); + ~XdgShellSurface() override; /** * States the Surface can be in **/ @@ -296,7 +283,7 @@ /** * The Surface is maximized. **/ - Maximized = 1 << 0, + Maximized = 1 << 0, /** * The Surface is fullscreen. **/ @@ -304,11 +291,11 @@ /** * The Surface is currently being resized by the Compositor. **/ - Resizing = 1 << 2, + Resizing = 1 << 2, /** * The Surface is considered active. Does not imply keyboard focus. **/ - Activated = 1 << 3 + Activated = 1 << 3 }; Q_DECLARE_FLAGS(States, State) @@ -468,14 +455,20 @@ */ void setMinSize(const QSize &size); - operator xdg_surface*(); - operator xdg_surface*() const; - operator xdg_toplevel*(); - operator xdg_toplevel*() const; - operator zxdg_surface_v6*(); - operator zxdg_surface_v6*() const; - operator zxdg_toplevel_v6*(); - operator zxdg_toplevel_v6*() const; + /** + * Sets the position of the window contents within the buffer + * @since 5.59 + */ + void setWindowGeometry(const QRect &windowGeometry); + + operator xdg_surface *(); + operator xdg_surface *() const; + operator xdg_toplevel *(); + operator xdg_toplevel *() const; + operator zxdg_surface_v6 *(); + operator zxdg_surface_v6 *() const; + operator zxdg_toplevel_v6 *(); + operator zxdg_toplevel_v6 *() const; Q_SIGNALS: /** @@ -505,6 +498,8 @@ QScopedPointer d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(XdgShellSurface::States) + /** * A XdgShellPopup is a short-lived, temporary surface that can be * used to implement menus. It takes an explicit grab on the surface @@ -517,15 +512,16 @@ { Q_OBJECT public: - virtual ~XdgShellPopup(); + ~XdgShellPopup() override; /** * Setup this XdgShellPopup to manage the @p xdgpopupv5. * When using XdgShell::createXdgShellPopup there is no need to call this * method. * - * This was for XDGShellV5, this is now deprecated + * @deprecated Since 5.49. This was for XDGShellV5, this is now deprecated **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 49, "Use XDGShell version >5") void setup(xdg_popup *xdgpopupv5); /** @@ -586,15 +582,30 @@ */ void requestGrab(Seat *seat, quint32 serial); - operator xdg_surface*(); - operator xdg_surface*() const; - operator xdg_popup*(); - operator xdg_popup*() const; - operator zxdg_surface_v6*(); - operator zxdg_surface_v6*() const; - operator zxdg_popup_v6*(); - operator zxdg_popup_v6*() const; + /** + * When a configure event is received, if a client commits the + * Surface in response to the configure event, then the client + * must make an ackConfigure request sometime before the commit + * request, passing along the @p serial of the configure event. + * @see configureRequested + * @since 5.56 + **/ + void ackConfigure(quint32 serial); + /** + * Sets the position of the window contents within the buffer + * @since 5.59 + */ + void setWindowGeometry(const QRect &windowGeometry); + + operator xdg_surface *(); + operator xdg_surface *() const; + operator xdg_popup *(); + operator xdg_popup *() const; + operator zxdg_surface_v6 *(); + operator zxdg_surface_v6 *() const; + operator zxdg_popup_v6 *(); + operator zxdg_popup_v6 *() const; Q_SIGNALS: /** @@ -610,7 +621,6 @@ **/ void configureRequested(const QRect &relativePosition, quint32 serial); - protected: class Private; explicit XdgShellPopup(Private *p, QObject *parent = nullptr); @@ -622,14 +632,10 @@ } } -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::XdgShellSurface::States) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::XdgPositioner::Constraints) - Q_DECLARE_METATYPE(KWayland::Client::XdgPositioner) Q_DECLARE_METATYPE(KWayland::Client::XdgShellSurface::State) Q_DECLARE_METATYPE(KWayland::Client::XdgShellSurface::States) Q_DECLARE_METATYPE(KWayland::Client::XdgPositioner::Constraint) Q_DECLARE_METATYPE(KWayland::Client::XdgPositioner::Constraints) - #endif diff -Nru dwayland-5.57.0.23/src/client/xdgshell_p.h dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_p.h --- dwayland-5.57.0.23/src/client/xdgshell_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,73 +1,68 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_CLIENT_XDGSHELL_P_H #define KWAYLAND_CLIENT_XDGSHELL_P_H #include "xdgshell.h" -#include -#include #include +#include +#include namespace KWayland { namespace Client { - class Q_DECL_HIDDEN XdgShell::Private { public: virtual ~Private(); - virtual void setupV5(xdg_shell *xdgshellv5) { + virtual void setupV5(xdg_shell *xdgshellv5) + { Q_UNUSED(xdgshellv5) } - virtual void setupV6(zxdg_shell_v6 *xdgshellv6) { + virtual void setupV6(zxdg_shell_v6 *xdgshellv6) + { Q_UNUSED(xdgshellv6) } - virtual void setup(xdg_wm_base *xdgshell) { + virtual void setup(xdg_wm_base *xdgshell) + { Q_UNUSED(xdgshell); } virtual void release() = 0; virtual void destroy() = 0; virtual bool isValid() const = 0; - virtual operator xdg_shell*() { + virtual operator xdg_shell *() + { return nullptr; } - virtual operator xdg_shell*() const { + virtual operator xdg_shell *() const + { return nullptr; } - virtual operator zxdg_shell_v6*() { + virtual operator zxdg_shell_v6 *() + { return nullptr; } - virtual operator zxdg_shell_v6*() const { + virtual operator zxdg_shell_v6 *() const + { return nullptr; } - virtual operator xdg_wm_base*() { + virtual operator xdg_wm_base *() + { return nullptr; } - virtual operator xdg_wm_base*() const { + virtual operator xdg_wm_base *() const + { return nullptr; } virtual XdgShellSurface *getXdgSurface(Surface *surface, QObject *parent) = 0; - virtual XdgShellPopup *getXdgPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) { + virtual XdgShellPopup *getXdgPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) + { Q_UNUSED(surface) Q_UNUSED(parentSurface) Q_UNUSED(seat) @@ -78,7 +73,8 @@ return nullptr; }; - virtual XdgShellPopup *getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) { + virtual XdgShellPopup *getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) + { Q_UNUSED(surface) Q_UNUSED(parentSurface) Q_UNUSED(positioner) @@ -87,8 +83,8 @@ return nullptr; } - virtual XdgShellPopup *getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) { - + virtual XdgShellPopup *getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) + { Q_UNUSED(surface) Q_UNUSED(parentSurface) Q_UNUSED(positioner) @@ -108,7 +104,7 @@ Q_OBJECT public: explicit XdgShellUnstableV5(QObject *parent = nullptr); - virtual ~XdgShellUnstableV5(); + ~XdgShellUnstableV5() override; private: class Private; @@ -119,7 +115,7 @@ Q_OBJECT public: explicit XdgShellUnstableV6(QObject *parent = nullptr); - virtual ~XdgShellUnstableV6(); + ~XdgShellUnstableV6() override; private: class Private; @@ -130,18 +126,17 @@ Q_OBJECT public: explicit XdgShellStable(QObject *parent = nullptr); - virtual ~XdgShellStable(); + ~XdgShellStable() override; private: class Private; - }; class XdgShellSurfaceUnstableV5 : public XdgShellSurface { Q_OBJECT public: - virtual ~XdgShellSurfaceUnstableV5(); + ~XdgShellSurfaceUnstableV5() override; private: explicit XdgShellSurfaceUnstableV5(QObject *parent = nullptr); @@ -153,7 +148,7 @@ { Q_OBJECT public: - virtual ~XdgTopLevelUnstableV6(); + ~XdgTopLevelUnstableV6() override; private: explicit XdgTopLevelUnstableV6(QObject *parent = nullptr); @@ -165,7 +160,7 @@ { Q_OBJECT public: - virtual ~XdgTopLevelStable(); + ~XdgTopLevelStable() override; private: explicit XdgTopLevelStable(QObject *parent = nullptr); @@ -180,7 +175,8 @@ EventQueue *queue = nullptr; QSize size; - virtual void setupV5(xdg_surface *surface) { + virtual void setupV5(xdg_surface *surface) + { Q_UNUSED(surface) } virtual void setupV6(zxdg_surface_v6 *surface, zxdg_toplevel_v6 *toplevel) @@ -196,28 +192,36 @@ virtual void release() = 0; virtual void destroy() = 0; virtual bool isValid() const = 0; - virtual operator xdg_surface*() { + virtual operator xdg_surface *() + { return nullptr; } - virtual operator xdg_surface*() const { + virtual operator xdg_surface *() const + { return nullptr; } - virtual operator xdg_toplevel*() { + virtual operator xdg_toplevel *() + { return nullptr; } - virtual operator xdg_toplevel*() const { + virtual operator xdg_toplevel *() const + { return nullptr; } - virtual operator zxdg_surface_v6*() { + virtual operator zxdg_surface_v6 *() + { return nullptr; } - virtual operator zxdg_surface_v6*() const { + virtual operator zxdg_surface_v6 *() const + { return nullptr; } - virtual operator zxdg_toplevel_v6*() { + virtual operator zxdg_toplevel_v6 *() + { return nullptr; } - virtual operator zxdg_toplevel_v6*() const { + virtual operator zxdg_toplevel_v6 *() const + { return nullptr; } @@ -235,6 +239,10 @@ virtual void setMinimized() = 0; virtual void setMaxSize(const QSize &size) = 0; virtual void setMinSize(const QSize &size) = 0; + virtual void setWindowGeometry(const QRect &windowGeometry) + { + Q_UNUSED(windowGeometry); + } protected: Private(XdgShellSurface *q); @@ -250,46 +258,68 @@ EventQueue *queue = nullptr; - virtual void setupV5(xdg_popup *p) { + virtual void setupV5(xdg_popup *p) + { Q_UNUSED(p) } - virtual void setupV6(zxdg_surface_v6 *s, zxdg_popup_v6 *p) { + virtual void setupV6(zxdg_surface_v6 *s, zxdg_popup_v6 *p) + { Q_UNUSED(s) Q_UNUSED(p) } - virtual void setup(xdg_surface *s, xdg_popup *p) { + virtual void setup(xdg_surface *s, xdg_popup *p) + { Q_UNUSED(s) Q_UNUSED(p) } virtual void release() = 0; virtual void destroy() = 0; virtual bool isValid() const = 0; - virtual void requestGrab(Seat *seat, quint32 serial) { + virtual void requestGrab(Seat *seat, quint32 serial) + { Q_UNUSED(seat); Q_UNUSED(serial); }; - virtual operator xdg_surface*() { + virtual void ackConfigure(quint32 serial) + { + Q_UNUSED(serial); + } + + virtual void setWindowGeometry(const QRect &windowGeometry) + { + Q_UNUSED(windowGeometry); + } + + virtual operator xdg_surface *() + { return nullptr; } - virtual operator xdg_surface*() const { + virtual operator xdg_surface *() const + { return nullptr; } - virtual operator xdg_popup*() { + virtual operator xdg_popup *() + { return nullptr; } - virtual operator xdg_popup*() const { + virtual operator xdg_popup *() const + { return nullptr; } - virtual operator zxdg_surface_v6*() { + virtual operator zxdg_surface_v6 *() + { return nullptr; } - virtual operator zxdg_surface_v6*() const { + virtual operator zxdg_surface_v6 *() const + { return nullptr; } - virtual operator zxdg_popup_v6*() { + virtual operator zxdg_popup_v6 *() + { return nullptr; } - virtual operator zxdg_popup_v6*() const { + virtual operator zxdg_popup_v6 *() const + { return nullptr; } @@ -310,11 +340,10 @@ QPoint anchorOffset; }; - class XdgShellPopupUnstableV5 : public XdgShellPopup { public: - virtual ~XdgShellPopupUnstableV5(); + ~XdgShellPopupUnstableV5() override; private: explicit XdgShellPopupUnstableV5(QObject *parent = nullptr); @@ -325,7 +354,7 @@ class XdgShellPopupUnstableV6 : public XdgShellPopup { public: - virtual ~XdgShellPopupUnstableV6(); + ~XdgShellPopupUnstableV6() override; private: explicit XdgShellPopupUnstableV6(QObject *parent = nullptr); @@ -336,7 +365,7 @@ class XdgShellPopupStable : public XdgShellPopup { public: - virtual ~XdgShellPopupStable(); + ~XdgShellPopupStable() override; private: explicit XdgShellPopupStable(QObject *parent = nullptr); diff -Nru dwayland-5.57.0.23/src/client/xdgshell_stable.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_stable.cpp --- dwayland-5.57.0.23/src/client/xdgshell_stable.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_stable.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,20 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "event_queue.h" #include "output.h" #include "seat.h" #include "surface.h" #include "wayland_pointer_p.h" +#include "xdgshell_p.h" #include namespace KWayland { namespace Client { - class XdgShellStable::Private : public XdgShell::Private { public: @@ -42,12 +27,14 @@ XdgShellPopup *getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) override; XdgShellPopup *getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) override; - using XdgShell::Private::operator xdg_shell*; - using XdgShell::Private::operator zxdg_shell_v6*; - operator xdg_wm_base*() override { + using XdgShell::Private::operator xdg_shell *; + using XdgShell::Private::operator zxdg_shell_v6 *; + operator xdg_wm_base *() override + { return xdg_shell_base; } - operator xdg_wm_base*() const override { + operator xdg_wm_base *() const override + { return xdg_shell_base; } @@ -220,7 +207,7 @@ XdgShellPopup *s = new XdgShellPopupStable(parent); auto popup = xdg_surface_get_popup(ss, parentSurface, p); if (queue) { - //deliberately not adding the positioner because the positioner has no events sent to it + // deliberately not adding the positioner because the positioner has no events sent to it queue->addProxy(ss); queue->addProxy(popup); } @@ -232,14 +219,13 @@ } XdgShellStable::XdgShellStable(QObject *parent) - : XdgShell(new Private, parent) + : XdgShell(new Private, parent) { } XdgShellStable::~XdgShellStable() = default; - -//A top level wraps both xdg_surface and xdg_top_level into the public API XdgShelllSurface +// A top level wraps both xdg_surface and xdg_top_level into the public API XdgShelllSurface class XdgTopLevelStable::Private : public XdgShellSurface::Private { public: @@ -252,18 +238,22 @@ void destroy() override; bool isValid() const override; - using XdgShellSurface::Private::operator zxdg_toplevel_v6*; - using XdgShellSurface::Private::operator zxdg_surface_v6*; - operator xdg_surface*() override { + using XdgShellSurface::Private::operator zxdg_toplevel_v6 *; + using XdgShellSurface::Private::operator zxdg_surface_v6 *; + operator xdg_surface *() override + { return xdgsurface; } - operator xdg_surface*() const override { + operator xdg_surface *() const override + { return xdgsurface; } - operator xdg_toplevel*() override { + operator xdg_toplevel *() override + { return xdgtoplevel; } - operator xdg_toplevel*() const override { + operator xdg_toplevel *() const override + { return xdgtoplevel; } @@ -281,6 +271,7 @@ void setMinimized() override; void setMaxSize(const QSize &size) override; void setMinSize(const QSize &size) override; + void setWindowGeometry(const QRect &windowGeometry) override; private: QSize pendingSize; @@ -294,31 +285,26 @@ static const struct xdg_surface_listener s_surfaceListener; }; -const struct xdg_toplevel_listener XdgTopLevelStable::Private::s_toplevelListener = { - configureCallback, - closeCallback -}; +const struct xdg_toplevel_listener XdgTopLevelStable::Private::s_toplevelListener = {configureCallback, closeCallback}; -const struct xdg_surface_listener XdgTopLevelStable::Private::s_surfaceListener = { - surfaceConfigureCallback -}; +const struct xdg_surface_listener XdgTopLevelStable::Private::s_surfaceListener = {surfaceConfigureCallback}; void XdgTopLevelStable::Private::surfaceConfigureCallback(void *data, struct xdg_surface *surface, uint32_t serial) { Q_UNUSED(surface) - auto s = static_cast(data); + auto s = static_cast(data); s->q->configureRequested(s->pendingSize, s->pendingState, serial); if (!s->pendingSize.isNull()) { s->q->setSize(s->pendingSize); s->pendingSize = QSize(); } - s->pendingState = nullptr; + s->pendingState = {}; } void XdgTopLevelStable::Private::configureCallback(void *data, struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height, struct wl_array *state) { Q_UNUSED(xdg_toplevel) - auto s = static_cast(data); + auto s = static_cast(data); States states; uint32_t *statePtr = static_cast(state->data); @@ -344,9 +330,9 @@ void XdgTopLevelStable::Private::closeCallback(void *data, xdg_toplevel *xdg_toplevel) { - auto s = static_cast(data); + auto s = static_cast(data); Q_ASSERT(s->xdgtoplevel == xdg_toplevel); - emit s->q->closeRequested(); + Q_EMIT s->q->closeRequested(); } XdgTopLevelStable::Private::Private(XdgShellSurface *q) @@ -390,12 +376,12 @@ xdg_toplevel_set_parent(xdgtoplevel, parentSurface); } -void XdgTopLevelStable::Private::setTitle(const QString & title) +void XdgTopLevelStable::Private::setTitle(const QString &title) { xdg_toplevel_set_title(xdgtoplevel, title.toUtf8().constData()); } -void XdgTopLevelStable::Private::setAppId(const QByteArray & appId) +void XdgTopLevelStable::Private::setAppId(const QByteArray &appId) { xdg_toplevel_set_app_id(xdgtoplevel, appId.constData()); } @@ -481,6 +467,11 @@ xdg_toplevel_set_min_size(xdgtoplevel, size.width(), size.height()); } +void XdgTopLevelStable::Private::setWindowGeometry(const QRect &windowGeometry) +{ + xdg_surface_set_window_geometry(xdgsurface, windowGeometry.x(), windowGeometry.y(), windowGeometry.width(), windowGeometry.height()); +} + XdgTopLevelStable::XdgTopLevelStable(QObject *parent) : XdgShellSurface(new Private(this), parent) { @@ -498,23 +489,29 @@ void destroy() override; bool isValid() const override; void requestGrab(Seat *seat, quint32 serial) override; + void ackConfigure(quint32 serial) override; + void setWindowGeometry(const QRect &windowGeometry) override; - using XdgShellPopup::Private::operator zxdg_popup_v6*; - using XdgShellPopup::Private::operator zxdg_surface_v6*; - operator xdg_surface*() override { - return xdgsurfacev6; - } - operator xdg_surface*() const override { - return xdgsurfacev6; + using XdgShellPopup::Private::operator zxdg_popup_v6 *; + using XdgShellPopup::Private::operator zxdg_surface_v6 *; + operator xdg_surface *() override + { + return xdgsurface; } - operator xdg_popup*() override { - return xdgpopupv6; + operator xdg_surface *() const override + { + return xdgsurface; } - operator xdg_popup*() const override { - return xdgpopupv6; + operator xdg_popup *() override + { + return xdgpopup; + } + operator xdg_popup *() const override + { + return xdgpopup; } - WaylandPointer xdgsurfacev6; - WaylandPointer xdgpopupv6; + WaylandPointer xdgsurface; + WaylandPointer xdgpopup; QRect pendingRect; @@ -527,10 +524,7 @@ static const struct xdg_surface_listener s_surfaceListener; }; -const struct xdg_popup_listener XdgShellPopupStable::Private::s_popupListener = { - configureCallback, - popupDoneCallback -}; +const struct xdg_popup_listener XdgShellPopupStable::Private::s_popupListener = {configureCallback, popupDoneCallback}; const struct xdg_surface_listener XdgShellPopupStable::Private::s_surfaceListener = { surfaceConfigureCallback, @@ -539,23 +533,23 @@ void XdgShellPopupStable::Private::configureCallback(void *data, xdg_popup *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height) { Q_UNUSED(xdg_popup) - auto s = static_cast(data); + auto s = static_cast(data); s->pendingRect = QRect(x, y, width, height); } void XdgShellPopupStable::Private::surfaceConfigureCallback(void *data, struct xdg_surface *surface, uint32_t serial) { Q_UNUSED(surface) - auto s = static_cast(data); + auto s = static_cast(data); s->q->configureRequested(s->pendingRect, serial); s->pendingRect = QRect(); } void XdgShellPopupStable::Private::popupDoneCallback(void *data, xdg_popup *xdg_popup) { - auto s = static_cast(data); - Q_ASSERT(s->xdgpopupv6 == xdg_popup); - emit s->q->popupDone(); + auto s = static_cast(data); + Q_ASSERT(s->xdgpopup == xdg_popup); + Q_EMIT s->q->popupDone(); } XdgShellPopupStable::Private::Private(XdgShellPopup *q) @@ -566,35 +560,44 @@ void XdgShellPopupStable::Private::setup(xdg_surface *s, xdg_popup *p) { Q_ASSERT(p); - Q_ASSERT(!xdgsurfacev6); - Q_ASSERT(!xdgpopupv6); + Q_ASSERT(!xdgsurface); + Q_ASSERT(!xdgpopup); - xdgsurfacev6.setup(s); - xdgpopupv6.setup(p); - xdg_surface_add_listener(xdgsurfacev6, &s_surfaceListener, this); - xdg_popup_add_listener(xdgpopupv6, &s_popupListener, this); + xdgsurface.setup(s); + xdgpopup.setup(p); + xdg_surface_add_listener(xdgsurface, &s_surfaceListener, this); + xdg_popup_add_listener(xdgpopup, &s_popupListener, this); } void XdgShellPopupStable::Private::release() { - xdgpopupv6.release(); + xdgpopup.release(); } void XdgShellPopupStable::Private::destroy() { - xdgpopupv6.destroy(); + xdgpopup.destroy(); } bool XdgShellPopupStable::Private::isValid() const { - return xdgpopupv6.isValid(); + return xdgpopup.isValid(); } void XdgShellPopupStable::Private::requestGrab(Seat *seat, quint32 serial) { - xdg_popup_grab(xdgpopupv6, *seat, serial); + xdg_popup_grab(xdgpopup, *seat, serial); +} + +void XdgShellPopupStable::Private::ackConfigure(quint32 serial) +{ + xdg_surface_ack_configure(xdgsurface, serial); } +void XdgShellPopupStable::Private::setWindowGeometry(const QRect &windowGeometry) +{ + xdg_surface_set_window_geometry(xdgsurface, windowGeometry.x(), windowGeometry.y(), windowGeometry.width(), windowGeometry.height()); +} XdgShellPopupStable::XdgShellPopupStable(QObject *parent) : XdgShellPopup(new Private(this), parent) diff -Nru dwayland-5.57.0.23/src/client/xdgshell_v5.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_v5.cpp --- dwayland-5.57.0.23/src/client/xdgshell_v5.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_v5.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,35 +1,20 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../compat/wayland-xdg-shell-v5-client-protocol.h" #include "event_queue.h" #include "output.h" #include "seat.h" #include "surface.h" #include "wayland_pointer_p.h" -#include "../compat/wayland-xdg-shell-v5-client-protocol.h" +#include "xdgshell_p.h" namespace KWayland { namespace Client { - class XdgShellUnstableV5::Private : public XdgShell::Private { public: @@ -40,12 +25,14 @@ XdgShellSurface *getXdgSurface(Surface *surface, QObject *parent) override; XdgShellPopup *getXdgPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) override; - using XdgShell::Private::operator xdg_wm_base*; - using XdgShell::Private::operator zxdg_shell_v6*; - operator xdg_shell*() override { + using XdgShell::Private::operator xdg_wm_base *; + using XdgShell::Private::operator zxdg_shell_v6 *; + operator xdg_shell *() override + { return xdgshellv5; } - operator xdg_shell*() const override { + operator xdg_shell *() const override + { return xdgshellv5; } @@ -101,7 +88,8 @@ return s; } -XdgShellPopup *XdgShellUnstableV5::Private::getXdgPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) +XdgShellPopup * +XdgShellUnstableV5::Private::getXdgPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) { Q_ASSERT(isValid()); XdgShellPopup *s = new XdgShellPopupUnstableV5(parent); @@ -114,7 +102,7 @@ } XdgShellUnstableV5::XdgShellUnstableV5(QObject *parent) - : XdgShell(new Private, parent) + : XdgShell(new Private, parent) { } @@ -131,13 +119,15 @@ void destroy() override; bool isValid() const override; - using XdgShellSurface::Private::operator zxdg_surface_v6*; - using XdgShellSurface::Private::operator zxdg_toplevel_v6*; - using XdgShellSurface::Private::operator xdg_toplevel*; - operator xdg_surface*() override { + using XdgShellSurface::Private::operator zxdg_surface_v6 *; + using XdgShellSurface::Private::operator zxdg_toplevel_v6 *; + using XdgShellSurface::Private::operator xdg_toplevel *; + operator xdg_surface *() override + { return xdgsurfacev5; } - operator xdg_surface*() const override { + operator xdg_surface *() const override + { return xdgsurfacev5; } @@ -163,16 +153,18 @@ static const struct zxdg_surface_v5_listener s_listener; }; -const struct zxdg_surface_v5_listener XdgShellSurfaceUnstableV5::Private::s_listener = { - configureCallback, - closeCallback -}; +const struct zxdg_surface_v5_listener XdgShellSurfaceUnstableV5::Private::s_listener = {configureCallback, closeCallback}; -void XdgShellSurfaceUnstableV5::Private::configureCallback(void *data, xdg_surface *xdg_surface, int32_t width, int32_t height, wl_array *wlStates, uint32_t serial) +void XdgShellSurfaceUnstableV5::Private::configureCallback(void *data, + xdg_surface *xdg_surface, + int32_t width, + int32_t height, + wl_array *wlStates, + uint32_t serial) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->xdgsurfacev5 == xdg_surface); - uint32_t *state = reinterpret_cast(wlStates->data); + uint32_t *state = reinterpret_cast(wlStates->data); size_t numStates = wlStates->size / sizeof(uint32_t); States states; for (size_t i = 0; i < numStates; i++) { @@ -192,7 +184,7 @@ } } const QSize size = QSize(width, height); - emit s->q->configureRequested(size, states, serial); + Q_EMIT s->q->configureRequested(size, states, serial); if (!size.isNull()) { s->q->setSize(size); } @@ -200,9 +192,9 @@ void XdgShellSurfaceUnstableV5::Private::closeCallback(void *data, xdg_surface *xdg_surface) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->xdgsurfacev5 == xdg_surface); - emit s->q->closeRequested(); + Q_EMIT s->q->closeRequested(); } XdgShellSurfaceUnstableV5::Private::Private(XdgShellSurface *q) @@ -233,7 +225,6 @@ return xdgsurfacev5.isValid(); } - void XdgShellSurfaceUnstableV5::Private::setTransientFor(XdgShellSurface *parent) { xdg_surface *parentSurface = nullptr; @@ -243,12 +234,12 @@ zxdg_surface_v5_set_parent(xdgsurfacev5, parentSurface); } -void XdgShellSurfaceUnstableV5::Private::setTitle(const QString & title) +void XdgShellSurfaceUnstableV5::Private::setTitle(const QString &title) { zxdg_surface_v5_set_title(xdgsurfacev5, title.toUtf8().constData()); } -void XdgShellSurfaceUnstableV5::Private::setAppId(const QByteArray & appId) +void XdgShellSurfaceUnstableV5::Private::setAppId(const QByteArray &appId) { zxdg_surface_v5_set_app_id(xdgsurfacev5, appId.constData()); } @@ -327,13 +318,13 @@ void XdgShellSurfaceUnstableV5::Private::setMaxSize(const QSize &size) { Q_UNUSED(size) - //TODO: notify an error? + // TODO: notify an error? } void XdgShellSurfaceUnstableV5::Private::setMinSize(const QSize &size) { Q_UNUSED(size) - //TODO: notify an error? + // TODO: notify an error? } XdgShellSurfaceUnstableV5::XdgShellSurfaceUnstableV5(QObject *parent) @@ -353,13 +344,15 @@ void destroy() override; bool isValid() const override; - using XdgShellPopup::Private::operator xdg_surface*; - using XdgShellPopup::Private::operator zxdg_popup_v6*; - using XdgShellPopup::Private::operator zxdg_surface_v6*; - operator xdg_popup*() override { + using XdgShellPopup::Private::operator xdg_surface *; + using XdgShellPopup::Private::operator zxdg_popup_v6 *; + using XdgShellPopup::Private::operator zxdg_surface_v6 *; + operator xdg_popup *() override + { return xdgpopupv5; } - operator xdg_popup*() const override { + operator xdg_popup *() const override + { return xdgpopupv5; } WaylandPointer xdgpopupv5; @@ -369,15 +362,13 @@ static const struct zxdg_popup_v5_listener s_listener; }; -const struct zxdg_popup_v5_listener XdgShellPopupUnstableV5::Private::s_listener = { - popupDoneCallback -}; +const struct zxdg_popup_v5_listener XdgShellPopupUnstableV5::Private::s_listener = {popupDoneCallback}; void XdgShellPopupUnstableV5::Private::popupDoneCallback(void *data, xdg_popup *xdg_popup) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->xdgpopupv5 == xdg_popup); - emit s->q->popupDone(); + Q_EMIT s->q->popupDone(); } XdgShellPopupUnstableV5::Private::Private(XdgShellPopup *q) diff -Nru dwayland-5.57.0.23/src/client/xdgshell_v6.cpp dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_v6.cpp --- dwayland-5.57.0.23/src/client/xdgshell_v6.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xdgshell_v6.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,28 +1,14 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "event_queue.h" #include "output.h" #include "seat.h" #include "surface.h" #include "wayland_pointer_p.h" +#include "xdgshell_p.h" #include #include @@ -31,7 +17,6 @@ { namespace Client { - class XdgShellUnstableV6::Private : public XdgShell::Private { public: @@ -44,12 +29,14 @@ XdgShellPopup *getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) override; XdgShellPopup *getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) override; - using XdgShell::Private::operator xdg_wm_base*; - using XdgShell::Private::operator xdg_shell*; - operator zxdg_shell_v6*() override { + using XdgShell::Private::operator xdg_wm_base *; + using XdgShell::Private::operator xdg_shell *; + operator zxdg_shell_v6 *() override + { return xdgshellv6; } - operator zxdg_shell_v6*() const override { + operator zxdg_shell_v6 *() const override + { return xdgshellv6; } @@ -123,7 +110,8 @@ return internalGetXdgPopup(surface, *parentSurface, positioner, parent); } -XdgShellPopup *XdgShellUnstableV6::Private::internalGetXdgPopup(Surface *surface, zxdg_surface_v6 *parentSurface, const XdgPositioner &positioner, QObject *parent) +XdgShellPopup * +XdgShellUnstableV6::Private::internalGetXdgPopup(Surface *surface, zxdg_surface_v6 *parentSurface, const XdgPositioner &positioner, QObject *parent) { Q_ASSERT(isValid()); auto ss = zxdg_shell_v6_get_xdg_surface(xdgshellv6, *surface); @@ -205,7 +193,7 @@ XdgShellPopup *s = new XdgShellPopupUnstableV6(parent); auto popup = zxdg_surface_v6_get_popup(ss, parentSurface, p); if (queue) { - //deliberately not adding the positioner because the positioner has no events sent to it + // deliberately not adding the positioner because the positioner has no events sent to it queue->addProxy(ss); queue->addProxy(popup); } @@ -217,14 +205,13 @@ } XdgShellUnstableV6::XdgShellUnstableV6(QObject *parent) - : XdgShell(new Private, parent) + : XdgShell(new Private, parent) { } XdgShellUnstableV6::~XdgShellUnstableV6() = default; - -//A top level wraps both xdg_surface_v6 and xdg_top_level into the public API XdgShelllSurface +// A top level wraps both xdg_surface_v6 and xdg_top_level into the public API XdgShelllSurface class XdgTopLevelUnstableV6::Private : public XdgShellSurface::Private { public: @@ -237,18 +224,22 @@ void destroy() override; bool isValid() const override; - using XdgShellSurface::Private::operator xdg_surface*; - using XdgShellSurface::Private::operator xdg_toplevel*; - operator zxdg_surface_v6*() override { + using XdgShellSurface::Private::operator xdg_surface *; + using XdgShellSurface::Private::operator xdg_toplevel *; + operator zxdg_surface_v6 *() override + { return xdgsurfacev6; } - operator zxdg_surface_v6*() const override { + operator zxdg_surface_v6 *() const override + { return xdgsurfacev6; } - operator zxdg_toplevel_v6*() override { + operator zxdg_toplevel_v6 *() override + { return xdgtoplevelv6; } - operator zxdg_toplevel_v6*() const override { + operator zxdg_toplevel_v6 *() const override + { return xdgtoplevelv6; } @@ -279,31 +270,26 @@ static const struct zxdg_surface_v6_listener s_surfaceListener; }; -const struct zxdg_toplevel_v6_listener XdgTopLevelUnstableV6::Private::s_toplevelListener = { - configureCallback, - closeCallback -}; +const struct zxdg_toplevel_v6_listener XdgTopLevelUnstableV6::Private::s_toplevelListener = {configureCallback, closeCallback}; -const struct zxdg_surface_v6_listener XdgTopLevelUnstableV6::Private::s_surfaceListener = { - surfaceConfigureCallback -}; +const struct zxdg_surface_v6_listener XdgTopLevelUnstableV6::Private::s_surfaceListener = {surfaceConfigureCallback}; void XdgTopLevelUnstableV6::Private::surfaceConfigureCallback(void *data, struct zxdg_surface_v6 *surface, uint32_t serial) { Q_UNUSED(surface) - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); s->q->configureRequested(s->pendingSize, s->pendingState, serial); if (!s->pendingSize.isNull()) { s->q->setSize(s->pendingSize); s->pendingSize = QSize(); } - s->pendingState = nullptr; + s->pendingState = {}; } void XdgTopLevelUnstableV6::Private::configureCallback(void *data, struct zxdg_toplevel_v6 *xdg_toplevel, int32_t width, int32_t height, struct wl_array *state) { Q_UNUSED(xdg_toplevel) - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); States states; uint32_t *statePtr = reinterpret_cast(state->data); @@ -329,9 +315,9 @@ void XdgTopLevelUnstableV6::Private::closeCallback(void *data, zxdg_toplevel_v6 *xdg_toplevel) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->xdgtoplevelv6 == xdg_toplevel); - emit s->q->closeRequested(); + Q_EMIT s->q->closeRequested(); } XdgTopLevelUnstableV6::Private::Private(XdgShellSurface *q) @@ -375,12 +361,12 @@ zxdg_toplevel_v6_set_parent(xdgtoplevelv6, parentSurface); } -void XdgTopLevelUnstableV6::Private::setTitle(const QString & title) +void XdgTopLevelUnstableV6::Private::setTitle(const QString &title) { zxdg_toplevel_v6_set_title(xdgtoplevelv6, title.toUtf8().constData()); } -void XdgTopLevelUnstableV6::Private::setAppId(const QByteArray & appId) +void XdgTopLevelUnstableV6::Private::setAppId(const QByteArray &appId) { zxdg_toplevel_v6_set_app_id(xdgtoplevelv6, appId.constData()); } @@ -483,19 +469,24 @@ void destroy() override; bool isValid() const override; void requestGrab(Seat *seat, quint32 serial) override; + void ackConfigure(quint32 serial) override; - using XdgShellPopup::Private::operator xdg_popup*; - using XdgShellPopup::Private::operator xdg_surface*; - operator zxdg_surface_v6*() override { + using XdgShellPopup::Private::operator xdg_popup *; + using XdgShellPopup::Private::operator xdg_surface *; + operator zxdg_surface_v6 *() override + { return xdgsurfacev6; } - operator zxdg_surface_v6*() const override { + operator zxdg_surface_v6 *() const override + { return xdgsurfacev6; } - operator zxdg_popup_v6*() override { + operator zxdg_popup_v6 *() override + { return xdgpopupv6; } - operator zxdg_popup_v6*() const override { + operator zxdg_popup_v6 *() const override + { return xdgpopupv6; } WaylandPointer xdgsurfacev6; @@ -512,10 +503,7 @@ static const struct zxdg_surface_v6_listener s_surfaceListener; }; -const struct zxdg_popup_v6_listener XdgShellPopupUnstableV6::Private::s_popupListener = { - configureCallback, - popupDoneCallback -}; +const struct zxdg_popup_v6_listener XdgShellPopupUnstableV6::Private::s_popupListener = {configureCallback, popupDoneCallback}; const struct zxdg_surface_v6_listener XdgShellPopupUnstableV6::Private::s_surfaceListener = { surfaceConfigureCallback, @@ -524,23 +512,23 @@ void XdgShellPopupUnstableV6::Private::configureCallback(void *data, zxdg_popup_v6 *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height) { Q_UNUSED(xdg_popup); - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); s->pendingRect = QRect(x, y, width, height); } void XdgShellPopupUnstableV6::Private::surfaceConfigureCallback(void *data, struct zxdg_surface_v6 *surface, uint32_t serial) { Q_UNUSED(surface); - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); s->q->configureRequested(s->pendingRect, serial); s->pendingRect = QRect(); } void XdgShellPopupUnstableV6::Private::popupDoneCallback(void *data, zxdg_popup_v6 *xdg_popup) { - auto s = reinterpret_cast(data); + auto s = reinterpret_cast(data); Q_ASSERT(s->xdgpopupv6 == xdg_popup); - emit s->q->popupDone(); + Q_EMIT s->q->popupDone(); } XdgShellPopupUnstableV6::Private::Private(XdgShellPopup *q) @@ -580,6 +568,10 @@ zxdg_popup_v6_grab(xdgpopupv6, *seat, serial); } +void XdgShellPopupUnstableV6::Private::ackConfigure(quint32 serial) +{ + zxdg_surface_v6_ack_configure(xdgsurfacev6, serial); +} XdgShellPopupUnstableV6::XdgShellPopupUnstableV6(QObject *parent) : XdgShellPopup(new Private(this), parent) diff -Nru dwayland-5.57.0.23/src/client/xwayland_keyboard_grab_v1.cpp dwayland-5.57.0.24+really5.24.3/src/client/xwayland_keyboard_grab_v1.cpp --- dwayland-5.57.0.23/src/client/xwayland_keyboard_grab_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xwayland_keyboard_grab_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,204 +0,0 @@ -/******************************************************************** -Copyright 2021 zhangyaning - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "xwayland_keyboard_grab_v1.h" -#include "event_queue.h" -#include "surface.h" -#include "seat.h" -#include "logging.h" -#include "wayland_pointer_p.h" -// Qt -#include -#include -#include -#include -// wayland -#include - -namespace KWayland -{ - -namespace Client -{ - -class Q_DECL_HIDDEN ZWPXwaylandKeyboardGrabManagerV1::Private -{ -public: - Private(ZWPXwaylandKeyboardGrabManagerV1 *q); - void setup(zwp_xwayland_keyboard_grab_manager_v1 *o); - - WaylandPointer grabManager; - EventQueue *queue = nullptr; - -private: - ZWPXwaylandKeyboardGrabManagerV1 *q; -}; - -ZWPXwaylandKeyboardGrabManagerV1::Private::Private(ZWPXwaylandKeyboardGrabManagerV1 *q) - : q(q) -{ -} - -void ZWPXwaylandKeyboardGrabManagerV1::Private::setup(zwp_xwayland_keyboard_grab_manager_v1 *o) -{ - Q_ASSERT(o); - Q_ASSERT(!grabManager); - grabManager.setup(o); -} - -ZWPXwaylandKeyboardGrabManagerV1::ZWPXwaylandKeyboardGrabManagerV1(QObject *parent) - : QObject(parent) - , d(new Private(this)) -{ -} - -ZWPXwaylandKeyboardGrabManagerV1::~ZWPXwaylandKeyboardGrabManagerV1() -{ - release(); -} - -void ZWPXwaylandKeyboardGrabManagerV1::destroy() -{ - if (!d->grabManager) { - return; - } - emit interfaceAboutToBeDestroyed(); - d->grabManager.destroy(); -} - -void ZWPXwaylandKeyboardGrabManagerV1::release() -{ - if (!d->grabManager) { - return; - } - emit interfaceAboutToBeReleased(); - d->grabManager.release(); -} - -void ZWPXwaylandKeyboardGrabManagerV1::setup(zwp_xwayland_keyboard_grab_manager_v1 *grabManager) -{ - d->setup(grabManager); -} - -EventQueue *ZWPXwaylandKeyboardGrabManagerV1::eventQueue() const -{ - return d->queue; -} - -void ZWPXwaylandKeyboardGrabManagerV1::setEventQueue(EventQueue *queue) -{ - d->queue = queue; -} - -ZWPXwaylandKeyboardGrabV1 *ZWPXwaylandKeyboardGrabManagerV1::grabKeyBoard(Surface *surface, Seat *seat, QObject *parent) -{ - Q_ASSERT(isValid()); - - ZWPXwaylandKeyboardGrabV1 *s = new ZWPXwaylandKeyboardGrabV1(parent); - connect(this, &ZWPXwaylandKeyboardGrabManagerV1::interfaceAboutToBeReleased, s, &ZWPXwaylandKeyboardGrabV1::release); - connect(this, &ZWPXwaylandKeyboardGrabManagerV1::interfaceAboutToBeDestroyed, s, &ZWPXwaylandKeyboardGrabV1::destroy); - auto w = zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(d->grabManager, *surface, *seat); - if (d->queue) { - d->queue->addProxy(w); - } - s->setup(w); - return s; -} - -bool ZWPXwaylandKeyboardGrabManagerV1::isValid() const -{ - return d->grabManager.isValid(); -} - -ZWPXwaylandKeyboardGrabManagerV1::operator zwp_xwayland_keyboard_grab_manager_v1*() { - return d->grabManager; -} - -ZWPXwaylandKeyboardGrabManagerV1::operator zwp_xwayland_keyboard_grab_manager_v1*() const { - return d->grabManager; -} - - -class Q_DECL_HIDDEN ZWPXwaylandKeyboardGrabV1::Private -{ -public: - Private(ZWPXwaylandKeyboardGrabV1 *q); - void setup(zwp_xwayland_keyboard_grab_v1 *p); - - WaylandPointer grab; -private: - - ZWPXwaylandKeyboardGrabV1 *q; -}; - -ZWPXwaylandKeyboardGrabV1::Private::Private(ZWPXwaylandKeyboardGrabV1 *q) - : q(q) -{ -} - -void ZWPXwaylandKeyboardGrabV1::Private::setup(zwp_xwayland_keyboard_grab_v1 *p) -{ - Q_ASSERT(p); - Q_ASSERT(!grab); - grab.setup(p); -} - -ZWPXwaylandKeyboardGrabV1::ZWPXwaylandKeyboardGrabV1(QObject *parent) - : QObject(parent) - , d(new Private(this)) -{ -} - -ZWPXwaylandKeyboardGrabV1::~ZWPXwaylandKeyboardGrabV1() -{ - release(); -} - -void ZWPXwaylandKeyboardGrabV1::release() -{ - d->grab.release(); -} - -void ZWPXwaylandKeyboardGrabV1::destroy() -{ - d->grab.destroy(); -} - -void ZWPXwaylandKeyboardGrabV1::setup(zwp_xwayland_keyboard_grab_v1 *grab) -{ - d->setup(grab); -} - -bool ZWPXwaylandKeyboardGrabV1::isValid() const -{ - return d->grab.isValid(); -} - -ZWPXwaylandKeyboardGrabV1::operator zwp_xwayland_keyboard_grab_v1*() const -{ - return d->grab; -} - -ZWPXwaylandKeyboardGrabV1::operator zwp_xwayland_keyboard_grab_v1*() -{ - return d->grab; -} - -} -} diff -Nru dwayland-5.57.0.23/src/client/xwayland_keyboard_grab_v1.h dwayland-5.57.0.24+really5.24.3/src/client/xwayland_keyboard_grab_v1.h --- dwayland-5.57.0.23/src/client/xwayland_keyboard_grab_v1.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/client/xwayland_keyboard_grab_v1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -/******************************************************************** -Copyright 2021 zhangyaning - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_xwayland_keyboard_grab_v1_H -#define WAYLAND_xwayland_keyboard_grab_v1_H - -#include -#include -#include -#include - -#include - -struct zwp_xwayland_keyboard_grab_manager_v1; -struct zwp_xwayland_keyboard_grab_v1; -class QPoint; -class QRect; - -namespace KWayland -{ -namespace Client -{ - -class EventQueue; -class ZWPXwaylandKeyboardGrabV1; -class Surface; -class Seat; - -/** - * @short Wrapper for the zwp_xwayland_keyboard_grab_manager_v1 interface. - * - * This class provides a convenient wrapper for the zwp_xwayland_keyboard_grab_manager_v1 interface. - * Its main purpose is to hold the information about one ZWPXwaylandKeyboardGrabManagerV1. - * - * To use this class one needs to interact with the Registry. There are two - * possible ways to create an ZWPXwaylandKeyboardGrabManagerV1 interface: - * @code - * ZWPXwaylandKeyboardGrabManagerV1 *c = registry->createDDESeat(name, version); - * @endcode - * - * This creates the ZWPXwaylandKeyboardGrabManagerV1 and sets it up directly. As an alternative this - * can also be done in a more low level way: - * @code - * ZWPXwaylandKeyboardGrabManagerV1 *c = new ZWPXwaylandKeyboardGrabManagerV1; - * c->setup(registry->bindDDESeat(name, version)); - * @endcode - * - * The ZWPXwaylandKeyboardGrabManagerV1 can be used as a drop-in replacement for any zwp_xwayland_keyboard_grab_manager_v1 - * pointer as it provides matching cast operators. - * - * Please note that all properties of ZWPXwaylandKeyboardGrabManagerV1 are not valid until the - * changed signal has been emitted. The wayland server is pushing the - * information in an async way to the ZWPXwaylandKeyboardGrabManagerV1 instance. By emitting changed - * the ZWPXwaylandKeyboardGrabManagerV1 indicates that all relevant information is available. - * - * @see Registry - * @since 5.5 - **/ -class KWAYLANDCLIENT_EXPORT ZWPXwaylandKeyboardGrabManagerV1 : public QObject -{ - Q_OBJECT -public: - enum GrabType { - GrabServer, - GrabKeyboard, - GrabPointer - }; - - explicit ZWPXwaylandKeyboardGrabManagerV1(QObject *parent = nullptr); - virtual ~ZWPXwaylandKeyboardGrabManagerV1(); - - /** - * Setup this Compositor to manage the @p ZWPXwaylandKeyboardGrabManagerV1. - * When using Registry::createDDESeat there is no need to call this - * method. - **/ - void setup(zwp_xwayland_keyboard_grab_manager_v1 *ZWPXwaylandKeyboardGrabManagerV1); - - /** - * @returns @c true if managing a zwp_xwayland_keyboard_grab_manager_v1. - **/ - bool isValid() const; - operator zwp_xwayland_keyboard_grab_manager_v1*(); - operator zwp_xwayland_keyboard_grab_manager_v1*() const; - - /** - * Creates a ZWPXwaylandKeyboardGrabV1 and sets it up. - * - * - * @param parent The parent to use for the ZWPXwaylandKeyboardGrabV1 - * @returns created ZWPXwaylandKeyboardGrabV1 - **/ - ZWPXwaylandKeyboardGrabV1 *grabKeyBoard(Surface *surface, Seat *seat, QObject *parent = nullptr); - - /** - * Sets the @p queue to use for bound proxies. - **/ - void setEventQueue(EventQueue *queue); - /** - * @returns The event queue to use for bound proxies. - **/ - EventQueue *eventQueue() const; - - void release(); - /** - * Destroys the data hold by this ZWPXwaylandKeyboardGrabManagerV1. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid any more, it's not - * possible to call release any more as that calls into the Wayland - * connection and the call would fail. - * - * This method is automatically invoked when the Registry which created this - * ZWPXwaylandKeyboardGrabManagerV1 gets destroyed. - **/ - void destroy(); - -Q_SIGNALS: - /** - * This signal is emitted right before the interface is released. - **/ - void interfaceAboutToBeReleased(); - /** - * This signal is emitted right before the data is destroyed. - **/ - void interfaceAboutToBeDestroyed(); - - /** - * The corresponding global for this interface on the Registry got removed. - * - * This signal gets only emitted if the ZWPXwaylandKeyboardGrabManagerV1 got created by - * Registry::createDDESeat - * - * @since 5.5 - **/ - void removed(); - -private: - class Private; - QScopedPointer d; -}; - -/** - * @short Wrapper for the zwp_xwayland_keyboard_grab_v1 interface. - * - * This class is a convenient wrapper for the zwp_xwayland_keyboard_grab_v1 interface. - * - * To create an instance use ZWPXwaylandKeyboardGrabManagerV1::createDDePointer. - * - * - * @see ZWPXwaylandKeyboardGrabManagerV1 - **/ -class KWAYLANDCLIENT_EXPORT ZWPXwaylandKeyboardGrabV1 : public QObject -{ - Q_OBJECT -public: - - explicit ZWPXwaylandKeyboardGrabV1(QObject *parent); - virtual ~ZWPXwaylandKeyboardGrabV1(); - - /** - * Releases the zwp_xwayland_keyboard_grab_v1 interface. - * After the interface has been released the ZWPXwaylandKeyboardGrabV1 instance is no - * longer valid and can be setup with another zwp_xwayland_keyboard_grab_v1 interface. - * - * This method is automatically invoked when the ZWPXwaylandKeyboardGrabManagerV1 which created this - * ZWPXwaylandKeyboardGrabV1 gets released. - **/ - void release(); - /** - * Destroys the data held by this ZWPXwaylandKeyboardGrabV1. - * This method is supposed to be used when the connection to the Wayland - * server goes away. If the connection is not valid anymore, it's not - * possible to call release anymore as that calls into the Wayland - * connection and the call would fail. This method cleans up the data, so - * that the instance can be deleted or set up to a new zwp_xwayland_keyboard_grab_v1 interface - * once there is a new connection available. - * - * This method is automatically invoked when the ZWPXwaylandKeyboardGrabManagerV1 which created this - * ZWPXwaylandKeyboardGrabV1 gets destroyed. - * - * @see release - **/ - void destroy(); - /** - * Setup this ZWPXwaylandKeyboardGrabV1 to manage the @p zwp_xwayland_keyboard_grab_v1. - * There is normally no need to call this method as it's invoked by - * ZWPXwaylandKeyboardGrabManagerV1::createDDEPointer. - **/ - void setup(zwp_xwayland_keyboard_grab_v1 *grab); - - /** - * @returns @c true if managing a zwp_xwayland_keyboard_grab_v1. - **/ - bool isValid() const; - operator zwp_xwayland_keyboard_grab_v1*(); - operator zwp_xwayland_keyboard_grab_v1*() const; - - -private: - friend class ZWPXwaylandKeyboardGrabManagerV1; - class Private; - QScopedPointer d; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Client::ZWPXwaylandKeyboardGrabManagerV1::GrabType) - -#endif diff -Nru dwayland-5.57.0.23/src/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/src/CMakeLists.txt --- dwayland-5.57.0.23/src/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,9 +1,12 @@ +add_subdirectory(tools) add_subdirectory(client) add_subdirectory(server) -add_subdirectory(tools) - -install( FILES org_kde_kwayland.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) +ecm_qt_install_logging_categories( + EXPORT DWAYLAND + FILE dwayland.categories + DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} +) if(BUILD_QCH) macro(_make_absolute var_name base_path) @@ -18,28 +21,36 @@ set(${var_name} ${_result}) endmacro() - _make_absolute(KWaylandClient_APIDOX_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/client") - _make_absolute(KWaylandServer_APIDOX_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/server") + _make_absolute(DWaylandClient_APIDOX_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/client") + _make_absolute(DWaylandServer_APIDOX_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/server") ecm_add_qch( - KF5Wayland_QCH - NAME KWayland - BASE_NAME KF5Wayland - VERSION ${KF5_VERSION} - ORG_DOMAIN org.kde + DWayland_QCH + NAME DWayland + BASE_NAME DWayland + VERSION ${PROJECT_VERSION} + ORG_DOMAIN com.deepin SOURCES # using only public headers, to cover only public API - ${KWaylandClient_APIDOX_SRCS} - ${KWaylandServer_APIDOX_SRCS} + ${DWaylandClient_APIDOX_SRCS} + ${DWaylandServer_APIDOX_SRCS} MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" LINK_QCHS Qt5Gui_QCH + INCLUDE_DIRS + ${DWaylandClient_APIDOX_BUILD_INCLUDE_DIRS} + ${DWaylandServer_APIDOX_BUILD_INCLUDE_DIRS} BLANK_MACROS - KWAYLANDCLIENT_EXPORT - KWAYLANDCLIENT_DEPRECATED - KWAYLANDCLIENT_DEPRECATED_EXPORT - KWAYLANDSERVER_EXPORT - KWAYLANDSERVER_DEPRECATED - KWAYLANDSERVER_DEPRECATED_EXPORT + DWAYLANDCLIENT_EXPORT + DWAYLANDCLIENT_DEPRECATED + DWAYLANDCLIENT_DEPRECATED_EXPORT + "DWAYLANDCLIENT_DEPRECATED_VERSION(x, y, t)" + "DWAYLANDCLIENT_DEPRECATED_VERSION_BELATED(x, y, xt, yt, t)" + "DWAYLANDCLIENT_ENUMERATOR_DEPRECATED_VERSION(x, y, t)" + "DWAYLANDCLIENT_ENUMERATOR_DEPRECATED_VERSION_BELATED(x, y, xt, yt, t)" + DWAYLANDSERVER_EXPORT + DWAYLANDSERVER_DEPRECATED + DWAYLANDSERVER_DEPRECATED_EXPORT + "DWAYLANDSERVER_DEPRECATED_VERSION(x, y, t)" TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} COMPONENT Devel diff -Nru dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-client-protocol.h dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-client-protocol.h --- dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-client-protocol.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-client-protocol.h 2022-11-18 03:38:26.000000000 +0000 @@ -6,11 +6,11 @@ #ifndef ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H #define ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H -#include -#include #include "wayland-client.h" +#include +#include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -23,29 +23,12 @@ * @section page_copyright_zxdg_shell_v5_unstable_v5 Copyright *
  *
- * Copyright © 2008-2013 Kristian Høgsberg
- * Copyright © 2013      Rafael Antognolli
- * Copyright © 2013      Jasper St. Pierre
- * Copyright © 2010-2013 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * SPDX-FileCopyrightText: 2008-2013 Kristian Høgsberg
+ * SPDX-FileCopyrightText: 2013 Rafael Antognolli
+ * SPDX-FileCopyrightText: 2013 Jasper St. Pierre
+ * SPDX-FileCopyrightText: 2010-2013 Intel Corporation
+ *
+ * SPDX-License-Identifier: MIT
  * 
*/ struct wl_output; @@ -253,32 +236,32 @@ * implementation versions match. */ enum zxdg_shell_v5_version { - /** - * Always the latest version - */ - ZXDG_SHELL_V5_VERSION_CURRENT = 5, + /** + * Always the latest version + */ + ZXDG_SHELL_V5_VERSION_CURRENT = 5, }; #endif /* ZXDG_SHELL_V5_VERSION_ENUM */ #ifndef ZXDG_SHELL_V5_ERROR_ENUM #define ZXDG_SHELL_V5_ERROR_ENUM enum zxdg_shell_v5_error { - /** - * given wl_surface has another role - */ - ZXDG_SHELL_V5_ERROR_ROLE = 0, - /** - * xdg_shell was destroyed before children - */ - ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1, - /** - * the client tried to map or destroy a non-topmost popup - */ - ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2, - /** - * the client specified an invalid popup parent surface - */ - ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3, + /** + * given wl_surface has another role + */ + ZXDG_SHELL_V5_ERROR_ROLE = 0, + /** + * xdg_shell was destroyed before children + */ + ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1, + /** + * the client tried to map or destroy a non-topmost popup + */ + ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2, + /** + * the client specified an invalid popup parent surface + */ + ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3, }; #endif /* ZXDG_SHELL_V5_ERROR_ENUM */ @@ -287,36 +270,31 @@ * @struct zxdg_shell_v5_listener */ struct zxdg_shell_v5_listener { - /** - * check if the client is alive - * - * The ping event asks the client if it's still alive. Pass the - * serial specified in the event back to the compositor by sending - * a "pong" request back with the specified serial. - * - * Compositors can use this to determine if the client is still - * alive. It's unspecified what will happen if the client doesn't - * respond to the ping request, or in what timeframe. Clients - * should try to respond in a reasonable amount of time. - * - * A compositor is free to ping in any way it wants, but a client - * must always respond to any xdg_shell object it created. - * @param serial pass this to the pong request - */ - void (*ping)(void *data, - struct xdg_shell *xdg_shell, - uint32_t serial); + /** + * check if the client is alive + * + * The ping event asks the client if it's still alive. Pass the + * serial specified in the event back to the compositor by sending + * a "pong" request back with the specified serial. + * + * Compositors can use this to determine if the client is still + * alive. It's unspecified what will happen if the client doesn't + * respond to the ping request, or in what timeframe. Clients + * should try to respond in a reasonable amount of time. + * + * A compositor is free to ping in any way it wants, but a client + * must always respond to any xdg_shell object it created. + * @param serial pass this to the pong request + */ + void (*ping)(void *data, struct xdg_shell *xdg_shell, uint32_t serial); }; /** * @ingroup iface_zxdg_shell_v5 */ -static inline int -zxdg_shell_v5_add_listener(struct xdg_shell *xdg_shell, - const struct zxdg_shell_v5_listener *listener, void *data) +static inline int zxdg_shell_v5_add_listener(struct xdg_shell *xdg_shell, const struct zxdg_shell_v5_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_shell, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)xdg_shell, (void (**)(void))listener, data); } #define ZXDG_SHELL_V5_DESTROY 0 @@ -352,23 +330,20 @@ #define ZXDG_SHELL_V5_PONG_SINCE_VERSION 1 /** @ingroup iface_xdg_shell */ -static inline void -zxdg_shell_v5_set_user_data(struct xdg_shell *xdg_shell, void *user_data) +static inline void zxdg_shell_v5_set_user_data(struct xdg_shell *xdg_shell, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data); + wl_proxy_set_user_data((struct wl_proxy *)xdg_shell, user_data); } /** @ingroup iface_xdg_shell */ -static inline void * -zxdg_shell_v5_get_user_data(struct xdg_shell *xdg_shell) +static inline void *zxdg_shell_v5_get_user_data(struct xdg_shell *xdg_shell) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell); + return wl_proxy_get_user_data((struct wl_proxy *)xdg_shell); } -static inline uint32_t -zxdg_shell_v5_get_version(struct xdg_shell *xdg_shell) +static inline uint32_t zxdg_shell_v5_get_version(struct xdg_shell *xdg_shell) { - return wl_proxy_get_version((struct wl_proxy *) xdg_shell); + return wl_proxy_get_version((struct wl_proxy *)xdg_shell); } /** @@ -380,13 +355,11 @@ * still alive created by this xdg_shell object instance is illegal * and will result in a protocol error. */ -static inline void -zxdg_shell_v5_destroy(struct xdg_shell *xdg_shell) +static inline void zxdg_shell_v5_destroy(struct xdg_shell *xdg_shell) { - wl_proxy_marshal((struct wl_proxy *) xdg_shell, - ZXDG_SHELL_V5_DESTROY); + wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_DESTROY); - wl_proxy_destroy((struct wl_proxy *) xdg_shell); + wl_proxy_destroy((struct wl_proxy *)xdg_shell); } /** @@ -398,11 +371,9 @@ * cleanly if they don't agree. This request will go away once * the xdg-shell protocol is stable. */ -static inline void -zxdg_shell_v5_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version) +static inline void zxdg_shell_v5_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version) { - wl_proxy_marshal((struct wl_proxy *) xdg_shell, - ZXDG_SHELL_V5_USE_UNSTABLE_VERSION, version); + wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_USE_UNSTABLE_VERSION, version); } /** @@ -417,15 +388,13 @@ * See the documentation of xdg_surface for more details about what an * xdg_surface is and how it is used. */ -static inline struct xdg_surface * -zxdg_shell_v5_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface) +static inline struct xdg_surface *zxdg_shell_v5_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface) { - struct wl_proxy *id; + struct wl_proxy *id; - id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, - ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5, &zxdg_surface_v5_interface, NULL, surface); + id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5, &zxdg_surface_v5_interface, NULL, surface); - return (struct xdg_surface *) id; + return (struct xdg_surface *)id; } /** @@ -443,15 +412,28 @@ * See the documentation of xdg_popup for more details about what an * xdg_popup is and how it is used. */ -static inline struct xdg_popup * -zxdg_shell_v5_get_xdg_popup(struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) -{ - struct wl_proxy *id; - - id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell, - ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5, &zxdg_popup_v5_interface, NULL, surface, parent, seat, serial, x, y); +static inline struct xdg_popup *zxdg_shell_v5_get_xdg_popup(struct xdg_shell *xdg_shell, + struct wl_surface *surface, + struct wl_surface *parent, + struct wl_seat *seat, + uint32_t serial, + int32_t x, + int32_t y) +{ + struct wl_proxy *id; + + id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell, + ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5, + &zxdg_popup_v5_interface, + NULL, + surface, + parent, + seat, + serial, + x, + y); - return (struct xdg_popup *) id; + return (struct xdg_popup *)id; } /** @@ -460,11 +442,9 @@ * A client must respond to a ping event with a pong request or * the client may be deemed unresponsive. */ -static inline void -zxdg_shell_v5_pong(struct xdg_shell *xdg_shell, uint32_t serial) +static inline void zxdg_shell_v5_pong(struct xdg_shell *xdg_shell, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_shell, - ZXDG_SHELL_V5_PONG, serial); + wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_PONG, serial); } #ifndef ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM @@ -477,15 +457,15 @@ * is being dragged in a resize operation. */ enum zxdg_surface_v5_resize_edge { - ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2, - ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6, - ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10, + ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2, + ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6, + ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10, }; #endif /* ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM */ @@ -500,22 +480,22 @@ * keyboard or pointer focus. */ enum zxdg_surface_v5_state { - /** - * the surface is maximized - */ - ZXDG_SURFACE_V5_STATE_MAXIMIZED = 1, - /** - * the surface is fullscreen - */ - ZXDG_SURFACE_V5_STATE_FULLSCREEN = 2, - /** - * the surface is being resized - */ - ZXDG_SURFACE_V5_STATE_RESIZING = 3, - /** - * the surface is now activated - */ - ZXDG_SURFACE_V5_STATE_ACTIVATED = 4, + /** + * the surface is maximized + */ + ZXDG_SURFACE_V5_STATE_MAXIMIZED = 1, + /** + * the surface is fullscreen + */ + ZXDG_SURFACE_V5_STATE_FULLSCREEN = 2, + /** + * the surface is being resized + */ + ZXDG_SURFACE_V5_STATE_RESIZING = 3, + /** + * the surface is now activated + */ + ZXDG_SURFACE_V5_STATE_ACTIVATED = 4, }; #endif /* ZXDG_SURFACE_V5_STATE_ENUM */ @@ -524,66 +504,57 @@ * @struct zxdg_surface_v5_listener */ struct zxdg_surface_v5_listener { - /** - * suggest a surface change - * - * The configure event asks the client to resize its surface or - * to change its state. - * - * The width and height arguments specify a hint to the window - * about how its surface should be resized in window geometry - * coordinates. See set_window_geometry. - * - * If the width or height arguments are zero, it means the client - * should decide its own window dimension. This may happen when the - * compositor need to configure the state of the surface but - * doesn't have any information about any previous or expected - * dimension. - * - * The states listed in the event specify how the width/height - * arguments should be interpreted, and possibly how it should be - * drawn. - * - * Clients should arrange their surface for the new size and - * states, and then send a ack_configure request with the serial - * sent in this configure event at some point before committing the - * new surface. - * - * If the client receives multiple configure events before it can - * respond to one, it is free to discard all but the last event it - * received. - */ - void (*configure)(void *data, - struct xdg_surface *xdg_surface, - int32_t width, - int32_t height, - struct wl_array *states, - uint32_t serial); - /** - * surface wants to be closed - * - * The close event is sent by the compositor when the user wants - * the surface to be closed. This should be equivalent to the user - * clicking the close button in client-side decorations, if your - * application has any... - * - * This is only a request that the user intends to close your - * window. The client may choose to ignore this request, or show a - * dialog to ask the user to save their data... - */ - void (*close)(void *data, - struct xdg_surface *xdg_surface); + /** + * suggest a surface change + * + * The configure event asks the client to resize its surface or + * to change its state. + * + * The width and height arguments specify a hint to the window + * about how its surface should be resized in window geometry + * coordinates. See set_window_geometry. + * + * If the width or height arguments are zero, it means the client + * should decide its own window dimension. This may happen when the + * compositor need to configure the state of the surface but + * doesn't have any information about any previous or expected + * dimension. + * + * The states listed in the event specify how the width/height + * arguments should be interpreted, and possibly how it should be + * drawn. + * + * Clients should arrange their surface for the new size and + * states, and then send a ack_configure request with the serial + * sent in this configure event at some point before committing the + * new surface. + * + * If the client receives multiple configure events before it can + * respond to one, it is free to discard all but the last event it + * received. + */ + void (*configure)(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial); + /** + * surface wants to be closed + * + * The close event is sent by the compositor when the user wants + * the surface to be closed. This should be equivalent to the user + * clicking the close button in client-side decorations, if your + * application has any... + * + * This is only a request that the user intends to close your + * window. The client may choose to ignore this request, or show a + * dialog to ask the user to save their data... + */ + void (*close)(void *data, struct xdg_surface *xdg_surface); }; /** * @ingroup iface_zxdg_surface_v5 */ -static inline int -zxdg_surface_v5_add_listener(struct xdg_surface *xdg_surface, - const struct zxdg_surface_v5_listener *listener, void *data) +static inline int zxdg_surface_v5_add_listener(struct xdg_surface *xdg_surface, const struct zxdg_surface_v5_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_surface, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)xdg_surface, (void (**)(void))listener, data); } #define ZXDG_SURFACE_V5_DESTROY 0 @@ -668,23 +639,20 @@ #define ZXDG_SURFACE_V5_SET_MINIMIZED_SINCE_VERSION 1 /** @ingroup iface_xdg_surface */ -static inline void -zxdg_surface_v5_set_user_data(struct xdg_surface *xdg_surface, void *user_data) +static inline void zxdg_surface_v5_set_user_data(struct xdg_surface *xdg_surface, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data); + wl_proxy_set_user_data((struct wl_proxy *)xdg_surface, user_data); } /** @ingroup iface_xdg_surface */ -static inline void * -zxdg_surface_v5_get_user_data(struct xdg_surface *xdg_surface) +static inline void *zxdg_surface_v5_get_user_data(struct xdg_surface *xdg_surface) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface); + return wl_proxy_get_user_data((struct wl_proxy *)xdg_surface); } -static inline uint32_t -zxdg_surface_v5_get_version(struct xdg_surface *xdg_surface) +static inline uint32_t zxdg_surface_v5_get_version(struct xdg_surface *xdg_surface) { - return wl_proxy_get_version((struct wl_proxy *) xdg_surface); + return wl_proxy_get_version((struct wl_proxy *)xdg_surface); } /** @@ -694,13 +662,11 @@ * hidden from the user's point of view, and all state like * maximization, fullscreen, and so on, will be lost. */ -static inline void -zxdg_surface_v5_destroy(struct xdg_surface *xdg_surface) +static inline void zxdg_surface_v5_destroy(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_DESTROY); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_DESTROY); - wl_proxy_destroy((struct wl_proxy *) xdg_surface); + wl_proxy_destroy((struct wl_proxy *)xdg_surface); } /** @@ -714,11 +680,9 @@ * "auxiliary" surfaces, so that the parent is raised when the dialog * is raised. */ -static inline void -zxdg_surface_v5_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent) +static inline void zxdg_surface_v5_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_PARENT, parent); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_PARENT, parent); } /** @@ -732,11 +696,9 @@ * * The string must be encoded in UTF-8. */ -static inline void -zxdg_surface_v5_set_title(struct xdg_surface *xdg_surface, const char *title) +static inline void zxdg_surface_v5_set_title(struct xdg_surface *xdg_surface, const char *title) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_TITLE, title); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_TITLE, title); } /** @@ -763,11 +725,9 @@ * * [0] http://standards.freedesktop.org/desktop-entry-spec/ */ -static inline void -zxdg_surface_v5_set_app_id(struct xdg_surface *xdg_surface, const char *app_id) +static inline void zxdg_surface_v5_set_app_id(struct xdg_surface *xdg_surface, const char *app_id) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_APP_ID, app_id); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_APP_ID, app_id); } /** @@ -785,11 +745,9 @@ * This request must be used in response to some sort of user action * like a button press, key press, or touch down event. */ -static inline void -zxdg_surface_v5_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) +static inline void zxdg_surface_v5_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SHOW_WINDOW_MENU, seat, serial, x, y); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SHOW_WINDOW_MENU, seat, serial, x, y); } /** @@ -812,11 +770,9 @@ * updating a pointer cursor, during the move. There is no guarantee * that the device focus will return when the move is completed. */ -static inline void -zxdg_surface_v5_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial) +static inline void zxdg_surface_v5_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_MOVE, seat, serial); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_MOVE, seat, serial); } /** @@ -853,11 +809,9 @@ * use this information to adapt its behavior, e.g. choose an * appropriate cursor image. */ -static inline void -zxdg_surface_v5_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) +static inline void zxdg_surface_v5_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_RESIZE, seat, serial, edges); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_RESIZE, seat, serial, edges); } /** @@ -883,11 +837,9 @@ * ack_configure request at the time of a commit indicates which * configure event the client is responding to. */ -static inline void -zxdg_surface_v5_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial) +static inline void zxdg_surface_v5_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_ACK_CONFIGURE, serial); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_ACK_CONFIGURE, serial); } /** @@ -919,11 +871,9 @@ * * The width and height must be greater than zero. */ -static inline void -zxdg_surface_v5_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height) +static inline void zxdg_surface_v5_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY, x, y, width, height); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY, x, y, width, height); } /** @@ -946,11 +896,9 @@ * If the surface was already maximized, the compositor will still emit * a configure event with the "maximized" state. */ -static inline void -zxdg_surface_v5_set_maximized(struct xdg_surface *xdg_surface) +static inline void zxdg_surface_v5_set_maximized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_MAXIMIZED); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MAXIMIZED); } /** @@ -974,11 +922,9 @@ * If the surface was already not maximized, the compositor will still * emit a configure event without the "maximized" state. */ -static inline void -zxdg_surface_v5_unset_maximized(struct xdg_surface *xdg_surface) +static inline void zxdg_surface_v5_unset_maximized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_UNSET_MAXIMIZED); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_MAXIMIZED); } /** @@ -994,21 +940,17 @@ * position the surface in the center of the output and compensate with * black borders filling the rest of the output. */ -static inline void -zxdg_surface_v5_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output) +static inline void zxdg_surface_v5_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_FULLSCREEN, output); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_FULLSCREEN, output); } /** * @ingroup iface_zxdg_surface_v5 */ -static inline void -zxdg_surface_v5_unset_fullscreen(struct xdg_surface *xdg_surface) +static inline void zxdg_surface_v5_unset_fullscreen(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_UNSET_FULLSCREEN); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_FULLSCREEN); } /** @@ -1023,11 +965,9 @@ * also work with live previews on windows in Alt-Tab, Expose or * similar compositor features. */ -static inline void -zxdg_surface_v5_set_minimized(struct xdg_surface *xdg_surface) +static inline void zxdg_surface_v5_set_minimized(struct xdg_surface *xdg_surface) { - wl_proxy_marshal((struct wl_proxy *) xdg_surface, - ZXDG_SURFACE_V5_SET_MINIMIZED); + wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MINIMIZED); } /** @@ -1035,26 +975,22 @@ * @struct zxdg_popup_v5_listener */ struct zxdg_popup_v5_listener { - /** - * popup interaction is done - * - * The popup_done event is sent out when a popup is dismissed by - * the compositor. The client should destroy the xdg_popup object - * at this point. - */ - void (*popup_done)(void *data, - struct xdg_popup *xdg_popup); + /** + * popup interaction is done + * + * The popup_done event is sent out when a popup is dismissed by + * the compositor. The client should destroy the xdg_popup object + * at this point. + */ + void (*popup_done)(void *data, struct xdg_popup *xdg_popup); }; /** * @ingroup iface_zxdg_popup_v5 */ -static inline int -zxdg_popup_v5_add_listener(struct xdg_popup *xdg_popup, - const struct zxdg_popup_v5_listener *listener, void *data) +static inline int zxdg_popup_v5_add_listener(struct xdg_popup *xdg_popup, const struct zxdg_popup_v5_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) xdg_popup, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)xdg_popup, (void (**)(void))listener, data); } #define ZXDG_POPUP_V5_DESTROY 0 @@ -1070,23 +1006,20 @@ #define ZXDG_POPUP_V5_DESTROY_SINCE_VERSION 1 /** @ingroup iface_xdg_popup */ -static inline void -zxdg_popup_v5_set_user_data(struct xdg_popup *xdg_popup, void *user_data) +static inline void zxdg_popup_v5_set_user_data(struct xdg_popup *xdg_popup, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data); + wl_proxy_set_user_data((struct wl_proxy *)xdg_popup, user_data); } /** @ingroup iface_xdg_popup */ -static inline void * -zxdg_popup_v5_get_user_data(struct xdg_popup *xdg_popup) +static inline void *zxdg_popup_v5_get_user_data(struct xdg_popup *xdg_popup) { - return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup); + return wl_proxy_get_user_data((struct wl_proxy *)xdg_popup); } -static inline uint32_t -zxdg_popup_v5_get_version(struct xdg_popup *xdg_popup) +static inline uint32_t zxdg_popup_v5_get_version(struct xdg_popup *xdg_popup) { - return wl_proxy_get_version((struct wl_proxy *) xdg_popup); + return wl_proxy_get_version((struct wl_proxy *)xdg_popup); } /** @@ -1098,16 +1031,14 @@ * If this xdg_popup is not the "topmost" popup, a protocol error * will be sent. */ -static inline void -zxdg_popup_v5_destroy(struct xdg_popup *xdg_popup) +static inline void zxdg_popup_v5_destroy(struct xdg_popup *xdg_popup) { - wl_proxy_marshal((struct wl_proxy *) xdg_popup, - ZXDG_POPUP_V5_DESTROY); + wl_proxy_marshal((struct wl_proxy *)xdg_popup, ZXDG_POPUP_V5_DESTROY); - wl_proxy_destroy((struct wl_proxy *) xdg_popup); + wl_proxy_destroy((struct wl_proxy *)xdg_popup); } -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -Nru dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-protocol.c dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-protocol.c --- dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-protocol.c 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-protocol.c 2022-11-18 03:38:26.000000000 +0000 @@ -4,34 +4,17 @@ * Strings inside the sent protocol remain the same */ /* - * Copyright © 2008-2013 Kristian Høgsberg - * Copyright © 2013 Rafael Antognolli - * Copyright © 2013 Jasper St. Pierre - * Copyright © 2010-2013 Intel Corporation + * SPDX-FileCopyrightText: 2008-2013 Kristian Høgsberg + * SPDX-FileCopyrightText: 2013 Rafael Antognolli + * SPDX-FileCopyrightText: 2013 Jasper St. Pierre + * SPDX-FileCopyrightText: 2010-2013 Intel Corporation * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * SPDX-License-Identifier: MIT */ -#include -#include #include "wayland-util.h" +#include +#include extern const struct wl_interface wl_output_interface; extern const struct wl_interface wl_seat_interface; @@ -40,89 +23,97 @@ extern const struct wl_interface zxdg_surface_v5_interface; static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - NULL, - &zxdg_surface_v5_interface, - &wl_surface_interface, - &zxdg_popup_v5_interface, - &wl_surface_interface, - &wl_surface_interface, - &wl_seat_interface, - NULL, - NULL, - NULL, - &zxdg_surface_v5_interface, - &wl_seat_interface, - NULL, - NULL, - NULL, - &wl_seat_interface, - NULL, - &wl_seat_interface, - NULL, - NULL, - &wl_output_interface, + NULL, + NULL, + NULL, + NULL, + &zxdg_surface_v5_interface, + &wl_surface_interface, + &zxdg_popup_v5_interface, + &wl_surface_interface, + &wl_surface_interface, + &wl_seat_interface, + NULL, + NULL, + NULL, + &zxdg_surface_v5_interface, + &wl_seat_interface, + NULL, + NULL, + NULL, + &wl_seat_interface, + NULL, + &wl_seat_interface, + NULL, + NULL, + &wl_output_interface, }; static const struct wl_message zxdg_shell_v5_requests[] = { - { "destroy", "", types + 0 }, - { "use_unstable_version", "i", types + 0 }, - { "get_xdg_surface", "no", types + 4 }, - { "get_xdg_popup", "nooouii", types + 6 }, - { "pong", "u", types + 0 }, + {"destroy", "", types + 0}, + {"use_unstable_version", "i", types + 0}, + {"get_xdg_surface", "no", types + 4}, + {"get_xdg_popup", "nooouii", types + 6}, + {"pong", "u", types + 0}, }; static const struct wl_message zxdg_shell_v5_events[] = { - { "ping", "u", types + 0 }, + {"ping", "u", types + 0}, }; WL_EXPORT const struct wl_interface zxdg_shell_v5_interface = { - "xdg_shell", 1, - 5, zxdg_shell_v5_requests, - 1, zxdg_shell_v5_events, + "xdg_shell", + 1, + 5, + zxdg_shell_v5_requests, + 1, + zxdg_shell_v5_events, }; static const struct wl_message zxdg_surface_v5_requests[] = { - { "destroy", "", types + 0 }, - { "set_parent", "?o", types + 13 }, - { "set_title", "s", types + 0 }, - { "set_app_id", "s", types + 0 }, - { "show_window_menu", "ouii", types + 14 }, - { "move", "ou", types + 18 }, - { "resize", "ouu", types + 20 }, - { "ack_configure", "u", types + 0 }, - { "set_window_geometry", "iiii", types + 0 }, - { "set_maximized", "", types + 0 }, - { "unset_maximized", "", types + 0 }, - { "set_fullscreen", "?o", types + 23 }, - { "unset_fullscreen", "", types + 0 }, - { "set_minimized", "", types + 0 }, + {"destroy", "", types + 0}, + {"set_parent", "?o", types + 13}, + {"set_title", "s", types + 0}, + {"set_app_id", "s", types + 0}, + {"show_window_menu", "ouii", types + 14}, + {"move", "ou", types + 18}, + {"resize", "ouu", types + 20}, + {"ack_configure", "u", types + 0}, + {"set_window_geometry", "iiii", types + 0}, + {"set_maximized", "", types + 0}, + {"unset_maximized", "", types + 0}, + {"set_fullscreen", "?o", types + 23}, + {"unset_fullscreen", "", types + 0}, + {"set_minimized", "", types + 0}, }; static const struct wl_message zxdg_surface_v5_events[] = { - { "configure", "iiau", types + 0 }, - { "close", "", types + 0 }, + {"configure", "iiau", types + 0}, + {"close", "", types + 0}, }; WL_EXPORT const struct wl_interface zxdg_surface_v5_interface = { - "xdg_surface", 1, - 14, zxdg_surface_v5_requests, - 2, zxdg_surface_v5_events, + "xdg_surface", + 1, + 14, + zxdg_surface_v5_requests, + 2, + zxdg_surface_v5_events, }; static const struct wl_message zxdg_popup_v5_requests[] = { - { "destroy", "", types + 0 }, + {"destroy", "", types + 0}, }; static const struct wl_message zxdg_popup_v5_events[] = { - { "popup_done", "", types + 0 }, + {"popup_done", "", types + 0}, }; WL_EXPORT const struct wl_interface zxdg_popup_v5_interface = { - "xdg_popup", 1, - 1, zxdg_popup_v5_requests, - 1, zxdg_popup_v5_events, + "xdg_popup", + 1, + 1, + zxdg_popup_v5_requests, + 1, + zxdg_popup_v5_events, }; - diff -Nru dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-server-protocol.h dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-server-protocol.h --- dwayland-5.57.0.23/src/compat/wayland-xdg-shell-v5-server-protocol.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/compat/wayland-xdg-shell-v5-server-protocol.h 2022-11-18 03:38:26.000000000 +0000 @@ -6,11 +6,11 @@ #ifndef ZXDG_SHELL_V5_UNSTABLE_V5_SERVER_PROTOCOL_H #define ZXDG_SHELL_V5_UNSTABLE_V5_SERVER_PROTOCOL_H -#include -#include #include "wayland-server.h" +#include +#include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -26,29 +26,12 @@ * @section page_copyright_zxdg_shell_v5_unstable_v5 Copyright *
  *
- * Copyright © 2008-2013 Kristian Høgsberg
- * Copyright © 2013      Rafael Antognolli
- * Copyright © 2013      Jasper St. Pierre
- * Copyright © 2010-2013 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * SPDX-FileCopyrightText: 2008-2013 Kristian Høgsberg
+ * SPDX-FileCopyrightText: 2013 Rafael Antognolli
+ * SPDX-FileCopyrightText: 2013 Jasper St. Pierre
+ * SPDX-FileCopyrightText: 2010-2013 Intel Corporation
+ *
+ * SPDX-License-Identifier: MIT
  * 
*/ struct wl_output; @@ -255,32 +238,32 @@ * implementation versions match. */ enum zxdg_shell_v5_version { - /** - * Always the latest version - */ - ZXDG_SHELL_V5_VERSION_CURRENT = 5, + /** + * Always the latest version + */ + ZXDG_SHELL_V5_VERSION_CURRENT = 5, }; #endif /* ZXDG_SHELL_V5_VERSION_ENUM */ #ifndef ZXDG_SHELL_V5_ERROR_ENUM #define ZXDG_SHELL_V5_ERROR_ENUM enum zxdg_shell_v5_error { - /** - * given wl_surface has another role - */ - ZXDG_SHELL_V5_ERROR_ROLE = 0, - /** - * xdg_shell was destroyed before children - */ - ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1, - /** - * the client tried to map or destroy a non-topmost popup - */ - ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2, - /** - * the client specified an invalid popup parent surface - */ - ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3, + /** + * given wl_surface has another role + */ + ZXDG_SHELL_V5_ERROR_ROLE = 0, + /** + * xdg_shell was destroyed before children + */ + ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1, + /** + * the client tried to map or destroy a non-topmost popup + */ + ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2, + /** + * the client specified an invalid popup parent surface + */ + ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3, }; #endif /* ZXDG_SHELL_V5_ERROR_ENUM */ @@ -289,81 +272,73 @@ * @struct zxdg_shell_v5_interface */ struct zxdg_shell_v5_interface { - /** - * destroy xdg_shell - * - * Destroy this xdg_shell object. - * - * Destroying a bound xdg_shell object while there are surfaces - * still alive created by this xdg_shell object instance is illegal - * and will result in a protocol error. - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * enable use of this unstable version - * - * Negotiate the unstable version of the interface. This - * mechanism is in place to ensure client and server agree on the - * unstable versions of the protocol that they speak or exit - * cleanly if they don't agree. This request will go away once the - * xdg-shell protocol is stable. - */ - void (*use_unstable_version)(struct wl_client *client, - struct wl_resource *resource, - int32_t version); - /** - * create a shell surface from a surface - * - * This creates an xdg_surface for the given surface and gives it - * the zxdg_surface role. A wl_v5_surface can only be given an - * zxdg_surface role once. If get_v5_xdg_surface is called with a - * wl_surface that already has an active xdg_surface associated - * with it, or if it had any other role, an error is raised. - * - * See the documentation of xdg_surface for more details about what - * an xdg_surface is and how it is used. - */ - void (*get_zxdg_surface)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - struct wl_resource *surface); - /** - * create a popup for a surface - * - * This creates an xdg_popup for the given surface and gives it - * the zxdg_popup role. A wl_v5_surface can only be given an xdg_popup - * role once. If get_zxdg_popup is called with a wl_v5_surface that - * already has an active xdg_popup associated with it, or if it had - * any other role, an error is raised. - * - * This request must be used in response to some sort of user - * action like a button press, key press, or touch down event. - * - * See the documentation of xdg_popup for more details about what - * an xdg_popup is and how it is used. - * @param seat the wl_seat of the user event - * @param serial the serial of the user event - */ - void (*get_zxdg_popup)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - struct wl_resource *surface, - struct wl_resource *parent, - struct wl_resource *seat, - uint32_t serial, - int32_t x, - int32_t y); - /** - * respond to a ping event - * - * A client must respond to a ping event with a pong request or - * the client may be deemed unresponsive. - * @param serial serial of the ping event - */ - void (*pong)(struct wl_client *client, - struct wl_resource *resource, - uint32_t serial); + /** + * destroy xdg_shell + * + * Destroy this xdg_shell object. + * + * Destroying a bound xdg_shell object while there are surfaces + * still alive created by this xdg_shell object instance is illegal + * and will result in a protocol error. + */ + void (*destroy)(struct wl_client *client, struct wl_resource *resource); + /** + * enable use of this unstable version + * + * Negotiate the unstable version of the interface. This + * mechanism is in place to ensure client and server agree on the + * unstable versions of the protocol that they speak or exit + * cleanly if they don't agree. This request will go away once the + * xdg-shell protocol is stable. + */ + void (*use_unstable_version)(struct wl_client *client, struct wl_resource *resource, int32_t version); + /** + * create a shell surface from a surface + * + * This creates an xdg_surface for the given surface and gives it + * the zxdg_surface role. A wl_v5_surface can only be given an + * zxdg_surface role once. If get_v5_xdg_surface is called with a + * wl_surface that already has an active xdg_surface associated + * with it, or if it had any other role, an error is raised. + * + * See the documentation of xdg_surface for more details about what + * an xdg_surface is and how it is used. + */ + void (*get_zxdg_surface)(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface); + /** + * create a popup for a surface + * + * This creates an xdg_popup for the given surface and gives it + * the zxdg_popup role. A wl_v5_surface can only be given an xdg_popup + * role once. If get_zxdg_popup is called with a wl_v5_surface that + * already has an active xdg_popup associated with it, or if it had + * any other role, an error is raised. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. + * + * See the documentation of xdg_popup for more details about what + * an xdg_popup is and how it is used. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + */ + void (*get_zxdg_popup)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *surface, + struct wl_resource *parent, + struct wl_resource *seat, + uint32_t serial, + int32_t x, + int32_t y); + /** + * respond to a ping event + * + * A client must respond to a ping event with a pong request or + * the client may be deemed unresponsive. + * @param serial serial of the ping event + */ + void (*pong)(struct wl_client *client, struct wl_resource *resource, uint32_t serial); }; #define ZXDG_SHELL_V5_PING 0 @@ -400,10 +375,9 @@ * @param resource_ The client's resource * @param serial pass this to the pong request */ -static inline void -zxdg_shell_v5_send_ping(struct wl_resource *resource_, uint32_t serial) +static inline void zxdg_shell_v5_send_ping(struct wl_resource *resource_, uint32_t serial) { - wl_resource_post_event(resource_, ZXDG_SHELL_V5_PING, serial); + wl_resource_post_event(resource_, ZXDG_SHELL_V5_PING, serial); } #ifndef ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM @@ -416,15 +390,15 @@ * is being dragged in a resize operation. */ enum zxdg_surface_v5_resize_edge { - ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2, - ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6, - ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8, - ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9, - ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10, + ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2, + ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6, + ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8, + ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9, + ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10, }; #endif /* ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM */ @@ -439,22 +413,22 @@ * keyboard or pointer focus. */ enum zxdg_surface_v5_state { - /** - * the surface is maximized - */ - ZXDG_SURFACE_V5_STATE_MAXIMIZED = 1, - /** - * the surface is fullscreen - */ - ZXDG_SURFACE_V5_STATE_FULLSCREEN = 2, - /** - * the surface is being resized - */ - ZXDG_SURFACE_V5_STATE_RESIZING = 3, - /** - * the surface is now activated - */ - ZXDG_SURFACE_V5_STATE_ACTIVATED = 4, + /** + * the surface is maximized + */ + ZXDG_SURFACE_V5_STATE_MAXIMIZED = 1, + /** + * the surface is fullscreen + */ + ZXDG_SURFACE_V5_STATE_FULLSCREEN = 2, + /** + * the surface is being resized + */ + ZXDG_SURFACE_V5_STATE_RESIZING = 3, + /** + * the surface is now activated + */ + ZXDG_SURFACE_V5_STATE_ACTIVATED = 4, }; #endif /* ZXDG_SURFACE_V5_STATE_ENUM */ @@ -463,308 +437,276 @@ * @struct zxdg_surface_v5_interface */ struct zxdg_surface_v5_interface { - /** - * Destroy the xdg_surface - * - * Unmap and destroy the window. The window will be effectively - * hidden from the user's point of view, and all state like - * maximization, fullscreen, and so on, will be lost. - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * set the parent of this surface - * - * Set the "parent" of this surface. This window should be - * stacked above a parent. The parent surface must be mapped as - * long as this surface is mapped. - * - * Parent windows should be set on dialogs, toolboxes, or other - * "auxiliary" surfaces, so that the parent is raised when the - * dialog is raised. - */ - void (*set_parent)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *parent); - /** - * set surface title - * - * Set a short title for the surface. - * - * This string may be used to identify the surface in a task bar, - * window list, or other user interface elements provided by the - * compositor. - * - * The string must be encoded in UTF-8. - */ - void (*set_title)(struct wl_client *client, - struct wl_resource *resource, - const char *title); - /** - * set application ID - * - * Set an application identifier for the surface. - * - * The app ID identifies the general class of applications to which - * the surface belongs. The compositor can use this to group - * multiple surfaces together, or to determine how to launch a new - * application. - * - * For D-Bus activatable applications, the app ID is used as the - * D-Bus service name. - * - * The compositor shell will try to group application surfaces - * together by their app ID. As a best practice, it is suggested to - * select app ID's that match the basename of the application's - * .desktop file. For example, "org.freedesktop.FooViewer" where - * the .desktop file is "org.freedesktop.FooViewer.desktop". - * - * See the desktop-entry specification [0] for more details on - * application identifiers and how they relate to well-known D-Bus - * names and .desktop files. - * - * [0] http://standards.freedesktop.org/desktop-entry-spec/ - */ - void (*set_app_id)(struct wl_client *client, - struct wl_resource *resource, - const char *app_id); - /** - * show the window menu - * - * Clients implementing client-side decorations might want to - * show a context menu when right-clicking on the decorations, - * giving the user a menu that they can use to maximize or minimize - * the window. - * - * This request asks the compositor to pop up such a window menu at - * the given position, relative to the local surface coordinates of - * the parent surface. There are no guarantees as to what menu - * items the window menu contains. - * - * This request must be used in response to some sort of user - * action like a button press, key press, or touch down event. - * @param seat the wl_seat of the user event - * @param serial the serial of the user event - * @param x the x position to pop up the window menu at - * @param y the y position to pop up the window menu at - */ - void (*show_window_menu)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *seat, - uint32_t serial, - int32_t x, - int32_t y); - /** - * start an interactive move - * - * Start an interactive, user-driven move of the surface. - * - * This request must be used in response to some sort of user - * action like a button press, key press, or touch down event. The - * passed serial is used to determine the type of interactive move - * (touch, pointer, etc). - * - * The server may ignore move requests depending on the state of - * the surface (e.g. fullscreen or maximized), or if the passed - * serial is no longer valid. - * - * If triggered, the surface will lose the focus of the device - * (wl_pointer, wl_touch, etc) used for the move. It is up to the - * compositor to visually indicate that the move is taking place, - * such as updating a pointer cursor, during the move. There is no - * guarantee that the device focus will return when the move is - * completed. - * @param seat the wl_seat of the user event - * @param serial the serial of the user event - */ - void (*move)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *seat, - uint32_t serial); - /** - * start an interactive resize - * - * Start a user-driven, interactive resize of the surface. - * - * This request must be used in response to some sort of user - * action like a button press, key press, or touch down event. The - * passed serial is used to determine the type of interactive - * resize (touch, pointer, etc). - * - * The server may ignore resize requests depending on the state of - * the surface (e.g. fullscreen or maximized). - * - * If triggered, the client will receive configure events with the - * "resize" state enum value and the expected sizes. See the - * "resize" enum value for more details about what is required. The - * client must also acknowledge configure events using - * "ack_configure". After the resize is completed, the client will - * receive another "configure" event without the resize state. - * - * If triggered, the surface also will lose the focus of the device - * (wl_pointer, wl_touch, etc) used for the resize. It is up to the - * compositor to visually indicate that the resize is taking place, - * such as updating a pointer cursor, during the resize. There is - * no guarantee that the device focus will return when the resize - * is completed. - * - * The edges parameter specifies how the surface should be resized, - * and is one of the values of the resize_edge enum. The compositor - * may use this information to update the surface position for - * example when dragging the top left corner. The compositor may - * also use this information to adapt its behavior, e.g. choose an - * appropriate cursor image. - * @param seat the wl_seat of the user event - * @param serial the serial of the user event - * @param edges which edge or corner is being dragged - */ - void (*resize)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *seat, - uint32_t serial, - uint32_t edges); - /** - * ack a configure event - * - * When a configure event is received, if a client commits the - * surface in response to the configure event, then the client must - * make an ack_configure request sometime before the commit - * request, passing along the serial of the configure event. - * - * For instance, the compositor might use this information to move - * a surface to the top left only when the client has drawn itself - * for the maximized or fullscreen state. - * - * If the client receives multiple configure events before it can - * respond to one, it only has to ack the last configure event. - * - * A client is not required to commit immediately after sending an - * ack_configure request - it may even ack_configure several times - * before its next surface commit. - * - * The compositor expects that the most recently received - * ack_configure request at the time of a commit indicates which - * configure event the client is responding to. - * @param serial the serial from the configure event - */ - void (*ack_configure)(struct wl_client *client, - struct wl_resource *resource, - uint32_t serial); - /** - * set the new window geometry - * - * The window geometry of a window is its "visible bounds" from - * the user's perspective. Client-side decorations often have - * invisible portions like drop-shadows which should be ignored for - * the purposes of aligning, placing and constraining windows. - * - * The window geometry is double buffered, and will be applied at - * the time wl_surface.commit of the corresponding wl_surface is - * called. - * - * Once the window geometry of the surface is set once, it is not - * possible to unset it, and it will remain the same until - * set_window_geometry is called again, even if a new subsurface or - * buffer is attached. - * - * If never set, the value is the full bounds of the surface, - * including any subsurfaces. This updates dynamically on every - * commit. This unset mode is meant for extremely simple clients. - * - * If responding to a configure event, the window geometry in here - * must respect the sizing negotiations specified by the states in - * the configure event. - * - * The arguments are given in the surface local coordinate space of - * the wl_surface associated with this xdg_surface. - * - * The width and height must be greater than zero. - */ - void (*set_window_geometry)(struct wl_client *client, - struct wl_resource *resource, - int32_t x, - int32_t y, - int32_t width, - int32_t height); - /** - * maximize the window - * - * Maximize the surface. - * - * After requesting that the surface should be maximized, the - * compositor will respond by emitting a configure event with the - * "maximized" state and the required window geometry. The client - * should then update its content, drawing it in a maximized state, - * i.e. without shadow or other decoration outside of the window - * geometry. The client must also acknowledge the configure when - * committing the new content (see ack_configure). - * - * It is up to the compositor to decide how and where to maximize - * the surface, for example which output and what region of the - * screen should be used. - * - * If the surface was already maximized, the compositor will still - * emit a configure event with the "maximized" state. - */ - void (*set_maximized)(struct wl_client *client, - struct wl_resource *resource); - /** - * unmaximize the window - * - * Unmaximize the surface. - * - * After requesting that the surface should be unmaximized, the - * compositor will respond by emitting a configure event without - * the "maximized" state. If available, the compositor will include - * the window geometry dimensions the window had prior to being - * maximized in the configure request. The client must then update - * its content, drawing it in a regular state, i.e. potentially - * with shadow, etc. The client must also acknowledge the configure - * when committing the new content (see ack_configure). - * - * It is up to the compositor to position the surface after it was - * unmaximized; usually the position the surface had before - * maximizing, if applicable. - * - * If the surface was already not maximized, the compositor will - * still emit a configure event without the "maximized" state. - */ - void (*unset_maximized)(struct wl_client *client, - struct wl_resource *resource); - /** - * set the window as fullscreen on a monitor - * - * Make the surface fullscreen. - * - * You can specify an output that you would prefer to be - * fullscreen. If this value is NULL, it's up to the compositor to - * choose which display will be used to map this surface. - * - * If the surface doesn't cover the whole output, the compositor - * will position the surface in the center of the output and - * compensate with black borders filling the rest of the output. - */ - void (*set_fullscreen)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *output); - /** - */ - void (*unset_fullscreen)(struct wl_client *client, - struct wl_resource *resource); - /** - * set the window as minimized - * - * Request that the compositor minimize your surface. There is no - * way to know if the surface is currently minimized, nor is there - * any way to unset minimization on this surface. - * - * If you are looking to throttle redrawing when minimized, please - * instead use the wl_surface.frame event for this, as this will - * also work with live previews on windows in Alt-Tab, Expose or - * similar compositor features. - */ - void (*set_minimized)(struct wl_client *client, - struct wl_resource *resource); + /** + * Destroy the xdg_surface + * + * Unmap and destroy the window. The window will be effectively + * hidden from the user's point of view, and all state like + * maximization, fullscreen, and so on, will be lost. + */ + void (*destroy)(struct wl_client *client, struct wl_resource *resource); + /** + * set the parent of this surface + * + * Set the "parent" of this surface. This window should be + * stacked above a parent. The parent surface must be mapped as + * long as this surface is mapped. + * + * Parent windows should be set on dialogs, toolboxes, or other + * "auxiliary" surfaces, so that the parent is raised when the + * dialog is raised. + */ + void (*set_parent)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent); + /** + * set surface title + * + * Set a short title for the surface. + * + * This string may be used to identify the surface in a task bar, + * window list, or other user interface elements provided by the + * compositor. + * + * The string must be encoded in UTF-8. + */ + void (*set_title)(struct wl_client *client, struct wl_resource *resource, const char *title); + /** + * set application ID + * + * Set an application identifier for the surface. + * + * The app ID identifies the general class of applications to which + * the surface belongs. The compositor can use this to group + * multiple surfaces together, or to determine how to launch a new + * application. + * + * For D-Bus activatable applications, the app ID is used as the + * D-Bus service name. + * + * The compositor shell will try to group application surfaces + * together by their app ID. As a best practice, it is suggested to + * select app ID's that match the basename of the application's + * .desktop file. For example, "org.freedesktop.FooViewer" where + * the .desktop file is "org.freedesktop.FooViewer.desktop". + * + * See the desktop-entry specification [0] for more details on + * application identifiers and how they relate to well-known D-Bus + * names and .desktop files. + * + * [0] http://standards.freedesktop.org/desktop-entry-spec/ + */ + void (*set_app_id)(struct wl_client *client, struct wl_resource *resource, const char *app_id); + /** + * show the window menu + * + * Clients implementing client-side decorations might want to + * show a context menu when right-clicking on the decorations, + * giving the user a menu that they can use to maximize or minimize + * the window. + * + * This request asks the compositor to pop up such a window menu at + * the given position, relative to the local surface coordinates of + * the parent surface. There are no guarantees as to what menu + * items the window menu contains. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + * @param x the x position to pop up the window menu at + * @param y the y position to pop up the window menu at + */ + void (*show_window_menu)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, uint32_t serial, int32_t x, int32_t y); + /** + * start an interactive move + * + * Start an interactive, user-driven move of the surface. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. The + * passed serial is used to determine the type of interactive move + * (touch, pointer, etc). + * + * The server may ignore move requests depending on the state of + * the surface (e.g. fullscreen or maximized), or if the passed + * serial is no longer valid. + * + * If triggered, the surface will lose the focus of the device + * (wl_pointer, wl_touch, etc) used for the move. It is up to the + * compositor to visually indicate that the move is taking place, + * such as updating a pointer cursor, during the move. There is no + * guarantee that the device focus will return when the move is + * completed. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + */ + void (*move)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, uint32_t serial); + /** + * start an interactive resize + * + * Start a user-driven, interactive resize of the surface. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. The + * passed serial is used to determine the type of interactive + * resize (touch, pointer, etc). + * + * The server may ignore resize requests depending on the state of + * the surface (e.g. fullscreen or maximized). + * + * If triggered, the client will receive configure events with the + * "resize" state enum value and the expected sizes. See the + * "resize" enum value for more details about what is required. The + * client must also acknowledge configure events using + * "ack_configure". After the resize is completed, the client will + * receive another "configure" event without the resize state. + * + * If triggered, the surface also will lose the focus of the device + * (wl_pointer, wl_touch, etc) used for the resize. It is up to the + * compositor to visually indicate that the resize is taking place, + * such as updating a pointer cursor, during the resize. There is + * no guarantee that the device focus will return when the resize + * is completed. + * + * The edges parameter specifies how the surface should be resized, + * and is one of the values of the resize_edge enum. The compositor + * may use this information to update the surface position for + * example when dragging the top left corner. The compositor may + * also use this information to adapt its behavior, e.g. choose an + * appropriate cursor image. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + * @param edges which edge or corner is being dragged + */ + void (*resize)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, uint32_t serial, uint32_t edges); + /** + * ack a configure event + * + * When a configure event is received, if a client commits the + * surface in response to the configure event, then the client must + * make an ack_configure request sometime before the commit + * request, passing along the serial of the configure event. + * + * For instance, the compositor might use this information to move + * a surface to the top left only when the client has drawn itself + * for the maximized or fullscreen state. + * + * If the client receives multiple configure events before it can + * respond to one, it only has to ack the last configure event. + * + * A client is not required to commit immediately after sending an + * ack_configure request - it may even ack_configure several times + * before its next surface commit. + * + * The compositor expects that the most recently received + * ack_configure request at the time of a commit indicates which + * configure event the client is responding to. + * @param serial the serial from the configure event + */ + void (*ack_configure)(struct wl_client *client, struct wl_resource *resource, uint32_t serial); + /** + * set the new window geometry + * + * The window geometry of a window is its "visible bounds" from + * the user's perspective. Client-side decorations often have + * invisible portions like drop-shadows which should be ignored for + * the purposes of aligning, placing and constraining windows. + * + * The window geometry is double buffered, and will be applied at + * the time wl_surface.commit of the corresponding wl_surface is + * called. + * + * Once the window geometry of the surface is set once, it is not + * possible to unset it, and it will remain the same until + * set_window_geometry is called again, even if a new subsurface or + * buffer is attached. + * + * If never set, the value is the full bounds of the surface, + * including any subsurfaces. This updates dynamically on every + * commit. This unset mode is meant for extremely simple clients. + * + * If responding to a configure event, the window geometry in here + * must respect the sizing negotiations specified by the states in + * the configure event. + * + * The arguments are given in the surface local coordinate space of + * the wl_surface associated with this xdg_surface. + * + * The width and height must be greater than zero. + */ + void (*set_window_geometry)(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); + /** + * maximize the window + * + * Maximize the surface. + * + * After requesting that the surface should be maximized, the + * compositor will respond by emitting a configure event with the + * "maximized" state and the required window geometry. The client + * should then update its content, drawing it in a maximized state, + * i.e. without shadow or other decoration outside of the window + * geometry. The client must also acknowledge the configure when + * committing the new content (see ack_configure). + * + * It is up to the compositor to decide how and where to maximize + * the surface, for example which output and what region of the + * screen should be used. + * + * If the surface was already maximized, the compositor will still + * emit a configure event with the "maximized" state. + */ + void (*set_maximized)(struct wl_client *client, struct wl_resource *resource); + /** + * unmaximize the window + * + * Unmaximize the surface. + * + * After requesting that the surface should be unmaximized, the + * compositor will respond by emitting a configure event without + * the "maximized" state. If available, the compositor will include + * the window geometry dimensions the window had prior to being + * maximized in the configure request. The client must then update + * its content, drawing it in a regular state, i.e. potentially + * with shadow, etc. The client must also acknowledge the configure + * when committing the new content (see ack_configure). + * + * It is up to the compositor to position the surface after it was + * unmaximized; usually the position the surface had before + * maximizing, if applicable. + * + * If the surface was already not maximized, the compositor will + * still emit a configure event without the "maximized" state. + */ + void (*unset_maximized)(struct wl_client *client, struct wl_resource *resource); + /** + * set the window as fullscreen on a monitor + * + * Make the surface fullscreen. + * + * You can specify an output that you would prefer to be + * fullscreen. If this value is NULL, it's up to the compositor to + * choose which display will be used to map this surface. + * + * If the surface doesn't cover the whole output, the compositor + * will position the surface in the center of the output and + * compensate with black borders filling the rest of the output. + */ + void (*set_fullscreen)(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output); + /** + */ + void (*unset_fullscreen)(struct wl_client *client, struct wl_resource *resource); + /** + * set the window as minimized + * + * Request that the compositor minimize your surface. There is no + * way to know if the surface is currently minimized, nor is there + * any way to unset minimization on this surface. + * + * If you are looking to throttle redrawing when minimized, please + * instead use the wl_surface.frame event for this, as this will + * also work with live previews on windows in Alt-Tab, Expose or + * similar compositor features. + */ + void (*set_minimized)(struct wl_client *client, struct wl_resource *resource); }; #define ZXDG_SURFACE_V5_CONFIGURE 0 @@ -841,10 +783,9 @@ * Sends an configure event to the client owning the resource. * @param resource_ The client's resource */ -static inline void -zxdg_surface_v5_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) +static inline void zxdg_surface_v5_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { - wl_resource_post_event(resource_, ZXDG_SURFACE_V5_CONFIGURE, width, height, states, serial); + wl_resource_post_event(resource_, ZXDG_SURFACE_V5_CONFIGURE, width, height, states, serial); } /** @@ -852,10 +793,9 @@ * Sends an close event to the client owning the resource. * @param resource_ The client's resource */ -static inline void -zxdg_surface_v5_send_close(struct wl_resource *resource_) +static inline void zxdg_surface_v5_send_close(struct wl_resource *resource_) { - wl_resource_post_event(resource_, ZXDG_SURFACE_V5_CLOSE); + wl_resource_post_event(resource_, ZXDG_SURFACE_V5_CLOSE); } /** @@ -863,17 +803,16 @@ * @struct zxdg_popup_v5_interface */ struct zxdg_popup_v5_interface { - /** - * remove xdg_popup interface - * - * This destroys the popup. Explicitly destroying the xdg_popup - * object will also dismiss the popup, and unmap the surface. - * - * If this xdg_popup is not the "topmost" popup, a protocol error - * will be sent. - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); + /** + * remove xdg_popup interface + * + * This destroys the popup. Explicitly destroying the xdg_popup + * object will also dismiss the popup, and unmap the surface. + * + * If this xdg_popup is not the "topmost" popup, a protocol error + * will be sent. + */ + void (*destroy)(struct wl_client *client, struct wl_resource *resource); }; #define ZXDG_POPUP_v5_POPUP_DONE 0 @@ -893,13 +832,12 @@ * Sends an popup_done event to the client owning the resource. * @param resource_ The client's resource */ -static inline void -zxdg_popup_v5_send_popup_done(struct wl_resource *resource_) +static inline void zxdg_popup_v5_send_popup_done(struct wl_resource *resource_) { - wl_resource_post_event(resource_, ZXDG_POPUP_v5_POPUP_DONE); + wl_resource_post_event(resource_, ZXDG_POPUP_v5_POPUP_DONE); } -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff -Nru dwayland-5.57.0.23/src/.krazy dwayland-5.57.0.24+really5.24.3/src/.krazy --- dwayland-5.57.0.23/src/.krazy 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/.krazy 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -EXCLUDE typedefs diff -Nru dwayland-5.57.0.23/src/org_kde_kwayland.categories dwayland-5.57.0.24+really5.24.3/src/org_kde_kwayland.categories --- dwayland-5.57.0.23/src/org_kde_kwayland.categories 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/org_kde_kwayland.categories 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -kwayland-client KWayland Client Library DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWAYLAND_CLIENT] -kwayland-server KWayland Server Library DEFAULT_SEVERITY [CRITICAL] IDENTIFIER [KWAYLAND_SERVER] diff -Nru dwayland-5.57.0.23/src/protocols/README.md dwayland-5.57.0.24+really5.24.3/src/protocols/README.md --- dwayland-5.57.0.23/src/protocols/README.md 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/protocols/README.md 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1 @@ +Folder for storing external protocols that aren't in released wayland-protocols or Plasma specific. diff -Nru dwayland-5.57.0.23/src/protocols/wlr-data-control-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/protocols/wlr-data-control-unstable-v1.xml --- dwayland-5.57.0.23/src/protocols/wlr-data-control-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/protocols/wlr-data-control-unstable-v1.xml 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,294 @@ + + + + Copyright © 2018 Simon Ser + Copyright © 2019 Ivan Molodetskikh + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + the copyright holders not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied + warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + THIS SOFTWARE. + + + + This protocol allows a privileged client to control data devices. In + particular, the client will be able to manage the current selection and take + the role of a clipboard manager. + + Warning! The protocol described in this file is experimental and + backward incompatible changes may be made. Backward compatible changes + may be added together with the corresponding interface version bump. + Backward incompatible changes are done by bumping the version number in + the protocol and interface names and resetting the interface version. + Once the protocol is to be declared stable, the 'z' prefix and the + version number in the protocol and interface names are removed and the + interface version number is reset. + + + + + This interface is a manager that allows creating per-seat data device + controls. + + + + + Create a new data source. + + + + + + + Create a data device that can be used to manage a seat's selection. + + + + + + + + All objects created by the manager will still remain valid, until their + appropriate destroy request has been called. + + + + + + + This interface allows a client to manage a seat's selection. + + When the seat is destroyed, this object becomes inert. + + + + + This request asks the compositor to set the selection to the data from + the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source is a protocol error. + + To unset the selection, set the source to NULL. + + + + + + + Destroys the data device object. + + + + + + The data_offer event introduces a new wlr_data_control_offer object, + which will subsequently be used in either the + wlr_data_control_device.selection event (for the regular clipboard + selections) or the wlr_data_control_device.primary_selection event (for + the primary clipboard selections). Immediately following the + wlr_data_control_device.data_offer event, the new data_offer object + will send out wlr_data_control_offer.offer events to describe the MIME + types it offers. + + + + + + + The selection event is sent out to notify the client of a new + wlr_data_control_offer for the selection for this device. The + wlr_data_control_device.data_offer and the wlr_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The selection event is sent to a client when a new + selection is set. The wlr_data_control_offer is valid until a new + wlr_data_control_offer or NULL is received. The client must destroy the + previous selection wlr_data_control_offer, if any, upon receiving this + event. + + The first selection event is sent upon binding the + wlr_data_control_device object. + + + + + + + This data control object is no longer valid and should be destroyed by + the client. + + + + + + + + The primary_selection event is sent out to notify the client of a new + wlr_data_control_offer for the primary selection for this device. The + wlr_data_control_device.data_offer and the wlr_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The primary_selection event is sent to a client when a + new primary selection is set. The wlr_data_control_offer is valid until + a new wlr_data_control_offer or NULL is received. The client must + destroy the previous primary selection wlr_data_control_offer, if any, + upon receiving this event. + + If the compositor supports primary selection, the first + primary_selection event is sent upon binding the + wlr_data_control_device object. + + + + + + + This request asks the compositor to set the primary selection to the + data from the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source is a protocol error. + + To unset the primary selection, set the source to NULL. + + The compositor will ignore this request if it does not support primary + selection. + + + + + + + + + + + This request asks the compositor to set the selection to the data from + the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source is a protocol error. + + To unset the selection, set the source to NULL. + + + + + + + + + The wlr_data_control_source object is the source side of a + wlr_data_control_offer. It is created by the source client in a data + transfer and provides a way to describe the offered data and a way to + respond to requests to transfer the data. + + + + + + + + + This request adds a MIME type to the set of MIME types advertised to + targets. Can be called several times to offer multiple types. + + Calling this after wlr_data_control_device.set_selection is a protocol + error. + + + + + + + Destroys the data source object. + + + + + + Request for data from the client. Send the data as the specified MIME + type over the passed file descriptor, then close it. + + + + + + + + This data source is no longer valid. The data source has been replaced + by another data source. + + The client should clean up and destroy this data source. + + + + + + + A wlr_data_control_offer represents a piece of data offered for transfer + by another client (the source client). The offer describes the different + MIME types that the data can be converted to and provides the mechanism + for transferring the data directly from the source client. + + + + + To transfer the offered data, the client issues this request and + indicates the MIME type it wants to receive. The transfer happens + through the passed file descriptor (typically created with the pipe + system call). The source client writes the data in the MIME type + representation requested and then closes the file descriptor. + + The receiving client reads from the read end of the pipe until EOF and + then closes its end, at which point the transfer is complete. + + This request may happen multiple times for different MIME types. + + + + + + + + Destroys the data offer object. + + + + + + Sent immediately after creating the wlr_data_control_offer object. + One event per offered MIME type. + + + + + diff -Nru dwayland-5.57.0.23/src/protocols/wlr-layer-shell-unstable-v1.xml dwayland-5.57.0.24+really5.24.3/src/protocols/wlr-layer-shell-unstable-v1.xml --- dwayland-5.57.0.23/src/protocols/wlr-layer-shell-unstable-v1.xml 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/protocols/wlr-layer-shell-unstable-v1.xml 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,325 @@ + + + + Copyright © 2017 Drew DeVault + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + the copyright holders not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied + warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + THIS SOFTWARE. + + + + + Clients can use this interface to assign the surface_layer role to + wl_surfaces. Such surfaces are assigned to a "layer" of the output and + rendered with a defined z-depth respective to each other. They may also be + anchored to the edges and corners of a screen and specify input handling + semantics. This interface should be suitable for the implementation of + many desktop shell components, and a broad number of other applications + that interact with the desktop. + + + + + Create a layer surface for an existing surface. This assigns the role of + layer_surface, or raises a protocol error if another role is already + assigned. + + Creating a layer surface from a wl_surface which has a buffer attached + or committed is a client error, and any attempts by a client to attach + or manipulate a buffer prior to the first layer_surface.configure call + must also be treated as errors. + + After creating a layer_surface object and setting it up, the client + must perform an initial commit without any buffer attached. + The compositor will reply with a layer_surface.configure event. + The client must acknowledge it and is then allowed to attach a buffer + to map the surface. + + You may pass NULL for output to allow the compositor to decide which + output to use. Generally this will be the one that the user most + recently interacted with. + + Clients can specify a namespace that defines the purpose of the layer + surface. + + + + + + + + + + + + + + + + + These values indicate which layers a surface can be rendered in. They + are ordered by z depth, bottom-most first. Traditional shell surfaces + will typically be rendered between the bottom and top layers. + Fullscreen shell surfaces are typically rendered at the top layer. + Multiple surfaces can share a single layer, and ordering within a + single layer is undefined. + + + + + + + + + + + + + This request indicates that the client will not use the layer_shell + object any more. Objects that have been created through this instance + are not affected. + + + + + + + An interface that may be implemented by a wl_surface, for surfaces that + are designed to be rendered as a layer of a stacked desktop-like + environment. + + Layer surface state (layer, size, anchor, exclusive zone, + margin, interactivity) is double-buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. + + Attaching a null buffer to a layer surface unmaps it. + + Unmapping a layer_surface means that the surface cannot be shown by the + compositor until it is explicitly mapped again. The layer_surface + returns to the state it had right after layer_shell.get_layer_surface. + The client can re-map the surface by performing a commit without any + buffer attached, waiting for a configure event and handling it as usual. + + + + + Sets the size of the surface in surface-local coordinates. The + compositor will display the surface centered with respect to its + anchors. + + If you pass 0 for either value, the compositor will assign it and + inform you of the assignment in the configure event. You must set your + anchor to opposite edges in the dimensions you omit; not doing so is a + protocol error. Both values are 0 by default. + + Size is double-buffered, see wl_surface.commit. + + + + + + + + Requests that the compositor anchor the surface to the specified edges + and corners. If two orthogonal edges are specified (e.g. 'top' and + 'left'), then the anchor point will be the intersection of the edges + (e.g. the top left corner of the output); otherwise the anchor point + will be centered on that edge, or in the center if none is specified. + + Anchor is double-buffered, see wl_surface.commit. + + + + + + + Requests that the compositor avoids occluding an area with other + surfaces. The compositor's use of this information is + implementation-dependent - do not assume that this region will not + actually be occluded. + + A positive value is only meaningful if the surface is anchored to one + edge or an edge and both perpendicular edges. If the surface is not + anchored, anchored to only two perpendicular edges (a corner), anchored + to only two parallel edges or anchored to all edges, a positive value + will be treated the same as zero. + + A positive zone is the distance from the edge in surface-local + coordinates to consider exclusive. + + Surfaces that do not wish to have an exclusive zone may instead specify + how they should interact with surfaces that do. If set to zero, the + surface indicates that it would like to be moved to avoid occluding + surfaces with a positive exclusive zone. If set to -1, the surface + indicates that it would not like to be moved to accommodate for other + surfaces, and the compositor should extend it all the way to the edges + it is anchored to. + + For example, a panel might set its exclusive zone to 10, so that + maximized shell surfaces are not shown on top of it. A notification + might set its exclusive zone to 0, so that it is moved to avoid + occluding the panel, but shell surfaces are shown underneath it. A + wallpaper or lock screen might set their exclusive zone to -1, so that + they stretch below or over the panel. + + The default value is 0. + + Exclusive zone is double-buffered, see wl_surface.commit. + + + + + + + Requests that the surface be placed some distance away from the anchor + point on the output, in surface-local coordinates. Setting this value + for edges you are not anchored to has no effect. + + The exclusive zone includes the margin. + + Margin is double-buffered, see wl_surface.commit. + + + + + + + + + + Set to 1 to request that the seat send keyboard events to this layer + surface. For layers below the shell surface layer, the seat will use + normal focus semantics. For layers above the shell surface layers, the + seat will always give exclusive keyboard focus to the top-most layer + which has keyboard interactivity set to true. + + Layer surfaces receive pointer, touch, and tablet events normally. If + you do not want to receive them, set the input region on your surface + to an empty region. + + Events is double-buffered, see wl_surface.commit. + + + + + + + This assigns an xdg_popup's parent to this layer_surface. This popup + should have been created via xdg_surface::get_popup with the parent set + to NULL, and this request must be invoked before committing the popup's + initial state. + + See the documentation of xdg_popup for more details about what an + xdg_popup is and how it is used. + + + + + + + When a configure event is received, if a client commits the + surface in response to the configure event, then the client + must make an ack_configure request sometime before the commit + request, passing along the serial of the configure event. + + If the client receives multiple configure events before it + can respond to one, it only has to ack the last configure event. + + A client is not required to commit immediately after sending + an ack_configure request - it may even ack_configure several times + before its next surface commit. + + A client may send multiple ack_configure requests before committing, but + only the last request sent before a commit indicates which configure + event the client really is responding to. + + + + + + + This request destroys the layer surface. + + + + + + The configure event asks the client to resize its surface. + + Clients should arrange their surface for the new states, and then send + an ack_configure request with the serial sent in this configure event at + some point before committing the new surface. + + The client is free to dismiss all but the last configure event it + received. + + The width and height arguments specify the size of the window in + surface-local coordinates. + + The size is a hint, in the sense that the client is free to ignore it if + it doesn't resize, pick a smaller size (to satisfy aspect ratio or + resize in steps of NxM pixels). If the client picks a smaller size and + is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the + surface will be centered on this axis. + + If the width or height arguments are zero, it means the client should + decide its own window dimension. + + + + + + + + + The closed event is sent by the compositor when the surface will no + longer be shown. The output may have been destroyed or the user may + have asked for it to be removed. Further changes to the surface will be + ignored. The client should destroy the resource after receiving this + event, and create a new surface if they so choose. + + + + + + + + + + + + + + + + + + + + + Change the layer that the surface is rendered on. + + Layer is double-buffered, see wl_surface.commit. + + + + + diff -Nru dwayland-5.57.0.23/src/server/abstract_data_source.cpp dwayland-5.57.0.24+really5.24.3/src/server/abstract_data_source.cpp --- dwayland-5.57.0.23/src/server/abstract_data_source.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/abstract_data_source.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -6,9 +6,9 @@ #include "abstract_data_source.h" -using namespace KWayland::Server; +using namespace KWaylandServer; -AbstractDataSource::AbstractDataSource(Private *d, QObject *parent) - : Resource(d, parent) +AbstractDataSource::AbstractDataSource(QObject *parent) + : QObject(parent) { } diff -Nru dwayland-5.57.0.23/src/server/abstract_data_source.h dwayland-5.57.0.24+really5.24.3/src/server/abstract_data_source.h --- dwayland-5.57.0.23/src/server/abstract_data_source.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/abstract_data_source.h 2022-11-18 03:38:26.000000000 +0000 @@ -4,21 +4,16 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#ifndef WAYLAND_SERVER_ABSTRACT_DATA_SOURCE_H -#define WAYLAND_SERVER_ABSTRACT_DATA_SOURCE_H +#pragma once #include "clientconnection.h" #include "datadevicemanager_interface.h" -#include -#include "resource.h" +#include struct wl_client; -namespace KWayland -{ - -namespace Server +namespace KWaylandServer { /** * @brief The AbstractDataSource class abstracts the data that @@ -30,7 +25,7 @@ // Anything related to selections are pure virtual, content relating // to drag and drop has a default implementation -class KWAYLANDSERVER_EXPORT AbstractDataSource : public Resource +class KWAYLANDSERVER_EXPORT AbstractDataSource : public QObject { Q_OBJECT public: @@ -79,10 +74,10 @@ { } - /*virtual wl_client *client() const + virtual wl_client *client() const { return nullptr; - };*/ + }; Q_SIGNALS: void aboutToBeDestroyed(); @@ -91,10 +86,7 @@ void supportedDragAndDropActionsChanged(); protected: - explicit AbstractDataSource(Private *d, QObject *parent = nullptr); + explicit AbstractDataSource(QObject *parent = nullptr); }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/abstract_drop_handler.cpp dwayland-5.57.0.24+really5.24.3/src/server/abstract_drop_handler.cpp --- dwayland-5.57.0.23/src/server/abstract_drop_handler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/abstract_drop_handler.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,17 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 David Redondo + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "abstract_drop_handler.h" + +namespace KWaylandServer +{ +AbstractDropHandler::AbstractDropHandler(QObject *parent) + : QObject(parent) +{ +} + +} diff -Nru dwayland-5.57.0.23/src/server/abstract_drop_handler.h dwayland-5.57.0.24+really5.24.3/src/server/abstract_drop_handler.h --- dwayland-5.57.0.23/src/server/abstract_drop_handler.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/abstract_drop_handler.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,26 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 David Redondo + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class SurfaceInterface; + +class KWAYLANDSERVER_EXPORT AbstractDropHandler : public QObject +{ + Q_OBJECT +public: + AbstractDropHandler(QObject *parent = nullptr); + virtual void updateDragTarget(SurfaceInterface *surface, quint32 serial) = 0; + virtual void drop() = 0; +}; +} diff -Nru dwayland-5.57.0.23/src/server/appmenu_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/appmenu_interface.cpp --- dwayland-5.57.0.23/src/server/appmenu_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/appmenu_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,186 +1,117 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "appmenu_interface.h" #include "display.h" #include "surface_interface.h" -#include "global_p.h" -#include "resource_p.h" -#include "logging.h" #include -#include +#include "qwayland-server-appmenu.h" -namespace KWayland +namespace KWaylandServer { -namespace Server -{ -class AppMenuManagerInterface::Private : public Global::Private +static const quint32 s_version = 1; + +class AppMenuManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_appmenu_manager { public: - Private(AppMenuManagerInterface *q, Display *d); - - QVector appmenus; -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); + AppMenuManagerInterfacePrivate(AppMenuManagerInterface *q, Display *d); + QVector appmenus; AppMenuManagerInterface *q; - static const struct org_kde_kwin_appmenu_manager_interface s_interface; - static const quint32 s_version; -}; -const quint32 AppMenuManagerInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_appmenu_manager_interface AppMenuManagerInterface::Private::s_interface = { - createCallback +protected: + void org_kde_kwin_appmenu_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; }; -#endif -void AppMenuManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) +void AppMenuManagerInterfacePrivate::org_kde_kwin_appmenu_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { - // TODO: send error? - qCWarning(KWAYLAND_SERVER) << "ServerSideDecorationInterface requested for non existing SurfaceInterface"; + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - auto appmenu = new AppMenuInterface(p->q, s, resource); - appmenu->create(p->display->getConnection(client), wl_resource_get_version(resource), id); - if (!appmenu->resource()) { - wl_resource_post_no_memory(resource); - delete appmenu; + wl_resource *appmenu_resource = wl_resource_create(resource->client(), &org_kde_kwin_appmenu_interface, resource->version(), id); + if (!appmenu_resource) { + wl_client_post_no_memory(resource->client()); return; } - p->appmenus.append(appmenu); - QObject::connect(appmenu, &QObject::destroyed, p->q, [=]() { - p->appmenus.removeOne(appmenu); - }); - emit p->q->appMenuCreated(appmenu); -} + auto appmenu = new AppMenuInterface(s, appmenu_resource); -AppMenuManagerInterface::Private::Private(AppMenuManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_appmenu_manager_interface, s_version) - , q(q) -{ -} - -void AppMenuManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_appmenu_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); + appmenus.append(appmenu); + QObject::connect(appmenu, &QObject::destroyed, q, [=]() { + appmenus.removeOne(appmenu); + }); + Q_EMIT q->appMenuCreated(appmenu); } -void AppMenuManagerInterface::Private::unbind(wl_resource *resource) +AppMenuManagerInterfacePrivate::AppMenuManagerInterfacePrivate(AppMenuManagerInterface *_q, Display *d) + : QtWaylandServer::org_kde_kwin_appmenu_manager(*d, s_version) + , q(_q) { - Q_UNUSED(resource) } -class AppMenuInterface::Private : public Resource::Private +class AppMenuInterfacePrivate : public QtWaylandServer::org_kde_kwin_appmenu { public: - Private(AppMenuInterface *q, AppMenuManagerInterface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); - + AppMenuInterfacePrivate(AppMenuInterface *q, SurfaceInterface *surface, wl_resource *resource); - SurfaceInterface *surface; - InterfaceAddress address; -private: - static void setAddressCallback(wl_client *client, wl_resource *resource, const char * service_name, const char * object_path); - - AppMenuInterface *q_func() { - return reinterpret_cast(q); - } - static AppMenuInterface *get(SurfaceInterface *s); - static const struct org_kde_kwin_appmenu_interface s_interface; + AppMenuInterface *q; + QPointer surface; + AppMenuInterface::InterfaceAddress address; + +protected: + void org_kde_kwin_appmenu_destroy_resource(Resource *resource) override; + void org_kde_kwin_appmenu_set_address(Resource *resource, const QString &service_name, const QString &object_path) override; + void org_kde_kwin_appmenu_release(Resource *resource) override; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_appmenu_interface AppMenuInterface::Private::s_interface = { - setAddressCallback, - resourceDestroyedCallback -}; -#endif - -void AppMenuInterface::Private::setAddressCallback(wl_client *client, wl_resource *resource, const char * service_name, const char * object_path) +AppMenuInterfacePrivate::AppMenuInterfacePrivate(AppMenuInterface *_q, SurfaceInterface *s, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_appmenu(resource) + , q(_q) + , surface(s) { - Q_UNUSED(client); - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - if (p->address.serviceName == QLatin1String(service_name) && - p->address.objectPath == QLatin1String(object_path)) { - return; - } - p->address.serviceName = QString::fromLatin1(service_name); - p->address.objectPath = QString::fromLatin1(object_path); - emit p->q_func()->addressChanged(p->address); } -AppMenuInterface::Private::Private(AppMenuInterface *q, AppMenuManagerInterface *c, SurfaceInterface *s, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_appmenu_interface, &s_interface), - surface(s) +void AppMenuInterfacePrivate::org_kde_kwin_appmenu_destroy_resource(QtWaylandServer::org_kde_kwin_appmenu::Resource *resource) { + Q_UNUSED(resource) + delete q; } -AppMenuInterface::Private::~Private() +void AppMenuInterfacePrivate::org_kde_kwin_appmenu_set_address(Resource *resource, const QString &service_name, const QString &object_path) { - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; + Q_UNUSED(resource) + if (address.serviceName == service_name && address.objectPath == object_path) { + return; } + + address.serviceName = service_name; + address.objectPath = object_path; + Q_EMIT q->addressChanged(address); } -AppMenuManagerInterface::AppMenuManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +void AppMenuInterfacePrivate::org_kde_kwin_appmenu_release(QtWaylandServer::org_kde_kwin_appmenu::Resource *resource) { + wl_resource_destroy(resource->handle); } -AppMenuManagerInterface::~AppMenuManagerInterface() +AppMenuManagerInterface::AppMenuManagerInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new AppMenuManagerInterfacePrivate(this, display)) { } -AppMenuManagerInterface::Private *AppMenuManagerInterface::d_func() const +AppMenuManagerInterface::~AppMenuManagerInterface() { - return reinterpret_cast(d.data()); } -AppMenuInterface* AppMenuManagerInterface::appMenuForSurface(SurfaceInterface *surface) +AppMenuInterface *AppMenuManagerInterface::appMenuForSurface(SurfaceInterface *surface) { - Q_D(); - for (AppMenuInterface* menu: d->appmenus) { + for (AppMenuInterface *menu : d->appmenus) { if (menu->surface() == surface) { return menu; } @@ -188,29 +119,24 @@ return nullptr; } -AppMenuInterface::AppMenuInterface(AppMenuManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource): - Resource(new Private(this, parent, s, parentResource)) +AppMenuInterface::AppMenuInterface(SurfaceInterface *surface, wl_resource *resource) + : QObject() + , d(new AppMenuInterfacePrivate(this, surface, resource)) { } -AppMenuInterface::Private *AppMenuInterface::d_func() const +AppMenuInterface::~AppMenuInterface() { - return reinterpret_cast(d.data()); } -AppMenuInterface::~AppMenuInterface() -{} - -AppMenuInterface::InterfaceAddress AppMenuInterface::address() const { - Q_D(); +AppMenuInterface::InterfaceAddress AppMenuInterface::address() const +{ return d->address; } -SurfaceInterface* AppMenuInterface::surface() const { - Q_D(); - return d->surface; -} - -}//namespace +SurfaceInterface *AppMenuInterface::surface() const +{ + return d->surface.data(); } +} // namespace diff -Nru dwayland-5.57.0.23/src/server/appmenu_interface.h dwayland-5.57.0.24+really5.24.3/src/server/appmenu_interface.h --- dwayland-5.57.0.23/src/server/appmenu_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/appmenu_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,77 +1,59 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_APPMENU_INTERFACE_H -#define KWAYLAND_SERVER_APPMENU_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" +#include +#include -#include +struct wl_resource; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class Display; class SurfaceInterface; class AppMenuInterface; +class AppMenuManagerInterfacePrivate; +class AppMenuInterfacePrivate; + /** * Provides the DBus service name and object path to a AppMenu DBus interface. * * This global can be used for clients to bind AppmenuInterface instances * and notifies when a new one is created - * @since 5.42 */ -class KWAYLANDSERVER_EXPORT AppMenuManagerInterface : public Global +class KWAYLANDSERVER_EXPORT AppMenuManagerInterface : public QObject { Q_OBJECT + public: - virtual ~AppMenuManagerInterface(); + explicit AppMenuManagerInterface(Display *display, QObject *parent = nullptr); + ~AppMenuManagerInterface() override; /** * Returns any existing appMenu for a given surface * This returns a null pointer if no AppMenuInterface exists. */ - AppMenuInterface* appMenuForSurface(SurfaceInterface *); + AppMenuInterface *appMenuForSurface(SurfaceInterface *); Q_SIGNALS: /** * Emitted whenever a new AppmenuInterface is created. - **/ - void appMenuCreated(KWayland::Server::AppMenuInterface*); + */ + void appMenuCreated(KWaylandServer::AppMenuInterface *); private: - explicit AppMenuManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; + QScopedPointer d; }; /** * Provides the DBus service name and object path to a AppMenu DBus interface. * This interface is attached to a wl_surface and provides access to where * the AppMenu DBus interface is registered. - * @since 5.42 */ -class KWAYLANDSERVER_EXPORT AppMenuInterface : public Resource +class KWAYLANDSERVER_EXPORT AppMenuInterface : public QObject { Q_OBJECT public: @@ -84,7 +66,7 @@ /** Object path of the AppMenu interface*/ QString objectPath; }; - virtual ~AppMenuInterface(); + ~AppMenuInterface() override; /** * @returns the service name and object path or empty strings if unset @@ -93,24 +75,20 @@ /** * @returns The SurfaceInterface this AppmenuInterface references. - **/ + */ SurfaceInterface *surface() const; Q_SIGNALS: /** * Emitted when the address changes or is first received */ - void addressChanged(KWayland::Server::AppMenuInterface::InterfaceAddress); + void addressChanged(KWaylandServer::AppMenuInterface::InterfaceAddress); private: - explicit AppMenuInterface(AppMenuManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource); - friend class AppMenuManagerInterface; + explicit AppMenuInterface(SurfaceInterface *s, wl_resource *resource); + friend class AppMenuManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/blur_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/blur_interface.cpp --- dwayland-5.57.0.23/src/server/blur_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/blur_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,200 +1,141 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "blur_interface.h" -#include "region_interface.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" +#include "region_interface_p.h" #include "surface_interface_p.h" -#include -#include +#include "qwayland-server-blur.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 1; -class BlurManagerInterface::Private : public Global::Private +class BlurManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_blur_manager { public: - Private(BlurManagerInterface *q, Display *d); + BlurManagerInterfacePrivate(BlurManagerInterface *q, Display *d); -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createBlur(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - static void unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface); - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - auto blurManager = reinterpret_cast*>(wl_resource_get_user_data(r))->data(); - if (blurManager) { - return static_cast(blurManager->d.data()); - } - return nullptr; - } BlurManagerInterface *q; - static const struct org_kde_kwin_blur_manager_interface s_interface; - static const quint32 s_version; -}; - -const quint32 BlurManagerInterface::Private::s_version = 1; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_blur_manager_interface BlurManagerInterface::Private::s_interface = { - createCallback, - unsetCallback +protected: + void org_kde_kwin_blur_manager_destroy_global() override; + void org_kde_kwin_blur_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; + void org_kde_kwin_blur_manager_unset(Resource *resource, wl_resource *surface) override; }; -#endif -BlurManagerInterface::Private::Private(BlurManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_blur_manager_interface, s_version) - , q(q) +BlurManagerInterfacePrivate::BlurManagerInterfacePrivate(BlurManagerInterface *_q, Display *d) + : QtWaylandServer::org_kde_kwin_blur_manager(*d, s_version) + , q(_q) { } -void BlurManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void BlurManagerInterfacePrivate::org_kde_kwin_blur_manager_destroy_global() { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_blur_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - auto ref = new QPointer(q);//deleted in unbind - wl_resource_set_implementation(resource, &s_interface, ref, unbind); + delete q; } -void BlurManagerInterface::Private::unbind(wl_resource *r) +void BlurManagerInterfacePrivate::org_kde_kwin_blur_manager_unset(Resource *resource, wl_resource *surface) { - delete reinterpret_cast*>(wl_resource_get_user_data(r)); -} - -void BlurManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) -{ - auto m = cast(resource); - if (!m) { - return;// will happen if global is deleted + Q_UNUSED(resource); + SurfaceInterface *s = SurfaceInterface::get(surface); + if (!s) { + return; } - m->createBlur(client, resource, id, surface); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setBlur(QPointer()); } -void BlurManagerInterface::Private::createBlur(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void BlurManagerInterfacePrivate::org_kde_kwin_blur_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - - BlurInterface *blur = new BlurInterface(q, resource); - blur->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!blur->resource()) { - wl_resource_post_no_memory(resource); - delete blur; + wl_resource *blur_resource = wl_resource_create(resource->client(), &org_kde_kwin_blur_interface, resource->version(), id); + if (!blur_resource) { + wl_client_post_no_memory(resource->client()); return; } - s->d_func()->setBlur(QPointer(blur)); + auto blur = new BlurInterface(blur_resource); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setBlur(blur); } -void BlurManagerInterface::Private::unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface) +BlurManagerInterface::BlurManagerInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new BlurManagerInterfacePrivate(this, display)) { - Q_UNUSED(client) - Q_UNUSED(resource) - SurfaceInterface *s = SurfaceInterface::get(surface); - if (!s) { - return; - } - s->d_func()->setBlur(QPointer()); } -BlurManagerInterface::BlurManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +BlurManagerInterface::~BlurManagerInterface() { } -BlurManagerInterface::~BlurManagerInterface() = default; +void BlurManagerInterface::remove() +{ + d->globalRemove(); +} -class BlurInterface::Private : public Resource::Private +class BlurInterfacePrivate : public QtWaylandServer::org_kde_kwin_blur { public: - Private(BlurInterface *q, BlurManagerInterface *c, wl_resource *parentResource); - ~Private(); - + BlurInterfacePrivate(BlurInterface *q, wl_resource *resource); QRegion pendingRegion; QRegion currentRegion; -private: - void commit(); - //TODO - BlurInterface *q_func() { - return reinterpret_cast(q); - } - - static void commitCallback(wl_client *client, wl_resource *resource); - static void setRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region); - - static const struct org_kde_kwin_blur_interface s_interface; -}; + BlurInterface *q; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_blur_interface BlurInterface::Private::s_interface = { - commitCallback, - setRegionCallback, - resourceDestroyedCallback +protected: + void org_kde_kwin_blur_destroy_resource(Resource *resource) override; + void org_kde_kwin_blur_commit(Resource *resource) override; + void org_kde_kwin_blur_set_region(Resource *resource, wl_resource *region) override; + void org_kde_kwin_blur_release(Resource *resource) override; }; -#endif -void BlurInterface::Private::commitCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - cast(resource)->commit(); -} - -void BlurInterface::Private::commit() +void BlurInterfacePrivate::org_kde_kwin_blur_commit(Resource *resource) { + Q_UNUSED(resource) currentRegion = pendingRegion; } -void BlurInterface::Private::setRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region) +void BlurInterfacePrivate::org_kde_kwin_blur_set_region(Resource *resource, wl_resource *region) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); if (r) { - p->pendingRegion = r->region(); + pendingRegion = r->region(); } else { - p->pendingRegion = QRegion(); + pendingRegion = QRegion(); } } -BlurInterface::Private::Private(BlurInterface *q, BlurManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_blur_interface, &s_interface) +void BlurInterfacePrivate::org_kde_kwin_blur_release(Resource *resource) { + wl_resource_destroy(resource->handle); } -BlurInterface::Private::~Private() = default; +void BlurInterfacePrivate::org_kde_kwin_blur_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +BlurInterfacePrivate::BlurInterfacePrivate(BlurInterface *_q, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_blur(resource) + , q(_q) +{ +} -BlurInterface::BlurInterface(BlurManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +BlurInterface::BlurInterface(wl_resource *resource) + : QObject() + , d(new BlurInterfacePrivate(this, resource)) { } @@ -202,14 +143,7 @@ QRegion BlurInterface::region() { - Q_D(); return d->currentRegion; } -BlurInterface::Private *BlurInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} } diff -Nru dwayland-5.57.0.23/src/server/blur_interface.h dwayland-5.57.0.24+really5.24.3/src/server/blur_interface.h --- dwayland-5.57.0.23/src/server/blur_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/blur_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,39 +1,23 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_BLUR_INTERFACE_H -#define KWAYLAND_SERVER_BLUR_INTERFACE_H - -#include "global.h" -#include "resource.h" +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ class Display; +class BlurManagerInterfacePrivate; +class BlurInterfacePrivate; /** * @brief Represents the Global for org_kde_kwin_blur_manager interface. @@ -42,18 +26,18 @@ * * @see BlurInterface * @see SurfaceInterface - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT BlurManagerInterface : public Global + */ +class KWAYLANDSERVER_EXPORT BlurManagerInterface : public QObject { Q_OBJECT public: - virtual ~BlurManagerInterface(); + explicit BlurManagerInterface(Display *display, QObject *parent = nullptr); + ~BlurManagerInterface() override; + + void remove(); private: - explicit BlurManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; /** @@ -65,30 +49,27 @@ * the BlurInterface is only available on the SurfaceInterface after it has been * committed. * + * Lifespan matches the underlying client resource + * * @see BlurManagerInterface * @see SurfaceInterface - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT BlurInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT BlurInterface : public QObject { Q_OBJECT public: - virtual ~BlurInterface(); + ~BlurInterface() override; /** * @returns The region or the SurfaceInterface which should be blurred, null Region implies complete surface. - **/ + */ QRegion region(); private: - explicit BlurInterface(BlurManagerInterface *parent, wl_resource *parentResource); - friend class BlurManagerInterface; + explicit BlurInterface(wl_resource *resource); + friend class BlurManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/buffer_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/buffer_interface.cpp --- dwayland-5.57.0.23/src/server/buffer_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/buffer_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "buffer_interface.h" -#include "display.h" -#include "logging.h" -#include "surface_interface.h" -#include "linuxdmabuf_v1_interface.h" -// Wayland -#include -// EGL -#include -#include - -#include "drm_fourcc.h" - -namespace KWayland -{ -namespace Server -{ - -namespace EGL -{ -typedef GLboolean(*eglQueryWaylandBufferWL_func)(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); -eglQueryWaylandBufferWL_func eglQueryWaylandBufferWL = nullptr; -} - -class BufferInterface::Private -{ -public: - Private(BufferInterface *q, wl_resource *resource, SurfaceInterface *parent); - ~Private(); - QImage::Format format() const; - QImage createImage(); - wl_resource *buffer; - wl_shm_buffer *shmBuffer; - LinuxDmabufBuffer *dmabufBuffer; - SurfaceInterface *surface; - int refCount; - QSize size; - bool alpha; - - static BufferInterface *get(wl_resource *r); - -private: - static void destroyListenerCallback(wl_listener *listener, void *data); - static Private *cast(wl_resource *r); - static void imageBufferCleanupHandler(void *info); - static QList s_buffers; - static Private *s_accessedBuffer; - static int s_accessCounter; - - BufferInterface *q; - wl_listener listener; -}; - -QList BufferInterface::Private::s_buffers; -BufferInterface::Private *BufferInterface::Private::s_accessedBuffer = nullptr; -int BufferInterface::Private::s_accessCounter = 0; - -BufferInterface::Private *BufferInterface::Private::cast(wl_resource *r) -{ - auto it = std::find_if(s_buffers.constBegin(), s_buffers.constEnd(), [r](Private *d) { return d->buffer == r; }); - if (it == s_buffers.constEnd()) { - return nullptr; - } - return *it; -} - -BufferInterface *BufferInterface::Private::get(wl_resource *r) -{ - Private *p = cast(r); - if (!p) { - return nullptr; - } - return p->q; -} - -void BufferInterface::Private::imageBufferCleanupHandler(void *info) -{ - Private *p = reinterpret_cast(info); - Q_ASSERT(p == s_accessedBuffer); - Q_ASSERT(s_accessCounter > 0); - s_accessCounter--; - if (s_accessCounter == 0) { - s_accessedBuffer = nullptr; - } - wl_shm_buffer_end_access(p->shmBuffer); -} - -BufferInterface::Private::Private(BufferInterface *q, wl_resource *resource, SurfaceInterface *parent) - : buffer(resource) - , shmBuffer(wl_shm_buffer_get(resource)) - , dmabufBuffer(nullptr) - , surface(parent) - , refCount(0) - , alpha(false) - , q(q) -{ - if (!shmBuffer && wl_resource_instance_of(resource, &wl_buffer_interface, LinuxDmabufUnstableV1Interface::bufferImplementation())) { - dmabufBuffer = static_cast(wl_resource_get_user_data(resource)); - } - s_buffers << this; - listener.notify = destroyListenerCallback; - listener.link.prev = nullptr; - listener.link.next = nullptr; - wl_resource_add_destroy_listener(resource, &listener); - if (shmBuffer) { - size = QSize(wl_shm_buffer_get_width(shmBuffer), wl_shm_buffer_get_height(shmBuffer)); - // check alpha - switch (wl_shm_buffer_get_format(shmBuffer)) { - case WL_SHM_FORMAT_ARGB8888: - alpha = true; - break; - case WL_SHM_FORMAT_XRGB8888: - default: - alpha = false; - break; - } - } else if (dmabufBuffer) { - switch (dmabufBuffer->format()) { - case DRM_FORMAT_ARGB4444: - case DRM_FORMAT_ABGR4444: - case DRM_FORMAT_RGBA4444: - case DRM_FORMAT_BGRA4444: - - case DRM_FORMAT_ARGB1555: - case DRM_FORMAT_ABGR1555: - case DRM_FORMAT_RGBA5551: - case DRM_FORMAT_BGRA5551: - - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ABGR8888: - case DRM_FORMAT_RGBA8888: - case DRM_FORMAT_BGRA8888: - - case DRM_FORMAT_ARGB2101010: - case DRM_FORMAT_ABGR2101010: - case DRM_FORMAT_RGBA1010102: - case DRM_FORMAT_BGRA1010102: - - case DRM_FORMAT_XRGB8888_A8: - case DRM_FORMAT_XBGR8888_A8: - case DRM_FORMAT_RGBX8888_A8: - case DRM_FORMAT_BGRX8888_A8: - case DRM_FORMAT_RGB888_A8: - case DRM_FORMAT_BGR888_A8: - case DRM_FORMAT_RGB565_A8: - case DRM_FORMAT_BGR565_A8: - alpha = true; - break; - default: - alpha = false; - break; - } - size = dmabufBuffer->size(); - } else if (parent) { - EGLDisplay eglDisplay = parent->global()->display()->eglDisplay(); - static bool resolved = false; - using namespace EGL; - if (!resolved && eglDisplay != EGL_NO_DISPLAY) { - eglQueryWaylandBufferWL = (eglQueryWaylandBufferWL_func)eglGetProcAddress("eglQueryWaylandBufferWL"); - resolved = true; - } - if (eglQueryWaylandBufferWL) { - EGLint width, height; - bool valid = false; - valid = eglQueryWaylandBufferWL(eglDisplay, buffer, EGL_WIDTH, &width); - valid = valid && eglQueryWaylandBufferWL(eglDisplay, buffer, EGL_HEIGHT, &height); - if (valid) { - size = QSize(width, height); - } - // check alpha - EGLint format; - if (eglQueryWaylandBufferWL(eglDisplay, buffer, EGL_TEXTURE_FORMAT, &format)) { - switch (format) { - case EGL_TEXTURE_RGBA: - alpha = true; - break; - case EGL_TEXTURE_RGB: - default: - alpha = false; - break; - } - } - } - } -} - -BufferInterface::Private::~Private() -{ - wl_list_remove(&listener.link); - s_buffers.removeAll(this); -} - -BufferInterface *BufferInterface::get(wl_resource *r) -{ - if (!r) { - return nullptr; - } - // TODO: verify it's a buffer - BufferInterface *b = Private::get(r); - if (b) { - return b; - } - return new BufferInterface(r, nullptr); -} - -BufferInterface::BufferInterface(wl_resource *resource, SurfaceInterface *parent) - : QObject() - , d(new Private(this, resource, parent)) -{ -} - -BufferInterface::~BufferInterface() -{ - if (d->refCount != 0) { - qCWarning(KWAYLAND_SERVER) << "Buffer destroyed while still being referenced, ref count:" << d->refCount; - } -} - -void BufferInterface::Private::destroyListenerCallback(wl_listener *listener, void *data) -{ - Q_UNUSED(listener); - auto b = cast(reinterpret_cast(data)); - b->buffer = nullptr; - emit b->q->aboutToBeDestroyed(b->q); - delete b->q; -} - -void BufferInterface::ref() -{ - d->refCount++; -} - -void BufferInterface::unref() -{ - Q_ASSERT(d->refCount > 0); - d->refCount--; - if (d->refCount == 0) { - if (d->buffer) { - wl_buffer_send_release(d->buffer); - wl_client_flush(wl_resource_get_client(d->buffer)); - } - deleteLater(); - } -} - -QImage::Format BufferInterface::Private::format() const -{ - if (!shmBuffer) { - return QImage::Format_Invalid; - } - switch (wl_shm_buffer_get_format(shmBuffer)) { - case WL_SHM_FORMAT_ARGB8888: - return QImage::Format_ARGB32_Premultiplied; - case WL_SHM_FORMAT_XRGB8888: - return QImage::Format_RGB32; - default: - return QImage::Format_Invalid; - } -} - -QImage BufferInterface::data() -{ - return std::move(d->createImage()); -} - -QImage BufferInterface::Private::createImage() -{ - if (!shmBuffer) { - return QImage(); - } - if (s_accessedBuffer != nullptr && s_accessedBuffer != this) { - return QImage(); - } - const QImage::Format imageFormat = format(); - if (imageFormat == QImage::Format_Invalid) { - return QImage(); - } - s_accessedBuffer = this; - s_accessCounter++; - wl_shm_buffer_begin_access(shmBuffer); - return std::move(QImage((const uchar*)wl_shm_buffer_get_data(shmBuffer), - size.width(), - size.height(), - wl_shm_buffer_get_stride(shmBuffer), - imageFormat, - &imageBufferCleanupHandler, this)); -} - -bool BufferInterface::isReferenced() const -{ - return d->refCount > 0; -} - -SurfaceInterface *BufferInterface::surface() const -{ - return d->surface; -} - -wl_shm_buffer *BufferInterface::shmBuffer() -{ - return d->shmBuffer; -} - -LinuxDmabufBuffer *BufferInterface::linuxDmabufBuffer() -{ - return d->dmabufBuffer; -} - -wl_resource *BufferInterface::resource() const -{ - return d->buffer; -} - -QSize BufferInterface::size() const -{ - return d->size; -} - -void BufferInterface::setSize(const QSize &size) -{ - if (d->shmBuffer || d->size == size) { - return; - } - d->size = size; - emit sizeChanged(); -} - -bool BufferInterface::hasAlphaChannel() const -{ - return d->alpha; -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/buffer_interface.h dwayland-5.57.0.24+really5.24.3/src/server/buffer_interface.h --- dwayland-5.57.0.23/src/server/buffer_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/buffer_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,193 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_BUFFER_INTERFACE_H -#define WAYLAND_SERVER_BUFFER_INTERFACE_H - -#include -#include - -#include - -struct wl_resource; -struct wl_shm_buffer; - -namespace KWayland -{ -namespace Server -{ -class SurfaceInterface; -class LinuxDmabufBuffer; - -/** - * @brief Reference counted representation of a Wayland buffer on Server side. - * - * This class encapsulates a rendering buffer which is normally attached to a SurfaceInterface. - * A client should not render to a Wayland buffer as long as the buffer gets used by the server. - * The server signals whether it's still used. This class provides a convenience access for this - * functionality by performing reference counting and deleting the BufferInterface instance - * automatically once it is no longer accessed. - * - * The BufferInterface is referenced as long as it is attached to a SurfaceInterface. If one wants - * to keep access to the BufferInterface for a longer time ensure to call ref on first usage and - * unref again once access to it is no longer needed. - * - * In Wayland the buffer is an abstract concept and a buffer might represent multiple different - * concrete buffer techniques. This class has direct support for shared memory buffers built and - * provides access to the native buffer for different (e.g. EGL/drm) buffers. - * - * If the EGL display has been registered in the Display the BufferInterface can also provide - * some information about an EGL/drm buffer. - * - * For shared memory buffers a direct conversion to a memory-mapped QImage possible using the - * data method. Please refer to the documentation for notes on the restrictions when using the - * shared memory-mapped QImages. - * - * @see Display - * @see SurfaceInterace - **/ -class KWAYLANDSERVER_EXPORT BufferInterface : public QObject -{ - Q_OBJECT -public: - virtual ~BufferInterface(); - /** - * Reference the BufferInterface. - * - * As long as the reference counting has not reached @c 0 the BufferInterface is valid - * and blocked for usage by the client. - * - * @see unref - * @see isReferenced - **/ - void ref(); - /** - * Unreference the BufferInterface. - * - * If the reference counting reached @c 0 the BufferInterface is released, so that the - * client can use it again. The instance of this BufferInterface will be automatically - * deleted. - * - * @see ref - * @see isReferenced - **/ - void unref(); - /** - * @returns whether the BufferInterface is currently referenced - * - * @see ref - * @see unref - **/ - bool isReferenced() const; - - /** - * @returns The SurfaceInterface this BufferInterface is attached to. - **/ - SurfaceInterface *surface() const; - /** - * @returns The native wl_shm_buffer if the BufferInterface represents a shared memory buffer, otherwise @c nullptr. - **/ - wl_shm_buffer *shmBuffer(); - /** - * Returns a pointer to the LinuxDmabufBuffer when the buffer is a dmabuf buffer, and nullptr otherwise. - */ - LinuxDmabufBuffer *linuxDmabufBuffer(); - /** - * @returns the native wl_resource wrapped by this BufferInterface. - **/ - wl_resource *resource() const; - - /** - * Creates a QImage for the shared memory buffer. - * - * If the BufferInterface does not reference a shared memory buffer a null QImage is returned. - * - * The QImage shares the memory with the buffer and this constraints how the returned - * QImage can be used and when this method can be invoked. - * - * It is not safe to have two shared memory QImages for different BufferInterfaces at - * the same time. This method ensures that this does not happen and returns a null - * QImage if a different BufferInterface's data is still mapped to a QImage. Please note - * that this also applies to all implicitly data shared copies. - * - * In case it is needed to keep a copy, a deep copy has to be performed by using QImage::copy. - * - * As the underlying shared memory buffer is owned by a different client it is not safe to - * write to the returned QImage. The image is a read-only buffer. If there is need to modify - * the image, perform a deep copy. - * - **/ - QImage data(); - - /** - * Returns the size of this BufferInterface. - * Note: only for shared memory buffers (shmBuffer) the size can be derived, - * for other buffers it might be possible to derive the size if an EGL display - * is set on Display otherwise the user of the BufferInterface has to use setSize to - * provide the proper size. - * @see setSize - * @see Display::setEglDisplay - * @since 5.3 - **/ - QSize size() const; - /** - * Sets the @p size for non shared memory buffers. - * @see size - * @see sizeChanged - * @since 5.3 - **/ - void setSize(const QSize &size); - - /** - * Returns whether the format of the BufferInterface has an alpha channel. - * For shared memory buffers returns @c true for format @c WL_SHM_FORMAT_ARGB8888, - * for all other formats returns @c false. - * - * For EGL buffers returns @c true for format @c EGL_TEXTURE_RGBA, for all other formats - * returns @c false. - * - * If the format cannot be queried the default value (@c false) is returned. - * - * @since 5.4 - **/ - bool hasAlphaChannel() const; - - static BufferInterface *get(wl_resource *r); - -Q_SIGNALS: - void aboutToBeDestroyed(KWayland::Server::BufferInterface*); - /** - * Emitted when the size of the Buffer changes. - * @since 5.3 - **/ - void sizeChanged(); - -private: - friend class SurfaceInterface; - explicit BufferInterface(wl_resource *resource, SurfaceInterface *parent); - class Private; - QScopedPointer d; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::BufferInterface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/clientbuffer.cpp dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer.cpp --- dwayland-5.57.0.23/src/server/clientbuffer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,84 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "clientbuffer.h" +#include "clientbuffer_p.h" + +#include "qwayland-server-wayland.h" + +namespace KWaylandServer +{ +ClientBuffer::ClientBuffer(ClientBufferPrivate &dd) + : d_ptr(&dd) +{ +} + +ClientBuffer::ClientBuffer(wl_resource *resource, ClientBufferPrivate &dd) + : d_ptr(&dd) +{ + initialize(resource); +} + +ClientBuffer::~ClientBuffer() +{ +} + +void ClientBuffer::initialize(wl_resource *resource) +{ + Q_D(ClientBuffer); + d->resource = resource; +} + +wl_resource *ClientBuffer::resource() const +{ + Q_D(const ClientBuffer); + return d->resource; +} + +bool ClientBuffer::isReferenced() const +{ + Q_D(const ClientBuffer); + return d->refCount > 0; +} + +bool ClientBuffer::isDestroyed() const +{ + Q_D(const ClientBuffer); + return d->isDestroyed; +} + +void ClientBuffer::ref() +{ + Q_D(ClientBuffer); + d->refCount++; +} + +void ClientBuffer::unref() +{ + Q_D(ClientBuffer); + Q_ASSERT(d->refCount > 0); + --d->refCount; + if (!isReferenced()) { + if (isDestroyed()) { + delete this; + } else { + wl_buffer_send_release(d->resource); + } + } +} + +void ClientBuffer::markAsDestroyed() +{ + Q_D(ClientBuffer); + if (!isReferenced()) { + delete this; + } else { + d->resource = nullptr; + d->isDestroyed = true; + } +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/clientbuffer.h dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer.h --- dwayland-5.57.0.23/src/server/clientbuffer.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,76 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include +#include +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class ClientBufferPrivate; + +/** + * The ClientBuffer class represents a client buffer. + * + * While the ClientBuffer is referenced, it won't be destroyed. Note that the client can + * still destroy the wl_buffer object while the ClientBuffer is referenced by the compositor. + * You can use the isDestroyed() function to check whether the wl_buffer object has been + * destroyed. + */ +class KWAYLANDSERVER_EXPORT ClientBuffer : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ClientBuffer) + +public: + ~ClientBuffer() override; + + /** + * This enum type is used to specify the corner where the origin is. That's it, the + * buffer corner where 0,0 is located. + */ + enum class Origin { + TopLeft, + BottomLeft, + }; + + bool isReferenced() const; + bool isDestroyed() const; + + void ref(); + void unref(); + + /** + * Returns the wl_resource for this ClientBuffer. If the buffer is destroyed, @c null + * will be returned. + */ + wl_resource *resource() const; + + /** + * Returns the size in the native pixels. The returned size is unaffected by buffer + * scale or other surface transforms, e.g. @c wp_viewport. + */ + virtual QSize size() const = 0; + virtual bool hasAlphaChannel() const = 0; + virtual Origin origin() const = 0; + + void markAsDestroyed(); ///< @internal + +protected: + ClientBuffer(ClientBufferPrivate &dd); + ClientBuffer(wl_resource *resource, ClientBufferPrivate &dd); + + void initialize(wl_resource *resource); + QScopedPointer d_ptr; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/clientbufferintegration.cpp dwayland-5.57.0.24+really5.24.3/src/server/clientbufferintegration.cpp --- dwayland-5.57.0.23/src/server/clientbufferintegration.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientbufferintegration.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,40 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "clientbufferintegration.h" +#include "display.h" +#include "display_p.h" + +namespace KWaylandServer +{ +ClientBufferIntegration::ClientBufferIntegration(Display *display) + : QObject(display) + , m_display(display) +{ + DisplayPrivate *displayPrivate = DisplayPrivate::get(display); + displayPrivate->bufferIntegrations.append(this); +} + +ClientBufferIntegration::~ClientBufferIntegration() +{ + if (m_display) { + DisplayPrivate *displayPrivate = DisplayPrivate::get(m_display); + displayPrivate->bufferIntegrations.removeOne(this); + } +} + +Display *ClientBufferIntegration::display() const +{ + return m_display; +} + +ClientBuffer *ClientBufferIntegration::createBuffer(wl_resource *resource) +{ + Q_UNUSED(resource) + return nullptr; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/clientbufferintegration.h dwayland-5.57.0.24+really5.24.3/src/server/clientbufferintegration.h --- dwayland-5.57.0.23/src/server/clientbufferintegration.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientbufferintegration.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "clientbuffer.h" + +#include + +namespace KWaylandServer +{ +class Display; + +class KWAYLANDSERVER_EXPORT ClientBufferIntegration : public QObject +{ + Q_OBJECT + +public: + explicit ClientBufferIntegration(Display *display); + ~ClientBufferIntegration() override; + + Display *display() const; + + virtual ClientBuffer *createBuffer(wl_resource *resource); + +private: + QPointer m_display; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/clientbuffer_p.h dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer_p.h --- dwayland-5.57.0.23/src/server/clientbuffer_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientbuffer_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,25 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "clientbuffer.h" + +namespace KWaylandServer +{ +class ClientBufferPrivate +{ +public: + virtual ~ClientBufferPrivate() + { + } + + int refCount = 0; + wl_resource *resource = nullptr; + bool isDestroyed = false; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/clientconnection.cpp dwayland-5.57.0.24+really5.24.3/src/server/clientconnection.cpp --- dwayland-5.57.0.23/src/server/clientconnection.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientconnection.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,40 +1,24 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "clientconnection.h" #include "display.h" +#include "utils/executable_path.h" // Qt #include #include // Wayland #include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class ClientConnection::Private +class ClientConnectionPrivate { public: - explicit Private(wl_client *c, Display *display, ClientConnection *q); - ~Private(); + ClientConnectionPrivate(wl_client *c, Display *display, ClientConnection *q); + ~ClientConnectionPrivate(); wl_client *client; Display *display; @@ -47,12 +31,12 @@ static void destroyListenerCallback(wl_listener *listener, void *data); ClientConnection *q; wl_listener listener; - static QVector s_allClients; + static QVector s_allClients; }; -QVector ClientConnection::Private::s_allClients; +QVector ClientConnectionPrivate::s_allClients; -ClientConnection::Private::Private(wl_client *c, Display *display, ClientConnection *q) +ClientConnectionPrivate::ClientConnectionPrivate(wl_client *c, Display *display, ClientConnection *q) : client(c) , display(display) , q(q) @@ -61,10 +45,10 @@ listener.notify = destroyListenerCallback; wl_client_add_destroy_listener(c, &listener); wl_client_get_credentials(client, &pid, &user, &group); - executablePath = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); + executablePath = executablePathFromPid(pid); } -ClientConnection::Private::~Private() +ClientConnectionPrivate::~ClientConnectionPrivate() { if (client) { wl_list_remove(&listener.link); @@ -72,27 +56,26 @@ s_allClients.removeAt(s_allClients.indexOf(this)); } -void ClientConnection::Private::destroyListenerCallback(wl_listener *listener, void *data) +void ClientConnectionPrivate::destroyListenerCallback(wl_listener *listener, void *data) { Q_UNUSED(listener) - wl_client *client = reinterpret_cast(data); - auto it = std::find_if(s_allClients.constBegin(), s_allClients.constEnd(), - [client](Private *c) { - return c->client == client; - } - ); + wl_client *client = reinterpret_cast(data); + auto it = std::find_if(s_allClients.constBegin(), s_allClients.constEnd(), [client](ClientConnectionPrivate *c) { + return c->client == client; + }); Q_ASSERT(it != s_allClients.constEnd()); auto p = (*it); auto q = p->q; + Q_EMIT q->aboutToBeDestroyed(); p->client = nullptr; wl_list_remove(&p->listener.link); - emit q->disconnected(q); + Q_EMIT q->disconnected(q); q->deleteLater(); } ClientConnection::ClientConnection(wl_client *c, Display *parent) : QObject(parent) - , d(new Private(c, parent, this)) + , d(new ClientConnectionPrivate(c, parent, this)) { } @@ -114,15 +97,7 @@ wl_client_destroy(d->client); } -wl_resource *ClientConnection::createResource(const wl_interface *interface, quint32 version, quint32 id) -{ - if (!d->client) { - return nullptr; - } - return wl_resource_create(d->client, interface, version, id); -} - -wl_resource *ClientConnection::getResource(quint32 id) +wl_resource *ClientConnection::getResource(quint32 id) const { if (!d->client) { return nullptr; @@ -130,22 +105,22 @@ return wl_client_get_object(d->client, id); } -wl_client *ClientConnection::client() +wl_client *ClientConnection::client() const { return d->client; } -ClientConnection::operator wl_client*() +ClientConnection::operator wl_client *() { return d->client; } -ClientConnection::operator wl_client*() const +ClientConnection::operator wl_client *() const { return d->client; } -Display *ClientConnection::display() +Display *ClientConnection::display() const { return d->display; } @@ -171,4 +146,3 @@ } } -} diff -Nru dwayland-5.57.0.23/src/server/clientconnection.h dwayland-5.57.0.24+really5.24.3/src/server/clientconnection.h --- dwayland-5.57.0.23/src/server/clientconnection.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientconnection.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,51 +1,33 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_CLIENTCONNECTION_H -#define KWAYLAND_SERVER_CLIENTCONNECTION_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include #include -#include +#include struct wl_client; -struct wl_interface; struct wl_resource; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - +class ClientConnectionPrivate; class Display; /** * @brief Convenient Class which represents a wl_client. * * The ClientConnection gets automatically created for a wl_client when a wl_client is - * first used in the context of KWayland::Server. In particular the signal + * first used in the context of KWaylandServer. In particular the signal * @link Display::clientConnected @endlink will be emitted. * * @see Display - **/ + */ class KWAYLANDSERVER_EXPORT ClientConnection : public QObject { Q_OBJECT @@ -54,109 +36,95 @@ /** * Flushes the connection to this client. Ensures that all events are pushed to the client. - **/ + */ void flush(); /** - * Creates a new wl_resource for the provided @p interface. - * - * Thus a convenient wrapper around wl_resource_create - * - * @param interface - * @param version - * @param id - * @returns the created native wl_resource - **/ - wl_resource *createResource(const wl_interface *interface, quint32 version, quint32 id); - /** * Get the wl_resource associated with the given @p id. - * @since 5.3 - **/ - wl_resource *getResource(quint32 id); + */ + wl_resource *getResource(quint32 id) const; /** * @returns the native wl_client this ClientConnection represents. - **/ - wl_client *client(); + */ + wl_client *client() const; /** * @returns The Display this ClientConnection is connected to - **/ - Display *display(); + */ + Display *display() const; /** * The pid of the ClientConnection endpoint. * * Please note: if the ClientConnection got created with @link Display::createClient @endlink - * the pid will be identical to the process running the KWayland::Server::Display. + * the pid will be identical to the process running the KWaylandServer::Display. * * @returns The pid of the connection. - **/ + */ pid_t processId() const; /** * The uid of the ClientConnection endpoint. * * Please note: if the ClientConnection got created with @link Display::createClient @endlink - * the uid will be identical to the process running the KWayland::Server::Display. + * the uid will be identical to the process running the KWaylandServer::Display. * * @returns The uid of the connection. - **/ + */ uid_t userId() const; /** * The gid of the ClientConnection endpoint. * * Please note: if the ClientConnection got created with @link Display::createClient @endlink - * the gid will be identical to the process running the KWayland::Server::Display. + * the gid will be identical to the process running the KWaylandServer::Display. * * @returns The gid of the connection. - **/ + */ gid_t groupId() const; /** * The absolute path to the executable. * * Please note: if the ClientConnection got created with @link Display::createClient @endlink - * the executablePath will be identical to the process running the KWayland::Server::Display. + * the executablePath will be identical to the process running the KWaylandServer::Display. * * If the executable path cannot be resolved an empty QString is returned. * * @see processId - * @since 5.6 - **/ + */ QString executablePath() const; /** * Cast operator the native wl_client this ClientConnection represents. - **/ - operator wl_client*(); + */ + operator wl_client *(); /** * Cast operator the native wl_client this ClientConnection represents. - **/ - operator wl_client*() const; + */ + operator wl_client *() const; /** * Destroys this ClientConnection. * This is a convenient wrapper around wl_client_destroy. The use case is in combination * with ClientConnections created through @link Display::createClient @endlink. E.g. once * the process for the ClientConnection exited, the ClientConnection needs to be destroyed, too. - * @since 5.5 - **/ + */ void destroy(); Q_SIGNALS: /** + * This signal is emitted when the client is about to be destroyed. + */ + void aboutToBeDestroyed(); + /** * Signal emitted when the ClientConnection got disconnected from the server. - **/ - void disconnected(KWayland::Server::ClientConnection*); + */ + void disconnected(KWaylandServer::ClientConnection *); private: friend class Display; explicit ClientConnection(wl_client *c, Display *parent); - class Private; - QScopedPointer d; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::ClientConnection*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::ClientConnection *) diff -Nru dwayland-5.57.0.23/src/server/clientmanagement_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/clientmanagement_interface.cpp --- dwayland-5.57.0.23/src/server/clientmanagement_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientmanagement_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -18,103 +18,156 @@ License along with this library. If not, see . *********************************************************************/ #include "clientmanagement_interface.h" -#include "global_p.h" #include "display.h" #include "logging.h" -#include "buffer_interface.h" +#include "surface_interface.h" +#include "utils.h" +#include "shmclientbuffer.h" -#include -#include "wayland-client-management-server-protocol.h" +#include +#include "qwayland-server-com-deepin-client-management.h" #define MAX_WINDOWS 100 -namespace KWayland -{ -namespace Server +namespace KWaylandServer { -class ClientManagementInterface::Private : public Global::Private +static const quint32 s_version = 1; + +class ClientManagementInterfacePrivate: public QtWaylandServer::com_deepin_client_management { public: - struct ResourceData { - wl_resource *resource; - uint32_t version; - }; - Private(ClientManagementInterface *q, Display *d); + ClientManagementInterfacePrivate(ClientManagementInterface *q, Display *d); + ClientManagementInterface *q; void updateWindowStates(); + void getWindowStates(); + void captureWindowImage(int windowId, wl_resource *buffer); void sendWindowStates(wl_resource *resource); void sendWindowCaption(int windowId, bool succeed, wl_resource *buffer); + void sendSplitChange(const QString& uuid, int splitable); + void splitWindow(QString uuid, int splitType); - WindowState m_windowStates[MAX_WINDOWS]; + ClientManagementInterface::WindowState m_windowStates[MAX_WINDOWS]; uint32_t m_windowCount; - QList resources; - static ClientManagementInterface *get(wl_resource *native); - +protected: + void com_deepin_client_management_get_window_states(Resource *resource) override; + void com_deepin_client_management_capture_window_image(Resource *resource, + int32_t window_id, struct ::wl_resource *buffer) override; + void com_deepin_client_management_split_window(Resource *resource, + const QString &uuid, int32_t splitType) override; private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void getWindowStates(); - void captureWindowImage(int windowId, wl_resource *buffer); - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } + QString m_splitUuid; + int m_splitable = 0; +}; + +ClientManagementInterfacePrivate::ClientManagementInterfacePrivate(ClientManagementInterface *q, Display *d) + : QtWaylandServer::com_deepin_client_management(*d, s_version) + , q(q) +{ +} - static void getWindowStatesCallback(wl_client *client, wl_resource *resource); - static void captureWindowImageCallback(wl_client *client, wl_resource *resource, int window_id, wl_resource *buffer); +void ClientManagementInterfacePrivate::com_deepin_client_management_get_window_states(Resource *resource) +{ + Q_UNUSED(resource); - static const quint32 s_version; - ClientManagementInterface *q; - static const struct com_deepin_client_management_interface s_interface; -}; + getWindowStates(); +} -const quint32 ClientManagementInterface::Private::s_version = 1; +void ClientManagementInterfacePrivate::com_deepin_client_management_capture_window_image(Resource *resource, int windowId, wl_resource *buffer) +{ + Q_UNUSED(resource); -ClientManagementInterface::Private::Private(ClientManagementInterface *q, Display *d) - : Global::Private(d, &com_deepin_client_management_interface, s_version) - , q(q) + captureWindowImage(windowId, buffer); +} + +void ClientManagementInterfacePrivate::com_deepin_client_management_split_window(Resource *resource, const QString &uuid, int32_t splitType) { + Q_UNUSED(resource); + + splitWindow(uuid, splitType); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct com_deepin_client_management_interface ClientManagementInterface::Private::s_interface = { - getWindowStatesCallback, - captureWindowImageCallback -}; -#endif +void ClientManagementInterfacePrivate::getWindowStates() +{ + Q_EMIT q->windowStatesRequest(); +} + +void ClientManagementInterfacePrivate::captureWindowImage(int windowId, wl_resource *buffer) +{ + qWarning() << __func__ << ":" << __LINE__ << "ut-gfx-capture: windowId " << windowId; + Q_EMIT q->captureWindowImageRequest(windowId, buffer); +} + +void ClientManagementInterfacePrivate::splitWindow(QString uuid, int splitType) +{ + Q_EMIT q->splitWindowRequest(uuid, splitType); +} + +void ClientManagementInterfacePrivate::sendWindowStates(wl_resource *resource) +{ + struct wl_array data; + auto fillArray = [this](const ClientManagementInterface::WindowState *origin, wl_array *dest) { + wl_array_init(dest); + const size_t memLength = sizeof(struct ClientManagementInterface::WindowState) * m_windowCount; + void *s = wl_array_add(dest, memLength); + memcpy(s, origin, memLength); + }; + fillArray(m_windowStates, &data); + com_deepin_client_management_send_window_states(resource, m_windowCount, &data); + wl_array_release(&data); +} -ClientManagementInterface *ClientManagementInterface::Private::get(wl_resource *native) +void ClientManagementInterfacePrivate::updateWindowStates() { - if (Private *p = cast(native)) { - return p->q; + const auto clientResources = resourceMap(); + for (Resource *resource : clientResources) { + sendWindowStates(resource->handle); } - return nullptr; } -ClientManagementInterface::Private *ClientManagementInterface::d_func() const +void ClientManagementInterfacePrivate::sendWindowCaption(int windowId, bool succeed, wl_resource *buffer) { - return reinterpret_cast(d.data()); + const auto clientResources = resourceMap(); + for (Resource *resource : clientResources) { + qWarning() << __func__ << ":" << __LINE__ << "ut-gfx-capture-sendWindowCaption: windowId " << windowId << " resource" << resource->handle; + com_deepin_client_management_send_capture_callback(resource->handle, windowId, succeed, buffer); + } +} + +void ClientManagementInterfacePrivate::sendSplitChange(const QString& uuid, int splitable) +{ + if (splitable > 0) { + m_splitUuid = uuid; + m_splitable = splitable; + const auto clientResources = resourceMap(); + for (Resource *resource : clientResources) { + com_deepin_client_management_send_split_change(resource->handle, m_splitUuid.toLatin1().data(), m_splitable); + } + } } ClientManagementInterface::ClientManagementInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new ClientManagementInterfacePrivate(this, display)) { - Q_D(); - connect(this, &ClientManagementInterface::windowStatesChanged, this, [this, d] { d->updateWindowStates(); }); + connect(this, &ClientManagementInterface::windowStatesChanged, this, [this] { this->d->updateWindowStates(); }); } ClientManagementInterface::~ClientManagementInterface() = default; ClientManagementInterface *ClientManagementInterface::get(wl_resource* native) { - return Private::get(native); + if (auto interfacePrivate = resource_cast(native)) { + return interfacePrivate->q; + } + return nullptr; } void ClientManagementInterface::setWindowStates(QList &windowStates) { - Q_D(); int i = 0; for (auto it = windowStates.begin(); it != windowStates.end() && i < MAX_WINDOWS; @@ -122,12 +175,11 @@ memcpy(&d->m_windowStates[i++], *it, sizeof(WindowState)); d->m_windowCount = i; } - emit windowStatesChanged(); + Q_EMIT windowStatesChanged(); } void ClientManagementInterface::sendWindowCaptionImage(int windowId, wl_resource *buffer, QImage image) { - Q_D(); bool succeed = false; wl_shm_buffer *shm_buffer = wl_shm_buffer_get(buffer); if (shm_buffer && !image.isNull()) { @@ -135,114 +187,43 @@ void *data = wl_shm_buffer_get_data(shm_buffer); if (data) { succeed = true; - memcpy(data, image.bits(), image.byteCount()); + memcpy(data, image.bits(), image.sizeInBytes()); } wl_shm_buffer_end_access(shm_buffer); } d->sendWindowCaption(windowId, succeed, buffer); } -void ClientManagementInterface::sendWindowCaption(int windowId, wl_resource *buffer, SurfaceInterface* surface) { - Q_D(); +void ClientManagementInterface::sendWindowCaption(int windowId, wl_resource *buffer, SurfaceInterface* surface) +{ if (!surface || !surface->buffer()) { d->sendWindowCaption(windowId, false, buffer); return; } + + auto shmClient = qobject_cast(surface->buffer()); + + if(!shmClient) { + return; + } + bool succeed = false; wl_shm_buffer *shm_buffer = wl_shm_buffer_get(buffer); if (shm_buffer) { - QImage image = surface->buffer()->data(); + QImage image = shmClient->data(); void *data = wl_shm_buffer_get_data(shm_buffer); if (!image.isNull()) { - memcpy(data, image.bits(), image.byteCount()); + memcpy(data, image.bits(), image.sizeInBytes()); succeed = true; } } d->sendWindowCaption(windowId, succeed, buffer); } -void ClientManagementInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&com_deepin_client_management_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - - ResourceData r; - r.resource = resource; - r.version = version; - resources << r; -} - -void ClientManagementInterface::Private::unbind(wl_resource *resource) -{ - Private *o = cast(resource); - if (!o) { - return; - } - auto it = std::find_if(o->resources.begin(), o->resources.end(), [resource](const ResourceData &r) { return r.resource == resource; }); - if (it != o->resources.end()) { - o->resources.erase(it); - } -} - -void ClientManagementInterface::Private::getWindowStatesCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - Private *p = cast(resource); - p->getWindowStates(); -} - -void ClientManagementInterface::Private::captureWindowImageCallback(wl_client *client, wl_resource *resource, int windowId, wl_resource *buffer) -{ - Q_UNUSED(client) - Private *p = cast(resource); - p->captureWindowImage(windowId, buffer); -} - -void ClientManagementInterface::Private::getWindowStates() +void ClientManagementInterface::sendSplitChange(const QString& uuid, int splitable) { - emit q->windowStatesRequest(); + d->sendSplitChange(uuid, splitable); } -void ClientManagementInterface::Private::captureWindowImage(int windowId, wl_resource *buffer) -{ - qWarning() << __func__ << ":" << __LINE__ << "ut-gfx-capture: windowId " << windowId; - emit q->captureWindowImageRequest(windowId, buffer); -} - -void ClientManagementInterface::Private::sendWindowStates(wl_resource *resource) -{ - struct wl_array data; - auto fillArray = [this](const WindowState *origin, wl_array *dest) { - wl_array_init(dest); - const size_t memLength = sizeof(struct WindowState) * m_windowCount; - void *s = wl_array_add(dest, memLength); - memcpy(s, origin, memLength); - }; - fillArray(m_windowStates, &data); - com_deepin_client_management_send_window_states(resource, m_windowCount, &data); - wl_array_release(&data); -} - -void ClientManagementInterface::Private::updateWindowStates() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendWindowStates((*it).resource); - } -} - -void ClientManagementInterface::Private::sendWindowCaption(int windowId, bool succeed, wl_resource *buffer) -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - qWarning() << __func__ << ":" << __LINE__ << "ut-gfx-capture-sendWindowCaption: windowId " << windowId << " resource" << (*it).resource; - com_deepin_client_management_send_capture_callback((*it).resource, windowId, succeed, buffer); - } -} - -} -} +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/clientmanagement_interface.h dwayland-5.57.0.24+really5.24.3/src/server/clientmanagement_interface.h --- dwayland-5.57.0.23/src/server/clientmanagement_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/clientmanagement_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -26,18 +26,16 @@ #include #include -#include -#include "global.h" #include "surface_interface.h" +#include struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { class Display; +class ClientManagementInterfacePrivate; /** @class ClientManagementInterface * @@ -45,11 +43,13 @@ * @see ClientManagementInterface * @since 5.5 */ -class KWAYLANDSERVER_EXPORT ClientManagementInterface : public Global +class KWAYLANDSERVER_EXPORT ClientManagementInterface : public QObject { Q_OBJECT + public: - virtual ~ClientManagementInterface(); + explicit ClientManagementInterface(Display *display, QObject *parent = nullptr); + ~ClientManagementInterface() override; struct WindowState { int32_t pid; @@ -64,6 +64,8 @@ bool isMinimized; bool isFullScreen; bool isActive; + int32_t splitable; + char uuid[256]; }; static ClientManagementInterface *get(wl_resource *native); @@ -71,21 +73,19 @@ void sendWindowCaptionImage(int windowId, wl_resource *buffer, QImage image); void sendWindowCaption(int windowId, wl_resource *buffer, SurfaceInterface* surface); + void sendSplitChange(const QString& uuid, int splitable); Q_SIGNALS: void windowStatesRequest(); void windowStatesChanged(); void captureWindowImageRequest(int windowId, wl_resource *buffer); + void splitWindowRequest(QString uuid, int splitType); private: - friend class Display; - explicit ClientManagementInterface(Display *display, QObject *parent = nullptr); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} #endif diff -Nru dwayland-5.57.0.23/src/server/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/src/server/CMakeLists.txt --- dwayland-5.57.0.23/src/server/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,14 +1,18 @@ set(SERVER_LIB_SRCS abstract_data_source.cpp + abstract_drop_handler.cpp appmenu_interface.cpp - buffer_interface.cpp + blur_interface.cpp + clientbuffer.cpp + clientbufferintegration.cpp clientconnection.cpp clientmanagement_interface.cpp compositor_interface.cpp - datacontroldevice_interface.cpp - datacontroldevicemanager_interface.cpp - datacontroloffer_interface.cpp - datacontrolsource_interface.cpp + contrast_interface.cpp + datacontroldevice_v1_interface.cpp + datacontroldevicemanager_v1_interface.cpp + datacontroloffer_v1_interface.cpp + datacontrolsource_v1_interface.cpp datadevice_interface.cpp datadevicemanager_interface.cpp dataoffer_interface.cpp @@ -18,369 +22,365 @@ ddeshell_interface.cpp display.cpp dpms_interface.cpp + drmclientbuffer.cpp + drmleasedevice_v1_interface.cpp + fakeinput_interface.cpp filtered_display.cpp - global.cpp idle_interface.cpp - idleinhibit_interface.cpp - idleinhibit_interface_v1.cpp - fakeinput_interface.cpp + idleinhibit_v1_interface.cpp + inputmethod_v1_interface.cpp keyboard_interface.cpp - linuxdmabuf_v1_interface.cpp - remote_access_interface.cpp - outputconfiguration_interface.cpp - outputchangeset.cpp - outputmanagement_interface.cpp - outputdevice_interface.cpp + keyboard_shortcuts_inhibit_v1_interface.cpp + keystate_interface.cpp + layershell_v1_interface.cpp + linuxdmabufv1clientbuffer.cpp output_interface.cpp - pointer_interface.cpp + outputdevice_v2_interface.cpp + outputconfiguration_v2_interface.cpp + outputmanagement_v2_interface.cpp + outputchangeset_v2.cpp plasmashell_interface.cpp plasmavirtualdesktop_interface.cpp plasmawindowmanagement_interface.cpp - pointerconstraints_interface.cpp - pointerconstraints_interface_v1.cpp - pointergestures_interface.cpp - pointergestures_interface_v1.cpp + pointer_interface.cpp + pointerconstraints_v1_interface.cpp + pointergestures_v1_interface.cpp + primaryoutput_v1_interface.cpp primaryselectiondevice_v1_interface.cpp primaryselectiondevicemanager_v1_interface.cpp primaryselectionoffer_v1_interface.cpp primaryselectionsource_v1_interface.cpp - qtsurfaceextension_interface.cpp region_interface.cpp - relativepointer_interface.cpp - relativepointer_interface_v1.cpp - resource.cpp + relativepointer_v1_interface.cpp + screencast_v1_interface.cpp seat_interface.cpp - slide_interface.cpp - shadow_interface.cpp - blur_interface.cpp - screencast_interface.cpp - contrast_interface.cpp server_decoration_interface.cpp server_decoration_palette_interface.cpp - shell_interface.cpp + shadow_interface.cpp + shmclientbuffer.cpp + slide_interface.cpp strut_interface.cpp - xwayland_keyboard_grab_v1_interface.cpp - surface_interface.cpp subcompositor_interface.cpp + surface_interface.cpp + surfacerole.cpp + tablet_v2_interface.cpp + textinput.cpp + textinput_v2_interface.cpp + textinput_v3_interface.cpp touch_interface.cpp - textinput_interface.cpp - textinput_interface_v0.cpp - textinput_interface_v2.cpp - xdgdecoration_interface.cpp - xdgshell_interface.cpp - xdgshell_v5_interface.cpp + viewporter_interface.cpp + xdgactivation_v1_interface.cpp + xdgdecoration_v1_interface.cpp xdgforeign_v2_interface.cpp - xdgforeign_interface.cpp - xdgshell_v5_interface.cpp - xdgshell_v6_interface.cpp - xdgshell_stable_interface.cpp - xdgoutput_interface.cpp - ../compat/wayland-xdg-shell-v5-protocol.c + xdgoutput_v1_interface.cpp + xdgshell_interface.cpp + globalproperty_interface.cpp + remote_access_interface.cpp ) -ecm_qt_declare_logging_category(SERVER_LIB_SRCS HEADER logging.h IDENTIFIER KWAYLAND_SERVER CATEGORY_NAME kwayland-server DEFAULT_SEVERITY Critical) +ecm_qt_declare_logging_category(SERVER_LIB_SRCS + HEADER logging.h + IDENTIFIER KWAYLAND_SERVER + CATEGORY_NAME dwayland.server + DEFAULT_SEVERITY Critical + DESCRIPTION "DWayland Server Library" + EXPORT DWAYLAND +) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/output-management.xml - BASENAME output-management +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${Wayland_DATADIR}/wayland.xml + BASENAME wayland ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/outputdevice.xml - BASENAME org_kde_kwin_outputdevice +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-output-device-v2.xml + BASENAME kde-output-device-v2 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-shell.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-primary-output-v1.xml + BASENAME kde-primary-output-v1 +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml + BASENAME kde-output-management-v2 +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-shell.xml BASENAME plasma-shell ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-virtual-desktop.xml - BASENAME plasma-virtual-desktop +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-virtual-desktop.xml + BASENAME org-kde-plasma-virtual-desktop ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/plasma-window-management.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/plasma-window-management.xml BASENAME plasma-window-management ) ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/surface-extension.xml + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/surface-extension.xml BASENAME qt-surface-extension ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/idle.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/idle.xml BASENAME idle ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/fake-input.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/fake-input.xml BASENAME fake-input ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/shadow.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/shadow.xml BASENAME shadow ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dpms.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dpms.xml BASENAME dpms ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/blur.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/blur.xml BASENAME blur ) -ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/screencast.xml - BASENAME zkde-screencast-unstable-v1 -) - -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/contrast.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/contrast.xml BASENAME contrast ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/relative-pointer-unstable-v1.xml - BASENAME relativepointer-unstable-v1 +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml + BASENAME relative-pointer-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/slide.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/slide.xml BASENAME slide ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/server-decoration.xml - BASENAME server_decoration +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/server-decoration.xml + BASENAME server-decoration ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/text-input.xml - BASENAME text +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml + BASENAME text-input-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/text-input-unstable-v2.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/text-input-unstable-v2.xml BASENAME text-input-unstable-v2 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-shell-unstable-v6.xml - BASENAME xdg-shell-v6 +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml + BASENAME text-input-unstable-v3 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/pointer-gestures-unstable-v1.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml BASENAME pointer-gestures-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/pointer-constraints-unstable-v1.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml BASENAME pointer-constraints-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-foreign-unstable-v2.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml BASENAME xdg-foreign-unstable-v2 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/idle-inhibit-unstable-v1.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml BASENAME idle-inhibit-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/appmenu.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/appmenu.xml BASENAME appmenu ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/server-decoration-palette.xml - BASENAME server_decoration_palette +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml + BASENAME server-decoration-palette ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/remote-access.xml - BASENAME remote-access +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-output/xdg-output-unstable-v1.xml + BASENAME xdg-output-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-output-unstable-v1.xml - BASENAME xdg-output +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml + BASENAME xdg-shell ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-shell.xml - BASENAME xdg-shell +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml + BASENAME xdg-decoration-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xdg-decoration-unstable-v1.xml - BASENAME xdg-decoration +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/keystate.xml + BASENAME keystate ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/client-management.xml - BASENAME client-management +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml + BASENAME linux-dmabuf-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dde-seat.xml - BASENAME dde-seat +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml + BASENAME tablet-unstable-v2 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/dde-shell.xml - BASENAME dde-shell +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-data-control-unstable-v1.xml + BASENAME wlr-data-control-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/strut.xml - BASENAME strut +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-layer-shell-unstable-v1.xml + BASENAME wlr-layer-shell-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/xwayland-keyboard-grab-unstable-v1.xml - BASENAME xwayland-keyboard-grab-v1 +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml + BASENAME keyboard-shortcuts-inhibit-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/linux-dmabuf-unstable-v1.xml - BASENAME linux-dmabuf-unstable-v1 +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml + BASENAME viewporter ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/wp-primary-selection-unstable-v1.xml +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/primary-selection/primary-selection-unstable-v1.xml BASENAME wp-primary-selection-unstable-v1 ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${KWayland_SOURCE_DIR}/src/client/protocols/wlr-data-control-unstable-v1.xml - BASENAME wlr-data-control-unstable-v1 +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/screencast.xml + BASENAME zkde-screencast-unstable-v1 ) -set(SERVER_GENERATED_SRCS - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-management-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-management-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-org_kde_kwin_outputdevice-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-org_kde_kwin_outputdevice-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-virtual-desktop-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-virtual-desktop-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-window-management-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-window-management-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-qt-surface-extension-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-qt-surface-extension-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-fake-input-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-fake-input-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-shadow-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-shadow-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dpms-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dpms-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-blur-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-blur-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-screencast-unstable-v1.h - ${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-screencast-unstable-v1.cpp - ${CMAKE_CURRENT_BINARY_DIR}/wayland-contrast-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-contrast-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-relativepointer-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-relativepointer-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-slide-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-slide-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-server_decoration-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-server_decoration-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-server_decoration_palette-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-server_decoration_palette-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-input-unstable-v2-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-text-input-unstable-v2-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-shell-v6-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-shell-v6-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-shell-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-pointer-gestures-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-pointer-gestures-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-pointer-constraints-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-pointer-constraints-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-foreign-unstable-v2-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-foreign-unstable-v2-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-inhibit-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-inhibit-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-unstable-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-decoration-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xdg-decoration-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-client-management-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-client-management-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-seat-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-seat-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-shell-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-dde-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-strut-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-strut-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xwayland-keyboard-grab-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-xwayland-keyboard-grab-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-linux-dmabuf-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-wp-primary-selection-unstable-v1-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-wlr-data-control-unstable-v1-protocol.h +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/client-management.xml + BASENAME com-deepin-client-management ) -set_source_files_properties(${SERVER_GENERATED_SRCS} PROPERTIES SKIP_AUTOMOC ON) +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml + BASENAME input-method-unstable-v1 +) -add_library(KF5WaylandServer ${SERVER_LIB_SRCS}) -generate_export_header(KF5WaylandServer +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml + BASENAME xdg-activation-v1 +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${WaylandProtocols_DATADIR}/staging/drm-lease/drm-lease-v1.xml + BASENAME drm-lease-v1 +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-seat.xml + BASENAME dde-seat +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-shell.xml + BASENAME dde-shell +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/dde-globalproperty.xml + BASENAME dde-globalproperty +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/strut.xml + BASENAME strut +) + +ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS + PROTOCOL ${DEEPIN_WAYLAND_PROTOCOLS_DIR}/remote-access.xml + BASENAME remote-access +) + +add_library(DWaylandServer ${SERVER_LIB_SRCS}) + +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + target_sources(DWaylandServer PRIVATE utils/executable_path_proc.cpp) +elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + target_sources(DWaylandServer PRIVATE utils/executable_path_sysctl.cpp) +else() + message(FATAL_ERROR "Unsupported platform ${CMAKE_SYSTEM_NAME}") +endif() + + +add_library(Deepin::DWaylandServer ALIAS DWaylandServer) +ecm_generate_export_header(DWaylandServer BASE_NAME KWaylandServer EXPORT_FILE_NAME - KWayland/Server/kwaylandserver_export.h + DWayland/Server/kwaylandserver_export.h + GROUP_BASE_NAME KF + VERSION ${PROJECT_VERSION} ) +target_include_directories(DWaylandServer INTERFACE "$/DWayland/Server") -add_library(KF5::WaylandServer ALIAS KF5WaylandServer) - -target_include_directories(KF5WaylandServer INTERFACE "$") - -target_link_libraries(KF5WaylandServer - PUBLIC Qt5::Gui - PRIVATE +target_link_libraries(DWaylandServer + PUBLIC + Qt::Gui Wayland::Server + PRIVATE EGL::EGL - Qt5::Concurrent + Qt::Concurrent ) -set_target_properties(KF5WaylandServer PROPERTIES VERSION ${KWAYLAND_VERSION_STRING} - SOVERSION ${KWAYLAND_SOVERSION} - EXPORT_NAME WaylandServer +target_compile_definitions(DWaylandServer PRIVATE + MESA_EGL_NO_X11_HEADERS + EGL_NO_X11 + EGL_NO_PLATFORM_SPECIFIC_TYPES ) -install(TARGETS KF5WaylandServer EXPORT KF5WaylandTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) +set_target_properties(DWaylandServer PROPERTIES VERSION ${DWAYLAND_VERSION} + SOVERSION ${DWAYLAND_SOVERSION} +) + +install(TARGETS DWaylandServer EXPORT DWaylandServerTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) set(SERVER_LIB_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/KWayland/Server/kwaylandserver_export.h + ${CMAKE_CURRENT_BINARY_DIR}/DWayland/Server/kwaylandserver_export.h abstract_data_source.h + abstract_drop_handler.h appmenu_interface.h blur_interface.h - screencast_interface.h - contrast_interface.h - buffer_interface.h + clientbuffer.h + clientbufferintegration.h clientconnection.h clientmanagement_interface.h compositor_interface.h - datacontroldevice_interface.h - datacontroldevicemanager_interface.h - datacontroloffer_interface.h - datacontrolsource_interface.h + contrast_interface.h + datacontroldevice_v1_interface.h + datacontroldevicemanager_v1_interface.h + datacontroloffer_v1_interface.h + datacontrolsource_v1_interface.h datadevice_interface.h datadevicemanager_interface.h dataoffer_interface.h @@ -389,60 +389,66 @@ ddeshell_interface.h display.h dpms_interface.h - filtered_display.h + drmclientbuffer.h + drmleasedevice_v1_interface.h fakeinput_interface.h - global.h + filtered_display.h idle_interface.h - idleinhibit_interface.h + idleinhibit_v1_interface.h + inputmethod_v1_interface.h keyboard_interface.h - remote_access_interface.h - outputdevice_interface.h - outputchangeset.h - outputconfiguration_interface.h - outputmanagement_interface.h + keyboard_shortcuts_inhibit_v1_interface.h + keystate_interface.h + layershell_v1_interface.h + linuxdmabufv1clientbuffer.h output_interface.h + outputchangeset_v2.h + outputconfiguration_v2_interface.h + outputdevice_v2_interface.h + outputmanagement_v2_interface.h + plasmashell_interface.h + plasmavirtualdesktop_interface.h + plasmawindowmanagement_interface.h pointer_interface.h - pointerconstraints_interface.h - pointergestures_interface.h + pointerconstraints_v1_interface.h + pointergestures_v1_interface.h + primaryoutput_v1_interface.h + primaryselectiondevice_v1_interface.h primaryselectiondevicemanager_v1_interface.h primaryselectionoffer_v1_interface.h - primaryselectiondevice_v1_interface.h primaryselectionsource_v1_interface.h - plasmashell_interface.h - plasmavirtualdesktop_interface.h - plasmawindowmanagement_interface.h - qtsurfaceextension_interface.h - region_interface.h - relativepointer_interface.h - resource.h + relativepointer_v1_interface.h + screencast_v1_interface.h seat_interface.h server_decoration_interface.h server_decoration_palette_interface.h shadow_interface.h - shell_interface.h + shmclientbuffer.h slide_interface.h strut_interface.h - xwayland_keyboard_grab_v1_interface.h subcompositor_interface.h surface_interface.h - textinput_interface.h + tablet_v2_interface.h + textinput.h + textinput_v2_interface.h + textinput_v3_interface.h touch_interface.h - xdgdecoration_interface.h + utils.h + viewporter_interface.h + xdgactivation_v1_interface.h + xdgdecoration_v1_interface.h + xdgforeign_v2_interface.h + xdgoutput_v1_interface.h xdgshell_interface.h - xdgforeign_interface.h - xdgoutput_interface.h - linuxdmabuf_v1_interface.h + globalproperty_interface.h + remote_access_interface.h ) install(FILES ${SERVER_LIB_HEADERS} - DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KWayland/Server COMPONENT Devel + DESTINATION ${KDE_INSTALL_INCLUDEDIR}/DWayland/Server COMPONENT Devel ) # make available to ecm_add_qch in parent folder -set(KWaylandServer_APIDOX_SRCS ${SERVER_LIB_HEADERS} PARENT_SCOPE) - -include(ECMGeneratePriFile) -ecm_generate_pri_file(BASE_NAME KWaylandServer LIB_NAME KF5WaylandServer DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}) -install(FILES ${PRI_FILENAME} - DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) +set(DWaylandServer_APIDOX_SRCS ${SERVER_LIB_HEADERS} PARENT_SCOPE) +set(DWaylandServer_APIDOX_BUILD_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) diff -Nru dwayland-5.57.0.23/src/server/compositor_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/compositor_interface.cpp --- dwayland-5.57.0.23/src/server/compositor_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/compositor_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,129 +1,73 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "compositor_interface.h" #include "display.h" -#include "global_p.h" +#include "region_interface_p.h" #include "surface_interface.h" -// Wayland -#include -namespace KWayland -{ -namespace Server +#include "qwayland-server-wayland.h" + +namespace KWaylandServer { +static const int s_version = 4; -class CompositorInterface::Private : public Global::Private +class CompositorInterfacePrivate : public QtWaylandServer::wl_compositor { public: - Private(CompositorInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createSurface(wl_client *client, wl_resource *resource, uint32_t id); - void createRegion(wl_client *client, wl_resource *resource, uint32_t id); - - static void unbind(wl_resource *resource); - static void createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void createRegionCallback(wl_client *client, wl_resource *resource, uint32_t id); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } + CompositorInterfacePrivate(CompositorInterface *q, Display *display); CompositorInterface *q; - static const struct wl_compositor_interface s_interface; - static const quint32 s_version; -}; - -const quint32 CompositorInterface::Private::s_version = 3; + Display *display; -CompositorInterface::Private::Private(CompositorInterface *q, Display *d) - : Global::Private(d, &wl_compositor_interface, s_version) - , q(q) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_compositor_interface CompositorInterface::Private::s_interface = { - createSurfaceCallback, - createRegionCallback +protected: + void compositor_create_surface(Resource *resource, uint32_t id) override; + void compositor_create_region(Resource *resource, uint32_t id) override; }; -#endif -CompositorInterface::CompositorInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +CompositorInterfacePrivate::CompositorInterfacePrivate(CompositorInterface *q, Display *display) + : QtWaylandServer::wl_compositor(*display, s_version) + , q(q) + , display(display) { } -CompositorInterface::~CompositorInterface() = default; - -void CompositorInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void CompositorInterfacePrivate::compositor_create_surface(Resource *resource, uint32_t id) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&wl_compositor_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); + wl_resource *surfaceResource = wl_resource_create(resource->client(), &wl_surface_interface, resource->version(), id); + if (!surfaceResource) { + wl_resource_post_no_memory(resource->handle); return; } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? + Q_EMIT q->surfaceCreated(new SurfaceInterface(q, surfaceResource)); } -void CompositorInterface::Private::unbind(wl_resource *resource) +void CompositorInterfacePrivate::compositor_create_region(Resource *resource, uint32_t id) { - Q_UNUSED(resource) - // TODO: implement? -} - -void CompositorInterface::Private::createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->createSurface(client, resource, id); -} - -void CompositorInterface::Private::createSurface(wl_client *client, wl_resource *resource, uint32_t id) -{ - SurfaceInterface *surface = new SurfaceInterface(q, resource); - surface->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!surface->resource()) { - wl_resource_post_no_memory(resource); - delete surface; + wl_resource *regionResource = wl_resource_create(resource->client(), &wl_region_interface, resource->version(), id); + if (!regionResource) { + wl_resource_post_no_memory(resource->handle); return; } - emit q->surfaceCreated(surface); + new RegionInterface(regionResource); } -void CompositorInterface::Private::createRegionCallback(wl_client *client, wl_resource *resource, uint32_t id) +CompositorInterface::CompositorInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new CompositorInterfacePrivate(this, display)) { - cast(resource)->createRegion(client, resource, id); } -void CompositorInterface::Private::createRegion(wl_client *client, wl_resource *resource, uint32_t id) +CompositorInterface::~CompositorInterface() { - RegionInterface *region = new RegionInterface(q, resource); - region->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!region->resource()) { - wl_resource_post_no_memory(resource); - delete region; - return; - } - emit q->regionCreated(region); } +Display *CompositorInterface::display() const +{ + return d->display; } -} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/compositor_interface.h dwayland-5.57.0.24+really5.24.3/src/server/compositor_interface.h --- dwayland-5.57.0.23/src/server/compositor_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/compositor_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,68 +1,48 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_COMPOSITOR_INTERFACE_H -#define WAYLAND_SERVER_COMPOSITOR_INTERFACE_H - -#include "global.h" -#include "region_interface.h" #include "surface_interface.h" #include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - +class CompositorInterfacePrivate; class Display; -class SurfaceInterface; /** - * @brief Represents the Global for wl_compositor interface. + * The CompositorInterface global allows clients to create surfaces and region objects. * - **/ -class KWAYLANDSERVER_EXPORT CompositorInterface : public Global + * The CompositorInterface corresponds to the Wayland interface @c wl_compositor. + */ +class KWAYLANDSERVER_EXPORT CompositorInterface : public QObject { Q_OBJECT + public: - virtual ~CompositorInterface(); + explicit CompositorInterface(Display *display, QObject *parent = nullptr); + ~CompositorInterface() override; -Q_SIGNALS: /** - * Emitted whenever this CompositorInterface created a SurfaceInterface. - **/ - void surfaceCreated(KWayland::Server::SurfaceInterface*); + * Returns the Display object for this CompositorInterface. + */ + Display *display() const; + +Q_SIGNALS: /** - * Emitted whenever this CompositorInterface created a RegionInterface. - **/ - void regionCreated(KWayland::Server::RegionInterface*); + * This signal is emitted when a new SurfaceInterface @a surface has been created. + */ + void surfaceCreated(KWaylandServer::SurfaceInterface *surface); private: - explicit CompositorInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; -} -} - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/contrast_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/contrast_interface.cpp --- dwayland-5.57.0.23/src/server/contrast_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/contrast_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,144 +1,92 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "contrast_interface.h" -#include "region_interface.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" +#include "region_interface_p.h" #include "surface_interface_p.h" -#include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 2; -class ContrastManagerInterface::Private : public Global::Private +class ContrastManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_contrast_manager { public: - Private(ContrastManagerInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createContrast(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - static void unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface); - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - auto contrastManager = reinterpret_cast*>(wl_resource_get_user_data(r))->data(); - if (contrastManager) { - return static_cast(contrastManager->d.data()); - } - return nullptr; - } + ContrastManagerInterfacePrivate(ContrastManagerInterface *q, Display *display); ContrastManagerInterface *q; - static const struct org_kde_kwin_contrast_manager_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ContrastManagerInterface::Private::s_version = 1; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_contrast_manager_interface ContrastManagerInterface::Private::s_interface = { - createCallback, - unsetCallback +protected: + void org_kde_kwin_contrast_manager_destroy_global() override; + void org_kde_kwin_contrast_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; + void org_kde_kwin_contrast_manager_unset(Resource *resource, wl_resource *surface) override; }; -#endif -ContrastManagerInterface::Private::Private(ContrastManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_contrast_manager_interface, s_version) +ContrastManagerInterfacePrivate::ContrastManagerInterfacePrivate(ContrastManagerInterface *q, Display *display) + : QtWaylandServer::org_kde_kwin_contrast_manager(*display, s_version) , q(q) { } -void ContrastManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_contrast_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - auto ref = new QPointer(q);//deleted in unbind - wl_resource_set_implementation(resource, &s_interface, ref, unbind); -} - -void ContrastManagerInterface::Private::unbind(wl_resource *resource) -{ - delete reinterpret_cast*>(wl_resource_get_user_data(resource)); -} - -void ContrastManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void ContrastManagerInterfacePrivate::org_kde_kwin_contrast_manager_destroy_global() { - auto m = cast(resource); - if (!m) { - return;// will happen if global is deleted - } - m->createContrast(client, resource, id, surface); + delete q; } -void ContrastManagerInterface::Private::createContrast(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void ContrastManagerInterfacePrivate::org_kde_kwin_contrast_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - ContrastInterface *contrast = new ContrastInterface(q, resource); - contrast->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!contrast->resource()) { - wl_resource_post_no_memory(resource); - delete contrast; + wl_resource *contrast_resource = wl_resource_create(resource->client(), &org_kde_kwin_contrast_interface, resource->version(), id); + if (!contrast_resource) { + wl_client_post_no_memory(resource->client()); return; } - s->d_func()->setContrast(QPointer(contrast)); + auto contrast = new ContrastInterface(contrast_resource); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setContrast(contrast); } -void ContrastManagerInterface::Private::unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface) +void ContrastManagerInterfacePrivate::org_kde_kwin_contrast_manager_unset(Resource *resource, wl_resource *surface) { - Q_UNUSED(client) - Q_UNUSED(resource) SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - s->d_func()->setContrast(QPointer()); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setContrast(QPointer()); } ContrastManagerInterface::ContrastManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new ContrastManagerInterfacePrivate(this, display)) { } -ContrastManagerInterface::~ContrastManagerInterface() = default; +ContrastManagerInterface::~ContrastManagerInterface() +{ +} -class ContrastInterface::Private : public Resource::Private +void ContrastManagerInterface::remove() +{ + d->globalRemove(); +} + +class ContrastInterfacePrivate : public QtWaylandServer::org_kde_kwin_contrast { public: - Private(ContrastInterface *q, ContrastManagerInterface *c, wl_resource *parentResource); - ~Private(); + ContrastInterfacePrivate(ContrastInterface *_q, wl_resource *resource); QRegion pendingRegion; QRegion currentRegion; @@ -148,90 +96,95 @@ qreal currentIntensity; qreal pendingSaturation; qreal currentSaturation; - -private: - void commit(); - //TODO - ContrastInterface *q_func() { - return reinterpret_cast(q); - } - - static void commitCallback(wl_client *client, wl_resource *resource); - static void setRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region); - static void setContrastCallback(wl_client *client, wl_resource *resource, wl_fixed_t contrast); - static void setIntensityCallback(wl_client *client, wl_resource *resource, wl_fixed_t intensity); - static void setSaturationCallback(wl_client *client, wl_resource *resource, wl_fixed_t saturation); - - static const struct org_kde_kwin_contrast_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_contrast_interface ContrastInterface::Private::s_interface = { - commitCallback, - setRegionCallback, - setContrastCallback, - setIntensityCallback, - setSaturationCallback, - resourceDestroyedCallback + QColor currentFrost; + QColor pendingFrost; + ContrastInterface *q; + +protected: + void org_kde_kwin_contrast_commit(Resource *resource) override; + void org_kde_kwin_contrast_set_region(Resource *resource, wl_resource *region) override; + void org_kde_kwin_contrast_set_contrast(Resource *resource, wl_fixed_t contrast) override; + void org_kde_kwin_contrast_set_intensity(Resource *resource, wl_fixed_t intensity) override; + void org_kde_kwin_contrast_set_saturation(Resource *resource, wl_fixed_t saturation) override; + void org_kde_kwin_contrast_set_frost(Resource *resource, int r, int g, int b, int a) override; + void org_kde_kwin_contrast_unset_frost(Resource *resource) override; + void org_kde_kwin_contrast_release(Resource *resource) override; + void org_kde_kwin_contrast_destroy_resource(Resource *resource) override; }; -#endif - -void ContrastInterface::Private::commitCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - cast(resource)->commit(); -} -void ContrastInterface::Private::commit() +void ContrastInterfacePrivate::org_kde_kwin_contrast_commit(Resource *resource) { + Q_UNUSED(resource) currentRegion = pendingRegion; currentContrast = pendingContrast; currentIntensity = pendingIntensity; currentSaturation = pendingSaturation; + currentFrost = pendingFrost; } -void ContrastInterface::Private::setRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region) +void ContrastInterfacePrivate::org_kde_kwin_contrast_set_region(Resource *resource, wl_resource *region) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); if (r) { - p->pendingRegion = r->region(); + pendingRegion = r->region(); } else { - p->pendingRegion = QRegion(); + pendingRegion = QRegion(); } } -void ContrastInterface::Private::setContrastCallback(wl_client *client, wl_resource *resource, wl_fixed_t contrast) +void ContrastInterfacePrivate::org_kde_kwin_contrast_set_contrast(Resource *resource, wl_fixed_t contrast) +{ + Q_UNUSED(resource) + pendingContrast = wl_fixed_to_double(contrast); +} + +void ContrastInterfacePrivate::org_kde_kwin_contrast_set_intensity(Resource *resource, wl_fixed_t intensity) +{ + Q_UNUSED(resource) + pendingIntensity = wl_fixed_to_double(intensity); +} + +void ContrastInterfacePrivate::org_kde_kwin_contrast_set_saturation(Resource *resource, wl_fixed_t saturation) { - Q_UNUSED(client) - Private *p = cast(resource); - p->pendingContrast = wl_fixed_to_double(contrast); + Q_UNUSED(resource) + pendingSaturation = wl_fixed_to_double(saturation); } -void ContrastInterface::Private::setIntensityCallback(wl_client *client, wl_resource *resource, wl_fixed_t intensity) +void ContrastInterfacePrivate::org_kde_kwin_contrast_set_frost(Resource *resource, int r, int g, int b, int a) { - Q_UNUSED(client) - Private *p = cast(resource); - p->pendingIntensity = wl_fixed_to_double(intensity); + Q_UNUSED(resource) + + pendingFrost = QColor(r, g, b, a); } -void ContrastInterface::Private::setSaturationCallback(wl_client *client, wl_resource *resource, wl_fixed_t saturation) +void ContrastInterfacePrivate::org_kde_kwin_contrast_unset_frost(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - p->pendingSaturation = wl_fixed_to_double(saturation); + Q_UNUSED(resource) + + pendingFrost = {}; } -ContrastInterface::Private::Private(ContrastInterface *q, ContrastManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_contrast_interface, &s_interface) +void ContrastInterfacePrivate::org_kde_kwin_contrast_release(Resource *resource) { + wl_resource_destroy(resource->handle); } -ContrastInterface::Private::~Private() = default; +void ContrastInterfacePrivate::org_kde_kwin_contrast_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +ContrastInterfacePrivate::ContrastInterfacePrivate(ContrastInterface *_q, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_contrast(resource) + , q(_q) +{ +} -ContrastInterface::ContrastInterface(ContrastManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +ContrastInterface::ContrastInterface(wl_resource *resource) + : QObject() + , d(new ContrastInterfacePrivate(this, resource)) { } @@ -239,32 +192,27 @@ QRegion ContrastInterface::region() const { - Q_D(); return d->currentRegion; } qreal ContrastInterface::contrast() const { - Q_D(); return d->currentContrast; } qreal ContrastInterface::intensity() const { - Q_D(); return d->currentIntensity; } qreal ContrastInterface::saturation() const { - Q_D(); return d->currentSaturation; } -ContrastInterface::Private *ContrastInterface::d_func() const +QColor ContrastInterface::frost() const { - return reinterpret_cast(d.data()); + return d->currentFrost; } } -} diff -Nru dwayland-5.57.0.23/src/server/contrast_interface.h dwayland-5.57.0.24+really5.24.3/src/server/contrast_interface.h --- dwayland-5.57.0.23/src/server/contrast_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/contrast_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,39 +1,25 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin -Copyright 2015 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_CONTRAST_INTERFACE_H -#define KWAYLAND_SERVER_CONTRAST_INTERFACE_H +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Marco Martin -#include "global.h" -#include "resource.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once +#include + +#include #include -#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ class Display; +class ContrastManagerInterfacePrivate; +class ContrastInterfacePrivate; /** * @brief Represents the Global for org_kde_kwin_contrast_manager interface. @@ -42,18 +28,19 @@ * * @see ContrastInterface * @see SurfaceInterface - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT ContrastManagerInterface : public Global + */ +class KWAYLANDSERVER_EXPORT ContrastManagerInterface : public QObject { Q_OBJECT + public: - virtual ~ContrastManagerInterface(); + explicit ContrastManagerInterface(Display *display, QObject *parent = nullptr); + ~ContrastManagerInterface() override; + + void remove(); private: - explicit ContrastManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; /** @@ -67,28 +54,24 @@ * * @see ContrastManagerInterface * @see SurfaceInterface - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT ContrastInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT ContrastInterface : public QObject { Q_OBJECT public: - virtual ~ContrastInterface(); + ~ContrastInterface() override; QRegion region() const; qreal contrast() const; qreal intensity() const; qreal saturation() const; + QColor frost() const; private: - explicit ContrastInterface(ContrastManagerInterface *parent, wl_resource *parentResource); - friend class ContrastManagerInterface; + explicit ContrastInterface(wl_resource *resource); + friend class ContrastManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/datacontroldevice_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroldevice_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#include "datacontroldevice_interface.h" -#include "datacontroldevicemanager_interface.h" -#include "datacontroloffer_interface.h" -#include "display.h" -#include "resource_p.h" -#include "pointer_interface.h" -#include "seat_interface.h" -#include "surface_interface.h" -// Wayland -#include - -namespace KWayland -{ -namespace Server -{ - -class DataControlDeviceV1Interface::Private : public Resource::Private -{ -public: - Private(SeatInterface *seat, DataControlDeviceV1Interface *q, DataControlDeviceManagerInterface *manager, wl_resource *parentResource); - ~Private(); - - DataControlOfferV1Interface *createDataOffer(AbstractDataSource *source); - - SeatInterface *seat; - DataControlSourceV1Interface *select = nullptr; - DataControlSourceV1Interface *primarySelection = nullptr; - QMetaObject::Connection selectionUnboundConnection; - QMetaObject::Connection selectionDestroyedConnection; - -private: - DataControlDeviceV1Interface *q_func() { - return reinterpret_cast(q); - } - void setSelection(DataControlSourceV1Interface *dataSource); - void setPrimarySelection(DataControlSourceV1Interface *dataSource); - void destroy(DataControlSourceV1Interface *dataSource); - - static void setSelectionCallback(struct wl_client *client,struct wl_resource *resource,struct wl_resource *source); - static void destroyCallback(struct wl_client *client,struct wl_resource *resource); - static void setPrimarySelectionCallback(struct wl_client *client, struct wl_resource *resource, struct wl_resource *source); - - static const struct zwlr_data_control_device_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwlr_data_control_device_v1_interface DataControlDeviceV1Interface::Private::s_interface = { - setSelectionCallback, - resourceDestroyedCallback, - setPrimarySelectionCallback -}; -#endif - -DataControlDeviceV1Interface::Private::Private(SeatInterface *seat, DataControlDeviceV1Interface *q, DataControlDeviceManagerInterface *manager, wl_resource *parentResource) - : Resource::Private(q, manager, parentResource, &zwlr_data_control_device_v1_interface, &s_interface) - , seat(seat) -{ -} - -DataControlDeviceV1Interface::Private::~Private() = default; - - - -void DataControlDeviceV1Interface::Private::setSelectionCallback(struct wl_client *client,struct wl_resource *resource,struct wl_resource *source) -{ - Q_UNUSED(client) - // TODO: verify serial - cast(resource)->setSelection(DataControlSourceV1Interface::get(source)); -} - -void DataControlDeviceV1Interface::Private::setPrimarySelectionCallback(struct wl_client *client,struct wl_resource *resource,struct wl_resource *source) -{ - Q_UNUSED(client) - // TODO: verify serial - cast(resource)->setPrimarySelection(DataControlSourceV1Interface::get(source)); -} - -void DataControlDeviceV1Interface::Private::setSelection(DataControlSourceV1Interface *dataSource) -{ - if (dataSource && (dataSource == seat->selection() || dataSource == seat->primarySelection())) { - return; - } - if (select == dataSource) { - return; - } - Q_Q(DataControlDeviceV1Interface); - QObject::disconnect(selectionUnboundConnection); - QObject::disconnect(selectionDestroyedConnection); - if (select) { - select->cancel(); - } - select = dataSource; - if (select) { - auto clearSelection = [this] { - setSelection(nullptr); - }; - selectionUnboundConnection = QObject::connect(select, &Resource::unbound, q, clearSelection); - selectionDestroyedConnection = QObject::connect(select, &QObject::destroyed, q, clearSelection); - emit q->selectionChanged(select); - } else { - selectionUnboundConnection = QMetaObject::Connection(); - selectionDestroyedConnection = QMetaObject::Connection(); - emit q->selectionCleared(); - } -} - -void DataControlDeviceV1Interface::Private::setPrimarySelection(DataControlSourceV1Interface *dataSource) -{ - Q_ASSERT(dataSource); - if (dataSource) { - if (dataSource == seat->selection() || dataSource == seat->primarySelection()) { - //thx wl_resource_post_error(resource->handle, error::error_used_source, "source given to set_primary_selection was already used before"); - return; - } - } - if (primarySelection) { - primarySelection->cancel(); - } - primarySelection = dataSource; - emit q_func()->primarySelectionChanged(primarySelection); -} - -DataControlOfferV1Interface *DataControlDeviceV1Interface::Private::createDataOffer(AbstractDataSource *source) -{ - if (!source) { - // a data offer can only exist together with a source - return nullptr; - } - - if (!resource) { - return nullptr; - } - - DataControlOfferV1Interface *offer = new DataControlOfferV1Interface(source ,q_func(), resource); - auto c = q->global()->display()->getConnection(wl_resource_get_client(resource)); - offer->create(c, wl_resource_get_version(resource), 0); - if (!offer->resource()) { - // TODO: send error? - delete offer; - return nullptr; - } - zwlr_data_control_device_v1_send_data_offer(resource ,offer->resource()); - offer->sendAllOffers(); - return offer; - -} - -DataControlDeviceV1Interface::DataControlDeviceV1Interface(SeatInterface *seat, DataControlDeviceManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(seat, this, parent, parentResource)) -{ -} - -DataControlDeviceV1Interface::~DataControlDeviceV1Interface() = default; - -SeatInterface *DataControlDeviceV1Interface::seat() const -{ - Q_D(); - return d->seat; -} - -DataControlSourceV1Interface *DataControlDeviceV1Interface::selection() const -{ - Q_D(); - return d->select; -} - -DataControlSourceV1Interface *DataControlDeviceV1Interface::primarySelection() const -{ - Q_D(); - return d->primarySelection; -} - -void DataControlDeviceV1Interface::sendSelection(AbstractDataSource *other) -{ - Q_D(); - if (!other) { - sendClearSelection(); - return; - } - DataControlOfferV1Interface *offer = d->createDataOffer(other); - if (!offer) { - return; - } - zwlr_data_control_device_v1_send_selection(d->resource, offer->resource()); - -} - -void DataControlDeviceV1Interface::sendClearSelection() -{ - zwlr_data_control_device_v1_send_selection(d->resource,nullptr); -} - -void DataControlDeviceV1Interface::sendPrimarySelection(AbstractDataSource *other) -{ - Q_D(); - if (!other) { - sendClearSelection(); - return; - } - DataControlOfferV1Interface *offer = d->createDataOffer(other); - if (!offer) { - return; - } - zwlr_data_control_device_v1_send_primary_selection(d->resource, offer->resource()); -} - -void DataControlDeviceV1Interface::sendClearPrimarySelection() -{ - zwlr_data_control_device_v1_send_primary_selection(d->resource,nullptr); -} - -DataControlDeviceV1Interface::Private *DataControlDeviceV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/datacontroldevice_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_interface.h --- dwayland-5.57.0.23/src/server/datacontroldevice_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#ifndef WAYLAND_SERVER_DATA_CONTROL_DEVICE_INTERFACE_H -#define WAYLAND_SERVER_DATA_CONTROL_DEVICE_INTERFACE_H - -#include - -#include - -#include "resource.h" -#include "datacontrolsource_interface.h" - -namespace KWayland -{ -namespace Server -{ - -class DataControlDeviceManagerInterface; -class DataControlOfferV1Interface; -class DataControlSourceV1Interface; -class SeatInterface; -class SurfaceInterface; -class PrimarySelectionSourceV1Interface; -class DataSourceInterface; -/** - * @brief Represents the Resource for the wl_data_device interface. - * - * @see SeatInterface - * @see DataSourceInterface - **/ -class KWAYLANDSERVER_EXPORT DataControlDeviceV1Interface : public Resource -{ - Q_OBJECT -public: - virtual ~DataControlDeviceV1Interface(); - - SeatInterface *seat() const; - - DataControlSourceV1Interface *selection() const; - DataControlSourceV1Interface *primarySelection() const; - - void sendSelection(AbstractDataSource *other); - void sendClearSelection(); - - void sendPrimarySelection(AbstractDataSource *other); - void sendClearPrimarySelection(); - -Q_SIGNALS: - void selectionChanged(KWayland::Server::DataControlSourceV1Interface *dataSource); - void selectionCleared(); - void primarySelectionChanged(KWayland::Server::DataControlSourceV1Interface *dataSource); - -private: - friend class DataControlDeviceManagerInterface; - explicit DataControlDeviceV1Interface(SeatInterface *seat, DataControlDeviceManagerInterface *parent, wl_resource *parentResource); - - class Private; - Private *d_func() const; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::DataControlDeviceV1Interface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/datacontroldevicemanager_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroldevicemanager_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#include "datacontroldevicemanager_interface.h" -#include "datacontroldevice_interface.h" -#include "datacontrolsource_interface.h" - -#include "global_p.h" -#include "display.h" -#include "seat_interface_p.h" -// Wayland -#include - -namespace KWayland -{ -namespace Server -{ - -class DataControlDeviceManagerInterface::Private : public Global::Private -{ -public: - Private(DataControlDeviceManagerInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createDataSource(wl_client *client, wl_resource *resource, uint32_t id); - void getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - - static void unbind(wl_resource *resource); - static void createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - DataControlDeviceManagerInterface *q; - static const struct zwlr_data_control_manager_v1_interface s_interface; - static const quint32 s_version; - static const qint32 s_dataDeviceVersion; - static const qint32 s_dataSourceVersion; -}; - -const quint32 DataControlDeviceManagerInterface::Private::s_version = 1; -const qint32 DataControlDeviceManagerInterface::Private::s_dataDeviceVersion = 1; -const qint32 DataControlDeviceManagerInterface::Private::s_dataSourceVersion = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwlr_data_control_manager_v1_interface DataControlDeviceManagerInterface::Private::s_interface = { - createDataSourceCallback, - getDataDeviceCallback, -}; -#endif - -DataControlDeviceManagerInterface::Private::Private(DataControlDeviceManagerInterface *q, Display *d) - : Global::Private(d, &zwlr_data_control_manager_v1_interface, s_version) - , q(q) -{ -} - -void DataControlDeviceManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwlr_data_control_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void DataControlDeviceManagerInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -void DataControlDeviceManagerInterface::Private::createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->createDataSource(client, resource, id); -} - -void DataControlDeviceManagerInterface::Private::createDataSource(wl_client *client, wl_resource *resource, uint32_t id) -{ - DataControlSourceV1Interface *dataSource = new DataControlSourceV1Interface(q, resource); - dataSource->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataSourceVersion) , id); - if (!dataSource->resource()) { - wl_resource_post_no_memory(resource); - delete dataSource; - return; - } - emit q->dataSourceCreated(dataSource); -} - -void DataControlDeviceManagerInterface::Private::getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) -{ - cast(resource)->getDataDevice(client, resource, id, seat); -} - -void DataControlDeviceManagerInterface::Private::getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) -{ - SeatInterface *s = SeatInterface::get(seat); - Q_ASSERT(s); - DataControlDeviceV1Interface *dataDevice = new DataControlDeviceV1Interface(s, q, resource); - dataDevice->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataDeviceVersion), id); - if (!dataDevice->resource()) { - wl_resource_post_no_memory(resource); - return; - } - s->d_func()->registerDataControlDevice(dataDevice); - emit q->dataDeviceCreated(dataDevice); -} - -DataControlDeviceManagerInterface::DataControlDeviceManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -DataControlDeviceManagerInterface::~DataControlDeviceManagerInterface() = default; - -} -} diff -Nru dwayland-5.57.0.23/src/server/datacontroldevicemanager_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_interface.h --- dwayland-5.57.0.23/src/server/datacontroldevicemanager_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#ifndef WAYLAND_SERVER_DATA_CONTROL_DEVICE_MANAGER_INTERFACE_H -#define WAYLAND_SERVER_DATA_CONTROL_DEVICE_MANAGER_INTERFACE_H - -#include - -#include -#include "global.h" - - -namespace KWayland -{ -namespace Server -{ - -class Display; -class DataControlSourceV1Interface; -class DataControlDeviceManagerInterfacePrivate; -class DataControlDeviceV1Interface; - - -/** - * @brief Represents the Global for zwlr_data_control_manager_v1 interface. - * - **/ -class KWAYLANDSERVER_EXPORT DataControlDeviceManagerInterface : public Global -{ - Q_OBJECT -public: - ~DataControlDeviceManagerInterface() override; - -Q_SIGNALS: - void dataSourceCreated(KWayland::Server::DataControlSourceV1Interface *dataSource); - void dataDeviceCreated(KWayland::Server::DataControlDeviceV1Interface *dataDevice); - -private: - explicit DataControlDeviceManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/datacontroldevicemanager_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_v1_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroldevicemanager_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,78 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "datacontroldevicemanager_v1_interface.h" +#include "datacontroldevice_v1_interface.h" +#include "datacontrolsource_v1_interface.h" +#include "display.h" +#include "seat_interface_p.h" +// Wayland +#include + +static const int s_version = 2; +namespace KWaylandServer +{ +class DataControlDeviceManagerV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_manager_v1 +{ +public: + DataControlDeviceManagerV1InterfacePrivate(DataControlDeviceManagerV1Interface *q, Display *d); + + DataControlDeviceManagerV1Interface *q; + +protected: + void zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id) override; + void zwlr_data_control_manager_v1_get_data_device(Resource *resource, uint32_t id, wl_resource *seat) override; + void zwlr_data_control_manager_v1_destroy(Resource *resource) override; +}; + +DataControlDeviceManagerV1InterfacePrivate::DataControlDeviceManagerV1InterfacePrivate(DataControlDeviceManagerV1Interface *q, Display *d) + : QtWaylandServer::zwlr_data_control_manager_v1(*d, s_version) + , q(q) +{ +} + +void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id) +{ + wl_resource *data_source_resource = wl_resource_create(resource->client(), &zwlr_data_control_source_v1_interface, resource->version(), id); + if (!data_source_resource) { + wl_resource_post_no_memory(resource->handle); + return; + } + DataControlSourceV1Interface *dataSource = new DataControlSourceV1Interface(q, data_source_resource); + Q_EMIT q->dataSourceCreated(dataSource); +} + +void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_get_data_device(Resource *resource, uint32_t id, wl_resource *seat) +{ + SeatInterface *s = SeatInterface::get(seat); + Q_ASSERT(s); + if (!s) { + return; + } + + wl_resource *data_device_resource = wl_resource_create(resource->client(), &zwlr_data_control_device_v1_interface, resource->version(), id); + if (!data_device_resource) { + wl_resource_post_no_memory(resource->handle); + return; + } + DataControlDeviceV1Interface *dataDevice = new DataControlDeviceV1Interface(s, data_device_resource); + Q_EMIT q->dataDeviceCreated(dataDevice); +} + +void DataControlDeviceManagerV1InterfacePrivate::zwlr_data_control_manager_v1_destroy(QtWaylandServer::zwlr_data_control_manager_v1::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +DataControlDeviceManagerV1Interface::DataControlDeviceManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new DataControlDeviceManagerV1InterfacePrivate(this, display)) +{ +} + +DataControlDeviceManagerV1Interface::~DataControlDeviceManagerV1Interface() = default; + +} diff -Nru dwayland-5.57.0.23/src/server/datacontroldevicemanager_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_v1_interface.h --- dwayland-5.57.0.23/src/server/datacontroldevicemanager_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevicemanager_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,41 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class DataControlSourceV1Interface; +class DataControlDeviceManagerV1InterfacePrivate; +class DataControlDeviceV1Interface; + +/** + * The DataControlDeviceManagerV1Interface provides a way for privileged clients such as clipboard + * managers to manage the current selection. + * + * DataControlDeviceManagerV1Interface corresponds to the Wayland interface @c zwlr_data_control_manager_v1. + */ +class KWAYLANDSERVER_EXPORT DataControlDeviceManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit DataControlDeviceManagerV1Interface(Display *display, QObject *parent = nullptr); + ~DataControlDeviceManagerV1Interface() override; + +Q_SIGNALS: + void dataSourceCreated(KWaylandServer::DataControlSourceV1Interface *dataSource); + void dataDeviceCreated(KWaylandServer::DataControlDeviceV1Interface *dataDevice); + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/datacontroldevice_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_v1_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroldevice_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,201 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 David Redondo + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "datacontroldevice_v1_interface.h" +#include "datacontroldevicemanager_v1_interface.h" +#include "datacontroloffer_v1_interface.h" +#include "datacontrolsource_v1_interface.h" +#include "display.h" +#include "seat_interface.h" +#include "seat_interface_p.h" +#include "surface_interface.h" + +// Wayland +#include + +namespace KWaylandServer +{ +class DataControlDeviceV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_device_v1 +{ +public: + DataControlDeviceV1InterfacePrivate(DataControlDeviceV1Interface *q, SeatInterface *seat, wl_resource *resource); + + DataControlOfferV1Interface *createDataOffer(AbstractDataSource *source); + + DataControlDeviceV1Interface *q; + QPointer seat; + QPointer selection; + QPointer primarySelection; + QPointer cachedSelection; + +protected: + void zwlr_data_control_device_v1_destroy_resource(Resource *resource) override; + void zwlr_data_control_device_v1_set_selection(Resource *resource, wl_resource *source) override; + void zwlr_data_control_device_v1_set_primary_selection(Resource *resource, struct ::wl_resource *source) override; + void zwlr_data_control_device_v1_destroy(Resource *resource) override; + void zwlr_data_control_device_v1_set_cached_selection(Resource *resource, wl_resource *source) override; +}; + +DataControlDeviceV1InterfacePrivate::DataControlDeviceV1InterfacePrivate(DataControlDeviceV1Interface *_q, SeatInterface *seat, wl_resource *resource) + : QtWaylandServer::zwlr_data_control_device_v1(resource) + , q(_q) + , seat(seat) +{ +} + +void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_set_selection(Resource *resource, wl_resource *source) +{ + DataControlSourceV1Interface *dataSource = nullptr; + + if (source) { + dataSource = DataControlSourceV1Interface::get(source); + Q_ASSERT(dataSource); + if (dataSource == seat->selection() || dataSource == seat->primarySelection()) { + wl_resource_post_error(resource->handle, error::error_used_source, "source given to set_selection was already used before"); + return; + } + } + if (selection) { + selection->cancel(); + } + selection = dataSource; + Q_EMIT q->selectionChanged(selection); +} + +void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_set_cached_selection(Resource *resource, wl_resource *source) +{ + DataControlSourceV1Interface *dataSource = nullptr; + + if (source) { + dataSource = DataControlSourceV1Interface::get(source); + Q_ASSERT(dataSource); + if (dataSource == seat->selection() || dataSource == seat->primarySelection()) { + wl_resource_post_error(resource->handle, error::error_used_source, "source given to set_selection was already used before"); + return; + } + } + if (cachedSelection) { + cachedSelection->cancel(); + } + cachedSelection = dataSource; + Q_EMIT q->cachedSelectionChanged(cachedSelection); +} + +void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_set_primary_selection(Resource *resource, wl_resource *source) +{ + DataControlSourceV1Interface *dataSource = nullptr; + + if (source) { + dataSource = DataControlSourceV1Interface::get(source); + Q_ASSERT(dataSource); + if (dataSource == seat->selection() || dataSource == seat->primarySelection()) { + wl_resource_post_error(resource->handle, error::error_used_source, "source given to set_primary_selection was already used before"); + return; + } + } + if (primarySelection) { + primarySelection->cancel(); + } + primarySelection = dataSource; + Q_EMIT q->primarySelectionChanged(primarySelection); +} + +void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_destroy(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +DataControlOfferV1Interface *DataControlDeviceV1InterfacePrivate::createDataOffer(AbstractDataSource *source) +{ + if (!source) { + // a data offer can only exist together with a source + return nullptr; + } + + wl_resource *data_offer_resource = wl_resource_create(resource()->client(), &zwlr_data_control_offer_v1_interface, resource()->version(), 0); + if (!data_offer_resource) { + return nullptr; + } + + DataControlOfferV1Interface *offer = new DataControlOfferV1Interface(source, data_offer_resource); + send_data_offer(offer->resource()); + offer->sendAllOffers(); + return offer; +} + +void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_destroy_resource(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +DataControlDeviceV1Interface::DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource) + : QObject() + , d(new DataControlDeviceV1InterfacePrivate(this, seat, resource)) +{ + SeatInterfacePrivate *seatPrivate = SeatInterfacePrivate::get(seat); + seatPrivate->registerDataControlDevice(this); +} + +DataControlDeviceV1Interface::~DataControlDeviceV1Interface() = default; + +SeatInterface *DataControlDeviceV1Interface::seat() const +{ + return d->seat; +} + +DataControlSourceV1Interface *DataControlDeviceV1Interface::selection() const +{ + return d->selection; +} + +DataControlSourceV1Interface *DataControlDeviceV1Interface::primarySelection() const +{ + return d->primarySelection; +} + +DataControlSourceV1Interface *DataControlDeviceV1Interface::cachedSelection() const +{ + return d->cachedSelection; +} + +void DataControlDeviceV1Interface::sendSelection(AbstractDataSource *other) +{ + if (!other) { + sendClearSelection(); + return; + } + DataControlOfferV1Interface *offer = d->createDataOffer(other); + if (!offer) { + return; + } + d->send_selection(offer->resource()); +} + +void DataControlDeviceV1Interface::sendClearSelection() +{ + d->send_selection(nullptr); +} + +void DataControlDeviceV1Interface::sendPrimarySelection(KWaylandServer::AbstractDataSource *other) +{ + if (!other) { + sendClearPrimarySelection(); + return; + } + DataControlOfferV1Interface *offer = d->createDataOffer(other); + if (!offer) { + return; + } + d->send_primary_selection(offer->resource()); +} + +void DataControlDeviceV1Interface::sendClearPrimarySelection() +{ + d->send_primary_selection(nullptr); +} + +} diff -Nru dwayland-5.57.0.23/src/server/datacontroldevice_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_v1_interface.h --- dwayland-5.57.0.23/src/server/datacontroldevice_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroldevice_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,64 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class AbstractDataSource; +class DataControlDeviceManagerV1Interface; +class DataControlDeviceV1InterfacePrivate; +class DataControlOfferV1Interface; +class DataControlSourceV1Interface; +class SeatInterface; +class SurfaceInterface; + +/** + * The DataControlDeviceV1Interface extensions allows clients to manage seat's current selection. + * + * DataControlDeviceV1Interface corresponds to the Wayland interface @c zwlr_data_control_device_v1. + */ +class KWAYLANDSERVER_EXPORT DataControlDeviceV1Interface : public QObject +{ + Q_OBJECT + +public: + ~DataControlDeviceV1Interface() override; + + SeatInterface *seat() const; + DataControlSourceV1Interface *selection() const; + DataControlSourceV1Interface *primarySelection() const; + DataControlSourceV1Interface *cachedSelection() const; + + void sendSelection(AbstractDataSource *other); + void sendClearSelection(); + + void sendPrimarySelection(AbstractDataSource *other); + void sendClearPrimarySelection(); + +Q_SIGNALS: + void selectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource); + void selectionCleared(); + + void primarySelectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource); + + void cachedSelectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource); + +private: + friend class DataControlDeviceManagerV1InterfacePrivate; + explicit DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource); + + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::DataControlDeviceV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/datacontroloffer_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroloffer_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#include "datacontroloffer_interface.h" -#include "datacontrolsource_interface.h" -#include "datacontroldevicemanager_interface.h" -#include "resource_p.h" - -#include "datasource_interface.h" -#include "primaryselectionsource_v1_interface.h" -#include "abstract_data_source.h" - -// Qt -#include -// Wayland -#include -// system -#include - -namespace KWayland -{ -namespace Server -{ - -class Q_DECL_HIDDEN DataControlOfferV1Interface::Private : public Resource::Private -{ -public: - Private(AbstractDataSource* datasource, DataControlDeviceV1Interface *parentInterface, DataControlOfferV1Interface *q, wl_resource *parentResource); - ~Private(); - - AbstractDataSource* source; - DataControlDeviceV1Interface *dataControlDevice; - -private: - DataControlOfferV1Interface *q_func() { - return reinterpret_cast(q); - } - void receive(const QString &mimeType, qint32 fd); - static void receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd); - static const struct zwlr_data_control_offer_v1_interface s_interface; - -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwlr_data_control_offer_v1_interface DataControlOfferV1Interface::Private::s_interface = { - receiveCallback, - resourceDestroyedCallback, -}; -#endif - -DataControlOfferV1Interface::Private::Private(AbstractDataSource* datasource, DataControlDeviceV1Interface *parentInterface, DataControlOfferV1Interface *q, wl_resource *parentResource) - : Resource::Private(q, nullptr, parentResource, &zwlr_data_control_offer_v1_interface, &s_interface) - , dataControlDevice(parentInterface) - ,source(datasource) -{ - -} - - -DataControlOfferV1Interface::Private::~Private() = default; - - -void DataControlOfferV1Interface::Private::receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd) -{ - Q_UNUSED(client) - cast(resource)->receive(QString::fromUtf8(mimeType), fd); -} - -void DataControlOfferV1Interface::Private::receive(const QString &mimeType, qint32 fd) -{ - Q_UNUSED(resource) - if (!source) { - close(fd); - return; - } - source->requestData(mimeType, fd); -} - - - - - -DataControlOfferV1Interface::DataControlOfferV1Interface(AbstractDataSource *source, DataControlDeviceV1Interface *parentInterface, wl_resource *parentResource) - : Resource(new Private(source,parentInterface, this, parentResource)) -{ - Q_D(); - Q_ASSERT(source); - connect(source, &DataSourceInterface::mimeTypeOffered, - [this](const QString &mimeType) { - Q_D(); - if (!d->resource) { - return; - } - zwlr_data_control_offer_v1_send_offer(d->resource, mimeType.toUtf8().constData()); - } - ); - QObject::connect(source, &QObject::destroyed, this, - [this] { - Q_D(); - d->source = nullptr; - } - ); -} - -DataControlOfferV1Interface::~DataControlOfferV1Interface() = default; - -void DataControlOfferV1Interface::sendAllOffers() -{ - Q_D(); - - for (const QString &mimeType : d->source->mimeTypes()) { - zwlr_data_control_offer_v1_send_offer(d->resource, mimeType.toUtf8().constData()); - } -} - -DataControlOfferV1Interface::Private *DataControlOfferV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - -} -} diff -Nru dwayland-5.57.0.23/src/server/datacontroloffer_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_interface.h --- dwayland-5.57.0.23/src/server/datacontroloffer_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#ifndef WAYLAND_SERVER_DATA_CONTROL_OFFER_INTERFACE_H -#define WAYLAND_SERVER_DATA_CONTROL_OFFER_INTERFACE_H - -#include - -#include - -#include "resource.h" -#include "datacontroldevicemanager_interface.h" - -namespace KWayland -{ -namespace Server -{ - -class DataControlDeviceV1Interface; -class DataControlSourceV1Interface; -class AbstractDataSource; - -/** - * @brief Represents the Resource for the wl_data_offer interface. - * - **/ -class KWAYLANDSERVER_EXPORT DataControlOfferV1Interface : public Resource -{ - Q_OBJECT -public: - - enum SourceType - { - SourceType_Data, - SourceType_Primary, - SourceType_Control - }; - - virtual ~DataControlOfferV1Interface(); - - void sendAllOffers(); - -private: - friend class DataControlDeviceV1Interface; - explicit DataControlOfferV1Interface(AbstractDataSource *source, DataControlDeviceV1Interface *parentInterface, wl_resource *parentResource); - - class Private; - Private *d_func() const; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::DataControlOfferV1Interface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/datacontroloffer_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_v1_interface.cpp --- dwayland-5.57.0.23/src/server/datacontroloffer_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,86 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "datacontroloffer_v1_interface.h" +#include "datacontroldevice_v1_interface.h" +#include "datacontrolsource_v1_interface.h" +// Qt +#include +#include +// Wayland +#include +// system +#include + +namespace KWaylandServer +{ +class DataControlOfferV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_offer_v1 +{ +public: + DataControlOfferV1InterfacePrivate(DataControlOfferV1Interface *q, AbstractDataSource *source, wl_resource *resource); + + DataControlOfferV1Interface *q; + QPointer source; + +protected: + void zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mime_type, int32_t fd) override; + void zwlr_data_control_offer_v1_destroy(Resource *resource) override; + void zwlr_data_control_offer_v1_destroy_resource(Resource *resource) override; +}; + +DataControlOfferV1InterfacePrivate::DataControlOfferV1InterfacePrivate(DataControlOfferV1Interface *_q, AbstractDataSource *source, wl_resource *resource) + : QtWaylandServer::zwlr_data_control_offer_v1(resource) + , q(_q) + , source(source) +{ +} + +void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy_resource(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd) +{ + Q_UNUSED(resource) + if (!source) { + close(fd); + return; + } + source->requestData(mimeType, fd); +} + +DataControlOfferV1Interface::DataControlOfferV1Interface(AbstractDataSource *source, wl_resource *resource) + : QObject() + , d(new DataControlOfferV1InterfacePrivate(this, source, resource)) +{ + Q_ASSERT(source); + connect(source, &AbstractDataSource::mimeTypeOffered, this, [this](const QString &mimeType) { + d->send_offer(mimeType); + }); +} + +DataControlOfferV1Interface::~DataControlOfferV1Interface() = default; + +void DataControlOfferV1Interface::sendAllOffers() +{ + Q_ASSERT(d->source); + for (const QString &mimeType : d->source->mimeTypes()) { + d->send_offer(mimeType); + } +} + +wl_resource *DataControlOfferV1Interface::resource() const +{ + return d->resource()->handle; +} + +} diff -Nru dwayland-5.57.0.23/src/server/datacontroloffer_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_v1_interface.h --- dwayland-5.57.0.23/src/server/datacontroloffer_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontroloffer_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +#include "datacontroldevicemanager_v1_interface.h" + +struct wl_resource; + +namespace KWaylandServer +{ +class AbstractDataSource; +class DataControlDeviceV1Interface; +class DataControlSourceV1Interface; +class DataControlOfferV1InterfacePrivate; + +/** + * The DataControlOfferV1Interface extension represents a piece of data offered for transfer. + * + * DataControlOfferV1Interface corresponds to the Wayland interface @c zwlr_data_control_offer_v1. + */ +class KWAYLANDSERVER_EXPORT DataControlOfferV1Interface : public QObject +{ + Q_OBJECT + +public: + ~DataControlOfferV1Interface() override; + + void sendAllOffers(); + wl_resource *resource() const; + +private: + friend class DataControlDeviceV1InterfacePrivate; + explicit DataControlOfferV1Interface(AbstractDataSource *source, wl_resource *resource); + + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::DataControlOfferV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/datacontrolsource_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_interface.cpp --- dwayland-5.57.0.23/src/server/datacontrolsource_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#include "datacontrolsource_interface.h" -#include "datacontroldevicemanager_interface.h" -#include "clientconnection.h" -#include "resource_p.h" -// Qt -#include -// Wayland -#include -// system -#include - -namespace KWayland -{ -namespace Server -{ - -class DataControlSourceV1Interface::Private : public Resource::Private -{ -public: - Private(DataControlSourceV1Interface *q, DataControlDeviceManagerInterface *parent, wl_resource *parentResource); - ~Private(); - - QStringList mimeTypes; - -private: - DataControlSourceV1Interface *q_func() { - return reinterpret_cast(q); - } - void offer(const QString &mimeType); - - static void offerCallback(wl_client *client, wl_resource *resource, const char *mimeType); - - const static struct zwlr_data_control_source_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwlr_data_control_source_v1_interface DataControlSourceV1Interface::Private::s_interface = { - offerCallback, - resourceDestroyedCallback -}; -#endif - -DataControlSourceV1Interface::Private::Private(DataControlSourceV1Interface *q, DataControlDeviceManagerInterface *parent, wl_resource *parentResource) - : Resource::Private(q, parent, parentResource, &zwlr_data_control_source_v1_interface, &s_interface) -{ -} - -DataControlSourceV1Interface::Private::~Private() = default; - -void DataControlSourceV1Interface::Private::offerCallback(wl_client *client, wl_resource *resource, const char *mimeType) -{ - Q_UNUSED(client) - cast(resource)->offer(QString::fromUtf8(mimeType)); -} - -void DataControlSourceV1Interface::Private::offer(const QString &mimeType) -{ - mimeTypes << mimeType; - Q_Q(DataControlSourceV1Interface); - emit q->mimeTypeOffered(mimeType); -} - -DataControlSourceV1Interface::~DataControlSourceV1Interface() = default; - - -void DataControlSourceV1Interface::requestData(const QString &mimeType, qint32 fd) -{ - Q_D(); - if (d->resource) { - zwlr_data_control_source_v1_send_send(d->resource, mimeType.toUtf8().constData(), int32_t(fd)); - } - close(fd); -} - -void DataControlSourceV1Interface::cancel() -{ - Q_D(); - if (!d->resource) { - return; - } - zwlr_data_control_source_v1_send_cancelled(d->resource); - client()->flush(); -} - -QStringList DataControlSourceV1Interface::mimeTypes() const -{ - Q_D(); - return d->mimeTypes; -} - -DataControlSourceV1Interface *DataControlSourceV1Interface::get(wl_resource *native) -{ - return Private::get(native); -} - -DataControlSourceV1Interface::DataControlSourceV1Interface(DataControlDeviceManagerInterface *parent, wl_resource *parentResource) - : AbstractDataSource(new Private(this, parent, parentResource)) -{ - -} - -DataControlSourceV1Interface::Private *DataControlSourceV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - - -} -} diff -Nru dwayland-5.57.0.23/src/server/datacontrolsource_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_interface.h --- dwayland-5.57.0.23/src/server/datacontrolsource_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - SPDX-FileCopyrightText: 2020 David Edmundson - - SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL -*/ - -#ifndef WAYLAND_SERVER_DATA_CONTROL_SOURCE_INTERFACE_H -#define WAYLAND_SERVER_DATA_CONTROL_SOURCE_INTERFACE_H - -#include - -#include - -#include "abstract_data_source.h" -#include "datacontroldevicemanager_interface.h" - - - -namespace KWayland -{ -namespace Server -{ - -/** - * @brief Represents the Resource for the wl_data_source interface. - **/ -class KWAYLANDSERVER_EXPORT DataControlSourceV1Interface : public AbstractDataSource -{ - Q_OBJECT -public: - virtual ~DataControlSourceV1Interface(); - - void requestData(const QString &mimeType, qint32 fd) override; - void cancel() override; - - QStringList mimeTypes() const override; - - static DataControlSourceV1Interface *get(wl_resource *native); - -private: - friend class DataControlDeviceManagerInterface; - explicit DataControlSourceV1Interface(DataControlDeviceManagerInterface *parent, wl_resource *parentResource); - - class Private; - Private *d_func() const; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::DataControlSourceV1Interface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/datacontrolsource_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_v1_interface.cpp --- dwayland-5.57.0.23/src/server/datacontrolsource_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,94 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "datacontrolsource_v1_interface.h" +#include "clientconnection.h" +#include "datacontroldevicemanager_v1_interface.h" +#include "utils.h" +// Qt +#include +// Wayland +#include +// system +#include + +namespace KWaylandServer +{ +class DataControlSourceV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_source_v1 +{ +public: + DataControlSourceV1InterfacePrivate(DataControlSourceV1Interface *q, ::wl_resource *resource); + + QStringList mimeTypes; + DataControlSourceV1Interface *q; + +protected: + void zwlr_data_control_source_v1_destroy_resource(Resource *resource) override; + void zwlr_data_control_source_v1_offer(Resource *resource, const QString &mime_type) override; + void zwlr_data_control_source_v1_destroy(Resource *resource) override; +}; + +DataControlSourceV1InterfacePrivate::DataControlSourceV1InterfacePrivate(DataControlSourceV1Interface *_q, ::wl_resource *resource) + : QtWaylandServer::zwlr_data_control_source_v1(resource) + , q(_q) +{ +} + +void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_destroy_resource(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_offer(Resource *, const QString &mimeType) +{ + mimeTypes << mimeType; + Q_EMIT q->mimeTypeOffered(mimeType); +} + +void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_destroy(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +DataControlSourceV1Interface::DataControlSourceV1Interface(DataControlDeviceManagerV1Interface *parent, ::wl_resource *resource) + : AbstractDataSource(parent) + , d(new DataControlSourceV1InterfacePrivate(this, resource)) +{ +} + +DataControlSourceV1Interface::~DataControlSourceV1Interface() = default; + +void DataControlSourceV1Interface::requestData(const QString &mimeType, qint32 fd) +{ + d->send_send(mimeType, fd); + close(fd); +} + +void DataControlSourceV1Interface::cancel() +{ + d->send_cancelled(); +} + +QStringList DataControlSourceV1Interface::mimeTypes() const +{ + return d->mimeTypes; +} + +wl_client *DataControlSourceV1Interface::client() const +{ + return d->resource()->client(); +} + +DataControlSourceV1Interface *DataControlSourceV1Interface::get(wl_resource *native) +{ + if (auto sourcePrivate = resource_cast(native)) { + return sourcePrivate->q; + } + return nullptr; +} + +} diff -Nru dwayland-5.57.0.23/src/server/datacontrolsource_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_v1_interface.h --- dwayland-5.57.0.23/src/server/datacontrolsource_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datacontrolsource_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "abstract_data_source.h" + +#include + +#include "datacontroldevicemanager_v1_interface.h" + +namespace KWaylandServer +{ +class DataControlSourceV1InterfacePrivate; + +/** + * The DataControlSourceV1Interface class represents the source side in a data transfer. + * + * DataControlSourceV1Interface corresponds to the wayland interface zwlr_data_control_source_v1. + */ +class KWAYLANDSERVER_EXPORT DataControlSourceV1Interface : public AbstractDataSource +{ + Q_OBJECT + +public: + ~DataControlSourceV1Interface() override; + + void requestData(const QString &mimeType, qint32 fd) override; + void cancel() override; + + QStringList mimeTypes() const override; + wl_client *client() const override; + + static DataControlSourceV1Interface *get(wl_resource *native); + +private: + friend class DataControlDeviceManagerV1InterfacePrivate; + explicit DataControlSourceV1Interface(DataControlDeviceManagerV1Interface *parent, ::wl_resource *resource); + + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::DataControlSourceV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/datadevice_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface.cpp --- dwayland-5.57.0.23/src/server/datadevice_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,111 +1,96 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datadevice_interface.h" +#include "datadevice_interface_p.h" #include "datadevicemanager_interface.h" -#include "dataoffer_interface_p.h" +#include "dataoffer_interface.h" #include "datasource_interface.h" #include "display.h" -#include "resource_p.h" #include "pointer_interface.h" #include "seat_interface.h" +#include "seat_interface_p.h" #include "surface_interface.h" -// Wayland -#include +#include "surfacerole_p.h" -namespace KWayland +namespace KWaylandServer { -namespace Server +class DragAndDropIconPrivate : public SurfaceRole { +public: + explicit DragAndDropIconPrivate(SurfaceInterface *surface); + + void commit() override; -class DataDeviceInterface::Private : public Resource::Private + QPoint position; +}; + +DragAndDropIconPrivate::DragAndDropIconPrivate(SurfaceInterface *surface) + : SurfaceRole(surface, QByteArrayLiteral("dnd_icon")) { -public: - Private(SeatInterface *seat, DataDeviceInterface *q, DataDeviceManagerInterface *manager, wl_resource *parentResource); - ~Private(); +} - DataOfferInterface *createDataOffer(AbstractDataSource *source); +void DragAndDropIconPrivate::commit() +{ + position += surface()->offset(); +} - SeatInterface *seat; - DataSourceInterface *source = nullptr; - SurfaceInterface *surface = nullptr; - SurfaceInterface *icon = nullptr; - - DataSourceInterface *selection = nullptr; - QMetaObject::Connection selectionUnboundConnection; - QMetaObject::Connection selectionDestroyedConnection; - - struct Drag { - SurfaceInterface *surface = nullptr; - QMetaObject::Connection destroyConnection; - QMetaObject::Connection posConnection; - QMetaObject::Connection sourceActionConnection; - QMetaObject::Connection targetActionConnection; - quint32 serial = 0; - }; - Drag drag; - - QPointer proxyRemoteSurface; - -private: - DataDeviceInterface *q_func() { - return reinterpret_cast(q); - } - void startDrag(DataSourceInterface *dataSource, SurfaceInterface *origin, SurfaceInterface *icon, quint32 serial); - void setSelection(DataSourceInterface *dataSource); - static void startDragCallback(wl_client *client, wl_resource *resource, wl_resource *source, wl_resource *origin, wl_resource *icon, uint32_t serial); - static void setSelectionCallback(wl_client *client, wl_resource *resource, wl_resource *source, uint32_t serial); +DragAndDropIcon::DragAndDropIcon(SurfaceInterface *surface) + : QObject(surface) + , d(new DragAndDropIconPrivate(surface)) +{ +} - static const struct wl_data_device_interface s_interface; -}; +DragAndDropIcon::~DragAndDropIcon() +{ +} -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_data_device_interface DataDeviceInterface::Private::s_interface = { - startDragCallback, - setSelectionCallback, - resourceDestroyedCallback -}; -#endif +QPoint DragAndDropIcon::position() const +{ + return d->position; +} -DataDeviceInterface::Private::Private(SeatInterface *seat, DataDeviceInterface *q, DataDeviceManagerInterface *manager, wl_resource *parentResource) - : Resource::Private(q, manager, parentResource, &wl_data_device_interface, &s_interface) - , seat(seat) +SurfaceInterface *DragAndDropIcon::surface() const { + return d->surface(); } -DataDeviceInterface::Private::~Private() = default; +DataDeviceInterfacePrivate *DataDeviceInterfacePrivate::get(DataDeviceInterface *device) +{ + return device->d.data(); +} -void DataDeviceInterface::Private::startDragCallback(wl_client *client, wl_resource *resource, wl_resource *source, wl_resource *origin, wl_resource *icon, uint32_t serial) +DataDeviceInterfacePrivate::DataDeviceInterfacePrivate(SeatInterface *seat, DataDeviceInterface *_q, wl_resource *resource) + : QtWaylandServer::wl_data_device(resource) + , seat(seat) + , q(_q) { - Q_UNUSED(client) - Q_UNUSED(serial) - // TODO: verify serial - cast(resource)->startDrag(DataSourceInterface::get(source), SurfaceInterface::get(origin), SurfaceInterface::get(icon), serial); } -void DataDeviceInterface::Private::startDrag(DataSourceInterface *dataSource, SurfaceInterface *origin, SurfaceInterface *i, quint32 serial) +void DataDeviceInterfacePrivate::data_device_start_drag(Resource *resource, + wl_resource *sourceResource, + wl_resource *originResource, + wl_resource *iconResource, + uint32_t serial) { - SurfaceInterface *focusSurface = origin; - if (proxyRemoteSurface) { - // origin is a proxy surface - focusSurface = proxyRemoteSurface.data(); + SurfaceInterface *iconSurface = SurfaceInterface::get(iconResource); + + const SurfaceRole *surfaceRole = SurfaceRole::get(iconSurface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_role, "the icon surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } + + SurfaceInterface *focusSurface = SurfaceInterface::get(originResource); + DataSourceInterface *dataSource = nullptr; + if (sourceResource) { + dataSource = DataSourceInterface::get(sourceResource); } + const bool pointerGrab = seat->hasImplicitPointerGrab(serial) && seat->focusedPointerSurface() == focusSurface; if (!pointerGrab) { // Client doesn't have pointer grab. @@ -115,152 +100,109 @@ return; } } - // TODO: source is allowed to be null, handled client internally! - Q_Q(DataDeviceInterface); - source = dataSource; - if (dataSource) { - QObject::connect(dataSource, &Resource::aboutToBeUnbound, q, [this] { source = nullptr; }); - } - surface = origin; - icon = i; - if (i) { - QObject::connect(i, &Resource::aboutToBeUnbound, q, [this] { icon = nullptr; }); + + DragAndDropIcon *dragIcon = nullptr; + if (iconSurface) { + // drag icon lifespan is mapped to surface lifespan + dragIcon = new DragAndDropIcon(iconSurface); } drag.serial = serial; - emit q->dragStarted(); + Q_EMIT q->dragStarted(dataSource, focusSurface, serial, dragIcon); } -void DataDeviceInterface::Private::setSelectionCallback(wl_client *client, wl_resource *resource, wl_resource *source, uint32_t serial) +void DataDeviceInterfacePrivate::data_device_set_selection(Resource *resource, wl_resource *source, uint32_t serial) { - Q_UNUSED(client) + Q_UNUSED(resource) Q_UNUSED(serial) - // TODO: verify serial - cast(resource)->setSelection(DataSourceInterface::get(source)); -} + DataSourceInterface *dataSource = DataSourceInterface::get(source); -void DataDeviceInterface::Private::setSelection(DataSourceInterface *dataSource) -{ if (dataSource && dataSource->supportedDragAndDropActions() && wl_resource_get_version(dataSource->resource()) >= WL_DATA_SOURCE_ACTION_SINCE_VERSION) { - wl_resource_post_error(dataSource->resource(), WL_DATA_SOURCE_ERROR_INVALID_SOURCE, "Data source is for drag and drop"); + wl_resource_post_error(dataSource->resource(), QtWaylandServer::wl_data_source::error_invalid_source, "Data source is for drag and drop"); return; } + if (selection == dataSource) { return; } - Q_Q(DataDeviceInterface); - QObject::disconnect(selectionUnboundConnection); - QObject::disconnect(selectionDestroyedConnection); if (selection) { selection->cancel(); } selection = dataSource; if (selection) { - auto clearSelection = [this] { - setSelection(nullptr); - }; - selectionUnboundConnection = QObject::connect(selection, &Resource::unbound, q, clearSelection); - selectionDestroyedConnection = QObject::connect(selection, &QObject::destroyed, q, clearSelection); - emit q->selectionChanged(selection); + Q_EMIT q->selectionChanged(selection); } else { - selectionUnboundConnection = QMetaObject::Connection(); - selectionDestroyedConnection = QMetaObject::Connection(); - emit q->selectionCleared(); + Q_EMIT q->selectionCleared(); } } -DataOfferInterface *DataDeviceInterface::Private::createDataOffer(AbstractDataSource *source) +void DataDeviceInterfacePrivate::data_device_release(QtWaylandServer::wl_data_device::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +DataOfferInterface *DataDeviceInterfacePrivate::createDataOffer(AbstractDataSource *source) { - if (!resource) { - return nullptr; - } if (!source) { // a data offer can only exist together with a source return nullptr; } - Q_Q(DataDeviceInterface); - DataOfferInterface *offer = new DataOfferInterface(source, q, resource); - auto c = q->global()->display()->getConnection(wl_resource_get_client(resource)); - offer->create(c, wl_resource_get_version(resource), 0); - if (!offer->resource()) { - // TODO: send error? - delete offer; + + wl_resource *data_offer_resource = wl_resource_create(resource()->client(), &wl_data_offer_interface, resource()->version(), 0); + if (!data_offer_resource) { + wl_resource_post_no_memory(resource()->handle); return nullptr; } - wl_data_device_send_data_offer(resource, offer->resource()); + + DataOfferInterface *offer = new DataOfferInterface(source, data_offer_resource); + send_data_offer(offer->resource()); offer->sendAllOffers(); return offer; } -DataDeviceInterface::DataDeviceInterface(SeatInterface *seat, DataDeviceManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(seat, this, parent, parentResource)) +void DataDeviceInterfacePrivate::data_device_destroy_resource(QtWaylandServer::wl_data_device::Resource *resource) { + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; } -DataDeviceInterface::~DataDeviceInterface() = default; - -SeatInterface *DataDeviceInterface::seat() const -{ - Q_D(); - return d->seat; -} - -AbstractDataSource *DataDeviceInterface::dragSource() const +DataDeviceInterface::DataDeviceInterface(SeatInterface *seat, wl_resource *resource) + : AbstractDropHandler(nullptr) + , d(new DataDeviceInterfacePrivate(seat, this, resource)) { - Q_D(); - return d->source; + SeatInterfacePrivate *seatPrivate = SeatInterfacePrivate::get(seat); + seatPrivate->registerDataDevice(this); } -SurfaceInterface *DataDeviceInterface::icon() const -{ - Q_D(); - return d->icon; -} +DataDeviceInterface::~DataDeviceInterface() = default; -SurfaceInterface *DataDeviceInterface::origin() const +SeatInterface *DataDeviceInterface::seat() const { - Q_D(); - return d->proxyRemoteSurface ? d->proxyRemoteSurface.data() : d->surface; + return d->seat; } -AbstractDataSource *DataDeviceInterface::selection() const +DataSourceInterface *DataDeviceInterface::selection() const { - Q_D(); return d->selection; } void DataDeviceInterface::sendSelection(AbstractDataSource *other) { - Q_D(); - if (!other) { - sendClearSelection(); - return; - } auto r = d->createDataOffer(other); if (!r) { return; } - if (!d->resource) { - return; - } - wl_data_device_send_selection(d->resource, r->resource()); + d->send_selection(r->resource()); } void DataDeviceInterface::sendClearSelection() { - Q_D(); - if (!d->resource) { - return; - } - wl_data_device_send_selection(d->resource, nullptr); + d->send_selection(nullptr); } void DataDeviceInterface::drop() { - Q_D(); - if (!d->resource) { - return; - } - wl_data_device_send_drop(d->resource); + d->send_drop(); if (d->drag.posConnection) { disconnect(d->drag.posConnection); d->drag.posConnection = QMetaObject::Connection(); @@ -268,15 +210,13 @@ disconnect(d->drag.destroyConnection); d->drag.destroyConnection = QMetaObject::Connection(); d->drag.surface = nullptr; - client()->flush(); } void DataDeviceInterface::updateDragTarget(SurfaceInterface *surface, quint32 serial) { - Q_D(); if (d->drag.surface) { - if (d->resource && d->drag.surface->resource()) { - wl_data_device_send_leave(d->resource); + if (d->drag.surface->resource()) { + d->send_leave(); } if (d->drag.posConnection) { disconnect(d->drag.posConnection); @@ -295,117 +235,88 @@ } // don't update serial, we need it } - if (!surface) { - if (auto s = d->seat->dragSource()->dragSource()) { + auto dragSource = d->seat->dragSource(); + if (!surface || !dragSource) { + if (auto s = dragSource) { s->dndAction(DataDeviceManagerInterface::DnDAction::None); } return; } - if (d->proxyRemoteSurface && d->proxyRemoteSurface == surface) { - // A proxy can not have the remote surface as target. - // TODO: do this for all client's surfaces? - return; - } - if (!d->seat->dragSource()) { - return; + + if (dragSource) { + dragSource->accept(QString()); } - auto *source = d->seat->dragSource()->dragSource(); - DataOfferInterface *offer = d->createDataOffer(source); + DataOfferInterface *offer = d->createDataOffer(dragSource); d->drag.surface = surface; if (d->seat->isDragPointer()) { - d->drag.posConnection = connect(d->seat, &SeatInterface::pointerPosChanged, this, - [this] { - Q_D(); - const QPointF pos = d->seat->dragSurfaceTransformation().map(d->seat->pointerPos()); - wl_data_device_send_motion(d->resource, d->seat->timestamp(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); - client()->flush(); - // workaround: drag surface move according to cursor move - if (d->seat->dragSource() && d->seat->dragSource()->icon()) { - emit d->seat->dragSource()->icon()->dragPositionChanged(d->seat->pointerPos() + d->seat->dragSource()->icon()->offset()); - } - } - ); + d->drag.posConnection = connect(d->seat, &SeatInterface::pointerPosChanged, this, [this] { + const QPointF pos = d->seat->dragSurfaceTransformation().map(d->seat->pointerPos()); + d->send_motion(d->seat->timestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); + }); } else if (d->seat->isDragTouch()) { - d->drag.posConnection = connect(d->seat, &SeatInterface::touchMoved, this, - [this](qint32 id, quint32 serial, const QPointF &globalPosition) { - Q_D(); - Q_UNUSED(id); - const QPointF pos = d->seat->dragSurfaceTransformation().map(globalPosition); - wl_data_device_send_motion(d->resource, d->seat->timestamp(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); - client()->flush(); - // workaround: drag surface move according to cursor move - if (d->seat->dragSource() && d->seat->dragSource()->icon()) { - emit d->seat->dragSource()->icon()->dragPositionChanged(globalPosition + d->seat->dragSource()->icon()->offset()); - } + d->drag.posConnection = connect(d->seat, &SeatInterface::touchMoved, this, [this](qint32 id, quint32 serial, const QPointF &globalPosition) { + Q_UNUSED(id); + if (serial != d->drag.serial) { + // different touch down has been moved + return; } - ); + const QPointF pos = d->seat->dragSurfaceTransformation().map(globalPosition); + d->send_motion(d->seat->timestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); + }); } - d->drag.destroyConnection = connect(d->drag.surface, &QObject::destroyed, this, - [this] { - Q_D(); - if (d->resource) { - wl_data_device_send_leave(d->resource); - } - if (d->drag.posConnection) { - disconnect(d->drag.posConnection); - } - d->drag = Private::Drag(); + d->drag.destroyConnection = connect(d->drag.surface, &QObject::destroyed, this, [this] { + d->send_leave(); + if (d->drag.posConnection) { + disconnect(d->drag.posConnection); } - ); + d->drag = DataDeviceInterfacePrivate::Drag(); + }); - // TODO: handle touch position - const QPointF pos = d->seat->dragSurfaceTransformation().map(d->seat->pointerPos()); - wl_data_device_send_enter(d->resource, serial, surface->resource(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()), offer ? offer->resource() : nullptr); + QPointF pos; + if (d->seat->isDragPointer()) { + pos = d->seat->dragSurfaceTransformation().map(d->seat->pointerPos()); + } else if (d->seat->isDragTouch()) { + pos = d->seat->dragSurfaceTransformation().map(d->seat->firstTouchPointPosition()); + } + d->send_enter(serial, surface->resource(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()), offer ? offer->resource() : nullptr); if (offer) { - offer->d_func()->sendSourceActions(); - auto matchOffers = [source, offer] { + offer->sendSourceActions(); + auto matchOffers = [dragSource, offer] { DataDeviceManagerInterface::DnDAction action{DataDeviceManagerInterface::DnDAction::None}; //source->supportedDragAndDropActions()源窗口的drag action,可能是 copy,move,ask的或集,但是offer->preferredDragAndDropAction是目的窗口的action //有可能为None,所以当为None时,下面条件不成立,导致最终发送的是support action。 - if (source->supportedDragAndDropActions().testFlag(offer->preferredDragAndDropAction()) - || offer->preferredDragAndDropAction() == DataDeviceManagerInterface::DnDAction::None) { + if (dragSource->supportedDragAndDropActions().testFlag(offer->preferredDragAndDropAction()) + || offer->preferredDragAndDropAction() == DataDeviceManagerInterface::DnDAction::None) { action = offer->preferredDragAndDropAction(); } else { - if (source->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Copy) && - offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Copy)) { + if (dragSource->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Copy) + && offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Copy)) { action = DataDeviceManagerInterface::DnDAction::Copy; - } else if (source->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Move) && - offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Move)) { + } else if (dragSource->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Move) + && offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Move)) { action = DataDeviceManagerInterface::DnDAction::Move; - } else if (source->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Ask) && - offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Ask)) { + } else if (dragSource->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Ask) + && offer->supportedDragAndDropActions().testFlag(DataDeviceManagerInterface::DnDAction::Ask)) { action = DataDeviceManagerInterface::DnDAction::Ask; } } offer->dndAction(action); - source->dndAction(action); + dragSource->dndAction(action); }; - d->drag.targetActionConnection = connect(offer, &DataOfferInterface::dragAndDropActionsChanged, offer, matchOffers); - d->drag.sourceActionConnection = connect(source, &DataSourceInterface::supportedDragAndDropActionsChanged, source, matchOffers); + d->drag.targetActionConnection = connect(offer, &DataOfferInterface::dragAndDropActionsChanged, dragSource, matchOffers); + d->drag.sourceActionConnection = connect(dragSource, &AbstractDataSource::supportedDragAndDropActionsChanged, dragSource, matchOffers); } - d->client->flush(); -} - -quint32 DataDeviceInterface::dragImplicitGrabSerial() const -{ - Q_D(); - return d->drag.serial; } void DataDeviceInterface::updateProxy(SurfaceInterface *remote) { - Q_D(); // TODO: connect destroy signal? d->proxyRemoteSurface = remote; } -DataDeviceInterface::Private *DataDeviceInterface::d_func() const +wl_client *DataDeviceInterface::client() { - return reinterpret_cast(d.data()); + return d->resource()->client(); } } -} diff -Nru dwayland-5.57.0.23/src/server/datadevice_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface.h --- dwayland-5.57.0.23/src/server/datadevice_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,75 +1,88 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DATA_DEVICE_INTERFACE_H -#define WAYLAND_SERVER_DATA_DEVICE_INTERFACE_H +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include +#include -#include "resource.h" +#include "abstract_drop_handler.h" -namespace KWayland -{ -namespace Server -{ +struct wl_client; +struct wl_resource; +namespace KWaylandServer +{ class DataDeviceManagerInterface; class DataOfferInterface; class DataSourceInterface; +class AbstractDataSource; class SeatInterface; class SurfaceInterface; -class AbstractDataSource; +class DataDeviceInterfacePrivate; +class DragAndDropIconPrivate; /** - * @brief Represents the Resource for the wl_data_device interface. + * The DragAndDropIcon class represents a drag-and-drop icon. + * + * Note that the lifetime of the drag-and-drop icon is bound to the lifetime of the underlying + * icon surface. + */ +class KWAYLANDSERVER_EXPORT DragAndDropIcon : public QObject +{ + Q_OBJECT + +public: + ~DragAndDropIcon() override; + + /** + * Returns the position of the icon relative to the cursor's hotspot. + */ + QPoint position() const; + + /** + * Returns the underlying icon surface. This function always returns a valid surface. + */ + SurfaceInterface *surface() const; + +private: + explicit DragAndDropIcon(SurfaceInterface *surface); + friend class DataDeviceInterfacePrivate; + QScopedPointer d; +}; + +/** + * @brief DataDeviceInterface allows clients to share data by copy-and-paste and drag-and-drop. + * + * The data device is per seat. + * Copy-and-paste use the selection functions. + * + * Represents the Resource for the wl_data_device interface. * * @see SeatInterface * @see DataSourceInterface - **/ -class KWAYLANDSERVER_EXPORT DataDeviceInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT DataDeviceInterface : public AbstractDropHandler { Q_OBJECT public: virtual ~DataDeviceInterface(); SeatInterface *seat() const; - AbstractDataSource *dragSource() const; - SurfaceInterface *origin() const; - SurfaceInterface *icon() const; - /** - * @returns the serial of the implicit grab which started the drag - * @since 5.6 - **/ - quint32 dragImplicitGrabSerial() const; - - AbstractDataSource *selection() const; + DataSourceInterface *selection() const; - void sendSelection(AbstractDataSource *other); + void sendSelection(KWaylandServer::AbstractDataSource *other); void sendClearSelection(); /** * The event is sent when a drag-and-drop operation is ended because the implicit grab is removed. - * @since 5.6 - **/ - void drop(); + */ + void drop() override; /** * Updates the SurfaceInterface to which drag motion events are sent. * @@ -80,31 +93,25 @@ * * @param surface The SurfaceInterface which gets motion events * @param serial The serial to be used for enter/leave - * @since 5.6 - **/ - void updateDragTarget(SurfaceInterface *surface, quint32 serial); - /** - * Mark this DataDeviceInterface as being a proxy device for @p remote. - * @since 5.56 - **/ + */ + void updateDragTarget(SurfaceInterface *surface, quint32 serial) override; void updateProxy(SurfaceInterface *remote); + wl_client *client(); + Q_SIGNALS: - void dragStarted(); - void selectionChanged(KWayland::Server::DataSourceInterface*); + void aboutToBeDestroyed(); + void dragStarted(AbstractDataSource *source, SurfaceInterface *originSurface, quint32 serial, DragAndDropIcon *dragIcon); + void selectionChanged(KWaylandServer::DataSourceInterface *); void selectionCleared(); private: - friend class DataDeviceManagerInterface; - explicit DataDeviceInterface(SeatInterface *seat, DataDeviceManagerInterface *parent, wl_resource *parentResource); - - class Private; - Private *d_func() const; + friend class DataDeviceManagerInterfacePrivate; + explicit DataDeviceInterface(SeatInterface *seat, wl_resource *resource); + QScopedPointer d; + friend class DataDeviceInterfacePrivate; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::DataDeviceInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::DataDeviceInterface *) diff -Nru dwayland-5.57.0.23/src/server/datadevice_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface_p.h --- dwayland-5.57.0.23/src/server/datadevice_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datadevice_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,55 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include "qwayland-server-wayland.h" + +namespace KWaylandServer +{ +class AbstractDataSource; +class DataDeviceInterface; +class DataOfferInterface; +class DataSourceInterface; +class DragAndDropIcon; +class SeatInterface; +class SurfaceInterface; + +class DataDeviceInterfacePrivate : public QtWaylandServer::wl_data_device +{ +public: + static DataDeviceInterfacePrivate *get(DataDeviceInterface *device); + + DataDeviceInterfacePrivate(SeatInterface *seat, DataDeviceInterface *_q, wl_resource *resource); + + DataOfferInterface *createDataOffer(AbstractDataSource *source); + + SeatInterface *seat; + DataDeviceInterface *q; + QPointer selection; + QPointer proxyRemoteSurface; + + struct Drag { + SurfaceInterface *surface = nullptr; + QMetaObject::Connection destroyConnection; + QMetaObject::Connection posConnection; + QMetaObject::Connection sourceActionConnection; + QMetaObject::Connection targetActionConnection; + quint32 serial = 0; + }; + Drag drag; + +protected: + void data_device_destroy_resource(Resource *resource) override; + void data_device_start_drag(Resource *resource, wl_resource *source, wl_resource *origin, wl_resource *icon, uint32_t serial) override; + void data_device_set_selection(Resource *resource, wl_resource *source, uint32_t serial) override; + void data_device_release(Resource *resource) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/datadevicemanager_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datadevicemanager_interface.cpp --- dwayland-5.57.0.23/src/server/datadevicemanager_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datadevicemanager_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,140 +1,76 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datadevicemanager_interface.h" #include "datasource_interface.h" -#include "global_p.h" #include "display.h" #include "seat_interface_p.h" // Wayland -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 3; -class DataDeviceManagerInterface::Private : public Global::Private +class DataDeviceManagerInterfacePrivate : public QtWaylandServer::wl_data_device_manager { public: - Private(DataDeviceManagerInterface *q, Display *d); + DataDeviceManagerInterfacePrivate(DataDeviceManagerInterface *q, Display *d); + + DataDeviceManagerInterface *q; private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; void createDataSource(wl_client *client, wl_resource *resource, uint32_t id); void getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - static void unbind(wl_resource *resource); - static void createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - DataDeviceManagerInterface *q; - static const struct wl_data_device_manager_interface s_interface; - static const quint32 s_version; - static const qint32 s_dataDeviceVersion; - static const qint32 s_dataSourceVersion; -}; - -const quint32 DataDeviceManagerInterface::Private::s_version = 3; -const qint32 DataDeviceManagerInterface::Private::s_dataDeviceVersion = 3; -const qint32 DataDeviceManagerInterface::Private::s_dataSourceVersion = 3; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_data_device_manager_interface DataDeviceManagerInterface::Private::s_interface = { - createDataSourceCallback, - getDataDeviceCallback +protected: + void data_device_manager_create_data_source(Resource *resource, uint32_t id) override; + void data_device_manager_get_data_device(Resource *resource, uint32_t id, wl_resource *seat) override; }; -#endif -DataDeviceManagerInterface::Private::Private(DataDeviceManagerInterface *q, Display *d) - : Global::Private(d, &wl_data_device_manager_interface, s_version) +DataDeviceManagerInterfacePrivate::DataDeviceManagerInterfacePrivate(DataDeviceManagerInterface *q, Display *d) + : QtWaylandServer::wl_data_device_manager(*d, s_version) , q(q) { } -void DataDeviceManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void DataDeviceManagerInterfacePrivate::data_device_manager_create_data_source(Resource *resource, uint32_t id) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&wl_data_device_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); + wl_resource *data_source_resource = wl_resource_create(resource->client(), &wl_data_source_interface, resource->version(), id); + if (!data_source_resource) { + wl_resource_post_no_memory(resource->handle); return; } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void DataDeviceManagerInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -void DataDeviceManagerInterface::Private::createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->createDataSource(client, resource, id); + DataSourceInterface *dataSource = new DataSourceInterface(q, data_source_resource); + Q_EMIT q->dataSourceCreated(dataSource); } -void DataDeviceManagerInterface::Private::createDataSource(wl_client *client, wl_resource *resource, uint32_t id) +void DataDeviceManagerInterfacePrivate::data_device_manager_get_data_device(Resource *resource, uint32_t id, wl_resource *seat) { - DataSourceInterface *dataSource = new DataSourceInterface(q, resource); - dataSource->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataSourceVersion) , id); - if (!dataSource->resource()) { - wl_resource_post_no_memory(resource); - delete dataSource; + SeatInterface *s = SeatInterface::get(seat); + Q_ASSERT(s); + if (!s) { return; } - QObject::connect(dataSource, &QObject::destroyed, q, - [this] { - emit q->dataSourceDestroyed(); - } - ); - emit q->dataSourceCreated(dataSource); -} - -void DataDeviceManagerInterface::Private::getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) -{ - cast(resource)->getDataDevice(client, resource, id, seat); -} -void DataDeviceManagerInterface::Private::getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) -{ - SeatInterface *s = SeatInterface::get(seat); - Q_ASSERT(s); - DataDeviceInterface *dataDevice = new DataDeviceInterface(s, q, resource); - dataDevice->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataDeviceVersion), id); - if (!dataDevice->resource()) { - wl_resource_post_no_memory(resource); + wl_resource *data_device_resource = wl_resource_create(resource->client(), &wl_data_device_interface, resource->version(), id); + if (!data_device_resource) { + wl_resource_post_no_memory(resource->handle); return; } - s->d_func()->registerDataDevice(dataDevice); - emit q->dataDeviceCreated(dataDevice); + DataDeviceInterface *dataDevice = new DataDeviceInterface(s, data_device_resource); + Q_EMIT q->dataDeviceCreated(dataDevice); } DataDeviceManagerInterface::DataDeviceManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new DataDeviceManagerInterfacePrivate(this, display)) { } DataDeviceManagerInterface::~DataDeviceManagerInterface() = default; } -} diff -Nru dwayland-5.57.0.23/src/server/datadevicemanager_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datadevicemanager_interface.h --- dwayland-5.57.0.23/src/server/datadevicemanager_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datadevicemanager_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,75 +1,53 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DATA_DEVICE_MANAGER_INTERFACE_H -#define WAYLAND_SERVER_DATA_DEVICE_MANAGER_INTERFACE_H +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include -#include "global.h" #include "datadevice_interface.h" +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; class DataSourceInterface; +class DataDeviceManagerInterfacePrivate; /** * @brief Represents the Global for wl_data_device_manager interface. * - **/ -class KWAYLANDSERVER_EXPORT DataDeviceManagerInterface : public Global + */ +class KWAYLANDSERVER_EXPORT DataDeviceManagerInterface : public QObject { Q_OBJECT + public: - virtual ~DataDeviceManagerInterface(); + explicit DataDeviceManagerInterface(Display *display, QObject *parent = nullptr); + ~DataDeviceManagerInterface() override; /** * Drag and Drop actions supported by the DataSourceInterface. - * @since 5.XX - **/ + */ enum class DnDAction { None = 0, Copy = 1 << 0, Move = 1 << 1, - Ask = 1 << 2 + Ask = 1 << 2, }; Q_DECLARE_FLAGS(DnDActions, DnDAction) Q_SIGNALS: - void dataSourceCreated(KWayland::Server::DataSourceInterface*); - void dataDeviceCreated(KWayland::Server::DataDeviceInterface*); - void dataSourceDestroyed(); + void dataSourceCreated(KWaylandServer::DataSourceInterface *); + void dataDeviceCreated(KWaylandServer::DataDeviceInterface *); private: - explicit DataDeviceManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; } -} - -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::DataDeviceManagerInterface::DnDActions) -#endif +Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::DataDeviceManagerInterface::DnDActions) diff -Nru dwayland-5.57.0.23/src/server/dataoffer_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface.cpp --- dwayland-5.57.0.23/src/server/dataoffer_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,222 +1,207 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "dataoffer_interface_p.h" +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "dataoffer_interface.h" #include "datadevice_interface.h" #include "datasource_interface.h" + // Qt +#include #include // Wayland -#include +#include // system #include -namespace KWayland +namespace KWaylandServer { -namespace Server +class DataOfferInterfacePrivate : public QtWaylandServer::wl_data_offer { - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_data_offer_interface DataOfferInterface::Private::s_interface = { - acceptCallback, - receiveCallback, - resourceDestroyedCallback, - finishCallback, - setActionsCallback +public: + DataOfferInterfacePrivate(AbstractDataSource *source, DataOfferInterface *q, wl_resource *resource); + DataOfferInterface *q; + QPointer source; + + // defaults are set to sensible values for < version 3 interfaces + DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move; + DataDeviceManagerInterface::DnDAction preferredDnDAction = DataDeviceManagerInterface::DnDAction::Copy; + +protected: + void data_offer_destroy_resource(Resource *resource) override; + void data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type) override; + void data_offer_receive(Resource *resource, const QString &mime_type, int32_t fd) override; + void data_offer_destroy(Resource *resource) override; + void data_offer_finish(Resource *resource) override; + void data_offer_set_actions(Resource *resource, uint32_t dnd_actions, uint32_t preferred_action) override; }; -#endif -DataOfferInterface::Private::Private(AbstractDataSource *source, DataDeviceInterface *parentInterface, DataOfferInterface *q, wl_resource *parentResource) - : Resource::Private(q, nullptr, parentResource, &wl_data_offer_interface, &s_interface) - , source(source) - , dataDevice(parentInterface) +DataOfferInterfacePrivate::DataOfferInterfacePrivate(AbstractDataSource *_source, DataOfferInterface *_q, wl_resource *resource) + : QtWaylandServer::wl_data_offer(resource) + , q(_q) + , source(_source) { - // TODO: connect to new selections } -DataOfferInterface::Private::~Private() = default; - -void DataOfferInterface::Private::acceptCallback(wl_client *client, wl_resource *resource, uint32_t serial, const char *mimeType) +void DataOfferInterfacePrivate::data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type) { - Q_UNUSED(client) + Q_UNUSED(resource) Q_UNUSED(serial) - auto p = cast(resource); - if (!p->source) { + if (!source) { return; } - p->source->accept(mimeType ? QString::fromUtf8(mimeType) : QString()); -} - -void DataOfferInterface::Private::receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd) -{ - Q_UNUSED(client) - cast(resource)->receive(QString::fromUtf8(mimeType), fd); + source->accept(mime_type); } -void DataOfferInterface::Private::receive(const QString &mimeType, qint32 fd) +void DataOfferInterfacePrivate::data_offer_receive(Resource *resource, const QString &mime_type, int32_t fd) { + Q_UNUSED(resource) if (!source) { close(fd); return; } - source->requestData(mimeType, fd); + source->requestData(mime_type, fd); } -void DataOfferInterface::Private::finishCallback(wl_client *client, wl_resource *resource) +void DataOfferInterfacePrivate::data_offer_destroy(QtWaylandServer::wl_data_offer::Resource *resource) { - Q_UNUSED(client) - auto p = cast(resource); - if (!p->source) { + wl_resource_destroy(resource->handle); +} + +void DataOfferInterfacePrivate::data_offer_finish(Resource *resource) +{ + Q_UNUSED(resource) + if (!source) { return; } - p->source->dndFinished(); + source->dndFinished(); // TODO: It is a client error to perform other requests than wl_data_offer.destroy after this one } -void DataOfferInterface::Private::setActionsCallback(wl_client *client, wl_resource *resource, uint32_t dnd_actions, uint32_t preferred_action) +void DataOfferInterfacePrivate::data_offer_set_actions(Resource *resource, uint32_t dnd_actions, uint32_t preferred_action) { // TODO: check it's drag and drop, otherwise send error - Q_UNUSED(client) + // verify that the no other actions are sent + if (dnd_actions + & ~(QtWaylandServer::wl_data_device_manager::dnd_action_copy | QtWaylandServer::wl_data_device_manager::dnd_action_move + | QtWaylandServer::wl_data_device_manager::dnd_action_ask)) { + wl_resource_post_error(resource->handle, error_invalid_action_mask, "Invalid action mask"); + return; + } + + if (preferred_action != QtWaylandServer::wl_data_device_manager::dnd_action_copy + && preferred_action != QtWaylandServer::wl_data_device_manager::dnd_action_move + && preferred_action != QtWaylandServer::wl_data_device_manager::dnd_action_ask + && preferred_action != QtWaylandServer::wl_data_device_manager::dnd_action_none) { + wl_resource_post_error(resource->handle, error_invalid_action, "Invalid preferred action"); + return; + } + DataDeviceManagerInterface::DnDActions supportedActions; - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_copy) { supportedActions |= DataDeviceManagerInterface::DnDAction::Copy; } - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_move) { supportedActions |= DataDeviceManagerInterface::DnDAction::Move; } - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_ask) { supportedActions |= DataDeviceManagerInterface::DnDAction::Ask; } - // verify that the no other actions are sent - if (dnd_actions & ~(WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY | WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK)) { - wl_resource_post_error(resource, WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK, "Invalid action mask"); - return; - } - if (preferred_action != WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY && - preferred_action != WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE && - preferred_action != WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK && - preferred_action != WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE) { - wl_resource_post_error(resource, WL_DATA_OFFER_ERROR_INVALID_ACTION, "Invalid preferred action"); - return; - } DataDeviceManagerInterface::DnDAction preferredAction = DataDeviceManagerInterface::DnDAction::None; - if (preferred_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY) { + if (preferred_action == QtWaylandServer::wl_data_device_manager::dnd_action_copy) { preferredAction = DataDeviceManagerInterface::DnDAction::Copy; - } else if (preferred_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE) { + } else if (preferred_action == QtWaylandServer::wl_data_device_manager::dnd_action_move) { preferredAction = DataDeviceManagerInterface::DnDAction::Move; - } else if (preferred_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) { + } else if (preferred_action == QtWaylandServer::wl_data_device_manager::dnd_action_ask) { preferredAction = DataDeviceManagerInterface::DnDAction::Ask; } - auto p = cast(resource); - p->supportedDnDActions = supportedActions; - p->preferredDnDAction = preferredAction; - emit p->q_func()->dragAndDropActionsChanged(); + if (supportedDnDActions != supportedActions || preferredDnDAction != preferredAction) { + supportedDnDActions = supportedActions; + preferredDnDAction = preferredAction; + Q_EMIT q->dragAndDropActionsChanged(); + } } -void DataOfferInterface::Private::sendSourceActions() +void DataOfferInterface::sendSourceActions() { - if (!source) { + if (!d->source) { return; } - if (wl_resource_get_version(resource) < WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION) { + if (d->resource()->version() < WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION) { return; } - uint32_t wlActions = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE; - const auto actions = source->supportedDragAndDropActions(); + uint32_t wlActions = QtWaylandServer::wl_data_device_manager::dnd_action_none; + const auto actions = d->source->supportedDragAndDropActions(); if (actions.testFlag(DataDeviceManagerInterface::DnDAction::Copy)) { - wlActions |= WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; + wlActions |= QtWaylandServer::wl_data_device_manager::dnd_action_copy; } if (actions.testFlag(DataDeviceManagerInterface::DnDAction::Move)) { - wlActions |= WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE; + wlActions |= QtWaylandServer::wl_data_device_manager::dnd_action_move; } if (actions.testFlag(DataDeviceManagerInterface::DnDAction::Ask)) { - wlActions |= WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK; + wlActions |= QtWaylandServer::wl_data_device_manager::dnd_action_ask; } - wl_data_offer_send_source_actions(resource, wlActions); + d->send_source_actions(wlActions); } -DataOfferInterface::DataOfferInterface(AbstractDataSource *source, DataDeviceInterface *parentInterface, wl_resource *parentResource) - : Resource(new Private(source, parentInterface, this, parentResource)) +void DataOfferInterfacePrivate::data_offer_destroy_resource(QtWaylandServer::wl_data_offer::Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +DataOfferInterface::DataOfferInterface(AbstractDataSource *source, wl_resource *resource) + : QObject(nullptr) + , d(new DataOfferInterfacePrivate(source, this, resource)) { Q_ASSERT(source); - connect(source, &DataSourceInterface::mimeTypeOffered, this, - [this](const QString &mimeType) { - Q_D(); - if (!d->resource) { - return; - } - wl_data_offer_send_offer(d->resource, mimeType.toUtf8().constData()); - } - ); - QObject::connect(source, &QObject::destroyed, this, - [this] { - Q_D(); - d->source = nullptr; - } - ); + connect(source, &DataSourceInterface::mimeTypeOffered, this, [this](const QString &mimeType) { + d->send_offer(mimeType); + }); } DataOfferInterface::~DataOfferInterface() = default; void DataOfferInterface::sendAllOffers() { - Q_D(); for (const QString &mimeType : d->source->mimeTypes()) { - wl_data_offer_send_offer(d->resource, mimeType.toUtf8().constData()); + d->send_offer(mimeType); } } -DataOfferInterface::Private *DataOfferInterface::d_func() const +wl_resource *DataOfferInterface::resource() const { - return reinterpret_cast(d.data()); + return d->resource()->handle; } DataDeviceManagerInterface::DnDActions DataOfferInterface::supportedDragAndDropActions() const { - Q_D(); return d->supportedDnDActions; } DataDeviceManagerInterface::DnDAction DataOfferInterface::preferredDragAndDropAction() const { - Q_D(); return d->preferredDnDAction; } void DataOfferInterface::dndAction(DataDeviceManagerInterface::DnDAction action) { - Q_D(); - if (wl_resource_get_version(d->resource) < WL_DATA_OFFER_ACTION_SINCE_VERSION) { + if (d->resource()->version() < WL_DATA_OFFER_ACTION_SINCE_VERSION) { return; } - uint32_t wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE; + uint32_t wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_none; if (action == DataDeviceManagerInterface::DnDAction::Copy) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; - } else if (action == DataDeviceManagerInterface::DnDAction::Move ) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE; + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_copy; + } else if (action == DataDeviceManagerInterface::DnDAction::Move) { + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_move; } else if (action == DataDeviceManagerInterface::DnDAction::Ask) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK; + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_ask; } - wl_data_offer_send_action(d->resource, wlAction); + d->send_action(wlAction); } } -} diff -Nru dwayland-5.57.0.23/src/server/dataoffer_interface.h dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface.h --- dwayland-5.57.0.23/src/server/dataoffer_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,89 +1,66 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DATA_OFFER_INTERFACE_H -#define WAYLAND_SERVER_DATA_OFFER_INTERFACE_H +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include +#include -#include "resource.h" #include "datadevicemanager_interface.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class DataDeviceInterface; -class DataSourceInterface; class AbstractDataSource; +class DataOfferInterfacePrivate; + /** * @brief Represents the Resource for the wl_data_offer interface. * - **/ -class KWAYLANDSERVER_EXPORT DataOfferInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT DataOfferInterface : public QObject { Q_OBJECT public: virtual ~DataOfferInterface(); void sendAllOffers(); + void sendSourceActions(); + wl_resource *resource() const; /** * @returns The Drag and Drop actions supported by this DataOfferInterface. - * @since 5.42 - **/ + */ DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const; /** * @returns The preferred Drag and Drop action of this DataOfferInterface. - * @since 5.42 - **/ + */ DataDeviceManagerInterface::DnDAction preferredDragAndDropAction() const; /** * This event indicates the @p action selected by the compositor after matching the * source/destination side actions. Only one action (or none) will be offered here. - * @since 5.42 - **/ + */ void dndAction(DataDeviceManagerInterface::DnDAction action); Q_SIGNALS: /** * Emitted whenever the supported or preferred Drag and Drop actions changed. - * @since 5.42 - **/ + */ void dragAndDropActionsChanged(); private: - friend class DataDeviceInterface; - explicit DataOfferInterface(AbstractDataSource *source, DataDeviceInterface *parentInterface, wl_resource *parentResource); + friend class DataDeviceInterfacePrivate; + explicit DataOfferInterface(AbstractDataSource *source, wl_resource *resource); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::DataOfferInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::DataOfferInterface *) diff -Nru dwayland-5.57.0.23/src/server/dataoffer_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface_p.h --- dwayland-5.57.0.23/src/server/dataoffer_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dataoffer_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/******************************************************************** -Copyright 2017 Martin Flöser - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_DATAOFFERINTERFACE_P_H -#define KWAYLAND_SERVER_DATAOFFERINTERFACE_P_H -#include "dataoffer_interface.h" -#include "datasource_interface.h" -#include "resource_p.h" -#include - -namespace KWayland -{ -namespace Server -{ - -class Q_DECL_HIDDEN DataOfferInterface::Private : public Resource::Private -{ -public: - Private(AbstractDataSource *source, DataDeviceInterface *parentInterface, DataOfferInterface *q, wl_resource *parentResource); - ~Private(); - AbstractDataSource *source; - DataDeviceInterface *dataDevice; - // defaults are set to sensible values for < version 3 interfaces - DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move; - DataDeviceManagerInterface::DnDAction preferredDnDAction = DataDeviceManagerInterface::DnDAction::Copy; - - void sendSourceActions(); - -private: - DataOfferInterface *q_func() { - return reinterpret_cast(q); - } - void receive(const QString &mimeType, qint32 fd); - static void acceptCallback(wl_client *client, wl_resource *resource, uint32_t serial, const char *mimeType); - static void receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd); - static void finishCallback(wl_client *client, wl_resource *resource); - static void setActionsCallback(wl_client *client, wl_resource *resource, uint32_t dnd_actions, uint32_t preferred_action); - - static const struct wl_data_offer_interface s_interface; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/datasource_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/datasource_interface.cpp --- dwayland-5.57.0.23/src/server/datasource_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datasource_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,227 +1,202 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "datasource_interface.h" -#include "datadevicemanager_interface.h" #include "clientconnection.h" -#include "resource_p.h" +#include "datadevicemanager_interface.h" +#include "utils.h" // Qt #include // Wayland -#include +#include // system #include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class DataSourceInterface::Private : public Resource::Private +class DataSourceInterfacePrivate : public QtWaylandServer::wl_data_source { public: - Private(DataSourceInterface *q, DataDeviceManagerInterface *parent, wl_resource *parentResource); - ~Private(); + DataSourceInterfacePrivate(DataSourceInterface *_q, ::wl_resource *resource); + DataSourceInterface *q; QStringList mimeTypes; DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::None; + bool isAccepted = false; + +protected: + void data_source_destroy_resource(Resource *resource) override; + void data_source_offer(Resource *resource, const QString &mime_type) override; + void data_source_destroy(Resource *resource) override; + void data_source_set_actions(Resource *resource, uint32_t dnd_actions) override; private: - DataSourceInterface *q_func() { - return reinterpret_cast(q); - } void offer(const QString &mimeType); - - static void offerCallback(wl_client *client, wl_resource *resource, const char *mimeType); - static void setActionsCallback(wl_client *client, wl_resource *resource, uint32_t dnd_actions); - static void resourceDestroyedCallback(wl_client *client, wl_resource *resource); - - const static struct wl_data_source_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_data_source_interface DataSourceInterface::Private::s_interface = { - offerCallback, - resourceDestroyedCallback, - setActionsCallback }; -#endif -DataSourceInterface::Private::Private(DataSourceInterface *q, DataDeviceManagerInterface *parent, wl_resource *parentResource) - : Resource::Private(q, parent, parentResource, &wl_data_source_interface, &s_interface) +DataSourceInterfacePrivate::DataSourceInterfacePrivate(DataSourceInterface *_q, ::wl_resource *resource) + : QtWaylandServer::wl_data_source(resource) + , q(_q) { } -DataSourceInterface::Private::~Private() = default; +void DataSourceInterfacePrivate::data_source_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} -void DataSourceInterface::Private::offerCallback(wl_client *client, wl_resource *resource, const char *mimeType) +void DataSourceInterfacePrivate::data_source_offer(QtWaylandServer::wl_data_source::Resource *resource, const QString &mime_type) { - Q_UNUSED(client) - cast(resource)->offer(QString::fromUtf8(mimeType)); + Q_UNUSED(resource) + mimeTypes << mime_type; + Q_EMIT q->mimeTypeOffered(mime_type); } -void DataSourceInterface::Private::resourceDestroyedCallback(wl_client *client, wl_resource *resource) +void DataSourceInterfacePrivate::data_source_destroy(QtWaylandServer::wl_data_source::Resource *resource) { - Q_UNUSED(client) - wl_resource_destroy(resource); + wl_resource_destroy(resource->handle); } -void DataSourceInterface::Private::offer(const QString &mimeType) +void DataSourceInterfacePrivate::offer(const QString &mimeType) { mimeTypes << mimeType; - Q_Q(DataSourceInterface); - emit q->mimeTypeOffered(mimeType); + Q_EMIT q->mimeTypeOffered(mimeType); } -void DataSourceInterface::Private::setActionsCallback(wl_client *client, wl_resource *resource, uint32_t dnd_actions) +void DataSourceInterfacePrivate::data_source_set_actions(Resource *resource, uint32_t dnd_actions) { - Q_UNUSED(client) + // verify that the no other actions are sent + if (dnd_actions + & ~(QtWaylandServer::wl_data_device_manager::dnd_action_copy | QtWaylandServer::wl_data_device_manager::dnd_action_move + | QtWaylandServer::wl_data_device_manager::dnd_action_ask)) { + wl_resource_post_error(resource->handle, error_invalid_action_mask, "Invalid action mask"); + return; + } DataDeviceManagerInterface::DnDActions supportedActions; - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_copy) { supportedActions |= DataDeviceManagerInterface::DnDAction::Copy; } - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_move) { supportedActions |= DataDeviceManagerInterface::DnDAction::Move; } - if (dnd_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) { + if (dnd_actions & QtWaylandServer::wl_data_device_manager::dnd_action_ask) { supportedActions |= DataDeviceManagerInterface::DnDAction::Ask; } - // verify that the no other actions are sent - if (dnd_actions & ~(WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY | WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK)) { - wl_resource_post_error(resource, WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK, "Invalid action mask"); - return; - } - auto p = cast(resource); - if (p->supportedDnDActions!= supportedActions) { - p->supportedDnDActions = supportedActions; - emit p->q_func()->supportedDragAndDropActionsChanged(); + if (supportedDnDActions != supportedActions) { + supportedDnDActions = supportedActions; + Q_EMIT q->supportedDragAndDropActionsChanged(); } } -DataSourceInterface::DataSourceInterface(DataDeviceManagerInterface *parent, wl_resource *parentResource) - : AbstractDataSource(new Private(this, parent, parentResource)) +DataSourceInterface::DataSourceInterface(DataDeviceManagerInterface *parent, wl_resource *resource) + : d(new DataSourceInterfacePrivate(this, resource)) { - if (wl_resource_get_version(parentResource) < WL_DATA_SOURCE_ACTION_SINCE_VERSION) { - Q_D(); + if (d->resource()->version() < WL_DATA_SOURCE_ACTION_SINCE_VERSION) { d->supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy; } } -DataSourceInterface::~DataSourceInterface() { - - emit this->aboutToBeDestroyed(); -} +DataSourceInterface::~DataSourceInterface() = default; void DataSourceInterface::accept(const QString &mimeType) { - Q_D(); - // TODO: does this require a sanity check on the possible mimeType? - if (!d->resource) - return; - wl_data_source_send_target(d->resource, mimeType.isEmpty() ? nullptr : mimeType.toUtf8().constData()); + d->send_target(mimeType); + d->isAccepted = !mimeType.isNull(); } void DataSourceInterface::requestData(const QString &mimeType, qint32 fd) { - Q_D(); - // TODO: does this require a sanity check on the possible mimeType? - if (d->resource) { - wl_data_source_send_send(d->resource, mimeType.toUtf8().constData(), int32_t(fd)); - } + d->send_send(mimeType, int32_t(fd)); close(fd); } void DataSourceInterface::cancel() { - Q_D(); - if (!d->resource) { - return; - } - wl_data_source_send_cancelled(d->resource); - client()->flush(); + d->send_cancelled(); } QStringList DataSourceInterface::mimeTypes() const { - Q_D(); return d->mimeTypes; } DataSourceInterface *DataSourceInterface::get(wl_resource *native) { - return Private::get(native); -} - -DataSourceInterface::Private *DataSourceInterface::d_func() const -{ - return reinterpret_cast(d.data()); + if (auto sourcePrivate = resource_cast(native)) { + return sourcePrivate->q; + } + return nullptr; } DataDeviceManagerInterface::DnDActions DataSourceInterface::supportedDragAndDropActions() const { - Q_D(); return d->supportedDnDActions; } void DataSourceInterface::dropPerformed() { - Q_D(); - if (!d->resource) { + if (d->resource()->version() < WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION) { return; } - if (wl_resource_get_version(d->resource) < WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION) { - return; - } - wl_data_source_send_dnd_drop_performed(d->resource); + d->send_dnd_drop_performed(); } void DataSourceInterface::dndFinished() { - Q_D(); - if (!d->resource) { - return; - } - if (wl_resource_get_version(d->resource) < WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION) { + if (d->resource()->version() < WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION) { return; } - wl_data_source_send_dnd_finished(d->resource); + d->send_dnd_finished(); } void DataSourceInterface::dndAction(DataDeviceManagerInterface::DnDAction action) { - Q_D(); - if (!d->resource) { + if (d->resource()->version() < WL_DATA_SOURCE_ACTION_SINCE_VERSION) { return; } - if (wl_resource_get_version(d->resource) < WL_DATA_SOURCE_ACTION_SINCE_VERSION) { - return; - } - uint32_t wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE; + uint32_t wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_none; if (action == DataDeviceManagerInterface::DnDAction::Copy) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; - } else if (action == DataDeviceManagerInterface::DnDAction::Move ) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE; + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_copy; + } else if (action == DataDeviceManagerInterface::DnDAction::Move) { + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_move; } else if (action == DataDeviceManagerInterface::DnDAction::Ask) { - wlAction = WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK; + wlAction = QtWaylandServer::wl_data_device_manager::dnd_action_ask; } - wl_data_source_send_action(d->resource, wlAction); + d->send_action(wlAction); } +void DataSourceInterface::dndCancelled() +{ + // for v3 or less, cancel should not be called after a failed drag operation + if (wl_resource_get_version(resource()) < 3) { + return; + } + d->send_cancelled(); } + +wl_resource *DataSourceInterface::resource() const +{ + return d->resource()->handle; +} + +wl_client *DataSourceInterface::client() const +{ + return d->resource()->client(); +} + +bool DataSourceInterface::isAccepted() const +{ + return d->isAccepted; +} + +void DataSourceInterface::setAccepted(bool accepted) +{ + d->isAccepted = accepted; +} + } diff -Nru dwayland-5.57.0.23/src/server/datasource_interface.h dwayland-5.57.0.24+really5.24.3/src/server/datasource_interface.h --- dwayland-5.57.0.23/src/server/datasource_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/datasource_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,40 +1,24 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DATA_SOURCE_INTERFACE_H -#define WAYLAND_SERVER_DATA_SOURCE_INTERFACE_H - -#include +#include "abstract_data_source.h" -#include +#include -#include "abstract_data_source.h" #include "datadevicemanager_interface.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class DataSourceInterfacePrivate; /** * @brief Represents the Resource for the wl_data_source interface. - **/ + */ class KWAYLANDSERVER_EXPORT DataSourceInterface : public AbstractDataSource { Q_OBJECT @@ -51,38 +35,28 @@ /** * @returns The Drag and Drop actions supported by this DataSourceInterface. - * @since 5.42 - **/ + */ DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override; - /** - * The user performed the drop action during a drag and drop operation. - * @since 5.42 - **/ void dropPerformed() override; - /** - * The drop destination finished interoperating with this data source. - * @since 5.42 - **/ void dndFinished() override; - /** - * This event indicates the @p action selected by the compositor after matching the - * source/destination side actions. Only one action (or none) will be offered here. - * @since 5.42 - **/ void dndAction(DataDeviceManagerInterface::DnDAction action) override; + void dndCancelled() override; + + wl_resource *resource() const; + + wl_client *client() const override; + + bool isAccepted() const override; + void setAccepted(bool accepted); private: - friend class DataDeviceManagerInterface; + friend class DataDeviceManagerInterfacePrivate; explicit DataSourceInterface(DataDeviceManagerInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::DataSourceInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::DataSourceInterface *) diff -Nru dwayland-5.57.0.23/src/server/ddekeyboard_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface.cpp --- dwayland-5.57.0.23/src/server/ddekeyboard_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2021 luochaojiang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -20,137 +20,91 @@ #include "ddeseat_interface.h" #include "ddekeyboard_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "display.h" #include "logging.h" -#include -#include -#include "wayland-dde-seat-server-protocol.h" +#include "qwayland-server-dde-seat.h" -namespace KWayland -{ -namespace Server -{ +#include "ddekeyboard_interface_p.h" -class DDEKeyboardInterface::Private : public Resource::Private +namespace KWaylandServer { -public: - Private(DDESeatInterface *parent, wl_resource *parentResource, DDEKeyboardInterface *q); - - void sendKeymap(int fd, quint32 size); - void sendModifiers(); - void sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial); - - DDESeatInterface *ddeSeat; - QMetaObject::Connection destroyConnection; - -private: - DDEKeyboardInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct dde_keyboard_interface s_keboard_interface; -}; - /********************************* * DDEKeyboardInterface *********************************/ -DDEKeyboardInterface::Private::Private(DDESeatInterface *parent, wl_resource *parentResource, DDEKeyboardInterface *q) - : Resource::Private(q, parent, parentResource, &dde_keyboard_interface, &s_keboard_interface) - , ddeSeat(parent) +DDEKeyboardInterfacePrivate *DDEKeyboardInterfacePrivate::get(DDEKeyboardInterface *keyboard) { + return keyboard->d.data(); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_keyboard_interface DDEKeyboardInterface::Private::s_keboard_interface = { - resourceDestroyedCallback, -}; -#endif - -DDEKeyboardInterface::DDEKeyboardInterface(DDESeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) +DDEKeyboardInterfacePrivate::DDEKeyboardInterfacePrivate(DDEKeyboardInterface *q, DDESeatInterface *seat, wl_resource *resource) + : QtWaylandServer::dde_keyboard(resource) + , q(q) + , ddeSeat(seat) { } -DDEKeyboardInterface::~DDEKeyboardInterface() = default; +DDEKeyboardInterfacePrivate::~DDEKeyboardInterfacePrivate() = default; -DDESeatInterface *DDEKeyboardInterface::ddeSeat() const { - Q_D(); - return reinterpret_cast(d->global); +void DDEKeyboardInterfacePrivate::dde_keyboard_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); } -DDEKeyboardInterface::Private *DDEKeyboardInterface::d_func() const +DDEKeyboardInterface::DDEKeyboardInterface(DDESeatInterface *seat, wl_resource *resource) + : d(new DDEKeyboardInterfacePrivate(this, seat, resource)) { - return reinterpret_cast(d.data()); +} + +DDEKeyboardInterface::~DDEKeyboardInterface() = default; + +DDESeatInterface *DDEKeyboardInterface::ddeSeat() const +{ + return d->ddeSeat; } void DDEKeyboardInterface::setKeymap(int fd, quint32 size) { - Q_D(); d->sendKeymap(fd, size); } -void DDEKeyboardInterface::Private::sendKeymap(int fd, quint32 size) +void DDEKeyboardInterfacePrivate::sendKeymap(int fd, quint32 size) { - if (!resource) { - return; - } - dde_keyboard_send_keymap(resource, DDE_KEYBOARD_KEYMAP_FORMAT_XKB_V1, fd, size); + send_keymap(keymap_format_xkb_v1, fd, size); } -void DDEKeyboardInterface::Private::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) +void DDEKeyboardInterfacePrivate::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) { - if (!resource) { - return; - } - dde_keyboard_send_modifiers(resource, serial, depressed, latched, locked, group); + send_modifiers(serial, depressed, latched, locked, group); } -void DDEKeyboardInterface::Private::sendModifiers() +void DDEKeyboardInterfacePrivate::sendModifiers() { sendModifiers(ddeSeat->depressedModifiers(), ddeSeat->latchedModifiers(), ddeSeat->lockedModifiers(), ddeSeat->groupModifiers(), ddeSeat->lastModifiersSerial()); } void DDEKeyboardInterface::keyPressed(quint32 key, quint32 serial) { - Q_D(); - if (!d->resource) { - return; - } - - dde_keyboard_send_key(d->resource, serial, d->ddeSeat->timestamp(), key, DDE_KEYBOARD_KEY_STATE_PRESSED); + d->send_key(serial, d->ddeSeat->timestamp(), key, QtWaylandServer::dde_keyboard::key_state::key_state_pressed); } void DDEKeyboardInterface::keyReleased(quint32 key, quint32 serial) { - Q_D(); - if (!d->resource) { - return; - } - - dde_keyboard_send_key(d->resource, serial, d->ddeSeat->timestamp(), key, DDE_KEYBOARD_KEY_STATE_RELEASED); + d->send_key(serial, d->ddeSeat->timestamp(), key, QtWaylandServer::dde_keyboard::key_state::key_state_released); } void DDEKeyboardInterface::updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) { - Q_D(); d->sendModifiers(depressed, latched, locked, group, serial); } void DDEKeyboardInterface::repeatInfo(qint32 charactersPerSecond, qint32 delay) { - Q_D(); - if (!d->resource) { - return; - } - if (wl_resource_get_version(d->resource) < DDE_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { + if (d->resource()->version() < WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { // only supported since version 4 return; } - dde_keyboard_send_repeat_info(d->resource, charactersPerSecond, delay); + d->send_repeat_info(charactersPerSecond, delay); } -} } \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddekeyboard_interface.h dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface.h --- dwayland-5.57.0.23/src/server/ddekeyboard_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2021 luochaojiang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,27 +17,18 @@ You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ -#ifndef WAYLAND_SERVER_DDE_KEYBOARD_INTERFACE_H -#define WAYLAND_SERVER_DDE_KEYBOARD_INTERFACE_H +#pragma once #include -#include -#include -#include - -#include -#include "global.h" -#include "resource.h" + +#include struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - -class Display; class DDESeatInterface; +class DDEKeyboardInterfacePrivate; /** * @brief Resource for the dde_keyboard interface. @@ -46,11 +37,10 @@ * * @since 5.4 **/ -class KWAYLANDSERVER_EXPORT DDEKeyboardInterface : public Resource +class KWAYLANDSERVER_EXPORT DDEKeyboardInterface : public QObject { Q_OBJECT public: - explicit DDEKeyboardInterface(DDESeatInterface *ddeSeat, wl_resource *parentResource); virtual ~DDEKeyboardInterface(); /** @@ -65,11 +55,11 @@ void repeatInfo(qint32 charactersPerSecond, qint32 delay); private: - class Private; - Private *d_func() const; + friend class DDESeatInterface; + friend class DDESeatInterfacePrivate; + friend class DDEKeyboardInterfacePrivate; + explicit DDEKeyboardInterface(DDESeatInterface *ddeSeat, wl_resource *resource); + QScopedPointer d; }; -} -} - -#endif \ No newline at end of file +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddekeyboard_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface_p.h --- dwayland-5.57.0.23/src/server/ddekeyboard_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddekeyboard_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,52 @@ +/******************************************************************** +Copyright 2022 luochaojiang + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) version 3, or any +later version accepted by the membership of KDE e.V. (or its +successor approved by the membership of KDE e.V.), which shall +act as a proxy defined in Section 6 of version 3 of the license. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library. If not, see . +*********************************************************************/ +#pragma once + +// KWayland +#include "ddekeyboard_interface.h" +// Qt +#include +#include +#include +#include + +#include "qwayland-server-dde-seat.h" + +namespace KWaylandServer +{ +class DDEKeyboardInterfacePrivate : public QtWaylandServer::dde_keyboard +{ +public: + static DDEKeyboardInterfacePrivate *get(DDEKeyboardInterface *ddekeyboard); + + DDEKeyboardInterfacePrivate(DDEKeyboardInterface *q, DDESeatInterface *seat, wl_resource *resource); + ~DDEKeyboardInterfacePrivate() override; + + void sendKeymap(int fd, quint32 size); + void sendModifiers(); + void sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial); + + DDEKeyboardInterface *q; + DDESeatInterface *ddeSeat; +protected: + void dde_keyboard_release(Resource *resource) override; +}; + +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddeseat_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface.cpp --- dwayland-5.57.0.23/src/server/ddeseat_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2020 wugang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,262 +19,71 @@ *********************************************************************/ #include "ddeseat_interface.h" #include "ddekeyboard_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "display.h" #include "logging.h" +#include "utils.h" -#include -#include -#include "wayland-dde-seat-server-protocol.h" - -#define MAX_WINDOWS 50 - -namespace KWayland -{ -namespace Server -{ - -class DDESeatInterface::Private : public Global::Private -{ -public: - - Private(DDESeatInterface *q, Display *d); - - QVector ddePointers; - static DDESeatInterface *get(wl_resource *native); - - QVector ddeKeyboards; - quint32 timestamp = 0; - - QVector ddeTouchs; - quint32 touchtimestamp = 0; - - // Keyboard related members - struct Keyboard { - enum class State { - Released, - Pressed - }; - QHash states; - struct Keymap { - int fd = -1; - quint32 size = 0; - bool xkbcommonCompatible = false; - }; - Keymap keymap; - struct Modifiers { - quint32 depressed = 0; - quint32 latched = 0; - quint32 locked = 0; - quint32 group = 0; - quint32 serial = 0; - }; - Modifiers modifiers; - quint32 lastStateSerial = 0; - struct { - qint32 charactersPerSecond = 0; - qint32 delay = 0; - } keyRepeat; - }; - Keyboard keys; - bool updateKey(quint32 key, Keyboard::State state); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - void getPointer(wl_client *client, wl_resource *resource, uint32_t id); - void getKeyboard(wl_client *client, wl_resource *resource, uint32_t id); - void getTouch(wl_client *client, wl_resource *resource, uint32_t id); - // interface - static void getPointerCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getTouchCallback(wl_client *client, wl_resource *resource, uint32_t id); - static const struct dde_seat_interface s_interface; - - static const quint32 s_version; - static const qint32 s_ddePointerVersion; - static const qint32 s_ddeKeyboardVersion; - static const qint32 s_ddeTouchVersion; - DDESeatInterface *q; -}; - -class DDEPointerInterface::Private : public Resource::Private -{ -public: - Private(DDESeatInterface *parent, wl_resource *parentResource, DDEPointerInterface *q); - - DDESeatInterface *ddeSeat; - QMetaObject::Connection destroyConnection; - -private: - DDEPointerInterface *q_func() { - return reinterpret_cast(q); - } - - void getMotion(wl_resource *resource); - // interface - static void getMotionCallback(wl_client *client, wl_resource *resource); - - static const struct dde_pointer_interface s_interface; -}; - -class DDETouchInterface::Private : public Resource::Private -{ -public: - Private(DDESeatInterface *parent, wl_resource *parentResource, DDETouchInterface *q); - - DDESeatInterface *ddeSeat; - QMetaObject::Connection destroyConnection; - -private: - DDETouchInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct dde_touch_interface s_touch_interface; -}; - -const quint32 DDESeatInterface::Private::s_version = 1; -const qint32 DDESeatInterface::Private::s_ddePointerVersion = 1; -const qint32 DDESeatInterface::Private::s_ddeKeyboardVersion = 7; -const qint32 DDESeatInterface::Private::s_ddeTouchVersion = 1; +#include -DDESeatInterface::Private::Private(DDESeatInterface *q, Display *d) - : Global::Private(d, &dde_seat_interface, s_version) - , q(q) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_seat_interface DDESeatInterface::Private::s_interface = { - getPointerCallback, - getKeyboardCallback, - getTouchCallback, -}; -#endif - -DDESeatInterface *DDESeatInterface::Private::get(wl_resource *native) -{ - if (Private *p = cast(native)) { - return p->q; - } - return nullptr; -} - -DDESeatInterface::Private *DDESeatInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -DDESeatInterface::DDESeatInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} +#include "ddeseat_interface_p.h" +#include "ddekeyboard_interface_p.h" -DDESeatInterface::~DDESeatInterface() = default; - -DDESeatInterface *DDESeatInterface::get(wl_resource* native) +namespace KWaylandServer { - return Private::get(native); -} +static const int s_version = 1; +static const int s_ddePointerVersion = 1; +static const int s_ddeTouchVersion = 7; +static const int s_ddeKeyboardVersion = 7; -void DDESeatInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +/********************************* + * DDESeatInterface + *********************************/ +DDESeatInterfacePrivate::DDESeatInterfacePrivate(DDESeatInterface *q, Display *d) + : QtWaylandServer::dde_seat(*d, s_version) + , q(q) + , display(d) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&dde_seat_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - - wl_resource_set_implementation(resource, &s_interface, this, nullptr); - } -void DDESeatInterface::Private::getPointerCallback(wl_client *client, wl_resource *resource, uint32_t id) +DDESeatInterfacePrivate *DDESeatInterfacePrivate::get(DDESeatInterface *ddeseat) { - cast(resource)->getPointer(client, resource, id); + return ddeseat->d.data(); } -void DDESeatInterface::Private::getPointer(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has pointer? - DDEPointerInterface *ddePointer = new DDEPointerInterface(q, resource); - auto clientConnection = display->getConnection(client); - ddePointer->create(clientConnection, qMin(wl_resource_get_version(resource), s_ddePointerVersion), id); - if (!ddePointer->resource()) { - wl_resource_post_no_memory(resource); - delete ddePointer; - return; +void DDESeatInterfacePrivate::dde_seat_get_dde_pointer(Resource *resource, uint32_t id) { + if (ddepointer) { + DDEPointerInterfacePrivate *pointerPrivate = DDEPointerInterfacePrivate::get(ddepointer.data()); + pointerPrivate->add(resource->client(), id, resource->version()); + } else { + wl_resource *pointer_resource = wl_resource_create(resource->client(), &dde_pointer_interface, s_ddePointerVersion, id); + ddepointer.reset(new DDEPointerInterface(q, pointer_resource)); + Q_EMIT q->ddePointerCreated(ddepointer.data()); } - ddePointers << ddePointer; - QObject::connect(ddePointer, &QObject::destroyed, q, - [ddePointer,this] { - ddePointers.removeAt(ddePointers.indexOf(ddePointer)); - } - ); - emit q->ddePointerCreated(ddePointer); -} - -void DDESeatInterface::Private::getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->getKeyboard(client, resource, id); } -void DDESeatInterface::Private::getKeyboard(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has keyboard? - DDEKeyboardInterface *keyboard = new DDEKeyboardInterface(q, resource); - auto clientConnection = display->getConnection(client); - keyboard->create(clientConnection, qMin(wl_resource_get_version(resource), s_ddeKeyboardVersion), id); - if (!keyboard->resource()) { - wl_resource_post_no_memory(resource); - delete keyboard; - return; +void DDESeatInterfacePrivate::dde_seat_get_dde_keyboard(Resource *resource, uint32_t id) { + if (ddekeyboard) { + DDEKeyboardInterfacePrivate *keyboardPrivate = DDEKeyboardInterfacePrivate::get(ddekeyboard.data()); + keyboardPrivate->add(resource->client(), id, resource->version()); + } else { + wl_resource *keyboard_resource = wl_resource_create(resource->client(), &dde_keyboard_interface, s_ddeKeyboardVersion, id); + ddekeyboard.reset(new DDEKeyboardInterface(q, keyboard_resource)); + Q_EMIT q->ddeKeyboardCreated(ddekeyboard.data()); } - keyboard->repeatInfo(keys.keyRepeat.charactersPerSecond, keys.keyRepeat.delay); - if (keys.keymap.xkbcommonCompatible) { - keyboard->setKeymap(keys.keymap.fd, keys.keymap.size); - } - ddeKeyboards << keyboard; - QObject::connect(keyboard, &QObject::destroyed, q, - [keyboard,this] { - ddeKeyboards.removeAt(ddeKeyboards.indexOf(keyboard)); - } - ); - emit q->ddeKeyboardCreated(keyboard); -} - -void DDESeatInterface::Private::getTouchCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->getTouch(client, resource, id); } -void DDESeatInterface::Private::getTouch(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has touch? - DDETouchInterface *touch = new DDETouchInterface(q, resource); - auto clientConnection = display->getConnection(client); - touch->create(clientConnection, qMin(wl_resource_get_version(resource), s_ddeTouchVersion), id); - if (!touch->resource()) { - wl_resource_post_no_memory(resource); - delete touch; - return; +void DDESeatInterfacePrivate::dde_seat_get_dde_touch(Resource *resource, uint32_t id) { + if (ddetouch) { + DDETouchInterfacePrivate *touchPrivate = DDETouchInterfacePrivate::get(ddetouch.data()); + touchPrivate->add(resource->client(), id, resource->version()); + } else { + wl_resource *touch_resource = wl_resource_create(resource->client(), &dde_touch_interface, s_ddeTouchVersion, id); + ddetouch.reset(new DDETouchInterface(q, touch_resource)); + Q_EMIT q->ddeTouchCreated(ddetouch.data()); } - ddeTouchs << touch; - QObject::connect(touch, &QObject::destroyed, q, - [touch,this] { - ddeTouchs.removeAt(ddeTouchs.indexOf(touch)); - } - ); - emit q->ddeTouchCreated(touch); } -bool DDESeatInterface::Private::updateKey(quint32 key, Keyboard::State state) +bool DDESeatInterfacePrivate::updateKey(quint32 key, Keyboard::State state) { auto it = keys.states.find(key); if (it == keys.states.end()) { @@ -288,55 +97,70 @@ return true; } +DDESeatInterface::DDESeatInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new DDESeatInterfacePrivate(this, display)) +{ +} + +DDESeatInterface::~DDESeatInterface() = default; + +DDESeatInterface *DDESeatInterface::get(wl_resource* native) +{ + if (DDESeatInterfacePrivate *seatPrivate = resource_cast(native)) { + return seatPrivate->q; + } + return nullptr; +} + QPointF DDESeatInterface::pointerPos() const { - Q_D(); - return globalPos; + return d->globalPos; } void DDESeatInterface::setPointerPos(const QPointF &pos) { - Q_D(); - if (globalPos == pos) { + if (!d->ddepointer) { return; } - globalPos = pos; - emit pointerPosChanged(pos); + if (d->globalPos == pos) { + return; + } + d->globalPos = pos; + d->ddepointer->sendMotion(pos); } void DDESeatInterface::pointerButtonPressed(quint32 button) { - Q_D(); - for (auto it = d->ddePointers.constBegin(), end = d->ddePointers.constEnd(); it != end; ++it) { - (*it)->buttonPressed(button); + if (!d->ddepointer) { + return; } + d->ddepointer->buttonPressed(button); } void DDESeatInterface::pointerButtonReleased(quint32 button) { - Q_D(); - for (auto it = d->ddePointers.constBegin(), end = d->ddePointers.constEnd(); it != end; ++it) { - (*it)->buttonReleased(button); + if (!d->ddepointer) { + return; } + d->ddepointer->buttonReleased(button); } void DDESeatInterface::pointerAxis(Qt::Orientation orientation, qint32 delta) { - Q_D(); - for (auto it = d->ddePointers.constBegin(), end = d->ddePointers.constEnd(); it != end; ++it) { - (*it)->axis(orientation, delta); + if (!d->ddepointer) { + return; } + d->ddepointer->axis(orientation, delta); } quint32 DDESeatInterface::timestamp() const { - Q_D(); return d->timestamp; } void DDESeatInterface::setTimestamp(quint32 time) { - Q_D(); if (d->timestamp == time) { return; } @@ -345,13 +169,11 @@ quint32 DDESeatInterface::touchtimestamp() const { - Q_D(); return d->touchtimestamp; } void DDESeatInterface::setTouchTimestamp(quint32 time) { - Q_D(); if (d->touchtimestamp == time) { return; } @@ -360,66 +182,71 @@ void DDESeatInterface::setKeymap(int fd, quint32 size) { - Q_D(); + if (!d->ddekeyboard) { + return; + } d->keys.keymap.xkbcommonCompatible = true; d->keys.keymap.fd = fd; d->keys.keymap.size = size; - for (auto it = d->ddeKeyboards.constBegin(); it != d->ddeKeyboards.constEnd(); ++it) { - (*it)->setKeymap(fd, size); - } + + d->ddekeyboard->setKeymap(fd, size); } void DDESeatInterface::keyPressed(quint32 key) { - Q_D(); - d->keys.lastStateSerial = d->display->nextSerial(); - if (!d->updateKey(key, Private::Keyboard::State::Pressed)) { + if (!d->ddekeyboard) { return; } - for (auto it = d->ddeKeyboards.constBegin(), end = d->ddeKeyboards.constEnd(); it != end; ++it) { - (*it)->keyPressed(key, d->keys.lastStateSerial); + d->keys.lastStateSerial = d->display->nextSerial(); + if (!d->updateKey(key, DDESeatInterfacePrivate::Keyboard::State::Pressed)) { + return; } + + d->ddekeyboard->keyPressed(key, d->keys.lastStateSerial); } void DDESeatInterface::keyReleased(quint32 key) { - Q_D(); - d->keys.lastStateSerial = d->display->nextSerial(); - if (!d->updateKey(key, Private::Keyboard::State::Released)) { + if (!d->ddekeyboard) { return; } - for (auto it = d->ddeKeyboards.constBegin(), end = d->ddeKeyboards.constEnd(); it != end; ++it) { - (*it)->keyReleased(key, d->keys.lastStateSerial); + d->keys.lastStateSerial = d->display->nextSerial(); + if (!d->updateKey(key, DDESeatInterfacePrivate::Keyboard::State::Released)) { + return; } + + d->ddekeyboard->keyReleased(key, d->keys.lastStateSerial); } void DDESeatInterface::touchDown(qint32 id, const QPointF &pos) { - Q_D(); - for (auto it = d->ddeTouchs.constBegin(), end = d->ddeTouchs.constEnd(); it != end; ++it) { - (*it)->touchDown(id, pos); + if (!d->ddetouch) { + return; } + d->ddetouch->touchDown(id, pos); } void DDESeatInterface::touchMotion(qint32 id, const QPointF &pos) { - Q_D(); - for (auto it = d->ddeTouchs.constBegin(), end = d->ddeTouchs.constEnd(); it != end; ++it) { - (*it)->touchMotion(id, pos); + if (!d->ddetouch) { + return; } + d->ddetouch->touchMotion(id, pos); } void DDESeatInterface::touchUp(qint32 id) { - Q_D(); - for (auto it = d->ddeTouchs.constBegin(), end = d->ddeTouchs.constEnd(); it != end; ++it) { - (*it)->touchUp(id); + if (!d->ddetouch) { + return; } + d->ddetouch->touchUp(id); } void DDESeatInterface::updateKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) { - Q_D(); + if (!d->ddekeyboard) { + return; + } bool changed = false; #define UPDATE( value ) \ if (d->keys.modifiers.value != value) { \ @@ -435,186 +262,169 @@ } const quint32 serial = d->display->nextSerial(); d->keys.modifiers.serial = serial; - for (auto it = d->ddeKeyboards.constBegin(), end = d->ddeKeyboards.constEnd(); it != end; ++it) { - (*it)->updateModifiers(depressed, latched, locked, group, serial); - } + + d->ddekeyboard->updateModifiers(depressed, latched, locked, group, serial); } quint32 DDESeatInterface::depressedModifiers() const { - Q_D(); return d->keys.modifiers.depressed; } quint32 DDESeatInterface::groupModifiers() const { - Q_D(); return d->keys.modifiers.group; } quint32 DDESeatInterface::latchedModifiers() const { - Q_D(); return d->keys.modifiers.latched; } quint32 DDESeatInterface::lockedModifiers() const { - Q_D(); return d->keys.modifiers.locked; } quint32 DDESeatInterface::lastModifiersSerial() const { - Q_D(); return d->keys.modifiers.serial; } -/********************************* - * DDEPointerInterface - *********************************/ -DDEPointerInterface::Private::Private(DDESeatInterface *parent, wl_resource *parentResource, DDEPointerInterface *q) - : Resource::Private(q, parent, parentResource, &dde_pointer_interface, &s_interface) - , ddeSeat(parent) +void DDESeatInterface::setHasKeyboard(bool has) +{ + Q_UNUSED(has) +} + +void DDESeatInterface::setHasPointer(bool has) { + Q_UNUSED(has) } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_pointer_interface DDEPointerInterface::Private::s_interface = { - getMotionCallback, -}; -#endif - -DDEPointerInterface::DDEPointerInterface(DDESeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) -{ - connect(parent, &DDESeatInterface::pointerPosChanged, this, [this] { - Q_D(); - if (d->resource) { - const QPointF globalPos = d->ddeSeat->pointerPos(); - dde_pointer_send_motion(d->resource, wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y())); - } - }); +void DDESeatInterface::setHasTouch(bool has) +{ + Q_UNUSED(has) } -DDEPointerInterface::~DDEPointerInterface() = default; +/********************************* + * DDEPointerInterface + *********************************/ +DDEPointerInterfacePrivate *DDEPointerInterfacePrivate::get(DDEPointerInterface *pointer) +{ + return pointer->d.data(); +} -DDESeatInterface *DDEPointerInterface::ddeSeat() const { - Q_D(); - return reinterpret_cast(d->global); +DDEPointerInterfacePrivate::DDEPointerInterfacePrivate(DDEPointerInterface *q, DDESeatInterface *seat, wl_resource *resource) + : QtWaylandServer::dde_pointer(resource) + , q(q) + , ddeSeat(seat) +{ } -DDEPointerInterface::Private *DDEPointerInterface::d_func() const +DDEPointerInterfacePrivate::~DDEPointerInterfacePrivate() { - return reinterpret_cast(d.data()); } -void DDEPointerInterface::Private::getMotion(wl_resource *resource) +void DDEPointerInterfacePrivate::dde_pointer_get_motion(Resource *resource) { + Q_UNUSED(resource) + const QPointF globalPos = ddeSeat->pointerPos(); - dde_pointer_send_motion(resource, wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y())); + send_motion(wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y())); } -void DDEPointerInterface::Private::getMotionCallback(wl_client *client, wl_resource *resource) +DDEPointerInterface::DDEPointerInterface(DDESeatInterface *seat, wl_resource *resource) + : d(new DDEPointerInterfacePrivate(this, seat, resource)) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); +} + +DDEPointerInterface::~DDEPointerInterface() = default; - s->getMotion(resource); +DDESeatInterface *DDEPointerInterface::ddeSeat() const +{ + return d->ddeSeat; } void DDEPointerInterface::buttonPressed(quint32 button) { - Q_D(); - if (!d->resource) { - return; - } const QPointF globalPos = d->ddeSeat->pointerPos(); - dde_pointer_send_button(d->resource, wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y()), button, DDE_POINTER_BUTTON_STATE_PRESSED); + d->send_button(wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y()), button, + QtWaylandServer::dde_pointer::button_state::button_state_pressed); } void DDEPointerInterface::buttonReleased(quint32 button) { - Q_D(); - if (!d->resource) { - return; - } const QPointF globalPos = d->ddeSeat->pointerPos(); - dde_pointer_send_button(d->resource, wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y()), button, DDE_POINTER_BUTTON_STATE_RELEASED); + d->send_button(wl_fixed_from_double(globalPos.x()), wl_fixed_from_double(globalPos.y()), button, + QtWaylandServer::dde_pointer::button_state::button_state_released); } void DDEPointerInterface::axis(Qt::Orientation orientation, qint32 delta) { - Q_D(); - if (!d->resource) { - return; - } - dde_pointer_send_axis(d->resource, 0, - (orientation == Qt::Vertical) ? WL_POINTER_AXIS_VERTICAL_SCROLL : WL_POINTER_AXIS_HORIZONTAL_SCROLL, - wl_fixed_from_int(delta)); + d->send_axis(0, (orientation == Qt::Vertical) ? WL_POINTER_AXIS_VERTICAL_SCROLL : WL_POINTER_AXIS_HORIZONTAL_SCROLL, + wl_fixed_from_int(delta)); +} + +void DDEPointerInterface::sendMotion(const QPointF &position) +{ + d->send_motion(wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); } /********************************* * DDETouchInterface *********************************/ -DDETouchInterface::Private::Private(DDESeatInterface *parent, wl_resource *parentResource, DDETouchInterface *q) - : Resource::Private(q, parent, parentResource, &dde_touch_interface, &s_touch_interface) - , ddeSeat(parent) +DDETouchInterfacePrivate *DDETouchInterfacePrivate::get(DDETouchInterface *touch) { + return touch->d.data(); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_touch_interface DDETouchInterface::Private::s_touch_interface = { - resourceDestroyedCallback, -}; -#endif - -DDETouchInterface::DDETouchInterface(DDESeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) +DDETouchInterfacePrivate::DDETouchInterfacePrivate(DDETouchInterface *q, DDESeatInterface *seat, wl_resource *resource) + : QtWaylandServer::dde_touch(resource) + , q(q) + , ddeSeat(seat) { } -DDETouchInterface::~DDETouchInterface() = default; +DDETouchInterfacePrivate::~DDETouchInterfacePrivate() = default; -DDESeatInterface *DDETouchInterface::ddeSeat() const { - Q_D(); - return reinterpret_cast(d->global); +void DDETouchInterfacePrivate::dde_touch_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); } -DDETouchInterface::Private *DDETouchInterface::d_func() const +DDETouchInterface::DDETouchInterface(DDESeatInterface *seat, wl_resource *resource) + : d(new DDETouchInterfacePrivate(this, seat, resource)) { - return reinterpret_cast(d.data()); } -void DDETouchInterface::touchDown(qint32 id, const QPointF &pos) +DDETouchInterface *DDETouchInterface::get(wl_resource *native) { - Q_D(); - if (!d->resource) { - return; + if (DDETouchInterfacePrivate *touchPrivate = resource_cast(native)) { + return touchPrivate->q; } + return nullptr; +} + +DDETouchInterface::~DDETouchInterface() = default; - dde_touch_send_down(d->resource, id, d->ddeSeat->touchtimestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +DDESeatInterface *DDETouchInterface::ddeSeat() const +{ + return d->ddeSeat; } -void DDETouchInterface::touchMotion(qint32 id, const QPointF &pos) +void DDETouchInterface::touchDown(qint32 id, const QPointF &pos) { - Q_D(); - if (!d->resource) { - return; - } + d->send_down(id, d->ddeSeat->touchtimestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +} - dde_touch_send_motion(d->resource, id, d->ddeSeat->touchtimestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +void DDETouchInterface::touchMotion(qint32 id, const QPointF &pos) +{ + d->send_motion(id, d->ddeSeat->touchtimestamp(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); } void DDETouchInterface::touchUp(qint32 id) { - Q_D(); - if (!d->resource) { - return; - } - - dde_touch_send_up(d->resource, id, d->ddeSeat->touchtimestamp()); + d->send_up(id, d->ddeSeat->touchtimestamp()); } -} } \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddeseat_interface.h dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface.h --- dwayland-5.57.0.23/src/server/ddeseat_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2020 wugang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,68 +17,45 @@ You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ -#ifndef WAYLAND_SERVER_DDE_SEAT_INTERFACE_H -#define WAYLAND_SERVER_DDE_SEAT_INTERFACE_H +#pragma once #include -#include -#include -#include - -#include -#include "global.h" -#include "resource.h" +#include + +#include struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; class DDEPointerInterface; class DDEKeyboardInterface; class DDETouchInterface; +class DDESeatInterfacePrivate; +class DDEPointerInterfacePrivate; +class DDETouchInterfacePrivate; + /** @class DDESeatInterface * * * @see DDESeatInterface * @since 5.5 */ -class KWAYLANDSERVER_EXPORT DDESeatInterface : public Global +class KWAYLANDSERVER_EXPORT DDESeatInterface : public QObject { Q_OBJECT public: + explicit DDESeatInterface(Display *display, QObject *parent = nullptr); virtual ~DDESeatInterface(); static DDESeatInterface *get(wl_resource *native); - /** - * Updates the global pointer @p pos. - * - **/ void setPointerPos(const QPointF &pos); - /** - * @returns the global pointer position - **/ QPointF pointerPos() const; - /** - * Marks the @p button as pressed. - * - * If there is a focused pointer surface a button pressed event is sent to it. - * - * @param button The Linux button code - **/ + void pointerButtonPressed(quint32 button); - /** - * Marks the @p button as released. - * - * If there is a focused pointer surface a button release event is sent to it. - * - * @param button The Linux button code - **/ void pointerButtonReleased(quint32 button); void pointerAxis(Qt::Orientation orientation, qint32 delta); @@ -103,23 +80,24 @@ void touchMotion(qint32 id, const QPointF &pos); void touchUp(qint32 id); + void setHasPointer(bool has); + void setHasKeyboard(bool has); + void setHasTouch(bool has); + Q_SIGNALS: /** * Emitted whenever a DDEPointerInterface got created. **/ - void ddePointerCreated(KWayland::Server::DDEPointerInterface*); + void ddePointerCreated(KWaylandServer::DDEPointerInterface*); void pointerPosChanged(const QPointF &pos); - void ddeKeyboardCreated(KWayland::Server::DDEKeyboardInterface*); + void ddeKeyboardCreated(KWaylandServer::DDEKeyboardInterface*); - void ddeTouchCreated(KWayland::Server::DDETouchInterface*); + void ddeTouchCreated(KWaylandServer::DDETouchInterface*); private: - friend class Display; - explicit DDESeatInterface(Display *display, QObject *parent = nullptr); - QPointF globalPos; - class Private; - Private *d_func() const; + QScopedPointer d; + friend class DDESeatInterfacePrivate; }; /** @@ -129,11 +107,11 @@ * * @since 5.4 **/ -class KWAYLANDSERVER_EXPORT DDEPointerInterface : public Resource +class KWAYLANDSERVER_EXPORT DDEPointerInterface : public QObject { Q_OBJECT public: - virtual ~DDEPointerInterface(); + ~DDEPointerInterface() override; /** * @returns The DDESeatInterface which created this DDEPointerInterface. @@ -146,17 +124,18 @@ **/ static DDEPointerInterface *get(wl_resource *native); -Q_SIGNALS: - void getMotionRequested(); - private: friend class DDESeatInterface; + friend class DDESeatInterfacePrivate; + friend class DDEPointerInterfacePrivate; + + explicit DDEPointerInterface(DDESeatInterface *seat, wl_resource *resource); + QScopedPointer d; + void buttonPressed(quint32 button); void buttonReleased(quint32 button); void axis(Qt::Orientation orientation, qint32 delta); - explicit DDEPointerInterface(DDESeatInterface *ddeSeat, wl_resource *parentResource); - class Private; - Private *d_func() const; + void sendMotion(const QPointF &position); }; /** @@ -166,7 +145,7 @@ * * @since 5.4 **/ -class KWAYLANDSERVER_EXPORT DDETouchInterface : public Resource +class KWAYLANDSERVER_EXPORT DDETouchInterface : public QObject { Q_OBJECT public: @@ -185,16 +164,15 @@ private: friend class DDESeatInterface; + friend class DDESeatInterfacePrivate; + friend class DDETouchInterfacePrivate; void touchDown(qint32 id, const QPointF &pos); void touchMotion(qint32 id, const QPointF &pos); void touchUp(qint32 id); - explicit DDETouchInterface(DDESeatInterface *ddeSeat, wl_resource *parentResource); - class Private; - Private *d_func() const; -}; -} -} + explicit DDETouchInterface(DDESeatInterface *ddeSeat, wl_resource *resource); + QScopedPointer d; +}; -#endif +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddeseat_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface_p.h --- dwayland-5.57.0.23/src/server/ddeseat_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddeseat_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,105 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +// KWayland +#include "ddeseat_interface.h" +// Qt +#include +#include +#include +#include + +#include "qwayland-server-dde-seat.h" + +namespace KWaylandServer +{ +class DDESeatInterfacePrivate : public QtWaylandServer::dde_seat +{ +public: + DDESeatInterfacePrivate(DDESeatInterface *q, Display *d); + + static DDESeatInterfacePrivate *get(DDESeatInterface *seat); + + DDESeatInterface *q; + QPointer display; + + QScopedPointer ddepointer; + QScopedPointer ddekeyboard; + QScopedPointer ddetouch; + + QPointF globalPos = QPointF(0, 0); + quint32 timestamp = 0; + quint32 touchtimestamp = 0; + + // Keyboard related members + struct Keyboard { + enum class State { + Released, + Pressed + }; + QHash states; + struct Keymap { + int fd = -1; + quint32 size = 0; + bool xkbcommonCompatible = false; + }; + Keymap keymap; + struct Modifiers { + quint32 depressed = 0; + quint32 latched = 0; + quint32 locked = 0; + quint32 group = 0; + quint32 serial = 0; + }; + Modifiers modifiers; + quint32 lastStateSerial = 0; + struct { + qint32 charactersPerSecond = 0; + qint32 delay = 0; + } keyRepeat; + }; + Keyboard keys; + bool updateKey(quint32 key, Keyboard::State state); + +protected: + // interface + void dde_seat_get_dde_pointer(Resource *resource, uint32_t id) override; + void dde_seat_get_dde_keyboard(Resource *resource, uint32_t id) override; + void dde_seat_get_dde_touch(Resource *resource, uint32_t id) override; +}; + +class DDEPointerInterfacePrivate : public QtWaylandServer::dde_pointer +{ +public: + static DDEPointerInterfacePrivate *get(DDEPointerInterface *pointer); + + DDEPointerInterfacePrivate(DDEPointerInterface *q, DDESeatInterface *seat, wl_resource *resource); + ~DDEPointerInterfacePrivate() override; + + DDEPointerInterface *q; + DDESeatInterface *ddeSeat; + +protected: + void dde_pointer_get_motion(Resource *resource) override; +}; + +class DDETouchInterfacePrivate : public QtWaylandServer::dde_touch +{ +public: + static DDETouchInterfacePrivate *get(DDETouchInterface *touch); + DDETouchInterfacePrivate(DDETouchInterface *q, DDESeatInterface *seat, wl_resource *resource); + ~DDETouchInterfacePrivate() override; + + DDETouchInterface *q; + DDESeatInterface *ddeSeat; + +protected: + void dde_touch_release(Resource *resource) override; +}; + +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/ddeshell_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/ddeshell_interface.cpp --- dwayland-5.57.0.23/src/server/ddeshell_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddeshell_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2020 wugang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,220 +18,132 @@ License along with this library. If not, see . *********************************************************************/ #include "ddeshell_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "display.h" #include "logging.h" #include "surface_interface.h" +#include "utils.h" -#include -#include "wayland-dde-shell-server-protocol.h" +#include "qwayland-server-dde-shell.h" -#include -#include +#include #define MAX_WINDOWS 50 -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 1; +static QList s_shellSurfaces; -class DDEShellInterface::Private : public Global::Private +class DDEShellInterfacePrivate : public QtWaylandServer::dde_shell { public: - - Private(DDEShellInterface *q, Display *d); - - QVector ddeShellSurfaces; - static DDEShellInterface *get(wl_resource *native); + DDEShellInterfacePrivate(DDEShellInterface *q, Display *display); private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - void getShellSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentSurface); - // interface - static void getShellSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - static const struct dde_shell_interface s_interface; - - static const quint32 s_version; + void dde_shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) override; DDEShellInterface *q; }; -class DDEShellSurfaceInterface::Private : public Resource::Private +class DDEShellSurfaceInterfacePrivate : public QtWaylandServer::dde_shell_surface { public: - Private(DDEShellSurfaceInterface *q, DDEShellInterface *ddeShell, SurfaceInterface *surface, wl_resource *parentResource); + DDEShellSurfaceInterfacePrivate(DDEShellSurfaceInterface *q, SurfaceInterface *surface, wl_resource *resource); - DDEShellInterface *ddeShell; SurfaceInterface *surface; - QMetaObject::Connection destroyConnection; + DDEShellSurfaceInterface *q; void setState(dde_shell_state flag, bool set); + void sendGeometry(const QRect &geom); private: - DDEShellSurfaceInterface *q_func() { - return reinterpret_cast(q); - } - - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - quint32 m_state = 0; + QRect m_geometry; - void requestGeometry(wl_resource *resource); - void requestActive(wl_resource *resource); - // interface - static void requestGeometryCallback(wl_client *client, wl_resource *resource); - static void requestActiveCallback(wl_client *client, wl_resource *resource); - static void setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state); - static void setPropertyCallback(wl_client *client, wl_resource *resource, uint32_t property, struct wl_array * dataArr); - static void setSplitWindowCallback(wl_client *client, wl_resource *resource, uint32_t value); + void dde_shell_surface_destroy_resource(Resource *resource) override; - static const struct dde_shell_surface_interface s_interface; + void dde_shell_surface_request_active(Resource *resource) override; + void dde_shell_surface_set_state(Resource *resource, uint32_t flags, uint32_t state) override; + void dde_shell_surface_set_property(Resource *resource, uint32_t property, wl_array *dataArr) override; }; -const quint32 DDEShellInterface::Private::s_version = 1; - -DDEShellInterface::Private::Private(DDEShellInterface *q, Display *d) - : Global::Private(d, &dde_shell_interface, s_version) - , q(q) -{ -} - -DDEShellInterface *DDEShellInterface::Private::get(wl_resource *native) -{ - if (Private *p = cast(native)) { - return p->q; - } - return nullptr; -} - -DDEShellInterface::Private *DDEShellInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - +/********************************* + * DDEShellInterface + *********************************/ DDEShellInterface::DDEShellInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new DDEShellInterfacePrivate(this, display)) { } DDEShellInterface::~DDEShellInterface() = default; -DDEShellInterface *DDEShellInterface::get(wl_resource* native) +DDEShellInterfacePrivate::DDEShellInterfacePrivate(DDEShellInterface *_q, Display *display) + : QtWaylandServer::dde_shell(*display, s_version) + , q(_q) { - return Private::get(native); } -void DDEShellInterface::Private::getShellSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void DDEShellInterfacePrivate::dde_shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) { - auto s = reinterpret_cast(wl_resource_get_user_data(resource)); - s->getShellSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void DDEShellInterface::Private::getShellSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(ddeShellSurfaces.constBegin(), ddeShellSurfaces.constEnd(), - [surface](DDEShellSurfaceInterface *s) { - return surface == s->surface(); - } - ); - if (it != ddeShellSurfaces.constEnd()) { - wl_resource_post_error(surface->resource(), WL_DISPLAY_ERROR_INVALID_OBJECT, "DDEShellSurface already created"); + SurfaceInterface *s = SurfaceInterface::get(surface); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - DDEShellSurfaceInterface *shellSurface = new DDEShellSurfaceInterface(q, surface, parentResource); - ddeShellSurfaces << shellSurface; - QObject::connect(shellSurface, &DDEShellSurfaceInterface::destroyed, q, - [this, shellSurface] { - ddeShellSurfaces.removeAll(shellSurface); - } - ); - shellSurface->d->create(display->getConnection(client), version, id); - emit q->shellSurfaceCreated(shellSurface); -} -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_shell_interface DDEShellInterface::Private::s_interface = { - getShellSurfaceCallback, -}; -#endif - -void DDEShellInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&dde_shell_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); + if (DDEShellSurfaceInterface::get(s)) { + wl_resource_post_error(resource->handle, 0, "dde_shell_surface already exists"); return; } - wl_resource_set_implementation(resource, &s_interface, this, nullptr); -} + wl_resource *shell_resource = wl_resource_create(resource->client(), &dde_shell_surface_interface, resource->version(), id); -/********************************* - * ShellSurfaceInterface - *********************************/ -DDEShellSurfaceInterface::Private::Private(DDEShellSurfaceInterface *q, DDEShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource) - : Resource::Private(q, shell, parentResource, &dde_shell_surface_interface, &s_interface) - , ddeShell(shell) - , surface(surface) -{ -} + auto shellSurface = new DDEShellSurfaceInterface(s, shell_resource); + s_shellSurfaces.append(shellSurface); -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct dde_shell_surface_interface DDEShellSurfaceInterface::Private::s_interface = { - requestGeometryCallback, - requestActiveCallback, - setStateCallback, - setPropertyCallback, - setSplitWindowCallback, -}; -#endif + QObject::connect(shellSurface, &QObject::destroyed, [shellSurface]() { + s_shellSurfaces.removeOne(shellSurface); + }); -DDEShellSurfaceInterface::DDEShellSurfaceInterface(DDEShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, shell, parent, parentResource)) + Q_EMIT q->shellSurfaceCreated(shellSurface); +} + +/********************************* + * DDEShellSurfaceInterface + *********************************/ +DDEShellSurfaceInterface::DDEShellSurfaceInterface(SurfaceInterface *surface, wl_resource *resource) + : QObject(surface) + , d(new DDEShellSurfaceInterfacePrivate(this, surface, resource)) { - auto unsetSurface = [this] { - Q_D(); - d->surface = nullptr; - }; - connect(parent, &Resource::unbound, this, unsetSurface); - connect(parent, &QObject::destroyed, this, unsetSurface); } DDEShellSurfaceInterface::~DDEShellSurfaceInterface() = default; -SurfaceInterface *DDEShellSurfaceInterface::surface() const { - Q_D(); +SurfaceInterface *DDEShellSurfaceInterface::surface() const +{ return d->surface; } -DDEShellInterface *DDEShellSurfaceInterface::ddeShell() const { - Q_D(); - return d->ddeShell; -} - -DDEShellSurfaceInterface::Private *DDEShellSurfaceInterface::d_func() const +DDEShellSurfaceInterface *DDEShellSurfaceInterface::get(wl_resource *native) { - return reinterpret_cast(d.data()); + if (auto surfacePrivate = resource_cast(native)) { + return surfacePrivate->q; + } + return nullptr; } -DDEShellSurfaceInterface *DDEShellSurfaceInterface::get(wl_resource *native) +DDEShellSurfaceInterface *DDEShellSurfaceInterface::get(SurfaceInterface *surface) { - return Private::get(native); + for (DDEShellSurfaceInterface *shellSurface : qAsConst(s_shellSurfaces)) { + if (shellSurface->surface() == surface) { + return shellSurface; + } + } + return nullptr; } -void DDEShellSurfaceInterface::Private::setState(dde_shell_state flag, bool set) +void DDEShellSurfaceInterfacePrivate::setState(dde_shell_state flag, bool set) { - if (!resource) { - return; - } quint32 newState = m_state; if (set) { newState |= flag; @@ -242,233 +154,206 @@ return; } m_state = newState; - dde_shell_surface_send_state_changed(resource, m_state); + send_state_changed(m_state); } -void DDEShellSurfaceInterface::Private::requestGeometry(wl_resource *resource) +void DDEShellSurfaceInterfacePrivate::sendGeometry(const QRect &geometry) { - // todo - return; + if (m_geometry == geometry) { + return; + } + m_geometry = geometry; + if (!m_geometry.isValid()) { + return; + } + send_geometry(m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()); } -void DDEShellSurfaceInterface::Private::requestGeometryCallback(wl_client *client, wl_resource *resource) +DDEShellSurfaceInterfacePrivate::DDEShellSurfaceInterfacePrivate(DDEShellSurfaceInterface *_q, SurfaceInterface *_surface, wl_resource *resource) + : QtWaylandServer::dde_shell_surface(resource) + , surface(_surface) + , q(_q) { - auto s = cast(resource); - Q_ASSERT(client == *(s->client)); - - s->requestGeometry(resource); } -void DDEShellSurfaceInterface::Private::requestActive(wl_resource *resource) +void DDEShellSurfaceInterfacePrivate::dde_shell_surface_destroy_resource(Resource *resource) { - emit q_func()->activationRequested(); + Q_UNUSED(resource) + delete q; } -void DDEShellSurfaceInterface::Private::requestActiveCallback(wl_client *client, wl_resource *resource) +void DDEShellSurfaceInterfacePrivate::dde_shell_surface_request_active(Resource *resource) { - auto s = cast(resource); - Q_ASSERT(client == *(s->client)); + Q_UNUSED(resource) - s->requestActive(resource); + Q_EMIT q->activationRequested(); } -void DDEShellSurfaceInterface::Private::setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state) +void DDEShellSurfaceInterfacePrivate::dde_shell_surface_set_state(Resource *resource, uint32_t flags, uint32_t state) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) if (flags & DDE_SHELL_STATE_ACTIVE) { - emit p->q_func()->activeRequested(state & DDE_SHELL_STATE_ACTIVE); + Q_EMIT q->activeRequested(state & DDE_SHELL_STATE_ACTIVE); } if (flags & DDE_SHELL_STATE_MINIMIZED) { - emit p->q_func()->minimizedRequested(state & DDE_SHELL_STATE_MINIMIZED); + Q_EMIT q->minimizedRequested(state & DDE_SHELL_STATE_MINIMIZED); } if (flags & DDE_SHELL_STATE_MAXIMIZED) { - emit p->q_func()->maximizedRequested(state & DDE_SHELL_STATE_MAXIMIZED); + Q_EMIT q->maximizedRequested(state & DDE_SHELL_STATE_MAXIMIZED); } if (flags & DDE_SHELL_STATE_FULLSCREEN) { - emit p->q_func()->fullscreenRequested(state & DDE_SHELL_STATE_FULLSCREEN); + Q_EMIT q->fullscreenRequested(state & DDE_SHELL_STATE_FULLSCREEN); } if (flags & DDE_SHELL_STATE_KEEP_ABOVE) { - emit p->q_func()->keepAboveRequested(state & DDE_SHELL_STATE_KEEP_ABOVE); + Q_EMIT q->keepAboveRequested(state & DDE_SHELL_STATE_KEEP_ABOVE); } if (flags & DDE_SHELL_STATE_KEEP_BELOW) { - emit p->q_func()->keepBelowRequested(state & DDE_SHELL_STATE_KEEP_BELOW); + Q_EMIT q->keepBelowRequested(state & DDE_SHELL_STATE_KEEP_BELOW); } if (flags & DDE_SHELL_STATE_ON_ALL_DESKTOPS) { - emit p->q_func()->onAllDesktopsRequested(state & DDE_SHELL_STATE_ON_ALL_DESKTOPS); + Q_EMIT q->onAllDesktopsRequested(state & DDE_SHELL_STATE_ON_ALL_DESKTOPS); } if (flags & DDE_SHELL_STATE_CLOSEABLE) { - emit p->q_func()->closeableRequested(state & DDE_SHELL_STATE_CLOSEABLE); + Q_EMIT q->closeableRequested(state & DDE_SHELL_STATE_CLOSEABLE); } if (flags & DDE_SHELL_STATE_MINIMIZABLE) { - emit p->q_func()->minimizeableRequested(state & DDE_SHELL_STATE_MINIMIZABLE); + Q_EMIT q->minimizeableRequested(state & DDE_SHELL_STATE_MINIMIZABLE); } if (flags & DDE_SHELL_STATE_MAXIMIZABLE) { - emit p->q_func()->maximizeableRequested(state & DDE_SHELL_STATE_MAXIMIZABLE); + Q_EMIT q->maximizeableRequested(state & DDE_SHELL_STATE_MAXIMIZABLE); } if (flags & DDE_SHELL_STATE_FULLSCREENABLE) { - emit p->q_func()->fullscreenableRequested(state & DDE_SHELL_STATE_FULLSCREENABLE); + Q_EMIT q->fullscreenableRequested(state & DDE_SHELL_STATE_FULLSCREENABLE); } if (flags & DDE_SHELL_STATE_MOVABLE) { - emit p->q_func()->movableRequested(state & DDE_SHELL_STATE_MOVABLE); + Q_EMIT q->movableRequested(state & DDE_SHELL_STATE_MOVABLE); } if (flags & DDE_SHELL_STATE_RESIZABLE) { - emit p->q_func()->resizableRequested(state & DDE_SHELL_STATE_RESIZABLE); + Q_EMIT q->resizableRequested(state & DDE_SHELL_STATE_RESIZABLE); } if (flags & DDE_SHELL_STATE_ACCEPT_FOCUS) { - emit p->q_func()->acceptFocusRequested(state & DDE_SHELL_STATE_ACCEPT_FOCUS); + Q_EMIT q->acceptFocusRequested(state & DDE_SHELL_STATE_ACCEPT_FOCUS); } if (flags & DDE_SHELL_STATE_MODALITY) { - emit p->q_func()->modalityRequested(state & DDE_SHELL_STATE_MODALITY); + Q_EMIT q->modalityRequested(state & DDE_SHELL_STATE_MODALITY); } } -void DDEShellSurfaceInterface::Private::setPropertyCallback(wl_client *client, wl_resource *resource, uint32_t property, struct wl_array * dataArr) +void DDEShellSurfaceInterfacePrivate::dde_shell_surface_set_property(Resource *resource, uint32_t property, wl_array *dataArr) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) if (property & DDE_SHELL_PROPERTY_NOTITLEBAR) { int *value = static_cast(dataArr->data); - emit p->q_func()->noTitleBarPropertyRequested(*value); + Q_EMIT q->noTitleBarPropertyRequested(*value); } if (property & DDE_SHELL_PROPERTY_WINDOWRADIUS) { float *value = static_cast(dataArr->data); QPointF pnt = QPointF(value[0],value[1]); - emit p->q_func()->windowRadiusPropertyRequested(pnt); + Q_EMIT q->windowRadiusPropertyRequested(pnt); } -} - -void DDEShellSurfaceInterface::Private::setSplitWindowCallback(wl_client *client, wl_resource *resource, uint32_t type) -{ - Q_UNUSED(client) - Private *p = cast(resource); - switch (type) { - case DDE_SHELL_SPLIT_TYPE_LEFT_SPLIT: - emit p->q_func()->splitWindowRequested(SplitType::leftSplit); - break; - case DDE_SHELL_SPLIT_TYPE_RIGHT_SPLIT: - emit p->q_func()->splitWindowRequested(SplitType::rightSplit); - break; - default: - break; + if (property & DDE_SHELL_PROPERTY_QUICKTILE) { + int *value = static_cast(dataArr->data); + Q_EMIT q->splitWindowRequested((SplitType)value[0], value[1]); } } void DDEShellSurfaceInterface::setActive(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_ACTIVE, set); } void DDEShellSurfaceInterface::setFullscreen(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_FULLSCREEN, set); } void DDEShellSurfaceInterface::setKeepAbove(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_KEEP_ABOVE, set); } void DDEShellSurfaceInterface::setKeepBelow(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_KEEP_BELOW, set); } void DDEShellSurfaceInterface::setOnAllDesktops(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_ON_ALL_DESKTOPS, set); } void DDEShellSurfaceInterface::setMaximized(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MAXIMIZED, set); } void DDEShellSurfaceInterface::setMinimized(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MINIMIZED, set); } void DDEShellSurfaceInterface::setCloseable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_CLOSEABLE, set); } void DDEShellSurfaceInterface::setFullscreenable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_FULLSCREENABLE, set); } void DDEShellSurfaceInterface::setMaximizeable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MAXIMIZABLE, set); } void DDEShellSurfaceInterface::setMinimizeable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MINIMIZABLE, set); } void DDEShellSurfaceInterface::setMovable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MOVABLE, set); } void DDEShellSurfaceInterface::setResizable(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_RESIZABLE, set); } void DDEShellSurfaceInterface::setAcceptFocus(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_ACCEPT_FOCUS, set); } void DDEShellSurfaceInterface::setModal(bool set) { - Q_D(); d->setState(DDE_SHELL_STATE_MODALITY, set); } void DDEShellSurfaceInterface::sendGeometry(const QRect &geom) { - Q_D(); - if (!d->resource) { - return; - } - if (geometry == geom) { - return; - } - geometry = geom; - if (!geometry.isValid()) { - return; - } - dde_shell_surface_send_geometry(d->resource, geometry.x(), geometry.y(), geometry.width(), geometry.height()); + d->sendGeometry(geom); } -void DDEShellSurfaceInterface::sendSplitable(bool splitable) +void DDEShellSurfaceInterface::sendSplitable(int splitable) { - Q_D(); - if (!d->resource) { - return; + if (splitable == 0) { + d->setState(DDE_SHELL_STATE_NO_SPLIT, true); + d->setState(DDE_SHELL_STATE_TWO_SPLIT, false); + d->setState(DDE_SHELL_STATE_FOUR_SPLIT, false); + } else { + d->setState(DDE_SHELL_STATE_NO_SPLIT, false); + if (splitable == 1) { + d->setState(DDE_SHELL_STATE_FOUR_SPLIT, false); + d->setState(DDE_SHELL_STATE_TWO_SPLIT, true); + } else if (splitable == 2) { + d->setState(DDE_SHELL_STATE_TWO_SPLIT, false); + d->setState(DDE_SHELL_STATE_FOUR_SPLIT, true); + } } - dde_shell_surface_send_splitable(d->resource, splitable); } } -} diff -Nru dwayland-5.57.0.23/src/server/ddeshell_interface.h dwayland-5.57.0.24+really5.24.3/src/server/ddeshell_interface.h --- dwayland-5.57.0.23/src/server/ddeshell_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/ddeshell_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,5 +1,5 @@ /******************************************************************** -Copyright 2020 wugang +Copyright 2022 luochaojiang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,49 +17,58 @@ You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ -#ifndef WAYLAND_SERVER_DDE_SHELL_INTERFACE_H -#define WAYLAND_SERVER_DDE_SHELL_INTERFACE_H +#pragma once #include -#include -#include -#include -#include - -#include -#include "global.h" -#include "resource.h" + +#include struct wl_resource; +class QRect; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; class SurfaceInterface; + class DDEShellInterface; +class DDEShellInterfacePrivate; + class DDEShellSurfaceInterface; +class DDEShellSurfaceInterfacePrivate; -class KWAYLANDSERVER_EXPORT DDEShellInterface : public Global +enum class SplitType { + None = 0, + Left = 1 << 0, + Right = 1 << 1, + Top = 1 << 2, + Bottom = 1 << 3, + LeftTop = Left | Top, + RightTop = Right | Top, + LeftBottom = Left | Bottom, + RightBottom = Right | Bottom, +}; +/** @class DDEShellInterface + * + * + * @see DDEShellInterface + * @since 5.5 + */ +class KWAYLANDSERVER_EXPORT DDEShellInterface : public QObject { Q_OBJECT public: + explicit DDEShellInterface(Display *display, QObject *parent); virtual ~DDEShellInterface(); - static DDEShellInterface *get(wl_resource *native); - Q_SIGNALS: - void shellSurfaceCreated(KWayland::Server::DDEShellSurfaceInterface*); + void shellSurfaceCreated(DDEShellSurfaceInterface*); + private: - friend class Display; - explicit DDEShellInterface(Display *display, QObject *parent = nullptr); - class Private; - Private *d_func() const; + QScopedPointer d; }; -class KWAYLANDSERVER_EXPORT DDEShellSurfaceInterface : public Resource +class KWAYLANDSERVER_EXPORT DDEShellSurfaceInterface : public QObject { Q_OBJECT public: @@ -69,8 +78,10 @@ SurfaceInterface *surface() const; static DDEShellSurfaceInterface *get(wl_resource *native); + static DDEShellSurfaceInterface *get(SurfaceInterface *surface); + void sendGeometry(const QRect &geom); - void sendSplitable(bool splitable); + void sendSplitable(int splitable); void setActive(bool set); void setMinimized(bool set); @@ -88,11 +99,6 @@ void setAcceptFocus(bool set); void setModal(bool set); - enum class SplitType { - leftSplit = 1 << 0, - rightSplit = 1 << 1, - }; - Q_SIGNALS: void activationRequested(); void activeRequested(bool set); @@ -113,17 +119,12 @@ void noTitleBarPropertyRequested(qint32 value); void windowRadiusPropertyRequested(QPointF windowRadius); - void splitWindowRequested(SplitType splitType); - + void nonStandardWindowPropertyRequested(const QMap &mapNonStandardWindowPropertyData); + void splitWindowRequested(SplitType splitType, int splitMode); private: - friend class DDEShellInterface; - QRect geometry; - explicit DDEShellSurfaceInterface(DDEShellInterface *ddeShell, SurfaceInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; + friend class DDEShellInterfacePrivate; + explicit DDEShellSurfaceInterface(SurfaceInterface *surface, wl_resource *resource); + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/display.cpp dwayland-5.57.0.24+really5.24.3/src/server/display.cpp --- dwayland-5.57.0.23/src/server/display.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/display.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,579 +1,130 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2018 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "display.h" -#include "compositor_interface.h" -#include "datadevicemanager_interface.h" -#include "dpms_interface.h" -#include "outputconfiguration_interface.h" -#include "outputmanagement_interface.h" -#include "outputdevice_interface.h" -#include "idle_interface.h" -#include "idleinhibit_interface_p.h" -#include "remote_access_interface.h" -#include "fakeinput_interface.h" +#include "clientbufferintegration.h" +#include "display_p.h" +#include "drmclientbuffer.h" #include "logging.h" #include "output_interface.h" -#include "plasmashell_interface.h" -#include "plasmawindowmanagement_interface.h" -#include "pointerconstraints_interface_p.h" -#include "pointergestures_interface_p.h" -#include "primaryselectiondevicemanager_v1_interface.h" -#include "qtsurfaceextension_interface.h" -#include "seat_interface.h" -#include "shadow_interface.h" -#include "blur_interface.h" -#include "contrast_interface.h" -#include "relativepointer_interface_p.h" -#include "server_decoration_interface.h" -#include "slide_interface.h" -#include "shell_interface.h" -#include "subcompositor_interface.h" -#include "textinput_interface_p.h" -#include "xdgshell_v5_interface_p.h" -#include "xdgforeign_interface.h" -#include "xdgshell_v6_interface_p.h" -#include "xdgshell_stable_interface_p.h" -#include "appmenu_interface.h" -#include "server_decoration_palette_interface.h" -#include "plasmavirtualdesktop_interface.h" -#include "xdgoutput_interface.h" -#include "xdgdecoration_interface.h" -#include "clientmanagement_interface.h" -#include "ddeseat_interface.h" -#include "ddeshell_interface.h" -#include "strut_interface.h" -#include "xwayland_keyboard_grab_v1_interface.h" -#include "screencast_interface.h" -#include "linuxdmabuf_v1_interface.h" -#include "datacontroldevicemanager_interface.h" +#include "shmclientbuffer.h" +#include #include #include -#include -#include -#include - -#include +#include -#include - -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - -class Display::Private +DisplayPrivate *DisplayPrivate::get(Display *display) { -public: - Private(Display *q); - void flush(); - void dispatch(); - void setRunning(bool running); - void installSocketNotifier(); - - wl_display *display = nullptr; - wl_event_loop *loop = nullptr; - QString socketName = QStringLiteral("wayland-0"); - bool running = false; - QList outputs; - QList outputdevices; - QVector seats; - QVector clients; - EGLDisplay eglDisplay = EGL_NO_DISPLAY; - -private: - Display *q; -}; + return display->d.data(); +} -Display::Private::Private(Display *q) +DisplayPrivate::DisplayPrivate(Display *q) : q(q) { } -void Display::Private::installSocketNotifier() +void DisplayPrivate::registerSocketName(const QString &socketName) { - if (!QThread::currentThread()) { - return; - } - int fd = wl_event_loop_get_fd(loop); - if (fd == -1) { - qCWarning(KWAYLAND_SERVER) << "Did not get the file descriptor for the event loop"; - return; - } - QSocketNotifier *m_notifier = new QSocketNotifier(fd, QSocketNotifier::Read, q); - QObject::connect(m_notifier, &QSocketNotifier::activated, q, [this] { dispatch(); } ); - QObject::connect(QThread::currentThread()->eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, q, [this] { flush(); }); - setRunning(true); + socketNames.append(socketName); + Q_EMIT q->socketNamesChanged(); } Display::Display(QObject *parent) : QObject(parent) - , d(new Private(this)) + , d(new DisplayPrivate(this)) { + d->display = wl_display_create(); + d->loop = wl_display_get_event_loop(d->display); } Display::~Display() { - terminate(); - if (d->display) { - wl_display_destroy(d->display); - } -} - -void Display::Private::flush() -{ - if (!display || !loop) { - return; - } - wl_display_flush_clients(display); + wl_display_destroy_clients(d->display); + wl_display_destroy(d->display); } -void Display::Private::dispatch() +bool Display::addSocketFileDescriptor(int fileDescriptor, const QString &name) { - if (!display || !loop) { - return; + if (wl_display_add_socket_fd(d->display, fileDescriptor)) { + qCWarning(KWAYLAND_SERVER, "Failed to add %d fd to display", fileDescriptor); + return false; } - if (wl_event_loop_dispatch(loop, 0) != 0) { - qCWarning(KWAYLAND_SERVER) << "Error on dispatching Wayland event loop"; + if (!name.isEmpty()) { + d->registerSocketName(name); } + return true; } -void Display::setSocketName(const QString &name) +bool Display::addSocketName(const QString &name) { - if (d->socketName == name) { - return; - } - d->socketName = name; - emit socketNameChanged(d->socketName); -} - -QString Display::socketName() const -{ - return d->socketName; -} - -void Display::start(StartMode mode) -{ - Q_ASSERT(!d->running); - Q_ASSERT(!d->display); - d->display = wl_display_create(); - if (mode == StartMode::ConnectToSocket) { - if (wl_display_add_socket(d->display, qPrintable(d->socketName)) != 0) { - qCWarning(KWAYLAND_SERVER) << "Failed to create Wayland socket"; - return; + if (name.isEmpty()) { + const char *socket = wl_display_add_socket_auto(d->display); + if (!socket) { + qCWarning(KWAYLAND_SERVER, "Failed to find a free display socket"); + return false; + } + d->registerSocketName(QString::fromUtf8(socket)); + } else { + if (wl_display_add_socket(d->display, qPrintable(name))) { + qCWarning(KWAYLAND_SERVER, "Failed to add %s socket to display", qPrintable(name)); + return false; } + d->registerSocketName(name); } - - d->loop = wl_display_get_event_loop(d->display); - d->installSocketNotifier(); + return true; } -void Display::startLoop() +QStringList Display::socketNames() const { - Q_ASSERT(!d->running); - Q_ASSERT(d->display); - d->installSocketNotifier(); + return d->socketNames; } -void Display::dispatchEvents(int msecTimeout) +bool Display::start() { - Q_ASSERT(d->display); if (d->running) { - d->dispatch(); - } else if (d->loop) { - wl_event_loop_dispatch(d->loop, msecTimeout); - wl_display_flush_clients(d->display); + return true; } -} - -void Display::terminate() -{ - if (!d->running) { - return; - } - emit aboutToTerminate(); - wl_display_terminate(d->display); - wl_display_destroy(d->display); - d->display = nullptr; - d->loop = nullptr; - d->setRunning(false); -} - -void Display::Private::setRunning(bool r) -{ - Q_ASSERT(running != r); - running = r; - emit q->runningChanged(running); -} - -OutputInterface *Display::createOutput(QObject *parent) -{ - OutputInterface *output = new OutputInterface(this, parent); - connect(output, &QObject::destroyed, this, [this,output] { d->outputs.removeAll(output); }); - connect(this, &Display::aboutToTerminate, output, [this,output] { removeOutput(output); }); - d->outputs << output; - return output; -} - -CompositorInterface *Display::createCompositor(QObject *parent) -{ - CompositorInterface *compositor = new CompositorInterface(this, parent); - connect(this, &Display::aboutToTerminate, compositor, [this,compositor] { delete compositor; }); - return compositor; -} - -ShellInterface *Display::createShell(QObject *parent) -{ - ShellInterface *shell = new ShellInterface(this, parent); - connect(this, &Display::aboutToTerminate, shell, [this,shell] { delete shell; }); - return shell; -} - -OutputDeviceInterface *Display::createOutputDevice(QObject *parent) -{ - OutputDeviceInterface *output = new OutputDeviceInterface(this, parent); - connect(output, &QObject::destroyed, this, [this,output] { d->outputdevices.removeAll(output); }); - connect(this, &Display::aboutToTerminate, output, [this,output] { removeOutputDevice(output); }); - d->outputdevices << output; - return output; -} - -OutputManagementInterface *Display::createOutputManagement(QObject *parent) -{ - OutputManagementInterface *om = new OutputManagementInterface(this, parent); - connect(this, &Display::aboutToTerminate, om, [this,om] { delete om; }); - return om; -} - -SeatInterface *Display::createSeat(QObject *parent) -{ - SeatInterface *seat = new SeatInterface(this, parent); - connect(seat, &QObject::destroyed, this, [this, seat] { d->seats.removeAll(seat); }); - connect(this, &Display::aboutToTerminate, seat, [this,seat] { delete seat; }); - d->seats << seat; - return seat; -} - -SubCompositorInterface *Display::createSubCompositor(QObject *parent) -{ - auto c = new SubCompositorInterface(this, parent); - connect(this, &Display::aboutToTerminate, c, [this,c] { delete c; }); - return c; -} - -DataDeviceManagerInterface *Display::createDataDeviceManager(QObject *parent) -{ - auto m = new DataDeviceManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, m, [this,m] { delete m; }); - return m; -} - -PlasmaShellInterface *Display::createPlasmaShell(QObject* parent) -{ - auto s = new PlasmaShellInterface(this, parent); - connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; }); - return s; -} - -PlasmaWindowManagementInterface *Display::createPlasmaWindowManagement(QObject *parent) -{ - auto wm = new PlasmaWindowManagementInterface(this, parent); - connect(this, &Display::aboutToTerminate, wm, [this, wm] { delete wm; }); - return wm; -} - -QtSurfaceExtensionInterface *Display::createQtSurfaceExtension(QObject *parent) -{ - auto s = new QtSurfaceExtensionInterface(this, parent); - connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; }); - return s; -} - -RemoteAccessManagerInterface *Display::createRemoteAccessManager(QObject *parent) -{ - auto i = new RemoteAccessManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; }); - return i; -} - -IdleInterface *Display::createIdle(QObject *parent) -{ - auto i = new IdleInterface(this, parent); - connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; }); - return i; -} - -FakeInputInterface *Display::createFakeInput(QObject *parent) -{ - auto i = new FakeInputInterface(this, parent); - connect(this, &Display::aboutToTerminate, i, [this, i] { delete i; }); - return i; -} - -ShadowManagerInterface *Display::createShadowManager(QObject *parent) -{ - auto s = new ShadowManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; }); - return s; -} - -BlurManagerInterface *Display::createBlurManager(QObject *parent) -{ - auto b = new BlurManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -ContrastManagerInterface *Display::createContrastManager(QObject *parent) -{ - auto b = new ContrastManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -SlideManagerInterface *Display::createSlideManager(QObject *parent) -{ - auto b = new SlideManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} -DpmsManagerInterface *Display::createDpmsManager(QObject *parent) -{ - auto d = new DpmsManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, d, [this, d] { delete d; }); - return d; -} - -ServerSideDecorationManagerInterface *Display::createServerSideDecorationManager(QObject *parent) -{ - auto d = new ServerSideDecorationManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, d, [d] { delete d; }); - return d; -} - -TextInputManagerInterface *Display::createTextInputManager(const TextInputInterfaceVersion &version, QObject *parent) -{ - TextInputManagerInterface *t = nullptr; - switch (version) { - case TextInputInterfaceVersion::UnstableV0: - t = new TextInputManagerUnstableV0Interface(this, parent); - break; - case TextInputInterfaceVersion::UnstableV1: - // unsupported - return nullptr; - case TextInputInterfaceVersion::UnstableV2: - t = new TextInputManagerUnstableV2Interface(this, parent); + const int fileDescriptor = wl_event_loop_get_fd(d->loop); + if (fileDescriptor == -1) { + qCWarning(KWAYLAND_SERVER) << "Did not get the file descriptor for the event loop"; + return false; } - connect(this, &Display::aboutToTerminate, t, [t] { delete t; }); - return t; -} -XdgShellInterface *Display::createXdgShell(const XdgShellInterfaceVersion &version, QObject *parent) -{ - XdgShellInterface *x = nullptr; - switch (version) { - case XdgShellInterfaceVersion::UnstableV5: - x = new XdgShellV5Interface(this, parent); - break; - case XdgShellInterfaceVersion::UnstableV6: - x = new XdgShellV6Interface(this, parent); - break; - case XdgShellInterfaceVersion::Stable: - x = new XdgShellStableInterface(this, parent); - break; - } - connect(this, &Display::aboutToTerminate, x, [x] { delete x; }); - return x; -} + d->socketNotifier = new QSocketNotifier(fileDescriptor, QSocketNotifier::Read, this); + connect(d->socketNotifier, &QSocketNotifier::activated, this, &Display::dispatchEvents); -RelativePointerManagerInterface *Display::createRelativePointerManager(const RelativePointerInterfaceVersion &version, QObject *parent) -{ - RelativePointerManagerInterface *r = nullptr; - switch (version) { - case RelativePointerInterfaceVersion::UnstableV1: - r = new RelativePointerManagerUnstableV1Interface(this, parent); - break; - } - connect(this, &Display::aboutToTerminate, r, [r] { delete r; }); - return r; -} + QAbstractEventDispatcher *dispatcher = QCoreApplication::eventDispatcher(); + connect(dispatcher, &QAbstractEventDispatcher::aboutToBlock, this, &Display::flush); -PointerGesturesInterface *Display::createPointerGestures(const PointerGesturesInterfaceVersion &version, QObject *parent) -{ - PointerGesturesInterface *p = nullptr; - switch (version) { - case PointerGesturesInterfaceVersion::UnstableV1: - p = new PointerGesturesUnstableV1Interface(this, parent); - break; - } - connect(this, &Display::aboutToTerminate, p, [p] { delete p; }); - return p; -} + d->running = true; + Q_EMIT runningChanged(true); -PointerConstraintsInterface *Display::createPointerConstraints(const PointerConstraintsInterfaceVersion &version, QObject *parent) -{ - PointerConstraintsInterface *p = nullptr; - switch (version) { - case PointerConstraintsInterfaceVersion::UnstableV1: - p = new PointerConstraintsUnstableV1Interface(this, parent); - break; - } - connect(this, &Display::aboutToTerminate, p, [p] { delete p; }); - return p; + return true; } -XdgForeignInterface *Display::createXdgForeignInterface(QObject *parent) +void Display::dispatchEvents() { - XdgForeignInterface *foreign = new XdgForeignInterface(this, parent); - connect(this, &Display::aboutToTerminate, foreign, [this,foreign] { delete foreign; }); - return foreign; -} - -IdleInhibitManagerInterface *Display::createIdleInhibitManager(const IdleInhibitManagerInterfaceVersion &version, QObject *parent) -{ - IdleInhibitManagerInterface *i = nullptr; - switch (version) { - case IdleInhibitManagerInterfaceVersion::UnstableV1: - i = new IdleInhibitManagerUnstableV1Interface(this, parent); - break; + if (wl_event_loop_dispatch(d->loop, 0) != 0) { + qCWarning(KWAYLAND_SERVER) << "Error on dispatching Wayland event loop"; } - connect(this, &Display::aboutToTerminate, i, [this,i] { delete i; }); - return i; } -AppMenuManagerInterface *Display::createAppMenuManagerInterface(QObject *parent) +void Display::flush() { - auto b = new AppMenuManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -ServerSideDecorationPaletteManagerInterface *Display::createServerSideDecorationPaletteManager(QObject *parent) -{ - auto b = new ServerSideDecorationPaletteManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -LinuxDmabufUnstableV1Interface *Display::createLinuxDmabufInterface(QObject *parent) -{ - auto b = new LinuxDmabufUnstableV1Interface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -PlasmaVirtualDesktopManagementInterface *Display::createPlasmaVirtualDesktopManagement(QObject *parent) -{ - auto b = new PlasmaVirtualDesktopManagementInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -XdgOutputManagerInterface *Display::createXdgOutputManager(QObject *parent) -{ - auto b = new XdgOutputManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -XdgDecorationManagerInterface *Display::createXdgDecorationManager(XdgShellInterface *shellInterface, QObject *parent) -{ - auto d = new XdgDecorationManagerInterface(this, shellInterface, parent); - connect(this, &Display::aboutToTerminate, d, [d] { delete d; }); - return d; -} - -ClientManagementInterface *Display::createClientManagement(QObject *parent) -{ - ClientManagementInterface *clientManagement = new ClientManagementInterface(this, parent); - connect(this, &Display::aboutToTerminate, clientManagement, [this,clientManagement] { delete clientManagement; }); - return clientManagement; -} - -ScreencastV1Interface *Display::createScreencastV1Interface(QObject *parent) -{ - ScreencastV1Interface *screencast = new ScreencastV1Interface(this, parent); - connect(this, &Display::aboutToTerminate, screencast, [this,screencast] { delete screencast; }); - return screencast; -} - -DDESeatInterface *Display::createDDESeat(QObject *parent) -{ - auto b = new DDESeatInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -ZWPXwaylandKeyboardGrabManagerV1Interface *Display::createZWPXwaylandKeyboardGrabManagerV1(QObject *parent) -{ - auto b = new ZWPXwaylandKeyboardGrabManagerV1Interface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -DDEShellInterface *Display::createDDEShell(QObject *parent) -{ - auto b = new DDEShellInterface(this, parent); - connect(this, &Display::aboutToTerminate, b, [this, b] { delete b; }); - return b; -} - -StrutInterface *Display::createStrut(QObject* parent) -{ - auto s = new StrutInterface(this, parent); - connect(this, &Display::aboutToTerminate, s, [this, s] { delete s; }); - return s; -} - -PrimarySelectionDeviceManagerV1Interface *Display::createPrimarySelectionDeviceManagerV1(QObject *parent) -{ - auto primarySelection = new PrimarySelectionDeviceManagerV1Interface(this, parent); - connect(this, &Display::aboutToTerminate, primarySelection, [this, primarySelection] { delete primarySelection; }); - return primarySelection; -} - -DataControlDeviceManagerInterface *Display::createDataControlDeviceManager(QObject *parent) -{ - auto controlSelection = new DataControlDeviceManagerInterface(this, parent); - connect(this, &Display::aboutToTerminate, controlSelection, [this, controlSelection] { delete controlSelection; }); - return controlSelection; + wl_display_flush_clients(d->display); } void Display::createShm() { Q_ASSERT(d->display); - wl_display_init_shm(d->display); -} - -void Display::removeOutput(OutputInterface *output) -{ - d->outputs.removeAll(output); - delete output; -} - -void Display::removeOutputDevice(OutputDeviceInterface *output) -{ - d->outputdevices.removeAll(output); - delete output; + new ShmClientBufferIntegration(this); } quint32 Display::nextSerial() @@ -591,27 +142,39 @@ return d->running; } -Display::operator wl_display*() +Display::operator wl_display *() { return d->display; } -Display::operator wl_display*() const +Display::operator wl_display *() const { return d->display; } -QList< OutputInterface* > Display::outputs() const +QList Display::outputs() const { return d->outputs; } -QList< OutputDeviceInterface* > Display::outputDevices() const +QList< OutputDeviceV2Interface* > Display::outputDevices() const { - return d->outputdevices; + return d->outputdevicesV2; } -QVector Display::seats() const +QVector Display::outputsIntersecting(const QRect &rect) const +{ + QVector outputs; + for (auto *output : qAsConst(d->outputs)) { + const QRect outputGeometry(output->globalPosition(), output->pixelSize() / output->scale()); + if (rect.intersects(outputGeometry)) { + outputs << output; + } + } + return outputs; +} + +QVector Display::seats() const { return d->seats; } @@ -619,31 +182,27 @@ ClientConnection *Display::getConnection(wl_client *client) { Q_ASSERT(client); - auto it = std::find_if(d->clients.constBegin(), d->clients.constEnd(), - [client](ClientConnection *c) { - return c->client() == client; - } - ); + auto it = std::find_if(d->clients.constBegin(), d->clients.constEnd(), [client](ClientConnection *c) { + return c->client() == client; + }); if (it != d->clients.constEnd()) { return *it; } // no ConnectionData yet, create it auto c = new ClientConnection(client, this); d->clients << c; - connect(c, &ClientConnection::disconnected, this, - [this] (ClientConnection *c) { - const int index = d->clients.indexOf(c); - Q_ASSERT(index != -1); - d->clients.remove(index); - Q_ASSERT(d->clients.indexOf(c) == -1); - emit clientDisconnected(c); - } - ); - emit clientConnected(c); + connect(c, &ClientConnection::disconnected, this, [this](ClientConnection *c) { + const int index = d->clients.indexOf(c); + Q_ASSERT(index != -1); + d->clients.remove(index); + Q_ASSERT(d->clients.indexOf(c) == -1); + Q_EMIT clientDisconnected(c); + }); + Q_EMIT clientConnected(c); return c; } -QVector< ClientConnection* > Display::connections() const +QVector Display::connections() const { return d->clients; } @@ -666,6 +225,7 @@ return; } d->eglDisplay = (EGLDisplay)display; + new DrmClientBufferIntegration(this); } void *Display::eglDisplay() const @@ -673,5 +233,68 @@ return d->eglDisplay; } +struct ClientBufferDestroyListener : wl_listener { + ClientBufferDestroyListener(Display *display, ClientBuffer *buffer); + ~ClientBufferDestroyListener(); + + Display *display; +}; + +void bufferDestroyCallback(wl_listener *listener, void *data) +{ + ClientBufferDestroyListener *destroyListener = static_cast(listener); + DisplayPrivate *displayPrivate = DisplayPrivate::get(destroyListener->display); + + ClientBuffer *buffer = displayPrivate->q->clientBufferForResource(static_cast(data)); + displayPrivate->unregisterClientBuffer(buffer); + + buffer->markAsDestroyed(); +} + +ClientBufferDestroyListener::ClientBufferDestroyListener(Display *display, ClientBuffer *buffer) + : display(display) +{ + notify = bufferDestroyCallback; + + link.prev = nullptr; + link.next = nullptr; + + wl_resource_add_destroy_listener(buffer->resource(), this); +} + +ClientBufferDestroyListener::~ClientBufferDestroyListener() +{ + wl_list_remove(&link); +} + +ClientBuffer *Display::clientBufferForResource(wl_resource *resource) const +{ + ClientBuffer *buffer = d->resourceToBuffer.value(resource); + if (buffer) { + return buffer; + } + + for (ClientBufferIntegration *integration : qAsConst(d->bufferIntegrations)) { + ClientBuffer *buffer = integration->createBuffer(resource); + if (buffer) { + d->registerClientBuffer(buffer); + return buffer; + } + } + return nullptr; } + +void DisplayPrivate::registerClientBuffer(ClientBuffer *buffer) +{ + resourceToBuffer.insert(buffer->resource(), buffer); + bufferToListener.insert(buffer, new ClientBufferDestroyListener(q, buffer)); +} + +void DisplayPrivate::unregisterClientBuffer(ClientBuffer *buffer) +{ + Q_ASSERT_X(buffer->resource(), "unregisterClientBuffer", "buffer must have valid resource"); + resourceToBuffer.remove(buffer->resource()); + delete bufferToListener.take(buffer); +} + } diff -Nru dwayland-5.57.0.23/src/server/display.h dwayland-5.57.0.24+really5.24.3/src/server/display.h --- dwayland-5.57.0.23/src/server/display.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/display.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,152 +1,94 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DISPLAY_H -#define WAYLAND_SERVER_DISPLAY_H +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2018 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include #include -#include +#include #include "clientconnection.h" struct wl_client; struct wl_display; -struct wl_event_loop; -namespace KWayland +namespace KWaylandServer { /** * @short KWayland Server. * * This namespace groups all classes related to the Server module. * - * The main entry point into the KWayland::Server API is the Display class. + * The main entry point into the KWaylandServer API is the Display class. * It allows to create a Wayland server and create various global objects on it. * - * KWayland::Server is an API to easily create a head-less Wayland server with a + * KWaylandServer is an API to easily create a head-less Wayland server with a * Qt style API. * * @see Display - **/ -namespace Server -{ + */ -class CompositorInterface; -class DataDeviceManagerInterface; -class DpmsManagerInterface; -class IdleInterface; -enum class IdleInhibitManagerInterfaceVersion; -class RemoteAccessManagerInterface; -class IdleInhibitManagerInterface; -class FakeInputInterface; +class ClientBuffer; +class ClientConnection; +class DisplayPrivate; class OutputInterface; -class OutputDeviceInterface; -class OutputConfigurationInterface; -class OutputManagementInterface; -class PlasmaShellInterface; -class PlasmaWindowManagementInterface; -class QtSurfaceExtensionInterface; +class OutputDeviceV2Interface; class SeatInterface; -class ShadowManagerInterface; -class BlurManagerInterface; -class ContrastManagerInterface; -class ServerSideDecorationManagerInterface; -class SlideManagerInterface; -class ShellInterface; -class SubCompositorInterface; -enum class TextInputInterfaceVersion; -class TextInputManagerInterface; -class XdgShellV5Interface; -enum class XdgShellInterfaceVersion; -class XdgShellInterface; -enum class RelativePointerInterfaceVersion; -class RelativePointerManagerInterface; -enum class PointerGesturesInterfaceVersion; -class PointerGesturesInterface; -enum class PointerConstraintsInterfaceVersion; -class PointerConstraintsInterface; -class XdgForeignInterface; -class AppMenuManagerInterface; -class ServerSideDecorationPaletteManagerInterface; -class PlasmaVirtualDesktopManagementInterface; -class XdgOutputManagerInterface; -class XdgDecorationManagerInterface; -class ClientManagementInterface; -class DDESeatInterface; -class DDEShellInterface; -class StrutInterface; -class ZWPXwaylandKeyboardGrabManagerV1Interface; -class ScreencastV1Interface; -class LinuxDmabufUnstableV1Interface; -class PrimarySelectionDeviceManagerV1Interface; -class DataControlDeviceManagerInterface; + /** * @brief Class holding the Wayland server display loop. * * @todo Improve documentation - **/ + */ class KWAYLANDSERVER_EXPORT Display : public QObject { Q_OBJECT - Q_PROPERTY(QString socketName READ socketName WRITE setSocketName NOTIFY socketNameChanged) Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged) public: explicit Display(QObject *parent = nullptr); virtual ~Display(); - void setSocketName(const QString &name); - QString socketName() const; + /** + * Adds a socket with the given @p fileDescriptor to the Wayland display. This function + * returns @c true if the socket has been added successfully; otherwise returns @c false. + * + * The compositor can call this function even after the display has been started. + * @arg socketName can optionally be parsed to store the socket name represented by the given file-descriptor + * + * @see start() + */ + bool addSocketFileDescriptor(int fileDescriptor, const QString &socketName = QString()); + /** + * Adds a UNIX socket with the specified @p name to the Wayland display. This function + * returns @c true if the socket has been added successfully; otherwise returns @c false. + * + * If the specified socket name @p name is empty, the display will pick a free socket with + * a filename "wayland-%d". + * + * The compositor can call this function even after the display has been started. + * + * @see start() + */ + bool addSocketName(const QString &name = QString()); + + /** + * Returns the list of socket names that the display listens for client connections. + */ + QStringList socketNames() const; quint32 serial(); quint32 nextSerial(); /** - * How to setup the server connection. - * @li ConnectToSocket: the server will open the socket identified by the socket name - * @li ConnectClientsOnly: only connections through createClient are possible - **/ - enum class StartMode { - ConnectToSocket, - ConnectClientsOnly - }; - void start(StartMode mode = StartMode::ConnectToSocket); - void terminate(); - /** - * Starts the event loop for the server socket. - * This method should only be used if start() is used before creating the - * QCoreApplication. In that case start() cannot fully setup the event processing - * and the loop needs to be started after the QCoreApplication got created. - * @see start - * @see dispatchEvents - **/ - void startLoop(); - /** - * Dispatches pending events in a blocking way. May only be used if the Display is - * created and started before the QCoreApplication is created. Once the QCoreApplication - * is created and the event loop is started this method delegates to the normal dispatch - * handling. - * @see startLoop - **/ - void dispatchEvents(int msecTimeout = -1); + * Start accepting client connections. If the display has started successfully, this + * function returns @c true; otherwise @c false is returned. + */ + bool start(); + void dispatchEvents(); /** * Create a client for the given file descriptor. @@ -158,208 +100,30 @@ * * @param fd The file descriptor for the socket to the client * @returns The new ClientConnection or @c null on failure. - **/ + */ ClientConnection *createClient(int fd); - operator wl_display*(); - operator wl_display*() const; + operator wl_display *(); + operator wl_display *() const; bool isRunning() const; - OutputInterface *createOutput(QObject *parent = nullptr); - void removeOutput(OutputInterface *output); - QList outputs() const; - - OutputDeviceInterface *createOutputDevice(QObject *parent = nullptr); - void removeOutputDevice(OutputDeviceInterface *output); - QList outputDevices() const; - - CompositorInterface *createCompositor(QObject *parent = nullptr); void createShm(); - ShellInterface *createShell(QObject *parent = nullptr); - SeatInterface *createSeat(QObject *parent = nullptr); /** * @returns All SeatInterface currently managed on the Display. - * @since 5.6 - **/ - QVector seats() const; - SubCompositorInterface *createSubCompositor(QObject *parent = nullptr); - DataDeviceManagerInterface *createDataDeviceManager(QObject *parent = nullptr); - OutputManagementInterface *createOutputManagement(QObject *parent = nullptr); - PlasmaShellInterface *createPlasmaShell(QObject *parent = nullptr); - PlasmaWindowManagementInterface *createPlasmaWindowManagement(QObject *parent = nullptr); - QtSurfaceExtensionInterface *createQtSurfaceExtension(QObject *parent = nullptr); - IdleInterface *createIdle(QObject *parent = nullptr); - RemoteAccessManagerInterface *createRemoteAccessManager(QObject *parent = nullptr); - FakeInputInterface *createFakeInput(QObject *parent = nullptr); - ShadowManagerInterface *createShadowManager(QObject *parent = nullptr); - BlurManagerInterface *createBlurManager(QObject *parent = nullptr); - ContrastManagerInterface *createContrastManager(QObject *parent = nullptr); - SlideManagerInterface *createSlideManager(QObject *parent = nullptr); - DpmsManagerInterface *createDpmsManager(QObject *parent = nullptr); - /** - * @since 5.6 - **/ - ServerSideDecorationManagerInterface *createServerSideDecorationManager(QObject *parent = nullptr); - /** - * Create the text input manager in interface @p version. - * @returns The created manager object - * @since 5.23 - **/ - TextInputManagerInterface *createTextInputManager(const TextInputInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the XdgShell in interface @p version. - * - * @since 5.25 - **/ - XdgShellInterface *createXdgShell(const XdgShellInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the RelativePointerManagerInterface in interface @p version - * - * @returns The created manager object - * @since 5.28 - **/ - RelativePointerManagerInterface *createRelativePointerManager(const RelativePointerInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the PointerGesturesInterface in interface @p version - * - * @returns The created manager object - * @since 5.29 - **/ - PointerGesturesInterface *createPointerGestures(const PointerGesturesInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the PointerConstraintsInterface in interface @p version - * - * @returns The created manager object - * @since 5.29 - **/ - PointerConstraintsInterface *createPointerConstraints(const PointerConstraintsInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the XdgForeignInterface in interface @p version - * - * @returns The created manager object - * @since 5.40 - **/ - XdgForeignInterface *createXdgForeignInterface(QObject *parent = nullptr); - - /** - * Creates the IdleInhibitManagerInterface in interface @p version. - * - * @returns The created manager object - * @since 5.41 - **/ - IdleInhibitManagerInterface *createIdleInhibitManager(const IdleInhibitManagerInterfaceVersion &version, QObject *parent = nullptr); - - /** - * Creates the AppMenuManagerInterface in interface @p version. - * - * @returns The created manager object - * @since 5.42 - **/ - AppMenuManagerInterface *createAppMenuManagerInterface(QObject *parent = nullptr); - - /** - * Creates the ServerSideDecorationPaletteManagerInterface in interface @p version. - * - * @returns The created manager object - * @since 5.42 - **/ - ServerSideDecorationPaletteManagerInterface *createServerSideDecorationPaletteManager(QObject *parent = nullptr); - - /** - * Creates the LinuxDmabufUnstableV1Interface in interface @p version. - * - * @returns A pointer to the created interface - **/ - LinuxDmabufUnstableV1Interface *createLinuxDmabufInterface(QObject *parent = nullptr); - - /** - * Creates the XdgOutputManagerInterface - * - * @return the created manager - * @since 5.47 - */ - XdgOutputManagerInterface *createXdgOutputManager(QObject *parent = nullptr); - - - /** - * Creates the PlasmaVirtualDesktopManagementInterface in interface @p version. - * - * @returns The created manager object - * @since 5.52 - **/ - PlasmaVirtualDesktopManagementInterface *createPlasmaVirtualDesktopManagement(QObject *parent = nullptr); - - /** - * Creates the XdgDecorationManagerInterface - * @arg shellInterface A created XdgShellInterface based on XDG_WM_BASE - * - * @return the created manager - * @since 5.54 - */ - XdgDecorationManagerInterface *createXdgDecorationManager(XdgShellInterface *shellInterface, QObject *parent = nullptr); - - /** - * Creates an interface to request video feeds of different compositor resources - */ - ScreencastV1Interface *createScreencastV1Interface(QObject *parent = nullptr); - - ClientManagementInterface *createClientManagement(QObject *parent = nullptr); - - /** - * Creates the DDESeatInterface in interface @p version. - * - * @returns The created manager object - * @since 5.52 - **/ - DDESeatInterface *createDDESeat(QObject *parent = nullptr); - /** - * Creates the DDEShellInterface in interface @p version. - * - * @returns The created manager object - * @since 5.52 - **/ - DDEShellInterface *createDDEShell(QObject *parent = nullptr); - - /** - * Creates the ZWPXwaylandKeyboardGrabManagerV1Interface in interface @p version. - * - * @returns The created manager object - * @since 5.52 - **/ - ZWPXwaylandKeyboardGrabManagerV1Interface *createZWPXwaylandKeyboardGrabManagerV1(QObject *parent = nullptr); - /** - * Creates the StrutInterface in interface @p version. - * - * @returns The created strut object - * @since 5.52 - **/ - StrutInterface *createStrut(QObject *parent = nullptr); - - /** - * Creates the PrimarySelectionDeviceManagerV1Interface */ - PrimarySelectionDeviceManagerV1Interface *createPrimarySelectionDeviceManagerV1(QObject *parent = nullptr); + QVector seats() const; + QList outputDevices() const; + QList outputs() const; + QVector outputsIntersecting(const QRect &rect) const; /** - * Creates the DataControlDeviceManagerInterface in interface @p version. - * - * @returns The created strut object - * @since 5.52 - **/ - DataControlDeviceManagerInterface *createDataControlDeviceManager(QObject *parent = nullptr); - /** * Gets the ClientConnection for the given @p client. * If there is no ClientConnection yet for the given @p client, it will be created. * @param client The native client for which the ClientConnection is retrieved * @return The ClientConnection for the given native client - **/ + */ ClientConnection *getConnection(wl_client *client); - QVector connections() const; + QVector connections() const; /** * Set the EGL @p display for this Wayland display. @@ -368,29 +132,32 @@ * Wayland display prior to calling this method. * * @see eglDisplay - * @since 5.3 - **/ + */ void setEglDisplay(void *display); /** * @returns the EGLDisplay used for this Wayland display or EGL_NO_DISPLAY if not set. * @see setEglDisplay - * @since 5.3 - **/ + */ void *eglDisplay() const; + /** + * Returns the client buffer with the specified @a resource. Returns @c null if there's + * no such a buffer. + */ + ClientBuffer *clientBufferForResource(wl_resource *resource) const; + +private Q_SLOTS: + void flush(); + Q_SIGNALS: - void socketNameChanged(const QString&); + void socketNamesChanged(); void runningChanged(bool); - void aboutToTerminate(); - void clientConnected(KWayland::Server::ClientConnection*); - void clientDisconnected(KWayland::Server::ClientConnection*); + void clientConnected(KWaylandServer::ClientConnection *); + void clientDisconnected(KWaylandServer::ClientConnection *); private: - class Private; - QScopedPointer d; + friend class DisplayPrivate; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/display_p.h dwayland-5.57.0.24+really5.24.3/src/server/display_p.h --- dwayland-5.57.0.23/src/server/display_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/display_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,60 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2018 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include +#include +#include +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class ClientBufferIntegration; +class ClientBuffer; +class ClientConnection; +class Display; +class OutputInterface; +class OutputDeviceV2Interface; +class SeatInterface; +struct ClientBufferDestroyListener; + +class DisplayPrivate +{ +public: + static DisplayPrivate *get(Display *display); + DisplayPrivate(Display *q); + + void registerSocketName(const QString &socketName); + + void registerClientBuffer(ClientBuffer *clientBuffer); + void unregisterClientBuffer(ClientBuffer *clientBuffer); + + Display *q; + QSocketNotifier *socketNotifier = nullptr; + wl_display *display = nullptr; + wl_event_loop *loop = nullptr; + bool running = false; + QList outputs; + QList outputdevicesV2; + QVector seats; + QVector clients; + QStringList socketNames; + EGLDisplay eglDisplay = EGL_NO_DISPLAY; + QHash<::wl_resource *, ClientBuffer *> resourceToBuffer; + QHash bufferToListener; + QList bufferIntegrations; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/dpms_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface.cpp --- dwayland-5.57.0.23/src/server/dpms_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,98 +1,77 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "dpms_interface_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "display.h" +#include "dpms_interface_p.h" #include "output_interface.h" -#include - -namespace KWayland -{ -namespace Server -{ - -const quint32 DpmsManagerInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_dpms_manager_interface DpmsManagerInterface::Private::s_interface = { - getDpmsCallback -}; -#endif -DpmsManagerInterface::Private::Private(DpmsManagerInterface *qptr, Display *d) - : Global::Private(d, &org_kde_kwin_dpms_manager_interface, s_version) - , q(qptr) +namespace KWaylandServer { -} +static const quint32 s_version = 1; -void DpmsManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +DpmsManagerInterfacePrivate::DpmsManagerInterfacePrivate(DpmsManagerInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_dpms_manager(*display, s_version) + , q(_q) { - auto c = display->getConnection(client); - wl_resource *dpms = c->createResource(&org_kde_kwin_dpms_manager_interface, qMin(version, s_version), id); - if (!dpms) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(dpms, &s_interface, this, nullptr); } -void DpmsManagerInterface::Private::getDpmsCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *output) +void DpmsManagerInterfacePrivate::org_kde_kwin_dpms_manager_get(Resource *resource, uint32_t id, wl_resource *output) { - auto p = Private::cast(resource); - auto c = p->display->getConnection(client); OutputInterface *o = OutputInterface::get(output); - DpmsInterface *dpms = new DpmsInterface(o, resource, p->q); - dpms->create(c, wl_resource_get_version(resource), id); - if (!dpms->resource()) { - wl_resource_post_no_memory(resource); + + wl_resource *dpms_resource = wl_resource_create(resource->client(), &org_kde_kwin_dpms_interface, resource->version(), id); + if (!dpms_resource) { + wl_client_post_no_memory(resource->client()); return; } - qDebug() << __func__ << "resource: " << resource; + auto dpms = new DpmsInterface(o, dpms_resource); + dpms->sendSupported(); dpms->sendMode(); dpms->sendDone(); } DpmsManagerInterface::DpmsManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new DpmsManagerInterfacePrivate(this, display)) { } DpmsManagerInterface::~DpmsManagerInterface() = default; +DpmsInterface::DpmsInterface(OutputInterface *output, wl_resource *resource) + : QObject() + , QtWaylandServer::org_kde_kwin_dpms(resource) + , output(output) +{ + connect(output, &OutputInterface::dpmsSupportedChanged, this, [this] { + sendSupported(); + sendDone(); + }); + connect(output, &OutputInterface::dpmsModeChanged, this, [this] { + sendMode(); + sendDone(); + }); +} + +DpmsInterface::~DpmsInterface() = default; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_dpms_interface DpmsInterface::Private::s_interface = { - setCallback, - resourceDestroyedCallback -}; -#endif +void DpmsInterface::org_kde_kwin_dpms_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} -DpmsInterface::Private::Private(DpmsInterface *q, DpmsManagerInterface *g, wl_resource *parentResource, OutputInterface *outputInterface) - : Resource::Private(q, g, parentResource, &org_kde_kwin_dpms_interface, &s_interface) - , output(outputInterface) +void DpmsInterface::org_kde_kwin_dpms_destroy_resource(Resource *resource) { + Q_UNUSED(resource) + delete this; } -void DpmsInterface::Private::setCallback(wl_client *client, wl_resource *resource, uint32_t mode) +void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) { - Q_UNUSED(client) + Q_UNUSED(resource) OutputInterface::DpmsMode dpmsMode; switch (mode) { case ORG_KDE_KWIN_DPMS_MODE_ON: @@ -110,45 +89,17 @@ default: return; } - if (cast(resource) && cast(resource)->output) { - emit cast(resource)->output->dpmsModeRequested(dpmsMode); - } else { - qDebug() << "skip dpmsModeRequested"; - } -} - -DpmsInterface::DpmsInterface(OutputInterface *output, wl_resource *parentResource, DpmsManagerInterface *manager) - : Resource(new Private(this, manager, parentResource, output)) -{ - connect(output, &OutputInterface::dpmsSupportedChanged, this, - [this] { - sendSupported(); - sendDone(); - } - ); - connect(output, &OutputInterface::dpmsModeChanged, this, - [this] { - qDebug() << "dpmsModeChanged" << "resource:" << this->d->resource; - if (!d->resource) return; - - sendMode(); - sendDone(); - } - ); + Q_EMIT output->dpmsModeRequested(dpmsMode); } -DpmsInterface::~DpmsInterface() = default; - void DpmsInterface::sendSupported() { - Q_D(); - org_kde_kwin_dpms_send_supported(d->resource, d->output->isDpmsSupported() ? 1 : 0); + send_supported(output->isDpmsSupported() ? 1 : 0); } void DpmsInterface::sendMode() { - Q_D(); - const auto mode = d->output->dpmsMode(); + const auto mode = output->dpmsMode(); org_kde_kwin_dpms_mode wlMode; switch (mode) { case OutputInterface::DpmsMode::On: @@ -166,23 +117,12 @@ default: Q_UNREACHABLE(); } - - if (d->resource) - org_kde_kwin_dpms_send_mode(d->resource, wlMode); + send_mode(wlMode); } void DpmsInterface::sendDone() { - Q_D(); - if (!d->resource) return; - org_kde_kwin_dpms_send_done(d->resource); - client()->flush(); + send_done(); } -DpmsInterface::Private *DpmsInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} } diff -Nru dwayland-5.57.0.23/src/server/dpms_interface.h dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface.h --- dwayland-5.57.0.23/src/server/dpms_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,44 +1,27 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DPMS_INTERFACE_H -#define WAYLAND_SERVER_DPMS_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include -#include "global.h" +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class Display; +class DpmsManagerInterfacePrivate; /** - * @brief Global for the org_kde_kwin_dpms_manager interface. + * @brief Global for server side Display Power Management Signaling interface. * - * If the DpmsManagerInterface is created it allows a client to - * query the Dpms state on a given OutputInterface and request - * changes for it. The code interaction happens only via the - * OutputInterface. + * A DpmsManagerInterface allows a client to query the DPMS state + * on a given OutputInterface and request changes to it. + * Server-side the interaction happens only via the OutputInterface, + * for clients the Dpms class provides the API. + * This global implements org_kde_kwin_dpms_manager. * * To create a DpmsManagerInterface use: * @code @@ -57,26 +40,22 @@ * To connect to Dpms change requests use: * @code * connect(output, &OutputInterface::dpmsModeRequested, - * [] (KWayland::Server::OutputInterface::DpmsMode requestedMode) { qDebug() << "Mode change requested"; }); + * [] (KWaylandServer::OutputInterface::DpmsMode requestedMode) { qDebug() << "Mode change requested"; }); * @endcode * * @see Display * @see OutputInterface - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT DpmsManagerInterface : public Global + */ +class KWAYLANDSERVER_EXPORT DpmsManagerInterface : public QObject { Q_OBJECT + public: - virtual ~DpmsManagerInterface(); + explicit DpmsManagerInterface(Display *display, QObject *parent = nullptr); + ~DpmsManagerInterface() override; private: - explicit DpmsManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/dpms_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface_p.h --- dwayland-5.57.0.23/src/server/dpms_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/dpms_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,84 +1,46 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_DPMS_INTERFACE_P_H -#define WAYLAND_SERVER_DPMS_INTERFACE_P_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include "dpms_interface.h" -#include "global_p.h" -#include "resource_p.h" -#include +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class OutputInterface; -class DpmsManagerInterface::Private : public Global::Private +class DpmsManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_dpms_manager { public: - Private(DpmsManagerInterface *q, Display *d); - -private: - static void getDpmsCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *output); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - void bind(wl_client *client, uint32_t version, uint32_t id) override; + DpmsManagerInterfacePrivate(DpmsManagerInterface *q, Display *d); DpmsManagerInterface *q; - static const struct org_kde_kwin_dpms_manager_interface s_interface; - static const quint32 s_version; + +protected: + void org_kde_kwin_dpms_manager_get(Resource *resource, uint32_t id, wl_resource *output) override; }; -class DpmsInterface : public Resource +class DpmsInterface : public QObject, QtWaylandServer::org_kde_kwin_dpms { Q_OBJECT public: - explicit DpmsInterface(OutputInterface *output, wl_resource *parentResource, DpmsManagerInterface *manager); - virtual ~DpmsInterface(); + explicit DpmsInterface(OutputInterface *output, wl_resource *resource); + ~DpmsInterface() override; void sendSupported(); void sendMode(); void sendDone(); -private: - class Private; - Private *d_func() const; -}; - -class DpmsInterface::Private : public Resource::Private -{ -public: - explicit Private(DpmsInterface *q, DpmsManagerInterface *g, wl_resource *parentResource, OutputInterface *output); - OutputInterface *output; -private: - static void setCallback(wl_client *client, wl_resource *resource, uint32_t mode); - static const struct org_kde_kwin_dpms_interface s_interface; +protected: + void org_kde_kwin_dpms_destroy_resource(Resource *resource) override; + void org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) override; + void org_kde_kwin_dpms_release(Resource *resource) override; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/drmclientbuffer.cpp dwayland-5.57.0.24+really5.24.3/src/server/drmclientbuffer.cpp --- dwayland-5.57.0.23/src/server/drmclientbuffer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drmclientbuffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,94 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "drmclientbuffer.h" +#include "clientbuffer_p.h" +#include "display.h" + +#include +#include + +#ifndef EGL_WL_bind_wayland_display +#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB +#endif + +namespace KWaylandServer +{ +typedef EGLBoolean (*eglQueryWaylandBufferWL_func)(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +static eglQueryWaylandBufferWL_func eglQueryWaylandBufferWL = nullptr; + +class DrmClientBufferPrivate : public ClientBufferPrivate +{ +public: + int textureFormat = 0; + int width = 0; + int height = 0; + int yInverted = 0; + bool hasAlphaChannel = false; +}; + +DrmClientBuffer::DrmClientBuffer(wl_resource *resource, DrmClientBufferIntegration *integration) + : ClientBuffer(resource, *new DrmClientBufferPrivate) +{ + Q_D(DrmClientBuffer); + + EGLDisplay eglDisplay = integration->display()->eglDisplay(); + eglQueryWaylandBufferWL(eglDisplay, resource, EGL_TEXTURE_FORMAT, &d->textureFormat); + eglQueryWaylandBufferWL(eglDisplay, resource, EGL_WIDTH, &d->width); + eglQueryWaylandBufferWL(eglDisplay, resource, EGL_HEIGHT, &d->height); + + if (!eglQueryWaylandBufferWL(eglDisplay, resource, EGL_WAYLAND_Y_INVERTED_WL, &d->yInverted)) { + // If EGL_WAYLAND_Y_INVERTED_WL is unsupported, we must assume that the buffer is inverted. + d->yInverted = true; + } +} + +int DrmClientBuffer::textureFormat() const +{ + Q_D(const DrmClientBuffer); + return d->textureFormat; +} + +QSize DrmClientBuffer::size() const +{ + Q_D(const DrmClientBuffer); + return QSize(d->width, d->height); +} + +bool DrmClientBuffer::hasAlphaChannel() const +{ + Q_D(const DrmClientBuffer); + return d->textureFormat == EGL_TEXTURE_RGBA; +} + +ClientBuffer::Origin DrmClientBuffer::origin() const +{ + Q_D(const DrmClientBuffer); + return d->yInverted ? Origin::TopLeft : Origin::BottomLeft; +} + +DrmClientBufferIntegration::DrmClientBufferIntegration(Display *display) + : ClientBufferIntegration(display) +{ +} + +ClientBuffer *DrmClientBufferIntegration::createBuffer(::wl_resource *resource) +{ + EGLDisplay eglDisplay = display()->eglDisplay(); + static bool resolved = false; + if (!resolved && eglDisplay != EGL_NO_DISPLAY) { + eglQueryWaylandBufferWL = (eglQueryWaylandBufferWL_func)eglGetProcAddress("eglQueryWaylandBufferWL"); + resolved = true; + } + + EGLint format; + if (eglQueryWaylandBufferWL(eglDisplay, resource, EGL_TEXTURE_FORMAT, &format)) { + return new DrmClientBuffer(resource, this); + } + return nullptr; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/drmclientbuffer.h dwayland-5.57.0.24+really5.24.3/src/server/drmclientbuffer.h --- dwayland-5.57.0.23/src/server/drmclientbuffer.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drmclientbuffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,51 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "clientbuffer.h" +#include "clientbufferintegration.h" + +namespace KWaylandServer +{ +class DrmClientBufferPrivate; + +/** + * The DrmClientBufferIntegration class provides support for wl_drm client buffers. + */ +class KWAYLANDSERVER_EXPORT DrmClientBufferIntegration : public ClientBufferIntegration +{ + Q_OBJECT + +public: + explicit DrmClientBufferIntegration(Display *display); + + ClientBuffer *createBuffer(::wl_resource *resource) override; +}; + +/** + * The DrmClientBuffer class represents a wl_drm client buffer. + * + * Nowadays, the wl_drm protocol is de-facto deprecated with the introduction of the + * linux-dmabuf-v1 protocol. Note that Vulkan WSI in Mesa still prefers wl_drm, but + * that's about to change, https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4942/ + */ +class KWAYLANDSERVER_EXPORT DrmClientBuffer : public ClientBuffer +{ + Q_OBJECT + Q_DECLARE_PRIVATE(DrmClientBuffer) + +public: + explicit DrmClientBuffer(wl_resource *resource, DrmClientBufferIntegration *integration); + + int textureFormat() const; + + QSize size() const override; + bool hasAlphaChannel() const override; + Origin origin() const override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/drm_fourcc.h dwayland-5.57.0.24+really5.24.3/src/server/drm_fourcc.h --- dwayland-5.57.0.23/src/server/drm_fourcc.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drm_fourcc.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,25 +1,8 @@ /* - * Copyright 2011 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ + SPDX-FileCopyrightText: 2011 Intel Corporation + + SPDX-License-Identifier: MIT +*/ #ifndef DRM_FOURCC_H #define DRM_FOURCC_H @@ -34,102 +17,101 @@ extern "C" { #endif -#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ - ((__u32)(c) << 16) | ((__u32)(d) << 24)) +#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) -#define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ +#define DRM_FORMAT_BIG_ENDIAN (1 << 31) /* format is big endian instead of little endian */ /* color index */ -#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ +#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ /* 8 bpp Red */ -#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ +#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ /* 16 bpp Red */ -#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ +#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ /* 16 bpp RG */ -#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ -#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ +#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ +#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ /* 32 bpp RG */ -#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ -#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ +#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ +#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ /* 8 bpp RGB */ -#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ -#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ +#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ +#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ /* 16 bpp RGB */ -#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ -#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ -#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ -#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ - -#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ -#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ -#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ -#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ - -#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ -#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ -#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ -#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ - -#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ -#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ -#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ -#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ +#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ +#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ +#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ +#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ + +#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ +#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ +#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ +#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ + +#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ +#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ +#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ +#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ + +#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ +#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ +#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ +#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ -#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ -#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ +#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ +#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ /* 24 bpp RGB */ -#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ -#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ +#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ +#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ /* 32 bpp RGB */ -#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ -#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ -#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ -#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ - -#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ -#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ -#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ -#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ - -#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ -#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ -#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ -#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ - -#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ -#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ -#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ -#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ +#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ +#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ +#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ +#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ + +#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ +#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ +#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ +#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ + +#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ +#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ +#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ +#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ + +#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ +#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ +#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ +#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ /* packed YCbCr */ -#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ -#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ -#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ -#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ +#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ +#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ +#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ +#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ -#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ /* * 2 plane RGB + A * index 0 = RGB plane, same format as the corresponding non _A8 format has * index 1 = A plane, [7:0] A */ -#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') -#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') -#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') -#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') -#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') -#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') -#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') -#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') +#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') +#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') +#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') +#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') +#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') +#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') +#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') +#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') /* * 2 plane YCbCr @@ -138,12 +120,12 @@ * or * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian */ -#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ -#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ -#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ -#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ -#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ -#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ /* * 3 plane YCbCr @@ -154,17 +136,16 @@ * index 1: Cr plane, [7:0] Cr * index 2: Cb plane, [7:0] Cb */ -#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ -#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ -#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ -#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ -#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ -#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ -#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ -#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ -#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ -#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ - +#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ +#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ +#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ +#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ +#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ +#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ +#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ +#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ +#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ +#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ /* * Format Modifiers: @@ -178,21 +159,20 @@ */ /* Vendor Ids: */ -#define DRM_FORMAT_MOD_NONE 0 -#define DRM_FORMAT_MOD_VENDOR_NONE 0 -#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 -#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 -#define DRM_FORMAT_MOD_VENDOR_NV 0x03 +#define DRM_FORMAT_MOD_NONE 0 +#define DRM_FORMAT_MOD_VENDOR_NONE 0 +#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 +#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 +#define DRM_FORMAT_MOD_VENDOR_NV 0x03 #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 -#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 +#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 #define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 #define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 /* add more to the end as needed */ -#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) +#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) -#define fourcc_mod_code(vendor, val) \ - ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL)) +#define fourcc_mod_code(vendor, val) ((((__u64)DRM_FORMAT_MOD_VENDOR_##vendor) << 56) | (val & 0x00ffffffffffffffULL)) /* * Format Modifier tokens: @@ -209,7 +189,7 @@ * list, or to initialize a variable with an invalid modifier. It might also be * used to report an error back to userspace for certain APIs. */ -#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) +#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) /* * Linear Layout @@ -219,7 +199,7 @@ * which tells the driver to also take driver-internal information into account * and so might actually result in a tiled framebuffer. */ -#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) +#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) /* Intel framebuffer modifiers */ @@ -235,7 +215,7 @@ * sharing. It exists since on a given platform it does uniquely identify the * layout in a simple way for i915-specific userspace. */ -#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) +#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) /* * Intel Y-tiling layout @@ -250,7 +230,7 @@ * sharing. It exists since on a given platform it does uniquely identify the * layout in a simple way for i915-specific userspace. */ -#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) +#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) /* * Intel Yf-tiling layout @@ -284,8 +264,8 @@ * But that fact is not relevant unless the memory is accessed * directly. */ -#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) -#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) +#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) +#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) /* * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks @@ -300,7 +280,7 @@ * * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html */ -#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) +#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) /* Vivante framebuffer modifiers */ @@ -310,7 +290,7 @@ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major * layout. */ -#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) +#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) /* * Vivante 64x64 super-tiling layout @@ -322,7 +302,7 @@ * For more information: see * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling */ -#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) +#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) /* * Vivante 4x4 tiling layout for dual-pipe @@ -331,7 +311,7 @@ * different base address. Offsets from the base addresses are therefore halved * compared to the non-split tiled layout. */ -#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) +#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) /* * Vivante 64x64 super-tiling layout for dual-pipe @@ -349,12 +329,9 @@ * a block. Reserve the lower 32 bits for parameters */ #define __fourcc_mod_tegra_mode_shift 32 -#define fourcc_mod_tegra_code(val, params) \ - fourcc_mod_code(NV, ((((__u64)val) << __fourcc_mod_tegra_mode_shift) | params)) -#define fourcc_mod_tegra_mod(m) \ - (m & ~((1ULL << __fourcc_mod_tegra_mode_shift) - 1)) -#define fourcc_mod_tegra_param(m) \ - (m & ((1ULL << __fourcc_mod_tegra_mode_shift) - 1)) +#define fourcc_mod_tegra_code(val, params) fourcc_mod_code(NV, ((((__u64)val) << __fourcc_mod_tegra_mode_shift) | params)) +#define fourcc_mod_tegra_mod(m) (m & ~((1ULL << __fourcc_mod_tegra_mode_shift) - 1)) +#define fourcc_mod_tegra_param(m) (m & ((1ULL << __fourcc_mod_tegra_mode_shift) - 1)) /* * Tegra Tiled Layout, used by Tegra 2, 3 and 4. diff -Nru dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface.cpp --- dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,389 @@ +/* + SPDX-FileCopyrightText: 2021 Xaver Hugl + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "drmleasedevice_v1_interface.h" +#include "drmleasedevice_v1_interface_p.h" +#include "display.h" +#include "logging.h" +#include "utils.h" + +#include +#include + +namespace KWaylandServer +{ + +static const quint32 s_version = 1; + +DrmLeaseDeviceV1Interface::DrmLeaseDeviceV1Interface(Display *display, std::function createNonMasterFd) + : d(new DrmLeaseDeviceV1InterfacePrivate(display, this, createNonMasterFd)) +{ +} + +DrmLeaseDeviceV1Interface::~DrmLeaseDeviceV1Interface() +{ + d->remove(); +} + +void DrmLeaseDeviceV1Interface::setDrmMaster(bool hasDrmMaster) +{ + if (hasDrmMaster && !d->hasDrmMaster) { + // withdraw all connectors + for (const auto &connector : qAsConst(d->connectors)) { + DrmLeaseConnectorV1InterfacePrivate::get(connector)->withdraw(); + } + // and revoke all leases + for (const auto &lease : qAsConst(d->leases)) { + lease->deny(); + } + } else if (!hasDrmMaster && d->hasDrmMaster) { + // send pending drm fds + while (!d->pendingFds.isEmpty()) { + int fd = d->createNonMasterFd(); + d->send_drm_fd(d->pendingFds.dequeue(), fd); + close(fd); + } + // offer all connectors again + for (const auto &connector : qAsConst(d->connectors)) { + auto connectorPrivate = DrmLeaseConnectorV1InterfacePrivate::get(connector); + connectorPrivate->withdrawn = false; + for (const auto &resource : d->resourceMap()) { + auto connectorResource = connectorPrivate->add(resource->client(), 0, s_version); + d->send_connector(resource->handle, connectorResource->handle); + connectorPrivate->send(connectorResource->handle); + } + } + } + d->hasDrmMaster = hasDrmMaster; +} + + +DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function createNonMasterFd) + : QtWaylandServer::wp_drm_lease_device_v1(*display, s_version) + , q(device) + , createNonMasterFd(createNonMasterFd) +{ +} + +DrmLeaseDeviceV1InterfacePrivate::~DrmLeaseDeviceV1InterfacePrivate() +{ +} + +void DrmLeaseDeviceV1InterfacePrivate::remove() +{ + for (const auto &lease : qAsConst(leases)) { + lease->deny(); + } + for (const auto &connector : qAsConst(connectors)) { + DrmLeaseConnectorV1InterfacePrivate::get(connector)->withdraw(); + } + for (const auto &request : qAsConst(leaseRequests)) { + request->connectors.clear(); + } + globalRemove(); + removed = true; + if (resourceMap().isEmpty()) { + delete this; + } +} + +void DrmLeaseDeviceV1InterfacePrivate::registerConnector(DrmLeaseConnectorV1Interface *connector) +{ + connectors << connector; + if (!hasDrmMaster) { + return; + } + for (const auto &resource : resourceMap()) { + auto connectorPrivate = DrmLeaseConnectorV1InterfacePrivate::get(connector); + auto connectorResource = connectorPrivate->add(resource->client(), 0, resource->version()); + send_connector(resource->handle, connectorResource->handle); + connectorPrivate->send(connectorResource->handle); + } +} + +void DrmLeaseDeviceV1InterfacePrivate::unregisterConnector(DrmLeaseConnectorV1Interface *connector) +{ + connectors.removeOne(connector); + for (const auto &lease : qAsConst(leases)) { + if (lease->d->connectors.contains(connector)) { + lease->d->connectors.removeOne(connector); + lease->deny(); + } + } + for (const auto &leaseRequest : qAsConst(leaseRequests)) { + if (leaseRequest->connectors.removeOne(connector)) { + leaseRequest->invalid = true; + } + } +} + +DrmLeaseDeviceV1InterfacePrivate *DrmLeaseDeviceV1InterfacePrivate::get(DrmLeaseDeviceV1Interface *device) +{ + return device->d; +} + +void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) +{ + wl_resource *requestResource = wl_resource_create(resource->client(), &wp_drm_lease_request_v1_interface, + resource->version(), id); + if (!requestResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + leaseRequests << new DrmLeaseRequestV1Interface(this, requestResource); +} + +void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_release(Resource *resource) +{ + send_released(resource->handle); + wl_resource_destroy(resource->handle); +} + +void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_bind_resource(Resource *resource) +{ + if (!hasDrmMaster) { + pendingFds << resource->handle; + return; + } + int fd = createNonMasterFd(); + send_drm_fd(resource->handle, fd); + close(fd); + for (const auto &connector : qAsConst(connectors)) { + auto connectorPrivate = DrmLeaseConnectorV1InterfacePrivate::get(connector); + if (!connectorPrivate->withdrawn) { + auto connectorResource = connectorPrivate->add(resource->client(), 0, s_version); + send_connector(resource->handle, connectorResource->handle); + connectorPrivate->send(connectorResource->handle); + } + } +} + +void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + if (removed && resourceMap().isEmpty()) { + delete this; + } +} + + +DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, + uint32_t id, + const QString &name, + const QString &description) + : d(new DrmLeaseConnectorV1InterfacePrivate(leaseDevice, this, id, name, description)) +{ + DrmLeaseDeviceV1InterfacePrivate::get(leaseDevice)->registerConnector(this); +} + +DrmLeaseConnectorV1Interface::~DrmLeaseConnectorV1Interface() +{ + d->withdraw(); + if (d->device) { + auto devicePrivate = DrmLeaseDeviceV1InterfacePrivate::get(d->device); + devicePrivate->unregisterConnector(this); + } +} + +DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource) +{ + if (auto connectorPrivate = resource_cast(resource)) { + return connectorPrivate->q; + } + return nullptr; +} + +DrmLeaseConnectorV1InterfacePrivate::DrmLeaseConnectorV1InterfacePrivate(DrmLeaseDeviceV1Interface *device, + DrmLeaseConnectorV1Interface *connector, + uint32_t connectorId, + const QString &name, + const QString &description) + : wp_drm_lease_connector_v1() + , q(connector) + , device(device) + , connectorId(connectorId) + , name(name) + , description(description) +{ +} + +DrmLeaseConnectorV1InterfacePrivate::~DrmLeaseConnectorV1InterfacePrivate() +{ +} + +void DrmLeaseConnectorV1InterfacePrivate::send(wl_resource *resource) +{ + send_connector_id(resource, connectorId); + send_name(resource, name); + send_description(resource, description); + send_done(resource); +} + +void DrmLeaseConnectorV1InterfacePrivate::withdraw() +{ + if (!withdrawn) { + withdrawn = true; + for (const auto &resource : resourceMap()) { + send_withdrawn(resource->handle); + DrmLeaseDeviceV1InterfacePrivate::get(device)->send_done(resource->handle); + } + } +} + +DrmLeaseConnectorV1InterfacePrivate *DrmLeaseConnectorV1InterfacePrivate::get(DrmLeaseConnectorV1Interface *connector) +{ + return connector->d.get(); +} + +void DrmLeaseConnectorV1InterfacePrivate::wp_drm_lease_connector_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + + +DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource) + : wp_drm_lease_request_v1(resource) + , device(device) +{ +} + +DrmLeaseRequestV1Interface::~DrmLeaseRequestV1Interface() +{ + device->leaseRequests.removeOne(this); +} + +void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector_handle) +{ + Q_UNUSED(resource); + if (auto connector = DrmLeaseConnectorV1Interface::get(connector_handle)) { + auto connectorPrivate = DrmLeaseConnectorV1InterfacePrivate::get(connector); + if (connectorPrivate->device != device->q) { + wl_resource_post_error(resource->handle, WP_DRM_LEASE_REQUEST_V1_ERROR_WRONG_DEVICE, "Requested connector from invalid lease device"); + } else if (connectorPrivate->withdrawn) { + qCWarning(KWAYLAND_SERVER) << "DrmLease: withdrawn connector requested"; + } else if (connectors.contains(connector)) { + wl_resource_post_error(resource->handle, WP_DRM_LEASE_REQUEST_V1_ERROR_DUPLICATE_CONNECTOR, "Requested connector twice"); + } else { + connectors << connector; + } + } else { + qCWarning(KWAYLAND_SERVER, "DrmLease: Invalid connector requested"); + } +} + +void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) +{ + wl_resource *leaseResource = wl_resource_create(resource->client(), &wp_drm_lease_v1_interface, s_version, id); + if (!leaseResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + DrmLeaseV1Interface *lease = new DrmLeaseV1Interface(device, leaseResource); + device->leases << lease; + if (!device->hasDrmMaster) { + qCWarning(KWAYLAND_SERVER) << "DrmLease: rejecting lease request without drm master"; + lease->deny(); + } else if (invalid) { + qCWarning(KWAYLAND_SERVER()) << "DrmLease: rejecting lease request with a withdrawn connector"; + lease->deny(); + } else if (connectors.isEmpty()) { + wl_resource_post_error(resource->handle, WP_DRM_LEASE_REQUEST_V1_ERROR_EMPTY_LEASE, "Requested lease without connectors"); + } else { + lease->d->connectors = connectors; + emit device->q->leaseRequested(lease); + } + wl_resource_destroy(resource->handle); +} + +void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; +} + +DrmLeaseV1Interface::DrmLeaseV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource) + : d(new DrmLeaseV1InterfacePrivate(device, this, resource)) +{ +} + +DrmLeaseV1Interface::~DrmLeaseV1Interface() +{ + deny(); + d->device->leases.removeOne(this); +} + +void DrmLeaseV1Interface::grant(int leaseFd, uint32_t lesseeId) +{ + d->send_lease_fd(leaseFd); + close(leaseFd); + d->lesseeId = lesseeId; + for (const auto &connector : qAsConst(d->connectors)) { + DrmLeaseConnectorV1InterfacePrivate::get(connector)->withdraw(); + } +} + +void DrmLeaseV1Interface::deny() +{ + if (!d->finished) { + d->finished = true; + d->send_finished(); + } + if (!d->lesseeId) { + return; + } + Q_EMIT d->device->q->leaseRevoked(this); + // check if we should offer connectors again + if (d->device->hasDrmMaster) { + bool sent = false; + for (const auto &connector : qAsConst(d->connectors)) { + auto connectorPrivate = DrmLeaseConnectorV1InterfacePrivate::get(connector); + connectorPrivate->withdrawn = false; + for (const auto &resource : d->device->resourceMap()) { + auto connectorResource = connectorPrivate->add(resource->client(), 0, s_version); + d->device->send_connector(resource->handle, connectorResource->handle); + connectorPrivate->send(connectorResource->handle); + sent = true; + } + } + if (sent) { + for (const auto &resource : d->device->resourceMap()) { + d->device->send_done(resource->handle); + } + } + } + d->lesseeId = 0; +} + +uint32_t DrmLeaseV1Interface::lesseeId() const +{ + return d->lesseeId; +} + +QVector DrmLeaseV1Interface::connectors() const +{ + return d->connectors; +} + + +DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource) + : wp_drm_lease_v1(resource) + , device(device) + , q(q) +{ +} + +void DrmLeaseV1InterfacePrivate::wp_drm_lease_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void DrmLeaseV1InterfacePrivate::wp_drm_lease_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +} diff -Nru dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface.h --- dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,122 @@ +/* + SPDX-FileCopyrightText: 2021 Xaver Hugl + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ + +class Display; +class DrmLeaseDeviceV1InterfacePrivate; +class DrmLeaseV1Interface; +class DrmLeaseV1InterfacePrivate; +class DrmLeaseRequestV1Interface; +class DrmLeaseConnectorV1InterfacePrivate; + +/** + * The DrmLeaseV1DeviceInterface allows the wayland compositor to offer unused + * drm connectors for lease by clients. The main use for this is VR headsets + */ +class KWAYLANDSERVER_EXPORT DrmLeaseDeviceV1Interface : public QObject +{ + Q_OBJECT +public: + /** + * @param createNonMasterFd a function that creates non-master drm file descriptors for + * this device that clients can use to enumerate connectors and their properties + */ + explicit DrmLeaseDeviceV1Interface(Display *display, std::function createNonMasterFd); + ~DrmLeaseDeviceV1Interface() override; + + /** + * Must be called by the compositor when it loses or gains drm master + */ + void setDrmMaster(bool hasDrmMaster); + +Q_SIGNALS: + /** + * Emitted when a lease is requested. The compositor needs to either + * grant or deny the lease when receiving this signal + */ + void leaseRequested(DrmLeaseV1Interface *leaseRequest); + + /** + * Emitted when a granted lease gets revoked + */ + void leaseRevoked(DrmLeaseV1Interface *lease); + +private: + friend class DrmLeaseDeviceV1InterfacePrivate; + DrmLeaseDeviceV1InterfacePrivate *d; +}; + +/** + * Represents a lease offer from the compositor. Creating the DrmLeaseConnectorV1Interface + * will allow clients to requests a lease for the connector, deleting it will result in the + * offer and possibly an active lease being revoked + */ +class KWAYLANDSERVER_EXPORT DrmLeaseConnectorV1Interface : public QObject +{ + Q_OBJECT +public: + explicit DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, uint32_t id, const QString &name, const QString &description); + ~DrmLeaseConnectorV1Interface() override; + + static DrmLeaseConnectorV1Interface *get(wl_resource *resource); + +private: + friend class DrmLeaseConnectorV1InterfacePrivate; + QScopedPointer d; +}; + +/** + * Represents a lease request or active lease + */ +class KWAYLANDSERVER_EXPORT DrmLeaseV1Interface : public QObject +{ + Q_OBJECT +public: + /** + * Grant the client requesting the lease access to DRM resources needed to + * drive the outputs corresponding to the requested connectors. + * Must only be called once in response to DrmLeaseDeviceV1Interface::leaseRequested + */ + void grant(int leaseFd, uint32_t lesseeId); + + /** + * Deny the lease request. The compositor may call this in response to + * DrmLeaseDeviceV1Interface::leaseRequested or when it detects a lease being ended with libdrm + */ + void deny(); + + /** + * The connectors this lease (request) encompasses + */ + QVector connectors() const; + + /** + * The lesseeId passed to DrmLeaseV1Interface::grant, or 0 if this lease was not granted + */ + uint32_t lesseeId() const; + +private: + DrmLeaseV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource); + ~DrmLeaseV1Interface(); + + friend class DrmLeaseDeviceV1InterfacePrivate; + friend class DrmLeaseRequestV1Interface; + friend class DrmLeaseV1InterfacePrivate; + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface_p.h --- dwayland-5.57.0.23/src/server/drmleasedevice_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/drmleasedevice_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,104 @@ +/* + SPDX-FileCopyrightText: 2021 Xaver Hugl + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include +#include + +namespace KWaylandServer +{ + +class Display; +class DrmLeaseConnectorV1Interface; +class DrmLeaseRequestV1Interface; +class DrmLeaseV1Interface; + +class DrmLeaseDeviceV1InterfacePrivate : public QtWaylandServer::wp_drm_lease_device_v1 +{ +public: + DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function createNonMasterFd); + ~DrmLeaseDeviceV1InterfacePrivate(); + void remove(); + + void registerConnector(DrmLeaseConnectorV1Interface *connector); + void unregisterConnector(DrmLeaseConnectorV1Interface *connector); + + static DrmLeaseDeviceV1InterfacePrivate *get(DrmLeaseDeviceV1Interface *device); + + DrmLeaseDeviceV1Interface *q; + QVector connectors; + QVector leaseRequests; + QVector leases; + QQueue pendingFds; + std::function createNonMasterFd; + bool hasDrmMaster = true; + bool removed = false; +protected: + void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override; + void wp_drm_lease_device_v1_release(Resource *resource) override; + void wp_drm_lease_device_v1_bind_resource(Resource *resource) override; + void wp_drm_lease_device_v1_destroy_resource(Resource *resource) override; +}; + +class DrmLeaseConnectorV1InterfacePrivate : public QObject, public QtWaylandServer::wp_drm_lease_connector_v1 +{ + Q_OBJECT +public: + DrmLeaseConnectorV1InterfacePrivate(DrmLeaseDeviceV1Interface *device, DrmLeaseConnectorV1Interface *connector, + uint32_t connectorId, const QString &name, const QString &description); + ~DrmLeaseConnectorV1InterfacePrivate(); + + void send(wl_resource *resource); + void withdraw(); + + static DrmLeaseConnectorV1InterfacePrivate *get(DrmLeaseConnectorV1Interface *connector); + + DrmLeaseConnectorV1Interface *q; + QPointer device; + uint32_t connectorId; + QString name; + QString description; + bool withdrawn = false; +protected: + void wp_drm_lease_connector_v1_destroy(Resource *resource) override; +}; + +class DrmLeaseRequestV1Interface : public QtWaylandServer::wp_drm_lease_request_v1 +{ +public: + DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource); + ~DrmLeaseRequestV1Interface(); + + DrmLeaseDeviceV1InterfacePrivate *device; + QVector connectors; + bool invalid = false; +protected: + void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector) override; + void wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) override; + void wp_drm_lease_request_v1_destroy_resource(Resource *resource) override; +}; + +class DrmLeaseV1InterfacePrivate : public QtWaylandServer::wp_drm_lease_v1 +{ +public: + DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource); + + DrmLeaseDeviceV1InterfacePrivate *device; + DrmLeaseV1Interface *q; + QVector connectors; + uint32_t lesseeId = 0; + bool finished = false; +protected: + void wp_drm_lease_v1_destroy(Resource *resource) override; + void wp_drm_lease_v1_destroy_resource(Resource *resource) override; +}; + +} + diff -Nru dwayland-5.57.0.23/src/server/fakeinput_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/fakeinput_interface.cpp --- dwayland-5.57.0.23/src/server/fakeinput_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/fakeinput_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,175 +1,134 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "fakeinput_interface.h" #include "display.h" -#include "global_p.h" -#include #include -#include +#include +#include #include -#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 4; -class FakeInputInterface::Private : public Global::Private +class FakeInputInterfacePrivate : public QtWaylandServer::org_kde_kwin_fake_input { public: - Private(FakeInputInterface *q, Display *d); - QList devices; + FakeInputInterfacePrivate(FakeInputInterface *_q, Display *display); + QList devices; private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - static void authenticateCallback(wl_client *client, wl_resource *resource, const char *application, const char *reason); - static void pointerMotionCallback(wl_client *client, wl_resource *resource, wl_fixed_t delta_x, wl_fixed_t delta_y); - static void pointerMotionAbsoluteCallback(wl_client *client, wl_resource *resource, wl_fixed_t x, wl_fixed_t y); - static void buttonCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t state); - static void axisCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value); - static void axisForCaptureCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value); - static void touchDownCallback(wl_client *client, wl_resource *resource, quint32 id, wl_fixed_t x, wl_fixed_t y); - static void touchMotionCallback(wl_client *client, wl_resource *resource, quint32 id, wl_fixed_t x, wl_fixed_t y); - static void touchUpCallback(wl_client *client, wl_resource *resource, quint32 id); - static void touchCancelCallback(wl_client *client, wl_resource *resource); - static void touchFrameCallback(wl_client *client, wl_resource *resource); - static void keyboardKeyCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t state); - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - static FakeInputDevice *device(wl_resource *r); + FakeInputDevice *device(wl_resource *r); FakeInputInterface *q; - static const struct org_kde_kwin_fake_input_interface s_interface; - static const quint32 s_version; static QList touchIds; -}; - -class FakeInputDevice::Private -{ -public: - Private(wl_resource *resource, FakeInputInterface *interface, FakeInputDevice *q); - wl_resource *resource; - FakeInputInterface *interface; - bool authenticated = false; -private: - FakeInputDevice *q; +protected: + void org_kde_kwin_fake_input_bind_resource(Resource *resource) override; + void org_kde_kwin_fake_input_destroy_resource(Resource *resource) override; + void org_kde_kwin_fake_input_authenticate(Resource *resource, const QString &application, const QString &reason) override; + void org_kde_kwin_fake_input_pointer_motion(Resource *resource, wl_fixed_t delta_x, wl_fixed_t delta_y) override; + void org_kde_kwin_fake_input_button(Resource *resource, uint32_t button, uint32_t state) override; + void org_kde_kwin_fake_input_axis(Resource *resource, uint32_t axis, wl_fixed_t value) override; + void org_kde_kwin_fake_input_axis_for_capture(Resource *resource, uint32_t axis, wl_fixed_t value) override; + void org_kde_kwin_fake_input_touch_down(Resource *resource, uint32_t id, wl_fixed_t x, wl_fixed_t y) override; + void org_kde_kwin_fake_input_touch_motion(Resource *resource, uint32_t id, wl_fixed_t x, wl_fixed_t y) override; + void org_kde_kwin_fake_input_touch_up(Resource *resource, uint32_t id) override; + void org_kde_kwin_fake_input_touch_cancel(Resource *resource) override; + void org_kde_kwin_fake_input_touch_frame(Resource *resource) override; + void org_kde_kwin_fake_input_pointer_motion_absolute(Resource *resource, wl_fixed_t x, wl_fixed_t y) override; + void org_kde_kwin_fake_input_keyboard_key(Resource *resource, uint32_t button, uint32_t state) override; }; -const quint32 FakeInputInterface::Private::s_version = 3; -QList FakeInputInterface::Private::touchIds = QList(); +QList FakeInputInterfacePrivate::touchIds = QList(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_fake_input_interface FakeInputInterface::Private::s_interface = { - authenticateCallback, - pointerMotionCallback, - buttonCallback, - axisCallback, - axisForCaptureCallback, - touchDownCallback, - touchMotionCallback, - touchUpCallback, - touchCancelCallback, - touchFrameCallback, - pointerMotionAbsoluteCallback, - keyboardKeyCallback -}; -#endif +FakeInputInterfacePrivate::FakeInputInterfacePrivate(FakeInputInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_fake_input(*display, s_version) + , q(_q) +{ +} -FakeInputInterface::Private::Private(FakeInputInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_fake_input_interface, s_version) - , q(q) +FakeInputInterface::FakeInputInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new FakeInputInterfacePrivate(this, display)) { } -void FakeInputInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +FakeInputInterface::~FakeInputInterface() = default; + +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_bind_resource(Resource *resource) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_fake_input_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - FakeInputDevice *device = new FakeInputDevice(resource, q); + FakeInputDevice *device = new FakeInputDevice(q, resource->handle); devices << device; - QObject::connect(device, &FakeInputDevice::destroyed, q, [device, this] { devices.removeAll(device); }); - emit q->deviceCreated(device); + QObject::connect(device, &FakeInputDevice::destroyed, q, [device, this] { + devices.removeAll(device); + }); + Q_EMIT q->deviceCreated(device); } -void FakeInputInterface::Private::unbind(wl_resource *resource) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_destroy_resource(Resource *resource) { - if (FakeInputDevice *d = device(resource)) { + if (FakeInputDevice *d = device(resource->handle)) { d->deleteLater(); } } -FakeInputDevice *FakeInputInterface::Private::device(wl_resource *r) +FakeInputDevice *FakeInputInterfacePrivate::device(wl_resource *r) { - Private *p = cast(r); - auto it = std::find_if(p->devices.constBegin(), p->devices.constEnd(), [r] (FakeInputDevice *device) { return device->resource() == r; } ); - if (it != p->devices.constEnd()) { + auto it = std::find_if(devices.constBegin(), devices.constEnd(), [r](FakeInputDevice *device) { + return device->resource() == r; + }); + if (it != devices.constEnd()) { return *it; } return nullptr; } -void FakeInputInterface::Private::authenticateCallback(wl_client *client, wl_resource *resource, const char *application, const char *reason) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_authenticate(Resource *resource, const QString &application, const QString &reason) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d) { return; } - emit d->authenticationRequested(QString::fromUtf8(application), QString::fromUtf8(reason)); + Q_EMIT d->authenticationRequested(application, reason); } -void FakeInputInterface::Private::pointerMotionCallback(wl_client *client, wl_resource *resource, wl_fixed_t delta_x, wl_fixed_t delta_y) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_pointer_motion(Resource *resource, wl_fixed_t delta_x, wl_fixed_t delta_y) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } - emit d->pointerMotionRequested(QSizeF(wl_fixed_to_double(delta_x), wl_fixed_to_double(delta_y))); + Q_EMIT d->pointerMotionRequested(QSizeF(wl_fixed_to_double(delta_x), wl_fixed_to_double(delta_y))); } -void FakeInputInterface::Private::pointerMotionAbsoluteCallback(wl_client *client, wl_resource *resource, wl_fixed_t x, wl_fixed_t y) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_button(Resource *resource, uint32_t button, uint32_t state) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } - emit d->pointerMotionAbsoluteRequested(QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); + switch (state) { + case WL_POINTER_BUTTON_STATE_PRESSED: + Q_EMIT d->pointerButtonPressRequested(button); + break; + case WL_POINTER_BUTTON_STATE_RELEASED: + Q_EMIT d->pointerButtonReleaseRequested(button); + break; + default: + // nothing + break; + } } -void FakeInputInterface::Private::axisCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_axis(Resource *resource, uint32_t axis, wl_fixed_t value) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } @@ -185,13 +144,12 @@ // invalid return; } - emit d->pointerAxisRequested(orientation, wl_fixed_to_double(value)); + Q_EMIT d->pointerAxisRequested(orientation, wl_fixed_to_double(value)); } -void FakeInputInterface::Private::axisForCaptureCallback(wl_client *client, wl_resource *resource, uint32_t axis, wl_fixed_t value) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_axis_for_capture(Resource *resource, uint32_t axis, wl_fixed_t value) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } @@ -207,33 +165,12 @@ // invalid return; } - emit d->pointerAxisRequestedForCapture(orientation, wl_fixed_to_double(value)); + Q_EMIT d->pointerAxisRequestedForCapture(orientation, wl_fixed_to_double(value)); } -void FakeInputInterface::Private::buttonCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t state) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_touch_down(Resource *resource, uint32_t id, wl_fixed_t x, wl_fixed_t y) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); - if (!d || !d->isAuthenticated()) { - return; - } - switch (state) { - case WL_POINTER_BUTTON_STATE_PRESSED: - emit d->pointerButtonPressRequested(button); - break; - case WL_POINTER_BUTTON_STATE_RELEASED: - emit d->pointerButtonReleaseRequested(button); - break; - default: - // nothing - break; - } -} - -void FakeInputInterface::Private::touchDownCallback(wl_client *client, wl_resource *resource, quint32 id, wl_fixed_t x, wl_fixed_t y) -{ - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } @@ -241,26 +178,24 @@ return; } touchIds << id; - emit d->touchDownRequested(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); + Q_EMIT d->touchDownRequested(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } -void FakeInputInterface::Private::touchMotionCallback(wl_client *client, wl_resource *resource, quint32 id, wl_fixed_t x, wl_fixed_t y) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_touch_motion(Resource *resource, uint32_t id, wl_fixed_t x, wl_fixed_t y) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } if (!touchIds.contains(id)) { return; } - emit d->touchMotionRequested(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); + Q_EMIT d->touchMotionRequested(id, QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } -void FakeInputInterface::Private::touchUpCallback(wl_client *client, wl_resource *resource, quint32 id) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_touch_up(Resource *resource, uint32_t id) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } @@ -268,43 +203,49 @@ return; } touchIds.removeOne(id); - emit d->touchUpRequested(id); + Q_EMIT d->touchUpRequested(id); } -void FakeInputInterface::Private::touchCancelCallback(wl_client *client, wl_resource *resource) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_touch_cancel(Resource *resource) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } touchIds.clear(); - emit d->touchCancelRequested(); + Q_EMIT d->touchCancelRequested(); +} + +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_touch_frame(Resource *resource) +{ + FakeInputDevice *d = device(resource->handle); + if (!d || !d->isAuthenticated()) { + return; + } + Q_EMIT d->touchFrameRequested(); } -void FakeInputInterface::Private::touchFrameCallback(wl_client *client, wl_resource *resource) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_pointer_motion_absolute(Resource *resource, wl_fixed_t x, wl_fixed_t y) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } - emit d->touchFrameRequested(); + Q_EMIT d->pointerMotionAbsoluteRequested(QPointF(wl_fixed_to_double(x), wl_fixed_to_double(y))); } -void FakeInputInterface::Private::keyboardKeyCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t state) +void FakeInputInterfacePrivate::org_kde_kwin_fake_input_keyboard_key(Resource *resource, uint32_t button, uint32_t state) { - Q_UNUSED(client) - FakeInputDevice *d = device(resource); + FakeInputDevice *d = device(resource->handle); if (!d || !d->isAuthenticated()) { return; } switch (state) { case WL_KEYBOARD_KEY_STATE_PRESSED: - emit d->keyboardKeyPressRequested(button); + Q_EMIT d->keyboardKeyPressRequested(button); break; case WL_KEYBOARD_KEY_STATE_RELEASED: - emit d->keyboardKeyReleaseRequested(button); + Q_EMIT d->keyboardKeyReleaseRequested(button); break; default: // nothing @@ -312,23 +253,24 @@ } } -FakeInputInterface::FakeInputInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +class FakeInputDevicePrivate { -} - -FakeInputInterface::~FakeInputInterface() = default; +public: + FakeInputDevicePrivate(FakeInputInterface *interface, wl_resource *resource); + wl_resource *resource; + FakeInputInterface *interface; + bool authenticated = false; +}; -FakeInputDevice::Private::Private(wl_resource *resource, FakeInputInterface *interface, FakeInputDevice *q) +FakeInputDevicePrivate::FakeInputDevicePrivate(FakeInputInterface *interface, wl_resource *resource) : resource(resource) , interface(interface) - , q(q) { } -FakeInputDevice::FakeInputDevice(wl_resource *resource, FakeInputInterface *parent) +FakeInputDevice::FakeInputDevice(FakeInputInterface *parent, wl_resource *resource) : QObject(parent) - , d(new Private(resource, parent, this)) + , d(new FakeInputDevicePrivate(parent, resource)) { } @@ -350,4 +292,3 @@ } } -} diff -Nru dwayland-5.57.0.23/src/server/fakeinput_interface.h dwayland-5.57.0.24+really5.24.3/src/server/fakeinput_interface.h --- dwayland-5.57.0.23/src/server/fakeinput_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/fakeinput_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,37 +1,24 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_FAKEINPUT_INTERFACE_H -#define KWAYLAND_SERVER_FAKEINPUT_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include +#include +#include -#include -#include "global.h" +#include struct wl_resource; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class Display; class FakeInputDevice; +class FakeInputDevicePrivate; +class FakeInputInterfacePrivate; /** * @brief Represents the Global for org_kde_kwin_fake_input interface. @@ -48,41 +35,39 @@ * way trusted clients. * * @see FakeInputDevice - * @since 5.4 - **/ -class KWAYLANDSERVER_EXPORT FakeInputInterface : public Global + */ +class KWAYLANDSERVER_EXPORT FakeInputInterface : public QObject { Q_OBJECT + public: - virtual ~FakeInputInterface(); + explicit FakeInputInterface(Display *display, QObject *parent = nullptr); + ~FakeInputInterface() override; Q_SIGNALS: /** * Signal emitted whenever a client bound the fake input @p device. * @param device The created FakeInputDevice - **/ - void deviceCreated(KWayland::Server::FakeInputDevice *device); + */ + void deviceCreated(KWaylandServer::FakeInputDevice *device); private: - explicit FakeInputInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; /** * @brief Represents the Resource for a org_kde_kwin_fake_input interface. * * @see FakeInputInterface - * @since 5.4 - **/ + */ class KWAYLANDSERVER_EXPORT FakeInputDevice : public QObject { Q_OBJECT public: - virtual ~FakeInputDevice(); + ~FakeInputDevice() override; /** * @returns the native wl_resource. - **/ + */ wl_resource *resource(); /** @@ -90,11 +75,11 @@ * accepted, for @c false events are no longer accepted. * * @param authenticated Whether the FakeInputDevice should be considered authenticated - **/ + */ void setAuthentication(bool authenticated); /** * @returns whether the FakeInputDevice is authenticated and allowed to send events, default is @c false. - **/ + */ bool isAuthenticated() const; Q_SIGNALS: @@ -107,29 +92,27 @@ * * @param application A textual description of the application * @param reason A textual description of the reason why the application wants to send fake input events - **/ + */ void authenticationRequested(const QString &application, const QString &reason); /** * Request a pointer motion by @p delta. - **/ + */ void pointerMotionRequested(const QSizeF &delta); /** * Request an absolute pointer motion to @p pos. - * - * @since 5.54 - **/ + */ void pointerMotionAbsoluteRequested(const QPointF &pos); /** * Requests a pointer button pressed for @p button. - **/ + */ void pointerButtonPressRequested(quint32 button); /** * Requests a pointer button release for @p button. - **/ + */ void pointerButtonReleaseRequested(quint32 button); /** * Requests a pointer axis for the given @p orientation by @p delta. - **/ + */ void pointerAxisRequested(Qt::Orientation orientation, qreal delta); /** * Requests a pointer axis for the given @p orientation by @p delta. @@ -137,58 +120,39 @@ void pointerAxisRequestedForCapture(Qt::Orientation orientation, qreal delta); /** * Requests a touch down at @p pos and identified by @p id. - * - * @since 5.23 - **/ + */ void touchDownRequested(quint32 id, const QPointF &pos); /** * Requests a touch motion by @p pos and identified by @p id. - * - * @since 5.23 - **/ + */ void touchMotionRequested(quint32 id, const QPointF &pos); /** * Requests a touch up identified by @p id. - * - * @since 5.23 - **/ + */ void touchUpRequested(quint32 id); /** * Requests a touch cancel event. - * - * @since 5.23 - **/ + */ void touchCancelRequested(); /** * Requests a touch frame event. - * - * @since 5.23 - **/ + */ void touchFrameRequested(); - /** * Requests a keyboard key pressed for @p key. - * - * @since 5.63 - **/ + */ void keyboardKeyPressRequested(quint32 key); /** * Requests a keyboard key release for @p key. - * - * @since 5.63 - **/ + */ void keyboardKeyReleaseRequested(quint32 key); private: - friend class FakeInputInterface; - FakeInputDevice(wl_resource *resource, FakeInputInterface *parent); - class Private; - QScopedPointer d; + friend class FakeInputInterfacePrivate; + FakeInputDevice(FakeInputInterface *parent, wl_resource *resource); + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::FakeInputDevice*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::FakeInputDevice *) diff -Nru dwayland-5.57.0.23/src/server/filtered_display.cpp dwayland-5.57.0.24+really5.24.3/src/server/filtered_display.cpp --- dwayland-5.57.0.23/src/server/filtered_display.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/filtered_display.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "filtered_display.h" #include "display.h" @@ -25,40 +11,37 @@ #include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class FilteredDisplay::Private +class FilteredDisplayPrivate { public: - Private(FilteredDisplay *_q); + FilteredDisplayPrivate(FilteredDisplay *_q); FilteredDisplay *q; static bool globalFilterCallback(const wl_client *client, const wl_global *global, void *data) { - auto t = static_cast(data); - auto clientConnection = t->q->getConnection(const_cast(client)); + auto t = static_cast(data); + auto clientConnection = t->q->getConnection(const_cast(client)); auto interface = wl_global_get_interface(global); auto name = QByteArray::fromRawData(interface->name, strlen(interface->name)); return t->q->allowInterface(clientConnection, name); }; }; -FilteredDisplay::Private::Private(FilteredDisplay *_q): - q(_q) -{} - +FilteredDisplayPrivate::FilteredDisplayPrivate(FilteredDisplay *_q) + : q(_q) +{ +} -FilteredDisplay::FilteredDisplay(QObject *parent): - Display(parent), - d(new Private(this)) +FilteredDisplay::FilteredDisplay(QObject *parent) + : Display(parent) + , d(new FilteredDisplayPrivate(this)) { connect(this, &Display::runningChanged, [this](bool running) { if (!running) { return; } - wl_display_set_global_filter(*this, Private::globalFilterCallback, d.data()); + wl_display_set_global_filter(*this, FilteredDisplayPrivate::globalFilterCallback, d.data()); }); } @@ -67,4 +50,3 @@ } } -} diff -Nru dwayland-5.57.0.23/src/server/filtered_display.h dwayland-5.57.0.24+really5.24.3/src/server/filtered_display.h --- dwayland-5.57.0.23/src/server/filtered_display.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/filtered_display.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,65 +1,43 @@ -/******************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ -#ifndef KWAYLAND_SERVER_FILTERED_DISPLAY_H -#define KWAYLAND_SERVER_FILTERED_DISPLAY_H +#pragma once -#include "global.h" #include "display.h" -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class FilteredDisplayPrivate; /** -* Server Implementation that allows one to restrict which globals are available to which clients -* -* Users of this class must implement the virtual @method allowInterface method. -* -* @since 5.FIXME -*/ + * Server Implementation that allows one to restrict which globals are available to which clients + * + * Users of this class must implement the virtual @method allowInterface method. + */ class KWAYLANDSERVER_EXPORT FilteredDisplay : public Display { Q_OBJECT public: FilteredDisplay(QObject *parent); - ~FilteredDisplay(); + ~FilteredDisplay() override; -/** -* Return whether the @arg client can see the interface with the given @arg interfaceName -* -* When false will not see these globals for a given interface in the registry, -* and any manual attempts to bind will fail -* -* @return true if the client should be able to access the global with the following interfaceName -*/ + /** + * Return whether the @arg client can see the interface with the given @arg interfaceName + * + * When false will not see these globals for a given interface in the registry, + * and any manual attempts to bind will fail + * + * @return true if the client should be able to access the global with the following interfaceName + */ virtual bool allowInterface(ClientConnection *client, const QByteArray &interfaceName) = 0; + private: - class Private; - QScopedPointer d; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/generic_shell_surface_p.h dwayland-5.57.0.24+really5.24.3/src/server/generic_shell_surface_p.h --- dwayland-5.57.0.23/src/server/generic_shell_surface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/generic_shell_surface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_GENERIC_SHELL_SURFACE_P_H -#define KWAYLAND_SERVER_GENERIC_SHELL_SURFACE_P_H - -#include "seat_interface.h" -#include "surface_interface.h" -#include - -namespace KWayland -{ - -namespace Server -{ - -template -class GenericShellSurface -{ -public: - GenericShellSurface(T *shellSurface, SurfaceInterface *surface) - : surface(surface) - , shellSurface(shellSurface) - {} - - SurfaceInterface *surface; - QString title; - QByteArray windowClass; - -protected: - void setTitle(const QString &title); - void setWindowClass(const QByteArray &wc); - - static void moveCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial); - template - static void resizeCallback(wl_client *client, wl_resource *resource, wl_resource * seat, uint32_t serial, uint32_t edges); - static void setTitleCallback(wl_client *client, wl_resource *resource, const char *title); - static void setAppIdCallback(wl_client *client, wl_resource *resource, const char *app_id); - -private: - T *q_func() { - return shellSurface; - } - static typename T::Private *userData(wl_resource *resource) { - return reinterpret_cast(wl_resource_get_user_data(resource)); - } - T *shellSurface; -}; - -template -void GenericShellSurface::setTitleCallback(wl_client *client, wl_resource *resource, const char *title) -{ - auto s = userData(resource); - Q_ASSERT(client == *s->client); - s->setTitle(QString::fromUtf8(title)); -} - -template -void GenericShellSurface::setAppIdCallback(wl_client *client, wl_resource *resource, const char *app_id) -{ - auto s = userData(resource); - Q_ASSERT(client == *s->client); - s->setWindowClass(QByteArray(app_id)); -} - -template -void GenericShellSurface::setTitle(const QString &t) -{ - if (title == t) { - return; - } - title = t; - Q_Q(T); - emit q->titleChanged(title); -} - -template -void GenericShellSurface::setWindowClass(const QByteArray &wc) -{ - if (windowClass == wc) { - return; - } - windowClass = wc; - Q_Q(T); - emit q->windowClassChanged(windowClass); -} - -template -void GenericShellSurface::moveCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial) -{ - auto s = userData(resource); - Q_ASSERT(client == *s->client); - emit s->q_func()->moveRequested(SeatInterface::get(seat), serial); -} - -namespace { -template -Qt::Edges edgesToQtEdges(T edges); -} - -template -template -void GenericShellSurface::resizeCallback(wl_client *client, wl_resource *resource, wl_resource * seat, uint32_t serial, uint32_t edges) -{ - auto s = userData(resource); - Q_ASSERT(client == *s->client); - emit s->q_func()->resizeRequested(SeatInterface::get(seat), serial, edgesToQtEdges(U(edges))); -} - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/global.cpp dwayland-5.57.0.24+really5.24.3/src/server/global.cpp --- dwayland-5.57.0.23/src/server/global.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/global.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "global.h" -#include "global_p.h" -#include "display.h" -// wayland -#include - -namespace KWayland -{ -namespace Server -{ - -Global::Private::Private(Display *d, const wl_interface *interface, quint32 version) - : display(d) - , m_interface(interface) - , m_version(version) -{ -} - -Global::Private::~Private() = default; - -void Global::Private::bind(wl_client *client, void *data, uint32_t version, uint32_t id) -{ - auto d = reinterpret_cast(data); - d->bind(client, version, id); -} - -void Global::Private::create() -{ - Q_ASSERT(!global); - global = wl_global_create(*display, m_interface, m_version, this, bind); -} - -Global::Global(Global::Private *d, QObject *parent) - : QObject(parent) - , d(d) -{ -} - -Global::~Global() -{ - destroy(); -} - -void Global::create() -{ - d->create(); - wl_display_flush_clients(*(d->display)); -} - -void Global::destroy() -{ - if (!d->global) { - return; - } - emit aboutToDestroyGlobal(); - wl_global_destroy(d->global); - d->global = nullptr; - emit hasDestroyedGlobal(); - wl_display_flush_clients(*(d->display)); -} - -bool Global::isValid() const -{ - return d->global != nullptr; -} - -Global::operator wl_global*() const -{ - return d->global; -} - -Global::operator wl_global*() -{ - return d->global; -} - -Display *Global::display() -{ - return d->display; -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/global.h dwayland-5.57.0.24+really5.24.3/src/server/global.h --- dwayland-5.57.0.23/src/server/global.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/global.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_GLOBAL_H -#define WAYLAND_SERVER_GLOBAL_H - -#include - -#include - -struct wl_global; - -namespace KWayland -{ -namespace Server -{ -class Display; - -/** - * @brief Base class for all Globals. - * - * Any class representing a Global should be derived from this base class. - * This class provides common functionality for all globals. A global is an - * object listed as an interface on the registry on client side. - * - * Normally a Global gets factored by the Display. For each Global-derived class there - * is a dedicated factory method. After creating an instance through the factory method - * it is not yet announced on the registry. One needs to call ::create on it. This allows - * to setup the Global before it gets announced, ensuring that the client's state is correct - * from the start. - * - * As an example shown for @link OutputInterface @endlink: - * @code - * Display *display; // The existing display - * auto o = display->createOutput(); - * o->setManufacturer(QStringLiteral("The KDE Community")); - * // setup further data on the OutputInterface - * o->create(); // announces OutputInterface - * @endcode - * - * @see Display - * - **/ -class KWAYLANDSERVER_EXPORT Global : public QObject -{ - Q_OBJECT -public: - virtual ~Global(); - /** - * Creates the global by creating a native wl_global and by that announcing it - * to the clients. - **/ - void create(); - /** - * Destroys the low level wl_global. Afterwards the Global is no longer shown to clients. - **/ - void destroy(); - /** - * @returns whether the Global got created - **/ - bool isValid() const; - - /** - * @returns the Display the Global got created on. - */ - Display *display(); - - /** - * Cast operator to the native wl_global this Global represents. - **/ - operator wl_global*(); - /** - * Cast operator to the native wl_global this Global represents. - **/ - operator wl_global*() const; - -Q_SIGNALS: - /** - * This signal is emitted when the client is in the process of removing the wl_global. - * At the time the signal is emitted the global is still valid and allows to perform - * cleanup tasks. - */ - void aboutToDestroyGlobal(); - /** - * This signal is emitted when the client finished removing of the wl_global. - * At the time the signal is emitted the global is invalid and allows to perform - * post clenaup tasks. - */ - void hasDestroyedGlobal(); - -protected: - class Private; - explicit Global(Private *d, QObject *parent = nullptr); - QScopedPointer d; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/global_p.h dwayland-5.57.0.24+really5.24.3/src/server/global_p.h --- dwayland-5.57.0.23/src/server/global_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/global_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_GLOBAL_P_H -#define WAYLAND_SERVER_GLOBAL_P_H - -#include "global.h" - -struct wl_client; -struct wl_interface; - -namespace KWayland -{ -namespace Server -{ - -class Global::Private -{ -public: - static constexpr quint32 version = 0; - virtual ~Private(); - void create(); - - Display *display = nullptr; - wl_global *global = nullptr; - -protected: - Private(Display *d, const wl_interface *interface, quint32 version); - virtual void bind(wl_client *client, uint32_t version, uint32_t id) = 0; - - static void bind(wl_client *client, void *data, uint32_t version, uint32_t id); - - const wl_interface *const m_interface; - const quint32 m_version; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/globalproperty_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/globalproperty_interface.cpp --- dwayland-5.57.0.23/src/server/globalproperty_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/globalproperty_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,73 @@ +#include "globalproperty_interface.h" +#include "display.h" +#include "surface_interface_p.h" + +#include +#include +#include + +#include "qwayland-server-dde-globalproperty.h" + +namespace KWaylandServer +{ +static const quint32 s_version = 1; +class GlobalPropertyInterfacePrivate : public QtWaylandServer::dde_globalproperty +{ +public: + GlobalPropertyInterfacePrivate(GlobalPropertyInterface *q, Display *display); + + GlobalPropertyInterface *q; + +private: + void dde_globalproperty_set_property(Resource *resource, const QString &module, const QString &function, struct ::wl_resource *surface, int32_t type, const QString &data) override; + void dde_globalproperty_get_property(Resource *resource, const QString &data) override; +}; + +GlobalPropertyInterfacePrivate::GlobalPropertyInterfacePrivate(GlobalPropertyInterface *_q, Display *display) + : QtWaylandServer::dde_globalproperty(*display, s_version) + , q(_q) +{ + +} + +void GlobalPropertyInterfacePrivate::dde_globalproperty_set_property(Resource *resource, const QString &module, const QString &function, struct ::wl_resource *surface, int32_t type, const QString &data) +{ + SurfaceInterface *si = SurfaceInterface::get(surface); + if (!si) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); + return; + } + + QJsonParseError error; + const auto doc = QJsonDocument::fromJson(data.toUtf8(), &error); + if (error.error != QJsonParseError::NoError) { + qDebug() << "Failed to parse data" << error.errorString(); + return; + } + QMap ret; + const QJsonObject rootObj = doc.object(); + for (const auto &key : rootObj.keys()) { + const QVariant &value = rootObj[key].toVariant(); + ret[key] = value; + } + emit q->windowDecoratePropertyChanged(si, ret); +} + +void GlobalPropertyInterfacePrivate::dde_globalproperty_get_property(Resource *resource, const QString &data) +{ + +} + +GlobalPropertyInterface::GlobalPropertyInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new GlobalPropertyInterfacePrivate(this, display)) +{ + +} + +GlobalPropertyInterface::~GlobalPropertyInterface() +{ + +} + +} diff -Nru dwayland-5.57.0.23/src/server/globalproperty_interface.h dwayland-5.57.0.24+really5.24.3/src/server/globalproperty_interface.h --- dwayland-5.57.0.23/src/server/globalproperty_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/globalproperty_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,58 @@ +/******************************************************************** +Copyright 2022 diguoliang + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) version 3, or any +later version accepted by the membership of KDE e.V. (or its +successor approved by the membership of KDE e.V.), which shall +act as a proxy defined in Section 6 of version 3 of the license. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library. If not, see . +*********************************************************************/ +#pragma once + +#include +#include +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class Display; +class wl_surface; +class SurfaceInterface;; +class GlobalPropertyInterfacePrivate; + +struct PropertyData{ + QString module; + QString function; + QMap propetyData; +}; + +class KWAYLANDSERVER_EXPORT GlobalPropertyInterface : public QObject +{ + Q_OBJECT + //Q_PROPERTY(QString propertyData READ propertyData WRITE setPropertyData NOTIFY WindowDecoratePropertyChanged) +public: + explicit GlobalPropertyInterface(Display *display, QObject *parent = nullptr); + virtual ~GlobalPropertyInterface(); + +Q_SIGNALS: + void windowDecoratePropertyChanged(SurfaceInterface *, QMap &) const; + +private: + QScopedPointer d; +}; + +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface.cpp --- dwayland-5.57.0.23/src/server/idleinhibit_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "idleinhibit_interface_p.h" - -namespace KWayland -{ -namespace Server -{ - -IdleInhibitManagerInterface::Private::Private(IdleInhibitManagerInterface *q, Display *d, const wl_interface *interface, quint32 version, IdleInhibitManagerInterfaceVersion interfaceVersion) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) -{ -} - -IdleInhibitManagerInterface::IdleInhibitManagerInterface(Private *d, QObject *parent) - : Global(d, parent) -{ -} - -IdleInhibitManagerInterface::~IdleInhibitManagerInterface() = default; - -IdleInhibitManagerInterfaceVersion IdleInhibitManagerInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -IdleInhibitManagerInterface::Private *IdleInhibitManagerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_interface.h dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface.h --- dwayland-5.57.0.23/src/server/idleinhibit_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_IDLEINHIBIT_INTERFACE_H -#define KWAYLAND_SERVER_IDLEINHIBIT_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; - -/** - * Enum describing the interface versions the IdleInhibitManagerInterface can support. - * - * @since 5.41 - **/ -enum class IdleInhibitManagerInterfaceVersion { - /** - * zwp_idle_inhibit_manager_v1 - **/ - UnstableV1 -}; - -/** - * The IdleInhibitorManagerInterface is used by clients to inhibit idle on a - * SurfaceInterface. Whether a SurfaceInterface inhibits idle is exposes through - * @link{SurfaceInterface::inhibitsIdle}. - * - * @since 5.41 - **/ -class KWAYLANDSERVER_EXPORT IdleInhibitManagerInterface : public Global -{ - Q_OBJECT -public: - virtual ~IdleInhibitManagerInterface(); - - /** - * @returns The interface version used by this IdleInhibitManagerInterface - **/ - IdleInhibitManagerInterfaceVersion interfaceVersion() const; - -protected: - class Private; - explicit IdleInhibitManagerInterface(Private *d, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface_p.h --- dwayland-5.57.0.23/src/server/idleinhibit_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_IDLEINHIBIT_INTERFACE_P_H -#define KWAYLAND_SERVER_IDLEINHIBIT_INTERFACE_P_H - -#include "idleinhibit_interface.h" -#include "global_p.h" -#include "resource_p.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Q_DECL_HIDDEN IdleInhibitManagerUnstableV1Interface : public IdleInhibitManagerInterface -{ - Q_OBJECT -public: - explicit IdleInhibitManagerUnstableV1Interface(Display *display, QObject *parent = nullptr); - ~IdleInhibitManagerUnstableV1Interface() override; - -private: - class Private; -}; - -class Q_DECL_HIDDEN IdleInhibitManagerInterface::Private : public Global::Private -{ -public: - IdleInhibitManagerInterfaceVersion interfaceVersion; - -protected: - Private(IdleInhibitManagerInterface *q, Display *d, const wl_interface *interface, quint32 version, IdleInhibitManagerInterfaceVersion interfaceVersion); - IdleInhibitManagerInterface *q; -}; - -class Q_DECL_HIDDEN IdleInhibitorInterface : public Resource -{ - Q_OBJECT -public: - explicit IdleInhibitorInterface(IdleInhibitManagerInterface *c, wl_resource *parentResource); - - virtual ~IdleInhibitorInterface(); - - /** - * @returns The interface version used by this IdleInhibitorInterface - **/ - IdleInhibitManagerInterfaceVersion interfaceVersion() const; - -protected: - class Private; - -private: - Private *d_func() const; - friend class IdleInhibitManagerUnstableV1Interface; -}; - -class Q_DECL_HIDDEN IdleInhibitorInterface::Private : public Resource::Private -{ -public: - Private(IdleInhibitorInterface *q, IdleInhibitManagerInterface *m, wl_resource *parentResource); - ~Private(); - -private: - - IdleInhibitorInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_idle_inhibitor_v1_interface s_interface; -}; - - -} -} - -#endif - diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_interface_v1.cpp dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface_v1.cpp --- dwayland-5.57.0.23/src/server/idleinhibit_interface_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_interface_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/**************************************************************************** -Copyright 2017 Martin Flöser - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "idleinhibit_interface_p.h" -#include "display.h" -#include "surface_interface_p.h" - -namespace KWayland -{ -namespace Server -{ - -class Q_DECL_HIDDEN IdleInhibitManagerUnstableV1Interface::Private : public IdleInhibitManagerInterface::Private -{ -public: - Private(IdleInhibitManagerUnstableV1Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void createInhibitorCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - - static const struct zwp_idle_inhibit_manager_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 IdleInhibitManagerUnstableV1Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_idle_inhibit_manager_v1_interface IdleInhibitManagerUnstableV1Interface::Private::s_interface = { - destroyCallback, - createInhibitorCallback -}; -#endif - -IdleInhibitManagerUnstableV1Interface::Private::Private(IdleInhibitManagerUnstableV1Interface *q, Display *d) - : IdleInhibitManagerInterface::Private(q, d, &zwp_idle_inhibit_manager_v1_interface, s_version, IdleInhibitManagerInterfaceVersion::UnstableV1) -{ -} - -void IdleInhibitManagerUnstableV1Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void IdleInhibitManagerUnstableV1Interface::Private::createInhibitorCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) -{ - auto s = SurfaceInterface::get(surface); - if (!s) { - // send error? - return; - } - auto q = cast(resource); - auto inhibitor = new IdleInhibitorInterface(q->q, resource); - inhibitor->d_func()->create(q->display->getConnection(client), version, id); - s->d_func()->installIdleInhibitor(inhibitor); -} - -void IdleInhibitManagerUnstableV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_idle_inhibit_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void IdleInhibitManagerUnstableV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -IdleInhibitManagerUnstableV1Interface::IdleInhibitManagerUnstableV1Interface(Display *display, QObject *parent) - : IdleInhibitManagerInterface(new Private(this, display), parent) -{ -} - -IdleInhibitManagerUnstableV1Interface::~IdleInhibitManagerUnstableV1Interface() = default; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_idle_inhibitor_v1_interface IdleInhibitorInterface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -IdleInhibitorInterface::Private::Private(IdleInhibitorInterface *q, IdleInhibitManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zwp_idle_inhibitor_v1_interface, &s_interface) -{ -} - -IdleInhibitorInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -IdleInhibitorInterface::IdleInhibitorInterface(IdleInhibitManagerInterface *m, wl_resource *parentResource) - : Resource(new Private(this, m, parentResource)) -{ -} - -IdleInhibitorInterface::~IdleInhibitorInterface() = default; - -IdleInhibitorInterface::Private *IdleInhibitorInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface.cpp --- dwayland-5.57.0.23/src/server/idleinhibit_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,71 @@ +/* + SPDX-FileCopyrightText: 2017 Martin Flöser + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "display.h" +#include "idleinhibit_v1_interface_p.h" +#include "surface_interface_p.h" + +namespace KWaylandServer +{ +static const quint32 s_version = 1; + +IdleInhibitManagerV1InterfacePrivate::IdleInhibitManagerV1InterfacePrivate(IdleInhibitManagerV1Interface *_q, Display *display) + : QtWaylandServer::zwp_idle_inhibit_manager_v1(*display, s_version) + , q(_q) +{ +} + +void IdleInhibitManagerV1InterfacePrivate::zwp_idle_inhibit_manager_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void IdleInhibitManagerV1InterfacePrivate::zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surface) +{ + auto s = SurfaceInterface::get(surface); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); + return; + } + + wl_resource *inhibitorResource = wl_resource_create(resource->client(), &zwp_idle_inhibitor_v1_interface, resource->version(), id); + if (!inhibitorResource) { + wl_client_post_no_memory(resource->client()); + return; + } + auto inhibitor = new IdleInhibitorV1Interface(inhibitorResource); + + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->installIdleInhibitor(inhibitor); +} + +IdleInhibitManagerV1Interface::IdleInhibitManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new IdleInhibitManagerV1InterfacePrivate(this, display)) +{ +} + +IdleInhibitManagerV1Interface::~IdleInhibitManagerV1Interface() = default; + +IdleInhibitorV1Interface::IdleInhibitorV1Interface(wl_resource *resource) + : QObject(nullptr) + , QtWaylandServer::zwp_idle_inhibitor_v1(resource) +{ +} + +IdleInhibitorV1Interface::~IdleInhibitorV1Interface() = default; + +void IdleInhibitorV1Interface::zwp_idle_inhibitor_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void IdleInhibitorV1Interface::zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; +} + +} diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface.h --- dwayland-5.57.0.23/src/server/idleinhibit_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,36 @@ +/* + SPDX-FileCopyrightText: 2017 Martin Flöser + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class Display; +class IdleInhibitManagerV1InterfacePrivate; + +/** + * The IdleInhibitorManagerInterface is used by clients to inhibit idle on a + * SurfaceInterface. Whether a SurfaceInterface inhibits idle is exposes through + * @link{SurfaceInterface::inhibitsIdle}. + */ +class KWAYLANDSERVER_EXPORT IdleInhibitManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit IdleInhibitManagerV1Interface(Display *display, QObject *parent = nullptr); + ~IdleInhibitManagerV1Interface() override; + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/idleinhibit_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface_p.h --- dwayland-5.57.0.23/src/server/idleinhibit_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idleinhibit_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,38 @@ +/* + SPDX-FileCopyrightText: 2017 Martin Flöser + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "idleinhibit_v1_interface.h" + +#include + +namespace KWaylandServer +{ +class IdleInhibitManagerV1InterfacePrivate : public QtWaylandServer::zwp_idle_inhibit_manager_v1 +{ +public: + IdleInhibitManagerV1InterfacePrivate(IdleInhibitManagerV1Interface *_q, Display *display); + + IdleInhibitManagerV1Interface *q; + +protected: + void zwp_idle_inhibit_manager_v1_destroy(Resource *resource) override; + void zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surface) override; +}; + +class IdleInhibitorV1Interface : public QObject, QtWaylandServer::zwp_idle_inhibitor_v1 +{ + Q_OBJECT +public: + explicit IdleInhibitorV1Interface(wl_resource *resource); + ~IdleInhibitorV1Interface() override; + +protected: + void zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) override; + void zwp_idle_inhibitor_v1_destroy(Resource *resource) override; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/idle_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/idle_interface.cpp --- dwayland-5.57.0.23/src/server/idle_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idle_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,133 +1,45 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "idle_interface.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "display.h" -#include "global_p.h" -#include "resource_p.h" +#include "idle_interface_p.h" #include "seat_interface.h" -#include - -#include -#include -#include - -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class IdleInterface::Private : public Global::Private -{ -public: - Private(IdleInterface *q, Display *d); - - int inhibitCount = 0; - QVector idleTimeouts; - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - static void getIdleTimeoutCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat, uint32_t timeout); - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - IdleInterface *q; - static const struct org_kde_kwin_idle_interface s_interface; - static const quint32 s_version; -}; - -class IdleTimeoutInterface::Private : public Resource::Private -{ -public: - Private(SeatInterface *seat, IdleTimeoutInterface *q, IdleInterface *manager, wl_resource *parentResource); - ~Private(); - void setup(quint32 timeout); - - void simulateUserActivity(); - - SeatInterface *seat; - QTimer *timer = nullptr; - -private: - static void simulateUserActivityCallback(wl_client *client, wl_resource *resource); - IdleTimeoutInterface *q_func() { - return reinterpret_cast(q); - } - static const struct org_kde_kwin_idle_timeout_interface s_interface; -}; - -const quint32 IdleInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_idle_interface IdleInterface::Private::s_interface = { - getIdleTimeoutCallback -}; -#endif +static const quint32 s_version = 1; -IdleInterface::Private::Private(IdleInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_idle_interface, s_version) - , q(q) +IdleInterfacePrivate::IdleInterfacePrivate(IdleInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_idle(*display, s_version) + , q(_q) { } -void IdleInterface::Private::getIdleTimeoutCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat, uint32_t timeout) +void IdleInterfacePrivate::org_kde_kwin_idle_get_idle_timeout(Resource *resource, uint32_t id, wl_resource *seat, uint32_t timeout) { - Private *p = cast(resource); SeatInterface *s = SeatInterface::get(seat); Q_ASSERT(s); - IdleTimeoutInterface *idleTimeout = new IdleTimeoutInterface(s, p->q, resource); - idleTimeout->create(p->display->getConnection(client), wl_resource_get_version(resource), id); - if (!idleTimeout->resource()) { - wl_resource_post_no_memory(resource); - delete idleTimeout; - return; - } - p->idleTimeouts << idleTimeout; - QObject::connect(idleTimeout, &IdleTimeoutInterface::aboutToBeUnbound, p->q, [p, idleTimeout]() { - p->idleTimeouts.removeOne(idleTimeout); - }); - idleTimeout->d_func()->setup(timeout); -} -void IdleInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_idle_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); + wl_resource *idleTimoutResource = wl_resource_create(resource->client(), &org_kde_kwin_idle_timeout_interface, resource->version(), id); + if (!idleTimoutResource) { + wl_client_post_no_memory(resource->client()); return; } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} -void IdleInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) + IdleTimeoutInterface *idleTimeout = new IdleTimeoutInterface(s, q, idleTimoutResource); + idleTimeouts << idleTimeout; + + QObject::connect(idleTimeout, &IdleTimeoutInterface::destroyed, q, [this, idleTimeout]() { + idleTimeouts.removeOne(idleTimeout); + }); + idleTimeout->setup(timeout); } IdleInterface::IdleInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new IdleInterfacePrivate(this, display)) { } @@ -135,136 +47,104 @@ void IdleInterface::inhibit() { - Q_D(); d->inhibitCount++; if (d->inhibitCount == 1) { - emit inhibitedChanged(); + Q_EMIT inhibitedChanged(); } } void IdleInterface::uninhibit() { - Q_D(); d->inhibitCount--; if (d->inhibitCount == 0) { - emit inhibitedChanged(); + Q_EMIT inhibitedChanged(); } } bool IdleInterface::isInhibited() const { - Q_D(); return d->inhibitCount > 0; } void IdleInterface::simulateUserActivity() { - Q_D(); for (auto i : qAsConst(d->idleTimeouts)) { - i->d_func()->simulateUserActivity(); + i->simulateUserActivity(); } } -IdleInterface::Private *IdleInterface::d_func() const +IdleTimeoutInterface::IdleTimeoutInterface(SeatInterface *seat, IdleInterface *manager, wl_resource *resource) + : QObject() + , QtWaylandServer::org_kde_kwin_idle_timeout(resource) + , seat(seat) + , manager(manager) { - return reinterpret_cast(d.data()); + connect(manager, &IdleInterface::inhibitedChanged, this, [this, manager] { + if (!timer) { + // not yet configured + return; + } + if (manager->isInhibited()) { + if (!timer->isActive()) { + send_resumed(); + } + timer->stop(); + } else { + timer->start(); + } + }); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_idle_timeout_interface IdleTimeoutInterface::Private::s_interface = { - resourceDestroyedCallback, - simulateUserActivityCallback -}; -#endif +IdleTimeoutInterface::~IdleTimeoutInterface() = default; -IdleTimeoutInterface::Private::Private(SeatInterface *seat, IdleTimeoutInterface *q, IdleInterface *manager, wl_resource *parentResource) - : Resource::Private(q, manager, parentResource, &org_kde_kwin_idle_timeout_interface, &s_interface) - , seat(seat) +void IdleTimeoutInterface::org_kde_kwin_idle_timeout_release(Resource *resource) { + wl_resource_destroy(resource->handle); } -IdleTimeoutInterface::Private::~Private() = default; - -void IdleTimeoutInterface::Private::simulateUserActivityCallback(wl_client *client, wl_resource *resource) +void IdleTimeoutInterface::org_kde_kwin_idle_timeout_destroy_resource(Resource *resource) { - Q_UNUSED(client); - Private *p = reinterpret_cast(wl_resource_get_user_data(resource)); - p->simulateUserActivity(); + Q_UNUSED(resource) + delete this; } -void IdleTimeoutInterface::Private::simulateUserActivity() +void IdleTimeoutInterface::org_kde_kwin_idle_timeout_simulate_user_activity(Resource *resource) +{ + Q_UNUSED(resource) + simulateUserActivity(); +} +void IdleTimeoutInterface::simulateUserActivity() { if (!timer) { // not yet configured return; } - if (qobject_cast(global)->isInhibited()) { + if (manager->isInhibited()) { // ignored while inhibited return; } - if (!timer->isActive() && resource) { - org_kde_kwin_idle_timeout_send_resumed(resource); + if (!timer->isActive()) { + send_resumed(); } timer->start(); } -void IdleTimeoutInterface::Private::setup(quint32 timeout) +void IdleTimeoutInterface::setup(quint32 timeout) { if (timer) { return; } - timer = new QTimer(q); + timer = new QTimer(this); timer->setSingleShot(true); - // less than 5 sec is not idle by definition - timer->setInterval(qMax(timeout, 5000u)); - QObject::connect(timer, &QTimer::timeout, q, - [this] { - if (resource) { - org_kde_kwin_idle_timeout_send_idle(resource); - } - } - ); - if (qobject_cast(global)->isInhibited()) { + // less than 500 msec is not idle by definition + timer->setInterval(qMax(timeout, 500u)); + QObject::connect(timer, &QTimer::timeout, this, [this] { + send_idle(); + }); + if (manager->isInhibited()) { // don't start if inhibited return; } timer->start(); } - -IdleTimeoutInterface::IdleTimeoutInterface(SeatInterface *seat, IdleInterface *parent, wl_resource *parentResource) - : Resource(new Private(seat, this, parent, parentResource)) -{ - connect(seat, &SeatInterface::timestampChanged, this, - [this] { - Q_D(); - d->simulateUserActivity(); - } - ); - connect(parent, &IdleInterface::inhibitedChanged, this, - [this] { - Q_D(); - if (!d->timer) { - // not yet configured - return; - } - if (qobject_cast(d->global)->isInhibited()) { - if (!d->timer->isActive() && d->resource) { - org_kde_kwin_idle_timeout_send_resumed(d->resource); - } - d->timer->stop(); - } else { - d->timer->start(); - } - } - ); -} - -IdleTimeoutInterface::~IdleTimeoutInterface() = default; - -IdleTimeoutInterface::Private *IdleTimeoutInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} } diff -Nru dwayland-5.57.0.23/src/server/idle_interface.h dwayland-5.57.0.24+really5.24.3/src/server/idle_interface.h --- dwayland-5.57.0.23/src/server/idle_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idle_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,36 +1,20 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_IDLE_INTERFACE_H -#define KWAYLAND_SERVER_IDLE_INTERFACE_H - -#include -#include "global.h" -#include "resource.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -namespace KWayland -{ -namespace Server -{ +#include + +#include +struct wl_resource; + +namespace KWaylandServer +{ class Display; -class SeatInterface; +class IdleInterfacePrivate; /** * @brief Global representing the org_kde_kwin_idle interface. @@ -49,14 +33,14 @@ * know whether the input devices are used, only if their surfaces have focus. With this * interface it is possible to notice that there are input events. A server should consider * this to decide whether it wants to provide this feature! - * - * @since 5.4 - **/ -class KWAYLANDSERVER_EXPORT IdleInterface : public Global + */ +class KWAYLANDSERVER_EXPORT IdleInterface : public QObject { Q_OBJECT + public: - virtual ~IdleInterface(); + explicit IdleInterface(Display *display, QObject *parent = nullptr); + ~IdleInterface() override; /** * Inhibits the IdleInterface. While inhibited no IdleTimeoutInterface interface gets @@ -70,8 +54,7 @@ * @see uninhibit * @see isInhibited * @see inhibitedChanged - * @since 5.41 - **/ + */ void inhibit(); /** @@ -81,8 +64,7 @@ * @see inhibit * @see isInhibited * @see inhibitedChanged - * @since 5.41 - **/ + */ void uninhibit(); /** @@ -90,8 +72,7 @@ * @see inhibit * @see uninhibit * @see inhibitedChanged - * @since 5.41 - **/ + */ bool isInhibited() const; /** @@ -99,8 +80,7 @@ * This means the same action is performed as if the user interacted with * an input device on the SeatInterface. * Idle timeouts are resumed and the idle time gets restarted. - * @since 5.42 - **/ + */ void simulateUserActivity(); Q_SIGNALS: @@ -109,32 +89,11 @@ * @see inhibit * @see uninhibit * @see isInhibited - * @since 5.41 - **/ + */ void inhibitedChanged(); private: - explicit IdleInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -// TODO: KF6 make private class -class KWAYLANDSERVER_EXPORT IdleTimeoutInterface : public Resource -{ - Q_OBJECT -public: - virtual ~IdleTimeoutInterface(); - -private: - explicit IdleTimeoutInterface(SeatInterface *seat, IdleInterface *parent, wl_resource *parentResource); - friend class IdleInterface; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/idle_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/idle_interface_p.h --- dwayland-5.57.0.23/src/server/idle_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/idle_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,54 @@ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "idle_interface.h" + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class SeatInterface; +class IdleTimeoutInterface; +class IdleTimeoutInterface; + +class IdleInterfacePrivate : public QtWaylandServer::org_kde_kwin_idle +{ +public: + IdleInterfacePrivate(IdleInterface *_q, Display *display); + + int inhibitCount = 0; + QVector idleTimeouts; + IdleInterface *q; + +protected: + void org_kde_kwin_idle_get_idle_timeout(Resource *resource, uint32_t id, wl_resource *seat, uint32_t timeout) override; +}; + +class IdleTimeoutInterface : public QObject, QtWaylandServer::org_kde_kwin_idle_timeout +{ + Q_OBJECT +public: + explicit IdleTimeoutInterface(SeatInterface *seat, IdleInterface *parent, wl_resource *resource); + ~IdleTimeoutInterface() override; + void setup(quint32 timeout); + void simulateUserActivity(); + +private: + SeatInterface *seat; + IdleInterface *manager; + QTimer *timer = nullptr; + +protected: + void org_kde_kwin_idle_timeout_destroy_resource(Resource *resource) override; + void org_kde_kwin_idle_timeout_release(Resource *resource) override; + void org_kde_kwin_idle_timeout_simulate_user_activity(Resource *resource) override; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/inputmethod_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/inputmethod_v1_interface.cpp --- dwayland-5.57.0.23/src/server/inputmethod_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/inputmethod_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,480 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "inputmethod_v1_interface.h" +#include "display.h" +#include "keyboard_interface.h" +#include "keyboard_interface_p.h" +#include "logging.h" +#include "output_interface.h" +#include "seat_interface.h" +#include "surface_interface.h" +#include "surfacerole_p.h" + +#include +#include + +#include + +#include "qwayland-server-input-method-unstable-v1.h" +#include "qwayland-server-text-input-unstable-v1.h" +#include "qwayland-server-wayland.h" + +namespace KWaylandServer +{ +static int s_version = 1; + +class InputKeyboardV1InterfacePrivate : public QtWaylandServer::wl_keyboard +{ +public: + InputKeyboardV1InterfacePrivate() + { + } +}; + +InputMethodGrabV1::InputMethodGrabV1(QObject *parent) + : QObject(parent) + , d(new InputKeyboardV1InterfacePrivate) +{ +} + +InputMethodGrabV1::~InputMethodGrabV1() +{ +} + +void InputMethodGrabV1::sendKeymap(const QByteArray &keymap) +{ + QScopedPointer tmp(new QTemporaryFile()); + if (!tmp->open()) { + qCWarning(KWAYLAND_SERVER) << "Failed to create keymap file:" << tmp->errorString(); + return; + } + + unlink(tmp->fileName().toUtf8().constData()); + if (!tmp->resize(keymap.size())) { + qCWarning(KWAYLAND_SERVER) << "Failed to resize keymap file:" << tmp->errorString(); + return; + } + + uchar *address = tmp->map(0, keymap.size()); + if (!address) { + qCWarning(KWAYLAND_SERVER) << "Failed to map keymap file:" << tmp->errorString(); + return; + } + + qstrncpy(reinterpret_cast(address), keymap.constData(), keymap.size() + 1); + tmp->unmap(address); + + const auto resources = d->resourceMap(); + for (auto r : resources) { + d->send_keymap(r->handle, QtWaylandServer::wl_keyboard::keymap_format::keymap_format_xkb_v1, tmp->handle(), tmp->size()); + } +} + +void InputMethodGrabV1::sendKey(quint32 serial, quint32 timestamp, quint32 key, KeyboardKeyState state) +{ + const auto resources = d->resourceMap(); + for (auto r : resources) { + d->send_key(r->handle, serial, timestamp, key, quint32(state)); + } +} + +void InputMethodGrabV1::sendModifiers(quint32 serial, quint32 depressed, quint32 latched, quint32 locked, quint32 group) +{ + const auto resources = d->resourceMap(); + for (auto r : resources) { + d->send_modifiers(r->handle, serial, depressed, latched, locked, group); + } +} + +class InputMethodContextV1InterfacePrivate : public QtWaylandServer::zwp_input_method_context_v1 +{ +public: + InputMethodContextV1InterfacePrivate(InputMethodContextV1Interface *q) + : zwp_input_method_context_v1() + , q(q) + { + } + + ~InputMethodContextV1InterfacePrivate() + { + } + + void zwp_input_method_context_v1_commit_string(Resource *, uint32_t serial, const QString &text) override + { + Q_EMIT q->commitString(serial, text); + } + void zwp_input_method_context_v1_preedit_string(Resource *, uint32_t serial, const QString &text, const QString &commit) override + { + Q_EMIT q->preeditString(serial, text, commit); + } + + void zwp_input_method_context_v1_preedit_styling(Resource *, uint32_t index, uint32_t length, uint32_t style) override + { + Q_EMIT q->preeditStyling(index, length, style); + } + void zwp_input_method_context_v1_preedit_cursor(Resource *, int32_t index) override + { + Q_EMIT q->preeditCursor(index); + } + void zwp_input_method_context_v1_delete_surrounding_text(Resource *, int32_t index, uint32_t length) override + { + Q_EMIT q->deleteSurroundingText(index, length); + } + void zwp_input_method_context_v1_cursor_position(Resource *, int32_t index, int32_t anchor) override + { + Q_EMIT q->cursorPosition(index, anchor); + } + void zwp_input_method_context_v1_modifiers_map(Resource *, wl_array *map) override + { + const auto mods = QByteArray::fromRawData(static_cast(map->data), map->size); + + Q_EMIT q->modifiersMap(mods); + } + void zwp_input_method_context_v1_keysym(Resource *, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override + { + Q_EMIT q->keysym(serial, time, sym, state == WL_KEYBOARD_KEY_STATE_PRESSED, modifiers); + } + void zwp_input_method_context_v1_grab_keyboard(Resource *resource, uint32_t id) override + { + m_keyboardGrab.reset(new InputMethodGrabV1(q)); + m_keyboardGrab->d->add(resource->client(), id, 1); + Q_EMIT q->keyboardGrabRequested(m_keyboardGrab.data()); + } + void zwp_input_method_context_v1_key(Resource *, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) override + { + Q_EMIT q->key(serial, time, key, state == WL_KEYBOARD_KEY_STATE_PRESSED); + } + void zwp_input_method_context_v1_modifiers(Resource *, + uint32_t serial, + uint32_t mods_depressed, + uint32_t mods_latched, + uint32_t mods_locked, + uint32_t group) override + { + Q_EMIT q->modifiers(serial, mods_depressed, mods_latched, mods_locked, group); + } + void zwp_input_method_context_v1_language(Resource *, uint32_t serial, const QString &language) override + { + Q_EMIT q->language(serial, language); + } + void zwp_input_method_context_v1_text_direction(Resource *, uint32_t serial, uint32_t direction) override + { + Qt::LayoutDirection qtDirection; + switch (direction) { + case ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_LTR: + qtDirection = Qt::LeftToRight; + break; + case ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_RTL: + qtDirection = Qt::RightToLeft; + break; + case ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_AUTO: + qtDirection = Qt::LayoutDirectionAuto; + break; + default: + Q_UNREACHABLE(); + break; + } + Q_EMIT q->textDirection(serial, qtDirection); + } + + void zwp_input_method_context_v1_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + + InputMethodContextV1Interface *const q; + QScopedPointer m_keyboardGrab; +}; + +InputMethodContextV1Interface::InputMethodContextV1Interface(InputMethodV1Interface *parent) + : QObject(parent) + , d(new InputMethodContextV1InterfacePrivate(this)) +{ +} + +InputMethodContextV1Interface::~InputMethodContextV1Interface() = default; + +void InputMethodContextV1Interface::sendCommitState(uint32_t serial) +{ + for (auto r : d->resourceMap()) { + d->send_commit_state(r->handle, serial); + } +} + +void InputMethodContextV1Interface::sendContentType(TextInputContentHints hint, TextInputContentPurpose purpose) +{ + quint32 contentHint = QtWaylandServer::zwp_text_input_v1::content_hint_none; + quint32 contentPurpose; + + if (hint.testFlag(TextInputContentHint::AutoCapitalization)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_auto_capitalization; + } + if (hint.testFlag(TextInputContentHint::AutoCorrection)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_auto_correction; + } + if (hint.testFlag(TextInputContentHint::AutoCompletion)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_auto_completion; + } + if (hint.testFlag(TextInputContentHint::LowerCase)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_lowercase; + } + if (hint.testFlag(TextInputContentHint::UpperCase)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_uppercase; + } + if (hint.testFlag(TextInputContentHint::TitleCase)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_titlecase; + } + if (hint.testFlag(TextInputContentHint::HiddenText)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_hidden_text; + } + if (hint.testFlag(TextInputContentHint::SensitiveData)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_lowercase; + } + if (hint.testFlag(TextInputContentHint::Latin)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_latin; + } + if (hint.testFlag(TextInputContentHint::MultiLine)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_multiline; + } + if (hint.testFlag(TextInputContentHint::None)) { + contentHint |= QtWaylandServer::zwp_text_input_v1::content_hint_none; + } + + switch (purpose) { + case TextInputContentPurpose::Alpha: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_alpha; + break; + case TextInputContentPurpose::Digits: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_digits; + break; + case TextInputContentPurpose::Number: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_number; + break; + case TextInputContentPurpose::Phone: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_phone; + break; + case TextInputContentPurpose::Url: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_url; + break; + case TextInputContentPurpose::Email: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_email; + break; + case TextInputContentPurpose::Name: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_name; + break; + case TextInputContentPurpose::Password: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_password; + break; + case TextInputContentPurpose::Date: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_date; + break; + case TextInputContentPurpose::Time: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_time; + break; + case TextInputContentPurpose::DateTime: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_datetime; + break; + case TextInputContentPurpose::Terminal: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_terminal; + break; + case TextInputContentPurpose::Normal: + default: + contentPurpose = QtWaylandServer::zwp_text_input_v1::content_purpose_normal; + } + + for (auto r : d->resourceMap()) { + d->send_content_type(r->handle, contentHint, contentPurpose); + } +} + +void InputMethodContextV1Interface::sendInvokeAction(uint32_t button, uint32_t index) +{ + for (auto r : d->resourceMap()) { + d->send_invoke_action(r->handle, button, index); + } +} + +void InputMethodContextV1Interface::sendPreferredLanguage(const QString &language) +{ + for (auto r : d->resourceMap()) { + d->send_preferred_language(r->handle, language); + } +} + +void InputMethodContextV1Interface::sendReset() +{ + for (auto r : d->resourceMap()) { + d->send_reset(r->handle); + } +} + +void InputMethodContextV1Interface::sendSurroundingText(const QString &text, uint32_t cursor, uint32_t anchor) +{ + for (auto r : d->resourceMap()) { + d->send_surrounding_text(r->handle, text, cursor, anchor); + } +} + +InputMethodGrabV1 *InputMethodContextV1Interface::keyboardGrab() const +{ + return d->m_keyboardGrab.get(); +} + +class InputPanelSurfaceV1InterfacePrivate : public QtWaylandServer::zwp_input_panel_surface_v1, public SurfaceRole +{ + friend class InputPanelSurfaceV1Interface; + +public: + InputPanelSurfaceV1InterfacePrivate(SurfaceInterface *surface, quint32 id, InputPanelSurfaceV1Interface *q) + : zwp_input_panel_surface_v1() + , SurfaceRole(surface, QByteArrayLiteral("input_panel_surface_v1")) + , q(q) + { + Q_UNUSED(id) + } + + void zwp_input_panel_surface_v1_set_overlay_panel(Resource *) override + { + Q_EMIT q->overlayPanel(); + } + + void zwp_input_panel_surface_v1_set_toplevel(Resource *, struct ::wl_resource *output, uint32_t position) override + { + Q_EMIT q->topLevel(OutputInterface::get(output), InputPanelSurfaceV1Interface::Position(position)); + } + + void commit() override + { + } + + void zwp_input_panel_surface_v1_destroy_resource(Resource *) override + { + delete q; + } + + InputPanelSurfaceV1Interface *const q; +}; + +InputPanelSurfaceV1Interface::InputPanelSurfaceV1Interface(SurfaceInterface *surface, quint32 id, QObject *parent) + : QObject(parent) + , d(new InputPanelSurfaceV1InterfacePrivate(surface, id, this)) +{ +} + +InputPanelSurfaceV1Interface::~InputPanelSurfaceV1Interface() +{ +} + +class InputPanelV1InterfacePrivate : public QtWaylandServer::zwp_input_panel_v1 +{ +public: + InputPanelV1InterfacePrivate(InputPanelV1Interface *q, Display *d) + : zwp_input_panel_v1(*d, s_version) + , q(q) + { + } + + void zwp_input_panel_v1_get_input_panel_surface(Resource *resource, uint32_t id, struct ::wl_resource *surfaceResource) override + { + auto surface = SurfaceInterface::get(surfaceResource); + + SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, 0, "the surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } + + auto interface = new InputPanelSurfaceV1Interface(surface, id, nullptr); + interface->d->init(resource->client(), id, resource->version()); + + Q_EMIT q->inputPanelSurfaceAdded(interface); + } + + InputPanelV1Interface *const q; +}; + +InputPanelV1Interface::InputPanelV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new InputPanelV1InterfacePrivate(this, display)) +{ +} + +InputPanelV1Interface::~InputPanelV1Interface() = default; + +SurfaceInterface *InputPanelSurfaceV1Interface::surface() const +{ + return d->surface(); +} + +class InputMethodV1InterfacePrivate : public QtWaylandServer::zwp_input_method_v1 +{ +public: + InputMethodV1InterfacePrivate(Display *d, InputMethodV1Interface *q) + : zwp_input_method_v1(*d, s_version) + , q(q) + , m_display(d) + { + } + + void zwp_input_method_v1_bind_resource(Resource *resource) override + { + if (!m_context) { + return; + } + + auto addedResource = m_context->d->add(resource->client(), resource->version()); + send_activate(resource->handle, addedResource->handle); + } + + QScopedPointer m_context; + InputMethodV1Interface *const q; + Display *const m_display; +}; + +InputMethodV1Interface::InputMethodV1Interface(Display *d, QObject *parent) + : QObject(parent) + , d(new InputMethodV1InterfacePrivate(d, this)) +{ +} + +InputMethodV1Interface::~InputMethodV1Interface() = default; + +void InputMethodV1Interface::sendActivate() +{ + if (d->m_context) { + return; + } + + d->m_context.reset(new InputMethodContextV1Interface(this)); + + for (auto resource : d->resourceMap()) { + auto connection = d->m_context->d->add(resource->client(), resource->version()); + d->send_activate(resource->handle, connection->handle); + } +} + +void InputMethodV1Interface::sendDeactivate() +{ + if (!d->m_context) { + return; + } + + for (auto resource : d->resourceMap()) { + auto connection = d->m_context->d->resourceMap().value(resource->client()); + if (connection) { + d->send_deactivate(resource->handle, connection->handle); + } + } + d->m_context.reset(); +} + +InputMethodContextV1Interface *InputMethodV1Interface::context() const +{ + return d->m_context.get(); +} + +} diff -Nru dwayland-5.57.0.23/src/server/inputmethod_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/inputmethod_v1_interface.h --- dwayland-5.57.0.23/src/server/inputmethod_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/inputmethod_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,171 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include + +#include "textinput.h" + +namespace KWaylandServer +{ +class OutputInterface; +class SurfaceInterface; +class Display; +class KeyboardInterface; +class InputPanelSurfaceV1Interface; +class InputMethodContextV1Interface; + +class InputMethodV1InterfacePrivate; +class InputMethodContextV1InterfacePrivate; +class InputPanelV1InterfacePrivate; +class InputPanelSurfaceV1InterfacePrivate; +class InputMethodGrabV1; +class InputKeyboardV1InterfacePrivate; + +enum class KeyboardKeyState : quint32; + +// This file's classes implment input_method_unstable_v1 + +/** + * Implements zwp_input_method_v1 and allows to activate and deactivate a context + * + * When we activate, an @class InputMethodContextV1Interface becomes available + */ +class KWAYLANDSERVER_EXPORT InputMethodV1Interface : public QObject +{ + Q_OBJECT +public: + InputMethodV1Interface(Display *d, QObject *parent); + ~InputMethodV1Interface() override; + + /** + * Activates the input method. + */ + void sendActivate(); + + /** + * Deactivates the input method, probably because we're not on some area + * where we can write text. + */ + void sendDeactivate(); + + InputMethodContextV1Interface *context() const; + +private: + QScopedPointer d; +}; + +/** + * Implements zwp_input_method_context_v1, allows to describe the client's input state + */ +class KWAYLANDSERVER_EXPORT InputMethodContextV1Interface : public QObject +{ + Q_OBJECT +public: + ~InputMethodContextV1Interface() override; + + void sendSurroundingText(const QString &text, quint32 cursor, quint32 anchor); + void sendReset(); + void sendContentType(KWaylandServer::TextInputContentHints hint, KWaylandServer::TextInputContentPurpose purpose); + void sendInvokeAction(quint32 button, quint32 index); + void sendCommitState(quint32 serial); + void sendPreferredLanguage(const QString &language); + + InputMethodGrabV1 *keyboardGrab() const; + +Q_SIGNALS: + void commitString(quint32 serial, const QString &text); + void preeditString(quint32 serial, const QString &text, const QString &commit); + void preeditStyling(quint32 index, quint32 length, quint32 style); + void preeditCursor(qint32 index); + void deleteSurroundingText(qint32 index, quint32 length); + void cursorPosition(qint32 index, qint32 anchor); + void keysym(quint32 serial, quint32 time, quint32 sym, bool pressed, quint32 modifiers); + void key(quint32 serial, quint32 time, quint32 key, bool pressed); + void modifiers(quint32 serial, quint32 mods_depressed, quint32 mods_latched, quint32 mods_locked, quint32 group); + void language(quint32 serial, const QString &language); + void textDirection(quint32 serial, Qt::LayoutDirection direction); + void keyboardGrabRequested(InputMethodGrabV1 *keyboardGrab); + void modifiersMap(const QByteArray &map); + +private: + friend class InputMethodV1Interface; + friend class InputMethodV1InterfacePrivate; + InputMethodContextV1Interface(InputMethodV1Interface *parent); + QScopedPointer d; +}; + +/** + * Implements zwp_input_panel_v1, tells us about the InputPanelSurfaceV1Interface that we might get + */ +class KWAYLANDSERVER_EXPORT InputPanelV1Interface : public QObject +{ + Q_OBJECT +public: + InputPanelV1Interface(Display *display, QObject *parent); + ~InputPanelV1Interface() override; + +Q_SIGNALS: + void inputPanelSurfaceAdded(InputPanelSurfaceV1Interface *surface); + +private: + QScopedPointer d; +}; + +/** + * Implements zwp_input_panel_surface_v1, it corresponds to each element shown so it can be placed. + */ +class KWAYLANDSERVER_EXPORT InputPanelSurfaceV1Interface : public QObject +{ + Q_OBJECT +public: + ~InputPanelSurfaceV1Interface() override; + + enum Position { + CenterBottom = 0, + }; + Q_ENUM(Position) + + SurfaceInterface *surface() const; + +Q_SIGNALS: + void topLevel(OutputInterface *output, Position position); + void overlayPanel(); + +private: + InputPanelSurfaceV1Interface(SurfaceInterface *surface, quint32 id, QObject *parent); + friend class InputPanelV1InterfacePrivate; + QScopedPointer d; +}; + +/** + * Implements a wl_keyboard tailored for zwp_input_method_v1 use-cases + */ +class KWAYLANDSERVER_EXPORT InputMethodGrabV1 : public QObject +{ + Q_OBJECT +public: + ~InputMethodGrabV1() override; + + void sendKeymap(const QByteArray &content); + void sendKey(quint32 serial, quint32 timestamp, quint32 key, KeyboardKeyState state); + void sendModifiers(quint32 serial, quint32 depressed, quint32 latched, quint32 locked, quint32 group); + +private: + InputMethodGrabV1(QObject *parent); + friend class InputPanelV1InterfacePrivate; + friend class InputMethodContextV1InterfacePrivate; + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::InputMethodV1Interface *) +Q_DECLARE_METATYPE(KWaylandServer::InputMethodGrabV1 *) diff -Nru dwayland-5.57.0.23/src/server/keyboard_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface.cpp --- dwayland-5.57.0.23/src/server/keyboard_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,198 +1,252 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "keyboard_interface.h" -#include "keyboard_interface_p.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "display.h" +#include "keyboard_interface_p.h" +#include "logging.h" #include "seat_interface.h" +#include "seat_interface_p.h" #include "surface_interface.h" // Qt +#include #include -// Wayland -#include -namespace KWayland +#include + +namespace KWaylandServer { +KeyboardInterfacePrivate::KeyboardInterfacePrivate(SeatInterface *s) + : seat(s) +{ +} -namespace Server +void KeyboardInterfacePrivate::keyboard_release(Resource *resource) { + wl_resource_destroy(resource->handle); +} + +void KeyboardInterfacePrivate::keyboard_bind_resource(Resource *resource) +{ + const ClientConnection *focusedClient = focusedSurface ? focusedSurface->client() : nullptr; + + if (resource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { + send_repeat_info(resource->handle, keyRepeat.charactersPerSecond, keyRepeat.delay); + } + if (!keymap.isNull()) { + sendKeymap(resource); + } + + if (focusedClient && focusedClient->client() == resource->client()) { + const QVector keys = pressedKeys(); + const QByteArray keysData = QByteArray::fromRawData(reinterpret_cast(keys.data()), sizeof(quint32) * keys.count()); + const quint32 serial = seat->display()->nextSerial(); -KeyboardInterface::Private::Private(SeatInterface *s, wl_resource *parentResource, KeyboardInterface *q) - : Resource::Private(q, s, parentResource, &wl_keyboard_interface, &s_interface) - , seat(s) + send_enter(resource->handle, serial, focusedSurface->resource(), keysData); + send_modifiers(resource->handle, serial, modifiers.depressed, modifiers.latched, modifiers.locked, modifiers.group); + } +} + +QList KeyboardInterfacePrivate::keyboardsForClient(ClientConnection *client) const { + return resourceMap().values(client->client()); } -void KeyboardInterface::Private::focusChildSurface(const QPointer &childSurface, quint32 serial) +void KeyboardInterfacePrivate::sendLeave(SurfaceInterface *surface, quint32 serial) { - if (focusedChildSurface == childSurface) { - return; + const QList keyboards = keyboardsForClient(surface->client()); + for (Resource *keyboardResource : keyboards) { + send_leave(keyboardResource->handle, serial, surface->resource()); } - sendLeave(focusedChildSurface.data(), serial); - focusedChildSurface = childSurface; - sendEnter(focusedChildSurface.data(), serial); } -void KeyboardInterface::Private::sendLeave(SurfaceInterface *surface, quint32 serial) +void KeyboardInterfacePrivate::sendEnter(SurfaceInterface *surface, quint32 serial) { - if (surface && resource && surface->resource()) { - wl_keyboard_send_leave(resource, serial, surface->resource()); + const auto states = pressedKeys(); + QByteArray data = QByteArray::fromRawData(reinterpret_cast(states.constData()), sizeof(quint32) * states.size()); + + const QList keyboards = keyboardsForClient(surface->client()); + for (Resource *keyboardResource : keyboards) { + send_enter(keyboardResource->handle, serial, surface->resource(), data); } } -void KeyboardInterface::Private::sendEnter(SurfaceInterface *surface, quint32 serial) +void KeyboardInterfacePrivate::sendKeymap(Resource *resource) { - wl_array keys; - wl_array_init(&keys); - const auto states = seat->pressedKeys(); - for (auto it = states.begin(); it != states.end(); ++it) { - uint32_t *k = reinterpret_cast(wl_array_add(&keys, sizeof(uint32_t))); - *k = *it; + QScopedPointer tmp(new QTemporaryFile()); + if (!tmp->open()) { + qCWarning(KWAYLAND_SERVER) << "Failed to create keymap file:" << tmp->errorString(); + return; } - wl_keyboard_send_enter(resource, serial, surface->resource(), &keys); - wl_array_release(&keys); - sendModifiers(); -} + unlink(tmp->fileName().toUtf8().constData()); + if (!tmp->resize(keymap.size())) { + qCWarning(KWAYLAND_SERVER) << "Failed to resize keymap file:" << tmp->errorString(); + return; + } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_keyboard_interface KeyboardInterface::Private::s_interface { - resourceDestroyedCallback -}; -#endif + uchar *address = tmp->map(0, keymap.size()); + if (!address) { + qCWarning(KWAYLAND_SERVER) << "Failed to map keymap file:" << tmp->errorString(); + return; + } -KeyboardInterface::KeyboardInterface(SeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) -{ -} + qstrncpy(reinterpret_cast(address), keymap.constData(), keymap.size() + 1); + tmp->unmap(address); -KeyboardInterface::~KeyboardInterface() = default; + send_keymap(resource->handle, keymap_format::keymap_format_xkb_v1, tmp->handle(), tmp->size()); +} -void KeyboardInterface::setKeymap(int fd, quint32 size) +void KeyboardInterface::setKeymap(const QByteArray &content) { - Q_D(); - d->sendKeymap(fd, size); + if (content.isNull()) { + return; + } + + d->keymap = content; + + const auto keyboardResources = d->resourceMap(); + for (KeyboardInterfacePrivate::Resource *resource : keyboardResources) { + d->sendKeymap(resource); + } } -void KeyboardInterface::Private::sendKeymap(int fd, quint32 size) +void KeyboardInterfacePrivate::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) { - if (!resource) { - return; + const QList keyboards = keyboardsForClient(focusedSurface->client()); + for (Resource *keyboardResource : keyboards) { + send_modifiers(keyboardResource->handle, serial, depressed, latched, locked, group); } - wl_keyboard_send_keymap(resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, fd, size); } -void KeyboardInterface::Private::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) +bool KeyboardInterfacePrivate::updateKey(quint32 key, KeyboardKeyState state) { - if (!resource) { - return; + auto it = states.find(key); + if (it == states.end()) { + states.insert(key, state); + return true; + } + if (it.value() == state) { + return false; } - wl_keyboard_send_modifiers(resource, serial, depressed, latched, locked, group); + it.value() = state; + return true; } -void KeyboardInterface::Private::sendModifiers() +KeyboardInterface::KeyboardInterface(SeatInterface *seat) + : d(new KeyboardInterfacePrivate(seat)) { - sendModifiers(seat->depressedModifiers(), seat->latchedModifiers(), seat->lockedModifiers(), seat->groupModifiers(), seat->lastModifiersSerial()); +} + +KeyboardInterface::~KeyboardInterface() = default; + +void KeyboardInterfacePrivate::sendModifiers() +{ + sendModifiers(modifiers.depressed, modifiers.latched, modifiers.locked, modifiers.group, modifiers.serial); } void KeyboardInterface::setFocusedSurface(SurfaceInterface *surface, quint32 serial) { - Q_D(); - d->sendLeave(d->focusedChildSurface, serial); - disconnect(d->destroyConnection); - d->focusedChildSurface.clear(); + if (d->focusedSurface == surface) { + return; + } + + if (d->focusedSurface) { + d->sendLeave(d->focusedSurface, serial); + disconnect(d->destroyConnection); + } + d->focusedSurface = surface; if (!d->focusedSurface) { return; } - d->destroyConnection = connect(d->focusedSurface, &Resource::aboutToBeUnbound, this, - [this] { - Q_D(); - if (d->resource) { - wl_keyboard_send_leave(d->resource, d->global->display()->nextSerial(), d->focusedSurface->resource()); - } - d->focusedSurface = nullptr; - d->focusedChildSurface.clear(); - } - ); - d->focusedChildSurface = QPointer(surface); + d->destroyConnection = connect(d->focusedSurface, &SurfaceInterface::aboutToBeDestroyed, this, [this] { + d->sendLeave(d->focusedSurface, d->seat->display()->nextSerial()); + d->focusedSurface = nullptr; + }); d->sendEnter(d->focusedSurface, serial); - d->client->flush(); + d->sendModifiers(); } -void KeyboardInterface::keyPressed(quint32 key, quint32 serial) +QVector KeyboardInterfacePrivate::pressedKeys() const { - Q_D(); - if (!d->resource) { - return; - } - // Q_ASSERT(d->focusedSurface); - if (d->focusedSurface) { - wl_keyboard_send_key(d->resource, serial, d->seat->timestamp(), key, WL_KEYBOARD_KEY_STATE_PRESSED); + QVector keys; + for (auto it = states.constBegin(); it != states.constEnd(); ++it) { + if (it.value() == KeyboardKeyState::Pressed) { + keys << it.key(); + } } + return keys; } -void KeyboardInterface::keyReleased(quint32 key, quint32 serial) +void KeyboardInterface::sendKey(quint32 key, KeyboardKeyState state) { - Q_D(); - if (!d->resource) { + if (!d->updateKey(key, state)) { return; } - // Q_ASSERT(d->focusedSurface); - if (d->focusedSurface) { - wl_keyboard_send_key(d->resource, serial, d->seat->timestamp(), key, WL_KEYBOARD_KEY_STATE_RELEASED); + + if (!d->focusedSurface) { + return; } -} -void KeyboardInterface::updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial) -{ - Q_D(); - // Q_ASSERT(d->focusedSurface); - if (d->focusedSurface) { - d->sendModifiers(depressed, latched, locked, group, serial); + const QList keyboards = d->keyboardsForClient(d->focusedSurface->client()); + const quint32 serial = d->seat->display()->nextSerial(); + for (KeyboardInterfacePrivate::Resource *keyboardResource : keyboards) { + d->send_key(keyboardResource->handle, serial, d->seat->timestamp(), key, quint32(state)); } } -void KeyboardInterface::repeatInfo(qint32 charactersPerSecond, qint32 delay) -{ - Q_D(); - if (!d->resource) { +void KeyboardInterface::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) +{ + bool changed = false; +#define UPDATE(value) \ + if (d->modifiers.value != value) { \ + d->modifiers.value = value; \ + changed = true; \ + } + UPDATE(depressed) + UPDATE(latched) + UPDATE(locked) + UPDATE(group) + if (!changed) { return; } - if (wl_resource_get_version(d->resource) < WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { - // only supported since version 4 + + if (!d->focusedSurface) { return; } - wl_keyboard_send_repeat_info(d->resource, charactersPerSecond, delay); + + d->modifiers.serial = d->seat->display()->nextSerial(); + d->sendModifiers(depressed, latched, locked, group, d->modifiers.serial); +} + +void KeyboardInterface::setRepeatInfo(qint32 charactersPerSecond, qint32 delay) +{ + d->keyRepeat.charactersPerSecond = qMax(charactersPerSecond, 0); + d->keyRepeat.delay = qMax(delay, 0); + const QList keyboards = d->resourceMap().values(); + for (KeyboardInterfacePrivate::Resource *keyboardResource : keyboards) { + if (keyboardResource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { + d->send_repeat_info(keyboardResource->handle, d->keyRepeat.charactersPerSecond, d->keyRepeat.delay); + } + } } SurfaceInterface *KeyboardInterface::focusedSurface() const { - Q_D(); return d->focusedSurface; } -KeyboardInterface::Private *KeyboardInterface::d_func() const +qint32 KeyboardInterface::keyRepeatDelay() const { - return reinterpret_cast(d.data()); + return d->keyRepeat.delay; } +qint32 KeyboardInterface::keyRepeatRate() const +{ + return d->keyRepeat.charactersPerSecond; } + } diff -Nru dwayland-5.57.0.23/src/server/keyboard_interface.h dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface.h --- dwayland-5.57.0.23/src/server/keyboard_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,69 +1,70 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_KEYBOARD_INTERFACE_H -#define WAYLAND_SERVER_KEYBOARD_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include +#include -#include "resource.h" +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class SeatInterface; class SurfaceInterface; +class KeyboardInterfacePrivate; + +enum class KeyboardKeyState : quint32; /** * @brief Resource for the wl_keyboard interface. - * - **/ -class KWAYLANDSERVER_EXPORT KeyboardInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT KeyboardInterface : public QObject { Q_OBJECT public: - virtual ~KeyboardInterface(); + ~KeyboardInterface() override; /** * @returns the focused SurfaceInterface on this keyboard resource, if any. - **/ + */ SurfaceInterface *focusedSurface() const; + /** + * @returns The key repeat in character per second + */ + qint32 keyRepeatRate() const; + /** + * @returns The delay on key press before starting repeating keys + */ + qint32 keyRepeatDelay() const; + void setKeymap(const QByteArray &content); + + /** + * Sets the key repeat information to be forwarded to all bound keyboards. + * + * To disable key repeat set a @p charactersPerSecond of @c 0. + * + * Requires wl_seat version 4. + * + * @param charactersPerSecond The characters per second rate, value of @c 0 disables key repeating + * @param delay The delay on key press before starting repeating keys + */ + void setRepeatInfo(qint32 charactersPerSecond, qint32 delay); + + void sendKey(quint32 key, KeyboardKeyState state); + void sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group); + private: void setFocusedSurface(SurfaceInterface *surface, quint32 serial); - void setKeymap(int fd, quint32 size); - void updateModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial); - void keyPressed(quint32 key, quint32 serial); - void keyReleased(quint32 key, quint32 serial); - void repeatInfo(qint32 charactersPerSecond, qint32 delay); friend class SeatInterface; - explicit KeyboardInterface(SeatInterface *parent, wl_resource *parentResource); + friend class KeyboardInterfacePrivate; + explicit KeyboardInterface(SeatInterface *seat); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::KeyboardInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface *) diff -Nru dwayland-5.57.0.23/src/server/keyboard_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface_p.h --- dwayland-5.57.0.23/src/server/keyboard_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keyboard_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,56 +1,65 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_KEYBOARD_INTERFACE_P_H -#define WAYLAND_SERVER_KEYBOARD_INTERFACE_P_H #include "keyboard_interface.h" -#include "resource_p.h" +#include + +#include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class ClientConnection; -class KeyboardInterface::Private : public Resource::Private +class KeyboardInterfacePrivate : public QtWaylandServer::wl_keyboard { public: - Private(SeatInterface *s, wl_resource *parentResource, KeyboardInterface *q); - void sendKeymap(int fd, quint32 size); + KeyboardInterfacePrivate(SeatInterface *s); + + void sendKeymap(Resource *resource); void sendModifiers(); void sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group, quint32 serial); - void focusChildSurface(const QPointer &childSurface, quint32 serial); + QList keyboardsForClient(ClientConnection *client) const; void sendLeave(SurfaceInterface *surface, quint32 serial); void sendEnter(SurfaceInterface *surface, quint32 serial); + static KeyboardInterfacePrivate *get(KeyboardInterface *keyboard) + { + return keyboard->d.data(); + } + SeatInterface *seat; SurfaceInterface *focusedSurface = nullptr; - QPointer focusedChildSurface; QMetaObject::Connection destroyConnection; + QByteArray keymap; -private: - static const struct wl_keyboard_interface s_interface; + struct { + qint32 charactersPerSecond = 0; + qint32 delay = 0; + } keyRepeat; + + struct Modifiers { + quint32 depressed = 0; + quint32 latched = 0; + quint32 locked = 0; + quint32 group = 0; + quint32 serial = 0; + }; + Modifiers modifiers; + + QHash states; + bool updateKey(quint32 key, KeyboardKeyState state); + QVector pressedKeys() const; + +protected: + void keyboard_release(Resource *resource) override; + void keyboard_bind_resource(Resource *resource) override; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/keyboard_shortcuts_inhibit_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/keyboard_shortcuts_inhibit_v1_interface.cpp --- dwayland-5.57.0.23/src/server/keyboard_shortcuts_inhibit_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keyboard_shortcuts_inhibit_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,190 @@ +/* + SPDX-FileCopyrightText: 2020 Benjamin Port + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "keyboard_shortcuts_inhibit_v1_interface.h" + +#include + +#include "display.h" +#include "seat_interface.h" +#include "surface_interface.h" + +static const int s_version = 1; + +namespace KWaylandServer +{ +class KeyboardShortcutsInhibitorV1InterfacePrivate : public QtWaylandServer::zwp_keyboard_shortcuts_inhibitor_v1 +{ +public: + KeyboardShortcutsInhibitorV1InterfacePrivate(SurfaceInterface *surface, + SeatInterface *seat, + KeyboardShortcutsInhibitManagerV1Interface *manager, + KeyboardShortcutsInhibitorV1Interface *q, + wl_resource *resource); + + KeyboardShortcutsInhibitorV1Interface *q; + QPointer m_manager; + SurfaceInterface *const m_surface; + SeatInterface *const m_seat; + bool m_active; + +protected: + void zwp_keyboard_shortcuts_inhibitor_v1_destroy_resource(Resource *resource) override; + + void zwp_keyboard_shortcuts_inhibitor_v1_destroy(Resource *resource) override; +}; + +class KeyboardShortcutsInhibitManagerV1InterfacePrivate : public QtWaylandServer::zwp_keyboard_shortcuts_inhibit_manager_v1 +{ +public: + KeyboardShortcutsInhibitManagerV1InterfacePrivate(Display *display, KeyboardShortcutsInhibitManagerV1Interface *q); + + void zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(Resource *resource, + uint32_t id, + struct ::wl_resource *surface_resource, + struct ::wl_resource *seat_resource) override; + + KeyboardShortcutsInhibitorV1Interface *findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const; + + void removeInhibitor(SurfaceInterface *const surface, SeatInterface *const seat); + + KeyboardShortcutsInhibitManagerV1Interface *q; + Display *const m_display; + QHash, KeyboardShortcutsInhibitorV1Interface *> m_inhibitors; + +protected: + void zwp_keyboard_shortcuts_inhibit_manager_v1_destroy(Resource *resource) override; +}; + +KeyboardShortcutsInhibitorV1InterfacePrivate::KeyboardShortcutsInhibitorV1InterfacePrivate(SurfaceInterface *surface, + SeatInterface *seat, + KeyboardShortcutsInhibitManagerV1Interface *manager, + KeyboardShortcutsInhibitorV1Interface *q, + wl_resource *resource) + : zwp_keyboard_shortcuts_inhibitor_v1(resource) + , q(q) + , m_manager(manager) + , m_surface(surface) + , m_seat(seat) + , m_active(false) +{ +} + +void KeyboardShortcutsInhibitorV1InterfacePrivate::zwp_keyboard_shortcuts_inhibitor_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void KeyboardShortcutsInhibitorV1InterfacePrivate::zwp_keyboard_shortcuts_inhibitor_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + // Ensure manager don't track anymore this inhibitor + if (m_manager) { + m_manager->removeInhibitor(m_surface, m_seat); + } + delete q; +} + +KeyboardShortcutsInhibitorV1Interface::KeyboardShortcutsInhibitorV1Interface(SurfaceInterface *surface, + SeatInterface *seat, + KeyboardShortcutsInhibitManagerV1Interface *manager, + wl_resource *resource) + : QObject(nullptr) + , d(new KeyboardShortcutsInhibitorV1InterfacePrivate(surface, seat, manager, this, resource)) +{ +} + +KeyboardShortcutsInhibitorV1Interface::~KeyboardShortcutsInhibitorV1Interface() = default; + +void KeyboardShortcutsInhibitorV1Interface::setActive(bool active) +{ + if (d->m_active == active) { + return; + } + d->m_active = active; + if (active) { + d->send_active(); + } else { + d->send_inactive(); + } +} + +bool KeyboardShortcutsInhibitorV1Interface::isActive() const +{ + return d->m_active; +} + +SeatInterface *KeyboardShortcutsInhibitorV1Interface::seat() const +{ + return d->m_seat; +} + +SurfaceInterface *KeyboardShortcutsInhibitorV1Interface::surface() const +{ + return d->m_surface; +} + +KeyboardShortcutsInhibitManagerV1InterfacePrivate::KeyboardShortcutsInhibitManagerV1InterfacePrivate(Display *display, + KeyboardShortcutsInhibitManagerV1Interface *q) + : zwp_keyboard_shortcuts_inhibit_manager_v1(*display, s_version) + , q(q) + , m_display(display) +{ +} + +void KeyboardShortcutsInhibitManagerV1InterfacePrivate::zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(Resource *resource, + uint32_t id, + wl_resource *surface_resource, + wl_resource *seat_resource) +{ + SeatInterface *seat = SeatInterface::get(seat_resource); + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + if (m_inhibitors.contains({surface, seat})) { + wl_resource_post_error(resource->handle, error::error_already_inhibited, "the shortcuts are already inhibited for this surface and seat"); + return; + } + + wl_resource *inhibitorResource = wl_resource_create(resource->client(), &zwp_keyboard_shortcuts_inhibitor_v1_interface, resource->version(), id); + auto inhibitor = new KeyboardShortcutsInhibitorV1Interface(surface, seat, q, inhibitorResource); + m_inhibitors[{surface, seat}] = inhibitor; + Q_EMIT q->inhibitorCreated(inhibitor); + inhibitor->setActive(true); +} + +KeyboardShortcutsInhibitorV1Interface *KeyboardShortcutsInhibitManagerV1InterfacePrivate::findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const +{ + return m_inhibitors.value({surface, seat}, nullptr); +} + +void KeyboardShortcutsInhibitManagerV1InterfacePrivate::zwp_keyboard_shortcuts_inhibit_manager_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void KeyboardShortcutsInhibitManagerV1InterfacePrivate::removeInhibitor(SurfaceInterface *const surface, SeatInterface *const seat) +{ + m_inhibitors.remove({surface, seat}); +} + +KeyboardShortcutsInhibitManagerV1Interface::KeyboardShortcutsInhibitManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new KeyboardShortcutsInhibitManagerV1InterfacePrivate(display, this)) +{ +} + +KeyboardShortcutsInhibitManagerV1Interface::~KeyboardShortcutsInhibitManagerV1Interface() = default; + +KeyboardShortcutsInhibitorV1Interface *KeyboardShortcutsInhibitManagerV1Interface::findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const +{ + return d->findInhibitor(surface, seat); +} + +void KeyboardShortcutsInhibitManagerV1Interface::removeInhibitor(SurfaceInterface *surface, SeatInterface *seat) +{ + d->removeInhibitor(surface, seat); +} + +} diff -Nru dwayland-5.57.0.23/src/server/keyboard_shortcuts_inhibit_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/keyboard_shortcuts_inhibit_v1_interface.h --- dwayland-5.57.0.23/src/server/keyboard_shortcuts_inhibit_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keyboard_shortcuts_inhibit_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,78 @@ +/* + SPDX-FileCopyrightText: 2020 Benjamin Port + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "seat_interface.h" +#include "surface_interface.h" +#include +#include + +namespace KWaylandServer +{ +/** + * This is an implementation of wayland-protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml + * + * This class is just the means to get a @class KeyboardShortcutsInhibitorV1Interface, which is + * the class that will have all of the information we need. + */ + +class KeyboardShortcutsInhibitManagerV1Interface; +class KeyboardShortcutsInhibitorV1InterfacePrivate; +class KeyboardShortcutsInhibitManagerV1InterfacePrivate; + +class KWAYLANDSERVER_EXPORT KeyboardShortcutsInhibitorV1Interface : public QObject +{ + Q_OBJECT + +public: + ~KeyboardShortcutsInhibitorV1Interface() override; + + SurfaceInterface *surface() const; + SeatInterface *seat() const; + void setActive(bool active); + bool isActive() const; + +private: + friend class KeyboardShortcutsInhibitManagerV1InterfacePrivate; + explicit KeyboardShortcutsInhibitorV1Interface(SurfaceInterface *surface, + SeatInterface *seat, + KeyboardShortcutsInhibitManagerV1Interface *manager, + wl_resource *resource); + QScopedPointer d; +}; + +/** + * The KeyboardShortcutsInhibitManagerV1Interface allows clients to inhibit global shortcuts. + * + * KeyboardShortcutsInhibitManagerV1Interface correponds to the wayland interface zwp_keyboard_shortcuts_inhibit_manager_v1. + */ +class KWAYLANDSERVER_EXPORT KeyboardShortcutsInhibitManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit KeyboardShortcutsInhibitManagerV1Interface(Display *d, QObject *parent = nullptr); + ~KeyboardShortcutsInhibitManagerV1Interface() override; + + /** + * return shortucts inhibitor associated with surface and seat, if no shortcut are associated, return nullptr + */ + KeyboardShortcutsInhibitorV1Interface *findInhibitor(SurfaceInterface *surface, SeatInterface *seat) const; + +Q_SIGNALS: + /** + * This signal is emitted when a keyboard shortcuts inhibitor @a inhibitor is created. + */ + void inhibitorCreated(KeyboardShortcutsInhibitorV1Interface *inhibitor); + +private: + friend class KeyboardShortcutsInhibitorV1InterfacePrivate; + void removeInhibitor(SurfaceInterface *const surface, SeatInterface *const seat); + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/keystate_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/keystate_interface.cpp --- dwayland-5.57.0.23/src/server/keystate_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keystate_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,53 @@ +/* + SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "keystate_interface.h" +#include "display.h" + +#include +#include +#include + +namespace KWaylandServer +{ +static const quint32 s_version = 1; + +class KeyStateInterfacePrivate : public QtWaylandServer::org_kde_kwin_keystate +{ +public: + KeyStateInterfacePrivate(Display *d) + : QtWaylandServer::org_kde_kwin_keystate(*d, s_version) + { + } + + void org_kde_kwin_keystate_fetchStates(Resource *resource) override + { + for (int i = 0; i < m_keyStates.count(); ++i) { + send_stateChanged(resource->handle, i, m_keyStates[i]); + } + } + + QVector m_keyStates = QVector(3, KeyStateInterface::Unlocked); +}; + +KeyStateInterface::KeyStateInterface(Display *d, QObject *parent) + : QObject(parent) + , d(new KeyStateInterfacePrivate(d)) +{ +} + +KeyStateInterface::~KeyStateInterface() = default; + +void KeyStateInterface::setState(KeyStateInterface::Key key, KeyStateInterface::State state) +{ + d->m_keyStates[int(key)] = state; + + for (auto r : d->resourceMap()) { + d->send_stateChanged(r->handle, int(key), int(state)); + } +} + +} diff -Nru dwayland-5.57.0.23/src/server/keystate_interface.h dwayland-5.57.0.24+really5.24.3/src/server/keystate_interface.h --- dwayland-5.57.0.23/src/server/keystate_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/keystate_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include +#include + +namespace KWaylandServer +{ +class Display; +class KeyStateInterfacePrivate; + +/** + * @brief Exposes key states to wayland clients + */ +class KWAYLANDSERVER_EXPORT KeyStateInterface : public QObject +{ + Q_OBJECT + +public: + explicit KeyStateInterface(Display *display, QObject *parent = nullptr); + virtual ~KeyStateInterface(); + + enum class Key { + CapsLock = 0, + NumLock = 1, + ScrollLock = 2, + }; + Q_ENUM(Key); + enum State { + Unlocked = 0, + Latched = 1, + Locked = 2, + }; + Q_ENUM(State) + + void setState(Key k, State s); + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/layershell_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/layershell_v1_interface.cpp --- dwayland-5.57.0.23/src/server/layershell_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/layershell_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,463 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "layershell_v1_interface.h" +#include "display.h" +#include "logging.h" +#include "surface_interface.h" +#include "surfacerole_p.h" +#include "xdgshell_interface_p.h" + +#include +#include + +#include "qwayland-server-wlr-layer-shell-unstable-v1.h" + +namespace KWaylandServer +{ +static const int s_version = 3; + +class LayerShellV1InterfacePrivate : public QtWaylandServer::zwlr_layer_shell_v1 +{ +public: + LayerShellV1InterfacePrivate(LayerShellV1Interface *q, Display *display); + + LayerShellV1Interface *q; + Display *display; + +protected: + void zwlr_layer_shell_v1_get_layer_surface(Resource *resource, + uint32_t id, + struct ::wl_resource *surface_resource, + struct ::wl_resource *output_resource, + uint32_t layer, + const QString &scope) override; + void zwlr_layer_shell_v1_destroy(Resource *resource) override; +}; + +class LayerSurfaceV1State +{ +public: + LayerSurfaceV1Interface::Layer layer = LayerSurfaceV1Interface::BottomLayer; + Qt::Edges anchor; + QMargins margins; + QSize desiredSize = QSize(0, 0); + int exclusiveZone = 0; + quint32 acknowledgedConfigure; + bool acknowledgedConfigureIsSet = false; + bool acceptsFocus = false; +}; + +class LayerSurfaceV1InterfacePrivate : public SurfaceRole, public QtWaylandServer::zwlr_layer_surface_v1 +{ +public: + LayerSurfaceV1InterfacePrivate(LayerSurfaceV1Interface *q, SurfaceInterface *surface); + + void commit() override; + + LayerSurfaceV1Interface *q; + LayerShellV1Interface *shell; + QPointer surface; + QPointer output; + LayerSurfaceV1State current; + LayerSurfaceV1State pending; + QQueue serials; + QString scope; + bool isClosed = false; + bool isConfigured = false; + bool isCommitted = false; + +protected: + void zwlr_layer_surface_v1_destroy_resource(Resource *resource) override; + void zwlr_layer_surface_v1_set_size(Resource *resource, uint32_t width, uint32_t height) override; + void zwlr_layer_surface_v1_set_anchor(Resource *resource, uint32_t anchor) override; + void zwlr_layer_surface_v1_set_exclusive_zone(Resource *resource, int32_t zone) override; + void zwlr_layer_surface_v1_set_margin(Resource *resource, int32_t top, int32_t right, int32_t bottom, int32_t left) override; + void zwlr_layer_surface_v1_set_keyboard_interactivity(Resource *resource, uint32_t keyboard_interactivity) override; + void zwlr_layer_surface_v1_get_popup(Resource *resource, struct ::wl_resource *popup) override; + void zwlr_layer_surface_v1_ack_configure(Resource *resource, uint32_t serial) override; + void zwlr_layer_surface_v1_destroy(Resource *resource) override; + void zwlr_layer_surface_v1_set_layer(Resource *resource, uint32_t layer) override; +}; + +LayerShellV1InterfacePrivate::LayerShellV1InterfacePrivate(LayerShellV1Interface *q, Display *display) + : QtWaylandServer::zwlr_layer_shell_v1(*display, s_version) + , q(q) + , display(display) +{ +} + +void LayerShellV1InterfacePrivate::zwlr_layer_shell_v1_get_layer_surface(Resource *resource, + uint32_t id, + wl_resource *surface_resource, + wl_resource *output_resource, + uint32_t layer, + const QString &scope) +{ + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + OutputInterface *output = OutputInterface::get(output_resource); + + if (surface->buffer()) { + wl_resource_post_error(resource->handle, error_already_constructed, "the wl_surface already has a buffer attached"); + return; + } + + if (layer > layer_overlay) { + wl_resource_post_error(resource->handle, error_invalid_layer, "invalid layer %d", layer); + return; + } + + SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_role, "the wl_surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } + + wl_resource *layerSurfaceResource = wl_resource_create(resource->client(), &zwlr_layer_surface_v1_interface, resource->version(), id); + if (!layerSurfaceResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + + auto layerSurface = new LayerSurfaceV1Interface(q, surface, output, LayerSurfaceV1Interface::Layer(layer), scope, layerSurfaceResource); + Q_EMIT q->surfaceCreated(layerSurface); +} + +void LayerShellV1InterfacePrivate::zwlr_layer_shell_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +LayerShellV1Interface::LayerShellV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new LayerShellV1InterfacePrivate(this, display)) +{ +} + +LayerShellV1Interface::~LayerShellV1Interface() +{ +} + +Display *LayerShellV1Interface::display() const +{ + return d->display; +} + +LayerSurfaceV1InterfacePrivate::LayerSurfaceV1InterfacePrivate(LayerSurfaceV1Interface *q, SurfaceInterface *surface) + : SurfaceRole(surface, QByteArrayLiteral("layer_surface_v1")) + , q(q) + , surface(surface) +{ +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_size(Resource *resource, uint32_t width, uint32_t height) +{ + Q_UNUSED(resource) + pending.desiredSize = QSize(width, height); +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_anchor(Resource *resource, uint32_t anchor) +{ + const uint32_t anchorMask = anchor_top | anchor_left | anchor_right | anchor_bottom; + if (anchor > anchorMask) { + wl_resource_post_error(resource->handle, error_invalid_anchor, "invalid anchor %d", anchor); + return; + } + + pending.anchor = Qt::Edges(); + + if (anchor & anchor_top) { + pending.anchor |= Qt::TopEdge; + } + + if (anchor & anchor_right) { + pending.anchor |= Qt::RightEdge; + } + + if (anchor & anchor_bottom) { + pending.anchor |= Qt::BottomEdge; + } + + if (anchor & anchor_left) { + pending.anchor |= Qt::LeftEdge; + } +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_exclusive_zone(Resource *, int32_t zone) +{ + pending.exclusiveZone = zone; +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_margin(Resource *, int32_t top, int32_t right, int32_t bottom, int32_t left) +{ + pending.margins = QMargins(left, top, right, bottom); +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_keyboard_interactivity(Resource *resource, uint32_t keyboard_interactivity) +{ + Q_UNUSED(resource) + pending.acceptsFocus = keyboard_interactivity; +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_get_popup(Resource *resource, struct ::wl_resource *popup_resource) +{ + XdgPopupInterface *popup = XdgPopupInterface::get(popup_resource); + XdgPopupInterfacePrivate *popupPrivate = XdgPopupInterfacePrivate::get(popup); + + if (popup->isConfigured()) { + wl_resource_post_error(resource->handle, error_invalid_surface_state, "xdg_popup surface is already configured"); + return; + } + + popupPrivate->parentSurface = surface; +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_ack_configure(Resource *resource, uint32_t serial) +{ + if (!serials.contains(serial)) { + wl_resource_post_error(resource->handle, error_invalid_surface_state, "invalid configure serial %d", serial); + return; + } + while (!serials.isEmpty()) { + const quint32 head = serials.takeFirst(); + if (head == serial) { + break; + } + } + if (!isClosed) { + pending.acknowledgedConfigure = serial; + pending.acknowledgedConfigureIsSet = true; + } +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_layer(Resource *resource, uint32_t layer) +{ + if (Q_UNLIKELY(layer > LayerShellV1InterfacePrivate::layer_overlay)) { + wl_resource_post_error(resource->handle, LayerShellV1InterfacePrivate::error_invalid_layer, "invalid layer %d", layer); + return; + } + pending.layer = LayerSurfaceV1Interface::Layer(layer); +} + +void LayerSurfaceV1InterfacePrivate::commit() +{ + if (isClosed) { + return; + } + + if (pending.acknowledgedConfigureIsSet) { + current.acknowledgedConfigure = pending.acknowledgedConfigure; + pending.acknowledgedConfigureIsSet = false; + Q_EMIT q->configureAcknowledged(pending.acknowledgedConfigure); + } + + if (Q_UNLIKELY(surface->isMapped() && !isConfigured)) { + wl_resource_post_error(resource()->handle, + error_invalid_surface_state, + "a buffer has been attached to a layer surface prior " + "to the first layer_surface.configure event"); + return; + } + + if (Q_UNLIKELY(pending.desiredSize.width() == 0 && (!(pending.anchor & Qt::LeftEdge) || !(pending.anchor & Qt::RightEdge)))) { + wl_resource_post_error(resource()->handle, + error_invalid_size, + "the layer surface has a width of 0 but its anchor " + "doesn't include the left and the right screen edge"); + return; + } + + if (Q_UNLIKELY(pending.desiredSize.height() == 0 && (!(pending.anchor & Qt::TopEdge) || !(pending.anchor & Qt::BottomEdge)))) { + wl_resource_post_error(resource()->handle, + error_invalid_size, + "the layer surface has a height of 0 but its anchor " + "doesn't include the top and the bottom screen edge"); + return; + } + + if (!surface->isMapped() && isCommitted) { + isCommitted = false; + isConfigured = false; + + current = LayerSurfaceV1State(); + pending = LayerSurfaceV1State(); + + return; + } + + const LayerSurfaceV1State previous = std::exchange(current, pending); + + isCommitted = true; // Must set the committed state before emitting any signals. + + if (previous.acceptsFocus != current.acceptsFocus) { + Q_EMIT q->acceptsFocusChanged(); + } + if (previous.layer != current.layer) { + Q_EMIT q->layerChanged(); + } + if (previous.anchor != current.anchor) { + Q_EMIT q->anchorChanged(); + } + if (previous.desiredSize != current.desiredSize) { + Q_EMIT q->desiredSizeChanged(); + } + if (previous.exclusiveZone != current.exclusiveZone) { + Q_EMIT q->exclusiveZoneChanged(); + } + if (previous.margins != current.margins) { + Q_EMIT q->marginsChanged(); + } +} + +LayerSurfaceV1Interface::LayerSurfaceV1Interface(LayerShellV1Interface *shell, + SurfaceInterface *surface, + OutputInterface *output, + Layer layer, + const QString &scope, + wl_resource *resource) + : d(new LayerSurfaceV1InterfacePrivate(this, surface)) +{ + d->current.layer = layer; + d->pending.layer = layer; + + d->shell = shell; + d->output = output; + d->scope = scope; + + d->init(resource); +} + +LayerSurfaceV1Interface::~LayerSurfaceV1Interface() +{ +} + +bool LayerSurfaceV1Interface::isCommitted() const +{ + return d->isCommitted; +} + +SurfaceInterface *LayerSurfaceV1Interface::surface() const +{ + return d->surface; +} + +Qt::Edges LayerSurfaceV1Interface::anchor() const +{ + return d->current.anchor; +} + +QSize LayerSurfaceV1Interface::desiredSize() const +{ + return d->current.desiredSize; +} + +bool LayerSurfaceV1Interface::acceptsFocus() const +{ + return d->current.acceptsFocus; +} + +LayerSurfaceV1Interface::Layer LayerSurfaceV1Interface::layer() const +{ + return d->current.layer; +} + +QMargins LayerSurfaceV1Interface::margins() const +{ + return d->current.margins; +} + +int LayerSurfaceV1Interface::leftMargin() const +{ + return d->current.margins.left(); +} + +int LayerSurfaceV1Interface::topMargin() const +{ + return d->current.margins.top(); +} + +int LayerSurfaceV1Interface::rightMargin() const +{ + return d->current.margins.right(); +} + +int LayerSurfaceV1Interface::bottomMargin() const +{ + return d->current.margins.bottom(); +} + +int LayerSurfaceV1Interface::exclusiveZone() const +{ + return d->current.exclusiveZone; +} + +Qt::Edge LayerSurfaceV1Interface::exclusiveEdge() const +{ + if (exclusiveZone() <= 0) { + return Qt::Edge(); + } + if (anchor() == (Qt::LeftEdge | Qt::TopEdge | Qt::RightEdge) || anchor() == Qt::TopEdge) { + return Qt::TopEdge; + } + if (anchor() == (Qt::TopEdge | Qt::RightEdge | Qt::BottomEdge) || anchor() == Qt::RightEdge) { + return Qt::RightEdge; + } + if (anchor() == (Qt::RightEdge | Qt::BottomEdge | Qt::LeftEdge) || anchor() == Qt::BottomEdge) { + return Qt::BottomEdge; + } + if (anchor() == (Qt::BottomEdge | Qt::LeftEdge | Qt::TopEdge) || anchor() == Qt::LeftEdge) { + return Qt::LeftEdge; + } + return Qt::Edge(); +} + +OutputInterface *LayerSurfaceV1Interface::output() const +{ + return d->output; +} + +QString LayerSurfaceV1Interface::scope() const +{ + return d->scope; +} + +quint32 LayerSurfaceV1Interface::sendConfigure(const QSize &size) +{ + if (d->isClosed) { + qCWarning(KWAYLAND_SERVER) << "Cannot configure a closed layer shell surface"; + return 0; + } + + const uint32_t serial = d->shell->display()->nextSerial(); + d->serials << serial; + + d->send_configure(serial, size.width(), size.height()); + d->isConfigured = true; + + return serial; +} + +void LayerSurfaceV1Interface::sendClosed() +{ + if (!d->isClosed) { + d->send_closed(); + d->isClosed = true; + } +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/layershell_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/layershell_v1_interface.h --- dwayland-5.57.0.23/src/server/layershell_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/layershell_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,184 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "display.h" + +#include + +namespace KWaylandServer +{ +class LayerShellV1InterfacePrivate; +class LayerSurfaceV1Interface; +class LayerSurfaceV1InterfacePrivate; +class OutputInterface; +class SurfaceInterface; + +/** + * The LayerShellV1Interface compositor extension allows to create desktop shell surfaces. + * + * The layer shell compositor extension provides a way to create surfaces that can serve as + * building blocks for desktop environment elements such as panels, notifications, etc. + * + * The LayerShellV1Interface corresponds to the Wayland interface @c zwlr_layer_shell_v1. + */ +class KWAYLANDSERVER_EXPORT LayerShellV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit LayerShellV1Interface(Display *display, QObject *parent = nullptr); + ~LayerShellV1Interface() override; + + /** + * Returns the Wayland display for the layer shell compositor extension. + */ + Display *display() const; + +Q_SIGNALS: + /** + * This signal is emitted when a new layer surface @a surface has been created. + */ + void surfaceCreated(LayerSurfaceV1Interface *surface); + +private: + QScopedPointer d; +}; + +/** + * The LayerSurfaceV1Interface class represents a desktop shell surface, e.g. panel, etc. + * + * The LayerSurfaceV1Interface corresponds to the Wayland interface @c zwlr_layer_surface_v1. + */ +class KWAYLANDSERVER_EXPORT LayerSurfaceV1Interface : public QObject +{ + Q_OBJECT + +public: + enum Layer { BackgroundLayer, BottomLayer, TopLayer, OverlayLayer }; + + LayerSurfaceV1Interface(LayerShellV1Interface *shell, + SurfaceInterface *surface, + OutputInterface *output, + Layer layer, + const QString &scope, + wl_resource *resource); + ~LayerSurfaceV1Interface() override; + + /** + * Returns @c true if the initial commit has been performed; otherwise returns @c false. + */ + bool isCommitted() const; + + /** + * Returns the underlying Wayland surface for this layer shell surface. + */ + SurfaceInterface *surface() const; + + /** + * Returns the anchor point relative to which the surface will be positioned. If no edges + * have been specified, the center of the screen is assumed to be the anchor point. + */ + Qt::Edges anchor() const; + + /** + * Returns the desired size for this layer shell surface, in the surface-local coordinates. + */ + QSize desiredSize() const; + + /** + * Returns the stacking order layer where this layer surface has to be rendered. + */ + Layer layer() const; + + /** + * Returns @c true if the surface accepts keyboard input; otherwise returns @c false. + */ + bool acceptsFocus() const; + + /** + * Returns the margins object that indicates the distance between an anchor edge and + * the corresponding surface edge. + */ + QMargins margins() const; + + /** + * Returns the value of the left margin. This is equivalent to calling margins().left(). + */ + int leftMargin() const; + + /** + * Returns the value of the right margin. This is equivalent to calling margins().right(). + */ + int rightMargin() const; + + /** + * Returns the value of the top margin. This is equivalent to calling margins().top(). + */ + int topMargin() const; + + /** + * Returns the value of the bottom margin. This is equivalent to calling margins().bottom(). + */ + int bottomMargin() const; + + /** + * Returns the distance from the anchor edge that should not be occluded. + * + * An exlusive zone of 0 means that the layer surface has to be moved to avoid occluding + * surfaces with a positive exclusion zone. If the exclusive zone is -1, the layer surface + * indicates that it doesn't want to be moved to accomodate for other surfaces. + */ + int exclusiveZone() const; + + /** + * If the exclusive zone is positive, this function returns the corresponding exclusive + * anchor edge, otherwise returns a Qt::Edge() value. + */ + Qt::Edge exclusiveEdge() const; + + /** + * Returns the output where the surface wants to be displayed. This function can return + * @c null, in which case the compositor is free to choose the output where the surface + * has to be placed. + */ + OutputInterface *output() const; + + /** + * Returns the scope of this layer surface. The scope defines the purpose of the surface. + */ + QString scope() const; + + /** + * Sends a configure event to the client. @a size contains the desired size in surface-local + * coordinates. A size of zero means that the client is free to choose its own dimensions. + * + * @see configureAcknowledged() + */ + quint32 sendConfigure(const QSize &size); + + /** + * Sends a closed event to the client. The client should destroy the surface after receiving + * this event. Further changes to the surface will be ignored. + */ + void sendClosed(); + +Q_SIGNALS: + void aboutToBeDestroyed(); + void configureAcknowledged(quint32 serial); + void acceptsFocusChanged(); + void layerChanged(); + void anchorChanged(); + void desiredSizeChanged(); + void exclusiveZoneChanged(); + void marginsChanged(); + +private: + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer.cpp dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer.cpp --- dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,562 @@ +/* + SPDX-FileCopyrightText: 2018 Fredrik Höglund + SPDX-FileCopyrightText: 2019 Roman Gilg + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + SPDX-FileCopyrightText: 2021 Xaver Hugl + + Based on the libweston implementation, + SPDX-FileCopyrightText: 2014, 2015 Collabora, Ltd. + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "linuxdmabufv1clientbuffer.h" +#include "linuxdmabufv1clientbuffer_p.h" +#include "logging.h" +#include "surface_interface_p.h" + +#include +#include +#include +#include + +namespace KWaylandServer +{ +static const int s_version = 4; + +LinuxDmaBufV1ClientBufferIntegrationPrivate::LinuxDmaBufV1ClientBufferIntegrationPrivate(LinuxDmaBufV1ClientBufferIntegration *q, Display *display) + : QtWaylandServer::zwp_linux_dmabuf_v1(*display, s_version) + , q(q) + , defaultFeedback(new LinuxDmaBufV1Feedback(this)) +{ +} + +void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_bind_resource(Resource *resource) +{ + if (resource->version() < ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION) { + for (auto it = supportedModifiers.constBegin(); it != supportedModifiers.constEnd(); ++it) { + const uint32_t format = it.key(); + QSet modifiers = it.value(); + if (modifiers.isEmpty()) { + modifiers.insert(DRM_FORMAT_MOD_INVALID); + } + + for (const uint64_t &modifier : qAsConst(modifiers)) { + if (resource->version() >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { + const uint32_t modifier_lo = modifier & 0xffffffff; + const uint32_t modifier_hi = modifier >> 32; + send_modifier(resource->handle, format, modifier_hi, modifier_lo); + } else if (modifier == DRM_FORMAT_MOD_LINEAR || modifier == DRM_FORMAT_MOD_INVALID) { + send_format(resource->handle, format); + } + } + } + } +} + +void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_get_default_feedback(Resource *resource, uint32_t id) +{ + LinuxDmaBufV1FeedbackPrivate::get(defaultFeedback.data())->add(resource->client(), id, resource->version()); +} + +void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_get_surface_feedback(Resource *resource, uint32_t id, wl_resource *surfaceResource) +{ + auto surface = SurfaceInterface::get(surfaceResource); + if (!surface) { + qCWarning(KWAYLAND_SERVER) << "requested surface feedback for nonexistant surface!"; + return; + } + auto surfacePrivate = SurfaceInterfacePrivate::get(surface); + if (!surfacePrivate->dmabufFeedbackV1) { + surfacePrivate->dmabufFeedbackV1.reset(new LinuxDmaBufV1Feedback(this)); + } + LinuxDmaBufV1FeedbackPrivate::get(surfacePrivate->dmabufFeedbackV1.data())->add(resource->client(), id, resource->version()); +} + +void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void LinuxDmaBufV1ClientBufferIntegrationPrivate::zwp_linux_dmabuf_v1_create_params(Resource *resource, uint32_t params_id) +{ + wl_resource *paramsResource = wl_resource_create(resource->client(), &zwp_linux_buffer_params_v1_interface, resource->version(), params_id); + if (!paramsResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + new LinuxDmaBufParamsV1(q, paramsResource); +} + +LinuxDmaBufParamsV1::LinuxDmaBufParamsV1(LinuxDmaBufV1ClientBufferIntegration *integration, ::wl_resource *resource) + : QtWaylandServer::zwp_linux_buffer_params_v1(resource) + , m_integration(integration) + , m_planes(4) +{ +} + +LinuxDmaBufParamsV1::~LinuxDmaBufParamsV1() +{ + for (const LinuxDmaBufV1Plane &plane : m_planes) { + if (plane.fd != -1) { + close(plane.fd); + } + } +} + +void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; +} + +void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_add(Resource *resource, + int32_t fd, + uint32_t plane_idx, + uint32_t offset, + uint32_t stride, + uint32_t modifier_hi, + uint32_t modifier_lo) +{ + if (Q_UNLIKELY(m_isUsed)) { + wl_resource_post_error(resource->handle, error_already_used, "the params object has already been used to create a wl_buffer"); + close(fd); + return; + } + + if (Q_UNLIKELY(plane_idx >= uint(m_planes.size()))) { + wl_resource_post_error(resource->handle, error_plane_idx, "plane index %d is out of bounds", plane_idx); + close(fd); + return; + } + + LinuxDmaBufV1Plane &plane = m_planes[plane_idx]; + + if (Q_UNLIKELY(plane.fd != -1)) { + wl_resource_post_error(resource->handle, error_plane_set, "the plane index %d was already set", plane_idx); + close(fd); + return; + } + + plane.fd = fd; + plane.modifier = (quint64(modifier_hi) << 32) | modifier_lo; + plane.offset = offset; + plane.stride = stride; + + m_planeCount++; +} + +void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_create(Resource *resource, int32_t width, int32_t height, uint32_t format, uint32_t flags) +{ + if (Q_UNLIKELY(m_isUsed)) { + wl_resource_post_error(resource->handle, error_already_used, "the params object has already been used to create a wl_buffer"); + return; + } + + if (Q_UNLIKELY(!test(resource, width, height))) { + return; + } + + m_isUsed = true; + m_planes.resize(m_planeCount); + + LinuxDmaBufV1ClientBuffer *clientBuffer = m_integration->rendererInterface()->importBuffer(m_planes, format, QSize(width, height), flags); + if (!clientBuffer) { + send_failed(resource->handle); + return; + } + + m_planes.clear(); // the ownership of file descriptors has been moved to the buffer + + wl_resource *bufferResource = wl_resource_create(resource->client(), &wl_buffer_interface, 1, 0); + if (!bufferResource) { + delete clientBuffer; + wl_resource_post_no_memory(resource->handle); + return; + } + + clientBuffer->initialize(bufferResource); + send_created(resource->handle, bufferResource); + + DisplayPrivate *displayPrivate = DisplayPrivate::get(m_integration->display()); + displayPrivate->registerClientBuffer(clientBuffer); +} + +void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_create_immed(Resource *resource, + uint32_t buffer_id, + int32_t width, + int32_t height, + uint32_t format, + uint32_t flags) +{ + if (Q_UNLIKELY(m_isUsed)) { + wl_resource_post_error(resource->handle, error_already_used, "the params object has already been used to create a wl_buffer"); + return; + } + + if (Q_UNLIKELY(!test(resource, width, height))) { + return; + } + + m_isUsed = true; + m_planes.resize(m_planeCount); + + LinuxDmaBufV1ClientBuffer *clientBuffer = m_integration->rendererInterface()->importBuffer(m_planes, format, QSize(width, height), flags); + if (!clientBuffer) { + wl_resource_post_error(resource->handle, error_invalid_wl_buffer, "importing the supplied dmabufs failed"); + return; + } + + m_planes.clear(); // the ownership of file descriptors has been moved to the buffer + + wl_resource *bufferResource = wl_resource_create(resource->client(), &wl_buffer_interface, 1, buffer_id); + if (!bufferResource) { + delete clientBuffer; + wl_resource_post_no_memory(resource->handle); + return; + } + + clientBuffer->initialize(bufferResource); + + DisplayPrivate *displayPrivate = DisplayPrivate::get(m_integration->display()); + displayPrivate->registerClientBuffer(clientBuffer); +} + +bool LinuxDmaBufParamsV1::test(Resource *resource, uint32_t width, uint32_t height) +{ + if (Q_UNLIKELY(!m_planeCount)) { + wl_resource_post_error(resource->handle, error_incomplete, "no planes have been specified"); + return false; + } + + // Check for holes in the dmabuf set (e.g. [0, 1, 3]). + for (int i = 0; i < m_planeCount; ++i) { + if (m_planes[i].fd == -1) { + wl_resource_post_error(resource->handle, error_incomplete, "no dmabuf has been added for plane %d", i); + return false; + } + } + + if (Q_UNLIKELY(width == 0 || height == 0)) { + wl_resource_post_error(resource->handle, error_invalid_dimensions, "invalid width %d or height %d", width, height); + return false; + } + + for (int i = 0; i < m_planeCount; ++i) { + const LinuxDmaBufV1Plane &plane = m_planes.at(i); + + // Check for overflows. + if (Q_UNLIKELY(uint64_t(plane.offset) + plane.stride > UINT32_MAX)) { + wl_resource_post_error(resource->handle, error_out_of_bounds, "size overflow for plane %d", i); + return false; + } + + if (Q_UNLIKELY(i == 0 && uint64_t(plane.offset) + uint64_t(plane.stride) * height > UINT32_MAX)) { + wl_resource_post_error(resource->handle, error_out_of_bounds, "size overflow for plane %d", i); + return false; + } + + // Don't report an error as it might be caused by the kernel not supporting + // seeking on dmabuf. + const off_t size = lseek(plane.fd, 0, SEEK_END); + if (size == -1) { + continue; + } + + if (Q_UNLIKELY(plane.offset >= size)) { + wl_resource_post_error(resource->handle, error_out_of_bounds, "invalid offset %i for plane %d", plane.offset, i); + return false; + } + + if (Q_UNLIKELY(plane.offset + plane.stride > size)) { + wl_resource_post_error(resource->handle, error_out_of_bounds, "invalid stride %i for plane %d", plane.stride, i); + return false; + } + + // Only valid for first plane as other planes might be sub-sampled according to + // fourcc format. + if (Q_UNLIKELY(i == 0 && plane.offset + plane.stride * height > size)) { + wl_resource_post_error(resource->handle, error_out_of_bounds, "invalid buffer stride of height for plane %d", i); + return false; + } + } + + return true; +} + +LinuxDmaBufV1ClientBufferIntegration::LinuxDmaBufV1ClientBufferIntegration(Display *display) + : ClientBufferIntegration(display) + , d(new LinuxDmaBufV1ClientBufferIntegrationPrivate(this, display)) +{ +} + +LinuxDmaBufV1ClientBufferIntegration::~LinuxDmaBufV1ClientBufferIntegration() +{ +} + +LinuxDmaBufV1ClientBufferIntegration::RendererInterface *LinuxDmaBufV1ClientBufferIntegration::rendererInterface() const +{ + return d->rendererInterface; +} + +void LinuxDmaBufV1ClientBufferIntegration::setRendererInterface(RendererInterface *rendererInterface) +{ + d->rendererInterface = rendererInterface; +} + +void LinuxDmaBufV1ClientBufferIntegration::setSupportedFormatsWithModifiers(const QVector &tranches) +{ + if (LinuxDmaBufV1FeedbackPrivate::get(d->defaultFeedback.data())->m_tranches != tranches) { + QHash> set; + for (const auto &tranche : tranches) { + set.insert(tranche.formatTable); + } + d->supportedModifiers = set; + d->mainDevice = tranches.first().device; + d->table.reset(new LinuxDmaBufV1FormatTable(set)); + d->defaultFeedback->setTranches(tranches); + } +} + +static bool testAlphaChannel(uint32_t drmFormat) +{ + switch (drmFormat) { + case DRM_FORMAT_ARGB4444: + case DRM_FORMAT_ABGR4444: + case DRM_FORMAT_RGBA4444: + case DRM_FORMAT_BGRA4444: + + case DRM_FORMAT_ARGB1555: + case DRM_FORMAT_ABGR1555: + case DRM_FORMAT_RGBA5551: + case DRM_FORMAT_BGRA5551: + + case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_ABGR8888: + case DRM_FORMAT_RGBA8888: + case DRM_FORMAT_BGRA8888: + + case DRM_FORMAT_ARGB2101010: + case DRM_FORMAT_ABGR2101010: + case DRM_FORMAT_RGBA1010102: + case DRM_FORMAT_BGRA1010102: + + case DRM_FORMAT_XRGB8888_A8: + case DRM_FORMAT_XBGR8888_A8: + case DRM_FORMAT_RGBX8888_A8: + case DRM_FORMAT_BGRX8888_A8: + case DRM_FORMAT_RGB888_A8: + case DRM_FORMAT_BGR888_A8: + case DRM_FORMAT_RGB565_A8: + case DRM_FORMAT_BGR565_A8: + return true; + default: + return false; + } +} + +void LinuxDmaBufV1ClientBufferPrivate::buffer_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(const QSize &size, quint32 format, quint32 flags, const QVector &planes) + : ClientBuffer(*new LinuxDmaBufV1ClientBufferPrivate) +{ + Q_D(LinuxDmaBufV1ClientBuffer); + d->size = size; + d->format = format; + d->flags = flags; + d->planes = planes; + d->hasAlphaChannel = testAlphaChannel(format); +} + +LinuxDmaBufV1ClientBuffer::~LinuxDmaBufV1ClientBuffer() +{ + Q_D(LinuxDmaBufV1ClientBuffer); + for (int i = 0; i < d->planes.count(); ++i) { + if (d->planes[i].fd != -1) { + close(d->planes[i].fd); + d->planes[i].fd = -1; + } + } +} + +void LinuxDmaBufV1ClientBuffer::initialize(wl_resource *resource) +{ + Q_D(LinuxDmaBufV1ClientBuffer); + d->init(resource); + ClientBuffer::initialize(resource); +} + +quint32 LinuxDmaBufV1ClientBuffer::format() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + return d->format; +} + +quint32 LinuxDmaBufV1ClientBuffer::flags() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + return d->flags; +} + +QVector LinuxDmaBufV1ClientBuffer::planes() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + return d->planes; +} + +QSize LinuxDmaBufV1ClientBuffer::size() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + return d->size; +} + +bool LinuxDmaBufV1ClientBuffer::hasAlphaChannel() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + return d->hasAlphaChannel; +} + +ClientBuffer::Origin LinuxDmaBufV1ClientBuffer::origin() const +{ + Q_D(const LinuxDmaBufV1ClientBuffer); + if (d->flags & QtWaylandServer::zwp_linux_buffer_params_v1::flags_y_invert) { + return ClientBuffer::Origin::BottomLeft; + } else { + return ClientBuffer::Origin::TopLeft; + } +} + +LinuxDmaBufV1Feedback::LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegrationPrivate *integration) + : d(new LinuxDmaBufV1FeedbackPrivate(integration)) +{ +} + +LinuxDmaBufV1Feedback::~LinuxDmaBufV1Feedback() = default; + +void LinuxDmaBufV1Feedback::setTranches(const QVector &tranches) +{ + if (d->m_tranches != tranches) { + d->m_tranches = tranches; + const auto &map = d->resourceMap(); + for (const auto &resource : map) { + d->send(resource); + } + } +} + +LinuxDmaBufV1FeedbackPrivate *LinuxDmaBufV1FeedbackPrivate::get(LinuxDmaBufV1Feedback *q) +{ + return q->d.data(); +} + +LinuxDmaBufV1FeedbackPrivate::LinuxDmaBufV1FeedbackPrivate(LinuxDmaBufV1ClientBufferIntegrationPrivate *bufferintegration) + : m_bufferintegration(bufferintegration) +{ +} + +bool operator==(const LinuxDmaBufV1Feedback::Tranche &t1, const LinuxDmaBufV1Feedback::Tranche &t2) +{ + return t1.device == t2.device && t1.flags == t2.flags && t1.formatTable == t2.formatTable; +} + +void LinuxDmaBufV1FeedbackPrivate::send(Resource *resource) +{ + send_format_table(resource->handle, m_bufferintegration->table->fd, m_bufferintegration->table->size); + QByteArray bytes; + bytes.append(reinterpret_cast(&m_bufferintegration->mainDevice), sizeof(dev_t)); + send_main_device(resource->handle, bytes); + const auto &sendTranche = [this, resource](const LinuxDmaBufV1Feedback::Tranche &tranche) { + QByteArray targetDevice; + targetDevice.append(reinterpret_cast(&tranche.device), sizeof(dev_t)); + QByteArray indices; + for (auto it = tranche.formatTable.begin(); it != tranche.formatTable.end(); it++) { + const uint32_t format = it.key(); + for (const auto &mod : qAsConst(it.value())) { + uint16_t index = m_bufferintegration->table->indices[std::pair(format, mod)]; + indices.append(reinterpret_cast(&index), 2); + } + } + send_tranche_target_device(resource->handle, targetDevice); + send_tranche_formats(resource->handle, indices); + send_tranche_flags(resource->handle, static_cast(tranche.flags)); + send_tranche_done(resource->handle); + }; + for (const auto &tranche : qAsConst(m_tranches)) { + sendTranche(tranche); + } + // send default hints as the last fallback tranche + const auto defaultFeedbackPrivate = get(m_bufferintegration->defaultFeedback.data()); + if (this != defaultFeedbackPrivate) { + for (const auto &tranche : qAsConst(defaultFeedbackPrivate->m_tranches)) { + sendTranche(tranche); + } + } + send_done(resource->handle); +} + +void LinuxDmaBufV1FeedbackPrivate::zwp_linux_dmabuf_feedback_v1_bind_resource(Resource *resource) +{ + send(resource); +} + +void LinuxDmaBufV1FeedbackPrivate::zwp_linux_dmabuf_feedback_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +struct linux_dmabuf_feedback_v1_table_entry { + uint32_t format; + uint32_t pad; // unused + uint64_t modifier; +}; + +LinuxDmaBufV1FormatTable::LinuxDmaBufV1FormatTable(const QHash> &supportedModifiers) +{ + QVector data; + for (auto it = supportedModifiers.begin(); it != supportedModifiers.end(); it++) { + const uint32_t format = it.key(); + for (const uint64_t &mod : *it) { + indices.insert({format, mod}, data.size()); + data.append({format, 0, mod}); + } + } + size = data.size() * sizeof(linux_dmabuf_feedback_v1_table_entry); + QScopedPointer tmp(new QTemporaryFile()); + if (!tmp->open()) { + qCWarning(KWAYLAND_SERVER) << "Failed to create keymap file:" << tmp->errorString(); + return; + } + fd = open(tmp->fileName().toUtf8().constData(), O_RDONLY | O_CLOEXEC); + if (fd < 0) { + qCWarning(KWAYLAND_SERVER) << "Could not create readonly shm fd!" << strerror(errno); + return; + } + unlink(tmp->fileName().toUtf8().constData()); + if (!tmp->resize(size)) { + qCWarning(KWAYLAND_SERVER) << "Failed to resize keymap file:" << tmp->errorString(); + return; + } + uchar *address = tmp->map(0, size); + if (!address) { + qCWarning(KWAYLAND_SERVER) << "Failed to map keymap file:" << tmp->errorString(); + return; + } + memcpy(address, data.data(), size); +} + +LinuxDmaBufV1FormatTable::~LinuxDmaBufV1FormatTable() +{ + if (fd != -1) { + close(fd); + } +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer.h dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer.h --- dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,144 @@ +/* + SPDX-FileCopyrightText: 2018 Fredrik Höglund + SPDX-FileCopyrightText: 2019 Roman Gilg + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + SPDX-FileCopyrightText: 2021 Xaver Hugl + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "clientbuffer.h" +#include "clientbufferintegration.h" + +#include +#include +#include + +namespace KWaylandServer +{ +class LinuxDmaBufV1ClientBufferPrivate; +class LinuxDmaBufV1ClientBufferIntegrationPrivate; +class LinuxDmaBufV1FeedbackPrivate; + +/** + * The LinuxDmaBufV1Plane type represents a plane in a client buffer. + */ +struct LinuxDmaBufV1Plane { + int fd = -1; ///< The dmabuf file descriptor + quint32 offset = 0; ///< The offset from the start of buffer + quint32 stride = 0; ///< The distance from the start of a row to the next row in bytes + quint64 modifier = 0; ///< The layout modifier +}; + +/** + * The LinuxDmaBufV1ClientBuffer class represents a linux dma-buf client buffer. + * + * The LinuxDmaBufV1ClientBuffer can be used even after the underlying wl_buffer object + * is destroyed by the client. + */ +class KWAYLANDSERVER_EXPORT LinuxDmaBufV1ClientBuffer : public ClientBuffer +{ + Q_OBJECT + Q_DECLARE_PRIVATE(LinuxDmaBufV1ClientBuffer) + +public: + LinuxDmaBufV1ClientBuffer(const QSize &size, quint32 format, quint32 flags, const QVector &planes); + ~LinuxDmaBufV1ClientBuffer() override; + + quint32 format() const; + quint32 flags() const; + QVector planes() const; + + QSize size() const override; + bool hasAlphaChannel() const override; + Origin origin() const override; + +private: + void initialize(wl_resource *resource); + friend class LinuxDmaBufParamsV1; +}; + +class KWAYLANDSERVER_EXPORT LinuxDmaBufV1Feedback : public QObject +{ + Q_OBJECT +public: + ~LinuxDmaBufV1Feedback() override; + + enum class TrancheFlag : uint32_t { + Scanout = 1, + }; + Q_DECLARE_FLAGS(TrancheFlags, TrancheFlag) + + struct Tranche { + dev_t device; + TrancheFlags flags; + QHash> formatTable; + }; + /** + * Sets the list of tranches for this feedback object, with lower indices + * indicating a higher priority / a more optimal configuration. + * The main device does not need to be included + */ + void setTranches(const QVector &tranches); + +private: + LinuxDmaBufV1Feedback(LinuxDmaBufV1ClientBufferIntegrationPrivate *integration); + friend class LinuxDmaBufV1ClientBufferIntegrationPrivate; + friend class LinuxDmaBufV1FeedbackPrivate; + QScopedPointer d; +}; + +/** + * The LinuxDmaBufV1ClientBufferIntegration class provides support for linux dma-buf buffers. + */ +class KWAYLANDSERVER_EXPORT LinuxDmaBufV1ClientBufferIntegration : public ClientBufferIntegration +{ + Q_OBJECT + +public: + explicit LinuxDmaBufV1ClientBufferIntegration(Display *display); + ~LinuxDmaBufV1ClientBufferIntegration() override; + + /** + * The Iface class provides an interface from the LinuxDmabufInterface into the compositor + */ + class RendererInterface + { + public: + virtual ~RendererInterface() = default; + + /** + * Imports a linux-dmabuf buffer into the compositor. + * + * The parent LinuxDmabufUnstableV1Interface class takes ownership of returned + * buffer objects. + * + * In return the returned buffer takes ownership of the file descriptor for each + * plane. + * + * Note that it is the responsibility of the caller to close the file descriptors + * when the import fails. + * + * @return The imported buffer on success, and nullptr otherwise. + */ + virtual LinuxDmaBufV1ClientBuffer *importBuffer(const QVector &planes, quint32 format, const QSize &size, quint32 flags) = 0; + }; + + RendererInterface *rendererInterface() const; + + /** + * Sets the compositor implementation for the dmabuf interface. + * + * The ownership is not transferred by this call. + */ + void setRendererInterface(RendererInterface *rendererInterface); + + void setSupportedFormatsWithModifiers(const QVector &tranches); + +private: + friend class LinuxDmaBufV1ClientBufferIntegrationPrivate; + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer_p.h dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer_p.h --- dwayland-5.57.0.23/src/server/linuxdmabufv1clientbuffer_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabufv1clientbuffer_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,118 @@ +/* + SPDX-FileCopyrightText: 2018 Fredrik Höglund + SPDX-FileCopyrightText: 2019 Roman Gilg + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + SPDX-FileCopyrightText: 2021 Xaver Hugl + + Based on the libweston implementation, + SPDX-FileCopyrightText: 2014, 2015 Collabora, Ltd. + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once +#include "clientbuffer_p.h" +#include "display.h" +#include "display_p.h" +#include "drm_fourcc.h" +#include "linuxdmabufv1clientbuffer.h" + +#include "qwayland-server-linux-dmabuf-unstable-v1.h" +#include "qwayland-server-wayland.h" + +#include +#include + +namespace KWaylandServer +{ + +class LinuxDmaBufV1FormatTable; + +class LinuxDmaBufV1ClientBufferIntegrationPrivate : public QtWaylandServer::zwp_linux_dmabuf_v1 +{ +public: + LinuxDmaBufV1ClientBufferIntegrationPrivate(LinuxDmaBufV1ClientBufferIntegration *q, Display *display); + + LinuxDmaBufV1ClientBufferIntegration *q; + LinuxDmaBufV1ClientBufferIntegration::RendererInterface *rendererInterface = nullptr; + QScopedPointer defaultFeedback; + QScopedPointer table; + dev_t mainDevice; + QHash> supportedModifiers; + +protected: + void zwp_linux_dmabuf_v1_bind_resource(Resource *resource) override; + void zwp_linux_dmabuf_v1_destroy(Resource *resource) override; + void zwp_linux_dmabuf_v1_create_params(Resource *resource, uint32_t params_id) override; + void zwp_linux_dmabuf_v1_get_default_feedback(Resource *resource, uint32_t id) override; + void zwp_linux_dmabuf_v1_get_surface_feedback(Resource *resource, uint32_t id, wl_resource *surface) override; +}; + +class LinuxDmaBufV1ClientBufferPrivate : public ClientBufferPrivate, public QtWaylandServer::wl_buffer +{ +public: + QSize size; + quint32 format; + quint32 flags; + QVector planes; + bool hasAlphaChannel = false; + +protected: + void buffer_destroy(Resource *resource) override; +}; + +class LinuxDmaBufParamsV1 : public QtWaylandServer::zwp_linux_buffer_params_v1 +{ +public: + LinuxDmaBufParamsV1(LinuxDmaBufV1ClientBufferIntegration *integration, ::wl_resource *resource); + ~LinuxDmaBufParamsV1() override; + +protected: + void zwp_linux_buffer_params_v1_destroy_resource(Resource *resource) override; + void zwp_linux_buffer_params_v1_destroy(Resource *resource) override; + void zwp_linux_buffer_params_v1_add(Resource *resource, + int32_t fd, + uint32_t plane_idx, + uint32_t offset, + uint32_t stride, + uint32_t modifier_hi, + uint32_t modifier_lo) override; + void zwp_linux_buffer_params_v1_create(Resource *resource, int32_t width, int32_t height, uint32_t format, uint32_t flags) override; + void + zwp_linux_buffer_params_v1_create_immed(Resource *resource, uint32_t buffer_id, int32_t width, int32_t height, uint32_t format, uint32_t flags) override; + +private: + bool test(Resource *resource, uint32_t width, uint32_t height); + + LinuxDmaBufV1ClientBufferIntegration *m_integration; + QVector m_planes; + int m_planeCount = 0; + bool m_isUsed = false; +}; + +class LinuxDmaBufV1FormatTable +{ +public: + LinuxDmaBufV1FormatTable(const QHash> &supportedModifiers); + ~LinuxDmaBufV1FormatTable(); + + int fd = -1; + int size; + QMap, uint16_t> indices; +}; + +class LinuxDmaBufV1FeedbackPrivate : public QtWaylandServer::zwp_linux_dmabuf_feedback_v1 +{ +public: + LinuxDmaBufV1FeedbackPrivate(LinuxDmaBufV1ClientBufferIntegrationPrivate *bufferintegration); + + static LinuxDmaBufV1FeedbackPrivate *get(LinuxDmaBufV1Feedback *q); + void send(Resource *resource); + + QVector m_tranches; + LinuxDmaBufV1ClientBufferIntegrationPrivate *m_bufferintegration; + +protected: + void zwp_linux_dmabuf_feedback_v1_bind_resource(Resource *resource) override; + void zwp_linux_dmabuf_feedback_v1_destroy(Resource *resource) override; +}; +} diff -Nru dwayland-5.57.0.23/src/server/linuxdmabuf_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabuf_v1_interface.cpp --- dwayland-5.57.0.23/src/server/linuxdmabuf_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabuf_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,513 +0,0 @@ -/******************************************************************** -Copyright © 2019 Roman Gilg -Copyright © 2018 Fredrik Höglund - -Based on the libweston implementation, -Copyright © 2014, 2015 Collabora, Ltd. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "linuxdmabuf_v1_interface.h" - -#include "drm_fourcc.h" -#include "global_p.h" -#include "wayland-linux-dmabuf-unstable-v1-server-protocol.h" -#include "wayland-server-protocol.h" - -#include - -#include - -#include -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class LinuxDmabufBuffer::Private -{ -public: - Private(LinuxDmabufBuffer *_q) : q(_q) { - q->d = this; - } - virtual ~Private() = default; - - virtual uint32_t format() const = 0; - virtual QSize size() const = 0; - - LinuxDmabufBuffer *q; -}; - -LinuxDmabufBuffer::LinuxDmabufBuffer() -{ -} - -uint32_t LinuxDmabufBuffer::format() const -{ - return d->format(); -} - -QSize LinuxDmabufBuffer::size() const -{ - return d->size(); -} - -class LinuxDmabufUnstableV1Buffer::Private : LinuxDmabufBuffer::Private -{ -public: - Private(LinuxDmabufUnstableV1Buffer *_q) - : LinuxDmabufBuffer::Private(_q) - , q(_q) - { - } - ~Private() override = default; - - uint32_t format() const override { - return m_format; - } - QSize size() const override { - return m_size; - } - - uint32_t m_format; - QSize m_size; - - LinuxDmabufUnstableV1Buffer *q; -}; - -LinuxDmabufUnstableV1Buffer::LinuxDmabufUnstableV1Buffer(uint32_t format, const QSize &size) - : LinuxDmabufBuffer() - , d(new LinuxDmabufUnstableV1Buffer::Private(this)) -{ - d->m_format = format; - d->m_size = size; -} - -typedef LinuxDmabufUnstableV1Interface V1Iface; - -class V1Iface::Private : public Global::Private -{ -public: - Private(V1Iface *q, Display *display); - ~Private(); - - static const struct wl_buffer_interface *bufferImplementation() { return &s_bufferImplementation; } - V1Iface::Impl *impl; - QHash > supportedFormatsWithModifiers; - V1Iface * const q; - static const uint32_t s_version; - - void bind(wl_client *client, uint32_t version, uint32_t id) override final; - void createParams(wl_client *client, wl_resource *resource, uint32_t id); - - static void unbind(wl_client *client, wl_resource *resource); - static void createParamsCallback(wl_client *client, wl_resource *resource, uint32_t id); - -private: - class Params - { - public: - Params(V1Iface::Private *dmabufInterface, wl_client *client, uint32_t version, uint32_t id); - ~Params(); - - void postNoMemory() { wl_resource_post_no_memory(m_resource); } - - wl_resource *resource() const { return m_resource; } - - void add(int fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint64_t modifier); - void create(wl_client *client, uint32_t bufferId, const QSize &size, uint32_t format, uint32_t flags); - - static void destroy(wl_client *client, wl_resource *resource); - static void add(wl_client *client, wl_resource *resource, int fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, uint32_t modifier_lo); - static void create(wl_client *client, wl_resource *resource, int width, int height, uint32_t format, uint32_t flags); - static void createImmed(wl_client *client, wl_resource *resource, uint32_t new_id, int width, int height, uint32_t format, uint32_t flags); - - private: - static const struct zwp_linux_buffer_params_v1_interface s_interface; - - wl_resource *m_resource; - V1Iface::Private *m_dmabufInterface; - std::array m_planes; - size_t m_planeCount = 0; - bool m_createRequested = false; - }; - - static const struct zwp_linux_dmabuf_v1_interface s_implementation; - static const struct wl_buffer_interface s_bufferImplementation; -}; - -void V1Iface::Private::Params::create(wl_client *client, wl_resource *resource, - int width, int height, uint32_t format, uint32_t flags) -{ - Q_UNUSED(client) - - V1Iface::Private::Params *params = static_cast(wl_resource_get_user_data(resource)); - assert(params->m_resource == resource); - params->create(client, 0, QSize(width, height), format, flags); -} - -void V1Iface::Private::Params::createImmed(wl_client *client, wl_resource *resource, - uint32_t new_id, int width, int height, - uint32_t format, uint32_t flags) -{ - Q_UNUSED(client) - - V1Iface::Private::Params *params = static_cast(wl_resource_get_user_data(resource)); - assert(params->m_resource == resource); - params->create(client, new_id, QSize(width, height), format, flags); -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_linux_dmabuf_v1_interface V1Iface::Private::s_implementation = { - [](wl_client *, wl_resource *resource) { wl_resource_destroy(resource); }, // unbind - createParamsCallback -}; - -const struct wl_buffer_interface V1Iface::Private::s_bufferImplementation = { - [](wl_client *, wl_resource *resource) { wl_resource_destroy(resource); } // destroy -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_linux_buffer_params_v1_interface V1Iface::Private::Params::s_interface = { - destroy, - add, - create, - createImmed -}; -#endif - -V1Iface::Private::Params::Params(V1Iface::Private *dmabufInterface, wl_client *client, uint32_t version, uint32_t id) - : m_dmabufInterface(dmabufInterface) -{ - m_resource = wl_resource_create(client, &zwp_linux_buffer_params_v1_interface, version, id); - if (!m_resource) { - return; - } - - wl_resource_set_implementation(m_resource, &s_interface, this, - [](wl_resource *resource) { - delete static_cast(wl_resource_get_user_data(resource)); - }); - - for (auto &plane : m_planes) { - plane.fd = -1; - plane.offset = 0; - plane.stride = 0; - plane.modifier = 0; - } -} - -V1Iface::Private::Params::~Params() -{ - // Close the file descriptors - for (auto &plane : m_planes) { - if (plane.fd != -1) { - ::close(plane.fd); - } - } -} - -void V1Iface::Private::Params::create(wl_client *client, uint32_t bufferId, const QSize &size, uint32_t format, uint32_t flags) -{ - // Validate the parameters - // ----------------------- - const uint32_t width = size.width(); - const uint32_t height = size.height(); - - if (m_createRequested) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED, - "params was already used to create a wl_buffer"); - return; - } - m_createRequested = true; - - if (m_planeCount == 0) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE, - "no dmabuf has been added to the params"); - return; - } - - // Check for holes in the dmabufs set (e.g. [0, 1, 3]) - for (uint32_t i = 0; i < m_planeCount; i++) { - if (m_planes[i].fd != -1) - continue; - - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE, - "no dmabuf has been added for plane %i", i); - return; - } - - if (width < 1 || height < 1) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS, - "invalid width %d or height %d", width, height); - return; - } - - for (uint32_t i = 0; i < m_planeCount; i++) { - auto &plane = m_planes[i]; - - if (uint64_t(plane.offset) + plane.stride > UINT32_MAX) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, - "size overflow for plane %i", i); - return; - } - - if (i == 0 && uint64_t(plane.offset) + plane.stride * height > UINT32_MAX) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, - "size overflow for plane %i", i); - return; - } - - // Don't report an error as it might be caused by the kernel not supporting seeking on dmabuf - off_t size = ::lseek(plane.fd, 0, SEEK_END); - if (size == -1) - continue; - - if (plane.offset >= size) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, - "invalid offset %i for plane %i", - plane.offset, i); - return; - } - - if (plane.offset + plane.stride > size) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, - "invalid stride %i for plane %i", - plane.stride, i); - return; - } - - // Only valid for first plane as other planes might be - // sub-sampled according to fourcc format - if (i == 0 && plane.offset + plane.stride * height > size) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, - "invalid buffer stride or height for plane %i", i); - return; - } - } - - // Import the buffer - // ----------------- - QVector planes; - planes.reserve(m_planeCount); - for (uint32_t i = 0; i < m_planeCount; i++) - planes << m_planes[i]; - - LinuxDmabufUnstableV1Buffer *buffer = m_dmabufInterface->impl->importBuffer(planes, - format, - size, - (V1Iface::Flags) flags); - if (buffer) { - // The buffer has ownership of the file descriptors now - for (auto &plane : m_planes) { - plane.fd = -1; - } - - wl_resource *resource = wl_resource_create(client, &wl_buffer_interface, 1, bufferId); - if (!resource ) { - postNoMemory(); - delete buffer; - return; - } - - wl_resource_set_implementation(resource, m_dmabufInterface->q->bufferImplementation(), buffer, - [](wl_resource *resource) { // Destructor - delete static_cast(wl_resource_get_user_data(resource)); - }); - - // XXX Do we need this? - //buffer->setResource(resource); - - // Send a 'created' event when the request is not for an immediate import, i.e. bufferId is zero - if (bufferId == 0) { - zwp_linux_buffer_params_v1_send_created(m_resource, resource); - } - } else { - if (bufferId == 0) { - zwp_linux_buffer_params_v1_send_failed(m_resource); - } else { - // since the behavior is left implementation defined by the - // protocol in case of create_immed failure due to an unknown cause, - // we choose to treat it as a fatal error and immediately kill the - // client instead of creating an invalid handle and waiting for it - // to be used. - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER, - "importing the supplied dmabufs failed"); - } - } -} - -void V1Iface::Private::Params::add(int fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint64_t modifier) -{ - if (m_createRequested) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED, - "params was already used to create a wl_buffer"); - ::close(fd); - return; - } - - if (plane_idx >= m_planes.size()) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX, - "plane index %u is too high", plane_idx); - ::close(fd); - return; - } - - auto &plane = m_planes[plane_idx]; - - if (plane.fd != -1) { - wl_resource_post_error(m_resource, - ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET, - "a dmabuf has already been added for plane %u", - plane_idx); - ::close(fd); - return; - } - - plane.fd = fd; - plane.offset = offset; - plane.stride = stride; - plane.modifier = modifier; - - m_planeCount++; -} - -void V1Iface::Private::Params::destroy(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void V1Iface::Private::Params::add(wl_client *client, wl_resource *resource, - int fd, uint32_t plane_idx, - uint32_t offset, uint32_t stride, - uint32_t modifier_hi, uint32_t modifier_lo) -{ - Q_UNUSED(client) - - V1Iface::Private::Params *params = static_cast(wl_resource_get_user_data(resource)); - assert(params->m_resource == resource); - params->add(fd, plane_idx, offset, stride, (uint64_t(modifier_hi) << 32) | modifier_lo); -} - -const uint32_t V1Iface::Private::s_version = 3; -#endif - -V1Iface::Private::Private(V1Iface *q, Display *display) - : Global::Private(display, &zwp_linux_dmabuf_v1_interface, s_version), - q(q) -{ -} - -V1Iface::Private::~Private() -{ - delete impl; -} - -void V1Iface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - wl_resource *resource = wl_resource_create(client, &zwp_linux_dmabuf_v1_interface, std::min(s_version, version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - - wl_resource_set_implementation(resource, &s_implementation, this, nullptr); - - // Send formats & modifiers - // ------------------------ - - QHash>::const_iterator it = supportedFormatsWithModifiers.constBegin(); - while (it != supportedFormatsWithModifiers.constEnd()) { - QSet modifiers = it.value(); - if (modifiers.isEmpty()) { - modifiers << DRM_FORMAT_MOD_INVALID; - } - - for (uint64_t modifier : qAsConst(modifiers)) { - if (version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { - const uint32_t modifier_lo = modifier & 0xFFFFFFFF; - const uint32_t modifier_hi = modifier >> 32; - zwp_linux_dmabuf_v1_send_modifier(resource, it.key(), modifier_hi, modifier_lo); - } else if (modifier == DRM_FORMAT_MOD_LINEAR || modifier == DRM_FORMAT_MOD_INVALID) { - zwp_linux_dmabuf_v1_send_format(resource, it.key()); - } - } - it++; - } -} - -void V1Iface::Private::createParams(wl_client *client, wl_resource *resource, uint32_t id) -{ - Params *params = new Params(this, client, wl_resource_get_version(resource), id); - if (!params->resource()) { - wl_resource_post_no_memory(resource); - delete params; - } -} - -void V1Iface::Private::createParamsCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - V1Iface::Private *global = static_cast(wl_resource_get_user_data(resource)); - global->createParams(client, resource, id); -} - - -V1Iface::LinuxDmabufUnstableV1Interface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -V1Iface::~LinuxDmabufUnstableV1Interface() = default; - -void V1Iface::setImpl(V1Iface::Impl *impl) -{ - d_func()->impl = impl; -} - -void V1Iface::setSupportedFormatsWithModifiers(QHash > set) -{ - d_func()->supportedFormatsWithModifiers = set; -} - -const struct wl_buffer_interface *V1Iface::bufferImplementation() -{ - return V1Iface::Private::bufferImplementation(); -} - -V1Iface::Private *V1Iface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/linuxdmabuf_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabuf_v1_interface.h --- dwayland-5.57.0.23/src/server/linuxdmabuf_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/linuxdmabuf_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -/******************************************************************** -Copyright © 2019 Roman Gilg -Copyright © 2018 Fredrik Höglund - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_LINUXDMABUF_INTERFACE_H -#define WAYLAND_SERVER_LINUXDMABUF_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -#include -#include -#include - -struct wl_buffer_interface; - -namespace KWayland -{ -namespace Server -{ -class BufferInterface; - -/** - * The base class for linux-dmabuf buffers - * - * Compositors should reimplement this class to store objects specific - * to the underlying graphics stack. - */ -class KWAYLANDSERVER_EXPORT LinuxDmabufBuffer -{ -public: - LinuxDmabufBuffer(); - virtual ~LinuxDmabufBuffer() = default; - - /** - * Returns the DRM format code for the buffer. - */ - uint32_t format() const; - /** - * Returns the size of the buffer. - */ - QSize size() const; - -private: - class Private; - Private *d; - - friend class LinuxDmabufUnstableV1Buffer; -}; - -class KWAYLANDSERVER_EXPORT LinuxDmabufUnstableV1Buffer : public LinuxDmabufBuffer -{ -public: - /** - * Creates a new Buffer. - */ - LinuxDmabufUnstableV1Buffer(uint32_t format, const QSize &size); - - /** - * Destroys the Buffer. - */ - virtual ~LinuxDmabufUnstableV1Buffer() = default; - -private: - class Private; - Private *d; -}; - -/** - * Represents the global zpw_linux_dmabuf_v1 interface. - * - * This interface provides a way for clients to create generic dmabuf based wl_buffers. - */ -class KWAYLANDSERVER_EXPORT LinuxDmabufUnstableV1Interface : public Global -{ - Q_OBJECT -public: - enum Flag { - YInverted = (1 << 0), /// Contents are y-inverted - Interlaced = (1 << 1), /// Content is interlaced - BottomFieldFirst = (1 << 2) /// Bottom field first - }; - - Q_DECLARE_FLAGS(Flags, Flag) - - /** - * Represents a plane in a buffer - */ - struct Plane { - int fd; /// The dmabuf file descriptor - uint32_t offset; /// The offset from the start of buffer - uint32_t stride; /// The distance from the start of a row to the next row in bytes - uint64_t modifier; /// The layout modifier - }; - - /** - * The Iface class provides an interface from the LinuxDmabufInterface into the compositor - */ - class Impl { - public: - Impl() = default; - virtual ~Impl() = default; - - /** - * Imports a linux-dmabuf buffer into the compositor. - * - * The parent LinuxDmabufUnstableV1Interface class takes ownership of returned - * buffer objects. - * - * In return the returned buffer takes ownership of the file descriptor for each - * plane. - * - * Note that it is the responsibility of the caller to close the file descriptors - * when the import fails. - * - * @return The imported buffer on success, and nullptr otherwise. - */ - virtual LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) = 0; - }; - - /** - * Destroys the LinuxDmabufUnstableV1Interface. - */ - virtual ~LinuxDmabufUnstableV1Interface(); - - /** - * Sets the compositor implementation for the dmabuf interface. - */ - void setImpl(Impl *impl); - - void setSupportedFormatsWithModifiers(QHash > set); - - /** - * Returns the LinuxDmabufInterface for the given resource. - **/ - static LinuxDmabufUnstableV1Interface *get(wl_resource *native); - -private: - /** - * @internal - */ - explicit LinuxDmabufUnstableV1Interface(Display *display, QObject *parent = nullptr); - - /** - * Returns a pointer to the wl_buffer implementation for imported dmabufs. - */ - static const struct wl_buffer_interface *bufferImplementation(); - - friend class Display; - friend class BufferInterface; - - class Private; - Private *d_func() const; -}; - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::LinuxDmabufUnstableV1Interface*) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::LinuxDmabufUnstableV1Interface::Flags) - -#endif // WAYLAND_SERVER_LINUXDMABUF_INTERFACE_H diff -Nru dwayland-5.57.0.23/src/server/outputchangeset.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset.cpp --- dwayland-5.57.0.23/src/server/outputchangeset.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ - -#include "outputchangeset.h" -#include "outputchangeset_p.h" -#include - -namespace KWayland -{ -namespace Server -{ - -OutputChangeSet::Private::Private(OutputDeviceInterface *outputdevice, OutputChangeSet *parent) - : q(parent) - , o(outputdevice) - , enabled(o->enabled()) - , modeId(o->currentModeId()) - , transform(o->transform()) - , position(o->globalPosition()) - , scale(o->scale()) - , colorCurves(o->colorCurves()) - , brightness(o->brightness()) -{ -} - -OutputChangeSet::Private::~Private() = default; - -OutputChangeSet::OutputChangeSet(OutputDeviceInterface *outputdevice, QObject *parent) - : QObject(parent) - , d(new Private(outputdevice, this)) -{ -} - -OutputChangeSet::~OutputChangeSet() = default; - -OutputChangeSet::Private *OutputChangeSet::d_func() const -{ - return reinterpret_cast(d.data()); -} - -bool OutputChangeSet::enabledChanged() const -{ - Q_D(); - if(d->o != NULL) - { - return d->enabled != d->o->enabled(); - } - else - { - qDebug()<<"enabledChanged d->o is NULL"; - return false; - } -} - -OutputDeviceInterface::Enablement OutputChangeSet::enabled() const -{ - Q_D(); - return d->enabled; -} - -bool OutputChangeSet::modeChanged() const -{ - Q_D(); - return d->modeId != d->o->currentModeId(); -} - -bool OutputChangeSet::brightnessChanged() const -{ - Q_D(); - return d->brightness != d->o->brightness(); -} - -int OutputChangeSet::mode() const -{ - Q_D(); - return d->modeId; -} - -int OutputChangeSet::brightness() const -{ - Q_D(); - return d->brightness; -} - -bool OutputChangeSet::transformChanged() const -{ - Q_D(); - return d->transform != d->o->transform(); -} - -OutputDeviceInterface::Transform OutputChangeSet::transform() const -{ - Q_D(); - return d->transform; -} -bool OutputChangeSet::positionChanged() const -{ - Q_D(); - return d->position != d->o->globalPosition(); -} - -QPoint OutputChangeSet::position() const -{ - Q_D(); - return d->position; -} - -bool OutputChangeSet::scaleChanged() const -{ - Q_D(); - return !qFuzzyCompare(d->scale, d->o->scaleF()); -} - -int OutputChangeSet::scale() const -{ - Q_D(); - return qRound(d->scale); -} - -qreal OutputChangeSet::scaleF() const -{ - Q_D(); - return d->scale; -} - -bool OutputChangeSet::colorCurvesChanged() const -{ - Q_D(); - return d->colorCurves != d->o->colorCurves(); -} - -OutputDeviceInterface::ColorCurves OutputChangeSet::colorCurves() const -{ - Q_D(); - return d->colorCurves; -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/outputchangeset.h dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset.h --- dwayland-5.57.0.23/src/server/outputchangeset.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ - -#ifndef WAYLAND_SERVER_OUTPUT_CHANGESET_H -#define WAYLAND_SERVER_OUTPUT_CHANGESET_H - -#include - -#include "outputdevice_interface.h" -#include - -namespace KWayland -{ -namespace Server -{ - -/** - * @brief Holds a set of changes to an OutputInterface or OutputDeviceInterface. - * - * This class implements a set of changes that the compositor can apply to an - * OutputInterface after OutputConfiguration::apply has been called on the client - * side. The changes are per-configuration. - * - * @see OutputConfiguration - * @since 5.5 - **/ -class KWAYLANDSERVER_EXPORT OutputChangeSet : public QObject -{ - Q_OBJECT -public: - virtual ~OutputChangeSet(); - - /** Whether the enabled() property of the outputdevice changed. - * @returns @c true if the enabled property of the outputdevice has changed. - */ - bool enabledChanged() const; - /** Whether the currentModeId() property of the outputdevice changed. - * @returns @c true if the enabled property of the outputdevice has changed. - * bool modeChanged() const; - */ - /** Whether the transform() property of the outputdevice changed. */ - bool transformChanged() const; - /** Whether the currentModeId() property of the outputdevice changed. - * @returns @c true if the currentModeId() property of the outputdevice has changed. - */ - bool modeChanged() const; - /** Whether the globalBrightness() property of the outputdevice changed. - * @returns @c true if the globalBrightness() property of the outputdevice has changed. - */ - bool brightnessChanged() const; - /** Whether the globalPosition() property of the outputdevice changed. - * @returns @c true if the globalPosition() property of the outputdevice has changed. - */ - bool positionChanged() const; - /** Whether the scale() property of the outputdevice changed. - * @returns @c true if the scale() property of the outputdevice has changed. - */ - bool scaleChanged() const; - /** Whether the colorCurves() property of the outputdevice changed. - * @returns @c true if the colorCurves() property of the outputdevice has changed. - */ - bool colorCurvesChanged() const; - - /** The new value for enabled. */ - OutputDeviceInterface::Enablement enabled() const; - /** The new mode id.*/ - int mode() const; - int brightness() const; - /** The new value for transform. */ - OutputDeviceInterface::Transform transform() const; - /** The new value for globalPosition. */ - QPoint position() const; - /** The new value for scale. - @deprecated see scaleF - */ - int scale() const; - /** The new value for scale. - * @since 5.XX - */ - qreal scaleF() const; - /** The new value for colorCurves. - * @since 5.XX - */ - OutputDeviceInterface::ColorCurves colorCurves() const; - -private: - friend class OutputConfigurationInterface; - explicit OutputChangeSet(OutputDeviceInterface *outputdevice, QObject *parent = nullptr); - - - class Private; - QScopedPointer d; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/outputchangeset_p.h dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_p.h --- dwayland-5.57.0.23/src/server/outputchangeset_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ -#ifndef KWAYLAND_SERVER_OUTPUTCHANGESET_P_H -#define KWAYLAND_SERVER_OUTPUTCHANGESET_P_H - -#include "outputchangeset.h" - -namespace KWayland -{ - namespace Server - { - - class OutputChangeSet::Private - { - public: - Private(OutputDeviceInterface *outputdevice, OutputChangeSet *parent); - ~Private(); - - OutputChangeSet *q; - OutputDeviceInterface *o; - - OutputDeviceInterface::Enablement enabled; - int modeId; - int brightness; - OutputDeviceInterface::Transform transform; - QPoint position; - qreal scale; - OutputDeviceInterface::ColorCurves colorCurves; - }; - } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/outputchangeset_v2.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2.cpp --- dwayland-5.57.0.23/src/server/outputchangeset_v2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,141 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "outputchangeset_v2.h" +#include "outputchangeset_v2_p.h" +#include + +namespace KWaylandServer +{ + +OutputChangeSetV2Private::OutputChangeSetV2Private(OutputDeviceV2Interface *outputdevice, OutputChangeSetV2 *parent) + : q(parent) + , outputDevice(outputdevice) + , enabled(outputDevice->enabled()) + , size(outputDevice->pixelSize()) + , refreshRate(outputDevice->refreshRate()) + , transform(outputDevice->transform()) + , position(outputDevice->globalPosition()) + , scale(outputDevice->scale()) + , overscan(outputDevice->overscan()) + , brightness(outputDevice->brightness()) +{ +} + +OutputChangeSetV2::OutputChangeSetV2(OutputDeviceV2Interface *outputdevice, QObject *parent) + : QObject(parent) + , d(new OutputChangeSetV2Private(outputdevice, this)) +{ +} + +OutputChangeSetV2::~OutputChangeSetV2() = default; + +bool OutputChangeSetV2::enabledChanged() const +{ + if (d->outputDevice != NULL) { + return d->enabled != d->outputDevice->enabled(); + } else { + qDebug()<<"enabledChanged d->outputDevice is NULL"; + return false; + } +} + +bool OutputChangeSetV2::enabled() const +{ + return d->enabled; +} + +QSize OutputChangeSetV2::size() const +{ + return d->size; +} + +bool OutputChangeSetV2::sizeChanged() const +{ + return d->size != d->outputDevice->pixelSize(); +} + +int OutputChangeSetV2::refreshRate() const +{ + return d->refreshRate; +} + +bool OutputChangeSetV2::refreshRateChanged() const +{ + return d->refreshRate != d->outputDevice->refreshRate(); +} + +bool OutputChangeSetV2::transformChanged() const +{ + return d->transform != d->outputDevice->transform(); +} + +OutputDeviceV2Interface::Transform OutputChangeSetV2::transform() const +{ + return d->transform; +} +bool OutputChangeSetV2::positionChanged() const +{ + return d->position != d->outputDevice->globalPosition(); +} + +QPoint OutputChangeSetV2::position() const +{ + return d->position; +} + +bool OutputChangeSetV2::scaleChanged() const +{ + return !qFuzzyCompare(d->scale, d->outputDevice->scale()); +} + +qreal OutputChangeSetV2::scale() const +{ + return d->scale; +} + +bool OutputChangeSetV2::overscanChanged() const +{ + return d->overscan != d->outputDevice->overscan(); +} + +uint32_t OutputChangeSetV2::overscan() const +{ + return d->overscan; +} + +bool OutputChangeSetV2::vrrPolicyChanged() const +{ + return d->vrrPolicy != d->outputDevice->vrrPolicy(); +} + +OutputDeviceV2Interface::VrrPolicy OutputChangeSetV2::vrrPolicy() const +{ + return d->vrrPolicy; +} + +bool OutputChangeSetV2::rgbRangeChanged() const +{ + return d->rgbRange != d->outputDevice->rgbRange(); +} + +OutputDeviceV2Interface::RgbRange OutputChangeSetV2::rgbRange() const +{ + return d->rgbRange; +} + +bool OutputChangeSetV2::brightnessChanged() const +{ + return d->brightness != d->outputDevice->brightness(); +} + +int OutputChangeSetV2::brightness() const +{ + return d->brightness; +} + +} diff -Nru dwayland-5.57.0.23/src/server/outputchangeset_v2.h dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2.h --- dwayland-5.57.0.23/src/server/outputchangeset_v2.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,123 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include "outputdevice_v2_interface.h" +#include + +namespace KWaylandServer +{ + +class OutputChangeSetV2Private; + +/** + * @brief Holds a set of changes to an OutputInterface or OutputDeviceInterface. + * + * This class implements a set of changes that the compositor can apply to an + * OutputInterface after OutputConfiguration::apply has been called on the client + * side. The changes are per-configuration. + * + * @see OutputConfiguration + */ +class KWAYLANDSERVER_EXPORT OutputChangeSetV2 : public QObject +{ + Q_OBJECT +public: + ~OutputChangeSetV2() override; + /** Whether the enabled() property of the outputdevice changed. + * @returns @c true if the enabled property of the outputdevice has changed. + */ + bool enabledChanged() const; + + /** Whether the transform() property of the outputdevice changed. + * @returns @c true if the enabled property of the outputdevice has changed. + * bool modeChanged() const; + */ + /** Whether the transform() property of the outputdevice changed. */ + bool transformChanged() const; + + /** Whether the size property of the outputdevice changed. + */ + bool sizeChanged() const; + + /** Whether the refreshRate property of the outputdevice changed. + */ + bool refreshRateChanged() const; + + /** Whether the globalPosition() property of the outputdevice changed. + * @returns @c true if the globalPosition() property of the outputdevice has changed. + */ + bool positionChanged() const; + + /** Whether the scale() property of the outputdevice changed. + * @returns @c true if the scale() property of the outputdevice has changed. + */ + bool scaleChanged() const; + + /** Whether the overscan() property of the outputdevice changed. + * @returns @c true if the overscan() property of the outputdevice has changed + */ + bool overscanChanged() const; + + /** + * Whether the vrrPolicy() property of the outputdevice changed. + * @returns @c true if the vrrPolicy() property of the outputdevice has changed. + */ + bool vrrPolicyChanged() const; + + /** + * Whether the rgbRange() property of the outputdevice changed. + * @returns @c true if the rgbRange() property of the outputdevice has changed. + */ + bool rgbRangeChanged() const; + + /** Whether the globalBrightness() property of the outputdevice changed. + * @returns @c true if the globalBrightness() property of the outputdevice has changed. + */ + bool brightnessChanged() const; + + /** The new value for enabled. */ + bool enabled() const; + + /** The new size */ + QSize size() const; + + /** The new refresh rate */ + int refreshRate() const; + + /** The new value for transform. */ + OutputDeviceV2Interface::Transform transform() const; + + /** The new value for globalPosition. */ + QPoint position() const; + + /** The new value for scale. + */ + qreal scale() const; + + /** the overscan value in % */ + uint32_t overscan() const; + + /** The new value for vrrPolicy */ + OutputDeviceV2Interface::VrrPolicy vrrPolicy() const; + + /** The new value for rgbRange */ + OutputDeviceV2Interface::RgbRange rgbRange() const; + + int brightness() const; + +private: + friend class OutputConfigurationV2InterfacePrivate; + explicit OutputChangeSetV2(OutputDeviceV2Interface *outputdevice, QObject *parent = nullptr); + + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/outputchangeset_v2_p.h dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2_p.h --- dwayland-5.57.0.23/src/server/outputchangeset_v2_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputchangeset_v2_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "outputchangeset_v2.h" + +namespace KWaylandServer +{ + +class OutputChangeSetV2Private +{ +public: + OutputChangeSetV2Private(OutputDeviceV2Interface *outputdevice, OutputChangeSetV2 *parent); + + OutputChangeSetV2 *q; + OutputDeviceV2Interface *outputDevice; + + bool enabled; + QSize size; + int refreshRate; + OutputDeviceV2Interface::Transform transform; + QPoint position; + qreal scale; + uint32_t overscan; + int brightness; + OutputDeviceV2Interface::VrrPolicy vrrPolicy = OutputDeviceV2Interface::VrrPolicy::Automatic; + OutputDeviceV2Interface::RgbRange rgbRange = OutputDeviceV2Interface::RgbRange::Automatic; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/outputconfiguration_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_interface.cpp --- dwayland-5.57.0.23/src/server/outputconfiguration_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,381 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2015 Sebastian Kügler - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "outputconfiguration_interface.h" -#include "outputdevice_interface.h" -#include "logging.h" -#include "resource_p.h" -#include "display.h" -#include "outputchangeset_p.h" - -#include -#include "wayland-output-management-server-protocol.h" -#include "wayland-org_kde_kwin_outputdevice-server-protocol.h" - -#include -#include - -namespace KWayland -{ -namespace Server -{ - - -class OutputConfigurationInterface::Private : public Resource::Private -{ -public: - Private(OutputConfigurationInterface *q, OutputManagementInterface *c, wl_resource *parentResource); - ~Private(); - - void sendApplied(); - void sendFailed(); - void emitConfigurationChangeRequested() const; - void clearPendingChanges(); - - bool hasPendingChanges(OutputDeviceInterface *outputdevice) const; - OutputChangeSet* pendingChanges(OutputDeviceInterface *outputdevice); - - OutputManagementInterface *outputManagement; - QHash changes; - - static const quint32 s_version = 2; - -private: - static void enableCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t enable); - static void modeCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t mode_id); - static void transformCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t transform); - static void positionCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t x, int32_t y); - static void scaleCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t scale); - static void applyCallback(wl_client *client, wl_resource *resource); - static void scaleFCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, wl_fixed_t scale); - static void colorcurvesCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, - wl_array *red, wl_array *green, wl_array *blue); - static void brightnessCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, int32_t brightness); - - OutputConfigurationInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct org_kde_kwin_outputconfiguration_interface s_interface; -}; - -const struct org_kde_kwin_outputconfiguration_interface OutputConfigurationInterface::Private::s_interface = { - enableCallback, - modeCallback, - transformCallback, - positionCallback, - scaleCallback, - applyCallback, - scaleFCallback, - colorcurvesCallback, - resourceDestroyedCallback, - brightnessCallback -}; - -OutputConfigurationInterface::OutputConfigurationInterface(OutputManagementInterface* parent, wl_resource* parentResource): Resource(new Private(this, parent, parentResource)) -{ - Q_D(); - d->outputManagement = parent; -} - -OutputConfigurationInterface::~OutputConfigurationInterface() -{ - Q_D(); - d->clearPendingChanges(); -} - -void OutputConfigurationInterface::Private::enableCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t enable) -{ - Q_UNUSED(client); - auto s = cast(resource); - Q_ASSERT(s); - auto _enable = (enable == ORG_KDE_KWIN_OUTPUTDEVICE_ENABLEMENT_ENABLED) ? - OutputDeviceInterface::Enablement::Enabled : - OutputDeviceInterface::Enablement::Disabled; - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - - s->pendingChanges(o)->d_func()->enabled = _enable; -} - -void OutputConfigurationInterface::Private::modeCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t mode_id) -{ - Q_UNUSED(client); - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - - bool modeValid = false; - for (const auto &m: o->modes()) { - if (m.id == mode_id) { - modeValid = true; - break; - } - } - if (!modeValid) { - qCWarning(KWAYLAND_SERVER) << "Set invalid mode id:" << mode_id; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - s->pendingChanges(o)->d_func()->modeId = mode_id; -} - -void OutputConfigurationInterface::Private::transformCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t transform) -{ - Q_UNUSED(client); - auto toTransform = [transform]() { - switch (transform) { - case WL_OUTPUT_TRANSFORM_90: - return OutputDeviceInterface::Transform::Rotated90; - case WL_OUTPUT_TRANSFORM_180: - return OutputDeviceInterface::Transform::Rotated180; - case WL_OUTPUT_TRANSFORM_270: - return OutputDeviceInterface::Transform::Rotated270; - case WL_OUTPUT_TRANSFORM_FLIPPED: - return OutputDeviceInterface::Transform::Flipped; - case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return OutputDeviceInterface::Transform::Flipped90; - case WL_OUTPUT_TRANSFORM_FLIPPED_180: - return OutputDeviceInterface::Transform::Flipped180; - case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return OutputDeviceInterface::Transform::Flipped270; - case WL_OUTPUT_TRANSFORM_NORMAL: - default: - return OutputDeviceInterface::Transform::Normal; - } - }; - auto _transform = toTransform(); - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - s->pendingChanges(o)->d_func()->transform = _transform; -} - -void OutputConfigurationInterface::Private::positionCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t x, int32_t y) -{ - Q_UNUSED(client); - auto _pos = QPoint(x, y); - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - s->pendingChanges(o)->d_func()->position = _pos; -} - -void OutputConfigurationInterface::Private::scaleCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t scale) -{ - Q_UNUSED(client); - if (scale <= 0) { - qCWarning(KWAYLAND_SERVER) << "Requested to scale output device to" << scale << ", but I can't do that."; - return; - } - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - s->pendingChanges(o)->d_func()->scale = scale; -} - -void OutputConfigurationInterface::Private::scaleFCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, wl_fixed_t scale_fixed) -{ - Q_UNUSED(client); - const qreal scale = wl_fixed_to_double(scale_fixed); - - if (scale <= 0) { - qCWarning(KWAYLAND_SERVER) << "Requested to scale output device to" << scale << ", but I can't do that."; - return; - } - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - - s->pendingChanges(o)->d_func()->scale = scale; -} - -void OutputConfigurationInterface::Private::applyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client); - auto s = cast(resource); - Q_ASSERT(s); - s->emitConfigurationChangeRequested(); -} - -void OutputConfigurationInterface::Private::colorcurvesCallback(wl_client *client, wl_resource *resource, - wl_resource * outputdevice, - wl_array *red, wl_array *green, wl_array *blue) -{ - Q_UNUSED(client); - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - OutputDeviceInterface::ColorCurves oldCc = o->colorCurves(); - - auto checkArg = [](const wl_array *newColor, const QVector &oldColor) { - return (newColor->size % sizeof(uint16_t) == 0) && - (newColor->size / sizeof(uint16_t) == static_cast(oldColor.size())); - }; - if (!checkArg(red, oldCc.red) || !checkArg(green, oldCc.green) || !checkArg(blue, oldCc.blue)) { - qCWarning(KWAYLAND_SERVER) << "Requested to change color curves, but have wrong size."; - return; - } - - auto s = cast(resource); - Q_ASSERT(s); - OutputDeviceInterface::ColorCurves cc; - - auto fillVector = [](const wl_array *array, QVector *v) { - const uint16_t *pos = (uint16_t*)array->data; - - while((char*)pos < (char*)array->data + array->size) { - v->append(*pos); - pos++; - } - }; - fillVector(red, &cc.red); - fillVector(green, &cc.green); - fillVector(blue, &cc.blue); - - s->pendingChanges(o)->d_func()->colorCurves = cc; -} - -void OutputConfigurationInterface::Private::brightnessCallback(wl_client *client, wl_resource *resource, wl_resource * outputdevice, int32_t brightness) -{ - Q_UNUSED(client); - OutputDeviceInterface *o = OutputDeviceInterface::get(outputdevice); - if (!o) { - qDebug() << "outputdevice is nullptr"; - return; - } - auto s = cast(resource); - Q_ASSERT(s); - s->pendingChanges(o)->d_func()->brightness = brightness; -} - -void OutputConfigurationInterface::Private::emitConfigurationChangeRequested() const -{ - auto configinterface = reinterpret_cast(q); - emit outputManagement->configurationChangeRequested(configinterface); -} - - -OutputConfigurationInterface::Private::Private(OutputConfigurationInterface *q, OutputManagementInterface *c, wl_resource *parentResource) -: Resource::Private(q, c, parentResource, &org_kde_kwin_outputconfiguration_interface, &s_interface) -{ -} - -OutputConfigurationInterface::Private::~Private() = default; - -OutputConfigurationInterface::Private *OutputConfigurationInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -QHash OutputConfigurationInterface::changes() const -{ - Q_D(); - return d->changes; -} - -void OutputConfigurationInterface::setApplied() -{ - Q_D(); - d->clearPendingChanges(); - d->sendApplied(); -} - -void OutputConfigurationInterface::Private::sendApplied() -{ - if (!resource) return; - org_kde_kwin_outputconfiguration_send_applied(resource); -} - -void OutputConfigurationInterface::setFailed() -{ - Q_D(); - d->clearPendingChanges(); - d->sendFailed(); -} - -void OutputConfigurationInterface::Private::sendFailed() -{ - if (!resource) return; - org_kde_kwin_outputconfiguration_send_failed(resource); -} - -OutputChangeSet* OutputConfigurationInterface::Private::pendingChanges(OutputDeviceInterface *outputdevice) -{ - if (!changes.keys().contains(outputdevice)) { - changes[outputdevice] = new OutputChangeSet(outputdevice, q); - } - return changes[outputdevice]; -} - -bool OutputConfigurationInterface::Private::hasPendingChanges(OutputDeviceInterface *outputdevice) const -{ - if (!changes.keys().contains(outputdevice)) { - return false; - } - auto c = changes[outputdevice]; - return c->enabledChanged() || - c->modeChanged() || - c->transformChanged() || - c->positionChanged() || - c->scaleChanged() || c->brightnessChanged(); -} - -void OutputConfigurationInterface::Private::clearPendingChanges() -{ - qDeleteAll(changes.begin(), changes.end()); - changes.clear(); -} - - -} -} diff -Nru dwayland-5.57.0.23/src/server/outputconfiguration_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_interface.h --- dwayland-5.57.0.23/src/server/outputconfiguration_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -/**************************************************************************** -* Copyright 2015 Sebastian Kügler -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) version 3, or any -* later version accepted by the membership of KDE e.V. (or its -* successor approved by the membership of KDE e.V.), which shall -* act as a proxy defined in Section 6 of version 3 of the license. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_OUTPUTCONFIGURATION_INTERFACE_H -#define KWAYLAND_SERVER_OUTPUTCONFIGURATION_INTERFACE_H - -#include "resource.h" -#include "outputmanagement_interface.h" -#include "outputdevice_interface.h" -#include "outputchangeset.h" - -#include - -namespace KWayland -{ -namespace Server -{ -/** @class OutputConfigurationInterface - * - * Holds a new configuration for the outputs. - * - * The overall mechanism is to get a new OutputConfiguration from the OutputManagement global and - * apply changes through the OutputConfiguration::set* calls. When all changes are set, the client - * calls apply, which asks the server to look at the changes and apply them. The server will then - * signal back whether the changes have been applied successfully (@c setApplied()) or were rejected - * or failed to apply (@c setFailed()). - * - * Once the client has called applied, the OutputManagementInterface send the configuration object - * to the compositor through the OutputManagement::configurationChangeRequested(OutputConfiguration*) - * signal, the compositor can then decide what to do with the changes. - * - * These KWayland classes will not apply changes to the OutputDevices, this is the compositor's - * task. As such, the configuration set through this interface can be seen as a hint what the - * compositor should set up, but whether or not the compositor does it (based on hardware or - * rendering policies, for example), is up to the compositor. The mode setting is passed on to - * the DRM subsystem through the compositor. The compositor also saves this configuration and reads - * it on startup, this interface is not involved in that process. - * - * @see OutputManagementInterface - * @see OutputConfiguration - * @since 5.5 - */ -class KWAYLANDSERVER_EXPORT OutputConfigurationInterface : public Resource -{ - Q_OBJECT -public: - virtual ~OutputConfigurationInterface(); - - /** - * Accessor for the changes made to OutputDevices. The data returned from this call - * will be deleted by the OutputConfigurationInterface when - * OutputManagementInterface::setApplied() or OutputManagementInterface::setFailed() - * is called, and on destruction of the OutputConfigurationInterface, so make sure you - * do not keep these pointers around. - * @returns A QHash of ChangeSets per outputdevice. - * @see ChangeSet - * @see OutputDeviceInterface - * @see OutputManagement - */ - QHash changes() const; - -public Q_SLOTS: - /** - * Called by the compositor once the changes have successfully been applied. - * The compositor is responsible for updating the OutputDevices. After having - * done so, calling this function sends applied() through the client. - * @see setFailed - * @see OutputConfiguration::applied - */ - void setApplied(); - /** - * Called by the compositor when the changes as a whole are rejected or - * failed to apply. This function results in the client OutputConfiguration emitting - * failed(). - * @see setApplied - * @see OutputConfiguration::failed - */ - void setFailed(); - -private: - explicit OutputConfigurationInterface(OutputManagementInterface *parent, wl_resource *parentResource); - friend class OutputManagementInterface; - - class Private; - Private *d_func() const; -}; - - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::OutputConfigurationInterface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/outputconfiguration_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_v2_interface.cpp --- dwayland-5.57.0.23/src/server/outputconfiguration_v2_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,315 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "display.h" +#include "outputconfiguration_v2_interface.h" +#include "outputdevice_v2_interface.h" +#include "logging.h" +#include "outputchangeset_v2_p.h" + +#include "qwayland-server-kde-output-management-v2.h" +#include "qwayland-server-kde-output-device-v2.h" + +#include + +namespace KWaylandServer +{ +class OutputConfigurationV2InterfacePrivate : public QtWaylandServer::kde_output_configuration_v2 +{ +public: + OutputConfigurationV2InterfacePrivate(OutputConfigurationV2Interface *q, OutputManagementV2Interface *outputManagement, wl_resource *resource); + + void sendApplied(); + void sendFailed(); + void emitConfigurationChangeRequested() const; + void clearPendingChanges(); + + bool hasPendingChanges(OutputDeviceV2Interface *outputdevice) const; + OutputChangeSetV2 *pendingChanges(OutputDeviceV2Interface *outputdevice); + + OutputManagementV2Interface *outputManagement; + QHash changes; + std::optional primaryOutput; + OutputConfigurationV2Interface *q; + +protected: + void kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) override; + void kde_output_configuration_v2_mode(Resource *resource, struct ::wl_resource *outputdevice, struct ::wl_resource *mode) override; + void kde_output_configuration_v2_transform(Resource *resource, wl_resource *outputdevice, int32_t transform) override; + void kde_output_configuration_v2_position(Resource *resource, wl_resource *outputdevice, int32_t x, int32_t y) override; + void kde_output_configuration_v2_scale(Resource *resource, wl_resource *outputdevice, wl_fixed_t scale) override; + void kde_output_configuration_v2_apply(Resource *resource) override; + void kde_output_configuration_v2_destroy(Resource *resource) override; + void kde_output_configuration_v2_destroy_resource(Resource *resource) override; + void kde_output_configuration_v2_overscan(Resource *resource, wl_resource *outputdevice, uint32_t overscan) override; + void kde_output_configuration_v2_set_vrr_policy(Resource *resource, struct ::wl_resource *outputdevice, uint32_t policy) override; + void kde_output_configuration_v2_set_rgb_range(Resource *resource, wl_resource *outputdevice, uint32_t rgbRange) override; + void kde_output_configuration_v2_set_primary_output(Resource *resource, struct ::wl_resource *output) override; + void kde_output_configuration_v2_brightness(Resource *resource, struct ::wl_resource *outputdevice, int32_t brightness); +}; + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) +{ + Q_UNUSED(resource) + + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->enabled = enable == 1; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_mode(Resource *resource, wl_resource *outputdevice, wl_resource *modeResource) +{ + Q_UNUSED(resource) + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + OutputDeviceModeV2Interface *mode = OutputDeviceModeV2Interface::get(modeResource); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + + pendingChanges(output)->d->size = mode->size(); + pendingChanges(output)->d->refreshRate = mode->refreshRate(); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_transform(Resource *resource, wl_resource *outputdevice, int32_t transform) +{ + Q_UNUSED(resource) + auto toTransform = [transform]() { + switch (transform) { + case WL_OUTPUT_TRANSFORM_90: + return OutputDeviceV2Interface::Transform::Rotated90; + case WL_OUTPUT_TRANSFORM_180: + return OutputDeviceV2Interface::Transform::Rotated180; + case WL_OUTPUT_TRANSFORM_270: + return OutputDeviceV2Interface::Transform::Rotated270; + case WL_OUTPUT_TRANSFORM_FLIPPED: + return OutputDeviceV2Interface::Transform::Flipped; + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + return OutputDeviceV2Interface::Transform::Flipped90; + case WL_OUTPUT_TRANSFORM_FLIPPED_180: + return OutputDeviceV2Interface::Transform::Flipped180; + case WL_OUTPUT_TRANSFORM_FLIPPED_270: + return OutputDeviceV2Interface::Transform::Flipped270; + case WL_OUTPUT_TRANSFORM_NORMAL: + default: + return OutputDeviceV2Interface::Transform::Normal; + } + }; + auto _transform = toTransform(); + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->transform = _transform; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_position(Resource *resource, wl_resource *outputdevice, int32_t x, int32_t y) +{ + Q_UNUSED(resource) + auto _pos = QPoint(x, y); + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->position = _pos; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_scale(Resource *resource, wl_resource *outputdevice, wl_fixed_t scale) +{ + Q_UNUSED(resource) + const qreal doubleScale = wl_fixed_to_double(scale); + + if (doubleScale <= 0) { + qCWarning(KWAYLAND_SERVER) << "Requested to scale output device to" << doubleScale << ", but I can't do that."; + return; + } + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + + pendingChanges(output)->d->scale = doubleScale; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_apply(Resource *resource) +{ + Q_UNUSED(resource) + emitConfigurationChangeRequested(); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_overscan(Resource *resource, wl_resource *outputdevice, uint32_t overscan) +{ + Q_UNUSED(resource) + if (overscan > 100) { + qCWarning(KWAYLAND_SERVER) << "Invalid overscan requested:" << overscan; + return; + } + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->overscan = overscan; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_set_vrr_policy(Resource *resource, wl_resource *outputdevice, uint32_t policy) +{ + Q_UNUSED(resource) + if (policy > static_cast(OutputDeviceV2Interface::VrrPolicy::Automatic)) { + qCWarning(KWAYLAND_SERVER) << "Invalid Vrr Policy requested:" << policy; + return; + } + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->vrrPolicy = static_cast(policy); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_set_rgb_range(Resource *resource, wl_resource *outputdevice, uint32_t rgbRange) +{ + Q_UNUSED(resource) + if (rgbRange > static_cast(OutputDeviceV2Interface::RgbRange::Limited)) { + qCWarning(KWAYLAND_SERVER) << "Invalid Rgb Range requested:" << rgbRange; + return; + } + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->rgbRange = static_cast(rgbRange); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_set_primary_output(Resource *resource, struct ::wl_resource *output) +{ + Q_UNUSED(resource); + primaryOutput = OutputDeviceV2Interface::get(output); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_brightness(Resource *resource, struct ::wl_resource *outputdevice, int32_t brightness) +{ + Q_UNUSED(resource); + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); + if (!output) { + qDebug() << "outputdevice is nullptr"; + return; + } + pendingChanges(output)->d->brightness = brightness; +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +void OutputConfigurationV2InterfacePrivate::emitConfigurationChangeRequested() const +{ + Q_EMIT outputManagement->configurationChangeRequested(q); +} + +OutputConfigurationV2InterfacePrivate::OutputConfigurationV2InterfacePrivate(OutputConfigurationV2Interface *q, OutputManagementV2Interface *outputManagement, wl_resource *resource) + : QtWaylandServer::kde_output_configuration_v2(resource) + , outputManagement(outputManagement) + , q(q) +{ +} + +QHash OutputConfigurationV2Interface::changes() const +{ + return d->changes; +} + +bool OutputConfigurationV2Interface::primaryChanged() const +{ + return d->primaryOutput.has_value(); +} + +OutputDeviceV2Interface *OutputConfigurationV2Interface::primary() const +{ + Q_ASSERT(d->primaryOutput.has_value()); + return *d->primaryOutput; +} + +void OutputConfigurationV2Interface::setApplied() +{ + d->clearPendingChanges(); + d->sendApplied(); +} + +void OutputConfigurationV2InterfacePrivate::sendApplied() +{ + send_applied(); +} + +void OutputConfigurationV2Interface::setFailed() +{ + d->clearPendingChanges(); + d->sendFailed(); +} + +void OutputConfigurationV2InterfacePrivate::sendFailed() +{ + send_failed(); +} + +OutputChangeSetV2 *OutputConfigurationV2InterfacePrivate::pendingChanges(OutputDeviceV2Interface *outputdevice) +{ + auto &change = changes[outputdevice]; + if (!change) { + change = new OutputChangeSetV2(outputdevice, q); + } + return change; +} + +bool OutputConfigurationV2InterfacePrivate::hasPendingChanges(OutputDeviceV2Interface *outputdevice) const +{ + auto it = changes.constFind(outputdevice); + if (it == changes.constEnd()) { + return false; + } + auto c = *it; + return c->enabledChanged() || + c->sizeChanged() || + c->refreshRateChanged() || + c->transformChanged() || + c->positionChanged() || + c->scaleChanged() || + c->brightnessChanged(); +} + +void OutputConfigurationV2InterfacePrivate::clearPendingChanges() +{ + qDeleteAll(changes.begin(), changes.end()); + changes.clear(); +} + +OutputConfigurationV2Interface::OutputConfigurationV2Interface(OutputManagementV2Interface *parent, wl_resource *resource) + : QObject() + , d(new OutputConfigurationV2InterfacePrivate(this, parent, resource)) +{ +} + +OutputConfigurationV2Interface::~OutputConfigurationV2Interface() +{ + d->clearPendingChanges(); +} + +} diff -Nru dwayland-5.57.0.23/src/server/outputconfiguration_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_v2_interface.h --- dwayland-5.57.0.23/src/server/outputconfiguration_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputconfiguration_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,94 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "outputmanagement_v2_interface.h" +#include "outputdevice_v2_interface.h" +#include "outputchangeset_v2.h" + +#include + +namespace KWaylandServer +{ + +class OutputConfigurationV2InterfacePrivate; + +/** @class OutputConfigurationInterface + * + * Holds a new configuration for the outputs. + * + * The overall mechanism is to get a new OutputConfiguration from the OutputManagement global and + * apply changes through the OutputConfiguration::set* calls. When all changes are set, the client + * calls apply, which asks the server to look at the changes and apply them. The server will then + * signal back whether the changes have been applied successfully (@c setApplied()) or were rejected + * or failed to apply (@c setFailed()). + * + * Once the client has called applied, the OutputManagementInterface send the configuration object + * to the compositor through the OutputManagement::configurationChangeRequested(OutputConfiguration*) + * signal, the compositor can then decide what to do with the changes. + * + * These KWayland classes will not apply changes to the OutputDevices, this is the compositor's + * task. As such, the configuration set through this interface can be seen as a hint what the + * compositor should set up, but whether or not the compositor does it (based on hardware or + * rendering policies, for example), is up to the compositor. The mode setting is passed on to + * the DRM subsystem through the compositor. The compositor also saves this configuration and reads + * it on startup, this interface is not involved in that process. + * + * @see OutputManagementInterface + * @see OutputConfiguration + */ +class KWAYLANDSERVER_EXPORT OutputConfigurationV2Interface : public QObject +{ + Q_OBJECT +public: + ~OutputConfigurationV2Interface() override; + + /** + * Accessor for the changes made to OutputDevices. The data returned from this call + * will be deleted by the OutputConfigurationInterface when + * OutputManagementInterface::setApplied() or OutputManagementInterface::setFailed() + * is called, and on destruction of the OutputConfigurationInterface, so make sure you + * do not keep these pointers around. + * @returns A QHash of ChangeSets per outputdevice. + * @see ChangeSet + * @see OutputDeviceInterface + * @see OutputManagement + */ + QHash changes() const; + + bool primaryChanged() const; + OutputDeviceV2Interface *primary() const; + +public Q_SLOTS: + /** + * Called by the compositor once the changes have successfully been applied. + * The compositor is responsible for updating the OutputDevices. After having + * done so, calling this function sends applied() through the client. + * @see setFailed + * @see OutputConfiguration::applied + */ + void setApplied(); + /** + * Called by the compositor when the changes as a whole are rejected or + * failed to apply. This function results in the client OutputConfiguration emitting + * failed(). + * @see setApplied + * @see OutputConfiguration::failed + */ + void setFailed(); + +private: + explicit OutputConfigurationV2Interface(OutputManagementV2Interface *parent, wl_resource *resource); + friend class OutputManagementV2InterfacePrivate; + + QScopedPointer d; +}; + + +} + +Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface*) diff -Nru dwayland-5.57.0.23/src/server/outputdevice_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_interface.cpp --- dwayland-5.57.0.23/src/server/outputdevice_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,757 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "outputdevice_interface.h" -#include "global_p.h" -#include "display.h" -#include "logging.h" - -#include -#include "wayland-org_kde_kwin_outputdevice-server-protocol.h" -#include - -namespace KWayland -{ -namespace Server -{ - -class OutputDeviceInterface::Private : public Global::Private -{ -public: - struct ResourceData { - wl_resource *resource; - uint32_t version; - }; - Private(OutputDeviceInterface *q, Display *d); - ~Private(); - - - void updateGeometry(); - void updateUuid(); - void updateEdid(); - void updateEnabled(); - void updateScale(); - void updateColorCurves(); - void updateEisaId(); - void updateSerialNumber(); - - void sendGeometry(wl_resource *resource); - void sendMode(wl_resource *resource, const Mode &mode); - void sendDone(const ResourceData &data); - void sendUuid(const ResourceData &data); - void sendEdid(const ResourceData &data); - void sendEnabled(const ResourceData &data); - void sendScale(const ResourceData &data); - void sendColorCurves(const ResourceData &data); - void sendEisaId(const ResourceData &data); - void sendSerialNumber(const ResourceData &data); - - QSize physicalSize; - QPoint globalPosition; - QString manufacturer = QStringLiteral("org.kde.kwin"); - QString model = QStringLiteral("none"); - qreal scale = 1.0; - int brightness = 60; - QString serialNumber; - QString eisaId; - SubPixel subPixel = SubPixel::Unknown; - Transform transform = Transform::Normal; - ColorCurves colorCurves; - QList modes; - QList resources; - - QByteArray edid; - Enablement enabled = Enablement::Enabled; - QByteArray uuid; - - static OutputDeviceInterface *get(wl_resource *native); - -private: - static Private *cast(wl_resource *native); - static void unbind(wl_resource *resource); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - int32_t toTransform() const; - int32_t toSubPixel() const; - - static const quint32 s_version; - OutputDeviceInterface *q; - static QVector s_privates; -}; - -const quint32 OutputDeviceInterface::Private::s_version = 2; - -QVector OutputDeviceInterface::Private::s_privates; - -OutputDeviceInterface::Private::Private(OutputDeviceInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_outputdevice_interface, s_version) - , q(q) -{ - s_privates << this; -} - -OutputDeviceInterface::Private::~Private() -{ - s_privates.removeAll(this); -} - -OutputDeviceInterface *OutputDeviceInterface::Private::get(wl_resource *native) -{ - if (Private *p = cast(native)) { - return p->q; - } - return nullptr; -} - -OutputDeviceInterface::Private *OutputDeviceInterface::Private::cast(wl_resource *native) -{ - for (auto it = s_privates.constBegin(); it != s_privates.constEnd(); ++it) { - const auto &resources = (*it)->resources; - auto rit = std::find_if(resources.begin(), resources.end(), [native] (const ResourceData &data) { return data.resource == native; }); - if (rit != resources.end()) { - return (*it); - } - } - return nullptr; -} - -OutputDeviceInterface::OutputDeviceInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ - Q_D(); - connect(this, &OutputDeviceInterface::currentModeChanged, this, - [this, d] { - auto currentModeIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(), [](const Mode &mode) { return mode.flags.testFlag(ModeFlag::Current); }); - if (currentModeIt == d->modes.constEnd()) { - return; - } - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - d->sendMode((*it).resource, *currentModeIt); - d->sendDone(*it); - } - wl_display_flush_clients(*(d->display)); - } - ); - connect(this, &OutputDeviceInterface::subPixelChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputDeviceInterface::transformChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputDeviceInterface::globalPositionChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputDeviceInterface::modelChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputDeviceInterface::manufacturerChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputDeviceInterface::scaleFChanged, this, [this, d] { d->updateScale(); }); - connect(this, &OutputDeviceInterface::scaleChanged, this, [this, d] { d->updateScale(); }); - connect(this, &OutputDeviceInterface::colorCurvesChanged, this, [this, d] { d->updateColorCurves(); }); -} - -OutputDeviceInterface::~OutputDeviceInterface() = default; - -QSize OutputDeviceInterface::pixelSize() const -{ - Q_D(); - auto it = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (it == d->modes.end()) { - return QSize(); - } - return (*it).size; -} - -OutputDeviceInterface *OutputDeviceInterface::get(wl_resource* native) -{ - return Private::get(native); -} - -int OutputDeviceInterface::refreshRate() const -{ - Q_D(); - auto it = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (it == d->modes.end()) { - return 60000; - } - return (*it).refreshRate; -} - -void OutputDeviceInterface::addMode(Mode &mode) -{ - Q_ASSERT(!isValid()); - Q_D(); - - - auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (currentModeIt == d->modes.end() && !mode.flags.testFlag(ModeFlag::Current)) { - // no mode with current flag - enforce - mode.flags |= ModeFlag::Current; - } - if (currentModeIt != d->modes.end() && mode.flags.testFlag(ModeFlag::Current)) { - // another mode has the current flag - remove - (*currentModeIt).flags &= ~uint(ModeFlag::Current); - } - - if (mode.flags.testFlag(ModeFlag::Preferred)) { - // remove from existing Preferred mode - auto preferredIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Preferred); - } - ); - if (preferredIt != d->modes.end()) { - (*preferredIt).flags &= ~uint(ModeFlag::Preferred); - } - } - - auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [mode](const Mode &mode_it) { - return mode.size == mode_it.size && - mode.refreshRate == mode_it.refreshRate; - } - ); - auto emitChanges = [this,mode] { - emit modesChanged(); - if (mode.flags.testFlag(ModeFlag::Current)) { - emit refreshRateChanged(mode.refreshRate); - emit pixelSizeChanged(mode.size); - emit currentModeChanged(); - } - }; - if (existingModeIt != d->modes.end()) { - if ((*existingModeIt).flags == mode.flags || - (*existingModeIt).flags.testFlag(ModeFlag::Current)) { - // no need to replace - return; - } - - (*existingModeIt).flags = mode.flags; - emitChanges(); - return; - } else { - auto idIt = std::find_if(d->modes.begin(), d->modes.end(), - [mode](const Mode &mode_it) { - return mode.id == mode_it.id; - } - ); - if (idIt != d->modes.end()) { - qCWarning(KWAYLAND_SERVER) << "Duplicate Mode id" << mode.id << ": not adding mode" << mode.size << mode.refreshRate; - return; - } - - } - d->modes << mode; - emitChanges(); -} - -void OutputDeviceInterface::setCurrentMode(const int modeId) -{ - Q_D(); - auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (currentModeIt != d->modes.end()) { - // another mode has the current flag - remove - (*currentModeIt).flags &= ~uint(ModeFlag::Current); - } - - auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [modeId](const Mode &mode) { - return mode.id == modeId; - } - ); - - Q_ASSERT(existingModeIt != d->modes.end()); - (*existingModeIt).flags |= ModeFlag::Current; - emit modesChanged(); - emit refreshRateChanged((*existingModeIt).refreshRate); - emit pixelSizeChanged((*existingModeIt).size); - emit currentModeChanged(); -} - -int32_t OutputDeviceInterface::Private::toTransform() const -{ - switch (transform) { - case Transform::Normal: - return WL_OUTPUT_TRANSFORM_NORMAL; - case Transform::Rotated90: - return WL_OUTPUT_TRANSFORM_90; - case Transform::Rotated180: - return WL_OUTPUT_TRANSFORM_180; - case Transform::Rotated270: - return WL_OUTPUT_TRANSFORM_270; - case Transform::Flipped: - return WL_OUTPUT_TRANSFORM_FLIPPED; - case Transform::Flipped90: - return WL_OUTPUT_TRANSFORM_FLIPPED_90; - case Transform::Flipped180: - return WL_OUTPUT_TRANSFORM_FLIPPED_180; - case Transform::Flipped270: - return WL_OUTPUT_TRANSFORM_FLIPPED_270; - } - abort(); -} - -int32_t OutputDeviceInterface::Private::toSubPixel() const -{ - switch (subPixel) { - case SubPixel::Unknown: - return WL_OUTPUT_SUBPIXEL_UNKNOWN; - case SubPixel::None: - return WL_OUTPUT_SUBPIXEL_NONE; - case SubPixel::HorizontalRGB: - return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; - case SubPixel::HorizontalBGR: - return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; - case SubPixel::VerticalRGB: - return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; - case SubPixel::VerticalBGR: - return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; - } - abort(); -} - -void OutputDeviceInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_outputdevice_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_user_data(resource, this); - wl_resource_set_destructor(resource, unbind); - ResourceData r; - r.resource = resource; - r.version = version; - resources << r; - - sendGeometry(resource); - sendScale(r); - sendColorCurves(r); - sendEisaId(r); - sendSerialNumber(r); - - auto currentModeIt = modes.constEnd(); - for (auto it = modes.constBegin(); it != modes.constEnd(); ++it) { - const Mode &mode = *it; - if (mode.flags.testFlag(ModeFlag::Current)) { - // needs to be sent as last mode - currentModeIt = it; - continue; - } - sendMode(resource, mode); - } - - if (currentModeIt != modes.constEnd()) { - sendMode(resource, *currentModeIt); - } - - sendUuid(r); - sendEdid(r); - sendEnabled(r); - - sendDone(r); - c->flush(); -} - -void OutputDeviceInterface::Private::unbind(wl_resource *resource) -{ - Private *o = cast(resource); - if (!o) { - return; - } - auto it = std::find_if(o->resources.begin(), o->resources.end(), [resource](const ResourceData &r) { return r.resource == resource; }); - if (it != o->resources.end()) { - o->resources.erase(it); - } -} - -void OutputDeviceInterface::Private::sendMode(wl_resource *resource, const Mode &mode) -{ - int32_t flags = 0; - if (mode.flags.testFlag(ModeFlag::Current)) { - flags |= WL_OUTPUT_MODE_CURRENT; - } - if (mode.flags.testFlag(ModeFlag::Preferred)) { - flags |= WL_OUTPUT_MODE_PREFERRED; - } - org_kde_kwin_outputdevice_send_mode(resource, - flags, - mode.size.width(), - mode.size.height(), - mode.refreshRate, - mode.id); - -} - -void OutputDeviceInterface::Private::sendGeometry(wl_resource *resource) -{ - org_kde_kwin_outputdevice_send_geometry(resource, - globalPosition.x(), - globalPosition.y(), - physicalSize.width(), - physicalSize.height(), - toSubPixel(), - qPrintable(manufacturer), - qPrintable(model), - toTransform()); -} - -void OutputDeviceInterface::Private::sendScale(const ResourceData &data) -{ - if (wl_resource_get_version(data.resource) < ORG_KDE_KWIN_OUTPUTDEVICE_SCALEF_SINCE_VERSION) { - org_kde_kwin_outputdevice_send_scale(data.resource, qRound(scale)); - } else { - org_kde_kwin_outputdevice_send_scalef(data.resource, wl_fixed_from_double(scale)); - } -} - -void OutputDeviceInterface::Private::sendColorCurves(const ResourceData &data) -{ - if (data.version < ORG_KDE_KWIN_OUTPUTDEVICE_COLORCURVES_SINCE_VERSION) { - return; - } - - wl_array wlRed, wlGreen, wlBlue; - - auto fillArray = [](const QVector &origin, wl_array *dest) { - wl_array_init(dest); - const size_t memLength = sizeof(uint16_t) * origin.size(); - void *s = wl_array_add(dest, memLength); - memcpy(s, origin.data(), memLength); - }; - fillArray(colorCurves.red, &wlRed); - fillArray(colorCurves.green, &wlGreen); - fillArray(colorCurves.blue, &wlBlue); - - org_kde_kwin_outputdevice_send_colorcurves(data.resource, &wlRed, &wlGreen, &wlBlue); - - wl_array_release(&wlRed); - wl_array_release(&wlGreen); - wl_array_release(&wlBlue); -} - -void KWayland::Server::OutputDeviceInterface::Private::sendSerialNumber(const ResourceData &data) -{ - if (wl_resource_get_version(data.resource) >= ORG_KDE_KWIN_OUTPUTDEVICE_SERIAL_NUMBER_SINCE_VERSION) { - org_kde_kwin_outputdevice_send_serial_number(data.resource, - qPrintable(serialNumber)); - } -} - -void KWayland::Server::OutputDeviceInterface::Private::sendEisaId(const ResourceData &data) -{ - if (wl_resource_get_version(data.resource) >= ORG_KDE_KWIN_OUTPUTDEVICE_EISA_ID_SINCE_VERSION) { - org_kde_kwin_outputdevice_send_eisa_id(data.resource, - qPrintable(eisaId)); - } -} - - -void OutputDeviceInterface::Private::sendDone(const ResourceData &data) -{ - org_kde_kwin_outputdevice_send_done(data.resource); -} - -void OutputDeviceInterface::Private::updateGeometry() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendGeometry((*it).resource); - sendDone(*it); - } -} - -void OutputDeviceInterface::Private::updateScale() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendScale(*it); - sendDone(*it); - } -} - -void OutputDeviceInterface::Private::updateColorCurves() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendColorCurves(*it); - sendDone(*it); - } -} - -bool OutputDeviceInterface::ColorCurves::operator==(const ColorCurves &cc) const -{ - return red == cc.red && green == cc.green && blue == cc.blue; -} -bool OutputDeviceInterface::ColorCurves::operator!=(const ColorCurves &cc) const { - return !operator==(cc); -} - -#define SETTER(setterName, type, argumentName) \ - void OutputDeviceInterface::setterName(type arg) \ - { \ - Q_D(); \ - if (d->argumentName == arg) { \ - return; \ - } \ - d->argumentName = arg; \ - emit argumentName##Changed(d->argumentName); \ - } - -SETTER(setPhysicalSize, const QSize&, physicalSize) -SETTER(setGlobalPosition, const QPoint&, globalPosition) -SETTER(setManufacturer, const QString&, manufacturer) -SETTER(setModel, const QString&, model) -SETTER(setSerialNumber, const QString&, serialNumber) -SETTER(setEisaId, const QString&, eisaId) -SETTER(setSubPixel, SubPixel, subPixel) -SETTER(setTransform, Transform, transform) - -#undef SETTER - -void OutputDeviceInterface::setScale(int scale) -{ - Q_D(); - if (d->scale == scale) { - return; - } - d->scale = scale; - emit scaleChanged(d->scale); - emit scaleFChanged(d->scale); -} - -void OutputDeviceInterface::setScaleF(qreal scale) -{ - Q_D(); - if (qFuzzyCompare(d->scale, scale)) { - return; - } - d->scale = scale; - emit scaleChanged(qRound(d->scale)); - emit scaleFChanged(d->scale); -} - -QSize OutputDeviceInterface::physicalSize() const -{ - Q_D(); - return d->physicalSize; -} - -QPoint OutputDeviceInterface::globalPosition() const -{ - Q_D(); - return d->globalPosition; -} - -QString OutputDeviceInterface::manufacturer() const -{ - Q_D(); - return d->manufacturer; -} - -QString OutputDeviceInterface::model() const -{ - Q_D(); - return d->model; -} - -QString OutputDeviceInterface::serialNumber() const -{ - Q_D(); - return d->serialNumber; -} - -QString OutputDeviceInterface::eisaId() const -{ - Q_D(); - return d->eisaId; -} - -int OutputDeviceInterface::scale() const -{ - Q_D(); - return qRound(d->scale); -} - -qreal OutputDeviceInterface::scaleF() const -{ - Q_D(); - return d->scale; -} - - -OutputDeviceInterface::SubPixel OutputDeviceInterface::subPixel() const -{ - Q_D(); - return d->subPixel; -} - -OutputDeviceInterface::Transform OutputDeviceInterface::transform() const -{ - Q_D(); - return d->transform; -} - -OutputDeviceInterface::ColorCurves OutputDeviceInterface::colorCurves() const -{ - Q_D(); - return d->colorCurves; -} - -QList< OutputDeviceInterface::Mode > OutputDeviceInterface::modes() const -{ - Q_D(); - return d->modes; -} - -int OutputDeviceInterface::currentModeId() const -{ - Q_D(); - for (const Mode &m: d->modes) { - if (m.flags.testFlag(OutputDeviceInterface::ModeFlag::Current)) { - return m.id; - } - } - return -1; -} - -int OutputDeviceInterface::brightness() const -{ - Q_D(); - return d->brightness; -} - -OutputDeviceInterface::Private *OutputDeviceInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -void OutputDeviceInterface::setColorCurves(const ColorCurves &colorCurves) -{ - Q_D(); - - if (d->colorCurves == colorCurves) { - return; - } - d->colorCurves = colorCurves; - emit colorCurvesChanged(d->colorCurves); -} - -void OutputDeviceInterface::setEdid(const QByteArray &edid) -{ - Q_D(); - d->edid = edid; - d->updateEdid(); - emit edidChanged(); -} - -QByteArray OutputDeviceInterface::edid() const -{ - Q_D(); - return d->edid; -} - -void OutputDeviceInterface::setEnabled(OutputDeviceInterface::Enablement enabled) -{ - Q_D(); - if (d->enabled != enabled) { - d->enabled = enabled; - d->updateEnabled(); - emit enabledChanged(); - } -} - -OutputDeviceInterface::Enablement OutputDeviceInterface::enabled() const -{ - Q_D(); - return d->enabled; -} - -void OutputDeviceInterface::setUuid(const QByteArray &uuid) -{ - Q_D(); - if (d->uuid != uuid) { - d->uuid = uuid; - d->updateUuid(); - emit uuidChanged(); - } -} - -QByteArray OutputDeviceInterface::uuid() const -{ - Q_D(); - return d->uuid; -} - -void KWayland::Server::OutputDeviceInterface::Private::sendEdid(const ResourceData &data) -{ - org_kde_kwin_outputdevice_send_edid(data.resource, - edid.toBase64().constData()); -} - -void KWayland::Server::OutputDeviceInterface::Private::sendEnabled(const ResourceData &data) -{ - int _enabled = 0; - if (enabled == OutputDeviceInterface::Enablement::Enabled) { - _enabled = 1; - } - org_kde_kwin_outputdevice_send_enabled(data.resource, _enabled); -} - -void OutputDeviceInterface::Private::sendUuid(const ResourceData &data) -{ - org_kde_kwin_outputdevice_send_uuid(data.resource, uuid.constData()); -} - -void KWayland::Server::OutputDeviceInterface::Private::updateEnabled() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendEnabled(*it); - } -} - -void KWayland::Server::OutputDeviceInterface::Private::updateEdid() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendEdid(*it); - } -} - -void KWayland::Server::OutputDeviceInterface::Private::updateUuid() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendUuid(*it); - } -} - -void KWayland::Server::OutputDeviceInterface::Private::updateEisaId() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendEisaId(*it); - } -} - - -} -} diff -Nru dwayland-5.57.0.23/src/server/outputdevice_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_interface.h --- dwayland-5.57.0.23/src/server/outputdevice_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,184 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H -#define WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H - -#include -#include -#include -#include - -#include -#include "global.h" - -struct wl_resource; - -namespace KWayland -{ -namespace Server -{ - -class Display; - -/** @class OutputDeviceInterface - * - * Represents an output device, the difference to Output is that this output can be disabled, - * so not currently used to display content. - * - * @see OutputManagementInterface - * @since 5.5 - */ -class KWAYLANDSERVER_EXPORT OutputDeviceInterface : public Global -{ - Q_OBJECT - Q_PROPERTY(QSize physicalSize READ physicalSize WRITE setPhysicalSize NOTIFY physicalSizeChanged) - Q_PROPERTY(QPoint globalPosition READ globalPosition WRITE setGlobalPosition NOTIFY globalPositionChanged) - Q_PROPERTY(QString manufacturer READ manufacturer WRITE setManufacturer NOTIFY manufacturerChanged) - Q_PROPERTY(QString model READ model WRITE setModel NOTIFY modelChanged) - Q_PROPERTY(QString serialNumber READ serialNumber WRITE setSerialNumber NOTIFY serialNumberChanged) - Q_PROPERTY(QString eisaId READ eisaId WRITE setEisaId NOTIFY eisaIdChanged) - Q_PROPERTY(QSize pixelSize READ pixelSize NOTIFY pixelSizeChanged) - Q_PROPERTY(int refreshRate READ refreshRate NOTIFY refreshRateChanged) - Q_PROPERTY(qreal scale READ scaleF WRITE setScaleF NOTIFY scaleFChanged) - Q_PROPERTY(QByteArray edid READ edid WRITE setEdid NOTIFY edidChanged) - Q_PROPERTY(OutputDeviceInterface::Enablement enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(QByteArray uuid READ uuid WRITE setUuid NOTIFY uuidChanged) -public: - enum class SubPixel { - Unknown, - None, - HorizontalRGB, - HorizontalBGR, - VerticalRGB, - VerticalBGR - }; - enum class Transform { - Normal, - Rotated90, - Rotated180, - Rotated270, - Flipped, - Flipped90, - Flipped180, - Flipped270 - }; - enum class Enablement { - Disabled = 0, - Enabled = 1 - }; - enum class ModeFlag { - Current = 1, - Preferred = 2 - }; - Q_DECLARE_FLAGS(ModeFlags, ModeFlag) - struct Mode { - QSize size = QSize(); - int refreshRate = 60000; - ModeFlags flags; - int id = -1; - }; - struct ColorCurves { - QVector red, green, blue; - bool operator==(const ColorCurves &cc) const; - bool operator!=(const ColorCurves &cc) const; - }; - virtual ~OutputDeviceInterface(); - - QSize physicalSize() const; - QPoint globalPosition() const; - QString manufacturer() const; - QString model() const; - QString serialNumber() const; - QString eisaId() const; - QSize pixelSize() const; - int refreshRate() const; - int scale() const; - qreal scaleF() const; - SubPixel subPixel() const; - Transform transform() const; - ColorCurves colorCurves() const; - QList modes() const; - int currentModeId() const; - int brightness() const; - - QByteArray edid() const; - OutputDeviceInterface::Enablement enabled() const; - QByteArray uuid() const; - - void setPhysicalSize(const QSize &size); - void setGlobalPosition(const QPoint &pos); - void setManufacturer(const QString &manufacturer); - void setModel(const QString &model); - void setSerialNumber(const QString &serialNumber); - void setEisaId(const QString &eisaId); - void setScale(int scale); - void setScaleF(qreal scale); - void setSubPixel(SubPixel subPixel); - void setTransform(Transform transform); - void setColorCurves(const ColorCurves &colorCurves); - void addMode(Mode &mode); - void setCurrentMode(const int modeId); - - void setEdid(const QByteArray &edid); - void setEnabled(OutputDeviceInterface::Enablement enabled); - void setUuid(const QByteArray &uuid); - - static OutputDeviceInterface *get(wl_resource *native); - static QListlist(); - -Q_SIGNALS: - void physicalSizeChanged(const QSize&); - void globalPositionChanged(const QPoint&); - void manufacturerChanged(const QString&); - void modelChanged(const QString&); - void serialNumberChanged(const QString&); - void eisaIdChanged(const QString &); - void pixelSizeChanged(const QSize&); - void refreshRateChanged(int); - //@deprecated see scaleChanged(real) - void scaleChanged(int); - void scaleFChanged(qreal); - void subPixelChanged(SubPixel); - void transformChanged(Transform); - void colorCurvesChanged(ColorCurves); - void modesChanged(); - void currentModeChanged(); - - void edidChanged(); - void enabledChanged(); - void uuidChanged(); - -private: - friend class Display; - explicit OutputDeviceInterface(Display *display, QObject *parent = nullptr); - class Private; - Private *d_func() const; -}; - -} -} - -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputDeviceInterface::ModeFlags) -Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Enablement) -Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::SubPixel) -Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Transform) -Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::ColorCurves) - -#endif diff -Nru dwayland-5.57.0.23/src/server/outputdevice_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_v2_interface.cpp --- dwayland-5.57.0.23/src/server/outputdevice_v2_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,790 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "outputdevice_v2_interface.h" + +#include "display_p.h" +#include "display.h" +#include "logging.h" +#include "utils.h" + +#include +#include +#include + +#include "qwayland-server-kde-output-device-v2.h" + +namespace KWaylandServer +{ +static const quint32 s_version = 2; + +class OutputDeviceV2InterfacePrivate : public QtWaylandServer::kde_output_device_v2 +{ +public: + OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display); + ~OutputDeviceV2InterfacePrivate() override; + + void updateGeometry(); + + void sendGeometry(Resource *resource); + wl_resource *sendNewMode(Resource *resource, OutputDeviceModeV2Interface *mode); + void sendCurrentMode(Resource *resource, OutputDeviceModeV2Interface *mode); + void sendDone(Resource *resource); + void sendUuid(Resource *resource); + void sendEdid(Resource *resource); + void sendEnabled(Resource *resource); + void sendScale(Resource *resource); + void sendEisaId(Resource *resource); + void sendName(Resource *resource); + void sendSerialNumber(Resource *resource); + void sendCapabilities(Resource *resource); + void sendOverscan(Resource *resource); + void sendVrrPolicy(Resource *resource); + void sendRgbRange(Resource *resource); + + QSize physicalSize; + QPoint globalPosition; + QString manufacturer = QStringLiteral("org.kde.kwin"); + QString model = QStringLiteral("none"); + qreal scale = 1.0; + int brightness = 60; + QString serialNumber; + QString eisaId; + QString name; + OutputDeviceV2Interface::SubPixel subPixel = OutputDeviceV2Interface::SubPixel::Unknown; + OutputDeviceV2Interface::Transform transform = OutputDeviceV2Interface::Transform::Normal; + + QList modes; + OutputDeviceModeV2Interface *currentMode = nullptr; + + QByteArray edid; + bool enabled = true; + QUuid uuid; + OutputDeviceV2Interface::Capabilities capabilities; + uint32_t overscan = 0; + OutputDeviceV2Interface::VrrPolicy vrrPolicy = OutputDeviceV2Interface::VrrPolicy::Automatic; + OutputDeviceV2Interface::RgbRange rgbRange = OutputDeviceV2Interface::RgbRange::Automatic; + + QPointer display; + OutputDeviceV2Interface *q; + +private: + int32_t toTransform() const; + int32_t toSubPixel() const; + +protected: + void kde_output_device_v2_bind_resource(Resource *resource) override; + void kde_output_device_v2_destroy_global() override; +}; + +class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2 +{ +public: + struct ModeResource : Resource { + OutputDeviceV2InterfacePrivate::Resource *output; + }; + + OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, const QSize &size, int refreshRate, OutputDeviceModeV2Interface::ModeFlags flags); + ~OutputDeviceModeV2InterfacePrivate() override; + + Resource *createResource(OutputDeviceV2InterfacePrivate::Resource *output); + Resource *findResource(OutputDeviceV2InterfacePrivate::Resource *output) const; + + void bindResource(wl_resource *resource); + + static OutputDeviceModeV2InterfacePrivate *get(OutputDeviceModeV2Interface *mode) { return mode->d.data(); } + + OutputDeviceModeV2Interface *q; + + QSize m_size; + int m_refreshRate = 60000; + OutputDeviceModeV2Interface::ModeFlags m_flags; + +protected: + Resource *kde_output_device_mode_v2_allocate() override; +}; + +OutputDeviceV2InterfacePrivate::OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display) + : QtWaylandServer::kde_output_device_v2(*display, s_version) + , display(display) + , q(q) +{ + DisplayPrivate *displayPrivate = DisplayPrivate::get(display); + displayPrivate->outputdevicesV2.append(q); +} + +OutputDeviceV2InterfacePrivate::~OutputDeviceV2InterfacePrivate() +{ + if (display) { + DisplayPrivate *displayPrivate = DisplayPrivate::get(display); + displayPrivate->outputdevicesV2.removeOne(q); + } +} + +OutputDeviceV2Interface::OutputDeviceV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new OutputDeviceV2InterfacePrivate(this, display)) +{ +} + +OutputDeviceV2Interface::~OutputDeviceV2Interface() +{ + d->globalRemove(); +} + +void OutputDeviceV2Interface::remove() +{ + if (d->isGlobalRemoved()) { + return; + } + + if (d->display) { + DisplayPrivate *displayPrivate = DisplayPrivate::get(d->display); + displayPrivate->outputdevicesV2.removeOne(this); + } + + d->globalRemove(); +} + +QSize OutputDeviceV2Interface::pixelSize() const +{ + if (d->currentMode == nullptr) { + return QSize(); + } + return d->currentMode->size(); +} + +int OutputDeviceV2Interface::refreshRate() const +{ + if (d->currentMode == nullptr) { + return 60000; + } + return d->currentMode->refreshRate(); +} + +void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode) +{ + if (mode == d->currentMode) { + return; + } + if (d->currentMode) { + // another mode has the current flag - remove + d->currentMode->setFlags(d->currentMode->flags() & ~uint(OutputDeviceModeV2Interface::ModeFlag::Current)); + } + + mode->setFlags(mode->flags() | OutputDeviceModeV2Interface::ModeFlag::Current); + d->currentMode = mode; + + const auto clientResources = d->resourceMap(); + for (auto it = clientResources.begin(); it != clientResources.end(); ++it) { + auto resource = *it; + d->sendCurrentMode(resource, d->currentMode); + d->sendDone(resource); + } + d->updateGeometry(); +} + +bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate) +{ + auto mode = std::find_if(d->modes.begin(), d->modes.end(), + [size, refreshRate](OutputDeviceModeV2Interface *mode) { + return mode->size() == size && mode->refreshRate() == refreshRate; + } + ); + if (mode == d->modes.end()) { + return false; + } + setCurrentMode(*mode); + return true; +} + +int32_t OutputDeviceV2InterfacePrivate::toTransform() const +{ + switch (transform) { + case OutputDeviceV2Interface::Transform::Normal: + return WL_OUTPUT_TRANSFORM_NORMAL; + case OutputDeviceV2Interface::Transform::Rotated90: + return WL_OUTPUT_TRANSFORM_90; + case OutputDeviceV2Interface::Transform::Rotated180: + return WL_OUTPUT_TRANSFORM_180; + case OutputDeviceV2Interface::Transform::Rotated270: + return WL_OUTPUT_TRANSFORM_270; + case OutputDeviceV2Interface::Transform::Flipped: + return WL_OUTPUT_TRANSFORM_FLIPPED; + case OutputDeviceV2Interface::Transform::Flipped90: + return WL_OUTPUT_TRANSFORM_FLIPPED_90; + case OutputDeviceV2Interface::Transform::Flipped180: + return WL_OUTPUT_TRANSFORM_FLIPPED_180; + case OutputDeviceV2Interface::Transform::Flipped270: + return WL_OUTPUT_TRANSFORM_FLIPPED_270; + default: + Q_UNREACHABLE(); + } +} + +int32_t OutputDeviceV2InterfacePrivate::toSubPixel() const +{ + switch (subPixel) { + case OutputDeviceV2Interface::SubPixel::Unknown: + return WL_OUTPUT_SUBPIXEL_UNKNOWN; + case OutputDeviceV2Interface::SubPixel::None: + return WL_OUTPUT_SUBPIXEL_NONE; + case OutputDeviceV2Interface::SubPixel::HorizontalRGB: + return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; + case OutputDeviceV2Interface::SubPixel::HorizontalBGR: + return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; + case OutputDeviceV2Interface::SubPixel::VerticalRGB: + return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; + case OutputDeviceV2Interface::SubPixel::VerticalBGR: + return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; + default: + Q_UNREACHABLE(); + } +} + +void OutputDeviceV2InterfacePrivate::kde_output_device_v2_destroy_global() +{ + delete q; +} + +void OutputDeviceV2InterfacePrivate::kde_output_device_v2_bind_resource(Resource *resource) +{ + sendGeometry(resource); + sendScale(resource); + sendEisaId(resource); + sendName(resource); + sendSerialNumber(resource); + + auto currentModeIt = modes.end(); + for (auto it = modes.begin(); it != modes.end(); ++it) { + auto &mode = *it; + if (mode->flags().testFlag(OutputDeviceModeV2Interface::ModeFlag::Current)) { + // needs to be sent as last mode + currentModeIt = it; + continue; + } + sendNewMode(resource, mode); + } + + if (currentModeIt != modes.end()) { + auto modeResource = sendNewMode(resource, *currentModeIt); + send_current_mode(resource->handle, modeResource); + } + + sendUuid(resource); + sendEdid(resource); + sendEnabled(resource); + sendCapabilities(resource); + sendOverscan(resource); + sendVrrPolicy(resource); + sendRgbRange(resource); + sendDone(resource); +} + +wl_resource *OutputDeviceV2InterfacePrivate::sendNewMode(Resource *resource, OutputDeviceModeV2Interface *mode) +{ + auto privateMode = OutputDeviceModeV2InterfacePrivate::get(mode); + // bind mode to client + const auto modeResource = privateMode->createResource(resource); + + send_mode(resource->handle, modeResource->handle); + + privateMode->bindResource(modeResource->handle); + + return modeResource->handle; +} + +void OutputDeviceV2InterfacePrivate::sendCurrentMode(Resource *outputResource, OutputDeviceModeV2Interface *mode) +{ + const auto modeResource = OutputDeviceModeV2InterfacePrivate::get(mode)->findResource(outputResource); + send_current_mode(outputResource->handle, modeResource->handle); +} + +void OutputDeviceV2InterfacePrivate::sendGeometry(Resource *resource) +{ + send_geometry(resource->handle, + globalPosition.x(), + globalPosition.y(), + physicalSize.width(), + physicalSize.height(), + toSubPixel(), + manufacturer, + model, + toTransform()); +} + +void OutputDeviceV2InterfacePrivate::sendScale(Resource *resource) +{ + send_scale(resource->handle, wl_fixed_from_double(scale)); +} + +void OutputDeviceV2InterfacePrivate::sendSerialNumber(Resource *resource) +{ + send_serial_number(resource->handle, serialNumber); +} + +void OutputDeviceV2InterfacePrivate::sendEisaId(Resource *resource) +{ + send_eisa_id(resource->handle, eisaId); +} + +void OutputDeviceV2InterfacePrivate::sendName(Resource *resource) +{ + if (resource->version() >= KDE_OUTPUT_DEVICE_V2_NAME_SINCE_VERSION) { + send_name(resource->handle, name); + } +} + +void OutputDeviceV2InterfacePrivate::sendDone(Resource *resource) +{ + send_done(resource->handle); +} + +void OutputDeviceV2InterfacePrivate::updateGeometry() +{ + const auto clientResources = resourceMap(); + for (const auto &resource : clientResources) { + sendGeometry(resource); + sendDone(resource); + } +} + +void OutputDeviceV2Interface::setPhysicalSize(const QSize &arg) +{ + if (d->physicalSize == arg) { + return; + } + d->physicalSize = arg; +} + +void OutputDeviceV2Interface::setGlobalPosition(const QPoint &arg) +{ + if (d->globalPosition == arg) { + return; + } + d->globalPosition = arg; + d->updateGeometry(); +} + +void OutputDeviceV2Interface::setManufacturer(const QString &arg) +{ + if (d->manufacturer == arg) { + return; + } + d->manufacturer = arg; +} + +void OutputDeviceV2Interface::setModel(const QString &arg) +{ + if (d->model == arg) { + return; + } + d->model = arg; +} + +void OutputDeviceV2Interface::setSerialNumber(const QString &arg) +{ + if (d->serialNumber == arg) { + return; + } + d->serialNumber = arg; +} + +void OutputDeviceV2Interface::setEisaId(const QString &arg) +{ + if (d->eisaId == arg) { + return; + } + d->eisaId = arg; +} + +void OutputDeviceV2Interface::setName(const QString &arg) +{ + if (d->name == arg) { + return; + } + d->name = arg; +} + +void OutputDeviceV2Interface::setSubPixel(SubPixel arg) +{ + if (d->subPixel == arg) { + return; + } + d->subPixel = arg; + d->updateGeometry(); +} + +void OutputDeviceV2Interface::setTransform(Transform arg) +{ + if (d->transform == arg) { + return; + } + d->transform = arg; + d->updateGeometry(); +} + +void OutputDeviceV2Interface::setScale(qreal scale) +{ + if (qFuzzyCompare(d->scale, scale)) { + return; + } + d->scale = scale; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendScale(resource); + d->sendDone(resource); + } +} + +QSize OutputDeviceV2Interface::physicalSize() const +{ + return d->physicalSize; +} + +QPoint OutputDeviceV2Interface::globalPosition() const +{ + return d->globalPosition; +} + +QString OutputDeviceV2Interface::manufacturer() const +{ + return d->manufacturer; +} + +QString OutputDeviceV2Interface::model() const +{ + return d->model; +} + +QString OutputDeviceV2Interface::serialNumber() const +{ + return d->serialNumber; +} + +QString OutputDeviceV2Interface::eisaId() const +{ + return d->eisaId; +} + +QString OutputDeviceV2Interface::name() const +{ + return d->name; +} + +qreal OutputDeviceV2Interface::scale() const +{ + return d->scale; +} + +OutputDeviceV2Interface::SubPixel OutputDeviceV2Interface::subPixel() const +{ + return d->subPixel; +} + +OutputDeviceV2Interface::Transform OutputDeviceV2Interface::transform() const +{ + return d->transform; +} + +int OutputDeviceV2Interface::brightness() const +{ + return d->brightness; +} + +void OutputDeviceV2Interface::setModes(const QList &modes) +{ + if (modes.isEmpty()) { + qCWarning(KWAYLAND_SERVER) << "Tried to set no modes for output"; + return; + } + + const auto clientResources = d->resourceMap(); + + const auto oldModes = d->modes; + d->modes.clear(); + d->currentMode = nullptr; + + for (OutputDeviceModeV2Interface *outputDeviceMode : modes) { + d->modes << outputDeviceMode; + outputDeviceMode->setParent(this); + + if (outputDeviceMode->flags().testFlag(OutputDeviceModeV2Interface::ModeFlag::Current)) { + d->currentMode = outputDeviceMode; + } else { + for (auto resource : clientResources) { + d->sendNewMode(resource, outputDeviceMode); + } + } + } + + if (!d->currentMode) { + d->currentMode = d->modes.at(0); + } + + for (auto resource : clientResources) { + d->sendNewMode(resource, d->currentMode); + d->sendCurrentMode(resource, d->currentMode); + } + + qDeleteAll(oldModes.crbegin(), oldModes.crend()); + + for (auto resource : clientResources) { + d->sendDone(resource); + } +} + +void OutputDeviceV2Interface::setEdid(const QByteArray &edid) +{ + d->edid = edid; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendEdid(resource); + d->sendDone(resource); + } +} + +QByteArray OutputDeviceV2Interface::edid() const +{ + return d->edid; +} + +void OutputDeviceV2Interface::setEnabled(bool enabled) +{ + if (d->enabled != enabled) { + d->enabled = enabled; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendEnabled(resource); + d->sendDone(resource); + } + } +} + +bool OutputDeviceV2Interface::enabled() const +{ + return d->enabled; +} + +void OutputDeviceV2Interface::setUuid(const QUuid &uuid) +{ + if (d->uuid != uuid) { + d->uuid = uuid; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendUuid(resource); + d->sendDone(resource); + } + } +} + +QUuid OutputDeviceV2Interface::uuid() const +{ + return d->uuid; +} + +void OutputDeviceV2InterfacePrivate::sendEdid(Resource *resource) +{ + send_edid(resource->handle, QString::fromStdString(edid.toBase64().toStdString())); +} + +void OutputDeviceV2InterfacePrivate::sendEnabled(Resource *resource) +{ + send_enabled(resource->handle, enabled); +} + +void OutputDeviceV2InterfacePrivate::sendUuid(Resource *resource) +{ + send_uuid(resource->handle, uuid.toString(QUuid::WithoutBraces)); +} + +uint32_t OutputDeviceV2Interface::overscan() const +{ + return d->overscan; +} + +OutputDeviceV2Interface::Capabilities OutputDeviceV2Interface::capabilities() const +{ + return d->capabilities; +} + +void OutputDeviceV2Interface::setCapabilities(Capabilities cap) +{ + if (d->capabilities != cap) { + d->capabilities = cap; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendCapabilities(resource); + d->sendDone(resource); + } + } +} + +void OutputDeviceV2InterfacePrivate::sendCapabilities(Resource *resource) +{ + send_capabilities(resource->handle, static_cast(capabilities)); +} + +void OutputDeviceV2Interface::setOverscan(uint32_t overscan) +{ + if (d->overscan != overscan) { + d->overscan = overscan; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendOverscan(resource); + d->sendDone(resource); + } + } +} + +void OutputDeviceV2InterfacePrivate::sendOverscan(Resource *resource) +{ + send_overscan(resource->handle, static_cast(overscan)); +} + +void OutputDeviceV2InterfacePrivate::sendVrrPolicy(Resource *resource) +{ + send_vrr_policy(resource->handle, static_cast(vrrPolicy)); +} + +OutputDeviceV2Interface::VrrPolicy OutputDeviceV2Interface::vrrPolicy() const +{ + return d->vrrPolicy; +} + +void OutputDeviceV2Interface::setVrrPolicy(VrrPolicy policy) +{ + if (d->vrrPolicy != policy) { + d->vrrPolicy = policy; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendVrrPolicy(resource); + d->sendDone(resource); + } + } +} + +OutputDeviceV2Interface::RgbRange OutputDeviceV2Interface::rgbRange() const +{ + return d->rgbRange; +} + +void OutputDeviceV2Interface::setRgbRange(RgbRange rgbRange) +{ + if (d->rgbRange != rgbRange) { + d->rgbRange = rgbRange; + const auto clientResources = d->resourceMap(); + for (const auto &resource : clientResources) { + d->sendRgbRange(resource); + d->sendDone(resource); + } + } +} + +void OutputDeviceV2InterfacePrivate::sendRgbRange(Resource *resource) +{ + send_rgb_range(resource->handle, static_cast(rgbRange)); +} + +wl_resource *OutputDeviceV2Interface::resource() const +{ + return d->resource()->handle; +} + +OutputDeviceV2Interface *OutputDeviceV2Interface::get(wl_resource *native) +{ + if (auto devicePrivate = resource_cast(native)) { + return devicePrivate->q; + } + return nullptr; +} + +OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, const QSize &size, int refreshRate, OutputDeviceModeV2Interface::ModeFlags flags) + : QtWaylandServer::kde_output_device_mode_v2() + , q(q) + , m_size(size) + , m_refreshRate(refreshRate) + , m_flags(flags) +{} + +OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent) + : QObject(parent) + , d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags)) +{} + +OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default; + +OutputDeviceModeV2InterfacePrivate::~OutputDeviceModeV2InterfacePrivate() +{ + const auto map = resourceMap(); + for (Resource *resource : map) { + send_removed(resource->handle); + } +} + +OutputDeviceModeV2InterfacePrivate::Resource *OutputDeviceModeV2InterfacePrivate::createResource(OutputDeviceV2InterfacePrivate::Resource *output) +{ + const auto modeResource = static_cast(add(output->client(), output->version())); + modeResource->output = output; + return modeResource; +} + +OutputDeviceModeV2InterfacePrivate::Resource *OutputDeviceModeV2InterfacePrivate::findResource(OutputDeviceV2InterfacePrivate::Resource *output) const +{ + const auto resources = resourceMap(); + for (const auto &resource : resources) { + auto modeResource = static_cast(resource); + if (modeResource->output == output) { + return resource; + } + } + return nullptr; +} + +OutputDeviceModeV2InterfacePrivate::Resource *OutputDeviceModeV2InterfacePrivate::kde_output_device_mode_v2_allocate() +{ + return new ModeResource; +} + +QSize OutputDeviceModeV2Interface::size() const +{ + return d->m_size; +} + +int OutputDeviceModeV2Interface::refreshRate() const +{ + return d->m_refreshRate; +} + +OutputDeviceModeV2Interface::ModeFlags OutputDeviceModeV2Interface::flags() const +{ + return d->m_flags; +} + +void OutputDeviceModeV2Interface::setFlags(OutputDeviceModeV2Interface::ModeFlags flags) +{ + d->m_flags = flags; +} + +void OutputDeviceModeV2InterfacePrivate::bindResource(wl_resource *resource) +{ + send_size(resource, m_size.width(), m_size.height()); + send_refresh(resource, m_refreshRate); + + if (m_flags.testFlag(OutputDeviceModeV2Interface::ModeFlag::Preferred)) { + send_preferred(resource); + } +} + +OutputDeviceModeV2Interface *OutputDeviceModeV2Interface::get(wl_resource *native) +{ + if (auto devicePrivate = resource_cast(native)) { + return devicePrivate->q; + } + return nullptr; +} + +} diff -Nru dwayland-5.57.0.23/src/server/outputdevice_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_v2_interface.h --- dwayland-5.57.0.23/src/server/outputdevice_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputdevice_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,183 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Méven Car + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include +#include +#include +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ + +class Display; +class OutputDeviceV2InterfacePrivate; +class OutputDeviceModeV2Interface; +class OutputDeviceModeV2InterfacePrivate; + + +/** @class OutputDeviceV2Interface + * + * Represents an output device, the difference to Output is that this output can be disabled, + * so not currently used to display content. + * + * @see OutputManagementV2Interface + */ +class KWAYLANDSERVER_EXPORT OutputDeviceV2Interface : public QObject +{ + Q_OBJECT +public: + enum class SubPixel { + Unknown, + None, + HorizontalRGB, + HorizontalBGR, + VerticalRGB, + VerticalBGR, + }; + Q_ENUM(SubPixel) + enum class Transform { + Normal, + Rotated90, + Rotated180, + Rotated270, + Flipped, + Flipped90, + Flipped180, + Flipped270, + }; + Q_ENUM(Transform) + enum class Capability { + Overscan = 0x1, + Vrr = 0x2, + RgbRange = 0x4, + }; + Q_ENUM(Capability) + Q_DECLARE_FLAGS(Capabilities, Capability) + enum class VrrPolicy { + Never = 0, + Always = 1, + Automatic = 2 + }; + Q_ENUM(VrrPolicy) + enum class RgbRange { + Automatic = 0, + Full = 1, + Limited = 2, + }; + Q_ENUM(RgbRange) + + explicit OutputDeviceV2Interface(Display *display, QObject *parent = nullptr); + ~OutputDeviceV2Interface() override; + + void remove(); + + QSize physicalSize() const; + QPoint globalPosition() const; + QString manufacturer() const; + QString model() const; + QString serialNumber() const; + QString eisaId() const; + QString name() const; + QSize pixelSize() const; + int refreshRate() const; + + qreal scale() const; + SubPixel subPixel() const; + Transform transform() const; + int brightness() const; + + QByteArray edid() const; + bool enabled() const; + QUuid uuid() const; + + Capabilities capabilities() const; + uint32_t overscan() const; + VrrPolicy vrrPolicy() const; + RgbRange rgbRange() const; + + void setPhysicalSize(const QSize &size); + void setGlobalPosition(const QPoint &pos); + void setManufacturer(const QString &manufacturer); + void setModel(const QString &model); + void setSerialNumber(const QString &serialNumber); + void setEisaId(const QString &eisaId); + void setName(const QString &name); + + void setScale(qreal scale); + void setSubPixel(SubPixel subPixel); + void setTransform(Transform transform); + + void setModes(const QList &modes); + void setCurrentMode(KWaylandServer::OutputDeviceModeV2Interface *mode); + + /** + * Makes the mode with the specified @a size and @a refreshRate current. + * Returns @c false if no mode with the given attributes exists; otherwise returns @c true. + */ + bool setCurrentMode(const QSize &size, int refreshRate); + + void setEdid(const QByteArray &edid); + void setEnabled(bool enabled); + void setUuid(const QUuid &uuid); + + void setCapabilities(Capabilities cap); + void setOverscan(uint32_t overscan); + void setVrrPolicy(VrrPolicy policy); + void setRgbRange(RgbRange rgbRange); + + wl_resource *resource() const; + static OutputDeviceV2Interface *get(wl_resource *native); + +private: + QScopedPointer d; +}; + +/** + * @class OutputDeviceModeV2Interface + * + * Represents an output device mode. + * +* @see OutputDeviceV2Interface + */ +class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject +{ + Q_OBJECT +public: + enum class ModeFlag { + Current = 0x1, + Preferred = 0x2, + }; + Q_ENUM(ModeFlag) + Q_DECLARE_FLAGS(ModeFlags, ModeFlag) + + OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent = nullptr); + ~OutputDeviceModeV2Interface() override; + + QSize size() const; + int refreshRate() const; + OutputDeviceModeV2Interface::ModeFlags flags() const; + + void setFlags(OutputDeviceModeV2Interface::ModeFlags newFlags); + + static OutputDeviceModeV2Interface *get(wl_resource *native); + +private: + friend class OutputDeviceModeV2InterfacePrivate; + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::OutputDeviceModeV2Interface::ModeFlag) +Q_DECLARE_METATYPE(KWaylandServer::OutputDeviceV2Interface::SubPixel) +Q_DECLARE_METATYPE(KWaylandServer::OutputDeviceV2Interface::Transform) diff -Nru dwayland-5.57.0.23/src/server/output_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/output_interface.cpp --- dwayland-5.57.0.23/src/server/output_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/output_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,580 +1,414 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "output_interface.h" -#include "global_p.h" #include "display.h" +#include "display_p.h" +#include "utils.h" -#include +#include "qwayland-server-wayland.h" -#include +#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const int s_version = 3; -class OutputInterface::Private : public Global::Private +class OutputInterfacePrivate : public QtWaylandServer::wl_output { public: - struct ResourceData { - wl_resource *resource; - uint32_t version; - }; - Private(OutputInterface *q, Display *d); - ~Private(); - void sendMode(wl_resource *resource, const Mode &mode); - void sendDone(const ResourceData &data); - void updateGeometry(); - void updateScale(); + explicit OutputInterfacePrivate(Display *display, OutputInterface *q); + + void sendScale(Resource *resource); + void sendGeometry(Resource *resource); + void sendMode(Resource *resource); + void sendDone(Resource *resource); + void broadcastGeometry(); + + OutputInterface *q; + QPointer display; QSize physicalSize; QPoint globalPosition; QString manufacturer = QStringLiteral("org.kde.kwin"); QString model = QStringLiteral("none"); int scale = 1; - SubPixel subPixel = SubPixel::Unknown; - Transform transform = Transform::Normal; - QList modes; - QList resources; + OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown; + OutputInterface::Transform transform = OutputInterface::Transform::Normal; + OutputInterface::Mode mode; struct { - DpmsMode mode = DpmsMode::On; + OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off; bool supported = false; } dpms; - static OutputInterface *get(wl_resource *native); - bool outputRemoved = false; - bool outputDisconnected = false; - private: - static Private *cast(wl_resource *native); - static void releaseCallback(wl_client *client, wl_resource *resource); - static void unbind(wl_resource *resource); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - int32_t toTransform() const; - int32_t toSubPixel() const; - void sendGeometry(wl_resource *resource); - void sendScale(const ResourceData &data); - - OutputInterface *q; - static QVector s_privates; - static const struct wl_output_interface s_interface; - static const quint32 s_version; + void output_destroy_global() override; + void output_bind_resource(Resource *resource) override; + void output_release(Resource *resource) override; }; -QVector OutputInterface::Private::s_privates; -const quint32 OutputInterface::Private::s_version = 3; - -OutputInterface::Private::Private(OutputInterface *q, Display *d) - : Global::Private(d, &wl_output_interface, s_version) +OutputInterfacePrivate::OutputInterfacePrivate(Display *display, OutputInterface *q) + : QtWaylandServer::wl_output(*display, s_version) , q(q) + , display(display) { - s_privates << this; } -OutputInterface::Private::~Private() +void OutputInterfacePrivate::sendMode(Resource *resource) { - s_privates.removeAll(this); + send_mode(resource->handle, mode_current, mode.size.width(), mode.size.height(), mode.refreshRate); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_output_interface OutputInterface::Private::s_interface = { - releaseCallback -}; -#endif - -void OutputInterface::Private::releaseCallback(wl_client *client, wl_resource *resource) +void OutputInterfacePrivate::sendScale(Resource *resource) { - Q_UNUSED(client); - unbind(resource); + if (resource->version() >= WL_OUTPUT_SCALE_SINCE_VERSION) { + send_scale(resource->handle, scale); + } } -OutputInterface *OutputInterface::Private::get(wl_resource *native) +static quint32 kwaylandServerTransformToWaylandTransform(OutputInterface::Transform transform) { - if (Private *p = cast(native)) { - return p->q; + switch (transform) { + case OutputInterface::Transform::Normal: + return OutputInterfacePrivate::transform_normal; + case OutputInterface::Transform::Rotated90: + return OutputInterfacePrivate::transform_90; + case OutputInterface::Transform::Rotated180: + return OutputInterfacePrivate::transform_180; + case OutputInterface::Transform::Rotated270: + return OutputInterfacePrivate::transform_270; + case OutputInterface::Transform::Flipped: + return OutputInterfacePrivate::transform_flipped; + case OutputInterface::Transform::Flipped90: + return OutputInterfacePrivate::transform_flipped_90; + case OutputInterface::Transform::Flipped180: + return OutputInterfacePrivate::transform_flipped_180; + case OutputInterface::Transform::Flipped270: + return OutputInterfacePrivate::transform_flipped_270; + default: + Q_UNREACHABLE(); } - return nullptr; } -OutputInterface::Private *OutputInterface::Private::cast(wl_resource *native) +static quint32 kwaylandServerSubPixelToWaylandSubPixel(OutputInterface::SubPixel subPixel) { - for (auto it = s_privates.constBegin(); it != s_privates.constEnd(); ++it) { - const auto &resources = (*it)->resources; - auto rit = std::find_if(resources.begin(), resources.end(), [native] (const ResourceData &data) { return data.resource == native; }); - if (rit != resources.end()) { - return (*it); - } + switch (subPixel) { + case OutputInterface::SubPixel::Unknown: + return OutputInterfacePrivate::subpixel_unknown; + case OutputInterface::SubPixel::None: + return OutputInterfacePrivate::subpixel_none; + case OutputInterface::SubPixel::HorizontalRGB: + return OutputInterfacePrivate::subpixel_horizontal_rgb; + case OutputInterface::SubPixel::HorizontalBGR: + return OutputInterfacePrivate::subpixel_horizontal_bgr; + case OutputInterface::SubPixel::VerticalRGB: + return OutputInterfacePrivate::subpixel_vertical_rgb; + case OutputInterface::SubPixel::VerticalBGR: + return OutputInterfacePrivate::subpixel_vertical_bgr; + default: + Q_UNREACHABLE(); } - return nullptr; } -OutputInterface::OutputInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +void OutputInterfacePrivate::sendGeometry(Resource *resource) { - Q_D(); - connect(this, &OutputInterface::currentModeChanged, this, - [this, d] { - auto currentModeIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(), [](const Mode &mode) { return mode.flags.testFlag(ModeFlag::Current); }); - if (currentModeIt == d->modes.constEnd()) { - return; - } - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - d->sendMode((*it).resource, *currentModeIt); - d->sendDone(*it); - } - wl_display_flush_clients(*(d->display)); - } - ); - connect(this, &OutputInterface::subPixelChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputInterface::transformChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputInterface::globalPositionChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputInterface::modelChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputInterface::manufacturerChanged, this, [this, d] { d->updateGeometry(); }); - connect(this, &OutputInterface::scaleChanged, this, [this, d] { d->updateScale(); }); - connect(this, &OutputInterface::hasDestroyedGlobal, this, [this, d] { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - wl_resource_set_destructor(it->resource, NULL); - wl_resource_set_user_data(it->resource, NULL); - } - d->resources.clear(); - // 控制中心的模式设置disable某个output也会走到这里销毁resources - // 所以这里加入一个outputDisconnected的判断,保证只有屏幕拔出才走这个逻辑 - if (d->outputDisconnected) { - d->outputRemoved = true; - } - } - ); + send_geometry(resource->handle, + globalPosition.x(), + globalPosition.y(), + physicalSize.width(), + physicalSize.height(), + kwaylandServerSubPixelToWaylandSubPixel(subPixel), + manufacturer, + model, + kwaylandServerTransformToWaylandTransform(transform)); } -OutputInterface::~OutputInterface() = default; +void OutputInterfacePrivate::sendDone(Resource *resource) +{ + if (resource->version() >= WL_OUTPUT_DONE_SINCE_VERSION) { + send_done(resource->handle); + } +} -QSize OutputInterface::pixelSize() const +void OutputInterfacePrivate::broadcastGeometry() { - Q_D(); - auto it = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (it == d->modes.end()) { - return QSize(); + const auto outputResources = resourceMap(); + for (Resource *resource : outputResources) { + sendGeometry(resource); } - return (*it).size; } -int OutputInterface::refreshRate() const +void OutputInterfacePrivate::output_destroy_global() { - Q_D(); - auto it = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (it == d->modes.end()) { - return 60000; - } - return (*it).refreshRate; -} - -void OutputInterface::addMode(const QSize &size, OutputInterface::ModeFlags flags, int refreshRate) -{ - Q_ASSERT(!isValid()); - Q_D(); - - auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (currentModeIt == d->modes.end() && !flags.testFlag(ModeFlag::Current)) { - // no mode with current flag - enforce - flags |= ModeFlag::Current; - } - if (currentModeIt != d->modes.end() && flags.testFlag(ModeFlag::Current)) { - // another mode has the current flag - remove - (*currentModeIt).flags &= ~uint(ModeFlag::Current); - } - - if (flags.testFlag(ModeFlag::Preferred)) { - // remove from existing Preferred mode - auto preferredIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Preferred); - } - ); - if (preferredIt != d->modes.end()) { - (*preferredIt).flags &= ~uint(ModeFlag::Preferred); - } - } - - auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [size,refreshRate](const Mode &mode) { - return mode.size == size && mode.refreshRate == refreshRate; - } - ); - auto emitChanges = [this,flags,size,refreshRate] { - emit modesChanged(); - if (flags.testFlag(ModeFlag::Current)) { - emit refreshRateChanged(refreshRate); - emit pixelSizeChanged(size); - emit currentModeChanged(); - } - }; - if (existingModeIt != d->modes.end()) { - if ((*existingModeIt).flags == flags) { - // nothing to do - return; - } - (*existingModeIt).flags = flags; - emitChanges(); - return; - } - Mode mode; - mode.size = size; - mode.refreshRate = refreshRate; - mode.flags = flags; - d->modes << mode; - emitChanges(); -} - -void OutputInterface::setCurrentMode(const QSize &size, int refreshRate) -{ - Q_D(); - auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [](const Mode &mode) { - return mode.flags.testFlag(ModeFlag::Current); - } - ); - if (currentModeIt != d->modes.end()) { - // another mode has the current flag - remove - (*currentModeIt).flags &= ~uint(ModeFlag::Current); - } - - auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(), - [size,refreshRate](const Mode &mode) { - return mode.size == size && mode.refreshRate == refreshRate; - } - ); - - Q_ASSERT(existingModeIt != d->modes.end()); - (*existingModeIt).flags |= ModeFlag::Current; - emit modesChanged(); - emit refreshRateChanged((*existingModeIt).refreshRate); - emit pixelSizeChanged((*existingModeIt).size); - emit currentModeChanged(); + delete q; } -int32_t OutputInterface::Private::toTransform() const +void OutputInterfacePrivate::output_release(Resource *resource) { - switch (transform) { - case Transform::Normal: - return WL_OUTPUT_TRANSFORM_NORMAL; - case Transform::Rotated90: - return WL_OUTPUT_TRANSFORM_90; - case Transform::Rotated180: - return WL_OUTPUT_TRANSFORM_180; - case Transform::Rotated270: - return WL_OUTPUT_TRANSFORM_270; - case Transform::Flipped: - return WL_OUTPUT_TRANSFORM_FLIPPED; - case Transform::Flipped90: - return WL_OUTPUT_TRANSFORM_FLIPPED_90; - case Transform::Flipped180: - return WL_OUTPUT_TRANSFORM_FLIPPED_180; - case Transform::Flipped270: - return WL_OUTPUT_TRANSFORM_FLIPPED_270; - } - abort(); + wl_resource_destroy(resource->handle); } -int32_t OutputInterface::Private::toSubPixel() const +void OutputInterfacePrivate::output_bind_resource(Resource *resource) { - switch (subPixel) { - case SubPixel::Unknown: - return WL_OUTPUT_SUBPIXEL_UNKNOWN; - case SubPixel::None: - return WL_OUTPUT_SUBPIXEL_NONE; - case SubPixel::HorizontalRGB: - return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; - case SubPixel::HorizontalBGR: - return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; - case SubPixel::VerticalRGB: - return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; - case SubPixel::VerticalBGR: - return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; - } - abort(); -} - -void OutputInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&wl_output_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_user_data(resource, this); - wl_resource_set_implementation(resource, &s_interface, this, unbind); - ResourceData r; - r.resource = resource; - r.version = version; - resources << r; - emit q->resourceChanged(); + if (isGlobalRemoved()) { + return; // We are waiting for the wl_output global to be destroyed. + } + sendMode(resource); + sendScale(resource); sendGeometry(resource); - sendScale(r); - - auto currentModeIt = modes.constEnd(); - for (auto it = modes.constBegin(); it != modes.constEnd(); ++it) { - const Mode &mode = *it; - if (mode.flags.testFlag(ModeFlag::Current)) { - // needs to be sent as last mode - currentModeIt = it; - continue; - } - sendMode(resource, mode); - } + sendDone(resource); - if (currentModeIt != modes.constEnd()) { - sendMode(resource, *currentModeIt); - } + Q_EMIT q->bound(display->getConnection(resource->client()), resource->handle); +} - sendDone(r); - c->flush(); +OutputInterface::OutputInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new OutputInterfacePrivate(display, this)) +{ + DisplayPrivate *displayPrivate = DisplayPrivate::get(display); + displayPrivate->outputs.append(this); } -void OutputInterface::Private::unbind(wl_resource *resource) +OutputInterface::~OutputInterface() { - Private *o = cast(resource); - if (!o) { - return; - } - auto it = std::find_if(o->resources.begin(), o->resources.end(), [resource](const ResourceData &r) { return r.resource == resource; }); - if (it != o->resources.end()) { - o->resources.erase(it); - } + remove(); } -void OutputInterface::Private::sendMode(wl_resource *resource, const Mode &mode) +void OutputInterface::remove() { - int32_t flags = 0; - if (mode.flags.testFlag(ModeFlag::Current)) { - flags |= WL_OUTPUT_MODE_CURRENT; + if (d->isGlobalRemoved()) { + return; } - if (mode.flags.testFlag(ModeFlag::Preferred)) { - flags |= WL_OUTPUT_MODE_PREFERRED; + + if (d->display) { + DisplayPrivate *displayPrivate = DisplayPrivate::get(d->display); + displayPrivate->outputs.removeOne(this); } - wl_output_send_mode(resource, - flags, - mode.size.width(), - mode.size.height(), - mode.refreshRate); + Q_EMIT removed(); + d->globalRemove(); } -void OutputInterface::Private::sendGeometry(wl_resource *resource) +QSize OutputInterface::pixelSize() const { - wl_output_send_geometry(resource, - globalPosition.x(), - globalPosition.y(), - physicalSize.width(), - physicalSize.height(), - toSubPixel(), - qPrintable(manufacturer), - qPrintable(model), - toTransform()); + return d->mode.size; } -void OutputInterface::Private::sendScale(const ResourceData &data) +int OutputInterface::refreshRate() const { - if (data.version < 2) { - return; - } - wl_output_send_scale(data.resource, scale); + return d->mode.refreshRate; } -void OutputInterface::Private::sendDone(const ResourceData &data) +OutputInterface::Mode OutputInterface::mode() const { - if (data.version < 2) { - return; - } - wl_output_send_done(data.resource); + return d->mode; } -void OutputInterface::Private::updateGeometry() +void OutputInterface::setMode(const Mode &mode) { - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendGeometry((*it).resource); - sendDone(*it); + if (d->mode.size == mode.size && d->mode.refreshRate == mode.refreshRate) { + return; } -} -void OutputInterface::Private::updateScale() -{ - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - sendScale(*it); - sendDone(*it); - } -} + d->mode = mode; -#define SETTER(setterName, type, argumentName) \ - void OutputInterface::setterName(type arg) \ - { \ - Q_D(); \ - if (d->argumentName == arg) { \ - return; \ - } \ - d->argumentName = arg; \ - emit argumentName##Changed(d->argumentName); \ + const auto outputResources = d->resourceMap(); + for (OutputInterfacePrivate::Resource *resource : outputResources) { + d->sendMode(resource); } -SETTER(setPhysicalSize, const QSize&, physicalSize) -SETTER(setGlobalPosition, const QPoint&, globalPosition) -SETTER(setManufacturer, const QString&, manufacturer) -SETTER(setModel, const QString&, model) -SETTER(setScale, int, scale) -SETTER(setSubPixel, SubPixel, subPixel) -SETTER(setTransform, Transform, transform) + Q_EMIT modeChanged(); + Q_EMIT refreshRateChanged(mode.refreshRate); + Q_EMIT pixelSizeChanged(mode.size); +} -#undef SETTER +void OutputInterface::setMode(const QSize &size, int refreshRate) +{ + setMode({size, refreshRate}); +} QSize OutputInterface::physicalSize() const { - Q_D(); return d->physicalSize; } +void OutputInterface::setPhysicalSize(const QSize &physicalSize) +{ + if (d->physicalSize == physicalSize) { + return; + } + d->physicalSize = physicalSize; + d->broadcastGeometry(); + Q_EMIT physicalSizeChanged(d->physicalSize); +} + QPoint OutputInterface::globalPosition() const { - Q_D(); return d->globalPosition; } +void OutputInterface::setGlobalPosition(const QPoint &globalPos) +{ + if (d->globalPosition == globalPos) { + return; + } + d->globalPosition = globalPos; + Q_EMIT globalPositionChanged(d->globalPosition); +} + QString OutputInterface::manufacturer() const { - Q_D(); return d->manufacturer; } +void OutputInterface::setManufacturer(const QString &manufacturer) +{ + if (d->manufacturer == manufacturer) { + return; + } + d->manufacturer = manufacturer; + d->broadcastGeometry(); + Q_EMIT manufacturerChanged(d->manufacturer); +} + QString OutputInterface::model() const { - Q_D(); return d->model; } +void OutputInterface::setModel(const QString &model) +{ + if (d->model == model) { + return; + } + d->model = model; + d->broadcastGeometry(); + Q_EMIT modelChanged(d->model); +} + int OutputInterface::scale() const { - Q_D(); return d->scale; } +void OutputInterface::setScale(int scale) +{ + if (d->scale == scale) { + return; + } + d->scale = scale; + + const auto outputResources = d->resourceMap(); + for (OutputInterfacePrivate::Resource *resource : outputResources) { + d->sendScale(resource); + } + + Q_EMIT scaleChanged(d->scale); +} + OutputInterface::SubPixel OutputInterface::subPixel() const { - Q_D(); return d->subPixel; } +void OutputInterface::setSubPixel(SubPixel subPixel) +{ + if (d->subPixel == subPixel) { + return; + } + d->subPixel = subPixel; + d->broadcastGeometry(); + Q_EMIT subPixelChanged(d->subPixel); +} + OutputInterface::Transform OutputInterface::transform() const { - Q_D(); return d->transform; } -QList< OutputInterface::Mode > OutputInterface::modes() const +void OutputInterface::setTransform(Transform transform) { - Q_D(); - return d->modes; + if (d->transform == transform) { + return; + } + d->transform = transform; + d->broadcastGeometry(); + Q_EMIT transformChanged(d->transform); } void OutputInterface::setDpmsMode(OutputInterface::DpmsMode mode) { - Q_D(); if (d->dpms.mode == mode) { return; } d->dpms.mode = mode; - emit dpmsModeChanged(); + Q_EMIT dpmsModeChanged(); } void OutputInterface::setDpmsSupported(bool supported) { - Q_D(); if (d->dpms.supported == supported) { return; } d->dpms.supported = supported; - emit dpmsSupportedChanged(); + Q_EMIT dpmsSupportedChanged(); } OutputInterface::DpmsMode OutputInterface::dpmsMode() const { - Q_D(); return d->dpms.mode; } bool OutputInterface::isDpmsSupported() const { - Q_D(); return d->dpms.supported; } -bool OutputInterface::isOutputRemoved() const +QVector OutputInterface::clientResources(ClientConnection *client) const { - Q_D(); - return d->outputRemoved; -} + const auto outputResources = d->resourceMap().values(client->client()); + QVector ret; + ret.reserve(outputResources.count()); -bool OutputInterface::isOutputDisconnected() const -{ - Q_D(); - return d->outputDisconnected; + for (OutputInterfacePrivate::Resource *resource : outputResources) { + ret.append(resource->handle); + } + + return ret; } -void OutputInterface::setOutputDisconnected(bool disconnected) +bool OutputInterface::isEnabled() const { - Q_D(); - d->outputDisconnected = disconnected; + if (!d->dpms.supported) { + return true; + } + return d->dpms.mode == DpmsMode::On; } -QVector OutputInterface::clientResources(ClientConnection *client) const +void OutputInterface::done() { - Q_D(); - QVector ret; - for (auto it = d->resources.constBegin(), end = d->resources.constEnd(); it != end; ++it) { - if (wl_resource_get_client((*it).resource) == client->client()) { - ret << (*it).resource; - } + const auto outputResources = d->resourceMap(); + for (OutputInterfacePrivate::Resource *resource : outputResources) { + d->sendDone(resource); } - return ret; } -OutputInterface *OutputInterface::get(wl_resource* native) +void OutputInterface::done(wl_client *client) { - return Private::get(native); + d->sendDone(d->resourceMap().value(client)); } -OutputInterface::Private *OutputInterface::d_func() const +OutputInterface *OutputInterface::get(wl_resource *native) { - return reinterpret_cast(d.data()); + if (auto outputPrivate = resource_cast(native)) { + return outputPrivate->q; + } + return nullptr; } -} -} +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/output_interface.h dwayland-5.57.0.24+really5.24.3/src/server/output_interface.h --- dwayland-5.57.0.23/src/server/output_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/output_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,49 +1,31 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_OUTPUT_INTERFACE_H -#define WAYLAND_SERVER_OUTPUT_INTERFACE_H +#include #include #include #include -#include -#include "global.h" - -struct wl_global; -struct wl_client; struct wl_resource; +struct wl_client; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class ClientConnection; class Display; +class OutputInterfacePrivate; /** - * @brief Global for the wl_output interface. - * - **/ -class KWAYLANDSERVER_EXPORT OutputInterface : public Global + * The OutputInterface class represents a screen. This class corresponds to the Wayland + * interface @c wl_output. + */ +class KWAYLANDSERVER_EXPORT OutputInterface : public QObject { Q_OBJECT Q_PROPERTY(QSize physicalSize READ physicalSize WRITE setPhysicalSize NOTIFY physicalSizeChanged) @@ -60,7 +42,7 @@ HorizontalRGB, HorizontalBGR, VerticalRGB, - VerticalBGR + VerticalBGR, }; enum class Transform { Normal, @@ -70,25 +52,23 @@ Flipped, Flipped90, Flipped180, - Flipped270 + Flipped270, }; - enum class ModeFlag { - Current = 1, - Preferred = 2 - }; - Q_DECLARE_FLAGS(ModeFlags, ModeFlag) struct Mode { QSize size = QSize(); int refreshRate = 60000; - ModeFlags flags; }; enum class DpmsMode { On, Standby, Suspend, - Off + Off, }; - virtual ~OutputInterface(); + + explicit OutputInterface(Display *display, QObject *parent = nullptr); + ~OutputInterface() override; + + void remove(); QSize physicalSize() const; QPoint globalPosition() const; @@ -99,7 +79,7 @@ int scale() const; SubPixel subPixel() const; Transform transform() const; - QList modes() const; + Mode mode() const; bool isDpmsSupported() const; DpmsMode dpmsMode() const; @@ -110,70 +90,75 @@ void setScale(int scale); void setSubPixel(SubPixel subPixel); void setTransform(Transform transform); - void addMode(const QSize &size, ModeFlags flags = ModeFlags(), int refreshRate = 60000); - void setCurrentMode(const QSize &size, int refreshRate = 60000); + void setMode(const Mode &mode); + void setMode(const QSize &size, int refreshRate = 60000); /** * Sets whether Dpms is supported for this output. * Default is @c false. - * @since 5.5 - **/ + */ void setDpmsSupported(bool supported); /** * Sets the currently used dpms mode. * Default is @c DpmsMode::On. - * @since 5.5 - **/ + */ void setDpmsMode(DpmsMode mode); /** * @returns all wl_resources bound for the @p client - * @since 5.27 - **/ + */ QVector clientResources(ClientConnection *client) const; - static OutputInterface *get(wl_resource *native); + /** + * Returns @c true if the output is on; otherwise returns false. + */ + bool isEnabled() const; + + /** + * Submit changes to all clients. + */ + void done(); + + /** + * Submit changes to @p client. + */ + void done(wl_client *client); - bool isOutputRemoved() const; - bool isOutputDisconnected() const; - void setOutputDisconnected(bool disconnected); + static OutputInterface *get(wl_resource *native); Q_SIGNALS: - void physicalSizeChanged(const QSize&); - void globalPositionChanged(const QPoint&); - void manufacturerChanged(const QString&); - void modelChanged(const QString&); - void pixelSizeChanged(const QSize&); + void physicalSizeChanged(const QSize &); + void globalPositionChanged(const QPoint &); + void manufacturerChanged(const QString &); + void modelChanged(const QString &); + void pixelSizeChanged(const QSize &); void refreshRateChanged(int); void scaleChanged(int); void subPixelChanged(SubPixel); void transformChanged(Transform); - void modesChanged(); - void currentModeChanged(); + void modeChanged(); void dpmsModeChanged(); void dpmsSupportedChanged(); - void resourceChanged(); + void removed(); /** * Change of dpms @p mode is requested. * A server is free to ignore this request. - * @since 5.5 - **/ - void dpmsModeRequested(KWayland::Server::OutputInterface::DpmsMode mode); + */ + void dpmsModeRequested(KWaylandServer::OutputInterface::DpmsMode mode); + + /** + * Emitted when a client binds to a given output + * @internal + */ + void bound(ClientConnection *client, wl_resource *boundResource); private: - friend class Display; - explicit OutputInterface(Display *display, QObject *parent = nullptr); - class Private; - Private *d_func() const; + QScopedPointer d; }; -} -} - -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputInterface::ModeFlags) -Q_DECLARE_METATYPE(KWayland::Server::OutputInterface::SubPixel) -Q_DECLARE_METATYPE(KWayland::Server::OutputInterface::Transform) -Q_DECLARE_METATYPE(KWayland::Server::OutputInterface::DpmsMode) +} // namespace KWaylandServer -#endif +Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::SubPixel) +Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::Transform) +Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::DpmsMode) diff -Nru dwayland-5.57.0.23/src/server/outputmanagement_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_interface.cpp --- dwayland-5.57.0.23/src/server/outputmanagement_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin -Copyright 2015 Sebastian Kügler - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "outputmanagement_interface.h" -#include "outputconfiguration_interface.h" -#include "display.h" -#include "global_p.h" - -#include -#include "wayland-output-management-server-protocol.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class OutputManagementInterface::Private : public Global::Private -{ -public: - Private(OutputManagementInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - void createConfiguration(wl_client *client, wl_resource *resource, uint32_t id); - - static void createConfigurationCallback(wl_client *client, wl_resource *resource, uint32_t id); - - OutputManagementInterface *q; - static const struct org_kde_kwin_outputmanagement_interface s_interface; - static const quint32 s_version; - - QHash configurationInterfaces; -}; - -const quint32 OutputManagementInterface::Private::s_version = 2; - -const struct org_kde_kwin_outputmanagement_interface OutputManagementInterface::Private::s_interface = { - createConfigurationCallback -}; - -OutputManagementInterface::OutputManagementInterface(Display *display, QObject *parent) -: Global(new Private(this, display), parent) -{ -} - -OutputManagementInterface::~OutputManagementInterface() -{ -} - -void OutputManagementInterface::Private::createConfigurationCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->createConfiguration(client, resource, id); -} - -void OutputManagementInterface::Private::createConfiguration(wl_client* client, wl_resource* resource, uint32_t id) -{ - auto config = new OutputConfigurationInterface(q, resource); - config->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!config->resource()) { - wl_resource_post_no_memory(resource); - delete config; - return; - } - - configurationInterfaces[resource] = config; - connect(config, &QObject::destroyed, [this, resource] { - configurationInterfaces.remove(resource); - }); -} - -OutputManagementInterface::Private::Private(OutputManagementInterface *q, Display *d) -: Global::Private(d, &org_kde_kwin_outputmanagement_interface, s_version) -, q(q) -{ -} - -void OutputManagementInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_outputmanagement_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void OutputManagementInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/outputmanagement_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_interface.h --- dwayland-5.57.0.23/src/server/outputmanagement_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ -#ifndef KWAYLAND_SERVER_OUTPUTMANAGEMENT_INTERFACE_H -#define KWAYLAND_SERVER_OUTPUTMANAGEMENT_INTERFACE_H - -#include "global.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class OutputConfigurationInterface; -/** - * @class OutputManagementInterface - * - * This class is used to change the configuration of the Wayland server's outputs. - * The client requests an OutputConfiguration, changes its OutputDevices and then - * calls OutputConfiguration::apply, which makes this class emit a signal, carrying - * the new configuration. - * The server is then expected to make the requested changes by applying the settings - * of the OutputDevices to the Outputs. - * - * @see OutputConfiguration - * @see OutputConfigurationInterface - * @since 5.5 - */ -class KWAYLANDSERVER_EXPORT OutputManagementInterface : public Global -{ - Q_OBJECT -public: - virtual ~OutputManagementInterface(); - -Q_SIGNALS: - /** - * Emitted after the client has requested an OutputConfiguration to be applied. - * through OutputConfiguration::apply. The compositor can use this object to get - * notified when the new configuration is set up, and it should be applied to the - * Wayland server's OutputInterfaces. - * - * @param config The OutputConfigurationInterface corresponding to the client that - * called apply(). - * @see OutputConfiguration::apply - * @see OutputConfigurationInterface - * @see OutputDeviceInterface - * @see OutputInterface - */ - void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *configurationInterface); - -private: - explicit OutputManagementInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/outputmanagement_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_v2_interface.cpp --- dwayland-5.57.0.23/src/server/outputmanagement_v2_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,56 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "display.h" +#include "outputmanagement_v2_interface.h" +#include "outputconfiguration_v2_interface.h" + +#include +#include "qwayland-server-kde-output-management-v2.h" + +#include + +namespace KWaylandServer +{ +static const quint32 s_version = 2; + +class OutputManagementV2InterfacePrivate : public QtWaylandServer::kde_output_management_v2 +{ +public: + OutputManagementV2InterfacePrivate(OutputManagementV2Interface *_q, Display *display); + +private: + OutputManagementV2Interface *q; + +protected: + void kde_output_management_v2_create_configuration(Resource *resource, uint32_t id) override; +}; + +OutputManagementV2InterfacePrivate::OutputManagementV2InterfacePrivate(OutputManagementV2Interface *_q, Display *display) + : QtWaylandServer::kde_output_management_v2(*display, s_version) + , q(_q) +{ +} + +void OutputManagementV2InterfacePrivate::kde_output_management_v2_create_configuration(Resource *resource, uint32_t id) +{ + wl_resource *config_resource = wl_resource_create(resource->client(), &kde_output_configuration_v2_interface, resource->version(), id); + if (!config_resource) { + wl_client_post_no_memory(resource->client()); + return; + } + new OutputConfigurationV2Interface(q, config_resource); +} + +OutputManagementV2Interface::OutputManagementV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new OutputManagementV2InterfacePrivate(this, display)) +{ +} + +OutputManagementV2Interface::~OutputManagementV2Interface() = default; + +} diff -Nru dwayland-5.57.0.23/src/server/outputmanagement_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_v2_interface.h --- dwayland-5.57.0.23/src/server/outputmanagement_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/outputmanagement_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,58 @@ +/* + SPDX-FileCopyrightText: 2015 Sebastian Kügler + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +namespace KWaylandServer +{ + +class OutputManagementV2InterfacePrivate; +class OutputConfigurationV2Interface; +/** + * @class OutputManagementInterface + * + * This class is used to change the configuration of the Wayland server's outputs. + * The client requests an OutputConfiguration, changes its OutputDevices and then + * calls OutputConfiguration::apply, which makes this class emit a signal, carrying + * the new configuration. + * The server is then expected to make the requested changes by applying the settings + * of the OutputDevices to the Outputs. + * + * @see OutputConfiguration + * @see OutputConfigurationInterface + */ +class KWAYLANDSERVER_EXPORT OutputManagementV2Interface : public QObject +{ + Q_OBJECT + +public: + explicit OutputManagementV2Interface(Display *display, QObject *parent = nullptr); + ~OutputManagementV2Interface() override; + +Q_SIGNALS: + /** + * Emitted after the client has requested an OutputConfiguration to be applied. + * through OutputConfiguration::apply. The compositor can use this object to get + * notified when the new configuration is set up, and it should be applied to the + * Wayland server's OutputInterfaces. + * + * @param config The OutputConfigurationInterface corresponding to the client that + * called apply(). + * @see OutputConfiguration::apply + * @see OutputConfigurationInterface + * @see OutputDeviceInterface + * @see OutputInterface + */ + void configurationChangeRequested(KWaylandServer::OutputConfigurationV2Interface *configurationInterface); + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/plasmashell_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/plasmashell_interface.cpp --- dwayland-5.57.0.23/src/server/plasmashell_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmashell_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,426 +1,337 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmashell_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "display.h" #include "surface_interface.h" +#include "utils.h" -#include +#include -#include -#include - -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 6; +static QList s_shellSurfaces; -class PlasmaShellInterface::Private : public Global::Private +class PlasmaShellInterfacePrivate : public QtWaylandServer::org_kde_plasma_shell { public: - Private(PlasmaShellInterface *q, Display *d); - - QList surfaces; + PlasmaShellInterfacePrivate(PlasmaShellInterface *q, Display *display); private: - static void createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - + void org_kde_plasma_shell_get_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) override; PlasmaShellInterface *q; - static const struct org_kde_plasma_shell_interface s_interface; - static const quint32 s_version; }; -const quint32 PlasmaShellInterface::Private::s_version = 5; - -PlasmaShellInterface::Private::Private(PlasmaShellInterface *q, Display *d) - : Global::Private(d, &org_kde_plasma_shell_interface, s_version) - , q(q) +PlasmaShellInterfacePrivate::PlasmaShellInterfacePrivate(PlasmaShellInterface *_q, Display *display) + : QtWaylandServer::org_kde_plasma_shell(*display, s_version) + , q(_q) { } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_shell_interface PlasmaShellInterface::Private::s_interface = { - createSurfaceCallback -}; -#endif - - -class PlasmaShellSurfaceInterface::Private : public Resource::Private +class PlasmaShellSurfaceInterfacePrivate : public QtWaylandServer::org_kde_plasma_surface { public: - Private(PlasmaShellSurfaceInterface *q, PlasmaShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource); + PlasmaShellSurfaceInterfacePrivate(PlasmaShellSurfaceInterface *q, SurfaceInterface *surface, wl_resource *resource); - SurfaceInterface *surface; + QPointer surface; + PlasmaShellSurfaceInterface *q; QPoint m_globalPos; - Role m_role = Role::Normal; + PlasmaShellSurfaceInterface::Role m_role = PlasmaShellSurfaceInterface::Role::Normal; + PlasmaShellSurfaceInterface::PanelBehavior m_panelBehavior = PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible; bool m_positionSet = false; - PanelBehavior m_panelBehavior = PanelBehavior::AlwaysVisible; bool m_skipTaskbar = false; bool m_skipSwitcher = false; - bool panelTakesFocus = false; + bool m_panelTakesFocus = false; private: - // interface callbacks - static void setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output); - static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); - static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role); - static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag); - static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip); - static void setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip); - static void panelAutoHideHideCallback(wl_client *client, wl_resource *resource); - static void panelAutoHideShowCallback(wl_client *client, wl_resource *resource); - static void panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus); - - void setPosition(const QPoint &globalPos); - void setRole(uint32_t role); - void setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior); - - PlasmaShellSurfaceInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct org_kde_plasma_surface_interface s_interface; + void org_kde_plasma_surface_destroy_resource(Resource *resource) override; + void org_kde_plasma_surface_destroy(Resource *resource) override; + void org_kde_plasma_surface_set_output(Resource *resource, struct ::wl_resource *output) override; + void org_kde_plasma_surface_set_position(Resource *resource, int32_t x, int32_t y) override; + void org_kde_plasma_surface_set_role(Resource *resource, uint32_t role) override; + void org_kde_plasma_surface_set_panel_behavior(Resource *resource, uint32_t flag) override; + void org_kde_plasma_surface_set_skip_taskbar(Resource *resource, uint32_t skip) override; + void org_kde_plasma_surface_panel_auto_hide_hide(Resource *resource) override; + void org_kde_plasma_surface_panel_auto_hide_show(Resource *resource) override; + void org_kde_plasma_surface_set_panel_takes_focus(Resource *resource, uint32_t takes_focus) override; + void org_kde_plasma_surface_set_skip_switcher(Resource *resource, uint32_t skip) override; }; PlasmaShellInterface::PlasmaShellInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new PlasmaShellInterfacePrivate(this, display)) { } PlasmaShellInterface::~PlasmaShellInterface() = default; -void PlasmaShellInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *shell = c->createResource(&org_kde_plasma_shell_interface, qMin(version, s_version), id); - if (!shell) { - wl_client_post_no_memory(client); +void PlasmaShellInterfacePrivate::org_kde_plasma_shell_get_surface(QtWaylandServer::org_kde_plasma_shell::Resource *resource, + uint32_t id, + struct ::wl_resource *surface) +{ + SurfaceInterface *s = SurfaceInterface::get(surface); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - wl_resource_set_implementation(shell, &s_interface, this, nullptr); -} -void PlasmaShellInterface::Private::createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) -{ - auto s = reinterpret_cast(wl_resource_get_user_data(resource)); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void PlasmaShellInterface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](PlasmaShellSurfaceInterface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), WL_DISPLAY_ERROR_INVALID_OBJECT, "PlasmaShellSurface already created"); + if (PlasmaShellSurfaceInterface::get(s)) { + wl_resource_post_error(resource->handle, 0, "org_kde_plasma_shell_surface already exists"); return; } - PlasmaShellSurfaceInterface *shellSurface = new PlasmaShellSurfaceInterface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &PlasmaShellSurfaceInterface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - shellSurface->d->create(display->getConnection(client), version, id); - emit q->surfaceCreated(shellSurface); + + wl_resource *shell_resource = wl_resource_create(resource->client(), &org_kde_plasma_surface_interface, resource->version(), id); + + auto shellSurface = new PlasmaShellSurfaceInterface(s, shell_resource); + s_shellSurfaces.append(shellSurface); + + QObject::connect(shellSurface, &QObject::destroyed, [shellSurface]() { + s_shellSurfaces.removeOne(shellSurface); + }); + + Q_EMIT q->surfaceCreated(shellSurface); } /********************************* * ShellSurfaceInterface *********************************/ -PlasmaShellSurfaceInterface::Private::Private(PlasmaShellSurfaceInterface *q, PlasmaShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource) - : Resource::Private(q, shell, parentResource, &org_kde_plasma_surface_interface, &s_interface) +PlasmaShellSurfaceInterfacePrivate::PlasmaShellSurfaceInterfacePrivate(PlasmaShellSurfaceInterface *_q, SurfaceInterface *surface, wl_resource *resource) + : QtWaylandServer::org_kde_plasma_surface(resource) , surface(surface) + , q(_q) { } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_surface_interface PlasmaShellSurfaceInterface::Private::s_interface = { - resourceDestroyedCallback, - setOutputCallback, - setPositionCallback, - setRoleCallback, - setPanelBehaviorCallback, - setSkipTaskbarCallback, - panelAutoHideHideCallback, - panelAutoHideShowCallback, - panelTakesFocusCallback, - setSkipSwitcherCallback -}; -#endif - -PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, shell, parent, parentResource)) +PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(SurfaceInterface *surface, wl_resource *resource) + : d(new PlasmaShellSurfaceInterfacePrivate(this, surface, resource)) { - auto unsetSurface = [this] { - Q_D(); - d->surface = nullptr; - }; - connect(parent, &Resource::unbound, this, unsetSurface); - connect(parent, &QObject::destroyed, this, unsetSurface); } PlasmaShellSurfaceInterface::~PlasmaShellSurfaceInterface() = default; -SurfaceInterface *PlasmaShellSurfaceInterface::surface() const { - Q_D(); +SurfaceInterface *PlasmaShellSurfaceInterface::surface() const +{ return d->surface; } -PlasmaShellInterface *PlasmaShellSurfaceInterface::shell() const { - Q_D(); - return reinterpret_cast(d->global); +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); } -PlasmaShellSurfaceInterface::Private *PlasmaShellSurfaceInterface::d_func() const +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_destroy_resource(Resource *resource) { - return reinterpret_cast(d.data()); + Q_UNUSED(resource) + delete q; } -void PlasmaShellSurfaceInterface::Private::setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_output(Resource *resource, struct ::wl_resource *output) { - Q_UNUSED(client) Q_UNUSED(resource) Q_UNUSED(output) // TODO: implement } -void PlasmaShellSurfaceInterface::Private::setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->setPosition(QPoint(x, y)); -} - -void PlasmaShellSurfaceInterface::Private::setPosition(const QPoint &globalPos) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_position(Resource *resource, int32_t x, int32_t y) { + Q_UNUSED(resource); + QPoint globalPos(x, y); if (m_globalPos == globalPos && m_positionSet) { return; } m_positionSet = true; m_globalPos = globalPos; - Q_Q(PlasmaShellSurfaceInterface); - emit q->positionChanged(); + Q_EMIT q->positionChanged(); } -void PlasmaShellSurfaceInterface::Private::setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_role(Resource *resource, uint32_t role) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->setRole(role); -} + Q_UNUSED(resource) -void PlasmaShellSurfaceInterface::Private::setRole(uint32_t role) -{ - Role r = Role::Normal; + PlasmaShellSurfaceInterface::Role r = PlasmaShellSurfaceInterface::Role::Normal; switch (role) { - case ORG_KDE_PLASMA_SURFACE_ROLE_DESKTOP: - r = Role::Desktop; + case role_desktop: + r = PlasmaShellSurfaceInterface::Role::Desktop; + break; + case role_panel: + r = PlasmaShellSurfaceInterface::Role::Panel; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_PANEL: - r = Role::Panel; + case role_onscreendisplay: + r = PlasmaShellSurfaceInterface::Role::OnScreenDisplay; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_ONSCREENDISPLAY: - r = Role::OnScreenDisplay; + case role_notification: + r = PlasmaShellSurfaceInterface::Role::Notification; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_NOTIFICATION: - r = Role::Notification; + case role_tooltip: + r = PlasmaShellSurfaceInterface::Role::ToolTip; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_TOOLTIP: - r = Role::ToolTip; + case role_criticalnotification: + r = PlasmaShellSurfaceInterface::Role::CriticalNotification; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_STANDALONE: - r = Role::StandAlone; + case role_StandAlone: + r = PlasmaShellSurfaceInterface::Role::StandAlone; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_OVERRIDE: - r = Role::Override; + case role_override: + r = PlasmaShellSurfaceInterface::Role::Override; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_ACTIVEFULLSCREEN: - r = Role::ActiveFullScreen; + case role_activeFullScreen: + r = PlasmaShellSurfaceInterface::Role::ActiveFullScreen; break; - case ORG_KDE_PLASMA_SURFACE_ROLE_NORMAL: + case role_normal: default: - r = Role::Normal; + r = PlasmaShellSurfaceInterface::Role::Normal; break; } if (r == m_role) { return; } m_role = r; - Q_Q(PlasmaShellSurfaceInterface); - emit q->roleChanged(); + Q_EMIT q->roleChanged(); } -void PlasmaShellSurfaceInterface::Private::setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_panel_behavior(Resource *resource, uint32_t flag) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->setPanelBehavior(org_kde_plasma_surface_panel_behavior(flag)); + Q_UNUSED(resource) + + PlasmaShellSurfaceInterface::PanelBehavior newBehavior = PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible; + switch (flag) { + case panel_behavior_auto_hide: + newBehavior = PlasmaShellSurfaceInterface::PanelBehavior::AutoHide; + break; + case panel_behavior_windows_can_cover: + newBehavior = PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover; + break; + case panel_behavior_windows_go_below: + newBehavior = PlasmaShellSurfaceInterface::PanelBehavior::WindowsGoBelow; + break; + case panel_behavior_always_visible: + default: + break; + } + if (m_panelBehavior == newBehavior) { + return; + } + m_panelBehavior = newBehavior; + Q_EMIT q->panelBehaviorChanged(); } -void PlasmaShellSurfaceInterface::Private::setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_skip_taskbar(Resource *resource, uint32_t skip) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->m_skipTaskbar = (bool)skip; - emit s->q_func()->skipTaskbarChanged(); + Q_UNUSED(resource) + + m_skipTaskbar = (bool)skip; + Q_EMIT q->skipTaskbarChanged(); } -void PlasmaShellSurfaceInterface::Private::setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_skip_switcher(Resource *resource, uint32_t skip) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->m_skipSwitcher = (bool)skip; - emit s->q_func()->skipSwitcherChanged(); + Q_UNUSED(resource) + + m_skipSwitcher = (bool)skip; + Q_EMIT q->skipSwitcherChanged(); } -void PlasmaShellSurfaceInterface::Private::panelAutoHideHideCallback(wl_client *client, wl_resource *resource) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_panel_auto_hide_hide(Resource *resource) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { - wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); + if (m_role != PlasmaShellSurfaceInterface::Role::Panel + || (m_panelBehavior != PlasmaShellSurfaceInterface::PanelBehavior::AutoHide + && m_panelBehavior != PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover)) { + wl_resource_post_error(resource->handle, error_panel_not_auto_hide, "Not an auto hide panel"); return; } - emit s->q_func()->panelAutoHideHideRequested(); + Q_EMIT q->panelAutoHideHideRequested(); } -void PlasmaShellSurfaceInterface::Private::panelAutoHideShowCallback(wl_client *client, wl_resource *resource) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_panel_auto_hide_show(Resource *resource) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { - wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); + if (m_role != PlasmaShellSurfaceInterface::Role::Panel || m_panelBehavior != PlasmaShellSurfaceInterface::PanelBehavior::AutoHide) { + wl_resource_post_error(resource->handle, error_panel_not_auto_hide, "Not an auto hide panel"); return; } - emit s->q_func()->panelAutoHideShowRequested(); + Q_EMIT q->panelAutoHideShowRequested(); } -void PlasmaShellSurfaceInterface::Private::panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus) +void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_panel_takes_focus(Resource *resource, uint32_t takesFocus) { - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->panelTakesFocus = takesFocus; -} + Q_UNUSED(resource) -void PlasmaShellSurfaceInterface::Private::setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior) -{ - PanelBehavior newBehavior = PanelBehavior::AlwaysVisible; - switch (behavior) { - case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_AUTO_HIDE: - newBehavior = PanelBehavior::AutoHide; - break; - case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_WINDOWS_CAN_COVER: - newBehavior = PanelBehavior::WindowsCanCover; - break; - case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_WINDOWS_GO_BELOW: - newBehavior = PanelBehavior::WindowsGoBelow; - break; - case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_ALWAYS_VISIBLE: - default: - break; - } - if (m_panelBehavior == newBehavior) { + if (m_panelTakesFocus == takesFocus) { return; } - m_panelBehavior = newBehavior; - Q_Q(PlasmaShellSurfaceInterface); - emit q->panelBehaviorChanged(); + m_panelTakesFocus = takesFocus; + Q_EMIT q->panelTakesFocusChanged(); } QPoint PlasmaShellSurfaceInterface::position() const { - Q_D(); return d->m_globalPos; } PlasmaShellSurfaceInterface::Role PlasmaShellSurfaceInterface::role() const { - Q_D(); return d->m_role; } bool PlasmaShellSurfaceInterface::isPositionSet() const { - Q_D(); return d->m_positionSet; } PlasmaShellSurfaceInterface::PanelBehavior PlasmaShellSurfaceInterface::panelBehavior() const { - Q_D(); return d->m_panelBehavior; } bool PlasmaShellSurfaceInterface::skipTaskbar() const { - Q_D(); return d->m_skipTaskbar; } bool PlasmaShellSurfaceInterface::skipSwitcher() const { - Q_D(); return d->m_skipSwitcher; } void PlasmaShellSurfaceInterface::hideAutoHidingPanel() { - Q_D(); - if (!d->resource) { - return; - } - org_kde_plasma_surface_send_auto_hidden_panel_hidden(d->resource); + d->send_auto_hidden_panel_hidden(); } void PlasmaShellSurfaceInterface::showAutoHidingPanel() { - Q_D(); - if (!d->resource) { - return; - } - org_kde_plasma_surface_send_auto_hidden_panel_shown(d->resource); + d->send_auto_hidden_panel_shown(); } bool PlasmaShellSurfaceInterface::panelTakesFocus() const { - Q_D(); - return d->panelTakesFocus; + return d->m_panelTakesFocus; } PlasmaShellSurfaceInterface *PlasmaShellSurfaceInterface::get(wl_resource *native) { - return Private::get(native); + if (auto surfacePrivate = resource_cast(native)) { + return surfacePrivate->q; + } + return nullptr; +} + +PlasmaShellSurfaceInterface *PlasmaShellSurfaceInterface::get(SurfaceInterface *surface) +{ + for (PlasmaShellSurfaceInterface *shellSurface : qAsConst(s_shellSurfaces)) { + if (shellSurface->surface() == surface) { + return shellSurface; + } + } + return nullptr; } void PlasmaShellSurfaceInterface::resetPositionSet() { - Q_D(); d->m_positionSet = false; } } -} diff -Nru dwayland-5.57.0.23/src/server/plasmashell_interface.h dwayland-5.57.0.24+really5.24.3/src/server/plasmashell_interface.h --- dwayland-5.57.0.23/src/server/plasmashell_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmashell_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,44 +1,27 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_PLASMA_SHELL_INTERFACE_H -#define WAYLAND_SERVER_PLASMA_SHELL_INTERFACE_H +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include - -#include "global.h" -#include "resource.h" +#include class QSize; struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; class SurfaceInterface; class PlasmaShellSurfaceInterface; +class PlasmaShellInterfacePrivate; +class PlasmaShellSurfaceInterfacePrivate; + /** * @brief Global for the org_kde_plasma_shell interface. * @@ -48,35 +31,31 @@ * * A server providing this interface should think about how to restrict access to it as * it allows to perform absolute window positioning. - * - * @since 5.4 - **/ -class KWAYLANDSERVER_EXPORT PlasmaShellInterface : public Global + */ +class KWAYLANDSERVER_EXPORT PlasmaShellInterface : public QObject { Q_OBJECT + public: + explicit PlasmaShellInterface(Display *display, QObject *parent); virtual ~PlasmaShellInterface(); Q_SIGNALS: /** * Emitted whenever a PlasmaShellSurfaceInterface got created. - **/ - void surfaceCreated(KWayland::Server::PlasmaShellSurfaceInterface*); + */ + void surfaceCreated(KWaylandServer::PlasmaShellSurfaceInterface *); private: - friend class Display; - explicit PlasmaShellInterface(Display *display, QObject *parent); - class Private; + QScopedPointer d; }; /** * @brief Resource for the org_kde_plasma_shell_surface interface. * * PlasmaShellSurfaceInterface gets created by PlasmaShellInterface. - * - * @since 5.4 - **/ -class KWAYLANDSERVER_EXPORT PlasmaShellSurfaceInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT PlasmaShellSurfaceInterface : public QObject { Q_OBJECT public: @@ -84,68 +63,62 @@ /** * @returns the SurfaceInterface this PlasmaShellSurfaceInterface got created for - **/ + */ SurfaceInterface *surface() const; /** - * @returns The PlasmaShellInterface which created this PlasmaShellSurfaceInterface. - **/ - PlasmaShellInterface *shell() const; - - /** * @returns the requested position in global coordinates. - **/ + */ QPoint position() const; /** * @returns Whether a global position has been requested. - **/ + */ bool isPositionSet() const; /** * Describes possible roles this PlasmaShellSurfaceInterface can have. * The role can be used by the server to e.g. change the stacking order accordingly. - **/ + */ enum class Role { Normal, ///< A normal surface Desktop, ///< The surface represents a desktop, normally stacked below all other surfaces Panel, ///< The surface represents a panel (dock), normally stacked above normal surfaces OnScreenDisplay, ///< The surface represents an on screen display, like a volume changed notification - Notification, ///< The surface represents a notification @since 5.24 - ToolTip, ///< The surface represents a tooltip @since 5.24 + Notification, ///< The surface represents a notification + ToolTip, ///< The surface represents a tooltip + CriticalNotification, ///< The surface represents a critical notification, like battery is running out StandAlone, ///< The Surface represents a special surface which the same as normal surface but can not be move/resize by window manager Override, ///< The Surface represents unmanaged surfaces ActiveFullScreen, // The surfce used for wallpaper }; /** * @returns The requested role, default value is @c Role::Normal. - **/ + */ Role role() const; /** * Describes how a PlasmaShellSurfaceInterface with role @c Role::Panel should behave. - **/ + */ enum class PanelBehavior { AlwaysVisible, ///< The panel should be always visible AutoHide, ///< The panel auto hides at a screen edge and returns on mouse press against edge WindowsCanCover, ///< Windows are allowed to go above the panel, it raises on mouse press against screen edge - WindowsGoBelow ///< Window are allowed to go below the panel + WindowsGoBelow, ///< Window are allowed to go below the panel }; /** * @returns The PanelBehavior for a PlasmaShellSurfaceInterface with role @c Role::Panel * @see role - **/ + */ PanelBehavior panelBehavior() const; /** * @returns true if this window doesn't want to be listed * in the taskbar - * @since 5.5 - **/ + */ bool skipTaskbar() const; /** * @returns true if this window doesn't want to be listed * in a window switcher - * @since 5.47 - **/ + */ bool skipSwitcher() const; /** @@ -155,8 +128,7 @@ * @see showAutoHidingPanel * @see panelAutoHideHideRequested * @see panelAutoHideShowRequested - * @since 5.28 - **/ + */ void hideAutoHidingPanel(); /** @@ -166,39 +138,39 @@ * @see panelAutoHideHideRequested * @see panelAutoHideShowRequested * @see 5.28 - **/ + */ void showAutoHidingPanel(); /** - * Whether a PlasmaShellSurfaceInterface with Role Panel wants to have focus. + * Whether a PlasmaShellSurfaceInterface wants to have focus. * - * By default a Panel does not get focus, but the PlasmaShellSurfaceInterface can + * By default some PlasmaShell roles do not get focus, but the PlasmaShellSurfaceInterface can * request that it wants to have focus. The compositor can use this information to - * pass focus to the panel. - * @since 5.28 - **/ + * pass focus to the surface. + */ + // TODO KF6 rename to something generic bool panelTakesFocus() const; /** * @returns The PlasmaShellSurfaceInterface for the @p native resource. - * @since 5.5 - **/ + */ static PlasmaShellSurfaceInterface *get(wl_resource *native); + static PlasmaShellSurfaceInterface *get(SurfaceInterface *surface); void resetPositionSet(); Q_SIGNALS: /** * A change of global position has been requested. - **/ + */ void positionChanged(); /** * A change of the role has been requested. - **/ + */ void roleChanged(); /** * A change of the panel behavior has been requested. - **/ + */ void panelBehaviorChanged(); /** * A change in the skip taskbar property has been requested @@ -206,7 +178,7 @@ void skipTaskbarChanged(); /** * A change in the skip switcher property has been requested - **/ + */ void skipSwitcherChanged(); /** @@ -221,8 +193,7 @@ * @see hideAutoHidingPanel * @see showAutoHidingPanel * @see panelAutoHideShowRequested - * @since 5.28 - **/ + */ void panelAutoHideHideRequested(); /** @@ -234,21 +205,22 @@ * @see hideAutoHidingPanel * @see showAutoHidingPanel * @see panelAutoHideHideRequested - * @since 5.28 - **/ + */ void panelAutoHideShowRequested(); + /* + * Emitted when panelTakesFocus changes + * @see panelTakesFocus + */ + void panelTakesFocusChanged(); + private: - friend class PlasmaShellInterface; - explicit PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; + friend class PlasmaShellInterfacePrivate; + explicit PlasmaShellSurfaceInterface(SurfaceInterface *surface, wl_resource *resource); + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::PlasmaShellSurfaceInterface::Role) -Q_DECLARE_METATYPE(KWayland::Server::PlasmaShellSurfaceInterface::PanelBehavior) -#endif +Q_DECLARE_METATYPE(KWaylandServer::PlasmaShellSurfaceInterface::Role) +Q_DECLARE_METATYPE(KWaylandServer::PlasmaShellSurfaceInterface::PanelBehavior) diff -Nru dwayland-5.57.0.23/src/server/plasmavirtualdesktop_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/plasmavirtualdesktop_interface.cpp --- dwayland-5.57.0.23/src/server/plasmavirtualdesktop_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmavirtualdesktop_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,198 +1,150 @@ -/**************************************************************************** -Copyright 2018 Marco Martin +/* + SPDX-FileCopyrightText: 2018 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmavirtualdesktop_interface.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" #include #include +#include #include -#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 2; -class Q_DECL_HIDDEN PlasmaVirtualDesktopInterface::Private +class PlasmaVirtualDesktopInterfacePrivate : public QtWaylandServer::org_kde_plasma_virtual_desktop { public: - Private(PlasmaVirtualDesktopInterface *q, PlasmaVirtualDesktopManagementInterface *c); - ~Private(); - void createResource(wl_resource *parent, quint32 serial); + PlasmaVirtualDesktopInterfacePrivate(PlasmaVirtualDesktopInterface *q, PlasmaVirtualDesktopManagementInterface *c); + ~PlasmaVirtualDesktopInterfacePrivate(); PlasmaVirtualDesktopInterface *q; PlasmaVirtualDesktopManagementInterface *vdm; - QVector resources; QString id; QString name; bool active = false; -private: - static void unbind(wl_resource *resource); - static void requestActivateCallback(wl_client *client, wl_resource *resource); - - static Private *cast(wl_resource *resource) { - return reinterpret_cast(wl_resource_get_user_data(resource)); - } - - wl_listener listener; - static const struct org_kde_plasma_virtual_desktop_interface s_interface; +protected: + void org_kde_plasma_virtual_desktop_bind_resource(Resource *resource) override; + void org_kde_plasma_virtual_desktop_request_activate(Resource *resource) override; }; - -class Q_DECL_HIDDEN PlasmaVirtualDesktopManagementInterface::Private : public Global::Private +class PlasmaVirtualDesktopManagementInterfacePrivate : public QtWaylandServer::org_kde_plasma_virtual_desktop_management { public: - Private(PlasmaVirtualDesktopManagementInterface *q, Display *d); + PlasmaVirtualDesktopManagementInterfacePrivate(PlasmaVirtualDesktopManagementInterface *_q, Display *display); - QVector resources; - QList desktops; + QList desktops; quint32 rows = 0; quint32 columns = 0; - - inline QList::const_iterator constFindDesktop(const QString &id); - inline QList::iterator findDesktop(const QString &id); -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void getVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t serial, const char *id); - static void requestCreateVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *name, uint32_t position); - static void requestRemoveVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id); - PlasmaVirtualDesktopManagementInterface *q; - static const struct org_kde_plasma_virtual_desktop_management_interface s_interface; - static const quint32 s_version; -}; - -const quint32 PlasmaVirtualDesktopManagementInterface::Private::s_version = 1; + inline QList::const_iterator constFindDesktop(const QString &id); + inline QList::iterator findDesktop(const QString &id); -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_virtual_desktop_management_interface PlasmaVirtualDesktopManagementInterface::Private::s_interface = { - getVirtualDesktopCallback, - requestCreateVirtualDesktopCallback, - requestRemoveVirtualDesktopCallback +protected: + void org_kde_plasma_virtual_desktop_management_get_virtual_desktop(Resource *resource, uint32_t id, const QString &desktop_id) override; + void org_kde_plasma_virtual_desktop_management_request_create_virtual_desktop(Resource *resource, const QString &name, uint32_t position) override; + void org_kde_plasma_virtual_desktop_management_request_remove_virtual_desktop(Resource *resource, const QString &desktop_id) override; + void org_kde_plasma_virtual_desktop_management_bind_resource(Resource *resource) override; }; -#endif -inline QList::const_iterator PlasmaVirtualDesktopManagementInterface::Private::constFindDesktop(const QString &id) +inline QList::const_iterator PlasmaVirtualDesktopManagementInterfacePrivate::constFindDesktop(const QString &id) { - return std::find_if( desktops.constBegin(), - desktops.constEnd(), - [id]( const PlasmaVirtualDesktopInterface *desk ){ return desk->id() == id; } ); + return std::find_if(desktops.constBegin(), desktops.constEnd(), [id](const PlasmaVirtualDesktopInterface *desk) { + return desk->id() == id; + }); } -inline QList::iterator PlasmaVirtualDesktopManagementInterface::Private::findDesktop(const QString &id) +inline QList::iterator PlasmaVirtualDesktopManagementInterfacePrivate::findDesktop(const QString &id) { - return std::find_if( desktops.begin(), - desktops.end(), - [id]( const PlasmaVirtualDesktopInterface *desk ){ return desk->id() == id; } ); + return std::find_if(desktops.begin(), desktops.end(), [id](const PlasmaVirtualDesktopInterface *desk) { + return desk->id() == id; + }); } -void PlasmaVirtualDesktopManagementInterface::Private::getVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t serial, const char *id) +void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desktop_management_get_virtual_desktop(Resource *resource, + uint32_t id, + const QString &desktop_id) { - Q_UNUSED(client) - auto s = cast(resource); - - auto i = s->constFindDesktop(QString::fromUtf8(id)); - if (i == s->desktops.constEnd()) { + auto i = constFindDesktop(desktop_id); + if (i == desktops.constEnd()) { return; } - (*i)->d->createResource(resource, serial); + (*i)->d->add(resource->client(), id, resource->version()); } -void PlasmaVirtualDesktopManagementInterface::Private::requestCreateVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *name, uint32_t position) +void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desktop_management_request_create_virtual_desktop(Resource *resource, + const QString &name, + uint32_t position) { - Q_UNUSED(client) - auto s = cast(resource); - emit s->q->desktopCreateRequested(QString::fromUtf8(name), qBound(0, position, (quint32)s->desktops.count())); + Q_UNUSED(resource) + Q_EMIT q->desktopCreateRequested(name, qBound(0, position, (quint32)desktops.count())); } -void PlasmaVirtualDesktopManagementInterface::Private::requestRemoveVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id) +void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desktop_management_request_remove_virtual_desktop(Resource *resource, + const QString &desktop_id) { - Q_UNUSED(client) - auto s = cast(resource); - emit s->q->desktopRemoveRequested(QString::fromUtf8(id)); + Q_UNUSED(resource) + Q_EMIT q->desktopRemoveRequested(desktop_id); } -PlasmaVirtualDesktopManagementInterface::Private::Private(PlasmaVirtualDesktopManagementInterface *q, Display *d) - : Global::Private(d, &org_kde_plasma_virtual_desktop_management_interface, s_version) - , q(q) +PlasmaVirtualDesktopManagementInterfacePrivate::PlasmaVirtualDesktopManagementInterfacePrivate(PlasmaVirtualDesktopManagementInterface *_q, Display *display) + : QtWaylandServer::org_kde_plasma_virtual_desktop_management(*display, s_version) + , q(_q) { } -void PlasmaVirtualDesktopManagementInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desktop_management_bind_resource(Resource *resource) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_plasma_virtual_desktop_management_interface, qMin(version, s_version), id); - - if (!resource) { - wl_client_post_no_memory(client); - return; - } - resources << resource; - - wl_resource_set_implementation(resource, &s_interface, this, unbind); - quint32 i = 0; for (auto it = desktops.constBegin(); it != desktops.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_management_send_desktop_created(resource, (*it)->id().toUtf8().constData(), i++); + send_desktop_created(resource->handle, (*it)->id(), i++); } - org_kde_plasma_virtual_desktop_management_send_done(resource); -} -void PlasmaVirtualDesktopManagementInterface::Private::unbind(wl_resource *resource) -{ - auto dm = reinterpret_cast(wl_resource_get_user_data(resource)); - dm->resources.removeAll(resource); + if (resource->version() >= ORG_KDE_PLASMA_VIRTUAL_DESKTOP_MANAGEMENT_ROWS_SINCE_VERSION) { + send_rows(resource->handle, rows); + } + + send_done(resource->handle); } PlasmaVirtualDesktopManagementInterface::PlasmaVirtualDesktopManagementInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new PlasmaVirtualDesktopManagementInterfacePrivate(this, display)) { } PlasmaVirtualDesktopManagementInterface::~PlasmaVirtualDesktopManagementInterface() { - Q_D(); qDeleteAll(d->desktops); } -PlasmaVirtualDesktopManagementInterface::Private *PlasmaVirtualDesktopManagementInterface::d_func() const +void PlasmaVirtualDesktopManagementInterface::setRows(quint32 rows) { - return reinterpret_cast(d.data()); + if (rows == 0 || d->rows == rows) { + return; + } + + d->rows = rows; + + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + if (resource->version() < ORG_KDE_PLASMA_VIRTUAL_DESKTOP_MANAGEMENT_ROWS_SINCE_VERSION) { + continue; + } + d->send_rows(resource->handle, rows); + } } PlasmaVirtualDesktopInterface *PlasmaVirtualDesktopManagementInterface::desktop(const QString &id) { - Q_D(); auto i = d->constFindDesktop(id); if (i != d->desktops.constEnd()) { return *i; @@ -202,29 +154,31 @@ PlasmaVirtualDesktopInterface *PlasmaVirtualDesktopManagementInterface::createDesktop(const QString &id, quint32 position) { - Q_D(); auto i = d->constFindDesktop(id); if (i != d->desktops.constEnd()) { return *i; } const quint32 actualPosition = qMin(position, (quint32)d->desktops.count()); - - PlasmaVirtualDesktopInterface *desktop = new PlasmaVirtualDesktopInterface(this); + + auto desktop = new PlasmaVirtualDesktopInterface(this); desktop->d->id = id; - for (auto it = desktop->d->resources.constBegin(); it != desktop->d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_desktop_id(*it, id.toUtf8().constData()); + + const auto desktopClientResources = desktop->d->resourceMap(); + for (auto resource : desktopClientResources) { + desktop->d->send_desktop_id(resource->handle, id); } - //activate the first desktop TODO: to be done here? + // activate the first desktop TODO: to be done here? if (d->desktops.isEmpty()) { desktop->d->active = true; } d->desktops.insert(actualPosition, desktop); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_management_send_desktop_created(*it, id.toUtf8().constData(), actualPosition); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_desktop_created(resource->handle, id, actualPosition); } return desktop; @@ -232,102 +186,78 @@ void PlasmaVirtualDesktopManagementInterface::removeDesktop(const QString &id) { - Q_D(); auto deskIt = d->findDesktop(id); if (deskIt == d->desktops.end()) { return; } - for (auto it = (*deskIt)->d->resources.constBegin(); it != (*deskIt)->d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_removed(*it); + const auto desktopClientResources = (*deskIt)->d->resourceMap(); + for (auto resource : desktopClientResources) { + (*deskIt)->d->send_removed(resource->handle); } - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_management_send_desktop_removed(*it, id.toUtf8().constData()); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_desktop_removed(resource->handle, id); } (*deskIt)->deleteLater(); d->desktops.erase(deskIt); } -QList PlasmaVirtualDesktopManagementInterface::desktops() const +QList PlasmaVirtualDesktopManagementInterface::desktops() const { - Q_D(); return d->desktops; } void PlasmaVirtualDesktopManagementInterface::sendDone() { - Q_D(); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_management_send_done(*it); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_done(resource->handle); } } //// PlasmaVirtualDesktopInterface -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_virtual_desktop_interface PlasmaVirtualDesktopInterface::Private::s_interface = { - requestActivateCallback -}; -#endif - -void PlasmaVirtualDesktopInterface::Private::requestActivateCallback(wl_client *client, wl_resource *resource) +void PlasmaVirtualDesktopInterfacePrivate::org_kde_plasma_virtual_desktop_request_activate(Resource *resource) { - Q_UNUSED(client) - auto s = cast(resource); - emit s->q->activateRequested(); + Q_UNUSED(resource) + Q_EMIT q->activateRequested(); } -PlasmaVirtualDesktopInterface::Private::Private(PlasmaVirtualDesktopInterface *q, PlasmaVirtualDesktopManagementInterface *c) - : q(q), - vdm(c) +PlasmaVirtualDesktopInterfacePrivate::PlasmaVirtualDesktopInterfacePrivate(PlasmaVirtualDesktopInterface *q, PlasmaVirtualDesktopManagementInterface *c) + : QtWaylandServer::org_kde_plasma_virtual_desktop() + , q(q) + , vdm(c) { } -PlasmaVirtualDesktopInterface::Private::~Private() +PlasmaVirtualDesktopInterfacePrivate::~PlasmaVirtualDesktopInterfacePrivate() { - // need to copy, as destroy goes through the destroy listener and modifies the list as we iterate - const auto c = resources; - for (const auto &r : c) { - auto client = wl_resource_get_client(r); - org_kde_plasma_virtual_desktop_send_removed(r); - wl_resource_destroy(r); - wl_client_flush(client); + const auto clientResources = resourceMap(); + for (Resource *resource : clientResources) { + send_removed(resource->handle); + wl_resource_destroy(resource->handle); } } -void PlasmaVirtualDesktopInterface::Private::unbind(wl_resource *resource) +void PlasmaVirtualDesktopInterfacePrivate::org_kde_plasma_virtual_desktop_bind_resource(Resource *resource) { - Private *p = reinterpret_cast(wl_resource_get_user_data(resource)); - p->resources.removeAll(resource); -} - -void PlasmaVirtualDesktopInterface::Private::createResource(wl_resource *parent, quint32 serial) -{ - ClientConnection *c = vdm->display()->getConnection(wl_resource_get_client(parent)); - wl_resource *resource = c->createResource(&org_kde_plasma_virtual_desktop_interface, wl_resource_get_version(parent), serial); - if (!resource) { - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - resources << resource; + send_desktop_id(resource->handle, id); - org_kde_plasma_virtual_desktop_send_desktop_id(resource, id.toUtf8().constData()); if (!name.isEmpty()) { - org_kde_plasma_virtual_desktop_send_name(resource, name.toUtf8().constData()); + send_name(resource->handle, name); } if (active) { - org_kde_plasma_virtual_desktop_send_activated(resource); + send_activated(resource->handle); } - - c->flush(); } PlasmaVirtualDesktopInterface::PlasmaVirtualDesktopInterface(PlasmaVirtualDesktopManagementInterface *parent) - : QObject(parent), - d(new Private(this, parent)) + : QObject() + , d(new PlasmaVirtualDesktopInterfacePrivate(this, parent)) { } @@ -348,8 +278,10 @@ } d->name = name; - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_name(*it, name.toUtf8().constData()); + + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_name(resource->handle, name); } } @@ -365,13 +297,15 @@ } d->active = active; + const auto clientResources = d->resourceMap(); + if (active) { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_activated(*it); + for (auto resource : clientResources) { + d->send_activated(resource->handle); } } else { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_deactivated(*it); + for (auto resource : clientResources) { + d->send_deactivated(resource->handle); } } } @@ -383,11 +317,10 @@ void PlasmaVirtualDesktopInterface::sendDone() { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_virtual_desktop_send_done(*it); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_done(resource->handle); } } } -} - diff -Nru dwayland-5.57.0.23/src/server/plasmavirtualdesktop_interface.h dwayland-5.57.0.24+really5.24.3/src/server/plasmavirtualdesktop_interface.h --- dwayland-5.57.0.23/src/server/plasmavirtualdesktop_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmavirtualdesktop_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,54 +1,38 @@ -/**************************************************************************** -Copyright 2018 Marco Martin +/* + SPDX-FileCopyrightText: 2018 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_PLASMAVIRTUALDESKTOP_H -#define KWAYLAND_SERVER_PLASMAVIRTUALDESKTOP_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" +#include -#include +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class Display; class PlasmaVirtualDesktopInterface; +class PlasmaVirtualDesktopInterfacePrivate; +class PlasmaVirtualDesktopManagementInterfacePrivate; /** * @short Wrapper for the org_kde_plasma_virtual_desktop_management interface. * * This class provides a convenient wrapper for the org_kde_plasma_virtual_desktop_management interface. - * @since 5.52 */ -class KWAYLANDSERVER_EXPORT PlasmaVirtualDesktopManagementInterface : public Global +class KWAYLANDSERVER_EXPORT PlasmaVirtualDesktopManagementInterface : public QObject { Q_OBJECT + public: - virtual ~PlasmaVirtualDesktopManagementInterface(); + explicit PlasmaVirtualDesktopManagementInterface(Display *display, QObject *parent = nullptr); + ~PlasmaVirtualDesktopManagementInterface() override; /** - * Sets a new layout for this desktop grid. + * Sets how many rows the virtual desktops should be laid into */ - void setLayout(quint32 rows, quint32 columns); + void setRows(quint32 rows); /** * @returns A desktop identified uniquely by this id. @@ -75,7 +59,7 @@ /** * @returns All tghe desktops present. */ - QList desktops() const; + QList desktops() const; /** * Inform the clients that all the properties have been sent, and @@ -104,17 +88,14 @@ void desktopCreateRequested(const QString &name, quint32 position); private: - explicit PlasmaVirtualDesktopManagementInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; + QScopedPointer d; }; class KWAYLANDSERVER_EXPORT PlasmaVirtualDesktopInterface : public QObject { Q_OBJECT public: - virtual ~PlasmaVirtualDesktopInterface(); + ~PlasmaVirtualDesktopInterface() override; /** * @returns the unique id for this desktop. @@ -160,12 +141,9 @@ private: explicit PlasmaVirtualDesktopInterface(PlasmaVirtualDesktopManagementInterface *parent); friend class PlasmaVirtualDesktopManagementInterface; + friend class PlasmaVirtualDesktopManagementInterfacePrivate; - class Private; - const QScopedPointer d; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/plasmawindowmanagement_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/plasmawindowmanagement_interface.cpp --- dwayland-5.57.0.23/src/server/plasmawindowmanagement_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmawindowmanagement_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,237 +1,258 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "plasmawindowmanagement_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "display.h" -#include "surface_interface.h" +#include "logging.h" #include "plasmavirtualdesktop_interface.h" +#include "surface_interface.h" -#include #include +#include #include #include -#include #include -#include +#include +#include +#include -#include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 14; +static const quint32 s_activationVersion = 1; -class PlasmaWindowManagementInterface::Private : public Global::Private +class PlasmaWindowManagementInterfacePrivate : public QtWaylandServer::org_kde_plasma_window_management { public: - Private(PlasmaWindowManagementInterface *q, Display *d); + PlasmaWindowManagementInterfacePrivate(PlasmaWindowManagementInterface *_q, Display *display); void sendShowingDesktopState(); + void sendShowingDesktopState(wl_resource *resource); + void sendStackingOrderChanged(); + void sendStackingOrderChanged(wl_resource *resource); + void sendStackingOrderUuidsChanged(); + void sendStackingOrderUuidsChanged(wl_resource *resource); - ShowingDesktopState state = ShowingDesktopState::Disabled; - QVector resources; - QList windows; + PlasmaWindowManagementInterface::ShowingDesktopState state = PlasmaWindowManagementInterface::ShowingDesktopState::Disabled; + QList windows; QPointer plasmaVirtualDesktopManagementInterface = nullptr; quint32 windowIdCounter = 0; - -private: - static void unbind(wl_resource *resource); - static void showDesktopCallback(wl_client *client, wl_resource *resource, uint32_t state); - static void getWindowCallback(wl_client *client, wl_resource *resource, uint32_t id, uint32_t internalWindowId); - - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void sendShowingDesktopState(wl_resource *r); - + QVector stackingOrder; + QVector stackingOrderUuids; PlasmaWindowManagementInterface *q; - static const struct org_kde_plasma_window_management_interface s_interface; - static const quint32 s_version; + +protected: + void org_kde_plasma_window_management_bind_resource(Resource *resource) override; + void org_kde_plasma_window_management_show_desktop(Resource *resource, uint32_t state) override; + void org_kde_plasma_window_management_get_window(Resource *resource, uint32_t id, uint32_t internal_window_id) override; + void org_kde_plasma_window_management_get_window_by_uuid(Resource *resource, uint32_t id, const QString &internal_window_uuid) override; }; -class PlasmaWindowInterface::Private +class PlasmaWindowInterfacePrivate : public QtWaylandServer::org_kde_plasma_window { public: - Private(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q); - ~Private(); + PlasmaWindowInterfacePrivate(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q); + ~PlasmaWindowInterfacePrivate(); - void createResource(wl_resource *parent, uint32_t id); void setTitle(const QString &title); void setAppId(const QString &appId); void setPid(quint32 pid); void setThemedIconName(const QString &iconName); void setIcon(const QIcon &icon); - void setVirtualDesktop(quint32 desktop); void unmap(); void setState(org_kde_plasma_window_management_state flag, bool set); void setParentWindow(PlasmaWindowInterface *parent); void setGeometry(const QRect &geometry); - void setWindowId(const quint32 &winid); - wl_resource *resourceForParent(PlasmaWindowInterface *parent, wl_resource *child) const; + void setApplicationMenuPaths(const QString &service, const QString &object); + void setWindowId(quint32 winid); + wl_resource *resourceForParent(PlasmaWindowInterface *parent, Resource *child) const; - QVector resources; quint32 windowId = 0; - QHash minimizedGeometries; + QHash minimizedGeometries; PlasmaWindowManagementInterface *wm; bool unmapped = false; PlasmaWindowInterface *parentWindow = nullptr; QMetaObject::Connection parentWindowDestroyConnection; QStringList plasmaVirtualDesktops; + QStringList plasmaActivities; QRect geometry; - -private: - static void unbind(wl_resource *resource); - static void setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state); - static void setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number); - static void closeCallback(wl_client *client, wl_resource *resource); - static void requestMoveCallback(wl_client *client, wl_resource *resource); - static void requestResizeCallback(wl_client *client, wl_resource *resource); - static void setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height); - static void unsetMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel); - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getIconCallback(wl_client *client, wl_resource *resource, int32_t fd); - static void requestEnterVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id); - static void requestEnterNewVirtualDesktopCallback(wl_client *client, wl_resource *resource); - static void requestLeaveVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id); - static Private *cast(wl_resource *resource) { - return reinterpret_cast(wl_resource_get_user_data(resource)); - } - PlasmaWindowInterface *q; QString m_title; QString m_appId; quint32 m_pid = 0; - quint32 m_windowId = 0; QString m_themedIconName; + QString m_appServiceName; + QString m_appObjectPath; QIcon m_icon; - quint32 m_virtualDesktop = 0; quint32 m_state = 0; - wl_listener listener; - static const struct org_kde_plasma_window_interface s_interface; -}; + QString uuid; -const quint32 PlasmaWindowManagementInterface::Private::s_version = 9; +protected: + void org_kde_plasma_window_bind_resource(Resource *resource) override; + void org_kde_plasma_window_set_state(Resource *resource, uint32_t flags, uint32_t state) override; + void org_kde_plasma_window_set_virtual_desktop(Resource *resource, uint32_t number) override; + void org_kde_plasma_window_set_minimized_geometry(Resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) override; + void org_kde_plasma_window_unset_minimized_geometry(Resource *resource, wl_resource *panel) override; + void org_kde_plasma_window_close(Resource *resource) override; + void org_kde_plasma_window_request_move(Resource *resource) override; + void org_kde_plasma_window_request_resize(Resource *resource) override; + void org_kde_plasma_window_destroy(Resource *resource) override; + void org_kde_plasma_window_get_icon(Resource *resource, int32_t fd) override; + void org_kde_plasma_window_request_enter_virtual_desktop(Resource *resource, const QString &id) override; + void org_kde_plasma_window_request_enter_new_virtual_desktop(Resource *resource) override; + void org_kde_plasma_window_request_leave_virtual_desktop(Resource *resource, const QString &id) override; + void org_kde_plasma_window_request_enter_activity(Resource *resource, const QString &id) override; + void org_kde_plasma_window_request_leave_activity(Resource *resource, const QString &id) override; + void org_kde_plasma_window_send_to_output(Resource *resource, struct wl_resource *output) override; +}; -PlasmaWindowManagementInterface::Private::Private(PlasmaWindowManagementInterface *q, Display *d) - : Global::Private(d, &org_kde_plasma_window_management_interface, s_version) - , q(q) +PlasmaWindowManagementInterfacePrivate::PlasmaWindowManagementInterfacePrivate(PlasmaWindowManagementInterface *_q, Display *display) + : QtWaylandServer::org_kde_plasma_window_management(*display, s_version) + , q(_q) { } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_window_management_interface PlasmaWindowManagementInterface::Private::s_interface = { - showDesktopCallback, - getWindowCallback -}; -#endif - -void PlasmaWindowManagementInterface::Private::sendShowingDesktopState() +void PlasmaWindowManagementInterfacePrivate::sendShowingDesktopState() { - for (wl_resource *r : resources) { - sendShowingDesktopState(r); + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + sendShowingDesktopState(resource->handle); } } -void PlasmaWindowManagementInterface::Private::sendShowingDesktopState(wl_resource *r) +void PlasmaWindowManagementInterfacePrivate::sendShowingDesktopState(wl_resource *r) { uint32_t s = 0; switch (state) { - case ShowingDesktopState::Enabled: - s = ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED; + case PlasmaWindowManagementInterface::ShowingDesktopState::Enabled: + s = QtWaylandServer::org_kde_plasma_window_management::show_desktop_enabled; break; - case ShowingDesktopState::Disabled: - s = ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED; + case PlasmaWindowManagementInterface::ShowingDesktopState::Disabled: + s = QtWaylandServer::org_kde_plasma_window_management::show_desktop_disabled; break; default: Q_UNREACHABLE(); break; } - org_kde_plasma_window_management_send_show_desktop_changed(r, s); + send_show_desktop_changed(r, s); } -void PlasmaWindowManagementInterface::Private::showDesktopCallback(wl_client *client, wl_resource *resource, uint32_t state) +void PlasmaWindowManagementInterfacePrivate::sendStackingOrderChanged() { - Q_UNUSED(client) - ShowingDesktopState s = ShowingDesktopState::Disabled; + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + sendStackingOrderChanged(resource->handle); + } +} + +void PlasmaWindowManagementInterfacePrivate::sendStackingOrderChanged(wl_resource *r) +{ + if (wl_resource_get_version(r) < ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STACKING_ORDER_CHANGED_SINCE_VERSION) { + return; + } + + send_stacking_order_changed(r, QByteArray::fromRawData(reinterpret_cast(stackingOrder.constData()), sizeof(uint32_t) * stackingOrder.size())); +} + +void PlasmaWindowManagementInterfacePrivate::sendStackingOrderUuidsChanged() +{ + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + sendStackingOrderUuidsChanged(resource->handle); + } +} + +void PlasmaWindowManagementInterfacePrivate::sendStackingOrderUuidsChanged(wl_resource *r) +{ + if (wl_resource_get_version(r) < ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STACKING_ORDER_UUID_CHANGED_SINCE_VERSION) { + return; + } + + QString uuids; + for (const auto &uuid : qAsConst(stackingOrderUuids)) { + uuids += uuid; + uuids += QLatin1Char(';'); + } + // Remove the trailing ';', on the receiving side this is interpreted as an empty uuid. + if (stackingOrderUuids.size() > 0) { + uuids.remove(uuids.length() - 1, 1); + } + send_stacking_order_uuid_changed(r, uuids); +} + +void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_bind_resource(Resource *resource) +{ + for (auto window : windows) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_MANAGEMENT_WINDOW_WITH_UUID_SINCE_VERSION) { + send_window_with_uuid(resource->handle, window->d->windowId, window->d->uuid); + } else { + send_window(resource->handle, window->d->windowId); + } + } + sendStackingOrderChanged(resource->handle); + sendStackingOrderUuidsChanged(resource->handle); +} + +void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_show_desktop(Resource *resource, uint32_t state) +{ + Q_UNUSED(resource) + PlasmaWindowManagementInterface::ShowingDesktopState s = PlasmaWindowManagementInterface::ShowingDesktopState::Disabled; switch (state) { case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED: - s = ShowingDesktopState::Enabled; + s = PlasmaWindowManagementInterface::ShowingDesktopState::Enabled; break; case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_DISABLED: default: - s = ShowingDesktopState::Disabled; + s = PlasmaWindowManagementInterface::ShowingDesktopState::Disabled; break; } - emit reinterpret_cast(wl_resource_get_user_data(resource))->q->requestChangeShowingDesktop(s); + Q_EMIT q->requestChangeShowingDesktop(s); } -void PlasmaWindowManagementInterface::Private::getWindowCallback(wl_client *client, wl_resource *resource, uint32_t id, uint32_t internalWindowId) +void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_get_window(Resource *resource, uint32_t id, uint32_t internal_window_id) { - Q_UNUSED(client) - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - auto it = std::find_if(p->windows.constBegin(), p->windows.constEnd(), - [internalWindowId] (PlasmaWindowInterface *window) { - return window->d->windowId == internalWindowId; + for (auto window : windows) { + if (window->d->windowId == internal_window_id) { + window->d->add(resource->client(), id, resource->version()); + return; } - ); - if (it == p->windows.constEnd()) { - // create a temp window just for the resource and directly send an unmapped - PlasmaWindowInterface *window = new PlasmaWindowInterface(p->q, p->q); - window->d->unmapped = true; - window->d->createResource(resource, id); - return; } - (*it)->d->createResource(resource, id); + // create a temp window just for the resource, bind then immediately delete it, sending an unmap event + PlasmaWindowInterface window(q, q); + window.d->add(resource->client(), id, resource->version()); } -PlasmaWindowManagementInterface::PlasmaWindowManagementInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_get_window_by_uuid(Resource *resource, + uint32_t id, + const QString &internal_window_uuid) { -} - -PlasmaWindowManagementInterface::~PlasmaWindowManagementInterface() = default; - -void PlasmaWindowManagementInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *shell = c->createResource(&org_kde_plasma_window_management_interface, qMin(version, s_version), id); - if (!shell) { - wl_client_post_no_memory(client); + auto it = std::find_if(windows.constBegin(), windows.constEnd(), [internal_window_uuid](PlasmaWindowInterface *window) { + return window->d->uuid == internal_window_uuid; + }); + if (it == windows.constEnd()) { + qCWarning(KWAYLAND_SERVER) << "Could not find window with uuid" << internal_window_uuid; + // create a temp window just for the resource, bind then immediately delete it, sending an unmap event + PlasmaWindowInterface window(q, q); + window.d->add(resource->client(), id, resource->version()); return; } - wl_resource_set_implementation(shell, &s_interface, this, unbind); - resources << shell; - for (auto it = windows.constBegin(); it != windows.constEnd(); ++it) { - org_kde_plasma_window_management_send_window(shell, (*it)->d->windowId); - } + (*it)->d->add(resource->client(), id, resource->version()); } -void PlasmaWindowManagementInterface::Private::unbind(wl_resource *resource) +PlasmaWindowManagementInterface::PlasmaWindowManagementInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new PlasmaWindowManagementInterfacePrivate(this, display)) { - auto wm = reinterpret_cast(wl_resource_get_user_data(resource)); - wm->resources.removeAll(resource); } +PlasmaWindowManagementInterface::~PlasmaWindowManagementInterface() = default; + void PlasmaWindowManagementInterface::setShowingDesktopState(PlasmaWindowManagementInterface::ShowingDesktopState state) { - Q_D(); if (d->state == state) { return; } @@ -239,50 +260,53 @@ d->sendShowingDesktopState(); } -PlasmaWindowManagementInterface::Private *PlasmaWindowManagementInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -PlasmaWindowInterface *PlasmaWindowManagementInterface::createWindow(QObject *parent) +PlasmaWindowInterface *PlasmaWindowManagementInterface::createWindow(QObject *parent, const QUuid &uuid) { - Q_D(); PlasmaWindowInterface *window = new PlasmaWindowInterface(this, parent); - // TODO: improve window ids so that it cannot wrap around - window->d->windowId = ++d->windowIdCounter; - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_window_management_send_window(*it, window->d->windowId); + + window->d->uuid = uuid.toString(); + window->d->windowId = ++d->windowIdCounter; // NOTE the window id is deprecated + + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_MANAGEMENT_WINDOW_WITH_UUID_SINCE_VERSION) { + d->send_window_with_uuid(resource->handle, window->d->windowId, window->d->uuid); + } else { + d->send_window(resource->handle, window->d->windowId); + } } d->windows << window; - connect(window, &QObject::destroyed, this, - [this, window] { - Q_D(); - d->windows.removeAll(window); - } - ); + connect(window, &QObject::destroyed, this, [this, window] { + d->windows.removeAll(window); + }); return window; } -QList PlasmaWindowManagementInterface::windows() const +QList PlasmaWindowManagementInterface::windows() const { - Q_D(); return d->windows; } -void PlasmaWindowManagementInterface::unmapWindow(PlasmaWindowInterface *window) +void PlasmaWindowManagementInterface::setStackingOrder(const QVector &stackingOrder) { - if (!window) { + if (d->stackingOrder == stackingOrder) { return; } - Q_D(); - d->windows.removeOne(window); - Q_ASSERT(!d->windows.contains(window)); - window->d->unmap(); + d->stackingOrder = stackingOrder; + d->sendStackingOrderChanged(); +} + +void PlasmaWindowManagementInterface::setStackingOrderUuids(const QVector &stackingOrderUuids) +{ + if (d->stackingOrderUuids == stackingOrderUuids) { + return; + } + d->stackingOrderUuids = stackingOrderUuids; + d->sendStackingOrderUuidsChanged(); } void PlasmaWindowManagementInterface::setPlasmaVirtualDesktopManagementInterface(PlasmaVirtualDesktopManagementInterface *manager) { - Q_D(); if (d->plasmaVirtualDesktopManagementInterface == manager) { return; } @@ -291,234 +315,208 @@ PlasmaVirtualDesktopManagementInterface *PlasmaWindowManagementInterface::plasmaVirtualDesktopManagementInterface() const { - Q_D(); return d->plasmaVirtualDesktopManagementInterface; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_plasma_window_interface PlasmaWindowInterface::Private::s_interface = { - setStateCallback, - setVirtualDesktopCallback, - setMinimizedGeometryCallback, - unsetMinimizedGeometryCallback, - closeCallback, - requestMoveCallback, - requestResizeCallback, - destroyCallback, - getIconCallback, - requestEnterVirtualDesktopCallback, - requestEnterNewVirtualDesktopCallback, - requestLeaveVirtualDesktopCallback -}; -#endif - -PlasmaWindowInterface::Private::Private(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q) - : wm(wm) +//////PlasmaWindow +PlasmaWindowInterfacePrivate::PlasmaWindowInterfacePrivate(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q) + : QtWaylandServer::org_kde_plasma_window() + , wm(wm) , q(q) { } -PlasmaWindowInterface::Private::~Private() -{ - // need to copy, as destroy goes through the destroy listener and modifies the list as we iterate - const auto c = resources; - for (const auto &r : c) { - auto client = wl_resource_get_client(r); - org_kde_plasma_window_send_unmapped(r); - wl_resource_destroy(r); - wl_client_flush(client); - } -} - -void PlasmaWindowInterface::Private::destroyCallback(wl_client *, wl_resource *r) +PlasmaWindowInterfacePrivate::~PlasmaWindowInterfacePrivate() { - Private *p = cast(r); - p->resources.removeAll(r); - wl_resource_destroy(r); - if (p->unmapped && p->resources.isEmpty()) { - p->q->deleteLater(); - } + unmap(); } -void PlasmaWindowInterface::Private::unbind(wl_resource *resource) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_destroy(Resource *resource) { - Private *p = reinterpret_cast(wl_resource_get_user_data(resource)); - p->resources.removeAll(resource); - if (p->unmapped && p->resources.isEmpty()) { - p->q->deleteLater(); - } + wl_resource_destroy(resource->handle); } -void PlasmaWindowInterface::Private::createResource(wl_resource *parent, uint32_t id) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_bind_resource(Resource *resource) { - ClientConnection *c = wm->display()->getConnection(wl_resource_get_client(parent)); - wl_resource *resource = c->createResource(&org_kde_plasma_window_interface, wl_resource_get_version(parent), id); - if (!resource) { - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - resources << resource; - - org_kde_plasma_window_send_virtual_desktop_changed(resource, m_virtualDesktop); for (const auto &desk : plasmaVirtualDesktops) { - org_kde_plasma_window_send_virtual_desktop_entered(resource, desk.toUtf8().constData()); + send_virtual_desktop_entered(resource->handle, desk); + } + for (const auto &activity : plasmaActivities) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_ACTIVITY_ENTERED_SINCE_VERSION) { + send_activity_entered(resource->handle, activity); + } } if (!m_appId.isEmpty()) { - org_kde_plasma_window_send_app_id_changed(resource, m_appId.toUtf8().constData()); + send_app_id_changed(resource->handle, m_appId); } if (m_pid != 0) { - org_kde_plasma_window_send_pid_changed(resource, m_pid); - } - if(m_windowId != 0){ - org_kde_plasma_window_send_window_id(resource,m_windowId); + send_pid_changed(resource->handle, m_pid); } if (!m_title.isEmpty()) { - org_kde_plasma_window_send_title_changed(resource, m_title.toUtf8().constData()); + send_title_changed(resource->handle, m_title); } - org_kde_plasma_window_send_state_changed(resource, m_state); + if (!m_appObjectPath.isEmpty() || !m_appServiceName.isEmpty()) { + send_application_menu(resource->handle, m_appServiceName, m_appObjectPath); + } + send_state_changed(resource->handle, m_state); if (!m_themedIconName.isEmpty()) { - org_kde_plasma_window_send_themed_icon_name_changed(resource, m_themedIconName.toUtf8().constData()); - } else { - if (wl_resource_get_version(resource) >= ORG_KDE_PLASMA_WINDOW_ICON_CHANGED_SINCE_VERSION) { - org_kde_plasma_window_send_icon_changed(resource); + send_themed_icon_name_changed(resource->handle, m_themedIconName); + } else if (!m_icon.isNull()) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_ICON_CHANGED_SINCE_VERSION) { + send_icon_changed(resource->handle); } } - org_kde_plasma_window_send_parent_window(resource, resourceForParent(parentWindow, resource)); - - if (unmapped) { - org_kde_plasma_window_send_unmapped(resource); - } + send_parent_window(resource->handle, resourceForParent(parentWindow, resource)); - if (geometry.isValid() && wl_resource_get_version(resource) >= ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { - org_kde_plasma_window_send_geometry(resource, geometry.x(), geometry.y(), geometry.width(), geometry.height()); + if (geometry.isValid() && resource->version() >= ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { + send_geometry(resource->handle, geometry.x(), geometry.y(), geometry.width(), geometry.height()); } - if (wl_resource_get_version(resource) >= ORG_KDE_PLASMA_WINDOW_INITIAL_STATE_SINCE_VERSION) { - org_kde_plasma_window_send_initial_state(resource); + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_INITIAL_STATE_SINCE_VERSION) { + send_initial_state(resource->handle); } - c->flush(); } -void PlasmaWindowInterface::Private::setAppId(const QString &appId) +void PlasmaWindowInterfacePrivate::setAppId(const QString &appId) { if (m_appId == appId) { return; } + m_appId = appId; - const QByteArray utf8 = m_appId.toUtf8(); - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_app_id_changed(*it, utf8.constData()); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_app_id_changed(resource->handle, m_appId); } } -void PlasmaWindowInterface::Private::setPid(quint32 pid) +void PlasmaWindowInterfacePrivate::setPid(quint32 pid) { if (m_pid == pid) { return; } m_pid = pid; - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_pid_changed(*it, pid); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_pid_changed(resource->handle, pid); } } -void PlasmaWindowInterface::Private::setThemedIconName(const QString &iconName) +void PlasmaWindowInterfacePrivate::setWindowId(quint32 winid) +{ + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_window_id(resource->handle, winid); + } +} + +void PlasmaWindowInterfacePrivate::setThemedIconName(const QString &iconName) { if (m_themedIconName == iconName) { return; } m_themedIconName = iconName; - const QByteArray utf8 = m_themedIconName.toUtf8(); - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_themed_icon_name_changed(*it, utf8.constData()); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_themed_icon_name_changed(resource->handle, m_themedIconName); } } -void PlasmaWindowInterface::Private::setIcon(const QIcon &icon) +void PlasmaWindowInterfacePrivate::setIcon(const QIcon &icon) { m_icon = icon; setThemedIconName(m_icon.name()); - if (m_icon.name().isEmpty()) { - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - if (wl_resource_get_version(*it) >= ORG_KDE_PLASMA_WINDOW_ICON_CHANGED_SINCE_VERSION) { - org_kde_plasma_window_send_icon_changed(*it); - } + + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_ICON_CHANGED_SINCE_VERSION) { + send_icon_changed(resource->handle); } } } -void PlasmaWindowInterface::Private::getIconCallback(wl_client *client, wl_resource *resource, int32_t fd) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_get_icon(Resource *resource, int32_t fd) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) QtConcurrent::run( - [fd] (const QIcon &icon) { + [fd](const QIcon &icon) { QFile file; file.open(fd, QIODevice::WriteOnly, QFileDevice::AutoCloseHandle); QDataStream ds(&file); ds << icon; file.close(); - }, p->m_icon - ); + }, + m_icon); } -void PlasmaWindowInterface::Private::requestEnterVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_virtual_desktop(Resource *resource, const QString &id) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->enterPlasmaVirtualDesktopRequested(QString::fromUtf8(id)); + Q_UNUSED(resource) + Q_EMIT q->enterPlasmaVirtualDesktopRequested(id); } -void PlasmaWindowInterface::Private::requestEnterNewVirtualDesktopCallback(wl_client *client, wl_resource *resource) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_new_virtual_desktop(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->enterNewPlasmaVirtualDesktopRequested(); + Q_UNUSED(resource) + Q_EMIT q->enterNewPlasmaVirtualDesktopRequested(); } -void PlasmaWindowInterface::Private::requestLeaveVirtualDesktopCallback(wl_client *client, wl_resource *resource, const char *id) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_leave_virtual_desktop(Resource *resource, const QString &id) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->leavePlasmaVirtualDesktopRequested(QString::fromUtf8(id)); + Q_UNUSED(resource) + Q_EMIT q->leavePlasmaVirtualDesktopRequested(id); } -void PlasmaWindowInterface::Private::setTitle(const QString &title) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_activity(Resource *resource, const QString &id) +{ + Q_UNUSED(resource) + Q_EMIT q->enterPlasmaActivityRequested(id); +} + +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_leave_activity(Resource *resource, const QString &id) +{ + Q_UNUSED(resource) + Q_EMIT q->leavePlasmaActivityRequested(id); +} + +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_send_to_output(Resource *resource, struct wl_resource *output) +{ + Q_UNUSED(resource) + Q_EMIT q->sendToOutput(KWaylandServer::OutputInterface::get(output)); +} + +void PlasmaWindowInterfacePrivate::setTitle(const QString &title) { if (m_title == title) { return; } m_title = title; - const QByteArray utf8 = m_title.toUtf8(); - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_title_changed(*it, utf8.constData()); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_title_changed(resource->handle, m_title); } } -void PlasmaWindowInterface::Private::setVirtualDesktop(quint32 desktop) +void PlasmaWindowInterfacePrivate::unmap() { - if (m_virtualDesktop == desktop) { + if (unmapped) { return; } - m_virtualDesktop = desktop; - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_virtual_desktop_changed(*it, m_virtualDesktop); - } -} - -void PlasmaWindowInterface::Private::unmap() -{ unmapped = true; - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_unmapped(*it); - } - if (resources.isEmpty()) { - q->deleteLater(); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_unmapped(resource->handle); } } -void PlasmaWindowInterface::Private::setState(org_kde_plasma_window_management_state flag, bool set) +void PlasmaWindowInterfacePrivate::setState(org_kde_plasma_window_management_state flag, bool set) { quint32 newState = m_state; if (set) { @@ -530,28 +528,30 @@ return; } m_state = newState; - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_state_changed(*it, m_state); + const auto clientResources = resourceMap(); + + for (auto resource : clientResources) { + send_state_changed(resource->handle, m_state); } } -wl_resource *PlasmaWindowInterface::Private::resourceForParent(PlasmaWindowInterface *parent, wl_resource *child) const +wl_resource *PlasmaWindowInterfacePrivate::resourceForParent(PlasmaWindowInterface *parent, Resource *child) const { if (!parent) { return nullptr; } - auto it = std::find_if(parent->d->resources.begin(), parent->d->resources.end(), - [child] (wl_resource *parentResource) { - return wl_resource_get_client(child) == wl_resource_get_client(parentResource); - } - ); - if (it != parent->d->resources.end()) { - return *it; + + const auto parentResource = parent->d->resourceMap(); + + for (auto resource : parentResource) { + if (child->client() == resource->client()) { + return resource->handle; + } } return nullptr; } -void PlasmaWindowInterface::Private::setParentWindow(PlasmaWindowInterface *window) +void PlasmaWindowInterfacePrivate::setParentWindow(PlasmaWindowInterface *window) { if (parentWindow == window) { return; @@ -560,22 +560,22 @@ parentWindowDestroyConnection = QMetaObject::Connection(); parentWindow = window; if (parentWindow) { - parentWindowDestroyConnection = QObject::connect(window, &QObject::destroyed, q, - [this] { - parentWindow = nullptr; - parentWindowDestroyConnection = QMetaObject::Connection(); - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_parent_window(*it, nullptr); - } + parentWindowDestroyConnection = QObject::connect(window, &QObject::destroyed, q, [this] { + parentWindow = nullptr; + parentWindowDestroyConnection = QMetaObject::Connection(); + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + send_parent_window(resource->handle, nullptr); } - ); + }); } - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - org_kde_plasma_window_send_parent_window(*it, resourceForParent(window, *it)); + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + send_parent_window(resource->handle, resourceForParent(window, resource)); } } -void PlasmaWindowInterface::Private::setGeometry(const QRect &geo) +void PlasmaWindowInterfacePrivate::setGeometry(const QRect &geo) { if (geometry == geo) { return; @@ -584,157 +584,162 @@ if (!geometry.isValid()) { return; } - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - auto resource = *it; - if (wl_resource_get_version(resource) < ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { + + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + if (resource->version() < ORG_KDE_PLASMA_WINDOW_GEOMETRY_SINCE_VERSION) { continue; } - org_kde_plasma_window_send_geometry(resource, geometry.x(), geometry.y(), geometry.width(), geometry.height()); + send_geometry(resource->handle, geometry.x(), geometry.y(), geometry.width(), geometry.height()); } } -void PlasmaWindowInterface::Private::setWindowId(const quint32 &winid) +void PlasmaWindowInterfacePrivate::setApplicationMenuPaths(const QString &service, const QString &object) { - if(m_windowId == winid){ + if (m_appServiceName == service && m_appObjectPath == object) { return; } - m_windowId = winid; - for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { - auto resource = *it; - org_kde_plasma_window_send_window_id(resource,winid); + m_appServiceName = service; + m_appObjectPath = object; + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + if (resource->version() < ORG_KDE_PLASMA_WINDOW_APPLICATION_MENU_SINCE_VERSION) { + continue; + } + send_application_menu(resource->handle, service, object); } } -void PlasmaWindowInterface::Private::closeCallback(wl_client *client, wl_resource *resource) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_close(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->closeRequested(); + Q_UNUSED(resource) + Q_EMIT q->closeRequested(); } -void PlasmaWindowInterface::Private::requestMoveCallback(wl_client *client, wl_resource *resource) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_move(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->moveRequested(); + Q_UNUSED(resource) + Q_EMIT q->moveRequested(); } -void PlasmaWindowInterface::Private::requestResizeCallback(wl_client *client, wl_resource *resource) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_resize(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->resizeRequested(); + Q_UNUSED(resource) + Q_EMIT q->resizeRequested(); } -void PlasmaWindowInterface::Private::setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_virtual_desktop(Resource *resource, uint32_t number) { - Q_UNUSED(client) - Private *p = cast(resource); - emit p->q->virtualDesktopRequested(number); + Q_UNUSED(resource) + Q_UNUSED(number) + + // This method is intentionally left blank. } -void PlasmaWindowInterface::Private::setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_state(Resource *resource, uint32_t flags, uint32_t state) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE) { - emit p->q->activeRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); + Q_EMIT q->activeRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED) { - emit p->q->minimizedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED); + Q_EMIT q->minimizedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZED); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED) { - emit p->q->maximizedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED); + Q_EMIT q->maximizedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZED); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREEN) { - emit p->q->fullscreenRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREEN); + Q_EMIT q->fullscreenRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREEN); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE) { - emit p->q->keepAboveRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE); + Q_EMIT q->keepAboveRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW) { - emit p->q->keepBelowRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW); + Q_EMIT q->keepBelowRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_DEMANDS_ATTENTION) { - emit p->q->demandsAttentionRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_DEMANDS_ATTENTION); + Q_EMIT q->demandsAttentionRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_DEMANDS_ATTENTION); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_CLOSEABLE) { - emit p->q->closeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_CLOSEABLE); + Q_EMIT q->closeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_CLOSEABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZABLE) { - emit p->q->minimizeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZABLE); + Q_EMIT q->minimizeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MINIMIZABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZABLE) { - emit p->q->maximizeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZABLE); + Q_EMIT q->maximizeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MAXIMIZABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE) { - emit p->q->fullscreenableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE); + Q_EMIT q->fullscreenableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_FULLSCREENABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR) { - emit p->q->skipTaskbarRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR); + Q_EMIT q->skipTaskbarRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER) { - emit p->q->skipSwitcherRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER); + Q_EMIT q->skipSwitcherRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE) { - emit p->q->shadeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE); + Q_EMIT q->shadeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED) { - emit p->q->shadedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); + Q_EMIT q->shadedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE) { - emit p->q->movableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE); + Q_EMIT q->movableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE) { - emit p->q->resizableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE); + Q_EMIT q->resizableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE); } if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE) { - emit p->q->virtualDesktopChangeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE); + Q_EMIT q->virtualDesktopChangeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_VIRTUAL_DESKTOP_CHANGEABLE); } } -void PlasmaWindowInterface::Private::setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_minimized_geometry(Resource *resource, + wl_resource *panel, + uint32_t x, + uint32_t y, + uint32_t width, + uint32_t height) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) SurfaceInterface *panelSurface = SurfaceInterface::get(panel); if (!panelSurface) { return; } - if (p->minimizedGeometries.value(panelSurface) == QRect(x, y, width, height)) { + if (minimizedGeometries.value(panelSurface) == QRect(x, y, width, height)) { return; } - p->minimizedGeometries[panelSurface] = QRect(x, y, width, height); - emit p->q->minimizedGeometriesChanged(); - connect(panelSurface, &QObject::destroyed, p->q, [p, panelSurface] () { - if (p->minimizedGeometries.remove(panelSurface)) { - emit p->q->minimizedGeometriesChanged(); + minimizedGeometries[panelSurface] = QRect(x, y, width, height); + Q_EMIT q->minimizedGeometriesChanged(); + QObject::connect(panelSurface, &QObject::destroyed, q, [this, panelSurface]() { + if (minimizedGeometries.remove(panelSurface)) { + Q_EMIT q->minimizedGeometriesChanged(); } }); } -void PlasmaWindowInterface::Private::unsetMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel) +void PlasmaWindowInterfacePrivate::org_kde_plasma_window_unset_minimized_geometry(Resource *resource, wl_resource *panel) { - Q_UNUSED(client) - Private *p = cast(resource); + Q_UNUSED(resource) SurfaceInterface *panelSurface = SurfaceInterface::get(panel); if (!panelSurface) { return; } - if (!p->minimizedGeometries.contains(panelSurface)) { + if (!minimizedGeometries.contains(panelSurface)) { return; } - p->minimizedGeometries.remove(panelSurface); - emit p->q->minimizedGeometriesChanged(); + minimizedGeometries.remove(panelSurface); + Q_EMIT q->minimizedGeometriesChanged(); } PlasmaWindowInterface::PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent) : QObject(parent) - , d(new Private(wm, this)) + , d(new PlasmaWindowInterfacePrivate(wm, this)) { } @@ -755,19 +760,12 @@ d->setTitle(title); } -#ifndef KWAYLANDSERVER_NO_DEPRECATED -void PlasmaWindowInterface::setVirtualDesktop(quint32 desktop) -{ - d->setVirtualDesktop(desktop); -} -#endif - void PlasmaWindowInterface::unmap() { - d->wm->unmapWindow(this); + d->unmap(); } -QHash PlasmaWindowInterface::minimizedGeometries() const +QHash PlasmaWindowInterface::minimizedGeometries() const { return d->minimizedGeometries; } @@ -804,22 +802,22 @@ void PlasmaWindowInterface::setOnAllDesktops(bool set) { - //the deprecated vd management + // the deprecated vd management d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ON_ALL_DESKTOPS, set); if (!d->wm->plasmaVirtualDesktopManagementInterface()) { return; } - - //the current vd management + const auto clientResources = d->resourceMap(); + // the current vd management if (set) { if (d->plasmaVirtualDesktops.isEmpty()) { return; } - //leaving everything means on all desktops + // leaving everything means on all desktops for (auto desk : plasmaVirtualDesktops()) { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_window_send_virtual_desktop_left(*it, desk.toUtf8().constData()); + for (auto resource : clientResources) { + d->send_virtual_desktop_left(resource->handle, desk); } } d->plasmaVirtualDesktops.clear(); @@ -827,12 +825,12 @@ if (!d->plasmaVirtualDesktops.isEmpty()) { return; } - //enters the desktops which are active (usually only one but not a given) + // enters the desktops which are active (usually only one but not a given) for (auto desk : d->wm->plasmaVirtualDesktopManagementInterface()->desktops()) { if (desk->isActive() && !d->plasmaVirtualDesktops.contains(desk->id())) { d->plasmaVirtualDesktops << desk->id(); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_window_send_virtual_desktop_entered(*it, desk->id().toUtf8().constData()); + for (auto resource : clientResources) { + d->send_virtual_desktop_entered(resource->handle, desk->id()); } } } @@ -874,13 +872,6 @@ d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER, skip); } -#ifndef KWAYLANDSERVER_NO_DEPRECATED -void PlasmaWindowInterface::setThemedIconName(const QString &iconName) -{ - d->setThemedIconName(iconName); -} -#endif - void PlasmaWindowInterface::setIcon(const QIcon &icon) { d->setIcon(icon); @@ -888,7 +879,7 @@ void PlasmaWindowInterface::addPlasmaVirtualDesktop(const QString &id) { - //don't add a desktop we're not sure it exists + // don't add a desktop we're not sure it exists if (!d->wm->plasmaVirtualDesktopManagementInterface() || d->plasmaVirtualDesktops.contains(id)) { return; } @@ -901,12 +892,14 @@ d->plasmaVirtualDesktops << id; - //if the desktop dies, remove it from or list - connect(desktop, &QObject::destroyed, - this, [this, id](){removePlasmaVirtualDesktop(id);}); + // if the desktop dies, remove it from or list + connect(desktop, &QObject::destroyed, this, [this, id]() { + removePlasmaVirtualDesktop(id); + }); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_window_send_virtual_desktop_entered(*it, id.toUtf8().constData()); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_virtual_desktop_entered(resource->handle, id); } } @@ -917,11 +910,12 @@ } d->plasmaVirtualDesktops.removeAll(id); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - org_kde_plasma_window_send_virtual_desktop_left(*it, id.toUtf8().constData()); + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_virtual_desktop_left(resource->handle, id); } - //we went on all desktops + // we went on all desktops if (d->plasmaVirtualDesktops.isEmpty()) { setOnAllDesktops(true); } @@ -932,9 +926,39 @@ return d->plasmaVirtualDesktops; } -void PlasmaWindowInterface::setWindowId(quint32 winid) +void PlasmaWindowInterface::addPlasmaActivity(const QString &id) { - d->setWindowId(winid); + if (d->plasmaActivities.contains(id)) { + return; + } + + d->plasmaActivities << id; + + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_ACTIVITY_ENTERED_SINCE_VERSION) { + d->send_activity_entered(resource->handle, id); + } + } +} + +void PlasmaWindowInterface::removePlasmaActivity(const QString &id) +{ + if (!d->plasmaActivities.removeOne(id)) { + return; + } + + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_ACTIVITY_LEFT_SINCE_VERSION) { + d->send_activity_left(resource->handle, id); + } + } +} + +QStringList PlasmaWindowInterface::plasmaActivities() const +{ + return d->plasmaActivities; } void PlasmaWindowInterface::setShadeable(bool set) @@ -972,5 +996,98 @@ d->setGeometry(geometry); } +void PlasmaWindowInterface::setApplicationMenuPaths(const QString &serviceName, const QString &objectPath) +{ + d->setApplicationMenuPaths(serviceName, objectPath); +} + +quint32 PlasmaWindowInterface::internalId() const +{ + return d->windowId; +} + +void PlasmaWindowInterface::setWindowId(quint32 winid) +{ + d->setWindowId(winid); +} + +QString PlasmaWindowInterface::uuid() const +{ + return d->uuid; +} + +class PlasmaWindowActivationFeedbackInterfacePrivate : public QtWaylandServer::org_kde_plasma_activation_feedback +{ +public: + PlasmaWindowActivationFeedbackInterfacePrivate(Display *display); + +protected: + void org_kde_plasma_activation_feedback_destroy(Resource *resource) override; +}; + +class PlasmaWindowActivationInterfacePrivate : public QtWaylandServer::org_kde_plasma_activation +{ +public: + PlasmaWindowActivationInterfacePrivate(PlasmaWindowActivationInterface *q) + : QtWaylandServer::org_kde_plasma_activation() + , q(q) + { + } + + PlasmaWindowActivationInterface *const q; +}; + +PlasmaWindowActivationFeedbackInterfacePrivate::PlasmaWindowActivationFeedbackInterfacePrivate(Display *display) + : QtWaylandServer::org_kde_plasma_activation_feedback(*display, s_activationVersion) +{ } + +void PlasmaWindowActivationFeedbackInterfacePrivate::org_kde_plasma_activation_feedback_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +PlasmaWindowActivationFeedbackInterface::PlasmaWindowActivationFeedbackInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new PlasmaWindowActivationFeedbackInterfacePrivate(display)) +{ +} + +PlasmaWindowActivationFeedbackInterface::~PlasmaWindowActivationFeedbackInterface() +{ +} + +PlasmaWindowActivationInterface *PlasmaWindowActivationFeedbackInterface::createActivation(const QString &appid) +{ + auto activation = new PlasmaWindowActivationInterface; + const auto resources = d->resourceMap(); + for (auto resource : resources) { + auto activationResource = activation->d->add(resource->client(), resource->version()); + d->send_activation(resource->handle, activationResource->handle); + } + activation->sendAppId(appid); + return activation; +} + +PlasmaWindowActivationInterface::PlasmaWindowActivationInterface() + : d(new PlasmaWindowActivationInterfacePrivate(this)) +{ +} + +PlasmaWindowActivationInterface::~PlasmaWindowActivationInterface() +{ + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_finished(resource->handle); + } +} + +void PlasmaWindowActivationInterface::sendAppId(const QString &appid) +{ + const auto clientResources = d->resourceMap(); + for (auto resource : clientResources) { + d->send_app_id(resource->handle, appid); + } +} + } diff -Nru dwayland-5.57.0.23/src/server/plasmawindowmanagement_interface.h dwayland-5.57.0.24+really5.24.3/src/server/plasmawindowmanagement_interface.h --- dwayland-5.57.0.23/src/server/plasmawindowmanagement_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/plasmawindowmanagement_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,100 +1,102 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H -#define WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include -#include - -#include "global.h" -#include "resource.h" +#include class QSize; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; +class OutputInterface; +class PlasmaWindowActivationFeedbackInterfacePrivate; class PlasmaWindowInterface; -class SurfaceInterface; class PlasmaVirtualDesktopManagementInterface; +class PlasmaWindowActivationInterfacePrivate; +class PlasmaWindowManagementInterfacePrivate; +class PlasmaWindowInterfacePrivate; +class SurfaceInterface; -/** - * @todo Add documentation - */ -class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public Global +class KWAYLANDSERVER_EXPORT PlasmaWindowActivationInterface +{ +public: + ~PlasmaWindowActivationInterface(); + + void sendAppId(const QString &id); + +private: + friend class PlasmaWindowActivationFeedbackInterface; + explicit PlasmaWindowActivationInterface(); + + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT PlasmaWindowActivationFeedbackInterface : public QObject +{ + Q_OBJECT + +public: + explicit PlasmaWindowActivationFeedbackInterface(Display *display, QObject *parent = nullptr); + ~PlasmaWindowActivationFeedbackInterface() override; + + /** + * Notify about a new application with @p app_id being started + * + * @returns an instance of @class PlasmaWindowActivationInterface to + * be destroyed as the activation process ends. + */ + PlasmaWindowActivationInterface *createActivation(const QString &app_id); + +private: + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public QObject { Q_OBJECT + public: - virtual ~PlasmaWindowManagementInterface(); + explicit PlasmaWindowManagementInterface(Display *display, QObject *parent = nullptr); + ~PlasmaWindowManagementInterface() override; enum class ShowingDesktopState { Disabled, - Enabled + Enabled, }; void setShowingDesktopState(ShowingDesktopState state); - PlasmaWindowInterface *createWindow(QObject *parent); - QList windows() const; - - /** - * Unmaps the @p window previously created with {@link createWindow}. - * The window will be unmapped and removed from the list of {@link windows}. - * - * Unmapping a @p window indicates to the client that it should destroy the - * resource created for the window. Once all resources for the @p window are - * destroyed, the @p window will get deleted automatically. There is no need - * to manually delete the @p window. A manual delete will trigger the unmap - * and resource destroy at the same time and can result in protocol errors on - * client side if it still accesses the resource before receiving the unmap event. - * - * @see createWindow - * @see windows - * @since 5.23 - **/ - void unmapWindow(PlasmaWindowInterface *window); + PlasmaWindowInterface *createWindow(QObject *parent, const QUuid &uuid); + QList windows() const; /** * Associate a PlasmaVirtualDesktopManagementInterface to this window management. * It's necessary to associate one in orderto use the plasma virtual desktop features * of PlasmaWindowInterface, as a window must know what are the deasktops available - * @since 5.48 */ void setPlasmaVirtualDesktopManagementInterface(PlasmaVirtualDesktopManagementInterface *manager); /** * @returns the PlasmaVirtualDesktopManagementInterface associated to this PlasmaWindowManagementInterface - * @since 5.48 */ PlasmaVirtualDesktopManagementInterface *plasmaVirtualDesktopManagementInterface() const; + /** + * Associate stacking order to this window management + */ + void setStackingOrder(const QVector &stackingOrder); + + void setStackingOrderUuids(const QVector &stackingOrderUuids); + Q_SIGNALS: void requestChangeShowingDesktop(ShowingDesktopState requestedState); private: - friend class Display; - explicit PlasmaWindowManagementInterface(Display *display, QObject *parent); - class Private; - Private *d_func() const; + QScopedPointer d; }; /** @@ -104,17 +106,11 @@ { Q_OBJECT public: - virtual ~PlasmaWindowInterface(); + ~PlasmaWindowInterface() override; void setTitle(const QString &title); void setAppId(const QString &appId); void setPid(quint32 pid); -#ifndef KWAYLANDSERVER_NO_DEPRECATED - /** - * @deprecated use addPlasmaVirtualDesktop and removePlasmaVirtualDesktop - */ - void KWAYLANDSERVER_DEPRECATED setVirtualDesktop(quint32 desktop); -#endif void setActive(bool set); void setMinimized(bool set); void setMaximized(bool set); @@ -129,65 +125,42 @@ void setFullscreenable(bool set); void setSkipTaskbar(bool skip); void setSkipSwitcher(bool skip); - /** - * @deprecated since 5.28 use setIcon - * @see setIcon - **/ -#ifndef KWAYLANDSERVER_NO_DEPRECATED - void KWAYLANDSERVER_DEPRECATED setThemedIconName(const QString &iconName); -#endif - /** - * @since 5.22 - */ void setShadeable(bool set); - /** - * @since 5.22 - */ void setShaded(bool set); - /** - * @since 5.22 - */ void setMovable(bool set); - /** - * @since 5.22 - */ void setResizable(bool set); + void setWindowId(quint32 winid); /** * FIXME: still relevant with new desktops? - * @since 5.22 */ void setVirtualDesktopChangeable(bool set); /** * This method removes the Window and the Client is supposed to release the resource - * bound for this Window. Once all resources are released the Window gets deleted. + * bound for this Window. * - * Prefer using {@link PlasmaWindowManagementInterface::unmapWindow}. - * @see PlasmaWindowManagementInterface::unmapWindow - **/ + * No more events should be sent afterwards. + */ void unmap(); /** * @returns Geometries of the taskbar entries, indicized by the * surface of the panels - * @since 5.5 */ - QHash minimizedGeometries() const; + QHash minimizedGeometries() const; /** * Sets this PlasmaWindowInterface as a transient window to @p parentWindow. * If @p parentWindow is @c nullptr, the PlasmaWindowInterface is a toplevel * window and does not have a parent window. - * @since 5.24 - **/ + */ void setParentWindow(PlasmaWindowInterface *parentWindow); /** * Sets the window @p geometry of this PlasmaWindow. * * @param geometry The geometry in absolute coordinates - * @since 5.25 - **/ + */ void setGeometry(const QRect &geometry); /** @@ -199,50 +172,64 @@ * into which the icon will be serialized. * * @param icon The new icon - * @since 5.28 - **/ + */ void setIcon(const QIcon &icon); /** * Adds a new desktop to this window: a window can be on * an arbitrary subset of virtual desktops. * If it's on none it will be considered on all desktops. - * - * @since 5.48 */ void addPlasmaVirtualDesktop(const QString &id); /** * Removes a visrtual desktop from a window - * - * @since 5.48 */ void removePlasmaVirtualDesktop(const QString &id); /** * The ids of all the desktops currently associated with this window. * When a desktop is deleted it will be automatically removed from this list - * - * @since 5.48 */ QStringList plasmaVirtualDesktops() const; - void setWindowId(quint32 winid); -Q_SIGNALS: - void closeRequested(); + /** - * @since 5.22 + * Adds an activity to this window: a window can be on + * an arbitrary subset of activities. + * If it's on none it will be considered on all activities. */ - void moveRequested(); + void addPlasmaActivity(const QString &id); + /** - * @since 5.22 + * Removes an activity from a window */ - void resizeRequested(); -#ifndef KWAYLANDSERVER_NO_DEPRECATED + void removePlasmaActivity(const QString &id); + + /** + * The ids of all the activities currently associated with this window. + * When an activity is deleted it will be automatically removed from this list + */ + QStringList plasmaActivities() const; + + /** + * Set the application menu D-BUS service name and object path for the window. + */ + void setApplicationMenuPaths(const QString &serviceName, const QString &objectPath); + + /** + * Return the window internal id + */ + quint32 internalId() const; + /** - * @deprecated use enterPlasmaVirtualDesktopRequested and leavePlasmaVirtualDesktopRequested instead + * @return a unique string that identifies this window */ - void KWAYLANDSERVER_DEPRECATED virtualDesktopRequested(quint32 desktop); -#endif + QString uuid() const; + +Q_SIGNALS: + void closeRequested(); + void moveRequested(); + void resizeRequested(); void activeRequested(bool set); void minimizedRequested(bool set); void maximizedRequested(bool set); @@ -257,32 +244,18 @@ void skipTaskbarRequested(bool set); void skipSwitcherRequested(bool set); QRect minimizedGeometriesChanged(); - /** - * @since 5.22 - */ void shadeableRequested(bool set); - /** - * @since 5.22 - */ void shadedRequested(bool set); - /** - * @since 5.22 - */ void movableRequested(bool set); - /** - * @since 5.22 - */ void resizableRequested(bool set); /** * FIXME: still relevant with new virtual desktops? - * @since 5.22 */ void virtualDesktopChangeableRequested(bool set); /** * Emitted when the client wishes this window to enter in a new virtual desktop. * The server will decide whether to consent this request - * @since 5.52 */ void enterPlasmaVirtualDesktopRequested(const QString &desktop); @@ -290,28 +263,41 @@ * Emitted when the client wishes this window to enter in * a new virtual desktop to be created for it. * The server will decide whether to consent this request - * @since 5.52 */ void enterNewPlasmaVirtualDesktopRequested(); /** * Emitted when the client wishes to remove this window from a virtual desktop. * The server will decide whether to consent this request - * @since 5.52 */ void leavePlasmaVirtualDesktopRequested(const QString &desktop); + /** + * Emitted when the client wishes this window to enter an activity. + * The server will decide whether to consent this request + */ + void enterPlasmaActivityRequested(const QString &activity); + + /** + * Emitted when the client wishes to remove this window from an activity. + * The server will decide whether to consent this request + */ + void leavePlasmaActivityRequested(const QString &activity); + + /** + * Requests sending the window to @p output + */ + void sendToOutput(KWaylandServer::OutputInterface *output); + private: friend class PlasmaWindowManagementInterface; + friend class PlasmaWindowInterfacePrivate; + friend class PlasmaWindowManagementInterfacePrivate; explicit PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent); - class Private; - const QScopedPointer d; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::PlasmaWindowManagementInterface::ShowingDesktopState) -#endif +Q_DECLARE_METATYPE(KWaylandServer::PlasmaWindowManagementInterface::ShowingDesktopState) diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface.cpp --- dwayland-5.57.0.23/src/server/pointerconstraints_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "pointerconstraints_interface_p.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -PointerConstraintsInterface::Private::Private(PointerConstraintsInterfaceVersion interfaceVersion, PointerConstraintsInterface *q, Display *d, const wl_interface *interface, quint32 version) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) -{ -} - -PointerConstraintsInterface::PointerConstraintsInterface(Private *d, QObject *parent) - : Global(d, parent) -{ -} - -PointerConstraintsInterface::~PointerConstraintsInterface() = default; - -PointerConstraintsInterfaceVersion PointerConstraintsInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -PointerConstraintsInterface::Private *PointerConstraintsInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -LockedPointerInterface::Private::Private(PointerConstraintsInterfaceVersion interfaceVersion, LockedPointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) - , interfaceVersion(interfaceVersion) -{ -} - -LockedPointerInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -void LockedPointerInterface::Private::commit() -{ - if (regionIsSet) { - region = pendingRegion; - pendingRegion = QRegion(); - regionIsSet = false; - emit q_func()->regionChanged(); - } - if (hintIsSet) { - hint = pendingHint; - hintIsSet = false; - emit q_func()->cursorPositionHintChanged(); - } -} - -LockedPointerInterface::LockedPointerInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ - connect(this, &LockedPointerInterface::unbound, this, [this]() { setLocked(false); }); -} - -LockedPointerInterface::~LockedPointerInterface() = default; - -PointerConstraintsInterfaceVersion LockedPointerInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -LockedPointerInterface::LifeTime LockedPointerInterface::lifeTime() const -{ - Q_D(); - return d->lifeTime; -} - -QRegion LockedPointerInterface::region() const -{ - Q_D(); - return d->region; -} - -QPointF LockedPointerInterface::cursorPositionHint() const -{ - Q_D(); - return d->hint; -} - -bool LockedPointerInterface::isLocked() const -{ - Q_D(); - return d->locked; -} - -void LockedPointerInterface::setLocked(bool locked) -{ - Q_D(); - if (locked == d->locked) { - return; - } - if (!locked) { - d->hint = QPointF(-1., -1.); - } - d->locked = locked; - d->updateLocked(); - emit lockedChanged(); -} - -LockedPointerInterface::Private *LockedPointerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -ConfinedPointerInterface::Private::Private(PointerConstraintsInterfaceVersion interfaceVersion, ConfinedPointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) - , interfaceVersion(interfaceVersion) -{ -} - -ConfinedPointerInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -void ConfinedPointerInterface::Private::commit() -{ - if (!regionIsSet) { - return; - } - region = pendingRegion; - pendingRegion = QRegion(); - regionIsSet = false; - emit q_func()->regionChanged(); -} - -ConfinedPointerInterface::ConfinedPointerInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ - connect(this, &ConfinedPointerInterface::unbound, this, [this]() { setConfined(false); }); -} - -ConfinedPointerInterface::~ConfinedPointerInterface() = default; - -PointerConstraintsInterfaceVersion ConfinedPointerInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -ConfinedPointerInterface::LifeTime ConfinedPointerInterface::lifeTime() const -{ - Q_D(); - return d->lifeTime; -} - -QRegion ConfinedPointerInterface::region() const -{ - Q_D(); - return d->region; -} - -bool ConfinedPointerInterface::isConfined() const -{ - Q_D(); - return d->confined; -} - -void ConfinedPointerInterface::setConfined(bool confined) -{ - Q_D(); - if (confined == d->confined) { - return; - } - d->confined = confined; - d->updateConfined(); - emit confinedChanged(); -} - -ConfinedPointerInterface::Private *ConfinedPointerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_interface.h dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface.h --- dwayland-5.57.0.23/src/server/pointerconstraints_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,296 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_POINTERCONSTRAINTS_INTERFACE_H -#define KWAYLAND_SERVER_POINTERCONSTRAINTS_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SurfaceInterface; - -/** - * Enum describing the interface versions the PointerConstraintsInterface can support. - * - * @since 5.29 - **/ -enum class PointerConstraintsInterfaceVersion { - /** - * zwp_pointer_constraints_v1 - **/ - UnstableV1 -}; - -/** - * Manager object to create pointer constraints. - * - * To create this manager use {@link Display::createPointerConstraints} - * - * @see ConfinedPointerInterface - * @see LockedPointerInterface - * @see Display::createPointerConstraints - * @since 5.29 - **/ -class KWAYLANDSERVER_EXPORT PointerConstraintsInterface : public Global -{ - Q_OBJECT -public: - virtual ~PointerConstraintsInterface(); - - /** - * @returns The interface version used by this PointerConstraintsInterface - **/ - PointerConstraintsInterfaceVersion interfaceVersion() const; - -protected: - class Private; - explicit PointerConstraintsInterface(Private *d, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -/** - * The LockedPointerInterface lets the client request to disable movements of - * the virtual pointer (i.e. the cursor), effectively locking the pointer - * to a position. - * - * It is up to the compositor whether the lock gets activated. - * To activate it needs to use {@link LockedPointerInterface::setLocked}. - * The compositor needs to ensure that the SurfaceInterface has pointer focus - * and that the pointer is inside the {@link LockedPointerInterface::region} when - * it activates the lock. - * - * While the lock is active the PointerInterface does no longer emit pointer motion - * events, but still emits relative pointer motion events. - * - * @since 5.29 - **/ -class KWAYLANDSERVER_EXPORT LockedPointerInterface : public Resource -{ - Q_OBJECT -public: - - virtual ~LockedPointerInterface(); - - /** - * @returns The interface version used by this LockedPointerInterface - **/ - PointerConstraintsInterfaceVersion interfaceVersion() const; - - enum class LifeTime { - OneShot, - Persistent - }; - - LifeTime lifeTime() const; - - /** - * The intersection of this region and the input region of the SurfaceInterface is used - * to determine where the pointer must be in order for the lock to activate. - * It is up to the compositor whether to warp the pointer or require some kind of - * user interaction for the lock to activate. - * - * If the region is empty the SurfaceInterface input region is used. - * - * @see regionChanged - * @see SurfaceInterface::input - **/ - QRegion region() const; - - /** - * Indicates where the mouse cursor should be positioned after it has been unlocked again. - * The compositor can warp the cursor at this moment to the position. For that it - * will not emit any relative motion events. The hint is relative to the top-left - * corner of the surface the lock was applied to. Only non-negative x and y values - * are allowed. Otherwise the hint is invalid and should be ignored by the compositor. - * - * In case the client never set the hint, an invalid one will be returned. - * - * This function should be called when the compositor decides to break the lock or the - * client unbinds the resource. To set the position in this case the compositor should - * call this function when the aboutToBeUnbound signal has been emitted. - * - * @see cursorPositionHintChanged - * @since 5.49 - **/ - QPointF cursorPositionHint() const; - - /** - * Whether the Compositor set this pointer lock to be active. - * @see setLocked - * @see lockedChanged - **/ - bool isLocked() const; - - /** - * Activates or deactivates the lock. - * - * A pointer lock can only be activated if the SurfaceInterface - * this LockedPointerInterface was created for has pointer focus - * and the pointer is inside the {@link region}. - * - * Unlocking resets the cursor position hint. - * - * @param locked Whether the lock should be active - * @see isLocked - * @see lockedChanged - **/ - void setLocked(bool locked); - -Q_SIGNALS: - /** - * Emitted whenever the region changes. - * This happens when the parent SurfaceInterface gets committed - * @see region - **/ - void regionChanged(); - - /** - * Emitted whenever the cursor position hint changes. - * This happens when the parent SurfaceInterface gets committed - * @see cursorPositionHint - * @since 5.49 - **/ - void cursorPositionHintChanged(); - - /** - * Emitted whenever the {@link isLocked} state changes. - * @see isLocked - * @see setLocked - **/ - void lockedChanged(); - -protected: - class Private; - explicit LockedPointerInterface(Private *p, QObject *parent = nullptr); - -private: - Private *d_func() const; - friend class SurfaceInterface; -}; - -/** - * - * The ConfinedPointerInterface gets installed on a SurfaceInterface. - * The confinement indicates that the SurfaceInterface wants to confine the - * pointer to a region of the SurfaceInterface. - * - * It is up to the compositor whether the confinement gets activated. - * To activate it needs to use {@link ConfinedPointerInterface::setConfined}. - * The compositor needs to ensure that the SurfaceInterface has pointer focus - * and that the pointer is inside the {@link ConfinedPointerInterface::region} when - * it activates the confinement. - * - * From client side the confinement gets deactivated by destroying the ConfinedPointerInterface. - * From compositor side the confinement can be deactivated by setting - * {@link ConfinedPointerInterface::setConfined} to @c false. - * - * @since 5.29 - **/ -class KWAYLANDSERVER_EXPORT ConfinedPointerInterface : public Resource -{ - Q_OBJECT -public: - - virtual ~ConfinedPointerInterface(); - - /** - * @returns The interface version used by this ConfinedPointerInterface - **/ - PointerConstraintsInterfaceVersion interfaceVersion() const; - - enum class LifeTime { - OneShot, - Persistent - }; - - LifeTime lifeTime() const; - - /** - * The intersection of this region and the input region of the SurfaceInterface is used - * to determine where the pointer must be in order for the confinement to activate. - * It is up to the compositor whether to warp the pointer or require some kind of - * user interaction for the confinement to activate. - * - * If the region is empty the SurfaceInterface input region is used. - * - * @see regionChanged - * @see SurfaceInterface::input - **/ - QRegion region() const; - - /** - * Whether the Compositor set this pointer confinement to be active. - * @see setConfined - * @see confinedChanged - **/ - bool isConfined() const; - - /** - * Activates or deactivates the confinement. - * - * A pointer confinement can only be activated if the SurfaceInterface - * this ConfinedPointerInterface was created for has pointer focus - * and the pointer is inside the {@link region}. - * - * @param confined Whether the confinement should be active - * @see isConfined - * @see confinedChanged - **/ - void setConfined(bool confined); - -Q_SIGNALS: - /** - * Emitted whenever the region changes. - * This happens when the parent SurfaceInterface gets committed - * @see region - **/ - void regionChanged(); - - /** - * Emitted whenever the {@link isConfined} state changes. - * @see isConfined - * @see setConfined - **/ - void confinedChanged(); - -protected: - class Private; - explicit ConfinedPointerInterface(Private *p, QObject *parent = nullptr); - -private: - Private *d_func() const; - friend class SurfaceInterface; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface_p.h --- dwayland-5.57.0.23/src/server/pointerconstraints_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_POINTERCONSTRAINTS_INTERFACE_P_H -#define KWAYLAND_SERVER_POINTERCONSTRAINTS_INTERFACE_P_H -#include "pointerconstraints_interface.h" -#include "global_p.h" -#include "resource_p.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class PointerConstraintsInterface::Private : public Global::Private -{ -public: - PointerConstraintsInterfaceVersion interfaceVersion; - -protected: - Private(PointerConstraintsInterfaceVersion interfaceVersion, PointerConstraintsInterface *q, Display *d, const wl_interface *interface, quint32 version); - PointerConstraintsInterface *q; -}; - -class PointerConstraintsUnstableV1Interface : public PointerConstraintsInterface -{ - Q_OBJECT -public: - explicit PointerConstraintsUnstableV1Interface(Display *display, QObject *parent = nullptr); - virtual ~PointerConstraintsUnstableV1Interface(); - -private: - class Private; -}; - -class LockedPointerInterface::Private : public Resource::Private -{ -public: - ~Private(); - - virtual void updateLocked() = 0; - void commit(); - - PointerConstraintsInterfaceVersion interfaceVersion; - - LifeTime lifeTime; - QRegion region; - bool locked = false; - QPointF hint = QPointF(-1., -1.); - -protected: - Private(PointerConstraintsInterfaceVersion interfaceVersion, LockedPointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation); - - QRegion pendingRegion; - bool regionIsSet = false; - - QPointF pendingHint; - bool hintIsSet = false; - -private: - LockedPointerInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class LockedPointerUnstableV1Interface : public LockedPointerInterface -{ - Q_OBJECT -public: - explicit LockedPointerUnstableV1Interface(PointerConstraintsUnstableV1Interface *parent, wl_resource *parentResource); - virtual ~LockedPointerUnstableV1Interface(); - -private: - class Private; - Private *d_func() const; - friend class PointerConstraintsUnstableV1Interface; -}; - -class ConfinedPointerInterface::Private : public Resource::Private -{ -public: - ~Private(); - - virtual void updateConfined() = 0; - void commit(); - - PointerConstraintsInterfaceVersion interfaceVersion; - - LifeTime lifeTime; - QRegion region; - - bool confined = false; - -protected: - Private(PointerConstraintsInterfaceVersion interfaceVersion, ConfinedPointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation); - - QRegion pendingRegion; - bool regionIsSet = false; - -private: - ConfinedPointerInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class ConfinedPointerUnstableV1Interface : public ConfinedPointerInterface -{ - Q_OBJECT -public: - explicit ConfinedPointerUnstableV1Interface(PointerConstraintsUnstableV1Interface *parent, wl_resource *parentResource); - virtual ~ConfinedPointerUnstableV1Interface(); - -private: - class Private; - Private *d_func() const; - friend class PointerConstraintsUnstableV1Interface; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_interface_v1.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface_v1.cpp --- dwayland-5.57.0.23/src/server/pointerconstraints_interface_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_interface_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "pointerconstraints_interface_p.h" -#include "display.h" -#include "pointer_interface.h" -#include "region_interface.h" -#include "surface_interface_p.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class PointerConstraintsUnstableV1Interface::Private : public PointerConstraintsInterface::Private -{ -public: - Private(PointerConstraintsUnstableV1Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - template - void createConstraint(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *pointer, wl_resource *region, uint32_t lifetime); - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void lockPointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * pointer, wl_resource * region, uint32_t lifetime); - static void confinePointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * pointer, wl_resource * region, uint32_t lifetime); - - PointerConstraintsUnstableV1Interface *q; - static const struct zwp_pointer_constraints_v1_interface s_interface; - static const quint32 s_version; -}; - -class LockedPointerUnstableV1Interface::Private : public LockedPointerInterface::Private -{ -public: - Private(LockedPointerUnstableV1Interface *q, PointerConstraintsUnstableV1Interface *c, wl_resource *parentResource); - ~Private(); - - void updateLocked() override; - -private: - static void setCursorPositionHintCallback(wl_client *client, wl_resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y); - static void setRegionCallback(wl_client *client, wl_resource *resource, wl_resource * region); - - LockedPointerUnstableV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_locked_pointer_v1_interface s_interface; -}; - -const quint32 PointerConstraintsUnstableV1Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_pointer_constraints_v1_interface PointerConstraintsUnstableV1Interface::Private::s_interface = { - destroyCallback, - lockPointerCallback, - confinePointerCallback -}; -#endif - -void PointerConstraintsUnstableV1Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -template -void PointerConstraintsUnstableV1Interface::Private::createConstraint(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *pointer, wl_resource *region, uint32_t lifetime) -{ - auto s = SurfaceInterface::get(surface); - auto p = PointerInterface::get(pointer); - if (!s || !p) { - // send error? - return; - } - if (!s->lockedPointer().isNull() || !s->confinedPointer().isNull()) { - wl_resource_post_error(s->resource(), ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED, "Surface already constrained"); - return; - } - auto constraint = new T(q, resource); - switch (lifetime) { - case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT: - constraint->d_func()->lifeTime = T::LifeTime::Persistent; - break; - case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT: // fall through - default: - constraint->d_func()->lifeTime = T::LifeTime::OneShot; - break; - } - auto r = RegionInterface::get(region); - constraint->d_func()->region = r ? r->region() : QRegion(); - constraint->d_func()->create(display->getConnection(client), version, id); - s->d_func()->installPointerConstraint(constraint); -} - -void PointerConstraintsUnstableV1Interface::Private::lockPointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *pointer, wl_resource *region, uint32_t lifetime) -{ - cast(resource)->createConstraint(client, resource, id, surface, pointer, region, lifetime); -} - -void PointerConstraintsUnstableV1Interface::Private::confinePointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *pointer, wl_resource *region, uint32_t lifetime) -{ - cast(resource)->createConstraint(client, resource, id, surface, pointer, region, lifetime); -} - -PointerConstraintsUnstableV1Interface::Private::Private(PointerConstraintsUnstableV1Interface *q, Display *d) - : PointerConstraintsInterface::Private(PointerConstraintsInterfaceVersion::UnstableV1, q, d, &zwp_pointer_constraints_v1_interface, s_version) - , q(q) -{ -} - -void PointerConstraintsUnstableV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_pointer_constraints_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void PointerConstraintsUnstableV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -PointerConstraintsUnstableV1Interface::PointerConstraintsUnstableV1Interface(Display *display, QObject *parent) - : PointerConstraintsInterface(new Private(this, display), parent) -{ -} - -PointerConstraintsUnstableV1Interface::~PointerConstraintsUnstableV1Interface() = default; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_locked_pointer_v1_interface LockedPointerUnstableV1Interface::Private::s_interface = { - resourceDestroyedCallback, - setCursorPositionHintCallback, - setRegionCallback -}; -#endif - -void LockedPointerUnstableV1Interface::Private::setCursorPositionHintCallback(wl_client *client, wl_resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y) -{ - Q_UNUSED(client) - auto p = cast(resource); - p->pendingHint = QPointF(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y)); - p->hintIsSet = true; -} - -void LockedPointerUnstableV1Interface::Private::setRegionCallback(wl_client *client, wl_resource *resource, wl_resource * region) -{ - Q_UNUSED(client) - auto p = cast(resource); - auto r = RegionInterface::get(region); - p->pendingRegion = r ? r->region() : QRegion(); - p->regionIsSet = true; -} - -void LockedPointerUnstableV1Interface::Private::updateLocked() -{ - if (!resource) { - return; - } - if (locked) { - zwp_locked_pointer_v1_send_locked(resource); - } else { - zwp_locked_pointer_v1_send_unlocked(resource); - } -} - -LockedPointerUnstableV1Interface::Private::Private(LockedPointerUnstableV1Interface *q, PointerConstraintsUnstableV1Interface *c, wl_resource *parentResource) - : LockedPointerInterface::Private(PointerConstraintsInterfaceVersion::UnstableV1, q, c, parentResource, &zwp_locked_pointer_v1_interface, &s_interface) -{ -} - -LockedPointerUnstableV1Interface::LockedPointerUnstableV1Interface(PointerConstraintsUnstableV1Interface *parent, wl_resource *parentResource) - : LockedPointerInterface(new Private(this, parent, parentResource)) -{ -} - -LockedPointerUnstableV1Interface::Private::~Private() = default; - -LockedPointerUnstableV1Interface::~LockedPointerUnstableV1Interface() = default; - -LockedPointerUnstableV1Interface::Private *LockedPointerUnstableV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -class ConfinedPointerUnstableV1Interface::Private : public ConfinedPointerInterface::Private -{ -public: - Private(ConfinedPointerUnstableV1Interface *q, PointerConstraintsUnstableV1Interface *c, wl_resource *parentResource); - ~Private(); - - void updateConfined() override; - -private: - static void setRegionCallback(wl_client *client, wl_resource *resource, wl_resource * region); - - ConfinedPointerUnstableV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_confined_pointer_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_confined_pointer_v1_interface ConfinedPointerUnstableV1Interface::Private::s_interface = { - resourceDestroyedCallback, - setRegionCallback -}; -#endif - -void ConfinedPointerUnstableV1Interface::Private::setRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region) -{ - Q_UNUSED(client) - auto p = cast(resource); - auto r = RegionInterface::get(region); - p->pendingRegion = r ? r->region() : QRegion(); - p->regionIsSet = true; -} - -ConfinedPointerUnstableV1Interface::Private::Private(ConfinedPointerUnstableV1Interface *q, PointerConstraintsUnstableV1Interface *c, wl_resource *parentResource) - : ConfinedPointerInterface::Private(PointerConstraintsInterfaceVersion::UnstableV1, q, c, parentResource, &zwp_confined_pointer_v1_interface, &s_interface) -{ -} - -ConfinedPointerUnstableV1Interface::ConfinedPointerUnstableV1Interface(PointerConstraintsUnstableV1Interface *parent, wl_resource *parentResource) - : ConfinedPointerInterface(new Private(this, parent, parentResource)) -{ -} - -ConfinedPointerUnstableV1Interface::Private::~Private() = default; - -ConfinedPointerUnstableV1Interface::~ConfinedPointerUnstableV1Interface() = default; - -void ConfinedPointerUnstableV1Interface::Private::updateConfined() -{ - if (!resource) { - return; - } - if (confined) { - zwp_confined_pointer_v1_send_confined(resource); - } else { - zwp_confined_pointer_v1_send_unconfined(resource); - } -} - -ConfinedPointerUnstableV1Interface::Private *ConfinedPointerUnstableV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface.cpp --- dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,309 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "pointerconstraints_v1_interface.h" +#include "display.h" +#include "pointer_interface.h" +#include "pointerconstraints_v1_interface_p.h" +#include "region_interface_p.h" +#include "surface_interface_p.h" + +namespace KWaylandServer +{ +static const int s_version = 1; + +PointerConstraintsV1InterfacePrivate::PointerConstraintsV1InterfacePrivate(Display *display) + : QtWaylandServer::zwp_pointer_constraints_v1(*display, s_version) +{ +} + +static QRegion regionFromResource(::wl_resource *resource) +{ + const RegionInterface *region = RegionInterface::get(resource); + return region ? region->region() : QRegion(); +} + +void PointerConstraintsV1InterfacePrivate::zwp_pointer_constraints_v1_lock_pointer(Resource *resource, + uint32_t id, + ::wl_resource *surface_resource, + ::wl_resource *pointer_resource, + ::wl_resource *region_resource, + uint32_t lifetime) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid pointer"); + return; + } + + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + if (!surface) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid surface"); + return; + } + + if (surface->lockedPointer() || surface->confinedPointer()) { + wl_resource_post_error(resource->handle, error_already_constrained, "the surface is already constrained"); + return; + } + + if (lifetime != lifetime_oneshot && lifetime != lifetime_persistent) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "unknown lifetime %d", lifetime); + return; + } + + wl_resource *lockedPointerResource = wl_resource_create(resource->client(), &zwp_locked_pointer_v1_interface, resource->version(), id); + if (!lockedPointerResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + + auto lockedPointer = new LockedPointerV1Interface(LockedPointerV1Interface::LifeTime(lifetime), regionFromResource(region_resource), lockedPointerResource); + + SurfaceInterfacePrivate::get(surface)->installPointerConstraint(lockedPointer); +} + +void PointerConstraintsV1InterfacePrivate::zwp_pointer_constraints_v1_confine_pointer(Resource *resource, + uint32_t id, + ::wl_resource *surface_resource, + ::wl_resource *pointer_resource, + ::wl_resource *region_resource, + uint32_t lifetime) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid pointer"); + return; + } + + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + if (!surface) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid surface"); + return; + } + + if (lifetime != lifetime_oneshot && lifetime != lifetime_persistent) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "unknown lifetime %d", lifetime); + return; + } + + if (surface->lockedPointer() || surface->confinedPointer()) { + wl_resource_post_error(resource->handle, error_already_constrained, "the surface is already constrained"); + return; + } + + wl_resource *confinedPointerResource = wl_resource_create(resource->client(), &zwp_confined_pointer_v1_interface, resource->version(), id); + if (!confinedPointerResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + + auto confinedPointer = + new ConfinedPointerV1Interface(ConfinedPointerV1Interface::LifeTime(lifetime), regionFromResource(region_resource), confinedPointerResource); + + SurfaceInterfacePrivate::get(surface)->installPointerConstraint(confinedPointer); +} + +void PointerConstraintsV1InterfacePrivate::zwp_pointer_constraints_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +PointerConstraintsV1Interface::PointerConstraintsV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new PointerConstraintsV1InterfacePrivate(display)) +{ +} + +PointerConstraintsV1Interface::~PointerConstraintsV1Interface() +{ +} + +LockedPointerV1InterfacePrivate *LockedPointerV1InterfacePrivate::get(LockedPointerV1Interface *q) +{ + return q->d.data(); +} + +LockedPointerV1InterfacePrivate::LockedPointerV1InterfacePrivate(LockedPointerV1Interface *q, + LockedPointerV1Interface::LifeTime lifeTime, + const QRegion ®ion, + ::wl_resource *resource) + : QtWaylandServer::zwp_locked_pointer_v1(resource) + , q(q) + , lifeTime(lifeTime) + , region(region) +{ +} + +void LockedPointerV1InterfacePrivate::commit() +{ + if (hasPendingRegion) { + region = pendingRegion; + hasPendingRegion = false; + Q_EMIT q->regionChanged(); + } + if (hasPendingHint) { + hint = pendingHint; + hasPendingHint = false; + Q_EMIT q->cursorPositionHintChanged(); + } +} + +void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_set_cursor_position_hint(Resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y) +{ + Q_UNUSED(resource) + pendingHint = QPointF(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y)); + hasPendingHint = true; +} + +void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_set_region(Resource *resource, ::wl_resource *region_resource) +{ + Q_UNUSED(resource) + pendingRegion = regionFromResource(region_resource); + hasPendingRegion = true; +} + +LockedPointerV1Interface::LockedPointerV1Interface(LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource) + : d(new LockedPointerV1InterfacePrivate(this, lifeTime, region, resource)) +{ +} + +LockedPointerV1Interface::~LockedPointerV1Interface() +{ +} + +LockedPointerV1Interface::LifeTime LockedPointerV1Interface::lifeTime() const +{ + return d->lifeTime; +} + +QRegion LockedPointerV1Interface::region() const +{ + return d->region; +} + +QPointF LockedPointerV1Interface::cursorPositionHint() const +{ + return d->hint; +} + +bool LockedPointerV1Interface::isLocked() const +{ + return d->isLocked; +} + +void LockedPointerV1Interface::setLocked(bool locked) +{ + if (d->isLocked == locked) { + return; + } + if (!locked) { + d->hint = QPointF(-1, -1); + } + d->isLocked = locked; + if (d->isLocked) { + d->send_locked(); + } else { + d->send_unlocked(); + } + Q_EMIT lockedChanged(); +} + +ConfinedPointerV1InterfacePrivate *ConfinedPointerV1InterfacePrivate::get(ConfinedPointerV1Interface *q) +{ + return q->d.data(); +} + +ConfinedPointerV1InterfacePrivate::ConfinedPointerV1InterfacePrivate(ConfinedPointerV1Interface *q, + ConfinedPointerV1Interface::LifeTime lifeTime, + const QRegion ®ion, + ::wl_resource *resource) + : QtWaylandServer::zwp_confined_pointer_v1(resource) + , q(q) + , lifeTime(lifeTime) + , region(region) +{ +} + +void ConfinedPointerV1InterfacePrivate::commit() +{ + if (hasPendingRegion) { + region = pendingRegion; + hasPendingRegion = false; + Q_EMIT q->regionChanged(); + } +} + +void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_set_region(Resource *resource, ::wl_resource *region_resource) +{ + Q_UNUSED(resource) + pendingRegion = regionFromResource(region_resource); + hasPendingRegion = true; +} + +ConfinedPointerV1Interface::ConfinedPointerV1Interface(LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource) + : d(new ConfinedPointerV1InterfacePrivate(this, lifeTime, region, resource)) +{ +} + +ConfinedPointerV1Interface::~ConfinedPointerV1Interface() +{ +} + +ConfinedPointerV1Interface::LifeTime ConfinedPointerV1Interface::lifeTime() const +{ + return d->lifeTime; +} + +QRegion ConfinedPointerV1Interface::region() const +{ + return d->region; +} + +bool ConfinedPointerV1Interface::isConfined() const +{ + return d->isConfined; +} + +void ConfinedPointerV1Interface::setConfined(bool confined) +{ + if (d->isConfined == confined) { + return; + } + d->isConfined = confined; + if (d->isConfined) { + d->send_confined(); + } else { + d->send_unconfined(); + } + Q_EMIT confinedChanged(); +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface.h --- dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,244 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class ConfinedPointerV1InterfacePrivate; +class Display; +class LockedPointerV1InterfacePrivate; +class PointerConstraintsV1InterfacePrivate; +class SurfaceInterface; + +/** + * Manager object to create pointer constraints. + * + * To create this manager use {@link Display::createPointerConstraintsV1} + * + * @see ConfinedPointerV1Interface + * @see LockedPointerV1Interface + */ +class KWAYLANDSERVER_EXPORT PointerConstraintsV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit PointerConstraintsV1Interface(Display *display, QObject *parent = nullptr); + ~PointerConstraintsV1Interface() override; + +private: + QScopedPointer d; +}; + +/** + * The LockedPointerV1Interface lets the client request to disable movements of + * the virtual pointer (i.e. the cursor), effectively locking the pointer + * to a position. + * + * It is up to the compositor whether the lock gets activated. + * To activate it needs to use {@link LockedPointerV1Interface::setLocked}. + * The compositor needs to ensure that the SurfaceInterface has pointer focus + * and that the pointer is inside the {@link LockedPointerV1Interface::region} when + * it activates the lock. + * + * While the lock is active the PointerInterface does no longer Q_EMIT pointer motion + * events, but still emits relative pointer motion events. + */ +class KWAYLANDSERVER_EXPORT LockedPointerV1Interface : public QObject +{ + Q_OBJECT + +public: + ~LockedPointerV1Interface() override; + + enum class LifeTime : uint { + OneShot = 1, + Persistent = 2, + }; + + LifeTime lifeTime() const; + + /** + * The intersection of this region and the input region of the SurfaceInterface is used + * to determine where the pointer must be in order for the lock to activate. + * It is up to the compositor whether to warp the pointer or require some kind of + * user interaction for the lock to activate. + * + * If the region is empty the SurfaceInterface input region is used. + * + * @see regionChanged + * @see SurfaceInterface::input + */ + QRegion region() const; + + /** + * Indicates where the mouse cursor should be positioned after it has been unlocked again. + * The compositor can warp the cursor at this moment to the position. For that it + * will not Q_EMIT any relative motion events. The hint is relative to the top-left + * corner of the surface the lock was applied to. Only non-negative x and y values + * are allowed. Otherwise the hint is invalid and should be ignored by the compositor. + * + * In case the client never set the hint, an invalid one will be returned. + * + * This function should be called when the compositor decides to break the lock or the + * client unbinds the resource. To set the position in this case the compositor should + * call this function when the aboutToBeUnbound signal has been emitted. + * + * @see cursorPositionHintChanged + */ + QPointF cursorPositionHint() const; + + /** + * Whether the Compositor set this pointer lock to be active. + * @see setLocked + * @see lockedChanged + */ + bool isLocked() const; + + /** + * Activates or deactivates the lock. + * + * A pointer lock can only be activated if the SurfaceInterface + * this LockedPointerV1Interface was created for has pointer focus + * and the pointer is inside the {@link region}. + * + * Unlocking resets the cursor position hint. + * + * @param locked Whether the lock should be active + * @see isLocked + * @see lockedChanged + */ + void setLocked(bool locked); + +Q_SIGNALS: + /** + * This is signal is emitted when the locked pointer is about to be destroyed. + */ + void aboutToBeDestroyed(); + + /** + * Emitted whenever the region changes. + * This happens when the parent SurfaceInterface gets committed + * @see region + */ + void regionChanged(); + + /** + * Emitted whenever the cursor position hint changes. + * This happens when the parent SurfaceInterface gets committed + * @see cursorPositionHint + */ + void cursorPositionHintChanged(); + + /** + * Emitted whenever the {@link isLocked} state changes. + * @see isLocked + * @see setLocked + */ + void lockedChanged(); + +private: + LockedPointerV1Interface(LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource); + QScopedPointer d; + friend class LockedPointerV1InterfacePrivate; + friend class PointerConstraintsV1InterfacePrivate; +}; + +/** + * + * The ConfinedPointerV1Interface gets installed on a SurfaceInterface. + * The confinement indicates that the SurfaceInterface wants to confine the + * pointer to a region of the SurfaceInterface. + * + * It is up to the compositor whether the confinement gets activated. + * To activate it needs to use {@link ConfinedPointerV1Interface::setConfined}. + * The compositor needs to ensure that the SurfaceInterface has pointer focus + * and that the pointer is inside the {@link ConfinedPointerV1Interface::region} when + * it activates the confinement. + * + * From client side the confinement gets deactivated by destroying the ConfinedPointerV1Interface. + * From compositor side the confinement can be deactivated by setting + * {@link ConfinedPointerV1Interface::setConfined} to @c false. + */ +class KWAYLANDSERVER_EXPORT ConfinedPointerV1Interface : public QObject +{ + Q_OBJECT + +public: + ~ConfinedPointerV1Interface() override; + + enum class LifeTime : uint { + OneShot = 1, + Persistent = 2, + }; + + LifeTime lifeTime() const; + + /** + * The intersection of this region and the input region of the SurfaceInterface is used + * to determine where the pointer must be in order for the confinement to activate. + * It is up to the compositor whether to warp the pointer or require some kind of + * user interaction for the confinement to activate. + * + * If the region is empty the SurfaceInterface input region is used. + * + * @see regionChanged + * @see SurfaceInterface::input + */ + QRegion region() const; + + /** + * Whether the Compositor set this pointer confinement to be active. + * @see setConfined + * @see confinedChanged + */ + bool isConfined() const; + + /** + * Activates or deactivates the confinement. + * + * A pointer confinement can only be activated if the SurfaceInterface + * this ConfinedPointerV1Interface was created for has pointer focus + * and the pointer is inside the {@link region}. + * + * @param confined Whether the confinement should be active + * @see isConfined + * @see confinedChanged + */ + void setConfined(bool confined); + +Q_SIGNALS: + /** + * Emitted whenever the region changes. + * This happens when the parent SurfaceInterface gets committed + * @see region + */ + void regionChanged(); + + /** + * Emitted whenever the {@link isConfined} state changes. + * @see isConfined + * @see setConfined + */ + void confinedChanged(); + +private: + ConfinedPointerV1Interface(LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource); + QScopedPointer d; + friend class ConfinedPointerV1InterfacePrivate; + friend class PointerConstraintsV1InterfacePrivate; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface_p.h --- dwayland-5.57.0.23/src/server/pointerconstraints_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointerconstraints_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,88 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "pointerconstraints_v1_interface.h" + +#include "qwayland-server-pointer-constraints-unstable-v1.h" + +namespace KWaylandServer +{ +class PointerConstraintsV1InterfacePrivate : public QtWaylandServer::zwp_pointer_constraints_v1 +{ +public: + explicit PointerConstraintsV1InterfacePrivate(Display *display); + +protected: + void zwp_pointer_constraints_v1_lock_pointer(Resource *resource, + uint32_t id, + struct ::wl_resource *surface_resource, + struct ::wl_resource *pointer_resource, + struct ::wl_resource *region_resource, + uint32_t lifetime) override; + void zwp_pointer_constraints_v1_confine_pointer(Resource *resource, + uint32_t id, + struct ::wl_resource *surface_resource, + struct ::wl_resource *pointer_resource, + struct ::wl_resource *region_resource, + uint32_t lifetime) override; + void zwp_pointer_constraints_v1_destroy(Resource *resource) override; +}; + +class LockedPointerV1InterfacePrivate : public QtWaylandServer::zwp_locked_pointer_v1 +{ +public: + static LockedPointerV1InterfacePrivate *get(LockedPointerV1Interface *pointer); + + LockedPointerV1InterfacePrivate(LockedPointerV1Interface *q, LockedPointerV1Interface::LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource); + + void commit(); + + LockedPointerV1Interface *q; + LockedPointerV1Interface::LifeTime lifeTime; + QRegion region; + QRegion pendingRegion; + QPointF hint = QPointF(-1, -1); + QPointF pendingHint; + bool hasPendingRegion = false; + bool hasPendingHint = false; + bool isLocked = false; + +protected: + void zwp_locked_pointer_v1_destroy_resource(Resource *resource) override; + void zwp_locked_pointer_v1_destroy(Resource *resource) override; + void zwp_locked_pointer_v1_set_cursor_position_hint(Resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y) override; + void zwp_locked_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region_resource) override; +}; + +class ConfinedPointerV1InterfacePrivate : public QtWaylandServer::zwp_confined_pointer_v1 +{ +public: + static ConfinedPointerV1InterfacePrivate *get(ConfinedPointerV1Interface *pointer); + + ConfinedPointerV1InterfacePrivate(ConfinedPointerV1Interface *q, + ConfinedPointerV1Interface::LifeTime lifeTime, + const QRegion ®ion, + ::wl_resource *resource); + + void commit(); + + ConfinedPointerV1Interface *q; + ConfinedPointerV1Interface::LifeTime lifeTime; + QRegion region; + QRegion pendingRegion; + bool hasPendingRegion = false; + bool isConfined = false; + +protected: + void zwp_confined_pointer_v1_destroy_resource(Resource *resource) override; + void zwp_confined_pointer_v1_destroy(Resource *resource) override; + void zwp_confined_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region_resource) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointergestures_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface.cpp --- dwayland-5.57.0.23/src/server/pointergestures_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "pointergestures_interface_p.h" - -namespace KWayland -{ -namespace Server -{ - -PointerGesturesInterface::Private::Private(PointerGesturesInterfaceVersion interfaceVersion, PointerGesturesInterface *q, Display *d, const wl_interface *interface, quint32 version) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) -{ -} - -PointerGesturesInterface::PointerGesturesInterface(Private *d, QObject *parent) - : Global(d, parent) -{ -} - -PointerGesturesInterface::~PointerGesturesInterface() = default; - -PointerGesturesInterfaceVersion PointerGesturesInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -PointerGesturesInterface::Private *PointerGesturesInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -PointerSwipeGestureInterface::Private::Private(PointerSwipeGestureInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation, PointerInterface *pointer) - : Resource::Private(q, c, parentResource, interface, implementation) - , pointer(pointer) -{ -} - -PointerSwipeGestureInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -PointerSwipeGestureInterface::PointerSwipeGestureInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ -} - -PointerSwipeGestureInterface::~PointerSwipeGestureInterface() = default; - -PointerSwipeGestureInterface::Private *PointerSwipeGestureInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -PointerPinchGestureInterface::Private::Private(PointerPinchGestureInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation, PointerInterface *pointer) - : Resource::Private(q, c, parentResource, interface, implementation) - , pointer(pointer) -{ -} - -PointerPinchGestureInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -PointerPinchGestureInterface::PointerPinchGestureInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ -} - -PointerPinchGestureInterface::~PointerPinchGestureInterface() = default; - -PointerPinchGestureInterface::Private *PointerPinchGestureInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/pointergestures_interface.h dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface.h --- dwayland-5.57.0.23/src/server/pointergestures_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_POINTERGESTURES_INTERFACE_H -#define KWAYLAND_SERVER_POINTERGESTURES_INTERFACE_H - -#include "global.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -/** - * Enum describing the interface versions the PointerGesturesInterface can support. - * - * @since 5.29 - **/ -enum class PointerGesturesInterfaceVersion { - /** - * zwp_pointer_gestures_v1, zwp_pointer_gesture_swipe_v1 and zwp_pointer_gesture_pinch_v1 - **/ - UnstableV1 -}; - -/** - * Manager object for the PointerGestures. - * - * Creates and manages pointer swipe and pointer pinch gestures which are - * reported to the SeatInterface. - * - * @see Display::createPointerGestures - * @since 5.29 - **/ -class KWAYLANDSERVER_EXPORT PointerGesturesInterface : public Global -{ - Q_OBJECT -public: - virtual ~PointerGesturesInterface(); - - /** - * @returns The interface version used by this PointerGesturesInterface - **/ - PointerGesturesInterfaceVersion interfaceVersion() const; - -protected: - class Private; - explicit PointerGesturesInterface(Private *d, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/pointergestures_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface_p.h --- dwayland-5.57.0.23/src/server/pointergestures_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_POINTERGESTURES_INTERFACE_P_H -#define KWAYLAND_SERVER_POINTERGESTURES_INTERFACE_P_H - -#include "pointergestures_interface.h" -#include "resource_p.h" -#include "global_p.h" - -namespace KWayland -{ -namespace Server -{ - -class PointerInterface; - -class PointerGesturesInterface::Private : public Global::Private -{ -public: - PointerGesturesInterfaceVersion interfaceVersion; - -protected: - Private(PointerGesturesInterfaceVersion interfaceVersion, PointerGesturesInterface *q, Display *d, const wl_interface *interface, quint32 version); - PointerGesturesInterface *q; -}; - -class PointerGesturesUnstableV1Interface : public PointerGesturesInterface -{ - Q_OBJECT -public: - explicit PointerGesturesUnstableV1Interface(Display *display, QObject *parent = nullptr); - virtual ~PointerGesturesUnstableV1Interface(); - -private: - class Private; -}; - -class PointerSwipeGestureInterface : public Resource -{ - Q_OBJECT -public: - virtual ~PointerSwipeGestureInterface(); - - virtual void start(quint32 serial, quint32 fingerCount) = 0; - virtual void update(const QSizeF &delta) = 0; - virtual void end(quint32 serial) = 0; - virtual void cancel(quint32 serial) = 0; - -protected: - class Private; - explicit PointerSwipeGestureInterface(Private *p, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -class PointerSwipeGestureInterface::Private : public Resource::Private -{ -public: - ~Private(); - - PointerInterface *pointer; - -protected: - Private(PointerSwipeGestureInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation, PointerInterface *pointer); - -private: - PointerSwipeGestureInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class PointerPinchGestureInterface : public Resource -{ - Q_OBJECT -public: - virtual ~PointerPinchGestureInterface(); - - virtual void start(quint32 serial, quint32 fingerCount) = 0; - virtual void update(const QSizeF &delta, qreal scale, qreal rotation) = 0; - virtual void end(quint32 serial) = 0; - virtual void cancel(quint32 serial) = 0; - -protected: - class Private; - explicit PointerPinchGestureInterface(Private *p, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -class PointerPinchGestureInterface::Private : public Resource::Private -{ -public: - ~Private(); - - PointerInterface *pointer; - -protected: - Private(PointerPinchGestureInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation, PointerInterface *pointer); - -private: - PointerPinchGestureInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class PointerSwipeGestureUnstableV1Interface : public PointerSwipeGestureInterface -{ - Q_OBJECT -public: - explicit PointerSwipeGestureUnstableV1Interface(PointerGesturesUnstableV1Interface *parent, wl_resource *parentResource, PointerInterface *pointer); - virtual ~PointerSwipeGestureUnstableV1Interface(); - - void start(quint32 serial, quint32 fingerCount) override; - void update(const QSizeF &delta) override; - void end(quint32 serial) override; - void cancel(quint32 serial) override; - -private: - friend class PointerGesturesUnstableV1Interface; - class Private; - Private *d_func() const; -}; - -class PointerPinchGestureUnstableV1Interface : public PointerPinchGestureInterface -{ - Q_OBJECT -public: - explicit PointerPinchGestureUnstableV1Interface(PointerGesturesUnstableV1Interface *parent, wl_resource *parentResource, PointerInterface *pointer); - virtual ~PointerPinchGestureUnstableV1Interface(); - - void start(quint32 serial, quint32 fingerCount) override; - void update(const QSizeF &delta, qreal scale, qreal rotation) override; - void end(quint32 serial) override; - void cancel(quint32 serial) override; - -private: - friend class PointerGesturesUnstableV1Interface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/pointergestures_interface_v1.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface_v1.cpp --- dwayland-5.57.0.23/src/server/pointergestures_interface_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_interface_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,297 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "pointergestures_interface_p.h" -#include "display.h" -#include "pointer_interface_p.h" -#include "resource_p.h" -#include "seat_interface.h" -#include "surface_interface.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class PointerGesturesUnstableV1Interface::Private : public PointerGesturesInterface::Private -{ -public: - Private(PointerGesturesUnstableV1Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void getSwipeGestureCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * pointer); - static void getPinchGestureCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * pointer); - - PointerGesturesUnstableV1Interface *q; - static const struct zwp_pointer_gestures_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 PointerGesturesUnstableV1Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_pointer_gestures_v1_interface PointerGesturesUnstableV1Interface::Private::s_interface = { - getSwipeGestureCallback, - getPinchGestureCallback -}; -#endif - -void PointerGesturesUnstableV1Interface::Private::getSwipeGestureCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *pointer) -{ - PointerInterface *p = PointerInterface::get(pointer); - if (!p) { - // TODO: raise error? - return; - } - auto m = cast(resource); - auto *g = new PointerSwipeGestureUnstableV1Interface(m->q, resource, p); - g->d->create(m->display->getConnection(client), version, id); - p->d_func()->registerSwipeGesture(g); -} - -void PointerGesturesUnstableV1Interface::Private::getPinchGestureCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * pointer) -{ - PointerInterface *p = PointerInterface::get(pointer); - if (!p) { - // TODO: raise error? - return; - } - auto m = cast(resource); - auto *g = new PointerPinchGestureUnstableV1Interface(m->q, resource, p); - g->d->create(m->display->getConnection(client), version, id); - p->d_func()->registerPinchGesture(g); -} - -PointerGesturesUnstableV1Interface::Private::Private(PointerGesturesUnstableV1Interface *q, Display *d) - : PointerGesturesInterface::Private(PointerGesturesInterfaceVersion::UnstableV1, q, d, &zwp_pointer_gestures_v1_interface, s_version) - , q(q) -{ -} - -void PointerGesturesUnstableV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_pointer_gestures_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void PointerGesturesUnstableV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -PointerGesturesUnstableV1Interface::PointerGesturesUnstableV1Interface(Display *display, QObject *parent) - : PointerGesturesInterface(new Private(this, display), parent) -{ -} - -PointerGesturesUnstableV1Interface::~PointerGesturesUnstableV1Interface() = default; - -class PointerSwipeGestureUnstableV1Interface::Private : public PointerSwipeGestureInterface::Private -{ -public: - Private(PointerSwipeGestureUnstableV1Interface *q, PointerGesturesUnstableV1Interface *c, wl_resource *parentResource, PointerInterface *pointer); - ~Private(); - - void end(quint32 serial, bool end); - -private: - - PointerSwipeGestureUnstableV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_pointer_gesture_swipe_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_pointer_gesture_swipe_v1_interface PointerSwipeGestureUnstableV1Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -PointerSwipeGestureUnstableV1Interface::Private::Private(PointerSwipeGestureUnstableV1Interface *q, PointerGesturesUnstableV1Interface *c, wl_resource *parentResource, PointerInterface *pointer) - : PointerSwipeGestureInterface::Private(q, c, parentResource, &zwp_pointer_gesture_swipe_v1_interface, &s_interface, pointer) -{ -} - -PointerSwipeGestureUnstableV1Interface::Private::~Private() = default; - -PointerSwipeGestureUnstableV1Interface::PointerSwipeGestureUnstableV1Interface(PointerGesturesUnstableV1Interface *parent, wl_resource *parentResource, PointerInterface *pointer) - : PointerSwipeGestureInterface(new Private(this, parent, parentResource, pointer)) -{ -} - -PointerSwipeGestureUnstableV1Interface::~PointerSwipeGestureUnstableV1Interface() = default; - -void PointerSwipeGestureUnstableV1Interface::start(quint32 serial, quint32 fingerCount) -{ - Q_D(); - SeatInterface *seat = qobject_cast(d->pointer->global()); - if (!seat) { - return; - } - if (!seat->focusedPointerSurface()) { - return; - } - zwp_pointer_gesture_swipe_v1_send_begin(resource(), serial, seat->timestamp(), seat->focusedPointerSurface()->resource(), fingerCount); -} - -void PointerSwipeGestureUnstableV1Interface::update(const QSizeF &delta) -{ - Q_D(); - SeatInterface *seat = qobject_cast(d->pointer->global()); - if (!seat) { - return; - } - zwp_pointer_gesture_swipe_v1_send_update(resource(), seat->timestamp(), - wl_fixed_from_double(delta.width()), wl_fixed_from_double(delta.height())); -} - -void PointerSwipeGestureUnstableV1Interface::Private::end(quint32 serial, bool cancel) -{ - SeatInterface *seat = qobject_cast(pointer->global()); - if (!seat) { - return; - } - zwp_pointer_gesture_swipe_v1_send_end(resource, serial, seat->timestamp(), uint32_t(cancel)); -} - -void PointerSwipeGestureUnstableV1Interface::end(quint32 serial) -{ - Q_D(); - d->end(serial, false); -} - -void PointerSwipeGestureUnstableV1Interface::cancel(quint32 serial) -{ - Q_D(); - d->end(serial, true); -} - -PointerSwipeGestureUnstableV1Interface::Private *PointerSwipeGestureUnstableV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -class PointerPinchGestureUnstableV1Interface::Private : public PointerPinchGestureInterface::Private -{ -public: - Private(PointerPinchGestureUnstableV1Interface *q, PointerGesturesUnstableV1Interface *c, wl_resource *parentResource, PointerInterface *pointer); - ~Private(); - - void end(quint32 serial, bool end); - -private: - - PointerPinchGestureUnstableV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_pointer_gesture_pinch_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_pointer_gesture_pinch_v1_interface PointerPinchGestureUnstableV1Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -PointerPinchGestureUnstableV1Interface::Private::Private(PointerPinchGestureUnstableV1Interface *q, PointerGesturesUnstableV1Interface *c, wl_resource *parentResource, PointerInterface *pointer) - : PointerPinchGestureInterface::Private(q, c, parentResource, &zwp_pointer_gesture_pinch_v1_interface, &s_interface, pointer) -{ -} - -PointerPinchGestureUnstableV1Interface::Private::~Private() = default; - -PointerPinchGestureUnstableV1Interface::PointerPinchGestureUnstableV1Interface(PointerGesturesUnstableV1Interface *parent, wl_resource *parentResource, PointerInterface *pointer) - : PointerPinchGestureInterface(new Private(this, parent, parentResource, pointer)) -{ -} - -PointerPinchGestureUnstableV1Interface::~PointerPinchGestureUnstableV1Interface() = default; - -void PointerPinchGestureUnstableV1Interface::start(quint32 serial, quint32 fingerCount) -{ - Q_D(); - SeatInterface *seat = qobject_cast(d->pointer->global()); - if (!seat) { - return; - } - if (!seat->focusedPointerSurface()) { - return; - } - zwp_pointer_gesture_pinch_v1_send_begin(resource(), serial, seat->timestamp(), seat->focusedPointerSurface()->resource(), fingerCount); -} - -void PointerPinchGestureUnstableV1Interface::update(const QSizeF &delta, qreal scale, qreal rotation) -{ - Q_D(); - SeatInterface *seat = qobject_cast(d->pointer->global()); - if (!seat) { - return; - } - zwp_pointer_gesture_pinch_v1_send_update(resource(), seat->timestamp(), - wl_fixed_from_double(delta.width()), wl_fixed_from_double(delta.height()), - wl_fixed_from_double(scale), wl_fixed_from_double(rotation)); -} - -void PointerPinchGestureUnstableV1Interface::Private::end(quint32 serial, bool cancel) -{ - SeatInterface *seat = qobject_cast(pointer->global()); - if (!seat) { - return; - } - zwp_pointer_gesture_pinch_v1_send_end(resource, serial, seat->timestamp(), uint32_t(cancel)); -} - -void PointerPinchGestureUnstableV1Interface::end(quint32 serial) -{ - Q_D(); - d->end(serial, false); -} - -void PointerPinchGestureUnstableV1Interface::cancel(quint32 serial) -{ - Q_D(); - d->end(serial, true); -} - -PointerPinchGestureUnstableV1Interface::Private *PointerPinchGestureUnstableV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/pointergestures_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface.cpp --- dwayland-5.57.0.23/src/server/pointergestures_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,326 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "pointergestures_v1_interface.h" +#include "clientconnection.h" +#include "display.h" +#include "pointer_interface_p.h" +#include "pointergestures_v1_interface_p.h" +#include "seat_interface.h" +#include "surface_interface.h" + +namespace KWaylandServer +{ +static const int s_version = 3; + +PointerGesturesV1InterfacePrivate::PointerGesturesV1InterfacePrivate(Display *display) + : QtWaylandServer::zwp_pointer_gestures_v1(*display, s_version) +{ +} + +void PointerGesturesV1InterfacePrivate::zwp_pointer_gestures_v1_get_swipe_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid pointer"); + return; + } + + PointerSwipeGestureV1Interface *swipeGesture = PointerSwipeGestureV1Interface::get(pointer); + swipeGesture->add(resource->client(), id, resource->version()); +} + +void PointerGesturesV1InterfacePrivate::zwp_pointer_gestures_v1_get_pinch_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid pointer"); + return; + } + + PointerPinchGestureV1Interface *pinchGesture = PointerPinchGestureV1Interface::get(pointer); + pinchGesture->add(resource->client(), id, resource->version()); +} + +void PointerGesturesV1InterfacePrivate::zwp_pointer_gestures_v1_get_hold_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, + "invalid pointer"); + return; + } + + PointerHoldGestureV1Interface *holdGesture = PointerHoldGestureV1Interface::get(pointer); + holdGesture->add(resource->client(), id, resource->version()); +} + +void PointerGesturesV1InterfacePrivate::zwp_pointer_gestures_v1_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +PointerGesturesV1Interface::PointerGesturesV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new PointerGesturesV1InterfacePrivate(display)) +{ +} + +PointerGesturesV1Interface::~PointerGesturesV1Interface() +{ +} + +PointerSwipeGestureV1Interface::PointerSwipeGestureV1Interface(PointerInterface *pointer) + : pointer(pointer) +{ +} + +PointerSwipeGestureV1Interface *PointerSwipeGestureV1Interface::get(PointerInterface *pointer) +{ + if (pointer) { + PointerInterfacePrivate *pointerPrivate = PointerInterfacePrivate::get(pointer); + return pointerPrivate->swipeGesturesV1.data(); + } + return nullptr; +} + +void PointerSwipeGestureV1Interface::zwp_pointer_gesture_swipe_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void PointerSwipeGestureV1Interface::sendBegin(quint32 serial, quint32 fingerCount) +{ + if (focusedClient) { + return; + } + if (!pointer->focusedSurface()) { + return; + } + + const SurfaceInterface *focusedSurface = pointer->focusedSurface(); + focusedClient = focusedSurface->client(); + SeatInterface *seat = pointer->seat(); + + const QList swipeResources = resourceMap().values(focusedClient->client()); + for (Resource *swipeResource : swipeResources) { + send_begin(swipeResource->handle, serial, seat->timestamp(), focusedSurface->resource(), fingerCount); + } +} + +void PointerSwipeGestureV1Interface::sendUpdate(const QSizeF &delta) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList swipeResources = resourceMap().values(focusedClient->client()); + for (Resource *swipeResource : swipeResources) { + send_update(swipeResource->handle, seat->timestamp(), wl_fixed_from_double(delta.width()), wl_fixed_from_double(delta.height())); + } +} + +void PointerSwipeGestureV1Interface::sendEnd(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList swipeResources = resourceMap().values(focusedClient->client()); + for (Resource *swipeResource : swipeResources) { + send_end(swipeResource->handle, serial, seat->timestamp(), false); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +void PointerSwipeGestureV1Interface::sendCancel(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList swipeResources = resourceMap().values(focusedClient->client()); + for (Resource *swipeResource : swipeResources) { + send_end(swipeResource->handle, serial, seat->timestamp(), true); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +PointerPinchGestureV1Interface::PointerPinchGestureV1Interface(PointerInterface *pointer) + : pointer(pointer) +{ +} + +PointerPinchGestureV1Interface *PointerPinchGestureV1Interface::get(PointerInterface *pointer) +{ + if (pointer) { + PointerInterfacePrivate *pointerPrivate = PointerInterfacePrivate::get(pointer); + return pointerPrivate->pinchGesturesV1.data(); + } + return nullptr; +} + +void PointerPinchGestureV1Interface::zwp_pointer_gesture_pinch_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void PointerPinchGestureV1Interface::sendBegin(quint32 serial, quint32 fingerCount) +{ + if (focusedClient) { + return; // gesture is already active + } + if (!pointer->focusedSurface()) { + return; + } + + const SurfaceInterface *focusedSurface = pointer->focusedSurface(); + focusedClient = focusedSurface->client(); + SeatInterface *seat = pointer->seat(); + + const QList pinchResources = resourceMap().values(*focusedClient); + for (Resource *pinchResource : pinchResources) { + send_begin(pinchResource->handle, serial, seat->timestamp(), focusedSurface->resource(), fingerCount); + } +} + +void PointerPinchGestureV1Interface::sendUpdate(const QSizeF &delta, qreal scale, qreal rotation) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList pinchResources = resourceMap().values(*focusedClient); + for (Resource *pinchResource : pinchResources) { + send_update(pinchResource->handle, + seat->timestamp(), + wl_fixed_from_double(delta.width()), + wl_fixed_from_double(delta.height()), + wl_fixed_from_double(scale), + wl_fixed_from_double(rotation)); + } +} + +void PointerPinchGestureV1Interface::sendEnd(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList pinchResources = resourceMap().values(*focusedClient); + for (Resource *pinchResource : pinchResources) { + send_end(pinchResource->handle, serial, seat->timestamp(), false); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +void PointerPinchGestureV1Interface::sendCancel(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList pinchResources = resourceMap().values(*focusedClient); + for (Resource *pinchResource : pinchResources) { + send_end(pinchResource->handle, serial, seat->timestamp(), true); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +PointerHoldGestureV1Interface::PointerHoldGestureV1Interface(PointerInterface *pointer) + : pointer(pointer) +{ +} + +PointerHoldGestureV1Interface *PointerHoldGestureV1Interface::get(PointerInterface *pointer) +{ + if (pointer) { + PointerInterfacePrivate *pointerPrivate = PointerInterfacePrivate::get(pointer); + return pointerPrivate->holdGesturesV1.data(); + } + return nullptr; +} + +void PointerHoldGestureV1Interface::zwp_pointer_gesture_hold_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void PointerHoldGestureV1Interface::sendBegin(quint32 serial, quint32 fingerCount) +{ + if (focusedClient) { + return; // gesture is already active + } + if (!pointer->focusedSurface()) { + return; + } + + const SurfaceInterface *focusedSurface = pointer->focusedSurface(); + focusedClient = focusedSurface->client(); + SeatInterface *seat = pointer->seat(); + + const QList holdResources = resourceMap().values(*focusedClient); + for (Resource *holdResource : holdResources) { + send_begin(holdResource->handle, serial, seat->timestamp(), focusedSurface->resource(), fingerCount); + } +} + +void PointerHoldGestureV1Interface::sendEnd(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList holdResources = resourceMap().values(*focusedClient); + for (Resource *holdResource : holdResources) { + send_end(holdResource->handle, serial, seat->timestamp(), false); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +void PointerHoldGestureV1Interface::sendCancel(quint32 serial) +{ + if (!focusedClient) { + return; + } + + SeatInterface *seat = pointer->seat(); + + const QList holdResources = resourceMap().values(*focusedClient); + for (Resource *holdResource : holdResources) { + send_end(holdResource->handle, serial, seat->timestamp(), true); + } + + // The gesture session has been just finished, reset the cached focused client. + focusedClient = nullptr; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointergestures_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface.h --- dwayland-5.57.0.23/src/server/pointergestures_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class PointerGesturesV1InterfacePrivate; + +/** + * Manager object for the PointerGestures. + * + * Creates and manages pointer swipe and pointer pinch gestures which are + * reported to the SeatInterface. + */ +class KWAYLANDSERVER_EXPORT PointerGesturesV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit PointerGesturesV1Interface(Display *display, QObject *parent = nullptr); + ~PointerGesturesV1Interface() override; + +private: + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointergestures_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface_p.h --- dwayland-5.57.0.23/src/server/pointergestures_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointergestures_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,93 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "qwayland-server-pointer-gestures-unstable-v1.h" + +#include + +namespace KWaylandServer +{ +class ClientConnection; +class Display; +class PointerInterface; +class SurfaceInterface; + +class PointerGesturesV1InterfacePrivate : public QtWaylandServer::zwp_pointer_gestures_v1 +{ +public: + explicit PointerGesturesV1InterfacePrivate(Display *display); + +protected: + void zwp_pointer_gestures_v1_get_swipe_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override; + void zwp_pointer_gestures_v1_get_pinch_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override; + void zwp_pointer_gestures_v1_get_hold_gesture(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override; + void zwp_pointer_gestures_v1_release(Resource *resource) override; +}; + +class PointerSwipeGestureV1Interface : public QtWaylandServer::zwp_pointer_gesture_swipe_v1 +{ +public: + explicit PointerSwipeGestureV1Interface(PointerInterface *pointer); + + static PointerSwipeGestureV1Interface *get(PointerInterface *pointer); + + void sendBegin(quint32 serial, quint32 fingerCount); + void sendUpdate(const QSizeF &delta); + void sendEnd(quint32 serial); + void sendCancel(quint32 serial); + +protected: + void zwp_pointer_gesture_swipe_v1_destroy(Resource *resource) override; + +private: + PointerInterface *pointer; + QPointer focusedClient; +}; + +class PointerPinchGestureV1Interface : public QtWaylandServer::zwp_pointer_gesture_pinch_v1 +{ +public: + explicit PointerPinchGestureV1Interface(PointerInterface *pointer); + + static PointerPinchGestureV1Interface *get(PointerInterface *pointer); + + void sendBegin(quint32 serial, quint32 fingerCount); + void sendUpdate(const QSizeF &delta, qreal scale, qreal rotation); + void sendEnd(quint32 serial); + void sendCancel(quint32 serial); + +protected: + void zwp_pointer_gesture_pinch_v1_destroy(Resource *resource) override; + +private: + PointerInterface *pointer; + QPointer focusedClient; +}; + +class PointerHoldGestureV1Interface : public QtWaylandServer::zwp_pointer_gesture_hold_v1 +{ +public: + explicit PointerHoldGestureV1Interface(PointerInterface *pointer); + + static PointerHoldGestureV1Interface *get(PointerInterface *pointer); + + void sendBegin(quint32 serial, quint32 fingerCount); + void sendUpdate(const QSizeF &delta, qreal scale, qreal rotation); + void sendEnd(quint32 serial); + void sendCancel(quint32 serial); + +protected: + void zwp_pointer_gesture_hold_v1_destroy(Resource *resource) override; + +private: + PointerInterface *pointer; + QPointer focusedClient; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointer_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface.cpp --- dwayland-5.57.0.23/src/server/pointer_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,430 +1,303 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Adrien Faveraux + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ #include "pointer_interface.h" +#include "clientconnection.h" +#include "display.h" +#include "logging.h" #include "pointer_interface_p.h" -#include "pointerconstraints_interface.h" -#include "pointergestures_interface_p.h" -#include "resource_p.h" -#include "relativepointer_interface_p.h" +#include "pointergestures_v1_interface_p.h" +#include "relativepointer_v1_interface_p.h" #include "seat_interface.h" -#include "display.h" -#include "subcompositor_interface.h" #include "surface_interface.h" -// Wayland -#include +#include "surfacerole_p.h" +#include "utils.h" -namespace KWayland +namespace KWaylandServer { - -namespace Server -{ - -class Cursor::Private +class CursorPrivate { public: - Private(Cursor *q, PointerInterface *pointer); + CursorPrivate(Cursor *q, PointerInterface *pointer); + + Cursor *q; PointerInterface *pointer; quint32 enteredSerial = 0; QPoint hotspot; QPointer surface; - void update(const QPointer &surface, quint32 serial, const QPoint &hotspot); - -private: - Cursor *q; + void update(SurfaceInterface *surface, quint32 serial, const QPoint &hotspot); }; -PointerInterface::Private::Private(SeatInterface *parent, wl_resource *parentResource, PointerInterface *q) - : Resource::Private(q, parent, parentResource, &wl_pointer_interface, &s_interface) - , seat(parent) +PointerInterfacePrivate *PointerInterfacePrivate::get(PointerInterface *pointer) { + return pointer->d.data(); } -void PointerInterface::Private::setCursor(quint32 serial, SurfaceInterface *surface, const QPoint &hotspot) -{ - if (!cursor) { - Q_Q(PointerInterface); - cursor = new Cursor(q); - cursor->d->update(QPointer(surface), serial, hotspot); - QObject::connect(cursor, &Cursor::changed, q, &PointerInterface::cursorChanged); - emit q->cursorChanged(); - } else { - cursor->d->update(QPointer(surface), serial, hotspot); - } -} - -void PointerInterface::Private::sendLeave(SurfaceInterface *surface, quint32 serial) +PointerInterfacePrivate::PointerInterfacePrivate(PointerInterface *q, SeatInterface *seat) + : q(q) + , seat(seat) + , relativePointersV1(new RelativePointerV1Interface(q)) + , swipeGesturesV1(new PointerSwipeGestureV1Interface(q)) + , pinchGesturesV1(new PointerPinchGestureV1Interface(q)) + , holdGesturesV1(new PointerHoldGestureV1Interface(q)) { - if (!surface) { - return; - } - if (resource && surface->resource()) { - wl_pointer_send_leave(resource, serial, surface->resource()); - } } -void PointerInterface::Private::registerRelativePointer(RelativePointerInterface *relativePointer) +PointerInterfacePrivate::~PointerInterfacePrivate() { - relativePointers << relativePointer; - QObject::connect(relativePointer, &QObject::destroyed, q, - [this, relativePointer] { - relativePointers.removeOne(relativePointer); - } - ); } - -void PointerInterface::Private::registerSwipeGesture(PointerSwipeGestureInterface *gesture) +QList PointerInterfacePrivate::pointersForClient(ClientConnection *client) const { - swipeGestures << gesture; - QObject::connect(gesture, &QObject::destroyed, q, - [this, gesture] { - swipeGestures.removeOne(gesture); - } - ); + return resourceMap().values(client->client()); } -void PointerInterface::Private::registerPinchGesture(PointerPinchGestureInterface *gesture) +void PointerInterfacePrivate::pointer_set_cursor(Resource *resource, uint32_t serial, ::wl_resource *surface_resource, int32_t hotspot_x, int32_t hotspot_y) { - pinchGestures << gesture; - QObject::connect(gesture, &QObject::destroyed, q, - [this, gesture] { - pinchGestures.removeOne(gesture); - } - ); -} + SurfaceInterface *surface = nullptr; -namespace { -static QPointF surfacePosition(SurfaceInterface *surface) { - if (surface && surface->subSurface()) { - return surface->subSurface()->position() + surfacePosition(surface->subSurface()->parentSurface().data()); - } - return QPointF(); -} -} - -void PointerInterface::Private::sendEnter(SurfaceInterface *surface, const QPointF &parentSurfacePosition, quint32 serial) -{ - if (!surface || !surface->resource()) { + if (!focusedSurface) { return; } - const QPointF adjustedPos = parentSurfacePosition - surfacePosition(surface); - wl_pointer_send_enter(resource, serial, - surface->resource(), - wl_fixed_from_double(adjustedPos.x()), wl_fixed_from_double(adjustedPos.y())); -} - -void PointerInterface::Private::startSwipeGesture(quint32 serial, quint32 fingerCount) -{ - if (swipeGestures.isEmpty()) { + if (focusedSurface->client()->client() != resource->client()) { + qCDebug(KWAYLAND_SERVER, "Denied set_cursor request from unfocused client"); return; } - for (auto it = swipeGestures.constBegin(), end = swipeGestures.constEnd(); it != end; it++) { - (*it)->start(serial, fingerCount); - } -} -void PointerInterface::Private::updateSwipeGesture(const QSizeF &delta) -{ - if (swipeGestures.isEmpty()) { - return; - } - for (auto it = swipeGestures.constBegin(), end = swipeGestures.constEnd(); it != end; it++) { - (*it)->update(delta); - } -} + if (surface_resource) { + surface = SurfaceInterface::get(surface_resource); + if (!surface) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid surface"); + return; + } -void PointerInterface::Private::endSwipeGesture(quint32 serial) -{ - if (swipeGestures.isEmpty()) { - return; + const SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_role, "the wl_surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } } - for (auto it = swipeGestures.constBegin(), end = swipeGestures.constEnd(); it != end; it++) { - (*it)->end(serial); + + if (!cursor) { // TODO: Assign the cursor surface role. + cursor = new Cursor(q); + cursor->d->update(surface, serial, QPoint(hotspot_x, hotspot_y)); + QObject::connect(cursor, &Cursor::changed, q, &PointerInterface::cursorChanged); + Q_EMIT q->cursorChanged(); + } else { + cursor->d->update(surface, serial, QPoint(hotspot_x, hotspot_y)); } } -void PointerInterface::Private::cancelSwipeGesture(quint32 serial) +void PointerInterfacePrivate::pointer_release(Resource *resource) { - if (swipeGestures.isEmpty()) { - return; - } - for (auto it = swipeGestures.constBegin(), end = swipeGestures.constEnd(); it != end; it++) { - (*it)->cancel(serial); - } + wl_resource_destroy(resource->handle); } -void PointerInterface::Private::startPinchGesture(quint32 serial, quint32 fingerCount) +void PointerInterfacePrivate::pointer_bind_resource(Resource *resource) { - if (pinchGestures.isEmpty()) { - return; - } - for (auto it = pinchGestures.constBegin(), end = pinchGestures.constEnd(); it != end; it++) { - (*it)->start(serial, fingerCount); + const ClientConnection *focusedClient = focusedSurface ? focusedSurface->client() : nullptr; + + if (focusedClient && focusedClient->client() == resource->client()) { + const quint32 serial = seat->display()->nextSerial(); + send_enter(resource->handle, serial, focusedSurface->resource(), wl_fixed_from_double(lastPosition.x()), wl_fixed_from_double(lastPosition.y())); + if (resource->version() >= WL_POINTER_FRAME_SINCE_VERSION) { + send_frame(resource->handle); + } } } -void PointerInterface::Private::updatePinchGesture(const QSizeF &delta, qreal scale, qreal rotation) +void PointerInterfacePrivate::sendLeave(quint32 serial) { - if (pinchGestures.isEmpty()) { - return; - } - for (auto it = pinchGestures.constBegin(), end = pinchGestures.constEnd(); it != end; it++) { - (*it)->update(delta, scale, rotation); + const QList pointerResources = pointersForClient(focusedSurface->client()); + for (Resource *resource : pointerResources) { + send_leave(resource->handle, serial, focusedSurface->resource()); } } -void PointerInterface::Private::endPinchGesture(quint32 serial) +void PointerInterfacePrivate::sendEnter(const QPointF &position, quint32 serial) { - if (pinchGestures.isEmpty()) { - return; - } - for (auto it = pinchGestures.constBegin(), end = pinchGestures.constEnd(); it != end; it++) { - (*it)->end(serial); + const QList pointerResources = pointersForClient(focusedSurface->client()); + for (Resource *resource : pointerResources) { + send_enter(resource->handle, serial, focusedSurface->resource(), wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); } } -void PointerInterface::Private::cancelPinchGesture(quint32 serial) +void PointerInterfacePrivate::sendFrame() { - if (pinchGestures.isEmpty()) { - return; - } - for (auto it = pinchGestures.constBegin(), end = pinchGestures.constEnd(); it != end; it++) { - (*it)->cancel(serial); + const QList pointerResources = pointersForClient(focusedSurface->client()); + for (Resource *resource : pointerResources) { + if (resource->version() >= WL_POINTER_FRAME_SINCE_VERSION) { + send_frame(resource->handle); + } } } -void PointerInterface::Private::sendFrame() +PointerInterface::PointerInterface(SeatInterface *seat) + : d(new PointerInterfacePrivate(this, seat)) { - if (!resource || wl_resource_get_version(resource) < WL_POINTER_FRAME_SINCE_VERSION) { - return; - } - wl_pointer_send_frame(resource); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_pointer_interface PointerInterface::Private::s_interface = { - setCursorCallback, - resourceDestroyedCallback -}; -#endif - -PointerInterface::PointerInterface(SeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) +PointerInterface::~PointerInterface() { - // TODO: handle touch - connect(parent, &SeatInterface::pointerPosChanged, this, [this] { - Q_D(); - if (d->focusedSurface && d->resource) { - if (d->seat->isDragPointer() && !d->focusedSurface->dataProxy()) { - return; - } - - if (!d->focusedSurface->lockedPointer().isNull() && d->focusedSurface->lockedPointer()->isLocked()) { - return; - } - const QPointF pos = d->seat->focusedPointerSurfaceTransformation().map(d->seat->pointerPos()); - auto targetSurface = d->focusedSurface->inputSurfaceAt(pos); - if (!targetSurface) { - targetSurface = d->focusedSurface; - } - if (targetSurface != d->focusedChildSurface.data()) { - const quint32 serial = d->seat->display()->nextSerial(); - d->sendLeave(d->focusedChildSurface.data(), serial); - d->focusedChildSurface = QPointer(targetSurface); - d->sendEnter(targetSurface, pos, serial); - d->sendFrame(); - d->client->flush(); - } else { - const QPointF adjustedPos = pos - surfacePosition(d->focusedChildSurface); - wl_pointer_send_motion(d->resource, d->seat->timestamp(), - wl_fixed_from_double(adjustedPos.x()), wl_fixed_from_double(adjustedPos.y())); - d->sendFrame(); - } - } - }); } -PointerInterface::~PointerInterface() = default; - SurfaceInterface *PointerInterface::focusedSurface() const { - Q_D(); return d->focusedSurface; } -void PointerInterface::setFocusedSurface(SurfaceInterface *surface, quint32 serial) +void PointerInterface::setFocusedSurface(SurfaceInterface *surface, const QPointF &position, quint32 serial) { - Q_D(); - d->sendLeave(d->focusedChildSurface.data(), serial); - disconnect(d->destroyConnection); - if (!surface) { - d->focusedSurface = nullptr; - d->focusedChildSurface.clear(); + if (d->focusedSurface == surface) { return; } - d->focusedSurface = surface; - d->destroyConnection = connect(d->focusedSurface, &Resource::aboutToBeUnbound, this, - [this] { - Q_D(); - d->sendLeave(d->focusedChildSurface.data(), d->global->display()->nextSerial()); + + if (d->focusedSurface) { + d->sendLeave(serial); + if (!surface || d->focusedSurface->client() != surface->client()) { d->sendFrame(); - d->focusedSurface = nullptr; - d->focusedChildSurface.clear(); } - ); - - const QPointF pos = d->seat->focusedPointerSurfaceTransformation().map(d->seat->pointerPos()); - d->focusedChildSurface = QPointer(d->focusedSurface->inputSurfaceAt(pos)); - if (!d->focusedChildSurface) { - d->focusedChildSurface = QPointer(d->focusedSurface); + disconnect(d->destroyConnection); } - d->sendEnter(d->focusedChildSurface.data(), pos, serial); - d->client->flush(); -} -void PointerInterface::setFocusedSurface(SurfaceInterface *surface, quint32 serial, QMatrix4x4 matrix) -{ - Q_D(); - d->sendLeave(d->focusedChildSurface.data(), serial); - disconnect(d->destroyConnection); - if (!surface) { - d->focusedSurface = nullptr; - d->focusedChildSurface.clear(); - return; - } d->focusedSurface = surface; - d->destroyConnection = connect(d->focusedSurface, &Resource::aboutToBeUnbound, this, - [this] { - Q_D(); - d->sendLeave(d->focusedChildSurface.data(), d->global->display()->nextSerial()); + + if (d->focusedSurface) { + d->destroyConnection = connect(d->focusedSurface, &SurfaceInterface::aboutToBeDestroyed, this, [this]() { + d->sendLeave(d->seat->display()->nextSerial()); d->sendFrame(); d->focusedSurface = nullptr; - d->focusedChildSurface.clear(); - } - ); - - const QPointF pos = matrix.map(d->seat->pointerPos()); - d->focusedChildSurface = QPointer(d->focusedSurface->inputSurfaceAt(pos)); - if (!d->focusedChildSurface) { - d->focusedChildSurface = QPointer(d->focusedSurface); + Q_EMIT focusedSurfaceChanged(); + }); + d->sendEnter(position, serial); + d->sendFrame(); + d->lastPosition = position; } - d->sendEnter(d->focusedChildSurface.data(), pos, serial); - d->client->flush(); + + Q_EMIT focusedSurfaceChanged(); } -void PointerInterface::buttonPressed(quint32 button, quint32 serial) +void PointerInterface::sendButton(quint32 button, PointerButtonState state, quint32 serial) { - Q_D(); if (!d->focusedSurface) { return; } - if (!d->resource) { - return; + + const auto pointerResources = d->pointersForClient(d->focusedSurface->client()); + for (PointerInterfacePrivate::Resource *resource : pointerResources) { + d->send_button(resource->handle, serial, d->seat->timestamp(), button, quint32(state)); } - wl_pointer_send_button(d->resource, serial, d->seat->timestamp(), button, WL_POINTER_BUTTON_STATE_PRESSED); - d->sendFrame(); } -void PointerInterface::buttonReleased(quint32 button, quint32 serial) +void PointerInterface::sendAxis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source) { - Q_D(); if (!d->focusedSurface) { return; } - if (!d->resource) { - return; + + const auto pointerResources = d->pointersForClient(d->focusedSurface->client()); + for (PointerInterfacePrivate::Resource *resource : pointerResources) { + const quint32 version = resource->version(); + + const auto wlOrientation = + (orientation == Qt::Vertical) ? PointerInterfacePrivate::axis_vertical_scroll : PointerInterfacePrivate::axis_horizontal_scroll; + + if (source != PointerAxisSource::Unknown && version >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION) { + PointerInterfacePrivate::axis_source wlSource; + switch (source) { + case PointerAxisSource::Wheel: + wlSource = PointerInterfacePrivate::axis_source_wheel; + break; + case PointerAxisSource::Finger: + wlSource = PointerInterfacePrivate::axis_source_finger; + break; + case PointerAxisSource::Continuous: + wlSource = PointerInterfacePrivate::axis_source_continuous; + break; + case PointerAxisSource::WheelTilt: + wlSource = PointerInterfacePrivate::axis_source_wheel_tilt; + break; + default: + Q_UNREACHABLE(); + break; + } + d->send_axis_source(resource->handle, wlSource); + } + + if (delta != 0.0) { + if (discreteDelta && version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION) { + d->send_axis_discrete(resource->handle, wlOrientation, discreteDelta); + } + d->send_axis(resource->handle, d->seat->timestamp(), wlOrientation, wl_fixed_from_double(delta)); + } else if (version >= WL_POINTER_AXIS_STOP_SINCE_VERSION) { + d->send_axis_stop(resource->handle, d->seat->timestamp(), wlOrientation); + } } - wl_pointer_send_button(d->resource, serial, d->seat->timestamp(), button, WL_POINTER_BUTTON_STATE_RELEASED); - d->sendFrame(); } -void PointerInterface::axis(Qt::Orientation orientation, qint32 delta) +void PointerInterface::sendMotion(const QPointF &position) { - Q_D(); + d->lastPosition = position; + if (!d->focusedSurface) { return; } - if (!d->resource) { - return; + + const auto pointerResources = d->pointersForClient(d->focusedSurface->client()); + for (PointerInterfacePrivate::Resource *resource : pointerResources) { + d->send_motion(resource->handle, d->seat->timestamp(), wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); } - wl_pointer_send_axis(d->resource, d->seat->timestamp(), - (orientation == Qt::Vertical) ? WL_POINTER_AXIS_VERTICAL_SCROLL : WL_POINTER_AXIS_HORIZONTAL_SCROLL, - wl_fixed_from_int(delta)); - d->sendFrame(); } -void PointerInterface::Private::setCursorCallback(wl_client *client, wl_resource *resource, uint32_t serial, - wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) -{ - auto p = cast(resource); - Q_ASSERT(p->client->client() == client); - p->setCursor(serial, SurfaceInterface::get(surface), QPoint(hotspot_x, hotspot_y)); +void PointerInterface::sendFrame() +{ + if (d->focusedSurface) { + d->sendFrame(); + } } Cursor *PointerInterface::cursor() const { - Q_D(); return d->cursor; } -void PointerInterface::relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) +SeatInterface *PointerInterface::seat() const { - Q_D(); - if (d->relativePointers.isEmpty()) { - return; - } - for (auto it = d->relativePointers.constBegin(), end = d->relativePointers.constEnd(); it != end; it++) { - (*it)->relativeMotion(delta, deltaNonAccelerated, microseconds); - } - d->sendFrame(); -} - -PointerInterface::Private *PointerInterface::d_func() const -{ - return reinterpret_cast(d.data()); + return d->seat; } PointerInterface *PointerInterface::get(wl_resource *native) { - return Private::get(native); + if (PointerInterfacePrivate *pointerPrivate = resource_cast(native)) { + return pointerPrivate->q; + } + return nullptr; } -Cursor::Private::Private(Cursor *q, PointerInterface *pointer) - : pointer(pointer) - , q(q) +CursorPrivate::CursorPrivate(Cursor *q, PointerInterface *pointer) + : q(q) + , pointer(pointer) { } -void Cursor::Private::update(const QPointer< SurfaceInterface > &s, quint32 serial, const QPoint &p) +void CursorPrivate::update(SurfaceInterface *s, quint32 serial, const QPoint &p) { bool emitChanged = false; if (enteredSerial != serial) { enteredSerial = serial; emitChanged = true; - emit q->enteredSerialChanged(); + Q_EMIT q->enteredSerialChanged(); } if (hotspot != p) { hotspot = p; emitChanged = true; - emit q->hotspotChanged(); + Q_EMIT q->hotspotChanged(); } if (surface != s) { if (!surface.isNull()) { @@ -435,20 +308,22 @@ QObject::connect(surface.data(), &SurfaceInterface::damaged, q, &Cursor::changed); } emitChanged = true; - emit q->surfaceChanged(); + Q_EMIT q->surfaceChanged(); } if (emitChanged) { - emit q->changed(); + Q_EMIT q->changed(); } } Cursor::Cursor(PointerInterface *parent) : QObject(parent) - , d(new Private(this, parent)) + , d(new CursorPrivate(this, parent)) { } -Cursor::~Cursor() = default; +Cursor::~Cursor() +{ +} quint32 Cursor::enteredSerial() const { @@ -465,10 +340,9 @@ return d->pointer; } -QPointer< SurfaceInterface > Cursor::surface() const +SurfaceInterface *Cursor::surface() const { return d->surface; } -} -} +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointer_interface.h dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface.h --- dwayland-5.57.0.23/src/server/pointer_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,117 +1,113 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Adrien Faveraux + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_POINTER_INTERFACE_H -#define WAYLAND_SERVER_POINTER_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include +#include -#include "resource.h" +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ +class CursorPrivate; class Cursor; -class PointerGesturesUnstableV1Interface; -class RelativePointerManagerUnstableV1Interface; +class PointerInterfacePrivate; class SeatInterface; class SurfaceInterface; +enum class PointerAxisSource; +enum class PointerButtonState : quint32; + /** - * @brief Resource for the wl_pointer interface. - * - * @see SeatInterface - **/ -class KWAYLANDSERVER_EXPORT PointerInterface : public Resource + * The PointerInterface class represents one or more input devices such as mice, which control + * the pointer location. It corresponds to the Wayland interface @c wl_pointer. + */ +class KWAYLANDSERVER_EXPORT PointerInterface : public QObject { Q_OBJECT + public: - virtual ~PointerInterface(); + ~PointerInterface() override; /** - * @returns the focused SurfaceInterface on this pointer resource, if any. - **/ + * Returns the focused pointer surface. Note that the returned value may be different + * from SurfaceInterface::focusedSurfacePointerSurface() because this function returns + * the effective focused surface. + */ SurfaceInterface *focusedSurface() const; - /** - * The Cursor set on this PointerInterface. Might be @c null. - * @since 5.3 - **/ + * Sets the effective focused pointer surface to @a surface. The @a position indicates + * where the pointer has entered the surface. + */ + void setFocusedSurface(SurfaceInterface *surface, const QPointF &position, quint32 serial); + Cursor *cursor() const; /** + * Returns the seat to which this pointer belongs to. + */ + SeatInterface *seat() const; + + /** * @returns The PointerInterface for the @p native resource. - * @since 5.28 - **/ + */ static PointerInterface *get(wl_resource *native); - void setFocusedSurface(SurfaceInterface *surface, quint32 serial); - - void setFocusedSurface(SurfaceInterface *surface, quint32 serial, QMatrix4x4 matrix); + void sendButton(quint32 button, PointerButtonState state, quint32 serial); + void sendAxis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source); + void sendMotion(const QPointF &position); + void sendFrame(); Q_SIGNALS: /** - * Signal emitted whenever the Cursor changes. - **/ + * This signal is emitted whenever the cursor surface changes. As long as there is no + * any focused surface, the cursor cannot be changed. + */ void cursorChanged(); + /** + * This signal is emitted whenever the focused pointer surface changes. + */ + void focusedSurfaceChanged(); private: - void buttonPressed(quint32 button, quint32 serial); - void buttonReleased(quint32 button, quint32 serial); - void axis(Qt::Orientation orientation, qint32 delta); - void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds); + explicit PointerInterface(SeatInterface *seat); + QScopedPointer d; + friend class SeatInterface; - friend class RelativePointerManagerUnstableV1Interface; - friend class PointerGesturesUnstableV1Interface; - explicit PointerInterface(SeatInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; + friend class PointerInterfacePrivate; }; /** * @brief Class encapsulating a Cursor image. - * - * @since 5.3 - **/ + */ class KWAYLANDSERVER_EXPORT Cursor : public QObject { Q_OBJECT + public: virtual ~Cursor(); /** * The hotspot of the cursor image in surface-relative coordinates. - **/ + */ QPoint hotspot() const; /** * The entered serial when the Cursor got set. - **/ + */ quint32 enteredSerial() const; /** * The PointerInterface this Cursor belongs to. - **/ + */ PointerInterface *pointer() const; /** * The SurfaceInterface for the image content of the Cursor. - **/ - QPointer surface() const; + */ + SurfaceInterface *surface() const; Q_SIGNALS: void hotspotChanged(); @@ -120,15 +116,9 @@ void changed(); private: - friend class PointerInterface; - Cursor(PointerInterface *parent); - class Private; - const QScopedPointer d; + QScopedPointer d; + friend class PointerInterfacePrivate; + explicit Cursor(PointerInterface *parent); }; -} -} - -Q_DECLARE_METATYPE(KWayland::Server::PointerInterface*) - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/pointer_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface_p.h --- dwayland-5.57.0.23/src/server/pointer_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/pointer_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,83 +1,57 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Adrien Faveraux + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_POINTER_INTERFACE_P_H -#define WAYLAND_SERVER_POINTER_INTERFACE_P_H #include "pointer_interface.h" -#include "resource_p.h" +#include #include #include -namespace KWayland -{ -namespace Server +#include "qwayland-server-wayland.h" + +namespace KWaylandServer { -class PointerPinchGestureInterface; -class PointerSwipeGestureInterface; -class RelativePointerInterface; +class ClientConnection; +class PointerPinchGestureV1Interface; +class PointerSwipeGestureV1Interface; +class PointerHoldGestureV1Interface; +class RelativePointerV1Interface; -class PointerInterface::Private : public Resource::Private +class PointerInterfacePrivate : public QtWaylandServer::wl_pointer { public: - Private(SeatInterface *parent, wl_resource *parentResource, PointerInterface *q); + static PointerInterfacePrivate *get(PointerInterface *pointer); + + PointerInterfacePrivate(PointerInterface *q, SeatInterface *seat); + ~PointerInterfacePrivate() override; + + QList pointersForClient(ClientConnection *client) const; + PointerInterface *q; SeatInterface *seat; SurfaceInterface *focusedSurface = nullptr; - QPointer focusedChildSurface; QMetaObject::Connection destroyConnection; Cursor *cursor = nullptr; - QVector relativePointers; - QVector swipeGestures; - QVector pinchGestures; + QScopedPointer relativePointersV1; + QScopedPointer swipeGesturesV1; + QScopedPointer pinchGesturesV1; + QScopedPointer holdGesturesV1; + QPointF lastPosition; - void sendLeave(SurfaceInterface *surface, quint32 serial); - void sendEnter(SurfaceInterface *surface, const QPointF &parentSurfacePosition, quint32 serial); + void sendLeave(quint32 serial); + void sendEnter(const QPointF &parentSurfacePosition, quint32 serial); void sendFrame(); - void registerRelativePointer(RelativePointerInterface *relativePointer); - void registerSwipeGesture(PointerSwipeGestureInterface *gesture); - void registerPinchGesture(PointerPinchGestureInterface *gesture); - - void startSwipeGesture(quint32 serial, quint32 fingerCount); - void updateSwipeGesture(const QSizeF &delta); - void endSwipeGesture(quint32 serial); - void cancelSwipeGesture(quint32 serial); - - void startPinchGesture(quint32 serial, quint32 fingerCount); - void updatePinchGesture(const QSizeF &delta, qreal scale, qreal rotation); - void endPinchGesture(quint32 serial); - void cancelPinchGesture(quint32 serial); - -private: - PointerInterface *q_func() { - return reinterpret_cast(q); - } - void setCursor(quint32 serial, SurfaceInterface *surface, const QPoint &hotspot); - // interface - static void setCursorCallback(wl_client *client, wl_resource *resource, uint32_t serial, - wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y); - - static const struct wl_pointer_interface s_interface; +protected: + void pointer_set_cursor(Resource *resource, uint32_t serial, ::wl_resource *surface_resource, int32_t hotspot_x, int32_t hotspot_y) override; + void pointer_release(Resource *resource) override; + void pointer_bind_resource(Resource *resource) override; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/primaryoutput_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/primaryoutput_v1_interface.cpp --- dwayland-5.57.0.23/src/server/primaryoutput_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryoutput_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,61 @@ +/* + SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "primaryoutput_v1_interface.h" + +#include "display.h" +#include "outputconfiguration_v2_interface.h" +#include "outputmanagement_v2_interface.h" + +#include "qwayland-server-kde-primary-output-v1.h" +#include + +#include + +namespace KWaylandServer +{ +static const quint32 s_version = 1; + +class PrimaryOutputV1InterfacePrivate : public QtWaylandServer::kde_primary_output_v1 +{ +public: + PrimaryOutputV1InterfacePrivate(Display *display) + : QtWaylandServer::kde_primary_output_v1(*display, s_version) + { + } + + void kde_primary_output_v1_bind_resource(Resource *resource) override + { + if (!m_outputName.isEmpty()) { + send_primary_output(resource->handle, m_outputName); + } + } + + QString m_outputName; +}; + +PrimaryOutputV1Interface::PrimaryOutputV1Interface(KWaylandServer::Display *display, QObject *parent) + : QObject(parent) + , d(new PrimaryOutputV1InterfacePrivate(display)) +{ +} + +PrimaryOutputV1Interface::~PrimaryOutputV1Interface() = default; + +void PrimaryOutputV1Interface::setPrimaryOutput(const QString &outputName) +{ + if (outputName == d->m_outputName) { + return; + } + d->m_outputName = outputName; + + const auto resources = d->resourceMap(); + for (auto *resource : resources) { + d->send_primary_output(resource->handle, outputName); + } +} + +} diff -Nru dwayland-5.57.0.23/src/server/primaryoutput_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/primaryoutput_v1_interface.h --- dwayland-5.57.0.23/src/server/primaryoutput_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryoutput_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,37 @@ +/* + SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class OutputDeviceV2Interface; +class PrimaryOutputV1InterfacePrivate; + +class KWAYLANDSERVER_EXPORT PrimaryOutputV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit PrimaryOutputV1Interface(Display *display, QObject *parent = nullptr); + ~PrimaryOutputV1Interface() override; + + /** + * Sets a primary output's @p outputName for the current display configuration + * + * It's up to the compositor to decide what the semantics are for it. + */ + void setPrimaryOutput(const QString &outputName); + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/primaryselectiondevicemanager_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevicemanager_v1_interface.cpp --- dwayland-5.57.0.23/src/server/primaryselectiondevicemanager_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevicemanager_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -5,122 +5,73 @@ */ #include "primaryselectiondevicemanager_v1_interface.h" +#include "display.h" #include "primaryselectiondevice_v1_interface.h" #include "primaryselectionsource_v1_interface.h" -#include "wayland-wp-primary-selection-unstable-v1-server-protocol.h" -#include "display.h" #include "seat_interface_p.h" // Wayland -#include "global_p.h" +#include static const int s_version = 1; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class PrimarySelectionDeviceManagerV1Interface::Private : public Global::Private +class PrimarySelectionDeviceManagerV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_device_manager_v1 { public: - Private(PrimarySelectionDeviceManagerV1Interface *q, Display *d); + PrimarySelectionDeviceManagerV1InterfacePrivate(PrimarySelectionDeviceManagerV1Interface *q, Display *d); PrimarySelectionDeviceManagerV1Interface *q; -protected: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createDataSource(wl_client *client, wl_resource *resource, uint32_t id); - void getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - - static void unbind(wl_resource *resource); - static void createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - static const struct zwp_primary_selection_device_manager_v1_interface s_interface; - static const quint32 s_version; - static const qint32 s_dataDeviceVersion; - static const qint32 s_dataSourceVersion; -}; -const quint32 PrimarySelectionDeviceManagerV1Interface::Private::s_version = 1; -const qint32 PrimarySelectionDeviceManagerV1Interface::Private::s_dataDeviceVersion = 1; -const qint32 PrimarySelectionDeviceManagerV1Interface::Private::s_dataSourceVersion = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_primary_selection_device_manager_v1_interface PrimarySelectionDeviceManagerV1Interface::Private::s_interface = { - createDataSourceCallback, - getDataDeviceCallback +protected: + void zwp_primary_selection_device_manager_v1_create_source(Resource *resource, uint32_t id) override; + void zwp_primary_selection_device_manager_v1_get_device(Resource *resource, uint32_t id, wl_resource *seat) override; + void zwp_primary_selection_device_manager_v1_destroy(Resource *resource) override; }; -#endif - -PrimarySelectionDeviceManagerV1Interface::Private::Private(PrimarySelectionDeviceManagerV1Interface *q, Display *d) - : Global::Private(d, &zwp_primary_selection_device_manager_v1_interface, s_version) +PrimarySelectionDeviceManagerV1InterfacePrivate::PrimarySelectionDeviceManagerV1InterfacePrivate(PrimarySelectionDeviceManagerV1Interface *q, Display *d) + : QtWaylandServer::zwp_primary_selection_device_manager_v1(*d, s_version) , q(q) { } - -void PrimarySelectionDeviceManagerV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void PrimarySelectionDeviceManagerV1InterfacePrivate::zwp_primary_selection_device_manager_v1_create_source(Resource *resource, uint32_t id) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_primary_selection_device_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); + wl_resource *data_source_resource = wl_resource_create(resource->client(), &zwp_primary_selection_source_v1_interface, resource->version(), id); + if (!data_source_resource) { + wl_resource_post_no_memory(resource->handle); return; } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void PrimarySelectionDeviceManagerV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -void PrimarySelectionDeviceManagerV1Interface::Private::createDataSourceCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->createDataSource(client, resource, id); + PrimarySelectionSourceV1Interface *dataSource = new PrimarySelectionSourceV1Interface(q, data_source_resource); + Q_EMIT q->dataSourceCreated(dataSource); } -void PrimarySelectionDeviceManagerV1Interface::Private::createDataSource(wl_client *client, wl_resource *resource, uint32_t id) +void PrimarySelectionDeviceManagerV1InterfacePrivate::zwp_primary_selection_device_manager_v1_get_device(Resource *resource, uint32_t id, wl_resource *seat) { - PrimarySelectionSourceV1Interface *dataSource = new PrimarySelectionSourceV1Interface(q, resource); - dataSource->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataSourceVersion) , id); - if (!dataSource->resource()) { - wl_resource_post_no_memory(resource); - delete dataSource; + SeatInterface *s = SeatInterface::get(seat); + Q_ASSERT(s); + if (!s) { return; } - emit q->primarySelectSourceCreated(dataSource); -} -void PrimarySelectionDeviceManagerV1Interface::Private::getDataDeviceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) -{ - cast(resource)->getDataDevice(client, resource, id, seat); + wl_resource *data_device_resource = wl_resource_create(resource->client(), &zwp_primary_selection_device_v1_interface, resource->version(), id); + if (!data_device_resource) { + wl_resource_post_no_memory(resource->handle); + return; + } + PrimarySelectionDeviceV1Interface *dataDevice = new PrimarySelectionDeviceV1Interface(s, data_device_resource); + Q_EMIT q->dataDeviceCreated(dataDevice); } -void PrimarySelectionDeviceManagerV1Interface::Private::getDataDevice(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *seat) +void PrimarySelectionDeviceManagerV1InterfacePrivate::zwp_primary_selection_device_manager_v1_destroy(Resource *resource) { - if (!client || !resource || !seat) - return; - SeatInterface *s = SeatInterface::get(seat); - Q_ASSERT(s); - PrimarySelectionDeviceV1Interface *dataDevice = new PrimarySelectionDeviceV1Interface(s, q, resource); - dataDevice->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataDeviceVersion), id); - if (!dataDevice->resource()) { - wl_resource_post_no_memory(resource); - return; - } - s->d_func()->registerPrimarySelectionDevice(dataDevice); - emit q->primarySelectDeviceCreated(dataDevice); + wl_resource_destroy(resource->handle); } PrimarySelectionDeviceManagerV1Interface::PrimarySelectionDeviceManagerV1Interface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new PrimarySelectionDeviceManagerV1InterfacePrivate(this, display)) { } PrimarySelectionDeviceManagerV1Interface::~PrimarySelectionDeviceManagerV1Interface() = default; } -} diff -Nru dwayland-5.57.0.23/src/server/primaryselectiondevicemanager_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevicemanager_v1_interface.h --- dwayland-5.57.0.23/src/server/primaryselectiondevicemanager_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevicemanager_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -3,17 +3,14 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#ifndef WAYLAND_SERVER_PRIMARY_SELECTION_DEVICE_MANAGER_INTERFACE_H -#define WAYLAND_SERVER_PRIMARY_SELECTION_DEVICE_MANAGER_INTERFACE_H +#pragma once #include -#include "global.h" -#include -namespace KWayland -{ -namespace Server -{ +#include + +namespace KWaylandServer +{ class Display; class PrimarySelectionSourceV1Interface; class PrimarySelectionDeviceManagerV1InterfacePrivate; @@ -22,23 +19,21 @@ /** * @brief Represents the Global for zwp_primary_selection_manager_v1 interface. * - **/ -class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceManagerV1Interface : public Global + */ +class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceManagerV1Interface : public QObject { Q_OBJECT + public: + explicit PrimarySelectionDeviceManagerV1Interface(Display *display, QObject *parent = nullptr); ~PrimarySelectionDeviceManagerV1Interface(); Q_SIGNALS: - void primarySelectSourceCreated(KWayland::Server::PrimarySelectionSourceV1Interface *dataSource); - void primarySelectDeviceCreated(KWayland::Server::PrimarySelectionDeviceV1Interface *dataDevice); + void dataSourceCreated(KWaylandServer::PrimarySelectionSourceV1Interface *dataSource); + void dataDeviceCreated(KWaylandServer::PrimarySelectionDeviceV1Interface *dataDevice); private: - explicit PrimarySelectionDeviceManagerV1Interface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; } -} -#endif diff -Nru dwayland-5.57.0.23/src/server/primaryselectiondevice_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevice_v1_interface.cpp --- dwayland-5.57.0.23/src/server/primaryselectiondevice_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevice_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -4,145 +4,123 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #include "primaryselectiondevice_v1_interface.h" +#include "display.h" #include "primaryselectiondevicemanager_v1_interface.h" #include "primaryselectionoffer_v1_interface.h" #include "primaryselectionsource_v1_interface.h" -#include "wayland-wp-primary-selection-unstable-v1-server-protocol.h" -#include "display.h" #include "seat_interface.h" #include "seat_interface_p.h" -#include "resource_p.h" -#include + // Wayland +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { -class PrimarySelectionDeviceV1Interface::Private : public Resource::Private +class PrimarySelectionDeviceV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_device_v1 { public: - Private(SeatInterface *seat, PrimarySelectionDeviceV1Interface *q, PrimarySelectionDeviceManagerV1Interface *manager, wl_resource *parentResource); + PrimarySelectionDeviceV1InterfacePrivate(PrimarySelectionDeviceV1Interface *q, SeatInterface *seat, wl_resource *resource); PrimarySelectionOfferV1Interface *createDataOffer(AbstractDataSource *source); PrimarySelectionDeviceV1Interface *q; SeatInterface *seat; QPointer selection; - QMetaObject::Connection selectionUnboundConnection; - QMetaObject::Connection selectionDestroyedConnection; -private: - PrimarySelectionDeviceV1Interface *q_func() { - return reinterpret_cast(q); - } +private: void setSelection(PrimarySelectionSourceV1Interface *dataSource); - static void setSelectionCallback(wl_client *client, wl_resource *resource, wl_resource *source, uint32_t serial); - static const struct zwp_primary_selection_device_v1_interface s_interface; protected: - + void zwp_primary_selection_device_v1_destroy_resource(Resource *resource) override; + void zwp_primary_selection_device_v1_set_selection(Resource *resource, wl_resource *source, uint32_t serial) override; + void zwp_primary_selection_device_v1_destroy(Resource *resource) override; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_primary_selection_device_v1_interface PrimarySelectionDeviceV1Interface::Private::s_interface = { - setSelectionCallback, - resourceDestroyedCallback -}; -#endif - -PrimarySelectionDeviceV1Interface::Private::Private(SeatInterface *seat, PrimarySelectionDeviceV1Interface *q, PrimarySelectionDeviceManagerV1Interface *manager, wl_resource *parentResource) - : Resource::Private(q, manager, parentResource, &zwp_primary_selection_device_v1_interface, &s_interface) - , q(q) +PrimarySelectionDeviceV1InterfacePrivate::PrimarySelectionDeviceV1InterfacePrivate(PrimarySelectionDeviceV1Interface *_q, + SeatInterface *seat, + wl_resource *resource) + : QtWaylandServer::zwp_primary_selection_device_v1(resource) + , q(_q) , seat(seat) { } - -void PrimarySelectionDeviceV1Interface::Private::setSelectionCallback(wl_client *client, wl_resource *resource, wl_resource *source, uint32_t serial) +void PrimarySelectionDeviceV1InterfacePrivate::zwp_primary_selection_device_v1_set_selection(Resource *resource, wl_resource *source, uint32_t serial) { - Q_UNUSED(client) + Q_UNUSED(resource) Q_UNUSED(serial) - // TODO: verify serial - cast(resource)->setSelection(PrimarySelectionSourceV1Interface::get(source)); -} + PrimarySelectionSourceV1Interface *dataSource = nullptr; + + if (source) { + dataSource = PrimarySelectionSourceV1Interface::get(source); + Q_ASSERT(dataSource); + } -void PrimarySelectionDeviceV1Interface::Private::setSelection(PrimarySelectionSourceV1Interface *dataSource) -{ if (selection == dataSource) { return; } - Q_Q(PrimarySelectionDeviceV1Interface); - QObject::disconnect(selectionUnboundConnection); - QObject::disconnect(selectionDestroyedConnection); if (selection) { selection->cancel(); } selection = dataSource; if (selection) { - auto clearSelection = [this] { - setSelection(nullptr); - }; - selectionUnboundConnection = QObject::connect(selection, &Resource::unbound, q, clearSelection); - selectionDestroyedConnection = QObject::connect(selection, &QObject::destroyed, q, clearSelection); - emit q->selectionChanged(selection); - } else { - selectionUnboundConnection = QMetaObject::Connection(); - selectionDestroyedConnection = QMetaObject::Connection(); - emit q->selectionCleared(); + Q_EMIT q->selectionChanged(selection); } } -PrimarySelectionOfferV1Interface *PrimarySelectionDeviceV1Interface::Private::createDataOffer(AbstractDataSource *source) +void PrimarySelectionDeviceV1InterfacePrivate::zwp_primary_selection_device_v1_destroy(QtWaylandServer::zwp_primary_selection_device_v1::Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +PrimarySelectionOfferV1Interface *PrimarySelectionDeviceV1InterfacePrivate::createDataOffer(AbstractDataSource *source) { - if (!resource) { - return nullptr; - } if (!source) { - // a select offer can only exist together with a source + // a data offer can only exist together with a source return nullptr; } - Q_Q(PrimarySelectionDeviceV1Interface); - PrimarySelectionOfferV1Interface *offer = new PrimarySelectionOfferV1Interface(source, q, resource); - auto c = q->global()->display()->getConnection(wl_resource_get_client(resource)); - offer->create(c, wl_resource_get_version(resource), 0); - if (!offer->resource()) { - // TODO: send error? - delete offer; + + wl_resource *data_offer_resource = wl_resource_create(resource()->client(), &zwp_primary_selection_offer_v1_interface, resource()->version(), 0); + if (!data_offer_resource) { + wl_resource_post_no_memory(resource()->handle); return nullptr; } - zwp_primary_selection_device_v1_send_data_offer(resource, offer->resource()); + + PrimarySelectionOfferV1Interface *offer = new PrimarySelectionOfferV1Interface(source, data_offer_resource); + send_data_offer(offer->resource()); offer->sendAllOffers(); return offer; } -PrimarySelectionDeviceV1Interface::PrimarySelectionDeviceV1Interface(SeatInterface *seat, PrimarySelectionDeviceManagerV1Interface *parent, wl_resource *parentResource) - : Resource(new Private(seat, this, parent, parentResource)) +void PrimarySelectionDeviceV1InterfacePrivate::zwp_primary_selection_device_v1_destroy_resource( + QtWaylandServer::zwp_primary_selection_device_v1::Resource *resource) { + Q_UNUSED(resource) + delete q; } -PrimarySelectionDeviceV1Interface::Private *PrimarySelectionDeviceV1Interface::d_func() const +PrimarySelectionDeviceV1Interface::PrimarySelectionDeviceV1Interface(SeatInterface *seat, wl_resource *resource) + : QObject() + , d(new PrimarySelectionDeviceV1InterfacePrivate(this, seat, resource)) { - return reinterpret_cast(d.data()); + SeatInterfacePrivate *seatPrivate = SeatInterfacePrivate::get(seat); + seatPrivate->registerPrimarySelectionDevice(this); } PrimarySelectionDeviceV1Interface::~PrimarySelectionDeviceV1Interface() = default; SeatInterface *PrimarySelectionDeviceV1Interface::seat() const { - Q_D(); return d->seat; } PrimarySelectionSourceV1Interface *PrimarySelectionDeviceV1Interface::selection() const { - Q_D(); return d->selection; } void PrimarySelectionDeviceV1Interface::sendSelection(AbstractDataSource *other) { - Q_D(); if (!other) { sendClearSelection(); return; @@ -151,33 +129,17 @@ if (!offer) { return; } - if (!d->resource) { - return; - } - zwp_primary_selection_device_v1_send_selection(d->resource,offer->resource()); + d->send_selection(offer->resource()); } void PrimarySelectionDeviceV1Interface::sendClearSelection() { - Q_D(); - if (!d->resource) { - return; - } - zwp_primary_selection_device_v1_send_selection(d->resource,nullptr); + d->send_selection(nullptr); } -void PrimarySelectionDeviceV1Interface::cancel() +wl_client *PrimarySelectionDeviceV1Interface::client() const { - Q_D(); - if (!d->resource) { - return; - } - if (d->selection) - d->selection->cancel(); - client()->flush(); + return d->resource()->client(); } - - -} } diff -Nru dwayland-5.57.0.23/src/server/primaryselectiondevice_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevice_v1_interface.h --- dwayland-5.57.0.23/src/server/primaryselectiondevice_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectiondevice_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -3,29 +3,24 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#ifndef WAYLAND_SERVER_PRIMARY_SELECTION_DEVICE_INTERFACE_H -#define WAYLAND_SERVER_PRIMARY_SELECTION_DEVICE_INTERFACE_H +#pragma once #include -#include -#include "resource.h" +#include struct wl_resource; struct wl_client; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - +class AbstractDataSource; class PrimarySelectionDeviceManagerV1Interface; class PrimarySelectionOfferV1Interface; class PrimarySelectionSourceV1Interface; class SeatInterface; class SurfaceInterface; class PrimarySelectionDeviceV1InterfacePrivate; -class AbstractDataSource; /** * @brief Represents the Resource for the wl_data_device interface. @@ -33,8 +28,8 @@ * @see SeatInterface * @see PrimarySelectionSourceInterface * Lifespan is mapped to the underlying object - **/ -class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceV1Interface : public Resource + */ +class KWAYLANDSERVER_EXPORT PrimarySelectionDeviceV1Interface : public QObject { Q_OBJECT public: @@ -46,23 +41,20 @@ void sendSelection(AbstractDataSource *other); void sendClearSelection(); - void cancel(); + + wl_client *client() const; Q_SIGNALS: - void selectionChanged(KWayland::Server::PrimarySelectionSourceV1Interface*); + void selectionChanged(KWaylandServer::PrimarySelectionSourceV1Interface *); void selectionCleared(); private: - friend class PrimarySelectionDeviceManagerV1Interface; - explicit PrimarySelectionDeviceV1Interface(SeatInterface *seat, PrimarySelectionDeviceManagerV1Interface *parent, wl_resource *resource); - + friend class PrimarySelectionDeviceManagerV1InterfacePrivate; + explicit PrimarySelectionDeviceV1Interface(SeatInterface *seat, wl_resource *resource); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} -Q_DECLARE_METATYPE(KWayland::Server::PrimarySelectionDeviceV1Interface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionDeviceV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/primaryselectionoffer_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionoffer_v1_interface.cpp --- dwayland-5.57.0.23/src/server/primaryselectionoffer_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionoffer_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -6,67 +6,53 @@ #include "primaryselectionoffer_v1_interface.h" #include "primaryselectiondevice_v1_interface.h" #include "primaryselectionsource_v1_interface.h" -#include "resource_p.h" // Qt -#include -#include #include +#include // Wayland -#include "wayland-wp-primary-selection-unstable-v1-server-protocol.h" +#include // system #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - - -class PrimarySelectionOfferV1Interface::Private : public Resource::Private +class PrimarySelectionOfferV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_offer_v1 { public: - Private(AbstractDataSource *source, PrimarySelectionDeviceV1Interface *parentInterface, PrimarySelectionOfferV1Interface *q, wl_resource *parentResource); + PrimarySelectionOfferV1InterfacePrivate(PrimarySelectionOfferV1Interface *q, AbstractDataSource *source, wl_resource *resource); PrimarySelectionOfferV1Interface *q; - AbstractDataSource *source; - PrimarySelectionDeviceV1Interface *primaryDevice; - + QPointer source; - void sendSourceActions(); protected: -private: - PrimarySelectionOfferV1Interface *q_func() { - return reinterpret_cast(q); - } - void receive(const QString &mimeType, qint32 fd); - static void receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd); - - static const struct zwp_primary_selection_offer_v1_interface s_interface; - + void zwp_primary_selection_offer_v1_receive(Resource *resource, const QString &mime_type, int32_t fd) override; + void zwp_primary_selection_offer_v1_destroy(Resource *resource) override; + void zwp_primary_selection_offer_v1_destroy_resource(Resource *resource) override; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_primary_selection_offer_v1_interface PrimarySelectionOfferV1Interface::Private::s_interface = { - receiveCallback, - resourceDestroyedCallback, -}; -#endif - -PrimarySelectionOfferV1Interface::Private::Private(AbstractDataSource *source, PrimarySelectionDeviceV1Interface *parentInterface, PrimarySelectionOfferV1Interface *q, wl_resource *parentResource) - : Resource::Private(q, nullptr, parentResource, &zwp_primary_selection_offer_v1_interface, &s_interface) - , q(q) +PrimarySelectionOfferV1InterfacePrivate::PrimarySelectionOfferV1InterfacePrivate(PrimarySelectionOfferV1Interface *_q, + AbstractDataSource *source, + wl_resource *resource) + : QtWaylandServer::zwp_primary_selection_offer_v1(resource) + , q(_q) , source(source) - , primaryDevice(parentInterface) { } -void PrimarySelectionOfferV1Interface::Private::receiveCallback(wl_client *client, wl_resource *resource, const char *mimeType, int32_t fd) +void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_destroy(QtWaylandServer::zwp_primary_selection_offer_v1::Resource *resource) { - Q_UNUSED(client) - cast(resource)->receive(QString::fromUtf8(mimeType), fd); + wl_resource_destroy(resource->handle); } -void PrimarySelectionOfferV1Interface::Private::receive(const QString &mimeType, qint32 fd) +void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_destroy_resource( + QtWaylandServer::zwp_primary_selection_offer_v1::Resource *resource) { + Q_UNUSED(resource) + delete q; +} + +void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd) +{ + Q_UNUSED(resource) if (!source) { close(fd); return; @@ -74,41 +60,28 @@ source->requestData(mimeType, fd); } +PrimarySelectionOfferV1Interface::PrimarySelectionOfferV1Interface(AbstractDataSource *source, wl_resource *resource) + : QObject() + , d(new PrimarySelectionOfferV1InterfacePrivate(this, source, resource)) +{ + Q_ASSERT(source); + connect(source, &AbstractDataSource::mimeTypeOffered, this, [this](const QString &mimeType) { + d->send_offer(mimeType); + }); +} + PrimarySelectionOfferV1Interface::~PrimarySelectionOfferV1Interface() = default; void PrimarySelectionOfferV1Interface::sendAllOffers() { - Q_D(); for (const QString &mimeType : d->source->mimeTypes()) { - zwp_primary_selection_offer_v1_send_offer(d->resource,mimeType.toUtf8().constData()); + d->send_offer(mimeType); } } -PrimarySelectionOfferV1Interface::PrimarySelectionOfferV1Interface(AbstractDataSource *source, PrimarySelectionDeviceV1Interface *parentInterface, wl_resource *parentResource) - : Resource(new Private(source, parentInterface, this, parentResource)) +wl_resource *PrimarySelectionOfferV1Interface::resource() const { - Q_ASSERT(source); - connect(source, &PrimarySelectionSourceV1Interface::mimeTypeOffered, this, - [this](const QString &mimeType) { - Q_D(); - if (!d->resource) { - return; - } - zwp_primary_selection_offer_v1_send_offer(d->resource, mimeType.toUtf8().constData()); - } - ); - QObject::connect(source, &QObject::destroyed, this, - [this] { - Q_D(); - d->source = nullptr; - } - ); + return d->resource()->handle; } -PrimarySelectionOfferV1Interface::Private *PrimarySelectionOfferV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} } diff -Nru dwayland-5.57.0.23/src/server/primaryselectionoffer_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionoffer_v1_interface.h --- dwayland-5.57.0.23/src/server/primaryselectionoffer_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionoffer_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -3,23 +3,17 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#ifndef WAYLAND_SERVER_PRIMARY_SELECTION_OFFER_INTERFACE_H -#define WAYLAND_SERVER_PRIMARY_SELECTION_OFFER_INTERFACE_H +#pragma once #include -#include +#include #include "primaryselectiondevicemanager_v1_interface.h" -#include "resource.h" - struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class AbstractDataSource; class PrimarySelectionDeviceV1Interface; class PrimarySelectionSourceV1Interface; @@ -28,24 +22,23 @@ /** * @brief Represents the Resource for the wl_data_offer interface. * Lifespan is mapped to the underlying object - **/ -class KWAYLANDSERVER_EXPORT PrimarySelectionOfferV1Interface : public Resource + */ +class KWAYLANDSERVER_EXPORT PrimarySelectionOfferV1Interface : public QObject { Q_OBJECT public: - virtual ~PrimarySelectionOfferV1Interface() ; + ~PrimarySelectionOfferV1Interface() override; void sendAllOffers(); + wl_resource *resource() const; private: - friend class PrimarySelectionDeviceV1Interface; - explicit PrimarySelectionOfferV1Interface(AbstractDataSource *source, PrimarySelectionDeviceV1Interface *parentInterface, wl_resource *parentResource); - class Private; - Private *d_func() const; + friend class PrimarySelectionDeviceV1InterfacePrivate; + explicit PrimarySelectionOfferV1Interface(AbstractDataSource *source, wl_resource *resource); + + QScopedPointer d; }; } -} -Q_DECLARE_METATYPE(KWayland::Server::PrimarySelectionOfferV1Interface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionOfferV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/primaryselectionsource_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionsource_v1_interface.cpp --- dwayland-5.57.0.23/src/server/primaryselectionsource_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionsource_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -4,109 +4,91 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #include "primaryselectionsource_v1_interface.h" -#include "primaryselectiondevicemanager_v1_interface.h" - #include "clientconnection.h" -#include "resource_p.h" +#include "primaryselectiondevicemanager_v1_interface.h" +#include "utils.h" // Qt #include // Wayland -#include "wayland-wp-primary-selection-unstable-v1-server-protocol.h" +#include // system #include -#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -class PrimarySelectionSourceV1Interface::Private : public Resource::Private +class PrimarySelectionSourceV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_source_v1 { public: - Private(PrimarySelectionSourceV1Interface *q, PrimarySelectionDeviceManagerV1Interface *parent, wl_resource *parentResource); - virtual ~Private(); + PrimarySelectionSourceV1InterfacePrivate(PrimarySelectionSourceV1Interface *q, ::wl_resource *resource); QStringList mimeTypes; - PrimarySelectionSourceV1Interface* q; -protected: - PrimarySelectionSourceV1Interface *q_func() { - return reinterpret_cast(q); - } - void offer(const QString &mimeType); + PrimarySelectionSourceV1Interface *q; - const static struct zwp_primary_selection_source_v1_interface s_interface; - static void offerCallback(wl_client *client, wl_resource *resource, const char *mimeType); -}; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_primary_selection_source_v1_interface PrimarySelectionSourceV1Interface::Private::s_interface = { - offerCallback, - resourceDestroyedCallback, +protected: + void zwp_primary_selection_source_v1_destroy_resource(Resource *resource) override; + void zwp_primary_selection_source_v1_offer(Resource *resource, const QString &mime_type) override; + void zwp_primary_selection_source_v1_destroy(Resource *resource) override; }; -#endif -PrimarySelectionSourceV1Interface::Private::~Private() = default; - -PrimarySelectionSourceV1Interface::Private::Private(PrimarySelectionSourceV1Interface *q, PrimarySelectionDeviceManagerV1Interface *parent, wl_resource *parentResource) - : Resource::Private(q, parent, parentResource, &zwp_primary_selection_source_v1_interface, &s_interface) - ,q(q) +PrimarySelectionSourceV1InterfacePrivate::PrimarySelectionSourceV1InterfacePrivate(PrimarySelectionSourceV1Interface *_q, ::wl_resource *resource) + : QtWaylandServer::zwp_primary_selection_source_v1(resource) + , q(_q) { } -void PrimarySelectionSourceV1Interface::Private::offer(const QString &mimeType) + +void PrimarySelectionSourceV1InterfacePrivate::zwp_primary_selection_source_v1_destroy_resource( + QtWaylandServer::zwp_primary_selection_source_v1::Resource *resource) { - mimeTypes << mimeType; - Q_Q(PrimarySelectionSourceV1Interface); - emit q->mimeTypeOffered(mimeType); + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; } -void PrimarySelectionSourceV1Interface::Private::offerCallback(wl_client *client, wl_resource *resource, const char *mimeType) + +void PrimarySelectionSourceV1InterfacePrivate::zwp_primary_selection_source_v1_offer(Resource *, const QString &mimeType) { - Q_UNUSED(client) - cast(resource)->offer(QString::fromUtf8(mimeType)); + mimeTypes << mimeType; + Q_EMIT q->mimeTypeOffered(mimeType); } - -PrimarySelectionSourceV1Interface::PrimarySelectionSourceV1Interface(PrimarySelectionDeviceManagerV1Interface *parent, ::wl_resource *parentResource) - : AbstractDataSource(new Private(this, parent, parentResource)) +void PrimarySelectionSourceV1InterfacePrivate::zwp_primary_selection_source_v1_destroy(QtWaylandServer::zwp_primary_selection_source_v1::Resource *resource) { + wl_resource_destroy(resource->handle); } -PrimarySelectionSourceV1Interface::Private *PrimarySelectionSourceV1Interface::d_func() const +PrimarySelectionSourceV1Interface::PrimarySelectionSourceV1Interface(PrimarySelectionDeviceManagerV1Interface *parent, ::wl_resource *resource) + : d(new PrimarySelectionSourceV1InterfacePrivate(this, resource)) { - return reinterpret_cast(d.data()); } PrimarySelectionSourceV1Interface::~PrimarySelectionSourceV1Interface() = default; void PrimarySelectionSourceV1Interface::requestData(const QString &mimeType, qint32 fd) { - Q_D(); - if (d->resource) - zwp_primary_selection_source_v1_send_send(d->resource,mimeType.toUtf8().constData(),fd); + d->send_send(mimeType, fd); close(fd); - } void PrimarySelectionSourceV1Interface::cancel() { - Q_D(); - if (d->resource) - { - zwp_primary_selection_source_v1_send_cancelled(d->resource); - client()->flush(); - } - + d->send_cancelled(); } QStringList PrimarySelectionSourceV1Interface::mimeTypes() const { - Q_D(); return d->mimeTypes; } -PrimarySelectionSourceV1Interface *PrimarySelectionSourceV1Interface::get(wl_resource *native) +wl_client *PrimarySelectionSourceV1Interface::client() const { - return Private::get(native); + return d->resource()->client(); } +PrimarySelectionSourceV1Interface *PrimarySelectionSourceV1Interface::get(wl_resource *native) +{ + if (auto sourcePrivate = resource_cast(native)) { + return sourcePrivate->q; + } + return nullptr; } + } diff -Nru dwayland-5.57.0.23/src/server/primaryselectionsource_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionsource_v1_interface.h --- dwayland-5.57.0.23/src/server/primaryselectionsource_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/primaryselectionsource_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -3,30 +3,27 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#ifndef WAYLAND_SERVER_PRIMARY_SELECTION_SOURCE_INTERFACE_H -#define WAYLAND_SERVER_PRIMARY_SELECTION_SOURCE_INTERFACE_H +#pragma once - -#include #include "abstract_data_source.h" + +#include + #include "primaryselectiondevicemanager_v1_interface.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class PrimarySelectionSourceV1InterfacePrivate; /** * @brief Represents the Resource for the zwp_primary_selection_source_v1 interface. * Lifespan is mapped to the underlying object - **/ + */ class KWAYLANDSERVER_EXPORT PrimarySelectionSourceV1Interface : public AbstractDataSource { Q_OBJECT public: - virtual ~PrimarySelectionSourceV1Interface() ; + ~PrimarySelectionSourceV1Interface() override; void requestData(const QString &mimeType, qint32 fd) override; void cancel() override; @@ -34,17 +31,15 @@ QStringList mimeTypes() const override; static PrimarySelectionSourceV1Interface *get(wl_resource *native); + wl_client *client() const override; + private: - class Private; - friend class PrimarySelectionDeviceManagerV1Interface; + friend class PrimarySelectionDeviceManagerV1InterfacePrivate; explicit PrimarySelectionSourceV1Interface(PrimarySelectionDeviceManagerV1Interface *parent, ::wl_resource *resource); - Private *d_func() const; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::PrimarySelectionSourceV1Interface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionSourceV1Interface *) diff -Nru dwayland-5.57.0.23/src/server/qtsurfaceextension_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/qtsurfaceextension_interface.cpp --- dwayland-5.57.0.23/src/server/qtsurfaceextension_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/qtsurfaceextension_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "qtsurfaceextension_interface.h" -#include "global_p.h" -#include "resource_p.h" -#include "display.h" -#include "surface_interface.h" - -#include -#include - -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class QtSurfaceExtensionInterface::Private : public Global::Private -{ -public: - Private(QtSurfaceExtensionInterface *q, Display *d); - - QList surfaces; - -private: - static void createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - - QtSurfaceExtensionInterface *q; - static const struct qt_surface_extension_interface s_interface; - static const quint32 s_version; -}; - -const quint32 QtSurfaceExtensionInterface::Private::s_version = 1; - -QtSurfaceExtensionInterface::Private::Private(QtSurfaceExtensionInterface *q, Display *d) - : Global::Private(d, &qt_surface_extension_interface, s_version) - , q(q) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct qt_surface_extension_interface QtSurfaceExtensionInterface::Private::s_interface = { - createSurfaceCallback -}; -#endif - - -class QtExtendedSurfaceInterface::Private : public Resource::Private -{ -public: - Private(QtExtendedSurfaceInterface *q, QtSurfaceExtensionInterface *shell, SurfaceInterface *surface, wl_resource *parentResource); - - SurfaceInterface *surface; - -private: - // interface callbacks - static void updateGenericPropertyCallback(wl_client *client, wl_resource *resource, const char *name, wl_array *value); - static void setContentOrientationMaskCallback(wl_client *client, wl_resource *resource, int32_t orientation); - static void setWindowFlagsCallback(wl_client *client, wl_resource *resource, int32_t flags); - static void raiseCallback(wl_client *client, wl_resource *resource); - static void lowerCallback(wl_client *client, wl_resource *resource); - - QtExtendedSurfaceInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct qt_extended_surface_interface s_interface; -}; - -QtSurfaceExtensionInterface::QtSurfaceExtensionInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -QtSurfaceExtensionInterface::~QtSurfaceExtensionInterface() = default; - -void QtSurfaceExtensionInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *shell = c->createResource(&qt_surface_extension_interface, qMin(version, s_version), id); - if (!shell) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(shell, &s_interface, this, nullptr); -} - -void QtSurfaceExtensionInterface::Private::createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) -{ - auto s = reinterpret_cast(wl_resource_get_user_data(resource)); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void QtSurfaceExtensionInterface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](QtExtendedSurfaceInterface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), WL_DISPLAY_ERROR_INVALID_OBJECT, "Qt Surface Extension already created"); - return; - } - QtExtendedSurfaceInterface *shellSurface = new QtExtendedSurfaceInterface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &QtExtendedSurfaceInterface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - shellSurface->d->create(display->getConnection(client), version, id); - emit q->surfaceCreated(shellSurface); -} - -/********************************* - * ShellSurfaceInterface - *********************************/ -QtExtendedSurfaceInterface::Private::Private(QtExtendedSurfaceInterface *q, QtSurfaceExtensionInterface *shell, SurfaceInterface *surface, wl_resource *parentResource) - : Resource::Private(q, shell, parentResource, &qt_extended_surface_interface, &s_interface) - , surface(surface) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct qt_extended_surface_interface QtExtendedSurfaceInterface::Private::s_interface = { - updateGenericPropertyCallback, - setContentOrientationMaskCallback, - setWindowFlagsCallback, - raiseCallback, - lowerCallback -}; -#endif - -void QtExtendedSurfaceInterface::Private::lowerCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - emit cast(resource)->q_func()->lowerRequested(); -} - -void QtExtendedSurfaceInterface::Private::raiseCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - emit cast(resource)->q_func()->raiseRequested(); -} - -void QtExtendedSurfaceInterface::Private::setContentOrientationMaskCallback(wl_client *client, wl_resource *resource, int32_t orientation) -{ - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(orientation) -} - -void QtExtendedSurfaceInterface::Private::setWindowFlagsCallback(wl_client *client, wl_resource *resource, int32_t flags) -{ - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(flags) -} - -void QtExtendedSurfaceInterface::Private::updateGenericPropertyCallback(wl_client *client, wl_resource *resource, const char *name, wl_array *value) -{ - Q_UNUSED(client) - QByteArray data = QByteArray::fromRawData(static_cast(value->data), value->size); - - QVariant variantValue; - QDataStream ds(data); - ds >> variantValue; - cast(resource)->q_func()->setProperty(name, variantValue); -} - -QtExtendedSurfaceInterface::QtExtendedSurfaceInterface(QtSurfaceExtensionInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, shell, parent, parentResource)) -{ - auto unsetSurface = [this] { - Q_D(); - d->surface = nullptr; - }; - connect(parent, &Resource::unbound, this, unsetSurface); - connect(parent, &QObject::destroyed, this, unsetSurface); -} - -QtExtendedSurfaceInterface::~QtExtendedSurfaceInterface() = default; - -SurfaceInterface *QtExtendedSurfaceInterface::surface() const -{ - Q_D(); - return d->surface; -} - -QtSurfaceExtensionInterface *QtExtendedSurfaceInterface::shell() const -{ - Q_D(); - return reinterpret_cast(d->global); -} - -QtExtendedSurfaceInterface::Private *QtExtendedSurfaceInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -void QtExtendedSurfaceInterface::close() -{ - Q_D(); - if (!d->resource) { - return; - } - qt_extended_surface_send_close(d->resource); - d->client->flush(); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/qtsurfaceextension_interface.h dwayland-5.57.0.24+really5.24.3/src/server/qtsurfaceextension_interface.h --- dwayland-5.57.0.23/src/server/qtsurfaceextension_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/qtsurfaceextension_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_QTSURFACEEXTENSION_INTERFACE_H -#define WAYLAND_SERVER_QTSURFACEEXTENSION_INTERFACE_H - -#include - -#include - -#include "global.h" -#include "resource.h" - -class QSize; -struct wl_resource; - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SurfaceInterface; -class QtExtendedSurfaceInterface; - -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT QtSurfaceExtensionInterface : public Global -{ - Q_OBJECT -public: - virtual ~QtSurfaceExtensionInterface(); - -Q_SIGNALS: - void surfaceCreated(KWayland::Server::QtExtendedSurfaceInterface*); - -private: - friend class Display; - explicit QtSurfaceExtensionInterface(Display *display, QObject *parent); - class Private; -}; - -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT QtExtendedSurfaceInterface : public Resource -{ - Q_OBJECT -public: - virtual ~QtExtendedSurfaceInterface(); - - SurfaceInterface *surface() const; - QtSurfaceExtensionInterface *shell() const; - - void close(); - -Q_SIGNALS: - /** - * Requests that the window be raised to appear above other windows. - * @since 5.5 - **/ - void raiseRequested(); - /** - * Requests that the window be lowered to appear below other windows. - * @since 5.5 - **/ - void lowerRequested(); - -private: - friend class QtSurfaceExtensionInterface; - explicit QtExtendedSurfaceInterface(QtSurfaceExtensionInterface *shell, SurfaceInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/region_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/region_interface.cpp --- dwayland-5.57.0.23/src/server/region_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/region_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,119 +1,47 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "region_interface_p.h" +#include "utils.h" -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "region_interface.h" -#include "resource_p.h" -#include "compositor_interface.h" -// Wayland -#include - -namespace KWayland -{ -namespace Server -{ - -class RegionInterface::Private : public Resource::Private -{ -public: - Private(CompositorInterface *compositor, RegionInterface *q, wl_resource *parentResource); - ~Private(); - QRegion qtRegion; - -private: - RegionInterface *q_func() { - return reinterpret_cast(q); - } - void add(const QRect &rect); - void subtract(const QRect &rect); - - static void addCallback(wl_client *client, wl_resource *r, int32_t x, int32_t y, int32_t width, int32_t height); - static void subtractCallback(wl_client *client, wl_resource *r, int32_t x, int32_t y, int32_t width, int32_t height); - - static const struct wl_region_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_region_interface RegionInterface::Private::s_interface = { - resourceDestroyedCallback, - addCallback, - subtractCallback -}; -#endif - -RegionInterface::Private::Private(CompositorInterface *compositor, RegionInterface *q, wl_resource *parentResource) - : Resource::Private(q, compositor, parentResource, &wl_region_interface, &s_interface) +namespace KWaylandServer { -} - -RegionInterface::Private::~Private() = default; - -void RegionInterface::Private::add(const QRect &rect) +RegionInterface::RegionInterface(wl_resource *resource) + : QtWaylandServer::wl_region(resource) { - qtRegion = qtRegion.united(rect); - Q_Q(RegionInterface); - emit q->regionChanged(qtRegion); } -void RegionInterface::Private::subtract(const QRect &rect) +void RegionInterface::region_destroy_resource(Resource *) { - if (qtRegion.isEmpty()) { - return; - } - qtRegion = qtRegion.subtracted(rect); - Q_Q(RegionInterface); - emit q->regionChanged(qtRegion); + delete this; } -void RegionInterface::Private::addCallback(wl_client *client, wl_resource *r, int32_t x, int32_t y, int32_t width, int32_t height) +void RegionInterface::region_destroy(Resource *resource) { - Q_UNUSED(client) - cast(r)->add(QRect(x, y, width, height)); + wl_resource_destroy(resource->handle); } -void RegionInterface::Private::subtractCallback(wl_client *client, wl_resource *r, int32_t x, int32_t y, int32_t width, int32_t height) +void RegionInterface::region_add(Resource *, int32_t x, int32_t y, int32_t width, int32_t height) { - Q_UNUSED(client) - cast(r)->subtract(QRect(x, y, width, height)); + m_region += QRegion(x, y, width, height); } -RegionInterface::RegionInterface(CompositorInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, this, parentResource)) +void RegionInterface::region_subtract(Resource *, int32_t x, int32_t y, int32_t width, int32_t height) { + m_region -= QRegion(x, y, width, height); } -RegionInterface::~RegionInterface() = default; - QRegion RegionInterface::region() const { - Q_D(); - return d->qtRegion; + return m_region; } RegionInterface *RegionInterface::get(wl_resource *native) { - return Private::get(native); + return resource_cast(native); } -RegionInterface::Private *RegionInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/region_interface.h dwayland-5.57.0.24+really5.24.3/src/server/region_interface.h --- dwayland-5.57.0.23/src/server/region_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/region_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_REGION_INTERFACE_H -#define WAYLAND_SERVER_REGION_INTERFACE_H - -#include -#include - -#include - -#include "resource.h" - -namespace KWayland -{ -namespace Server -{ -class CompositorInterface; - -/** - * @brief Resource for the wl_region. - * - * A RegionInterface gets created by the CompositorInterface and represents - * a QRegion. - * - * @see CompositorInterface - **/ -class KWAYLANDSERVER_EXPORT RegionInterface : public Resource -{ - Q_OBJECT -public: - virtual ~RegionInterface(); - - /** - * @returns the data of the region as a QRegion. - **/ - QRegion region() const; - - /** - * @returns The RegionInterface for the @p native resource. - **/ - static RegionInterface *get(wl_resource *native); - -Q_SIGNALS: - /** - * Emitted whenever the region changes. - **/ - void regionChanged(const QRegion&); - -private: - friend class CompositorInterface; - explicit RegionInterface(CompositorInterface *parent, wl_resource *parentResource); - - class Private; - Private *d_func() const; -}; - -} -} -Q_DECLARE_METATYPE(KWayland::Server::RegionInterface*) - -#endif diff -Nru dwayland-5.57.0.23/src/server/region_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/region_interface_p.h --- dwayland-5.57.0.23/src/server/region_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/region_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include "qwayland-server-wayland.h" + +namespace KWaylandServer +{ +class RegionInterface : public QtWaylandServer::wl_region +{ +public: + static RegionInterface *get(wl_resource *native); + explicit RegionInterface(wl_resource *resource); + + QRegion region() const; + +protected: + void region_destroy_resource(Resource *resource) override; + void region_destroy(Resource *resource) override; + void region_add(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void region_subtract(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + +private: + QRegion m_region; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/relativepointer_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface.cpp --- dwayland-5.57.0.23/src/server/relativepointer_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "relativepointer_interface_p.h" - -namespace KWayland -{ -namespace Server -{ - -RelativePointerManagerInterface::Private::Private(RelativePointerInterfaceVersion interfaceVersion, RelativePointerManagerInterface *q, Display *d, const wl_interface *interface, quint32 version) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) -{ -} - -RelativePointerManagerInterface::RelativePointerManagerInterface(Private *d, QObject *parent) - : Global(d, parent) -{ -} - -RelativePointerManagerInterface::~RelativePointerManagerInterface() = default; - -RelativePointerInterfaceVersion RelativePointerManagerInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -RelativePointerManagerInterface::Private *RelativePointerManagerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -RelativePointerInterface::Private::Private(RelativePointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) -{ -} - -RelativePointerInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -RelativePointerInterface::RelativePointerInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ -} - -RelativePointerInterface::~RelativePointerInterface() = default; - -void RelativePointerInterface::relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) -{ - Q_D(); - d->relativeMotion(delta, deltaNonAccelerated, microseconds); -} - -RelativePointerInterface::Private *RelativePointerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/relativepointer_interface.h dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface.h --- dwayland-5.57.0.23/src/server/relativepointer_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_RELATIVE_POINTER_INTERFACE_H -#define KWAYLAND_SERVER_RELATIVE_POINTER_INTERFACE_H - -#include "global.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; - -enum class RelativePointerInterfaceVersion { - /** - * zwp_relative_pointer_manager_v1 and zwp_relative_pointer_v1 - **/ - UnstableV1 -}; - -/** - * Manager object to create relative pointer interfaces. - * - * Once created the interaction happens through the SeatInterface class - * which automatically delegates relative motion events to the created relative pointer - * interfaces. - * - * @see SeatInterface::relativePointerMotion - * @since 5.28 - **/ -class KWAYLANDSERVER_EXPORT RelativePointerManagerInterface : public Global -{ - Q_OBJECT -public: - virtual ~RelativePointerManagerInterface(); - - /** - * @returns The interface version used by this RelativePointerManagerInterface - **/ - RelativePointerInterfaceVersion interfaceVersion() const; - -protected: - class Private; - explicit RelativePointerManagerInterface(Private *d, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/relativepointer_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface_p.h --- dwayland-5.57.0.23/src/server/relativepointer_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_RELATIVEPOINTER_INTERFACE_P_H -#define KWAYLAND_SERVER_RELATIVEPOINTER_INTERFACE_P_H -#include "relativepointer_interface.h" -#include "resource_p.h" -#include "global_p.h" - - -namespace KWayland -{ -namespace Server -{ - -class RelativePointerManagerInterface::Private : public Global::Private -{ -public: - RelativePointerInterfaceVersion interfaceVersion; - -protected: - Private(RelativePointerInterfaceVersion interfaceVersion, RelativePointerManagerInterface *q, Display *d, const wl_interface *interface, quint32 version); - RelativePointerManagerInterface *q; -}; - -class RelativePointerManagerUnstableV1Interface : public RelativePointerManagerInterface -{ - Q_OBJECT -public: - explicit RelativePointerManagerUnstableV1Interface(Display *display, QObject *parent = nullptr); - virtual ~RelativePointerManagerUnstableV1Interface(); - -private: - class Private; -}; - -class RelativePointerInterface : public Resource -{ - Q_OBJECT -public: - virtual ~RelativePointerInterface(); - void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds); - -protected: - class Private; - explicit RelativePointerInterface(Private *p, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -class RelativePointerInterface::Private : public Resource::Private -{ -public: - ~Private(); - virtual void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) = 0; - -protected: - Private(RelativePointerInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation); - -private: - RelativePointerInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class RelativePointerUnstableV1Interface : public RelativePointerInterface -{ - Q_OBJECT -public: - virtual ~RelativePointerUnstableV1Interface(); - -private: - explicit RelativePointerUnstableV1Interface(RelativePointerManagerUnstableV1Interface *parent, wl_resource *parentResource); - friend class RelativePointerManagerUnstableV1Interface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/relativepointer_interface_v1.cpp dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface_v1.cpp --- dwayland-5.57.0.23/src/server/relativepointer_interface_v1.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_interface_v1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "relativepointer_interface_p.h" -#include "display.h" -#include "pointer_interface_p.h" -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class RelativePointerManagerUnstableV1Interface::Private : public RelativePointerManagerInterface::Private -{ -public: - Private(RelativePointerManagerUnstableV1Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getRelativePointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * pointer); - - RelativePointerManagerUnstableV1Interface *q; - - static const struct zwp_relative_pointer_manager_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 RelativePointerManagerUnstableV1Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_relative_pointer_manager_v1_interface RelativePointerManagerUnstableV1Interface::Private::s_interface = { - destroyCallback, - getRelativePointerCallback -}; -#endif - -void RelativePointerManagerUnstableV1Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void RelativePointerManagerUnstableV1Interface::Private::getRelativePointerCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *pointer) -{ - PointerInterface *p = PointerInterface::get(pointer); - if (!p) { - // TODO: raise error? - return; - } - auto m = cast(resource); - auto *r = new RelativePointerUnstableV1Interface(m->q, resource); - r->d->create(m->display->getConnection(client), version, id); - p->d_func()->registerRelativePointer(r); -} - -RelativePointerManagerUnstableV1Interface::Private::Private(RelativePointerManagerUnstableV1Interface *q, Display *d) - : RelativePointerManagerInterface::Private(RelativePointerInterfaceVersion::UnstableV1, q, d, &zwp_relative_pointer_manager_v1_interface, s_version) - , q(q) -{ -} - -void RelativePointerManagerUnstableV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_relative_pointer_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void RelativePointerManagerUnstableV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -RelativePointerManagerUnstableV1Interface::RelativePointerManagerUnstableV1Interface(Display *display, QObject *parent) - : RelativePointerManagerInterface(new Private(this, display), parent) -{ -} - -RelativePointerManagerUnstableV1Interface::~RelativePointerManagerUnstableV1Interface() = default; - -class RelativePointerUnstableV1Interface::Private : public RelativePointerInterface::Private -{ -public: - Private(RelativePointerUnstableV1Interface *q, RelativePointerManagerUnstableV1Interface *c, wl_resource *parentResource); - ~Private(); - void relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) override; - -private: - RelativePointerUnstableV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zwp_relative_pointer_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_relative_pointer_v1_interface RelativePointerUnstableV1Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -RelativePointerUnstableV1Interface::Private::Private(RelativePointerUnstableV1Interface *q, RelativePointerManagerUnstableV1Interface *c, wl_resource *parentResource) - : RelativePointerInterface::Private(q, c, parentResource, &zwp_relative_pointer_v1_interface, &s_interface) -{ -} - -RelativePointerUnstableV1Interface::Private::~Private() = default; - -void RelativePointerUnstableV1Interface::Private::relativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) -{ - if (!resource) { - return; - } - zwp_relative_pointer_v1_send_relative_motion(resource, (microseconds >> 32), microseconds, - wl_fixed_from_double(delta.width()), - wl_fixed_from_double(delta.height()), - wl_fixed_from_double(deltaNonAccelerated.width()), - wl_fixed_from_double(deltaNonAccelerated.height())); -} - -RelativePointerUnstableV1Interface::RelativePointerUnstableV1Interface(RelativePointerManagerUnstableV1Interface *parent, wl_resource *parentResource) - : RelativePointerInterface(new Private(this, parent, parentResource)) -{ -} - -RelativePointerUnstableV1Interface::~RelativePointerUnstableV1Interface() = default; - -} -} diff -Nru dwayland-5.57.0.23/src/server/relativepointer_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface.cpp --- dwayland-5.57.0.23/src/server/relativepointer_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,94 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "relativepointer_v1_interface.h" +#include "clientconnection.h" +#include "display.h" +#include "pointer_interface_p.h" +#include "relativepointer_v1_interface_p.h" +#include "seat_interface.h" +#include "surface_interface.h" + +namespace KWaylandServer +{ +static const int s_version = 1; + +RelativePointerManagerV1InterfacePrivate::RelativePointerManagerV1InterfacePrivate(Display *display) + : QtWaylandServer::zwp_relative_pointer_manager_v1(*display, s_version) +{ +} + +void RelativePointerManagerV1InterfacePrivate::zwp_relative_pointer_manager_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void RelativePointerManagerV1InterfacePrivate::zwp_relative_pointer_manager_v1_get_relative_pointer(Resource *resource, + uint32_t id, + struct ::wl_resource *pointer_resource) +{ + PointerInterface *pointer = PointerInterface::get(pointer_resource); + if (!pointer) { + wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid pointer"); + return; + } + + RelativePointerV1Interface *relativePointer = RelativePointerV1Interface::get(pointer); + relativePointer->add(resource->client(), id, resource->version()); +} + +RelativePointerManagerV1Interface::RelativePointerManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new RelativePointerManagerV1InterfacePrivate(display)) +{ +} + +RelativePointerManagerV1Interface::~RelativePointerManagerV1Interface() +{ +} + +RelativePointerV1Interface::RelativePointerV1Interface(PointerInterface *pointer) + : pointer(pointer) +{ +} + +RelativePointerV1Interface *RelativePointerV1Interface::get(PointerInterface *pointer) +{ + if (pointer) { + PointerInterfacePrivate *pointerPrivate = PointerInterfacePrivate::get(pointer); + return pointerPrivate->relativePointersV1.data(); + } + return nullptr; +} + +void RelativePointerV1Interface::zwp_relative_pointer_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void RelativePointerV1Interface::sendRelativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) +{ + if (!pointer->focusedSurface()) { + return; + } + + ClientConnection *focusedClient = pointer->focusedSurface()->client(); + const QList pointerResources = resourceMap().values(focusedClient->client()); + for (Resource *pointerResource : pointerResources) { + if (pointerResource->client() == focusedClient->client()) { + send_relative_motion(pointerResource->handle, + microseconds >> 32, + microseconds & 0xffffffff, + wl_fixed_from_double(delta.width()), + wl_fixed_from_double(delta.height()), + wl_fixed_from_double(deltaNonAccelerated.width()), + wl_fixed_from_double(deltaNonAccelerated.height())); + } + } +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/relativepointer_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface.h --- dwayland-5.57.0.23/src/server/relativepointer_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,38 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class RelativePointerManagerV1InterfacePrivate; + +/** + * Manager object to create relative pointer interfaces. + * + * Once created the interaction happens through the SeatInterface class + * which automatically delegates relative motion events to the created relative pointer + * interfaces. + */ +class KWAYLANDSERVER_EXPORT RelativePointerManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit RelativePointerManagerV1Interface(Display *display, QObject *parent = nullptr); + ~RelativePointerManagerV1Interface() override; + +private: + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/relativepointer_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface_p.h --- dwayland-5.57.0.23/src/server/relativepointer_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/relativepointer_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,43 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "qwayland-server-relative-pointer-unstable-v1.h" + +namespace KWaylandServer +{ +class ClientConnection; +class Display; +class PointerInterface; + +class RelativePointerManagerV1InterfacePrivate : public QtWaylandServer::zwp_relative_pointer_manager_v1 +{ +public: + explicit RelativePointerManagerV1InterfacePrivate(Display *display); + +protected: + void zwp_relative_pointer_manager_v1_destroy(Resource *resource) override; + void zwp_relative_pointer_manager_v1_get_relative_pointer(Resource *resource, uint32_t id, struct ::wl_resource *pointer_resource) override; +}; + +class RelativePointerV1Interface : public QtWaylandServer::zwp_relative_pointer_v1 +{ +public: + explicit RelativePointerV1Interface(PointerInterface *pointer); + + static RelativePointerV1Interface *get(PointerInterface *pointer); + void sendRelativeMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds); + +protected: + void zwp_relative_pointer_v1_destroy(Resource *resource) override; + +private: + PointerInterface *pointer; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/remote_access_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface.cpp --- dwayland-5.57.0.23/src/server/remote_access_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,46 +1,32 @@ -/**************************************************************************** -Copyright 2016 Oleg Chernovskiy +/* + SPDX-FileCopyrightText: 2016 Oleg Chernovskiy -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "remote_access_interface.h" #include "remote_access_interface_p.h" -#include "output_interface.h" -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "logging.h" -#include +#include +#include +#include +#include +#include + +#include "logging.h" #include #include #include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { + static const QString SCREEN_RECORDING_START = QStringLiteral("screenRecordingStart"); static const QString SCREEN_RECORDING_FINISHED = QStringLiteral("screenRecordingStop"); static QObject gsScreenRecord; -class BufferHandle::Private // @see gbm_import_fd_data +class BufferHandlePrivate // @see gbm_import_fd_data { public: // Note that on client side received fd number will be different @@ -54,7 +40,7 @@ }; BufferHandle::BufferHandle() - : d(new Private) + : d(new BufferHandlePrivate) { } @@ -93,7 +79,6 @@ d->stride = stride; } - quint32 BufferHandle::stride() const { return d->stride; @@ -118,12 +103,12 @@ const BufferHandle *buf; quint64 counter; }; - -class RemoteAccessManagerInterface::Private : public Global::Private + +class RemoteAccessManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_remote_access_manager { public: - Private(RemoteAccessManagerInterface *q, Display *d); - ~Private() override; + RemoteAccessManagerInterfacePrivate(RemoteAccessManagerInterface *q, Display *display); + ~RemoteAccessManagerInterfacePrivate() override; /** * @brief Send buffer ready notification to all connected clients @@ -139,24 +124,14 @@ void incrementRenderSequence(); - /** - * Clients of this interface. - * This may be screenshot app, video capture app, - * remote control app etc. - */ - QList clientResources; + Display *display; + int renderSequence = 0; + private: - // methods - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - static void getBufferCallback(wl_client *client, wl_resource *resource, uint32_t buffer, int32_t internalBufId); - static void recordCallback(wl_client *client, wl_resource *resource, int32_t count); - static void releaseCallback(wl_client *client, wl_resource *resource); - static void getRenderSequenceCallback(wl_client *client, wl_resource *resource); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void startRecord(wl_client *client, wl_resource *resource, int32_t frame); + virtual void org_kde_kwin_remote_access_manager_get_buffer(Resource *resource, uint32_t buffer, int32_t internal_buffer_id) override; + virtual void org_kde_kwin_remote_access_manager_release(Resource *resource) override; + virtual void org_kde_kwin_remote_access_manager_record(Resource *resource, int32_t frame) override; + virtual void org_kde_kwin_remote_access_manager_get_rendersequence(Resource *resource) override; /** * @brief Unreferences counter and frees buffer when it reaches zero @@ -165,8 +140,6 @@ */ bool unref(BufferHolder &buf); - // fields - static const struct org_kde_kwin_remote_access_manager_interface s_interface; static const quint32 s_version; RemoteAccessManagerInterface *q; @@ -176,41 +149,25 @@ * Keys are fd numbers as they are unique **/ QHash sentBuffers; - QHash requestFrames; - - int renderSequence = 0; + QHash requestFrames; }; -const quint32 RemoteAccessManagerInterface::Private::s_version = 2; - -RemoteAccessManagerInterface::Private::Private(RemoteAccessManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_remote_access_manager_interface, s_version) - , q(q) -{ -} +const quint32 RemoteAccessManagerInterfacePrivate::s_version = 2; -void RemoteAccessManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +RemoteAccessManagerInterfacePrivate::RemoteAccessManagerInterfacePrivate(RemoteAccessManagerInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_remote_access_manager(*display, s_version) + , display(display) + , q(_q) { - // create new client resource - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_remote_access_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - - // add newly created client resource to the list - clientResources << resource; } -void RemoteAccessManagerInterface::Private::sendBufferReady(const OutputInterface *output, const BufferHandle *buf) +void RemoteAccessManagerInterfacePrivate::sendBufferReady(const OutputInterface *output, const BufferHandle *buf) { - BufferHolder holder {buf, 0}; + BufferHolder holder{buf, 0}; // notify clients qCDebug(KWAYLAND_SERVER) << "Server buffer sent: fd" << buf->fd(); - for (auto res : clientResources) { - auto client = wl_resource_get_client(res); + for (auto res : resourceMap()) { + auto client = wl_resource_get_client(res->handle); auto boundScreens = output->clientResources(display->getConnection(client)); // clients don't necessarily bind outputs @@ -219,222 +176,193 @@ } int frame = -1; - if (requestFrames.contains(res)) { - frame = requestFrames[res]; + if (requestFrames.contains(res->handle)) { + frame = requestFrames[res->handle]; } + if (frame) { // no reason for client to bind wl_output multiple times, send only to first one - org_kde_kwin_remote_access_manager_send_buffer_ready(res, buf->fd(), boundScreens[0]); + send_buffer_ready(res->handle, buf->fd(), boundScreens[0]); holder.counter++; } if (frame > 0) { - requestFrames[res] = frame - 1; + requestFrames[res->handle] = frame - 1; } } if (holder.counter == 0) { // buffer was not requested by any client - emit q->bufferReleased(buf); + Q_EMIT q->bufferReleased(buf); return; } // store buffer locally, clients will ask it later sentBuffers[buf->fd()] = holder; } -void RemoteAccessManagerInterface::Private::incrementRenderSequence() +void RemoteAccessManagerInterfacePrivate::incrementRenderSequence() { renderSequence++; } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_remote_access_manager_interface RemoteAccessManagerInterface::Private::s_interface = { - getBufferCallback, - releaseCallback, - recordCallback, - getRenderSequenceCallback -}; -#endif - -void RemoteAccessManagerInterface::Private::getBufferCallback(wl_client *client, wl_resource *resource, uint32_t buffer, int32_t internalBufId) +bool RemoteAccessManagerInterfacePrivate::unref(BufferHolder &bh) { - Private *p = cast(resource); + bh.counter--; + if (!bh.counter) { + // no more clients using this buffer + qCDebug(KWAYLAND_SERVER) << "[ut-gfx ]Buffer released, fd" << bh.buf->fd(); + sentBuffers.remove(bh.buf->fd()); + Q_EMIT q->bufferReleased(bh.buf); + return true; + } + return false; +} +void RemoteAccessManagerInterfacePrivate::org_kde_kwin_remote_access_manager_get_buffer(Resource *resource, uint32_t buffer, int32_t internal_buffer_id) +{ // client asks for buffer we earlier announced, we must have it - if (Q_UNLIKELY(!p->sentBuffers.contains(internalBufId))) { // no such buffer (?) - wl_resource_post_no_memory(resource); + if (Q_UNLIKELY(!this->sentBuffers.contains(internal_buffer_id))) { // no such buffer (?) + wl_resource_post_no_memory(resource->handle); return; } - BufferHolder &bh = p->sentBuffers[internalBufId]; - auto rbuf = new RemoteBufferInterface(p->q, resource, bh.buf); - rbuf->create(p->display->getConnection(client), wl_resource_get_version(resource), buffer); - if (!rbuf->resource()) { - wl_resource_post_no_memory(resource); - delete rbuf; + BufferHolder &bh = sentBuffers[internal_buffer_id]; + wl_resource *RbiResource = wl_resource_create(resource->client(), &org_kde_kwin_remote_buffer_interface, resource->version(), buffer); + + if (!RbiResource) { + qCDebug(KWAYLAND_SERVER) << resource->client() << buffer << internal_buffer_id; + wl_client_post_no_memory(resource->client()); return; } - QObject::connect(rbuf, &Resource::aboutToBeUnbound, p->q, [p, rbuf, resource, &bh] { - if (!p->clientResources.contains(resource)) { + auto rbuf = new RemoteBufferInterface(bh.buf, RbiResource); + + QObject::connect(rbuf, &QObject::destroyed, [resource, &bh, this] { + if (!resourceMap().contains(resource->client())) { // remote buffer destroy confirmed after client is already gone // all relevant buffers are already unreferenced return; } - qCDebug(KWAYLAND_SERVER) << "Remote buffer returned, client" << wl_resource_get_id(resource) - << ", id" << rbuf->id() - << ", fd" << bh.buf->fd(); - p->unref(bh); + qCDebug(KWAYLAND_SERVER) << "Remote buffer returned, client" << wl_resource_get_id(resource->handle) << ", fd" << bh.buf->fd(); + unref(bh); + gsScreenRecord.setObjectName(SCREEN_RECORDING_FINISHED); }); // send buffer params - rbuf->passFd(); + rbuf->sendGbmHandle(); gsScreenRecord.setObjectName(SCREEN_RECORDING_START); } -void RemoteAccessManagerInterface::Private::releaseCallback(wl_client *client, wl_resource *resource) +void RemoteAccessManagerInterfacePrivate::org_kde_kwin_remote_access_manager_release(Resource *resource) { - Q_UNUSED(client); - unbind(resource); -} - -void RemoteAccessManagerInterface::Private::recordCallback(wl_client *client, wl_resource *resource, int32_t frame) -{ - Private *p = cast(resource); - p->startRecord(client, resource, frame); + // all holders should decrement their counter as one client is gone + QMutableHashIterator itr(sentBuffers); + while (itr.hasNext()) { + BufferHolder &bh = itr.next().value(); + if (unref(bh)) { + itr.remove(); + } + } + wl_resource_destroy(resource->handle); } -void RemoteAccessManagerInterface::Private::startRecord(wl_client *client, wl_resource *resource, int32_t frame) +void RemoteAccessManagerInterfacePrivate::org_kde_kwin_remote_access_manager_record(Resource *resource, int32_t frame) { - requestFrames[resource] = frame; + requestFrames[resource->handle] = frame; emit q->startRecord(frame); } -void RemoteAccessManagerInterface::Private::getRenderSequenceCallback(wl_client *client, wl_resource *resource) -{ - Private *p = cast(resource); - org_kde_kwin_remote_access_manager_send_rendersequence(resource, p->renderSequence); -} - -bool RemoteAccessManagerInterface::Private::unref(BufferHolder &bh) -{ - bh.counter--; - if (!bh.counter) { - // no more clients using this buffer - qCDebug(KWAYLAND_SERVER) << "Buffer released, fd" << bh.buf->fd(); - sentBuffers.remove(bh.buf->fd()); - emit q->bufferReleased(bh.buf); - return true; - } - - return false; -} - -void RemoteAccessManagerInterface::Private::unbind(wl_resource *resource) +void RemoteAccessManagerInterfacePrivate::org_kde_kwin_remote_access_manager_get_rendersequence(Resource *resource) { - // we're unbinding, all sent buffers for this client are now effectively invalid - Private *p = cast(resource); - p->release(resource); - - gsScreenRecord.setObjectName(SCREEN_RECORDING_FINISHED); + send_rendersequence(resource->handle, renderSequence); } -void RemoteAccessManagerInterface::Private::release(wl_resource *resource) +RemoteAccessManagerInterfacePrivate::~RemoteAccessManagerInterfacePrivate() { - // all holders should decrement their counter as one client is gone - QMutableHashIterator itr(sentBuffers); - while (itr.hasNext()) { - BufferHolder &bh = itr.next().value(); - unref(bh); - } - - clientResources.removeAll(resource); } -RemoteAccessManagerInterface::Private::~Private() +RemoteAccessManagerInterface::RemoteAccessManagerInterface(Display *display) + : QObject(nullptr) + , d(new RemoteAccessManagerInterfacePrivate(this, display)) { - // server deletes created interfaces, release all held buffers - auto c = clientResources; // shadow copy - for (auto res : c) { - release(res); - } + connect(&gsScreenRecord, &QObject::objectNameChanged, this, [=](const QString &name) { + Q_EMIT screenRecordStatusChanged(name == SCREEN_RECORDING_START); + }); } -RemoteAccessManagerInterface::RemoteAccessManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +RemoteAccessManagerInterface::~RemoteAccessManagerInterface() { - connect(&gsScreenRecord, &QObject::objectNameChanged, this, [=](const QString& name) { - emit screenRecordStatusChanged(name == SCREEN_RECORDING_START); - }); } void RemoteAccessManagerInterface::sendBufferReady(const OutputInterface *output, const BufferHandle *buf) { - Private *priv = reinterpret_cast(d.data()); - priv->sendBufferReady(output, buf); + d->sendBufferReady(output, buf); } void RemoteAccessManagerInterface::incrementRenderSequence() { - Private *priv = reinterpret_cast(d.data()); - priv->incrementRenderSequence(); + d->incrementRenderSequence(); } bool RemoteAccessManagerInterface::isBound() const { - Private *priv = reinterpret_cast(d.data()); - return !priv->clientResources.isEmpty(); + return !d->resourceMap().isEmpty(); } -class RemoteBufferInterface::Private : public Resource::Private +class RemoteBufferInterfacePrivate : public QtWaylandServer::org_kde_kwin_remote_buffer { public: - Private(RemoteAccessManagerInterface *ram, RemoteBufferInterface *q, wl_resource *pResource, const BufferHandle *buf); - ~Private(); + RemoteBufferInterfacePrivate(RemoteBufferInterface *q, const BufferHandle *buf, wl_resource *resource); + ~RemoteBufferInterfacePrivate() override; - void passFd(); + void sendGbmHandle(); -private: - static const struct org_kde_kwin_remote_buffer_interface s_interface; + virtual void org_kde_kwin_remote_buffer_release(Resource *resource) override; + virtual void org_kde_kwin_remote_buffer_destroy_resource(Resource *resource) override; +private: + RemoteBufferInterface *q; const BufferHandle *wrapped; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_remote_buffer_interface RemoteBufferInterface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -RemoteBufferInterface::Private::Private(RemoteAccessManagerInterface *ram, RemoteBufferInterface *q, wl_resource *pResource, const BufferHandle *buf) - : Resource::Private(q, ram, pResource, &org_kde_kwin_remote_buffer_interface, &s_interface), wrapped(buf) +RemoteBufferInterfacePrivate::RemoteBufferInterfacePrivate(RemoteBufferInterface *q, const BufferHandle *buf, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_remote_buffer(resource) + , q(q) + , wrapped(buf) { } -RemoteBufferInterface::Private::~Private() +RemoteBufferInterfacePrivate::~RemoteBufferInterfacePrivate() { } -void RemoteBufferInterface::Private::passFd() +void RemoteBufferInterfacePrivate::sendGbmHandle() { - org_kde_kwin_remote_buffer_send_gbm_handle(resource, wrapped->fd(), - wrapped->width(), wrapped->height(), wrapped->stride(), wrapped->format()); + send_gbm_handle(resource()->handle, wrapped->fd(), wrapped->width(), wrapped->height(), wrapped->stride(), wrapped->format()); } -RemoteBufferInterface::RemoteBufferInterface(RemoteAccessManagerInterface *ram, wl_resource *pResource, const BufferHandle *buf) - : Resource(new Private(ram, this, pResource, buf), ram) +void RemoteBufferInterfacePrivate::org_kde_kwin_remote_buffer_release(Resource *resource) { + wl_resource_destroy(resource->handle); } -RemoteBufferInterface::Private *RemoteBufferInterface::d_func() const +void RemoteBufferInterfacePrivate::org_kde_kwin_remote_buffer_destroy_resource(Resource *resource) { - return reinterpret_cast(d.data()); + delete q; } - -void RemoteBufferInterface::passFd() +RemoteBufferInterface::RemoteBufferInterface(const BufferHandle *buf, wl_resource *resource) + : QObject() + , d(new RemoteBufferInterfacePrivate(this, buf, resource)) { - d_func()->passFd(); } +RemoteBufferInterface::~RemoteBufferInterface() +{ } + +void RemoteBufferInterface::sendGbmHandle() +{ + d->sendGbmHandle(); } + +} \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/remote_access_interface.h dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface.h --- dwayland-5.57.0.23/src/server/remote_access_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,48 +1,39 @@ -/**************************************************************************** -Copyright 2016 Oleg Chernovskiy +/* + SPDX-FileCopyrightText: 2016 Oleg Chernovskiy -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_SERVER_REMOTE_ACCESS_INTERFACE_H #define KWAYLAND_SERVER_REMOTE_ACCESS_INTERFACE_H -#include "global.h" +#include -namespace KWayland -{ -namespace Server +#include + +struct wl_resource; + +namespace KWaylandServer { +class RemoteAccessManagerInterfacePrivate; class Display; class OutputInterface; +class BufferHandlePrivate; /** * The structure server should fill to use this interface. * Lifecycle: * 1. BufferHandle is filled and passed to RemoteAccessManager * (stored in manager's sent list) - * 2. Clients confirm that they wants this buffer, the RemoteBuffer + * 2. Clients confirm that they wants this buffer, the RemoteBuffer * interfaces are then created and wrapped around BufferHandle. * 3. Once all clients are done with buffer (or disconnected), * RemoteBuffer notifies manager and release signal is emitted. - * + * * It's the responsibility of your process to delete this BufferHandle * and release its' fd afterwards. **/ + class KWAYLANDSERVER_EXPORT BufferHandle { public: @@ -52,37 +43,38 @@ void setSize(quint32 width, quint32 height); void setStride(quint32 stride); void setFormat(quint32 format); - + qint32 fd() const; quint32 height() const; quint32 width() const; quint32 stride() const; quint32 format() const; -private: +private: friend class RemoteAccessManagerInterface; friend class RemoteBufferInterface; - class Private; - QScopedPointer d; + QScopedPointer d; }; -class KWAYLANDSERVER_EXPORT RemoteAccessManagerInterface : public Global +class KWAYLANDSERVER_EXPORT RemoteAccessManagerInterface : public QObject { Q_OBJECT public: - virtual ~RemoteAccessManagerInterface() = default; + explicit RemoteAccessManagerInterface(Display *display); + ~RemoteAccessManagerInterface(); /** * Store buffer in sent list and notify client that we have a buffer for it **/ void sendBufferReady(const OutputInterface *output, const BufferHandle *buf); - + /** + * Increase the rendering sequence + **/ void incrementRenderSequence(); /** * Check whether interface has been bound **/ bool isBound() const; - Q_SIGNALS: /** * Previously sent buffer has been released by client @@ -92,12 +84,10 @@ void startRecord(int count); private: - explicit RemoteAccessManagerInterface(Display *display, QObject *parent = nullptr); friend class Display; - class Private; + QScopedPointer d; }; } -} -#endif +#endif \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/remote_access_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface_p.h --- dwayland-5.57.0.23/src/server/remote_access_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/remote_access_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,58 +1,45 @@ -/**************************************************************************** -Copyright 2016 Oleg Chernovskiy +/* + SPDX-FileCopyrightText: 2016 Oleg Chernovskiy -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #ifndef KWAYLAND_SERVER_REMOTE_ACCESS_INTERFACE_P_H #define KWAYLAND_SERVER_REMOTE_ACCESS_INTERFACE_P_H -#include "resource.h" +struct wl_resource; -namespace KWayland -{ -namespace Server +#include + +namespace KWaylandServer { - + +class BufferHandle; +class RemoteAccessManagerInterface; +class RemoteBufferInterfacePrivate; /** * @class RemoteBufferInterface * @brief Internally used class. Holds data of passed buffer and client resource. Also controls buffer lifecycle. * @see RemoteAccessManagerInterface */ -class RemoteBufferInterface : public Resource +class RemoteBufferInterface : public QObject { Q_OBJECT public: - virtual ~RemoteBufferInterface() = default; + ~RemoteBufferInterface(); /** * Sends GBM fd to the client. * Note that server still has to close mirror fd from its side. **/ - void passFd(); + void sendGbmHandle(); private: - explicit RemoteBufferInterface(RemoteAccessManagerInterface *ram, wl_resource *pResource, const BufferHandle *buf); - friend class RemoteAccessManagerInterface; + explicit RemoteBufferInterface(const BufferHandle *buf, wl_resource *resource); + friend class RemoteAccessManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} -#endif // KWAYLAND_SERVER_REMOTE_ACCESS_P_H +#endif // KWAYLAND_SERVER_REMOTE_ACCESS_P_H \ No newline at end of file diff -Nru dwayland-5.57.0.23/src/server/resource.cpp dwayland-5.57.0.24+really5.24.3/src/server/resource.cpp --- dwayland-5.57.0.23/src/server/resource.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/resource.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "resource.h" -#include "resource_p.h" -#include "clientconnection.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -QList Resource::Private::s_allResources; - -Resource::Private::Private(Resource *q, Global *g, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : parentResource(parentResource) - , global(g) - , q(q) - , m_interface(interface) - , m_interfaceImplementation(implementation) -{ - s_allResources << this; -} - -Resource::Private::~Private() -{ - s_allResources.removeAll(this); - if (resource) { - wl_resource_destroy(resource); - } -} - -void Resource::Private::create(ClientConnection *c, quint32 version, quint32 id) -{ - Q_ASSERT(!resource); - Q_ASSERT(!client); - client = c; - resource = client->createResource(m_interface, version, id); - if (!resource) { - return; - } - wl_resource_set_implementation(resource, m_interfaceImplementation, this, unbind); -} - -void Resource::Private::unbind(wl_resource *r) -{ - Private *p = cast(r); - emit p->q->aboutToBeUnbound(); - p->resource = nullptr; - emit p->q->unbound(); - p->q->deleteLater(); -} - - -void Resource::Private::resourceDestroyedCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -Resource::Resource(Resource::Private *d, QObject *parent) - : QObject(parent) - , d(d) -{ -} - -Resource::~Resource() = default; - -void Resource::create(ClientConnection *client, quint32 version, quint32 id) -{ - d->create(client, version, id); -} - -ClientConnection *Resource::client() -{ - return d->client; -} - -Global *Resource::global() -{ - return d->global; -} - -wl_resource *Resource::resource() -{ - return d->resource; -} - -wl_resource *Resource::parentResource() const -{ - return d->parentResource; -} - -quint32 Resource::id() const -{ - if (!d->resource) { - return 0; - } - return wl_resource_get_id(d->resource); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/resource.h dwayland-5.57.0.24+really5.24.3/src/server/resource.h --- dwayland-5.57.0.23/src/server/resource.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/resource.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_RESOURCE_H -#define WAYLAND_SERVER_RESOURCE_H - -#include - -#include - -struct wl_client; -struct wl_resource; - -namespace KWayland -{ -namespace Server -{ - -class ClientConnection; -class Global; - -/** - * @brief Represents a bound Resource. - * - * A Resource normally gets created by a @link Global @endlink. - * - * The Resource is a base class for all specific resources and provides - * access to various common aspects. - **/ -class KWAYLANDSERVER_EXPORT Resource : public QObject -{ - Q_OBJECT -public: - virtual ~Resource(); - void create(ClientConnection *client, quint32 version, quint32 id); - - /** - * @returns the native wl_resource this Resource was created for. - **/ - wl_resource *resource(); - /** - * @returns The ClientConnection for which the Resource was created. - **/ - ClientConnection *client(); - /** - * @returns The Global which created the Resource. - **/ - Global *global(); - /** - * @returns the native parent wl_resource, e.g. the wl_resource bound on the Global - **/ - wl_resource *parentResource() const; - /** - * @returns The id of this Resource if it is created, otherwise @c 0. - * - * This is a convenient wrapper for wl_resource_get_id. - * @since 5.3 - **/ - quint32 id() const; - -Q_SIGNALS: - /** - * This signal is emitted when the client unbound this Resource. - * The Resource will be deleted in the next event cycle after this event. - * @since 5.24 - **/ - void unbound(); - /** - * This signal is emitted when the client is in the process of unbinding the Resource. - * In opposite to @link{unbound} the @link{resource} is still valid and allows to perform - * cleanup tasks. Example: send a keyboard leave for the Surface which is in the process of - * getting destroyed. - * - * @see unbound - * @since 5.37 - **/ - void aboutToBeUnbound(); - -protected: - class Private; - explicit Resource(Private *d, QObject *parent = nullptr); - QScopedPointer d; - -}; - -} -} -#endif diff -Nru dwayland-5.57.0.23/src/server/resource_p.h dwayland-5.57.0.24+really5.24.3/src/server/resource_p.h --- dwayland-5.57.0.23/src/server/resource_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/resource_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_RESOURCE_P_H -#define WAYLAND_SERVER_RESOURCE_P_H - -#include "resource.h" -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class Resource::Private -{ -public: - virtual ~Private(); - void create(ClientConnection *client, quint32 version, quint32 id); - - wl_resource *parentResource = nullptr; - wl_resource *resource = nullptr; - ClientConnection *client = nullptr; - Global *global; - - template - static ResourceDerived *get(wl_resource *native) { - static_assert(std::is_base_of::value, - "ResourceDerived must be derived from Resource"); - if (!native) { - return nullptr; - } - auto it = std::find_if(s_allResources.constBegin(), s_allResources.constEnd(), - [native](Private *p) { - return p->resource == native; - } - ); - if (it == s_allResources.constEnd()) { - return nullptr; - } - return reinterpret_cast((*it)->q); - } - template - static ResourceDerived *get(quint32 id, const ClientConnection *c) { - static_assert(std::is_base_of::value, - "ResourceDerived must be derived from Resource"); - auto it = std::find_if(s_allResources.constBegin(), s_allResources.constEnd(), - [id, c](Private *p) { - return c == p->client && p->resource && wl_resource_get_id(p->resource) == id; - } - ); - if (it == s_allResources.constEnd()) { - return nullptr; - } - return reinterpret_cast((*it)->q); - } - -protected: - explicit Private(Resource *q, Global *g, wl_resource *parentResource, const wl_interface *interface, const void *implementation); - - template - static Derived *cast(wl_resource *r) { - static_assert(std::is_base_of::value, - "Derived must be derived from Resource::Private"); - return r ? reinterpret_cast(wl_resource_get_user_data(r)) : nullptr; - } - static void unbind(wl_resource *resource); - static void resourceDestroyedCallback(wl_client *client, wl_resource *resource); - - Resource *q; - static QList s_allResources; - -private: - const wl_interface *const m_interface; - const void *const m_interfaceImplementation; -}; - -} -} -#endif diff -Nru dwayland-5.57.0.23/src/server/screencast_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/screencast_interface.cpp --- dwayland-5.57.0.23/src/server/screencast_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/screencast_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "screencast_interface.h" -#include "display.h" -#include "output_interface.h" - -#include "qwayland-server-zkde-screencast-unstable-v1.h" - -namespace KWayland -{ -namespace Server -{ - -static int s_version = 1; - -class ScreencastStreamV1InterfacePrivate : public QtWaylandServer::zkde_screencast_stream_unstable_v1 -{ -public: - ScreencastStreamV1InterfacePrivate(ScreencastStreamV1Interface *q) - : q(q) - {} - - void zkde_screencast_stream_unstable_v1_destroy_resource(Resource *resource) override - { - Q_UNUSED(resource); - if (!stopped) { - Q_EMIT q->finished(); - } - - q->deleteLater(); - } - - void zkde_screencast_stream_unstable_v1_close(Resource *resource) override - { - Q_UNUSED(resource); - Q_EMIT q->finished(); - stopped = true; - wl_resource_destroy(resource->handle); - } - - bool stopped = false; - ScreencastStreamV1Interface *const q; -}; - -ScreencastStreamV1Interface::ScreencastStreamV1Interface(QObject *parent) - : QObject(parent) - , d(new ScreencastStreamV1InterfacePrivate(this)) -{ -} - -ScreencastStreamV1Interface::~ScreencastStreamV1Interface() = default; - -void ScreencastStreamV1Interface::sendCreated(quint32 nodeid) -{ - d->send_created(nodeid); -} - -void ScreencastStreamV1Interface::sendFailed(const QString &error) -{ - d->send_failed(error); -} - -void ScreencastStreamV1Interface::sendClosed() -{ - if (!d->stopped) { - d->send_closed(); - } -} - -class ScreencastV1InterfacePrivate : public QtWaylandServer::zkde_screencast_unstable_v1 -{ -public: - ScreencastV1InterfacePrivate(Display *display, ScreencastV1Interface *q) - : QtWaylandServer::zkde_screencast_unstable_v1(*display, s_version) - , q(q) - { - } - - ScreencastStreamV1Interface *createStream(Resource *resource, quint32 streamid) const - { - auto stream = new ScreencastStreamV1Interface(q); - stream->d->init(resource->client(), streamid, resource->version()); - return stream; - } - - void zkde_screencast_unstable_v1_stream_output(Resource *resource, uint32_t streamid, struct ::wl_resource *output, uint32_t pointer) override - { - Q_EMIT q->outputScreencastRequested(createStream(resource, streamid), OutputInterface::get(output), ScreencastV1Interface::CursorMode(pointer)); - } - - void zkde_screencast_unstable_v1_stream_window(Resource *resource, uint32_t streamid, const QString &uuid, uint32_t pointer) override - { - Q_EMIT q->windowScreencastRequested(createStream(resource, streamid), uuid, ScreencastV1Interface::CursorMode(pointer)); - } - - void zkde_screencast_unstable_v1_destroy(Resource *resource) override - { - wl_resource_destroy(resource->handle); - } - - ScreencastV1Interface *const q; -}; - -ScreencastV1Interface::ScreencastV1Interface(Display *display, QObject *parent) - : QObject(parent) - , d(new ScreencastV1InterfacePrivate(display, this)) -{ -} - -ScreencastV1Interface::~ScreencastV1Interface() = default; - -} -} diff -Nru dwayland-5.57.0.23/src/server/screencast_interface.h dwayland-5.57.0.24+really5.24.3/src/server/screencast_interface.h --- dwayland-5.57.0.23/src/server/screencast_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/screencast_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SCREENCAST_INTERFACE_H -#define WAYLAND_SERVER_SCREENCAST_INTERFACE_H - -#include -#include - -#include - - -namespace KWayland -{ -namespace Server -{ - -class Display; -class OutputInterface; -class ScreencastV1InterfacePrivate; -class ScreencastStreamV1InterfacePrivate; -class ScreencastStreamV1Interface; - -class KWAYLANDSERVER_EXPORT ScreencastStreamV1Interface : public QObject -{ - Q_OBJECT -public: - ~ScreencastStreamV1Interface() override; - - void sendCreated(quint32 nodeid); - void sendFailed(const QString &error); - void sendClosed(); - -Q_SIGNALS: - void finished(); - -private: - friend class ScreencastV1InterfacePrivate; - explicit ScreencastStreamV1Interface(QObject *parent); - QScopedPointer d; -}; - -class KWAYLANDSERVER_EXPORT ScreencastV1Interface : public QObject -{ - Q_OBJECT -public: - virtual ~ScreencastV1Interface(); - - enum CursorMode { - Hidden = 1, - Embedded = 2, - Metadata = 4, - }; - Q_ENUM(CursorMode); - -Q_SIGNALS: - void outputScreencastRequested(ScreencastStreamV1Interface *stream, OutputInterface *output, CursorMode mode); - void windowScreencastRequested(ScreencastStreamV1Interface *stream, const QString &winid, CursorMode mode); - -private: - explicit ScreencastV1Interface(Display *display, QObject *parent = nullptr); - friend class Display; - QScopedPointer d; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/screencast_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/screencast_v1_interface.cpp --- dwayland-5.57.0.23/src/server/screencast_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/screencast_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,130 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "screencast_v1_interface.h" +#include "display.h" +#include "output_interface.h" + +#include + +#include "qwayland-server-zkde-screencast-unstable-v1.h" + +namespace KWaylandServer +{ +static int s_version = 2; + +class ScreencastStreamV1InterfacePrivate : public QtWaylandServer::zkde_screencast_stream_unstable_v1 +{ +public: + ScreencastStreamV1InterfacePrivate(ScreencastStreamV1Interface *q) + : q(q) + { + } + + void zkde_screencast_stream_unstable_v1_destroy_resource(Resource *resource) override + { + Q_UNUSED(resource); + if (!stopped) { + Q_EMIT q->finished(); + } + + q->deleteLater(); + } + + void zkde_screencast_stream_unstable_v1_close(Resource *resource) override + { + Q_UNUSED(resource); + Q_EMIT q->finished(); + stopped = true; + wl_resource_destroy(resource->handle); + } + + bool stopped = false; + ScreencastStreamV1Interface *const q; +}; + +ScreencastStreamV1Interface::ScreencastStreamV1Interface(QObject *parent) + : QObject(parent) + , d(new ScreencastStreamV1InterfacePrivate(this)) +{ +} + +ScreencastStreamV1Interface::~ScreencastStreamV1Interface() = default; + +void ScreencastStreamV1Interface::sendCreated(quint32 nodeid) +{ + d->send_created(nodeid); +} + +void ScreencastStreamV1Interface::sendFailed(const QString &error) +{ + d->send_failed(error); +} + +void ScreencastStreamV1Interface::sendClosed() +{ + if (!d->stopped) { + d->send_closed(); + } +} + +class ScreencastV1InterfacePrivate : public QtWaylandServer::zkde_screencast_unstable_v1 +{ +public: + ScreencastV1InterfacePrivate(Display *display, ScreencastV1Interface *q) + : QtWaylandServer::zkde_screencast_unstable_v1(*display, s_version) + , q(q) + { + } + + ScreencastStreamV1Interface *createStream(Resource *resource, quint32 streamid) const + { + auto stream = new ScreencastStreamV1Interface(q); + stream->d->init(resource->client(), streamid, resource->version()); + return stream; + } + + void zkde_screencast_unstable_v1_stream_output(Resource *resource, uint32_t streamid, struct ::wl_resource *output, uint32_t pointer) override + { + Q_EMIT q->outputScreencastRequested(createStream(resource, streamid), OutputInterface::get(output), ScreencastV1Interface::CursorMode(pointer)); + } + + void zkde_screencast_unstable_v1_stream_window(Resource *resource, uint32_t streamid, const QString &uuid, uint32_t pointer) override + { + Q_EMIT q->windowScreencastRequested(createStream(resource, streamid), uuid, ScreencastV1Interface::CursorMode(pointer)); + } + void zkde_screencast_unstable_v1_stream_virtual_output(Resource *resource, + uint32_t streamid, + const QString &name, + int32_t width, + int32_t height, + wl_fixed_t scale, + uint32_t pointer) override + { + Q_EMIT q->virtualOutputScreencastRequested(createStream(resource, streamid), + name, + {width, height}, + wl_fixed_to_double(scale), + ScreencastV1Interface::CursorMode(pointer)); + } + + void zkde_screencast_unstable_v1_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + + ScreencastV1Interface *const q; +}; + +ScreencastV1Interface::ScreencastV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new ScreencastV1InterfacePrivate(display, this)) +{ +} + +ScreencastV1Interface::~ScreencastV1Interface() = default; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/screencast_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/screencast_v1_interface.h --- dwayland-5.57.0.23/src/server/screencast_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/screencast_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,66 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class Display; +class OutputInterface; +class ScreencastV1InterfacePrivate; +class ScreencastStreamV1InterfacePrivate; +class ScreencastStreamV1Interface; + +class KWAYLANDSERVER_EXPORT ScreencastStreamV1Interface : public QObject +{ + Q_OBJECT +public: + ~ScreencastStreamV1Interface() override; + + void sendCreated(quint32 nodeid); + void sendFailed(const QString &error); + void sendClosed(); + +Q_SIGNALS: + void finished(); + +private: + friend class ScreencastV1InterfacePrivate; + explicit ScreencastStreamV1Interface(QObject *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT ScreencastV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit ScreencastV1Interface(Display *display, QObject *parent = nullptr); + virtual ~ScreencastV1Interface(); + + enum CursorMode { + Hidden = 1, + Embedded = 2, + Metadata = 4, + }; + Q_ENUM(CursorMode); + +Q_SIGNALS: + void outputScreencastRequested(ScreencastStreamV1Interface *stream, OutputInterface *output, CursorMode mode); + void virtualOutputScreencastRequested(ScreencastStreamV1Interface *stream, const QString &name, const QSize &size, double scaling, CursorMode mode); + void windowScreencastRequested(ScreencastStreamV1Interface *stream, const QString &winid, CursorMode mode); + +private: + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/seat_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/seat_interface.cpp --- dwayland-5.57.0.23/src/server/seat_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/seat_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,370 +1,184 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 David Edmundson + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "seat_interface.h" -#include "seat_interface_p.h" -#include "display.h" +#include "abstract_data_source.h" +#include "datacontroldevice_v1_interface.h" +#include "datacontrolsource_v1_interface.h" #include "datadevice_interface.h" +#include "datadevice_interface_p.h" #include "datasource_interface.h" +#include "display.h" +#include "display_p.h" #include "keyboard_interface.h" #include "keyboard_interface_p.h" +#include "logging.h" #include "pointer_interface.h" #include "pointer_interface_p.h" +#include "pointerconstraints_v1_interface.h" +#include "pointergestures_v1_interface_p.h" #include "primaryselectiondevice_v1_interface.h" #include "primaryselectionsource_v1_interface.h" -#include "primaryselectiondevicemanager_v1_interface.h" -#include "datacontroldevicemanager_interface.h" -#include "datacontroldevice_interface.h" +#include "relativepointer_v1_interface_p.h" +#include "seat_interface_p.h" #include "surface_interface.h" -#include "textinput_interface_p.h" -#include "abstract_data_source.h" +#include "textinput_v2_interface_p.h" +#include "textinput_v3_interface_p.h" +#include "touch_interface_p.h" +#include "utils.h" -// Wayland -#ifndef WL_SEAT_NAME_SINCE_VERSION -#define WL_SEAT_NAME_SINCE_VERSION 2 -#endif -// linux -#include -#if HAVE_LINUX_INPUT_H #include -#endif #include -#include -namespace KWayland +namespace KWaylandServer { +static const int s_version = 7; -namespace Server +SeatInterfacePrivate *SeatInterfacePrivate::get(SeatInterface *seat) { + return seat->d.data(); +} -const quint32 SeatInterface::Private::s_version = 5; -const qint32 SeatInterface::Private::s_pointerVersion = 5; -const qint32 SeatInterface::Private::s_touchVersion = 5; -const qint32 SeatInterface::Private::s_keyboardVersion = 5; - -SeatInterface::Private::Private(SeatInterface *q, Display *display) - : Global::Private(display, &wl_seat_interface, s_version) +SeatInterfacePrivate::SeatInterfacePrivate(SeatInterface *q, Display *display) + : QtWaylandServer::wl_seat(*display, s_version) , q(q) + , display(display) { + textInputV2 = new TextInputV2Interface(q); + textInputV3 = new TextInputV3Interface(q); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_seat_interface SeatInterface::Private::s_interface = { - getPointerCallback, - getKeyboardCallback, - getTouchCallback, - releaseCallback -}; -#endif - -SeatInterface::SeatInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +void SeatInterfacePrivate::seat_bind_resource(Resource *resource) { - Q_D(); - connect(this, &SeatInterface::nameChanged, this, - [this, d] { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - d->sendName(*it); - } - } - ); - auto sendCapabilitiesAll = [this, d] { - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) { - d->sendCapabilities(*it); - } - }; - connect(this, &SeatInterface::hasPointerChanged, this, sendCapabilitiesAll); - connect(this, &SeatInterface::hasKeyboardChanged, this, sendCapabilitiesAll); - connect(this, &SeatInterface::hasTouchChanged, this, sendCapabilitiesAll); -} + send_capabilities(resource->handle, capabilities); -SeatInterface::~SeatInterface() -{ - Q_D(); - while (!d->resources.isEmpty()) { - wl_resource_destroy(d->resources.takeLast()); + if (resource->version() >= WL_SEAT_NAME_SINCE_VERSION) { + send_name(resource->handle, name); } } -void SeatInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void SeatInterfacePrivate::seat_get_pointer(Resource *resource, uint32_t id) { - wl_resource *r = wl_resource_create(client, &wl_seat_interface, qMin(s_version, version), id); - if (!r) { - wl_client_post_no_memory(client); + if (!(accumulatedCapabilities & capability_pointer)) { + wl_resource_post_error(resource->handle, 0, "wl_pointer capability is missing"); return; } - resources << r; - - wl_resource_set_implementation(r, &s_interface, this, unbind); - - sendCapabilities(r); - sendName(r); -} - -void SeatInterface::Private::unbind(wl_resource *r) -{ - cast(r)->resources.removeAll(r); -} - -void SeatInterface::Private::releaseCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void SeatInterface::Private::updatePointerButtonSerial(quint32 button, quint32 serial) -{ - auto it = globalPointer.buttonSerials.find(button); - if (it == globalPointer.buttonSerials.end()) { - globalPointer.buttonSerials.insert(button, serial); - return; + if (pointer) { + PointerInterfacePrivate *pointerPrivate = PointerInterfacePrivate::get(pointer.data()); + pointerPrivate->add(resource->client(), id, resource->version()); } - it.value() = serial; } -void SeatInterface::Private::updatePointerButtonState(quint32 button, Pointer::State state) +void SeatInterfacePrivate::seat_get_keyboard(Resource *resource, uint32_t id) { - auto it = globalPointer.buttonStates.find(button); - if (it == globalPointer.buttonStates.end()) { - globalPointer.buttonStates.insert(button, state); + if (!(accumulatedCapabilities & capability_keyboard)) { + wl_resource_post_error(resource->handle, 0, "wl_keyboard capability is missing"); return; } - it.value() = state; -} - -bool SeatInterface::Private::updateKey(quint32 key, Keyboard::State state) -{ - auto it = keys.states.find(key); - if (it == keys.states.end()) { - keys.states.insert(key, state); - return true; - } - if (it.value() == state) { - return false; + if (keyboard) { + KeyboardInterfacePrivate *keyboardPrivate = KeyboardInterfacePrivate::get(keyboard.data()); + keyboardPrivate->add(resource->client(), id, resource->version()); } - it.value() = state; - return true; } -void SeatInterface::Private::sendName(wl_resource *r) +void SeatInterfacePrivate::seat_get_touch(Resource *resource, uint32_t id) { - if (wl_resource_get_version(r) < WL_SEAT_NAME_SINCE_VERSION) { + if (!(accumulatedCapabilities & capability_touch)) { + wl_resource_post_error(resource->handle, 0, "wl_touch capability is missing"); return; } - wl_seat_send_name(r, name.toUtf8().constData()); -} - -void SeatInterface::Private::sendCapabilities(wl_resource *r) -{ - uint32_t capabilities = 0; - if (pointer) { - capabilities |= WL_SEAT_CAPABILITY_POINTER; - } - if (keyboard) { - capabilities |= WL_SEAT_CAPABILITY_KEYBOARD; - } if (touch) { - capabilities |= WL_SEAT_CAPABILITY_TOUCH; + TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(touch.data()); + touchPrivate->add(resource->client(), id, resource->version()); } - wl_seat_send_capabilities(r, capabilities); } -SeatInterface::Private *SeatInterface::Private::cast(wl_resource *r) +void SeatInterfacePrivate::seat_release(Resource *resource) { - return r ? reinterpret_cast(wl_resource_get_user_data(r)) : nullptr; + wl_resource_destroy(resource->handle); } -namespace { -template -static -T *interfaceForSurface(SurfaceInterface *surface, const QVector &interfaces) +SeatInterface::SeatInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new SeatInterfacePrivate(this, display)) { - if (!surface) { - return nullptr; - } + DisplayPrivate *displayPrivate = DisplayPrivate::get(d->display); + displayPrivate->seats.append(this); +} - for (auto it = interfaces.begin(); it != interfaces.end(); ++it) { - if ((*it)->client() == surface->client()) { - return (*it); - } +SeatInterface::~SeatInterface() +{ + if (d->display) { + DisplayPrivate *displayPrivate = DisplayPrivate::get(d->display); + displayPrivate->seats.removeOne(this); } - return nullptr; } -template -static -QVector interfacesForSurface(SurfaceInterface *surface, const QVector &interfaces) +void SeatInterfacePrivate::updatePointerButtonSerial(quint32 button, quint32 serial) { - QVector ret; - if (!surface) { - return ret; + auto it = globalPointer.buttonSerials.find(button); + if (it == globalPointer.buttonSerials.end()) { + globalPointer.buttonSerials.insert(button, serial); + return; } + it.value() = serial; +} - for (auto it = interfaces.begin(); it != interfaces.end(); ++it) { - if ((*it)->client() == surface->client() && (*it)->resource()) { - ret << *it; - } +void SeatInterfacePrivate::updatePointerButtonState(quint32 button, Pointer::State state) +{ + auto it = globalPointer.buttonStates.find(button); + if (it == globalPointer.buttonStates.end()) { + globalPointer.buttonStates.insert(button, state); + return; } - return ret; + it.value() = state; } -template -static -bool forEachInterface(SurfaceInterface *surface, const QVector &interfaces, std::function method) +QVector SeatInterfacePrivate::dataDevicesForSurface(SurfaceInterface *surface) const { if (!surface) { - return false; + return {}; } - bool calledAtLeastOne = false; - for (auto it = interfaces.begin(); it != interfaces.end(); ++it) { - if ((*it)->client() == surface->client() && (*it)->resource()) { - method(*it); - calledAtLeastOne = true; + QVector primarySelectionDevices; + for (auto it = dataDevices.constBegin(); it != dataDevices.constEnd(); ++it) { + if ((*it)->client() == *surface->client()) { + primarySelectionDevices << *it; } } - return calledAtLeastOne; -} - -} - -QVector SeatInterface::Private::pointersForSurface(SurfaceInterface *surface) const -{ - return interfacesForSurface(surface, pointers); -} - -QVector SeatInterface::Private::keyboardsForSurface(SurfaceInterface *surface) const -{ - return interfacesForSurface(surface, keyboards); -} - -QVector SeatInterface::Private::touchsForSurface(SurfaceInterface *surface) const -{ - return interfacesForSurface(surface, touchs); -} - -DataDeviceInterface *SeatInterface::Private::dataDeviceForSurface(SurfaceInterface *surface) const -{ - return interfaceForSurface(surface, dataDevices); -} - -TextInputInterface *SeatInterface::Private::textInputForSurface(SurfaceInterface *surface) const -{ - return interfaceForSurface(surface, textInputs); + return primarySelectionDevices; } -void SeatInterface::Private::registerDataDevice(DataDeviceInterface *dataDevice) +void SeatInterfacePrivate::registerDataDevice(DataDeviceInterface *dataDevice) { Q_ASSERT(dataDevice->seat() == q); dataDevices << dataDevice; auto dataDeviceCleanup = [this, dataDevice] { - if (!dataDevices.isEmpty() && dataDevices.contains(dataDevice)) { - dataDevices.removeOne(dataDevice); - if (keys.focus.selection == dataDevice) { - keys.focus.selection = nullptr; - } - if (currentSelection == dataDevice->selection()) { - // current selection is cleared - if (currentSelection) { - emit currentSelection->aboutToBeDestroyed(); - } - currentSelection = nullptr; - emit q->selectionChanged(nullptr); - if (keys.focus.selection) { - keys.focus.selection->sendClearSelection(); - } - } - } + dataDevices.removeOne(dataDevice); + globalKeyboard.focus.selections.removeOne(dataDevice); }; QObject::connect(dataDevice, &QObject::destroyed, q, dataDeviceCleanup); - QObject::connect(dataDevice, &Resource::unbound, q, dataDeviceCleanup); - QObject::connect(dataDevice, &DataDeviceInterface::selectionChanged, q, - [this, dataDevice] { - if(keys.focus.surface && dataDevice && dataDevice->client() == keys.focus.surface->client()) { - updateSelection(dataDevice->selection(), true); - } - - } - ); - QObject::connect(dataDevice, &DataDeviceInterface::selectionCleared, q, - [this, dataDevice] { - if(keys.focus.surface && dataDevice && dataDevice->client() == keys.focus.surface->client()) { - updateSelection(dataDevice->selection(), true); - } - } - ); - QObject::connect(dataDevice, &DataDeviceInterface::dragStarted, q, - [this, dataDevice] { - const auto dragSerial = dataDevice->dragImplicitGrabSerial(); - auto *dragSurface = dataDevice->origin(); - if (q->hasImplicitPointerGrab(dragSerial)) { - drag.mode = Drag::Mode::Pointer; - drag.sourcePointer = interfaceForSurface(dragSurface, pointers); - drag.transformation = globalPointer.focus.transformation; - } else if (q->hasImplicitTouchGrab(dragSerial)) { - drag.mode = Drag::Mode::Touch; - drag.sourceTouch = interfaceForSurface(dragSurface, touchs); - // TODO: touch transformation - } else { - // no implicit grab, abort drag - return; - } - auto *originSurface = dataDevice->origin(); - const bool proxied = originSurface->dataProxy(); - if (!proxied) { - // origin surface - drag.target = dataDevice; - drag.surface = originSurface; - // TODO: transformation needs to be either pointer or touch - drag.transformation = globalPointer.focus.transformation; - } - drag.source = dataDevice; - drag.sourcePointer = interfaceForSurface(originSurface, pointers); - drag.destroyConnection = QObject::connect(dataDevice, &QObject::destroyed, q, - [this] { - endDrag(display->nextSerial()); - } - ); - if (dataDevice->dragSource()) { - drag.dragSourceDestroyConnection = QObject::connect(dataDevice->dragSource(), &Resource::aboutToBeUnbound, q, - [this] { - const auto serial = display->nextSerial(); - if (drag.target) { - drag.target->updateDragTarget(nullptr, serial); - drag.target = nullptr; - } - endDrag(serial); - } - ); - } else { - drag.dragSourceDestroyConnection = QMetaObject::Connection(); - } - dataDevice->updateDragTarget(proxied ? nullptr : originSurface, dataDevice->dragImplicitGrabSerial()); - emit q->dragStarted(); - emit q->dragSurfaceChanged(); - } - ); + QObject::connect(dataDevice, &DataDeviceInterface::selectionChanged, q, [this, dataDevice] { + updateSelection(dataDevice); + }); + QObject::connect(dataDevice, &DataDeviceInterface::selectionCleared, q, [this, dataDevice] { + updateSelection(dataDevice); + }); + QObject::connect(dataDevice, + &DataDeviceInterface::dragStarted, + q, + [this](AbstractDataSource *source, SurfaceInterface *origin, quint32 serial, DragAndDropIcon *dragIcon) { + q->startDrag(source, origin, serial, dragIcon); + }); // is the new DataDevice for the current keyoard focus? - if (keys.focus.surface && !keys.focus.selection) { + if (globalKeyboard.focus.surface) { // same client? - if (keys.focus.surface->client() == dataDevice->client()) { - keys.focus.selection = dataDevice; + if (*globalKeyboard.focus.surface->client() == dataDevice->client()) { + globalKeyboard.focus.selections.append(dataDevice); if (currentSelection) { dataDevice->sendSelection(currentSelection); } @@ -372,63 +186,85 @@ } } -void SeatInterface::Private::registerDataControlDevice(DataControlDeviceV1Interface *dataDevice) +KWaylandServer::AbstractDropHandler *SeatInterface::dropHandlerForSurface(SurfaceInterface *surface) const +{ + auto list = d->dataDevicesForSurface(surface); + if (list.isEmpty()) { + return nullptr; + }; + return list.first(); +} + +void SeatInterfacePrivate::registerDataControlDevice(DataControlDeviceV1Interface *dataDevice) { Q_ASSERT(dataDevice->seat() == q); dataControlDevices << dataDevice; auto dataDeviceCleanup = [this, dataDevice] { dataControlDevices.removeOne(dataDevice); - if (currentSelection == dataDevice->selection()) { - // current selection is cleared - currentSelection = nullptr; - emit q->selectionChanged(nullptr); - if (keys.focus.selection) { - keys.focus.selection->sendClearSelection(); - } - } }; QObject::connect(dataDevice, &QObject::destroyed, q, dataDeviceCleanup); - QObject::connect(dataDevice, &DataControlDeviceV1Interface::selectionChanged, q, - [this, dataDevice] { - updateSelection(dataDevice->selection(),false); + QObject::connect(dataDevice, &DataControlDeviceV1Interface::selectionChanged, q, [this, dataDevice] { + // Special klipper workaround to avoid a race + // If the mimetype x-kde-onlyReplaceEmpty is set, and we've had another update in the meantime, do nothing + // See https://github.com/swaywm/wlr-protocols/issues/92 + if (dataDevice->selection() && dataDevice->selection()->mimeTypes().contains(QLatin1String("application/x-kde-onlyReplaceEmpty")) && currentSelection) { + dataDevice->selection()->cancel(); + return; } - ); + q->setSelection(dataDevice->selection()); + }); - QObject::connect(dataDevice, &DataControlDeviceV1Interface::selectionCleared, q, - [this, dataDevice] { - updateSelection(dataDevice->selection(),false); + QObject::connect(dataDevice, &DataControlDeviceV1Interface::cachedSelectionChanged, q, [this, dataDevice] { + q->updateCachedSelection(dataDevice->cachedSelection()); + }); + + QObject::connect(dataDevice, &DataControlDeviceV1Interface::selectionCleared, q, [this, dataDevice] { + Q_UNUSED(dataDevice); + q->setSelection(nullptr); + }); + + QObject::connect(dataDevice, &DataControlDeviceV1Interface::primarySelectionChanged, q, [this, dataDevice] { + // Special klipper workaround to avoid a race + // If the mimetype x-kde-onlyReplaceEmpty is set, and we've had another update in the meantime, do nothing + // See https://github.com/swaywm/wlr-protocols/issues/92 + if (dataDevice->primarySelection() && dataDevice->primarySelection()->mimeTypes().contains(QLatin1String("application/x-kde-onlyReplaceEmpty")) + && currentPrimarySelection) { + dataDevice->primarySelection()->cancel(); + return; } - ); + q->setPrimarySelection(dataDevice->primarySelection()); + }); + if (currentSelection) { dataDevice->sendSelection(currentSelection); } - + if (currentPrimarySelection) { + dataDevice->sendPrimarySelection(currentPrimarySelection); + } } -void SeatInterface::Private::registerPrimarySelectionDevice(PrimarySelectionDeviceV1Interface *primarySelectionDevice) +void SeatInterfacePrivate::registerPrimarySelectionDevice(PrimarySelectionDeviceV1Interface *primarySelectionDevice) { Q_ASSERT(primarySelectionDevice->seat() == q); primarySelectionDevices << primarySelectionDevice; auto dataDeviceCleanup = [this, primarySelectionDevice] { primarySelectionDevices.removeOne(primarySelectionDevice); - keys.focus.primarySelections.removeOne(primarySelectionDevice); + globalKeyboard.focus.primarySelections.removeOne(primarySelectionDevice); }; - QObject::connect(primarySelectionDevice, &QObject::destroyed, dataDeviceCleanup); - QObject::connect(primarySelectionDevice, &PrimarySelectionDeviceV1Interface::selectionChanged, - [=](){ - updatePrimarySelection(primarySelectionDevice); - } - ); - QObject::connect(primarySelectionDevice, &PrimarySelectionDeviceV1Interface::selectionCleared, - [=](){ - updatePrimarySelection(primarySelectionDevice); - } - ); - if (keys.focus.surface) { - if (keys.focus.surface->client() == primarySelectionDevice->client()) { - keys.focus.primarySelections.append(primarySelectionDevice); + QObject::connect(primarySelectionDevice, &QObject::destroyed, q, dataDeviceCleanup); + QObject::connect(primarySelectionDevice, &PrimarySelectionDeviceV1Interface::selectionChanged, q, [this, primarySelectionDevice] { + updatePrimarySelection(primarySelectionDevice); + }); + QObject::connect(primarySelectionDevice, &PrimarySelectionDeviceV1Interface::selectionCleared, q, [this, primarySelectionDevice] { + updatePrimarySelection(primarySelectionDevice); + }); + // is the new DataDevice for the current keyoard focus? + if (globalKeyboard.focus.surface) { + // same client? + if (*globalKeyboard.focus.surface->client() == primarySelectionDevice->client()) { + globalKeyboard.focus.primarySelections.append(primarySelectionDevice); if (currentPrimarySelection) { primarySelectionDevice->sendSelection(currentPrimarySelection); } @@ -436,375 +272,236 @@ } } -void SeatInterface::Private::updatePrimarySelection(PrimarySelectionDeviceV1Interface *primarySelectionDevice) +void SeatInterfacePrivate::cancelDrag(quint32 serial) { - // if the update is from the focussed window we should inform the active client - if (!(keys.focus.surface && (keys.focus.surface->client() == primarySelectionDevice->client()))) { - return; - } - q->setPrimarySelection(primarySelectionDevice->selection()); -} - -void SeatInterface::Private::registerTextInput(TextInputInterface *ti) -{ - // text input version 0 might call this multiple times - if (textInputs.contains(ti)) { - return; + if (drag.target) { + drag.target->updateDragTarget(nullptr, serial); + drag.target = nullptr; } - textInputs << ti; - if (textInput.focus.surface && textInput.focus.surface->client() == ti->client()) { - // this is a text input for the currently focused text input surface - if (!textInput.focus.textInput) { - textInput.focus.textInput = ti; - ti->d_func()->sendEnter(textInput.focus.surface, textInput.focus.serial); - emit q->focusedTextInputChanged(); - } - } - QObject::connect(ti, &QObject::destroyed, q, - [this, ti] { - textInputs.removeAt(textInputs.indexOf(ti)); - if (textInput.focus.textInput == ti) { - textInput.focus.textInput = nullptr; - emit q->focusedTextInputChanged(); - } - } - ); + endDrag(serial); } -void SeatInterface::Private::endDrag(quint32 serial) +void SeatInterfacePrivate::endDrag(quint32 serial) { - auto target = drag.target; - QObject::disconnect(drag.destroyConnection); QObject::disconnect(drag.dragSourceDestroyConnection); - if (drag.source && drag.source->dragSource()) { - drag.source->dragSource()->dropPerformed(); + + AbstractDropHandler *dragTargetDevice = drag.target.data(); + AbstractDataSource *dragSource = drag.source; + if (dragSource) { + // TODO: Also check the current drag-and-drop action. + if (dragTargetDevice && dragSource->isAccepted()) { + Q_EMIT q->dragDropped(); + dragTargetDevice->drop(); + dragSource->dropPerformed(); + } else { + dragSource->dndCancelled(); + } } - if (target) { - target->drop(); - target->updateDragTarget(nullptr, serial); + + if (dragTargetDevice) { + dragTargetDevice->updateDragTarget(nullptr, serial); } + drag = Drag(); - emit q->dragSurfaceChanged(); - emit q->dragEnded(); + Q_EMIT q->dragSurfaceChanged(); + Q_EMIT q->dragEnded(); } -void SeatInterface::Private::cancelPreviousSelection(AbstractDataSource *dataDevice) +void SeatInterfacePrivate::updateSelection(DataDeviceInterface *dataDevice) { - if (!currentSelection) { + // if the update is from the focussed window we should inform the active client + if (!(globalKeyboard.focus.surface && (*globalKeyboard.focus.surface->client() == dataDevice->client()))) { return; } - if (currentSelection != dataDevice) { - // only if current selection is not on the same device - // that would cancel the newly set source - currentSelection->cancel(); - } + q->setSelection(dataDevice->selection()); } -void SeatInterface::Private::cancelPreviousPrimarySelection(AbstractDataSource *newlySelectedDataDevice) +void SeatInterfacePrivate::updatePrimarySelection(PrimarySelectionDeviceV1Interface *primarySelectionDevice) { - if (!currentPrimarySelection) { + // if the update is from the focussed window we should inform the active client + if (!(globalKeyboard.focus.surface && (*globalKeyboard.focus.surface->client() == primarySelectionDevice->client()))) { return; } - if (currentPrimarySelection != newlySelectedDataDevice) { - // only if current selection is not on the same device - // that would cancel the newly set source - newlySelectedDataDevice->cancel(); - } + q->setPrimarySelection(primarySelectionDevice->selection()); } -void SeatInterface::Private::updateSelection(AbstractDataSource *dataSource, bool sendDataConctrl) +void SeatInterfacePrivate::sendCapabilities() { - // if the update is from the focussed window we should inform the active client - // && sendDataConctrl The client in the dataconctrl protocol may not be the active window - if (dataSource && sendDataConctrl && !(keys.focus.surface && (keys.focus.surface->client() == dataSource->client()))) { - return ; - } - connect(dataSource, &KWayland::Server::AbstractDataSource::aboutToBeDestroyed, - q, [this,dataSource](){ - if (dataSource == currentSelection) { - currentSelection = nullptr; - } - }); - if(sendDataConctrl) - q->setSelection(dataSource); - else { // dataconctrl Don’t send to yourself when you don’t change yourself - if (currentSelection == dataSource) { - return; - } - // cancel the previous selection - cancelPreviousSelection(dataSource); - currentSelection = dataSource; - if (keys.focus.selection) { - if (dataSource) { - keys.focus.selection->sendSelection(dataSource); - } else { - keys.focus.selection->sendClearSelection(); - } - } - emit q->selectionChanged(dataSource); + const auto seatResources = resourceMap(); + for (SeatInterfacePrivate::Resource *resource : seatResources) { + send_capabilities(resource->handle, capabilities); } } void SeatInterface::setHasKeyboard(bool has) { - Q_D(); - if (d->keyboard == has) { + if (d->keyboard.isNull() != has) { return; } - d->keyboard = has; - emit hasKeyboardChanged(d->keyboard); -} - -void SeatInterface::setPrimarySelection(AbstractDataSource *primarySource) -{ - Q_D(); - - if (d->currentPrimarySelection == primarySource) { - return; - } - - if (d->currentPrimarySelection) { - d->currentPrimarySelection->cancel(); - disconnect(d->currentPrimarySelection, nullptr, this, nullptr); - } - - - if (primarySource) { - auto cleanup = [this]() { - setPrimarySelection(nullptr); - }; - connect(primarySource, &PrimarySelectionSourceV1Interface::unbound, this, cleanup); - } - - d->currentPrimarySelection = primarySource; - - for (auto focussedSelection: qAsConst(d->keys.focus.primarySelections)) { - if (primarySource) { - focussedSelection->sendSelection(primarySource); - } else { - focussedSelection->sendClearSelection(); - } - } - - for (auto control : qAsConst(d->dataControlDevices)) { - if (primarySource) { - control->sendPrimarySelection(primarySource); - } else { - control->sendClearPrimarySelection(); - } + if (has) { + d->capabilities |= SeatInterfacePrivate::capability_keyboard; + d->keyboard.reset(new KeyboardInterface(this)); + } else { + d->capabilities &= ~SeatInterfacePrivate::capability_keyboard; + d->keyboard.reset(); } + d->accumulatedCapabilities |= d->capabilities; - emit primarySelectionChanged(primarySource); + d->sendCapabilities(); + Q_EMIT hasKeyboardChanged(d->keyboard); } - void SeatInterface::setHasPointer(bool has) { - Q_D(); - if (d->pointer == has) { + if (d->pointer.isNull() != has) { return; } - d->pointer = has; - emit hasPointerChanged(d->pointer); + if (has) { + d->capabilities |= SeatInterfacePrivate::capability_pointer; + d->pointer.reset(new PointerInterface(this)); + } else { + d->capabilities &= ~SeatInterfacePrivate::capability_pointer; + d->pointer.reset(); + } + d->accumulatedCapabilities |= d->capabilities; + + d->sendCapabilities(); + Q_EMIT hasPointerChanged(d->pointer); } void SeatInterface::setHasTouch(bool has) { - Q_D(); - if (d->touch == has) { + if (d->touch.isNull() != has) { return; } - d->touch = has; - emit hasTouchChanged(d->touch); + if (has) { + d->capabilities |= SeatInterfacePrivate::capability_touch; + d->touch.reset(new TouchInterface(this)); + } else { + d->capabilities &= ~SeatInterfacePrivate::capability_touch; + d->touch.reset(); + } + d->accumulatedCapabilities |= d->capabilities; + + d->sendCapabilities(); + Q_EMIT hasTouchChanged(d->touch); } void SeatInterface::setName(const QString &name) { - Q_D(); if (d->name == name) { return; } d->name = name; - emit nameChanged(d->name); -} -void SeatInterface::Private::getPointerCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->getPointer(client, resource, id); -} - -void SeatInterface::Private::getPointer(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has pointer? - PointerInterface *pointer = new PointerInterface(q, resource); - auto clientConnection = display->getConnection(client); - pointer->create(clientConnection, qMin(wl_resource_get_version(resource), s_pointerVersion), id); - if (!pointer->resource()) { - wl_resource_post_no_memory(resource); - delete pointer; - return; - } - pointers << pointer; - if (globalPointer.focus.surface && globalPointer.focus.surface->client() == clientConnection) { - // this is a pointer for the currently focused pointer surface - globalPointer.focus.pointers << pointer; - pointer->setFocusedSurface(globalPointer.focus.surface, globalPointer.focus.serial); - pointer->d_func()->sendFrame(); - if (globalPointer.focus.pointers.count() == 1) { - // got a new pointer - emit q->focusedPointerChanged(pointer); + const auto seatResources = d->resourceMap(); + for (SeatInterfacePrivate::Resource *resource : seatResources) { + if (resource->version() >= WL_SEAT_NAME_SINCE_VERSION) { + d->send_name(resource->handle, d->name); } } - QObject::connect(pointer, &QObject::destroyed, q, - [pointer,this] { - pointers.removeAt(pointers.indexOf(pointer)); - if (globalPointer.focus.pointers.removeOne(pointer)) { - if (globalPointer.focus.pointers.isEmpty()) { - emit q->focusedPointerChanged(nullptr); - } - } - } - ); - emit q->pointerCreated(pointer); -} -void SeatInterface::Private::getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->getKeyboard(client, resource, id); -} - -void SeatInterface::Private::getKeyboard(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has keyboard? - KeyboardInterface *keyboard = new KeyboardInterface(q, resource); - auto clientConnection = display->getConnection(client); - keyboard->create(clientConnection, qMin(wl_resource_get_version(resource), s_keyboardVersion) , id); - if (!keyboard->resource()) { - wl_resource_post_no_memory(resource); - delete keyboard; - return; - } - keyboard->repeatInfo(keys.keyRepeat.charactersPerSecond, keys.keyRepeat.delay); - if (keys.keymap.xkbcommonCompatible) { - keyboard->setKeymap(keys.keymap.fd, keys.keymap.size); - } - keyboards << keyboard; - if (keys.focus.surface && keys.focus.surface->client() == clientConnection) { - // this is a keyboard for the currently focused keyboard surface - keys.focus.keyboards << keyboard; - keyboard->setFocusedSurface(keys.focus.surface, keys.focus.serial); - } - QObject::connect(keyboard, &QObject::destroyed, q, - [keyboard,this] { - keyboards.removeAt(keyboards.indexOf(keyboard)); - keys.focus.keyboards.removeOne(keyboard); - } - ); - emit q->keyboardCreated(keyboard); -} - -void SeatInterface::Private::getTouchCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - cast(resource)->getTouch(client, resource, id); -} - -void SeatInterface::Private::getTouch(wl_client *client, wl_resource *resource, uint32_t id) -{ - // TODO: only create if seat has touch? - TouchInterface *touch = new TouchInterface(q, resource); - auto clientConnection = display->getConnection(client); - touch->create(clientConnection, qMin(wl_resource_get_version(resource), s_touchVersion), id); - if (!touch->resource()) { - wl_resource_post_no_memory(resource); - delete touch; - return; - } - touchs << touch; - if (globalTouch.focus.surface && globalTouch.focus.surface->client() == clientConnection) { - // this is a touch for the currently focused touch surface - globalTouch.focus.touchs << touch; - if (!globalTouch.ids.isEmpty()) { - // TODO: send out all the points - } - } - QObject::connect(touch, &QObject::destroyed, q, - [touch,this] { - touchs.removeAt(touchs.indexOf(touch)); - globalTouch.focus.touchs.removeOne(touch); - } - ); - emit q->touchCreated(touch); + Q_EMIT nameChanged(d->name); } QString SeatInterface::name() const { - Q_D(); return d->name; } bool SeatInterface::hasPointer() const { - Q_D(); return d->pointer; } bool SeatInterface::hasKeyboard() const { - Q_D(); return d->keyboard; } bool SeatInterface::hasTouch() const { - Q_D(); return d->touch; } -SeatInterface *SeatInterface::get(wl_resource *native) +Display *SeatInterface::display() const { - return Private::get(native); + return d->display; } -SeatInterface::Private *SeatInterface::d_func() const +SeatInterface *SeatInterface::get(wl_resource *native) { - return reinterpret_cast(d.data()); + if (SeatInterfacePrivate *seatPrivate = resource_cast(native)) { + return seatPrivate->q; + } + return nullptr; } QPointF SeatInterface::pointerPos() const { - Q_D(); return d->globalPointer.pos; } -void SeatInterface::setPointerPos(const QPointF &pos) +void SeatInterface::notifyPointerMotion(const QPointF &pos) { - Q_D(); + if (!d->pointer) { + return; + } if (d->globalPointer.pos == pos) { return; } d->globalPointer.pos = pos; - emit pointerPosChanged(pos); + Q_EMIT pointerPosChanged(pos); + + SurfaceInterface *focusedSurface = focusedPointerSurface(); + if (!focusedSurface) { + return; + } + if (isDragPointer()) { + // data device will handle it directly + // for xwayland cases we still want to send pointer events + if (!d->dataDevicesForSurface(focusedSurface).isEmpty()) + return; + } + if (focusedSurface->lockedPointer() && focusedSurface->lockedPointer()->isLocked()) { + return; + } + + QPointF localPosition = focusedPointerSurfaceTransformation().map(pos); + SurfaceInterface *effectiveFocusedSurface = focusedSurface->inputSurfaceAt(localPosition); + if (!effectiveFocusedSurface) { + effectiveFocusedSurface = focusedSurface; + } + if (focusedSurface != effectiveFocusedSurface) { + localPosition = focusedSurface->mapToChild(effectiveFocusedSurface, localPosition); + } + + if (d->pointer->focusedSurface() != effectiveFocusedSurface) { + d->pointer->setFocusedSurface(effectiveFocusedSurface, localPosition, display()->nextSerial()); + } + + d->pointer->sendMotion(localPosition); } quint32 SeatInterface::timestamp() const { - Q_D(); return d->timestamp; } void SeatInterface::setTimestamp(quint32 time) { - Q_D(); if (d->timestamp == time) { return; } d->timestamp = time; - emit timestampChanged(time); + Q_EMIT timestampChanged(time); } -void SeatInterface::setDragTarget(SurfaceInterface *surface, const QPointF &globalPosition, const QMatrix4x4 &inputTransformation) +void SeatInterface::setDragTarget(AbstractDropHandler *dropTarget, + SurfaceInterface *surface, + const QPointF &globalPosition, + const QMatrix4x4 &inputTransformation) { - Q_D(); if (surface == d->drag.surface) { // no change return; @@ -813,12 +510,17 @@ if (d->drag.target) { d->drag.target->updateDragTarget(nullptr, serial); } - d->drag.target = d->dataDeviceForSurface(surface); - if (d->drag.mode == Private::Drag::Mode::Pointer) { - setPointerPos(globalPosition); - } else if (d->drag.mode == Private::Drag::Mode::Touch && - d->globalTouch.focus.firstTouchPos != globalPosition) { - touchMove(d->globalTouch.ids.first(), globalPosition); + + // TODO: technically we can have mulitple data devices + // and we should send the drag to all of them, but that seems overly complicated + // in practice so far the only case for mulitple data devices is for clipboard overriding + d->drag.target = dropTarget; + + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { + notifyPointerMotion(globalPosition); + notifyPointerFrame(); + } else if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Touch && d->globalTouch.focus.firstTouchPos != globalPosition) { + notifyTouchMotion(d->globalTouch.ids.first(), globalPosition); } if (d->drag.target) { d->drag.surface = surface; @@ -827,27 +529,22 @@ } else { d->drag.surface = nullptr; } - emit dragSurfaceChanged(); + Q_EMIT dragSurfaceChanged(); return; } -void SeatInterface::setDragTarget(SurfaceInterface *surface, const QMatrix4x4 &inputTransformation) +void SeatInterface::setDragTarget(AbstractDropHandler *target, SurfaceInterface *surface, const QMatrix4x4 &inputTransformation) { - Q_D(); - if (d->drag.mode == Private::Drag::Mode::Pointer) { - setDragTarget(surface, pointerPos(), inputTransformation); + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { + setDragTarget(target, surface, pointerPos(), inputTransformation); } else { - // Q_ASSERT(d->drag.mode == Private::Drag::Mode::Touch); - if (d->drag.mode == Private::Drag::Mode::Touch) { - setDragTarget(surface, d->globalTouch.focus.firstTouchPos, inputTransformation); - } + Q_ASSERT(d->drag.mode == SeatInterfacePrivate::Drag::Mode::Touch); + setDragTarget(target, surface, d->globalTouch.focus.firstTouchPos, inputTransformation); } - } SurfaceInterface *SeatInterface::focusedPointerSurface() const { - Q_D(); return d->globalPointer.focus.surface; } @@ -856,7 +553,6 @@ QMatrix4x4 m; m.translate(-surfacePosition.x(), -surfacePosition.y()); setFocusedPointerSurface(surface, m); - Q_D(); if (d->globalPointer.focus.surface) { d->globalPointer.focus.offset = surfacePosition; } @@ -864,68 +560,47 @@ void SeatInterface::setFocusedPointerSurface(SurfaceInterface *surface, const QMatrix4x4 &transformation) { - Q_D(); - if (d->drag.mode == Private::Drag::Mode::Pointer) { + if (!d->pointer) { + return; + } + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { // ignore return; } + const quint32 serial = d->display->nextSerial(); - QSet framePointers; - for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { - (*it)->setFocusedSurface(nullptr, serial); - framePointers << *it; - } + if (d->globalPointer.focus.surface) { disconnect(d->globalPointer.focus.destroyConnection); } - d->globalPointer.focus = Private::Pointer::Focus(); + d->globalPointer.focus = SeatInterfacePrivate::Pointer::Focus(); d->globalPointer.focus.surface = surface; - auto p = d->pointersForSurface(surface); - d->globalPointer.focus.pointers = p; if (d->globalPointer.focus.surface) { - d->globalPointer.focus.destroyConnection = connect(surface, &QObject::destroyed, this, - [this] { - Q_D(); - d->globalPointer.focus = Private::Pointer::Focus(); - emit focusedPointerChanged(nullptr); - } - ); - d->globalPointer.focus.offset = QPointF(); - d->globalPointer.focus.transformation = transformation; + d->globalPointer.focus.destroyConnection = connect(surface, &QObject::destroyed, this, [this] { + d->globalPointer.focus = SeatInterfacePrivate::Pointer::Focus(); + }); d->globalPointer.focus.serial = serial; + d->globalPointer.focus.transformation = transformation; + d->globalPointer.focus.offset = QPointF(); } - if (p.isEmpty()) { - emit focusedPointerChanged(nullptr); - for (auto p : qAsConst(framePointers)) - { - p->d_func()->sendFrame(); - } - return; - } - // TODO: signal with all pointers - emit focusedPointerChanged(p.first()); - for (auto it = p.constBegin(), end = p.constEnd(); it != end; ++it) { - (*it)->setFocusedSurface(surface, serial); - framePointers << *it; - } - for (auto p : qAsConst(framePointers)) - { - p->d_func()->sendFrame(); - } -} -PointerInterface *SeatInterface::focusedPointer() const -{ - Q_D(); - if (d->globalPointer.focus.pointers.isEmpty()) { - return nullptr; + if (surface) { + QPointF localPosition = focusedPointerSurfaceTransformation().map(pointerPos()); + SurfaceInterface *effectiveFocusedSurface = surface->inputSurfaceAt(localPosition); + if (!effectiveFocusedSurface) { + effectiveFocusedSurface = surface; + } + if (surface != effectiveFocusedSurface) { + localPosition = surface->mapToChild(effectiveFocusedSurface, localPosition); + } + d->pointer->setFocusedSurface(effectiveFocusedSurface, localPosition, serial); + } else { + d->pointer->setFocusedSurface(nullptr, QPointF(), serial); } - return d->globalPointer.focus.pointers.first(); } void SeatInterface::setFocusedPointerSurfacePosition(const QPointF &surfacePosition) { - Q_D(); if (d->globalPointer.focus.surface) { d->globalPointer.focus.offset = surfacePosition; d->globalPointer.focus.transformation = QMatrix4x4(); @@ -935,13 +610,11 @@ QPointF SeatInterface::focusedPointerSurfacePosition() const { - Q_D(); return d->globalPointer.focus.offset; } void SeatInterface::setFocusedPointerSurfaceTransformation(const QMatrix4x4 &transformation) { - Q_D(); if (d->globalPointer.focus.surface) { d->globalPointer.focus.transformation = transformation; } @@ -949,23 +622,25 @@ QMatrix4x4 SeatInterface::focusedPointerSurfaceTransformation() const { - Q_D(); return d->globalPointer.focus.transformation; } -namespace { +PointerInterface *SeatInterface::pointer() const +{ + return d->pointer.data(); +} + static quint32 qtToWaylandButton(Qt::MouseButton button) { -#if HAVE_LINUX_INPUT_H static const QHash s_buttons({ {Qt::LeftButton, BTN_LEFT}, {Qt::RightButton, BTN_RIGHT}, {Qt::MiddleButton, BTN_MIDDLE}, - {Qt::ExtraButton1, BTN_BACK}, // note: QtWayland maps BTN_SIDE + {Qt::ExtraButton1, BTN_BACK}, // note: QtWayland maps BTN_SIDE {Qt::ExtraButton2, BTN_FORWARD}, // note: QtWayland maps BTN_EXTRA - {Qt::ExtraButton3, BTN_TASK}, // note: QtWayland maps BTN_FORWARD - {Qt::ExtraButton4, BTN_EXTRA}, // note: QtWayland maps BTN_BACK - {Qt::ExtraButton5, BTN_SIDE}, // note: QtWayland maps BTN_TASK + {Qt::ExtraButton3, BTN_TASK}, // note: QtWayland maps BTN_FORWARD + {Qt::ExtraButton4, BTN_EXTRA}, // note: QtWayland maps BTN_BACK + {Qt::ExtraButton5, BTN_SIDE}, // note: QtWayland maps BTN_TASK {Qt::ExtraButton6, BTN_TASK + 1}, {Qt::ExtraButton7, BTN_TASK + 2}, {Qt::ExtraButton8, BTN_TASK + 3}, @@ -977,10 +652,6 @@ // further mapping not possible, 0x120 is BTN_JOYSTICK }); return s_buttons.value(button, 0); -#else - return 0; -#endif -} } bool SeatInterface::isPointerButtonPressed(Qt::MouseButton button) const @@ -990,118 +661,91 @@ bool SeatInterface::isPointerButtonPressed(quint32 button) const { - Q_D(); auto it = d->globalPointer.buttonStates.constFind(button); if (it == d->globalPointer.buttonStates.constEnd()) { return false; } - return it.value() == Private::Pointer::State::Pressed ? true : false; + return it.value() == SeatInterfacePrivate::Pointer::State::Pressed; } -void SeatInterface::pointerAxis(Qt::Orientation orientation, qint32 delta) +void SeatInterface::notifyPointerAxis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source) { - Q_D(); - if (d->drag.mode == Private::Drag::Mode::Pointer) { - // ignore + if (!d->pointer) { return; } - if (d->globalPointer.focus.surface) { - for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { - (*it)->axis(orientation, delta); - } - } -} - -void SeatInterface::pointerAxisToClient(Qt::Orientation orientation, qint32 delta, SurfaceInterface * surface, QMatrix4x4 matrix) -{ - Q_D(); - if (d->drag.mode == Private::Drag::Mode::Pointer) { + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { // ignore return; } - if (!surface) { - return; - } - const quint32 serial = d->display->nextSerial(); - QVector targetPoints = d->pointersForSurface(surface); - for (auto it = targetPoints.constBegin(), end = targetPoints.constEnd(); it != end; ++it) { - SurfaceInterface * sur = (*it)->focusedSurface(); - if (sur != surface) { - (*it)->setFocusedSurface(surface, serial, matrix); - } - (*it)->axis(orientation, delta); - (*it)->client()->flush(); - usleep(10000); - if ((*it) != focusedPointer()) { - (*it)->setFocusedSurface(nullptr, serial, matrix); - } - } + d->pointer->sendAxis(orientation, delta, discreteDelta, source); } -void SeatInterface::pointerButtonPressed(Qt::MouseButton button) +void SeatInterface::notifyPointerAxisToClient(Qt::Orientation orientation, qint32 delta, SurfaceInterface * surface, QMatrix4x4 matrix) { - const quint32 nativeButton = qtToWaylandButton(button); - if (nativeButton == 0) { + if (!d->pointer) { return; } - pointerButtonPressed(nativeButton); -} - -void SeatInterface::pointerButtonPressed(quint32 button) -{ - Q_D(); - const quint32 serial = d->display->nextSerial(); - d->updatePointerButtonSerial(button, serial); - d->updatePointerButtonState(button, Private::Pointer::State::Pressed); - if (d->drag.mode == Private::Drag::Mode::Pointer) { + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { // ignore - return; - } - if (d->globalPointer.focus.surface) { - for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { - (*it)->buttonPressed(button, serial); - } - if (d->globalPointer.focus.surface == d->keys.focus.surface) { - // update the focused child surface - auto p = focusedPointer(); - if (p) { - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->d_func()->focusChildSurface(p->d_func()->focusedChildSurface, serial); - } - } - } + return; + } + + const quint32 serial = d->display->nextSerial(); + const QPointF pos = matrix.map(pointerPos()); + SurfaceInterface * sur = d->pointer->focusedSurface(); + if (sur != surface) { + d->pointer->setFocusedSurface(surface, pos, serial); } + d->pointer->sendAxis(orientation, delta, 1, PointerAxisSource::Wheel); + usleep(10000); } -void SeatInterface::pointerButtonReleased(Qt::MouseButton button) +void SeatInterface::notifyPointerButton(Qt::MouseButton button, PointerButtonState state) { const quint32 nativeButton = qtToWaylandButton(button); if (nativeButton == 0) { return; } - pointerButtonReleased(nativeButton); + notifyPointerButton(nativeButton, state); } -void SeatInterface::pointerButtonReleased(quint32 button) +void SeatInterface::notifyPointerButton(quint32 button, PointerButtonState state) { - Q_D(); + if (!d->pointer) { + return; + } const quint32 serial = d->display->nextSerial(); - const quint32 currentButtonSerial = pointerButtonSerial(button); - d->updatePointerButtonSerial(button, serial); - d->updatePointerButtonState(button, Private::Pointer::State::Released); - if (d->drag.mode == Private::Drag::Mode::Pointer) { - if (d->drag.source->dragImplicitGrabSerial() != currentButtonSerial) { - // not our drag button - ignore + + if (state == PointerButtonState::Pressed) { + d->updatePointerButtonSerial(button, serial); + d->updatePointerButtonState(button, SeatInterfacePrivate::Pointer::State::Pressed); + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { + // ignore return; } - d->endDrag(serial); - return; - } - if (d->globalPointer.focus.surface) { - for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { - (*it)->buttonReleased(button, serial); + } else { + const quint32 currentButtonSerial = pointerButtonSerial(button); + d->updatePointerButtonSerial(button, serial); + d->updatePointerButtonState(button, SeatInterfacePrivate::Pointer::State::Released); + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer) { + if (d->drag.dragImplicitGrabSerial != currentButtonSerial) { + // not our drag button - ignore + return; + } + d->endDrag(serial); + return; } } + + d->pointer->sendButton(button, state, serial); +} + +void SeatInterface::notifyPointerFrame() +{ + if (!d->pointer) { + return; + } + d->pointer->sendFrame(); } quint32 SeatInterface::pointerButtonSerial(Qt::MouseButton button) const @@ -1111,7 +755,6 @@ quint32 SeatInterface::pointerButtonSerial(quint32 button) const { - Q_D(); auto it = d->globalPointer.buttonSerials.constFind(button); if (it == d->globalPointer.buttonSerials.constEnd()) { return 0; @@ -1121,540 +764,409 @@ void SeatInterface::relativePointerMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds) { - Q_D(); - if (d->globalPointer.focus.surface) { - for (auto it = d->globalPointer.focus.pointers.constBegin(), end = d->globalPointer.focus.pointers.constEnd(); it != end; ++it) { - (*it)->relativeMotion(delta, deltaNonAccelerated, microseconds); - } + if (!d->pointer) { + return; + } + + auto relativePointer = RelativePointerV1Interface::get(pointer()); + if (relativePointer) { + relativePointer->sendRelativeMotion(delta, deltaNonAccelerated, microseconds); } } void SeatInterface::startPointerSwipeGesture(quint32 fingerCount) { - Q_D(); - if (!d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - d->globalPointer.gestureSurface = QPointer(d->globalPointer.focus.surface); - if (d->globalPointer.gestureSurface.isNull()) { - return; + + auto swipeGesture = PointerSwipeGestureV1Interface::get(pointer()); + if (swipeGesture) { + swipeGesture->sendBegin(d->display->nextSerial(), fingerCount); } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial, fingerCount] (PointerInterface *p) { - p->d_func()->startSwipeGesture(serial, fingerCount); - } - ); } void SeatInterface::updatePointerSwipeGesture(const QSizeF &delta) { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [delta] (PointerInterface *p) { - p->d_func()->updateSwipeGesture(delta); - } - ); + + auto swipeGesture = PointerSwipeGestureV1Interface::get(pointer()); + if (swipeGesture) { + swipeGesture->sendUpdate(delta); + } } void SeatInterface::endPointerSwipeGesture() { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial] (PointerInterface *p) { - p->d_func()->endSwipeGesture(serial); - } - ); - d->globalPointer.gestureSurface.clear(); + + auto swipeGesture = PointerSwipeGestureV1Interface::get(pointer()); + if (swipeGesture) { + swipeGesture->sendEnd(d->display->nextSerial()); + } } void SeatInterface::cancelPointerSwipeGesture() { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial] (PointerInterface *p) { - p->d_func()->cancelSwipeGesture(serial); - } - ); - d->globalPointer.gestureSurface.clear(); + + auto swipeGesture = PointerSwipeGestureV1Interface::get(pointer()); + if (swipeGesture) { + swipeGesture->sendCancel(d->display->nextSerial()); + } } void SeatInterface::startPointerPinchGesture(quint32 fingerCount) { - Q_D(); - if (!d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - d->globalPointer.gestureSurface = QPointer(d->globalPointer.focus.surface); - if (d->globalPointer.gestureSurface.isNull()) { - return; + + auto pinchGesture = PointerPinchGestureV1Interface::get(pointer()); + if (pinchGesture) { + pinchGesture->sendBegin(d->display->nextSerial(), fingerCount); } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial, fingerCount] (PointerInterface *p) { - p->d_func()->startPinchGesture(serial, fingerCount); - } - ); } void SeatInterface::updatePointerPinchGesture(const QSizeF &delta, qreal scale, qreal rotation) { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [delta, scale, rotation] (PointerInterface *p) { - p->d_func()->updatePinchGesture(delta, scale, rotation); - } - ); + + auto pinchGesture = PointerPinchGestureV1Interface::get(pointer()); + if (pinchGesture) { + pinchGesture->sendUpdate(delta, scale, rotation); + } } void SeatInterface::endPointerPinchGesture() { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial] (PointerInterface *p) { - p->d_func()->endPinchGesture(serial); - } - ); - d->globalPointer.gestureSurface.clear(); + + auto pinchGesture = PointerPinchGestureV1Interface::get(pointer()); + if (pinchGesture) { + pinchGesture->sendEnd(d->display->nextSerial()); + } } void SeatInterface::cancelPointerPinchGesture() { - Q_D(); - if (d->globalPointer.gestureSurface.isNull()) { + if (!d->pointer) { return; } - const quint32 serial = d->display->nextSerial(); - forEachInterface(d->globalPointer.gestureSurface.data(), d->pointers, - [serial] (PointerInterface *p) { - p->d_func()->cancelPinchGesture(serial); - } - ); - d->globalPointer.gestureSurface.clear(); + + auto pinchGesture = PointerPinchGestureV1Interface::get(pointer()); + if (pinchGesture) { + pinchGesture->sendCancel(d->display->nextSerial()); + } } -void SeatInterface::keyPressed(quint32 key) +void SeatInterface::startPointerHoldGesture(quint32 fingerCount) { - Q_D(); - d->keys.lastStateSerial = d->display->nextSerial(); - if (!d->updateKey(key, Private::Keyboard::State::Pressed)) { + if (!d->pointer) { return; } - if (d->keys.focus.surface) { - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->keyPressed(key, d->keys.lastStateSerial); - } + + auto holdGesture = PointerHoldGestureV1Interface::get(pointer()); + if (holdGesture) { + holdGesture->sendBegin(d->display->nextSerial(), fingerCount); } } -void SeatInterface::keyReleased(quint32 key) +void SeatInterface::endPointerHoldGesture() { - Q_D(); - d->keys.lastStateSerial = d->display->nextSerial(); - if (!d->updateKey(key, Private::Keyboard::State::Released)) { + if (!d->pointer) { return; } - if (d->keys.focus.surface) { - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->keyReleased(key, d->keys.lastStateSerial); - } + + auto holdGesture = PointerHoldGestureV1Interface::get(pointer()); + if (holdGesture) { + holdGesture->sendEnd(d->display->nextSerial()); + } +} + +void SeatInterface::cancelPointerHoldGesture() +{ + if (!d->pointer) { + return; + } + + auto holdGesture = PointerHoldGestureV1Interface::get(pointer()); + if (holdGesture) { + holdGesture->sendCancel(d->display->nextSerial()); } } SurfaceInterface *SeatInterface::focusedKeyboardSurface() const { - Q_D(); - return d->keys.focus.surface; + return d->globalKeyboard.focus.surface; } void SeatInterface::setFocusedKeyboardSurface(SurfaceInterface *surface) { - Q_D(); - const quint32 serial = d->display->nextSerial(); - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->setFocusedSurface(nullptr, serial); + if (!d->keyboard) { + return; } - if (d->keys.focus.surface) { - disconnect(d->keys.focus.destroyConnection); + + const quint32 serial = d->display->nextSerial(); + + if (d->globalKeyboard.focus.surface) { + disconnect(d->globalKeyboard.focus.destroyConnection); } - d->keys.focus = Private::Keyboard::Focus(); - d->keys.focus.surface = surface; - d->keys.focus.keyboards = d->keyboardsForSurface(surface); - if (d->keys.focus.surface) { - d->keys.focus.destroyConnection = connect(surface, &QObject::destroyed, this, - [this] { - Q_D(); - d->keys.focus = Private::Keyboard::Focus(); - } - ); - d->keys.focus.serial = serial; + d->globalKeyboard.focus = SeatInterfacePrivate::Keyboard::Focus(); + d->globalKeyboard.focus.surface = surface; + + d->keyboard->setFocusedSurface(surface, serial); + + if (d->globalKeyboard.focus.surface) { + d->globalKeyboard.focus.destroyConnection = connect(surface, &QObject::destroyed, this, [this]() { + d->globalKeyboard.focus = SeatInterfacePrivate::Keyboard::Focus(); + }); + d->globalKeyboard.focus.serial = serial; // selection? - d->keys.focus.selection = d->dataDeviceForSurface(surface); - if (d->keys.focus.selection) { + const QVector dataDevices = d->dataDevicesForSurface(surface); + d->globalKeyboard.focus.selections = dataDevices; + for (auto dataDevice : dataDevices) { if (d->currentSelection) { - d->keys.focus.selection->sendSelection(d->currentSelection); + dataDevice->sendSelection(d->currentSelection); } else { - d->keys.focus.selection->sendClearSelection(); + dataDevice->sendClearSelection(); } } - } - - // primary selection - QVector primarySelectionDevices; - for (auto it = d->primarySelectionDevices.constBegin(); it != d->primarySelectionDevices.constEnd(); ++it) { - if (surface && ((*it)->client() == surface->client())) { - primarySelectionDevices << *it; + // primary selection + QVector primarySelectionDevices; + for (auto it = d->primarySelectionDevices.constBegin(); it != d->primarySelectionDevices.constEnd(); ++it) { + if ((*it)->client() == *surface->client()) { + primarySelectionDevices << *it; + } } - } - d->keys.focus.primarySelections = primarySelectionDevices; - for (auto primaryDataDevice : primarySelectionDevices) { - if (d->currentPrimarySelection) { - primaryDataDevice->sendSelection(d->currentPrimarySelection); - } else { - primaryDataDevice->sendClearSelection(); + + d->globalKeyboard.focus.primarySelections = primarySelectionDevices; + for (auto primaryDataDevice : primarySelectionDevices) { + if (d->currentPrimarySelection) { + primaryDataDevice->sendSelection(d->currentPrimarySelection); + } else { + primaryDataDevice->sendClearSelection(); + } } } - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->setFocusedSurface(surface, serial); - } + // focused text input surface follows keyboard if (hasKeyboard()) { setFocusedTextInputSurface(surface); } } -void SeatInterface::setKeymap(int fd, quint32 size) +KeyboardInterface *SeatInterface::keyboard() const { - Q_D(); - d->keys.keymap.xkbcommonCompatible = true; - d->keys.keymap.fd = fd; - d->keys.keymap.size = size; - for (auto it = d->keyboards.constBegin(); it != d->keyboards.constEnd(); ++it) { - (*it)->setKeymap(fd, size); - } -} - -void SeatInterface::updateKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) -{ - Q_D(); - bool changed = false; -#define UPDATE( value ) \ - if (d->keys.modifiers.value != value) { \ - d->keys.modifiers.value = value; \ - changed = true; \ - } - UPDATE(depressed) - UPDATE(latched) - UPDATE(locked) - UPDATE(group) - if (!changed) { - return; - } - const quint32 serial = d->display->nextSerial(); - d->keys.modifiers.serial = serial; - if (d->keys.focus.surface) { - for (auto it = d->keys.focus.keyboards.constBegin(), end = d->keys.focus.keyboards.constEnd(); it != end; ++it) { - (*it)->updateModifiers(depressed, latched, locked, group, serial); - } - } + return d->keyboard.data(); } -void SeatInterface::setKeyRepeatInfo(qint32 charactersPerSecond, qint32 delay) +void SeatInterface::notifyKeyboardKey(quint32 keyCode, KeyboardKeyState state) { - Q_D(); - d->keys.keyRepeat.charactersPerSecond = qMax(charactersPerSecond, 0); - d->keys.keyRepeat.delay = qMax(delay, 0); - for (auto it = d->keyboards.constBegin(); it != d->keyboards.constEnd(); ++it) { - (*it)->repeatInfo(d->keys.keyRepeat.charactersPerSecond, d->keys.keyRepeat.delay); + if (!d->keyboard) { + return; } + d->keyboard->sendKey(keyCode, state); } -qint32 SeatInterface::keyRepeatDelay() const -{ - Q_D(); - return d->keys.keyRepeat.delay; -} - -qint32 SeatInterface::keyRepeatRate() const -{ - Q_D(); - return d->keys.keyRepeat.charactersPerSecond; -} - -bool SeatInterface::isKeymapXkbCompatible() const -{ - Q_D(); - return d->keys.keymap.xkbcommonCompatible; -} - -int SeatInterface::keymapFileDescriptor() const -{ - Q_D(); - return d->keys.keymap.fd; -} - -quint32 SeatInterface::keymapSize() const -{ - Q_D(); - return d->keys.keymap.size; -} - -quint32 SeatInterface::depressedModifiers() const -{ - Q_D(); - return d->keys.modifiers.depressed; -} - -quint32 SeatInterface::groupModifiers() const -{ - Q_D(); - return d->keys.modifiers.group; -} - -quint32 SeatInterface::latchedModifiers() const -{ - Q_D(); - return d->keys.modifiers.latched; -} - -quint32 SeatInterface::lockedModifiers() const -{ - Q_D(); - return d->keys.modifiers.locked; -} - -quint32 SeatInterface::lastModifiersSerial() const -{ - Q_D(); - return d->keys.modifiers.serial; -} - -QVector< quint32 > SeatInterface::pressedKeys() const +void SeatInterface::notifyKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) { - Q_D(); - QVector keys; - for (auto it = d->keys.states.begin(); it != d->keys.states.end(); ++it) { - if (it.value() == Private::Keyboard::State::Pressed) { - keys << it.key(); - } + if (!d->keyboard) { + return; } - return keys; + d->keyboard->sendModifiers(depressed, latched, locked, group); } -KeyboardInterface *SeatInterface::focusedKeyboard() const +void SeatInterface::notifyTouchCancel() { - Q_D(); - if (d->keys.focus.keyboards.isEmpty()) { - return nullptr; + if (!d->touch) { + return; } - return d->keys.focus.keyboards.first(); -} + d->touch->sendCancel(); -void SeatInterface::cancelTouchSequence() -{ - Q_D(); - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->cancel(); - } - if (d->drag.mode == Private::Drag::Mode::Touch) { - // cancel the drag, don't drop. - if (d->drag.target) { - // remove the current target - d->drag.target->updateDragTarget(nullptr, 0); - d->drag.target = nullptr; - } - // and end the drag for the source, serial does not matter - d->endDrag(0); + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Touch) { + // cancel the drag, don't drop. serial does not matter + d->cancelDrag(0); } d->globalTouch.ids.clear(); } -TouchInterface *SeatInterface::focusedTouch() const -{ - Q_D(); - if (d->globalTouch.focus.touchs.isEmpty()) { - return nullptr; - } - return d->globalTouch.focus.touchs.first(); -} - SurfaceInterface *SeatInterface::focusedTouchSurface() const { - Q_D(); return d->globalTouch.focus.surface; } QPointF SeatInterface::focusedTouchSurfacePosition() const { - Q_D(); return d->globalTouch.focus.offset; } bool SeatInterface::isTouchSequence() const { - Q_D(); return !d->globalTouch.ids.isEmpty(); } +TouchInterface *SeatInterface::touch() const +{ + return d->touch.data(); +} + +QPointF SeatInterface::firstTouchPointPosition() const +{ + return d->globalTouch.focus.firstTouchPos; +} + void SeatInterface::setFocusedTouchSurface(SurfaceInterface *surface, const QPointF &surfacePosition) { + if (!d->touch) { + return; + } if (isTouchSequence()) { // changing surface not allowed during a touch sequence return; } - Q_ASSERT(!isDragTouch()); - Q_D(); + if (isDragTouch()) { + return; + } if (d->globalTouch.focus.surface) { disconnect(d->globalTouch.focus.destroyConnection); } - d->globalTouch.focus = Private::Touch::Focus(); + d->globalTouch.focus = SeatInterfacePrivate::Touch::Focus(); d->globalTouch.focus.surface = surface; - d->globalTouch.focus.offset = surfacePosition; - d->globalTouch.focus.touchs = d->touchsForSurface(surface); + setFocusedTouchSurfacePosition(surfacePosition); + if (d->globalTouch.focus.surface) { - d->globalTouch.focus.destroyConnection = connect(surface, &QObject::destroyed, this, - [this] { - Q_D(); - if (isTouchSequence()) { - // Surface destroyed during touch sequence - send a cancel - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->cancel(); - } - } - d->globalTouch.focus = Private::Touch::Focus(); + d->globalTouch.focus.destroyConnection = connect(surface, &QObject::destroyed, this, [this]() { + if (isTouchSequence()) { + // Surface destroyed during touch sequence - send a cancel + d->touch->sendCancel(); } - ); + d->globalTouch.focus = SeatInterfacePrivate::Touch::Focus(); + }); } + d->touch->setFocusedSurface(surface); } void SeatInterface::setFocusedTouchSurfacePosition(const QPointF &surfacePosition) { - Q_D(); d->globalTouch.focus.offset = surfacePosition; + d->globalTouch.focus.transformation = QMatrix4x4(); + d->globalTouch.focus.transformation.translate(-surfacePosition.x(), -surfacePosition.y()); } -qint32 SeatInterface::touchDown(const QPointF &globalPosition) +void SeatInterface::notifyTouchDown(qint32 id, const QPointF &globalPosition) { - Q_D(); - const qint32 id = d->globalTouch.ids.isEmpty() ? 0 : d->globalTouch.ids.last() + 1; + if (!d->touch) { + return; + } const qint32 serial = display()->nextSerial(); const auto pos = globalPosition - d->globalTouch.focus.offset; - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->down(id, serial, pos); - } + d->touch->sendDown(id, serial, pos); if (id == 0) { d->globalTouch.focus.firstTouchPos = globalPosition; } -#if HAVE_LINUX_INPUT_H - if (id == 0 && d->globalTouch.focus.touchs.isEmpty()) { - // If the client did not bind the touch interface fall back - // to at least emulating touch through pointer events. - forEachInterface(focusedTouchSurface(), d->pointers, - [this, pos, serial] (PointerInterface *p) { - wl_pointer_send_enter(p->resource(), serial, - focusedTouchSurface()->resource(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); - wl_pointer_send_motion(p->resource(), timestamp(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); - - wl_pointer_send_button(p->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); - p->d_func()->sendFrame(); - } - ); + if (id == 0 && hasPointer() && focusedTouchSurface()) { + TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data()); + if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) { + // If the client did not bind the touch interface fall back + // to at least emulating touch through pointer events. + d->pointer->setFocusedSurface(focusedTouchSurface(), pos, serial); + d->pointer->sendMotion(pos); + d->pointer->sendFrame(); + } } -#endif d->globalTouch.ids[id] = serial; - return id; } -void SeatInterface::touchMove(qint32 id, const QPointF &globalPosition) +void SeatInterface::notifyTouchMotion(qint32 id, const QPointF &globalPosition) { - Q_D(); - Q_ASSERT(d->globalTouch.ids.contains(id)); + if (!d->touch) { + return; + } + auto itTouch = d->globalTouch.ids.constFind(id); + if (itTouch == d->globalTouch.ids.constEnd()) { + // This can happen in cases where the interaction started while the device was asleep + qCWarning(KWAYLAND_SERVER) << "Detected a touch move that never has been down, discarding"; + return; + } + const auto pos = globalPosition - d->globalTouch.focus.offset; - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->move(id, pos); + if (isDragTouch()) { + // handled by DataDevice + } else { + d->touch->sendMotion(id, pos); } if (id == 0) { d->globalTouch.focus.firstTouchPos = globalPosition; - } - if (id == 0 && d->globalTouch.focus.touchs.isEmpty()) { - // Client did not bind touch, fall back to emulating with pointer events. - forEachInterface(focusedTouchSurface(), d->pointers, - [this, pos] (PointerInterface *p) { - wl_pointer_send_motion(p->resource(), timestamp(), - wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); + if (hasPointer() && focusedTouchSurface()) { + TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data()); + if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) { + // Client did not bind touch, fall back to emulating with pointer events. + d->pointer->sendMotion(pos); + d->pointer->sendFrame(); } - ); + } } - emit touchMoved(id, d->globalTouch.ids[id], globalPosition); + Q_EMIT touchMoved(id, *itTouch, globalPosition); } -void SeatInterface::touchUp(qint32 id) +void SeatInterface::notifyTouchUp(qint32 id) { - Q_D(); - Q_ASSERT(d->globalTouch.ids.contains(id)); - const qint32 serial = display()->nextSerial(); - if (d->drag.mode == Private::Drag::Mode::Touch && - d->drag.source->dragImplicitGrabSerial() == d->globalTouch.ids.value(id)) { - // the implicitly grabbing touch point has been upped - d->endDrag(serial); - d->globalTouch.ids.remove(id); + if (!d->touch) { + return; + } + + auto itTouch = d->globalTouch.ids.find(id); + if (itTouch == d->globalTouch.ids.end()) { + // This can happen in cases where the interaction started while the device was asleep + qCWarning(KWAYLAND_SERVER) << "Detected a touch that never started, discarding"; return; } - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->up(id, serial); + const qint32 serial = d->display->nextSerial(); + if (d->drag.mode == SeatInterfacePrivate::Drag::Mode::Touch && d->drag.dragImplicitGrabSerial == d->globalTouch.ids.value(id)) { + // the implicitly grabbing touch point has been upped + d->endDrag(serial); } + d->touch->sendUp(id, serial); -#if HAVE_LINUX_INPUT_H - if (id == 0 && d->globalTouch.focus.touchs.isEmpty()) { - // Client did not bind touch, fall back to emulating with pointer events. - const quint32 serial = display()->nextSerial(); - forEachInterface(focusedTouchSurface(), d->pointers, - [this, serial] (PointerInterface *p) { - wl_pointer_send_button(p->resource(), serial, timestamp(), BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); - } - ); + if (id == 0 && hasPointer() && focusedTouchSurface()) { + TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.data()); + if (touchPrivate->touchesForClient(focusedTouchSurface()->client()).isEmpty()) { + // Client did not bind touch, fall back to emulating with pointer events. + const quint32 serial = display()->nextSerial(); + d->pointer->sendButton(BTN_LEFT, PointerButtonState::Released, serial); + d->pointer->sendFrame(); + } } -#endif - d->globalTouch.ids.remove(id); + d->globalTouch.ids.erase(itTouch); } -void SeatInterface::touchFrame() +void SeatInterface::notifyTouchFrame() { - Q_D(); - for (auto it = d->globalTouch.focus.touchs.constBegin(), end = d->globalTouch.focus.touchs.constEnd(); it != end; ++it) { - (*it)->frame(); + if (!d->touch) { + return; } + d->touch->sendFrame(); } bool SeatInterface::hasImplicitTouchGrab(quint32 serial) const { - Q_D(); if (!d->globalTouch.focus.surface) { // origin surface has been destroyed return false; @@ -1664,27 +1176,23 @@ bool SeatInterface::isDrag() const { - Q_D(); - return d->drag.mode != Private::Drag::Mode::None; + return d->drag.mode != SeatInterfacePrivate::Drag::Mode::None; } bool SeatInterface::isDragPointer() const { - Q_D(); - return d->drag.mode == Private::Drag::Mode::Pointer; + return d->drag.mode == SeatInterfacePrivate::Drag::Mode::Pointer; } bool SeatInterface::isDragTouch() const { - Q_D(); - return d->drag.mode == Private::Drag::Mode::Touch; + return d->drag.mode == SeatInterfacePrivate::Drag::Mode::Touch; } bool SeatInterface::hasImplicitPointerGrab(quint32 serial) const { - Q_D(); const auto &serials = d->globalPointer.buttonSerials; - for (auto it = serials.begin(), end = serials.end(); it != end; it++) { + for (auto it = serials.constBegin(), end = serials.constEnd(); it != end; it++) { if (it.value() == serial) { return isPointerButtonPressed(it.key()); } @@ -1694,120 +1202,206 @@ QMatrix4x4 SeatInterface::dragSurfaceTransformation() const { - Q_D(); return d->drag.transformation; } SurfaceInterface *SeatInterface::dragSurface() const { - Q_D(); return d->drag.surface; } -PointerInterface *SeatInterface::dragPointer() const -{ - Q_D(); - if (d->drag.mode != Private::Drag::Mode::Pointer) { - return nullptr; - } - - return d->drag.sourcePointer; -} - -DataDeviceInterface *SeatInterface::dragSource() const +AbstractDataSource *SeatInterface::dragSource() const { - Q_D(); return d->drag.source; } void SeatInterface::setFocusedTextInputSurface(SurfaceInterface *surface) { - Q_D(); const quint32 serial = d->display->nextSerial(); - const auto old = d->textInput.focus.textInput; - if (d->textInput.focus.textInput) { - // TODO: setFocusedSurface like in other interfaces - d->textInput.focus.textInput->d_func()->sendLeave(serial, d->textInput.focus.surface); - } - if (d->textInput.focus.surface) { - disconnect(d->textInput.focus.destroyConnection); - } - d->textInput.focus = Private::TextInput::Focus(); - d->textInput.focus.surface = surface; - TextInputInterface *t = d->textInputForSurface(surface); - if (t && !t->resource()) { - t = nullptr; - } - d->textInput.focus.textInput = t; - if (d->textInput.focus.surface) { - d->textInput.focus.destroyConnection = connect(surface, &Resource::aboutToBeUnbound, this, - [this] { - setFocusedTextInputSurface(nullptr); - } - ); - d->textInput.focus.serial = serial; + + if (d->focusedTextInputSurface == surface) { + return; } - if (t) { - // TODO: setFocusedSurface like in other interfaces - t->d_func()->sendEnter(surface, serial); + + if (d->focusedTextInputSurface) { + disconnect(d->focusedSurfaceDestroyConnection); + d->textInputV2->d->sendLeave(serial, d->focusedTextInputSurface); + d->textInputV3->d->sendLeave(d->focusedTextInputSurface); } - if (old != t) { - emit focusedTextInputChanged(); + d->focusedTextInputSurface = surface; + Q_EMIT focusedTextInputSurfaceChanged(); + + if (surface) { + d->focusedSurfaceDestroyConnection = connect(surface, &SurfaceInterface::aboutToBeDestroyed, this, [this] { + setFocusedTextInputSurface(nullptr); + }); + d->textInputV2->d->sendEnter(surface, serial); + d->textInputV3->d->sendEnter(surface); } } SurfaceInterface *SeatInterface::focusedTextInputSurface() const { - Q_D(); - return d->textInput.focus.surface; + return d->focusedTextInputSurface; } -TextInputInterface *SeatInterface::focusedTextInput() const +TextInputV2Interface *SeatInterface::textInputV2() const { - Q_D(); - return d->textInput.focus.textInput; + return d->textInputV2; } +TextInputV3Interface *SeatInterface::textInputV3() const +{ + return d->textInputV3; +} AbstractDataSource *SeatInterface::selection() const { - Q_D(); return d->currentSelection; } -AbstractDataSource *SeatInterface::primarySelection() const +void SeatInterface::updateCachedSelection(AbstractDataSource *selection) { - Q_D(); - return d->currentPrimarySelection; + if (d->currentCachedSelection == selection) { + return; + } + + if (d->currentCachedSelection) { + d->currentCachedSelection->cancel(); + disconnect(d->currentCachedSelection, nullptr, this, nullptr); + } + + if (selection) { + auto cleanup = [this]() { + updateCachedSelection(nullptr); + }; + connect(selection, &AbstractDataSource::aboutToBeDestroyed, this, cleanup); + } + + d->currentCachedSelection = selection; } -void SeatInterface::setSelection(AbstractDataSource *dataSource) +void SeatInterface::setSelection(AbstractDataSource *selection) { - Q_D(); - - if (d->currentSelection == dataSource) { + if (d->currentSelection == selection) { return; } - // cancel the previous selection - d->cancelPreviousSelection(dataSource); - d->currentSelection = dataSource; - if (d->keys.focus.selection) { - if (dataSource) { - d->keys.focus.selection->sendSelection(dataSource); + + if (d->currentSelection) { + d->currentSelection->cancel(); + disconnect(d->currentSelection, nullptr, this, nullptr); + } + + if (selection) { + auto cleanup = [this]() { + setSelection(nullptr); + }; + connect(selection, &AbstractDataSource::aboutToBeDestroyed, this, cleanup); + } + + d->currentSelection = selection; + + if (!d->currentSelection && d->currentCachedSelection) { + d->currentSelection = d->currentCachedSelection; + } + + for (auto focussedSelection : qAsConst(d->globalKeyboard.focus.selections)) { + if (d->currentSelection) { + focussedSelection->sendSelection(d->currentSelection); } else { - d->keys.focus.selection->sendClearSelection(); + focussedSelection->sendClearSelection(); } } for (auto control : qAsConst(d->dataControlDevices)) { - if (dataSource) { - control->sendSelection(dataSource); + if (selection) { + control->sendSelection(selection); } else { control->sendClearSelection(); } } - emit selectionChanged(dataSource); + Q_EMIT selectionChanged(selection); +} + +AbstractDataSource *SeatInterface::primarySelection() const +{ + return d->currentPrimarySelection; +} + +void SeatInterface::setPrimarySelection(AbstractDataSource *selection) +{ + if (d->currentPrimarySelection == selection) { + return; + } + if (d->currentPrimarySelection) { + d->currentPrimarySelection->cancel(); + disconnect(d->currentPrimarySelection, nullptr, this, nullptr); + } + + if (selection) { + auto cleanup = [this]() { + setPrimarySelection(nullptr); + }; + connect(selection, &AbstractDataSource::aboutToBeDestroyed, this, cleanup); + } + + d->currentPrimarySelection = selection; + + for (auto focussedSelection : qAsConst(d->globalKeyboard.focus.primarySelections)) { + if (selection) { + focussedSelection->sendSelection(selection); + } else { + focussedSelection->sendClearSelection(); + } + } + for (auto control : qAsConst(d->dataControlDevices)) { + if (selection) { + control->sendPrimarySelection(selection); + } else { + control->sendClearPrimarySelection(); + } + } + + Q_EMIT primarySelectionChanged(selection); +} + +void SeatInterface::startDrag(AbstractDataSource *dragSource, SurfaceInterface *originSurface, int dragSerial, DragAndDropIcon *dragIcon) +{ + if (hasImplicitPointerGrab(dragSerial)) { + d->drag.mode = SeatInterfacePrivate::Drag::Mode::Pointer; + d->drag.transformation = d->globalPointer.focus.transformation; + } else if (hasImplicitTouchGrab(dragSerial)) { + d->drag.mode = SeatInterfacePrivate::Drag::Mode::Touch; + d->drag.transformation = d->globalTouch.focus.transformation; + } else { + // no implicit grab, abort drag + return; + } + d->drag.dragImplicitGrabSerial = dragSerial; + + // set initial drag target to ourself + d->drag.surface = originSurface; + + d->drag.source = dragSource; + if (dragSource) { + d->drag.dragSourceDestroyConnection = QObject::connect(dragSource, &AbstractDataSource::aboutToBeDestroyed, this, [this] { + d->cancelDrag(d->display->nextSerial()); + }); + } + d->drag.dragIcon = dragIcon; + + if (!d->dataDevicesForSurface(originSurface).isEmpty()) { + d->drag.target = d->dataDevicesForSurface(originSurface)[0]; + } + if (d->drag.target) { + d->drag.target->updateDragTarget(originSurface, dragSerial); + } + Q_EMIT dragStarted(); + Q_EMIT dragSurfaceChanged(); } +DragAndDropIcon *SeatInterface::dragIcon() const +{ + return d->drag.dragIcon; } } diff -Nru dwayland-5.57.0.23/src/server/seat_interface.h dwayland-5.57.0.24+really5.24.3/src/server/seat_interface.h --- dwayland-5.57.0.23/src/server/seat_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/seat_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,51 +1,78 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SEAT_INTERFACE_H -#define WAYLAND_SERVER_SEAT_INTERFACE_H +#include +#include #include #include -#include - -#include -#include "global.h" -#include "keyboard_interface.h" -#include "pointer_interface.h" -#include "touch_interface.h" struct wl_client; struct wl_resource; -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - +class AbstractDataSource; +class AbstractDropHandler; +class DragAndDropIcon; class DataDeviceInterface; class Display; +class KeyboardInterface; +class PointerInterface; +class SeatInterfacePrivate; class SurfaceInterface; -class TextInputInterface; -class PrimarySelectionDeviceV1Interface; -class PrimarySelectionSourceV1Interface; -class DataControlDeviceV1Interface; -class AbstractDataSource; +class TextInputV2Interface; +class TextInputV3Interface; +class TouchInterface; + +/** + * Describes the source types for axis events. This indicates to the + * client how an axis event was physically generated; a client may + * adjust the user interface accordingly. For example, scroll events + * from a "finger" source may be in a smooth coordinate space with + * kinetic scrolling whereas a "wheel" source may be in discrete steps + * of a number of lines. + * + * The "continuous" axis source is a device generating events in a + * continuous coordinate space, but using something other than a + * finger. One example for this source is button-based scrolling where + * the vertical motion of a device is converted to scroll events while + * a button is held down. + * + * The "wheel tilt" axis source indicates that the actual device is a + * wheel but the scroll event is not caused by a rotation but a + * (usually sideways) tilt of the wheel. + */ +enum class PointerAxisSource { + Unknown, + Wheel, + Finger, + Continuous, + WheelTilt, +}; + +/** + * This enum type is used to describe the state of a pointer button. It + * is equivalent to the @c wl_pointer.button_state enum. + */ +enum class PointerButtonState : quint32 { + Released = 0, + Pressed = 1, +}; + +/** + * This enum type is used to describe the state of a keyboard key. It is + * equivalent to the @c wl_keyboard.key_state enum. + */ +enum class KeyboardKeyState : quint32 { + Released = 0, + Pressed = 1, +}; /** * @brief Represents a Seat on the Wayland Display. @@ -79,53 +106,58 @@ * // example for pointer * seat->setFocusedPointerSurface(surface, QPointF(100, 200)); // surface at it's global position * seat->setTimestamp(100); - * seat->setPointerPos(QPointF(350, 210)); // global pos, local pos in surface: 250,10 + * seat->notifyPointerMotion(QPointF(350, 210)); // global pos, local pos in surface: 250,10 + * seat->notifyPointerFrame(); * seat->setTimestamp(110); - * seat->pointerButtonPressed(Qt::LeftButton); + * seat->notifyPointerButton(Qt::LeftButton, PointerButtonState::Pressed); + * seat->notifyPointerFrame(); * seat->setTimestamp(120); - * seat->pointerButtonReleased(Qt::LeftButton); + * seat->notifyPointerButton(Qt::LeftButton, PointerButtonState::Released); + * seat->notifyPointerFrame(); * @endcode * * @see KeyboardInterface * @see PointerInterface * @see TouchInterface * @see SurfaceInterface - **/ -class KWAYLANDSERVER_EXPORT SeatInterface : public Global + */ +class KWAYLANDSERVER_EXPORT SeatInterface : public QObject { Q_OBJECT /** * The name of the Seat - **/ + */ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) /** * Whether the SeatInterface supports a pointer device. - **/ + */ Q_PROPERTY(bool pointer READ hasPointer WRITE setHasPointer NOTIFY hasPointerChanged) /** * Whether the SeatInterface supports a keyboard device. - **/ + */ Q_PROPERTY(bool keyboard READ hasKeyboard WRITE setHasKeyboard NOTIFY hasKeyboardChanged) /** * Whether the SeatInterface supports a touch device. - * @deprecated use touch - **/ + * @deprecated Since 5.5, use touch + */ Q_PROPERTY(bool tourch READ hasTouch WRITE setHasTouch NOTIFY hasTouchChanged) /** * Whether the SeatInterface supports a touch device. - **/ + */ Q_PROPERTY(bool touch READ hasTouch WRITE setHasTouch NOTIFY hasTouchChanged) /** * The global pointer position. - **/ - Q_PROPERTY(QPointF pointerPos READ pointerPos WRITE setPointerPos NOTIFY pointerPosChanged) + */ + Q_PROPERTY(QPointF pointerPos READ pointerPos WRITE notifyPointerMotion NOTIFY pointerPosChanged) /** * The current timestamp passed to the input events. - **/ + */ Q_PROPERTY(quint32 timestamp READ timestamp WRITE setTimestamp NOTIFY timestampChanged) public: + explicit SeatInterface(Display *display, QObject *parent = nullptr); virtual ~SeatInterface(); + Display *display() const; QString name() const; bool hasPointer() const; bool hasKeyboard() const; @@ -141,87 +173,75 @@ /** * @name Drag'n'Drop related methods - **/ + */ ///@{ /** * @returns whether there is currently a drag'n'drop going on. - * @since 5.6 * @see isDragPointer * @see isDragTouch * @see dragStarted * @see dragEnded - **/ + */ bool isDrag() const; /** * @returns whether the drag'n'drop is operated through the pointer device - * @since 5.6 * @see isDrag * @see isDragTouch - **/ + */ bool isDragPointer() const; /** * @returns whether the drag'n'drop is operated through the touch device - * @since 5.6 * @see isDrag * @see isDragPointer - **/ + */ bool isDragTouch() const; /** * @returns The transformation applied to go from global to local coordinates for drag motion events. * @see dragSurfaceTransformation - * @since 5.6 - **/ + */ QMatrix4x4 dragSurfaceTransformation() const; /** * @returns The currently focused Surface for drag motion events. - * @since 5.6 * @see dragSurfaceTransformation * @see dragSurfaceChanged - **/ + */ SurfaceInterface *dragSurface() const; /** - * @returns The PointerInterface which triggered the drag operation - * @since 5.6 - * @see isDragPointer - **/ - PointerInterface *dragPointer() const; - /** * @returns The DataDeviceInterface which started the drag and drop operation. * @see isDrag - * @since 5.6 - **/ - DataDeviceInterface *dragSource() const; + */ + KWaylandServer::AbstractDataSource *dragSource() const; /** * Sets the current drag target to @p surface. * * Sends a drag leave event to the current target and an enter event to @p surface. * The enter position is derived from @p globalPosition and transformed by @p inputTransformation. - * @since 5.6 - **/ - void setDragTarget(SurfaceInterface *surface, const QPointF &globalPosition, const QMatrix4x4 &inputTransformation); + */ + void setDragTarget(AbstractDropHandler *dropTarget, SurfaceInterface *surface, const QPointF &globalPosition, const QMatrix4x4 &inputTransformation); /** * Sets the current drag target to @p surface. * * Sends a drag leave event to the current target and an enter event to @p surface. * The enter position is derived from current global position and transformed by @p inputTransformation. - * @since 5.6 - **/ - void setDragTarget(SurfaceInterface *surface, const QMatrix4x4 &inputTransformation = QMatrix4x4()); + */ + void setDragTarget(AbstractDropHandler *dropTarget, SurfaceInterface *surface, const QMatrix4x4 &inputTransformation = QMatrix4x4()); ///@} + AbstractDropHandler *dropHandlerForSurface(SurfaceInterface *surface) const; + /** * @name Pointer related methods - **/ + */ ///@{ /** * Updates the global pointer @p pos. * * Sends a pointer motion event to the focused pointer surface. - **/ - void setPointerPos(const QPointF &pos); + */ + void notifyPointerMotion(const QPointF &pos); /** * @returns the global pointer position - **/ + */ QPointF pointerPos() const; /** * Sets the focused pointer @p surface. @@ -248,7 +268,7 @@ * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfaceTransformation * @see focusedPointerSurfaceTransformation - **/ + */ void setFocusedPointerSurface(SurfaceInterface *surface, const QPointF &surfacePosition = QPoint()); /** * Sets the focused pointer @p surface. @@ -272,19 +292,14 @@ * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfaceTransformation * @see focusedPointerSurfaceTransformation - * @since 5.6 - **/ + */ void setFocusedPointerSurface(SurfaceInterface *surface, const QMatrix4x4 &transformation); /** * @returns The currently focused pointer surface, that is the surface receiving pointer events. * @see setFocusedPointerSurface - **/ + */ SurfaceInterface *focusedPointerSurface() const; - /** - * @returns The PointerInterface belonging to the focused pointer surface, if any. - * @see setFocusedPointerSurface - **/ - PointerInterface *focusedPointer() const; + PointerInterface *pointer() const; /** * Updates the global position of the currently focused pointer surface. * @@ -298,14 +313,14 @@ * @see setFocusedPointerSurface * @see focusedPointerSurfaceTransformation * @see setFocusedPointerSurfaceTransformation - **/ + */ void setFocusedPointerSurfacePosition(const QPointF &surfacePosition); /** * @returns The position of the focused pointer surface in global coordinates. * @see setFocusedPointerSurfacePosition * @see setFocusedPointerSurface * @see focusedPointerSurfaceTransformation - **/ + */ QPointF focusedPointerSurfacePosition() const; /** * Sets the @p transformation for going from global to local coordinates. @@ -316,61 +331,53 @@ * @see focusedPointerSurfaceTransformation * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfacePosition - * @since 5.6 - **/ + */ void setFocusedPointerSurfaceTransformation(const QMatrix4x4 &transformation); /** * @returns The transformation applied to pointer position to go from global to local coordinates. * @see setFocusedPointerSurfaceTransformation - * @since 5.6 - **/ + */ QMatrix4x4 focusedPointerSurfaceTransformation() const; /** - * Marks the @p button as pressed. - * - * If there is a focused pointer surface a button pressed event is sent to it. - * - * @param button The Linux button code - **/ - void pointerButtonPressed(quint32 button); + * Marks the specified @a button as pressed or released based on @a state. + */ + void notifyPointerButton(quint32 button, PointerButtonState state); /** * @overload - **/ - void pointerButtonPressed(Qt::MouseButton button); - /** - * Marks the @p button as released. - * - * If there is a focused pointer surface a button release event is sent to it. - * - * @param button The Linux button code - **/ - void pointerButtonReleased(quint32 button); - /** - * @overload - **/ - void pointerButtonReleased(Qt::MouseButton button); + */ + void notifyPointerButton(Qt::MouseButton button, PointerButtonState state); + void notifyPointerFrame(); /** * @returns whether the @p button is pressed - **/ + */ bool isPointerButtonPressed(quint32 button) const; /** * @returns whether the @p button is pressed - **/ + */ bool isPointerButtonPressed(Qt::MouseButton button) const; /** * @returns the last serial for @p button. - **/ + */ quint32 pointerButtonSerial(quint32 button) const; /** * @returns the last serial for @p button. - **/ + */ quint32 pointerButtonSerial(Qt::MouseButton button) const; - void pointerAxis(Qt::Orientation orientation, qint32 delta); - void pointerAxisToClient(Qt::Orientation orientation, qint32 delta, SurfaceInterface * surface, QMatrix4x4 matrix); + /** + * Sends axis events to the currently focused pointer surface. + * + * @param orientation The scroll axis. + * @param delta The length of a vector along the specified axis @p orientation. + * @param discreteDelta The number of discrete steps, e.g. mouse wheel clicks. + * @param source Describes how the axis event was physically generated. + */ + void notifyPointerAxis(Qt::Orientation orientation, qreal delta, qint32 discreteDelta, PointerAxisSource source); + + void notifyPointerAxisToClient(Qt::Orientation orientation, qint32 delta, SurfaceInterface * surface, QMatrix4x4 matrix); + /** * @returns true if there is a pressed button with the given @p serial - * @since 5.6 - **/ + */ bool hasImplicitPointerGrab(quint32 serial) const; /** @@ -405,8 +412,7 @@ * @param deltaNonAccelerated non-accelerated motion vector * @param microseconds timestamp with microseconds granularity * @see setPointerPos - * @since 5.28 - **/ + */ void relativePointerMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds); /** @@ -419,7 +425,7 @@ * The precise conditions of when such a gesture is detected are * implementation-dependent. * - * Only one gesture (either swipe or pinch) can be active at a given time. + * Only one gesture (either swipe or pinch or hold) can be active at a given time. * * @param fingerCount The number of fingers involved in this multi-finger touchpad gesture * @@ -429,8 +435,7 @@ * @see endPointerSwipeGesture * @see cancelPointerSwipeGesture * @see startPointerPinchGesture - * @since 5.29 - **/ + */ void startPointerSwipeGesture(quint32 fingerCount); /** @@ -440,8 +445,7 @@ * @see startPointerSwipeGesture * @see endPointerSwipeGesture * @see cancelPointerSwipeGesture - * @since 5.29 - **/ + */ void updatePointerSwipeGesture(const QSizeF &delta); /** @@ -450,7 +454,7 @@ * @see updatePointerSwipeGesture * @see cancelPointerSwipeGesture * @see 5.29 - **/ + */ void endPointerSwipeGesture(); /** @@ -458,8 +462,7 @@ * @see startPointerSwipeGesture * @see updatePointerSwipeGesture * @see endPointerSwipeGesture - * @since 5.29 - **/ + */ void cancelPointerSwipeGesture(); /** @@ -472,7 +475,7 @@ * around a logical center of gravity. The precise conditions of when * such a gesture is detected are implementation-dependent. * - * Only one gesture (either swipe or pinch) can be active at a given time. + * Only one gesture (either swipe or pinch or hold) can be active at a given time. * * @param fingerCount The number of fingers involved in this multi-touch touchpad gesture * @@ -482,8 +485,7 @@ * @see endPointerPinchGesture * @see cancelPointerPinchGesture * @see startPointerSwipeGesture - * @since 5.29 - **/ + */ void startPointerPinchGesture(quint32 fingerCount); /** @@ -496,8 +498,7 @@ * @see startPointerPinchGesture * @see endPointerPinchGesture * @see cancelPointerPinchGesture - * @since 5.29 - **/ + */ void updatePointerPinchGesture(const QSizeF &delta, qreal scale, qreal rotation); /** @@ -505,8 +506,7 @@ * @see startPointerPinchGesture * @see updatePointerPinchGesture * @see cancelPointerPinchGesture - * @since 5.29 - **/ + */ void endPointerPinchGesture(); /** @@ -514,55 +514,44 @@ * @see startPointerPinchGesture * @see updatePointerPinchGesture * @see endPointerPinchGesture - * @since 5.29 - **/ + */ void cancelPointerPinchGesture(); - ///@} /** - * @name keyboard related methods - **/ - ///@{ - void setKeymap(int fd, quint32 size); - void keyPressed(quint32 key); - void keyReleased(quint32 key); - void updateKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group); - /** - * Sets the key repeat information to be forwarded to all bound keyboards. - * - * To disable key repeat set a @p charactersPerSecond of @c 0. - * - * Requires wl_seat version 4. - * - * @param charactersPerSecond The characters per second rate, value of @c 0 disables key repeating - * @param delay The delay on key press before starting repeating keys - * - * @since 5.5 - ***/ - void setKeyRepeatInfo(qint32 charactersPerSecond, qint32 delay); - quint32 depressedModifiers() const; - quint32 latchedModifiers() const; - quint32 lockedModifiers() const; - quint32 groupModifiers() const; - quint32 lastModifiersSerial() const; - int keymapFileDescriptor() const; - quint32 keymapSize() const; - bool isKeymapXkbCompatible() const; - QVector pressedKeys() const; - /** - * @returns The key repeat in character per second - * @since 5.5 - * @see setKeyRepeatInfo - * @see keyRepeatDelay - **/ - qint32 keyRepeatRate() const; - /** - * @returns The delay on key press before starting repeating keys - * @since 5.5 - * @see keyRepeatRate - * @see setKeyRepeatInfo - **/ - qint32 keyRepeatDelay() const; + * Starts a multi-finger hold gesture for the currently focused pointer surface. + * + * Such gestures are normally reported through dedicated input devices such as touchpads. + * + * The gesture is usually initiated by multiple fingers being held down on the touchpad. + * The precise conditions of when such a gesture is detected are + * implementation-dependent. + * + * Only one gesture (either swipe or pinch or hold) can be active at a given time. + * + * @param fingerCount The number of fingers involved in this multi-finger touchpad gesture + * + * @see PointerGesturesInterface + * @see focusedPointerSurface + * @see endPointerHoldeGesture + * @see cancelPointerHoldGesture + */ + void startPointerHoldGesture(quint32 fingerCount); + + + /** + * The multi-finger hold gesture ended. This may happen when one or more fingers are lifted. + * @see startPointerHoldGesture + * @see cancelPointerHoldGesture + */ + void endPointerHoldGesture(); + + /** + * The multi-finger swipe gestures ended and got cancelled by the Wayland compositor. + * @see startPointerHoldGesture + * @see endPointerHoldGesture + */ + void cancelPointerHoldGesture(); + ///@} /** * Passes keyboard focus to @p surface. @@ -573,38 +562,40 @@ * @see focusedKeyboardSurface * @see hasKeyboard * @see setFocusedTextInputSurface - **/ + */ void setFocusedKeyboardSurface(SurfaceInterface *surface); SurfaceInterface *focusedKeyboardSurface() const; - KeyboardInterface *focusedKeyboard() const; + KeyboardInterface *keyboard() const; + void notifyKeyboardKey(quint32 keyCode, KeyboardKeyState state); + void notifyKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group); ///@} /** * @name touch related methods - **/ + */ ///@{ void setFocusedTouchSurface(SurfaceInterface *surface, const QPointF &surfacePosition = QPointF()); SurfaceInterface *focusedTouchSurface() const; - TouchInterface *focusedTouch() const; + TouchInterface *touch() const; void setFocusedTouchSurfacePosition(const QPointF &surfacePosition); QPointF focusedTouchSurfacePosition() const; - qint32 touchDown(const QPointF &globalPosition); - void touchUp(qint32 id); - void touchMove(qint32 id, const QPointF &globalPosition); - void touchFrame(); - void cancelTouchSequence(); + void notifyTouchDown(qint32 id, const QPointF &globalPosition); + void notifyTouchUp(qint32 id); + void notifyTouchMotion(qint32 id, const QPointF &globalPosition); + void notifyTouchFrame(); + void notifyTouchCancel(); bool isTouchSequence() const; + QPointF firstTouchPointPosition() const; /** * @returns true if there is a touch sequence going on associated with a touch * down of the given @p serial. - * @since 5.XX - **/ + */ bool hasImplicitTouchGrab(quint32 serial) const; ///@} /** * @name Text input related methods. - **/ + */ ///@{ /** * Passes text input focus to @p surface. @@ -612,24 +603,22 @@ * If the SeatInterface has the keyboard capability this method will * be invoked automatically when setting the focused keyboard surface. * - * In case there is a TextInputInterface for the @p surface, the enter - * event will be triggered on the TextInputInterface for @p surface. - * The focusedTextInput will be set to that TextInputInterface. If there - * is no TextInputInterface for that @p surface, it might get updated later on. + * In case there is a TextInputV2Interface for the @p surface, the enter + * event will be triggered on the TextInputV2Interface for @p surface. + * The focusedTextInput will be set to that TextInputV2Interface. If there + * is no TextInputV2Interface for that @p surface, it might get updated later on. * In both cases the signal focusedTextInputChanged will be emitted. * * @see focusedTextInputSurface * @see focusedTextInput * @see focusedTextInputChanged * @see setFocusedKeyboardSurface - * @since 5.23 - **/ + */ void setFocusedTextInputSurface(SurfaceInterface *surface); /** * @returns The SurfaceInterface which is currently focused for text input. * @see setFocusedTextInputSurface - * @since 5.23 - **/ + */ SurfaceInterface *focusedTextInputSurface() const; /** * The currently focused text input, may be @c null even if there is a @@ -637,29 +626,23 @@ * * The focused text input might not be enabled for the {@link focusedTextInputSurface}. * It is recommended to check the enabled state before interacting with the - * TextInputInterface. + * TextInputV2Interface. * * @see focusedTextInputChanged * @see focusedTextInputSurface - * @since 5.23 - **/ - TextInputInterface *focusedTextInput() const; + */ + TextInputV2Interface *textInputV2() const; + + TextInputV3Interface *textInputV3() const; ///@} /** * @returns The DataDeviceInterface holding the current clipboard selection. - * @since 5.24 * @see selectionChanged * @see setSelection - **/ - AbstractDataSource *selection() const; - - /** - * @returns The PrimarySelectionDeviceV1Interface holding the current selection. - * @since 5.54 - * @see setSelection - **/ - AbstractDataSource *primarySelection() const; + * This may be null + */ + KWaylandServer::AbstractDataSource *selection() const; /** * This method allows to manually set the @p dataDevice for the current clipboard selection. @@ -672,37 +655,26 @@ * @param dataDevice Sets the current clipboard selection. * @see selection * @see selectionChanged - * @since 5.24 - **/ - void setSelection(AbstractDataSource *dataSource); + */ + void setSelection(AbstractDataSource *selection); - /** - * This method allows to manually set the @p PrimarySelectionDeviceV1Interface for the current selection. - * The selection is handled automatically in SeatInterface. - * If a PrimarySelectionDeviceV1Interface belonging to the current focused KeyboardInterface - * sets a selection, the current selection will be updated automatically. - * With this method it's possible to override the automatic select update for - * - * @param PrimarySelectionDeviceV1Interface Sets the current selection. - * @see selection - * @since 5.24 - **/ - void setPrimarySelection(AbstractDataSource *primarySource); + void updateCachedSelection(AbstractDataSource *selection); + + KWaylandServer::AbstractDataSource *primarySelection() const; + void setPrimarySelection(AbstractDataSource *selection); + + void startDrag(AbstractDataSource *source, SurfaceInterface *sourceSurface, int dragSerial = -1, DragAndDropIcon *dragIcon = nullptr); /** - * This method allows to manually set the @p DataControlDeviceV1Interface for the current selection. - * The selection is handled automatically in SeatInterface. - * If the source changes, it will notify all clients of the clipboard change - * sets a selection, the current selection will be updated automatically. - * With this method it's possible to override the automatic select update for - * @since - **/ - void setControlSelect(DataControlDeviceV1Interface* ); + * Returns the additional icon attached to the cursor during a drag-and-drop operation. + * This function returns @c null if no drag-and-drop is active or no icon has been attached. + */ + DragAndDropIcon *dragIcon() const; - static SeatInterface *get(wl_resource *native); + static SeatInterface *get(wl_resource *native); Q_SIGNALS: - void nameChanged(const QString&); + void nameChanged(const QString &); void hasPointerChanged(bool); void hasKeyboardChanged(bool); void hasTouchChanged(bool); @@ -710,71 +682,50 @@ void touchMoved(qint32 id, quint32 serial, const QPointF &globalPosition); void timestampChanged(quint32); - void pointerCreated(KWayland::Server::PointerInterface*); - void keyboardCreated(KWayland::Server::KeyboardInterface*); - void touchCreated(KWayland::Server::TouchInterface*); - - /** - * Emitted whenever the focused pointer changes - * @since 5.6 - **/ - void focusedPointerChanged(KWayland::Server::PointerInterface*); - /** * Emitted whenever the selection changes - * @since 5.56 * @see selection * @see setSelection - **/ - void selectionChanged(KWayland::Server::AbstractDataSource*); + */ + void selectionChanged(KWaylandServer::AbstractDataSource *); /** * Emitted whenever the primary selection changes * @see primarySelection - **/ - void primarySelectionChanged(KWayland::Server::AbstractDataSource*); + */ + void primarySelectionChanged(KWaylandServer::AbstractDataSource *); /** * Emitted when a drag'n'drop operation is started - * @since 5.6 * @see dragEnded - **/ + */ void dragStarted(); /** * Emitted when a drag'n'drop operation ended, either by dropping or canceling. - * @since 5.6 * @see dragStarted - **/ + */ void dragEnded(); /** * Emitted whenever the drag surface for motion events changed. - * @since 5.6 * @see dragSurface - **/ + */ void dragSurfaceChanged(); + + /** Emitted when a drop ocurrs in a drag'n'drop operation. This is emitted + * before dragEnded + */ + void dragDropped(); /** * Emitted whenever the focused text input changed. * @see focusedTextInput - * @since 5.23 - **/ - void focusedTextInputChanged(); + */ + void focusedTextInputSurfaceChanged(); private: - friend class Display; - friend class DataControlDeviceManagerInterface; - friend class DataDeviceManagerInterface; - friend class PrimarySelectionDeviceManagerV1Interface; - friend class TextInputManagerUnstableV0Interface; - friend class TextInputManagerUnstableV2Interface; - explicit SeatInterface(Display *display, QObject *parent); - - class Private; - Private *d_func() const; + QScopedPointer d; + friend class SeatInterfacePrivate; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::SeatInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::SeatInterface *) diff -Nru dwayland-5.57.0.23/src/server/seat_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/seat_interface_p.h --- dwayland-5.57.0.23/src/server/seat_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/seat_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,104 +1,89 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SEAT_INTERFACE_P_H -#define WAYLAND_SERVER_SEAT_INTERFACE_P_H // KWayland #include "seat_interface.h" -#include "global_p.h" // Qt #include #include #include #include -// Wayland -#include -namespace KWayland -{ -namespace Server -{ +#include "qwayland-server-wayland.h" +namespace KWaylandServer +{ +class AbstractDataSource; class DataDeviceInterface; -class TextInputInterface; -class PrimarySelectionDeviceV1Interface; -class PrimarySelectionSourceV1Interface; +class DataSourceInterface; class DataControlDeviceV1Interface; -class AbstractDataSource; +class TextInputV2Interface; +class TextInputV3Interface; +class PrimarySelectionDeviceV1Interface; +class DragAndDropIcon; -class SeatInterface::Private : public Global::Private +class SeatInterfacePrivate : public QtWaylandServer::wl_seat { public: - Private(SeatInterface *q, Display *d); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void sendCapabilities(wl_resource *r); - void sendName(wl_resource *r); - QVector pointersForSurface(SurfaceInterface *surface) const; - QVector keyboardsForSurface(SurfaceInterface *surface) const; - QVector touchsForSurface(SurfaceInterface *surface) const; - DataDeviceInterface *dataDeviceForSurface(SurfaceInterface *surface) const; - TextInputInterface *textInputForSurface(SurfaceInterface *surface) const; + // exported for unit tests + KWAYLANDSERVER_EXPORT static SeatInterfacePrivate *get(SeatInterface *seat); + SeatInterfacePrivate(SeatInterface *q, Display *display); + + void sendCapabilities(); + QVector dataDevicesForSurface(SurfaceInterface *surface) const; void registerPrimarySelectionDevice(PrimarySelectionDeviceV1Interface *primarySelectionDevice); void registerDataDevice(DataDeviceInterface *dataDevice); void registerDataControlDevice(DataControlDeviceV1Interface *dataDevice); - void registerTextInput(TextInputInterface *textInput); void endDrag(quint32 serial); - void cancelPreviousSelection(AbstractDataSource *newlySelectedDataDevice); - void cancelPreviousPrimarySelection(AbstractDataSource *newlySelectedDataDevice); - + void cancelDrag(quint32 serial); + SeatInterface *q; + QPointer display; QString name; - bool pointer = false; - bool keyboard = false; - bool touch = false; - QList resources; quint32 timestamp = 0; - QVector pointers; - QVector keyboards; - QVector touchs; - QVector dataDevices; - QVector dataControlDevices; - QVector primarySelectionDevices; - QVector textInputs; + quint32 accumulatedCapabilities = 0; + quint32 capabilities = 0; + QScopedPointer keyboard; + QScopedPointer pointer; + QScopedPointer touch; + QVector dataDevices; + QVector primarySelectionDevices; + QVector dataControlDevices; + + // TextInput v2 + QPointer textInputV2; + QPointer textInputV3; + SurfaceInterface *focusedTextInputSurface = nullptr; + QMetaObject::Connection focusedSurfaceDestroyConnection; + + // the last thing copied into the clipboard content AbstractDataSource *currentSelection = nullptr; AbstractDataSource *currentPrimarySelection = nullptr; + AbstractDataSource *currentCachedSelection = nullptr; // Pointer related members struct Pointer { enum class State { Released, - Pressed + Pressed, }; QHash buttonSerials; QHash buttonStates; QPointF pos; struct Focus { SurfaceInterface *surface = nullptr; - QVector pointers; QMetaObject::Connection destroyConnection; QPointF offset = QPointF(); QMatrix4x4 transformation; quint32 serial = 0; }; Focus focus; - QPointer gestureSurface; }; Pointer globalPointer; void updatePointerButtonSerial(quint32 button, quint32 serial); @@ -106,62 +91,25 @@ // Keyboard related members struct Keyboard { - enum class State { - Released, - Pressed - }; - QHash states; - struct Keymap { - int fd = -1; - quint32 size = 0; - bool xkbcommonCompatible = false; - }; - Keymap keymap; - struct Modifiers { - quint32 depressed = 0; - quint32 latched = 0; - quint32 locked = 0; - quint32 group = 0; - quint32 serial = 0; - }; - Modifiers modifiers; struct Focus { SurfaceInterface *surface = nullptr; - QVector keyboards; QMetaObject::Connection destroyConnection; quint32 serial = 0; - DataDeviceInterface *selection = nullptr; + QVector selections; QVector primarySelections; }; Focus focus; - quint32 lastStateSerial = 0; - struct { - qint32 charactersPerSecond = 0; - qint32 delay = 0; - } keyRepeat; - }; - Keyboard keys; - bool updateKey(quint32 key, Keyboard::State state); - - struct TextInput { - struct Focus { - SurfaceInterface *surface = nullptr; - QMetaObject::Connection destroyConnection; - quint32 serial = 0; - TextInputInterface *textInput = nullptr; - }; - Focus focus; }; - TextInput textInput; + Keyboard globalKeyboard; // Touch related members struct Touch { struct Focus { SurfaceInterface *surface = nullptr; - QVector touchs; QMetaObject::Connection destroyConnection; QPointF offset = QPointF(); QPointF firstTouchPos; + QMatrix4x4 transformation; }; Focus focus; QMap ids; @@ -172,49 +120,29 @@ enum class Mode { None, Pointer, - Touch + Touch, }; Mode mode = Mode::None; - DataDeviceInterface *source = nullptr; - DataDeviceInterface *target = nullptr; - SurfaceInterface *surface = nullptr; - PointerInterface *sourcePointer = nullptr; - TouchInterface *sourceTouch = nullptr; + AbstractDataSource *source = nullptr; + QPointer surface; + QPointer target; + QPointer dragIcon; QMatrix4x4 transformation; - QMetaObject::Connection destroyConnection; + quint32 dragImplicitGrabSerial = -1; QMetaObject::Connection dragSourceDestroyConnection; }; Drag drag; - static SeatInterface *get(wl_resource *native) { - auto s = cast(native); - return s ? s->q : nullptr; - } +protected: + void seat_bind_resource(Resource *resource) override; + void seat_get_pointer(Resource *resource, uint32_t id) override; + void seat_get_keyboard(Resource *resource, uint32_t id) override; + void seat_get_touch(Resource *resource, uint32_t id) override; + void seat_release(Resource *resource) override; private: - void getPointer(wl_client *client, wl_resource *resource, uint32_t id); - void getKeyboard(wl_client *client, wl_resource *resource, uint32_t id); - void getTouch(wl_client *client, wl_resource *resource, uint32_t id); + void updateSelection(DataDeviceInterface *dataDevice); void updatePrimarySelection(PrimarySelectionDeviceV1Interface *primarySelectionDevice); - void updateSelection(AbstractDataSource *dataSource, bool sendDataConctrl); - static Private *cast(wl_resource *r); - static void unbind(wl_resource *r); - - // interface - static void getPointerCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getTouchCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void releaseCallback(wl_client *client, wl_resource *resource); - static const struct wl_seat_interface s_interface; - static const quint32 s_version; - static const qint32 s_pointerVersion; - static const qint32 s_touchVersion; - static const qint32 s_keyboardVersion; - - SeatInterface *q; }; -} -} - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/server_decoration_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_interface.cpp --- dwayland-5.57.0.23/src/server/server_decoration_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,210 +1,150 @@ -/**************************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "server_decoration_interface.h" #include "display.h" -#include "global_p.h" #include "logging.h" -#include "resource_p.h" #include "surface_interface.h" #include -#include +#include -namespace KWayland -{ -namespace Server +#include + +namespace KWaylandServer { +static const quint32 s_version = 1; -class ServerSideDecorationManagerInterface::Private : public Global::Private +class ServerSideDecorationManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_server_decoration_manager { public: - Private(ServerSideDecorationManagerInterface *q, Display *d); - - Mode defaultMode = Mode::None; - - QVector resources; - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - void create(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); + ServerSideDecorationManagerInterfacePrivate(ServerSideDecorationManagerInterface *_q, Display *display); + void setDefaultMode(ServerSideDecorationManagerInterface::Mode mode); + ServerSideDecorationManagerInterface::Mode defaultMode = ServerSideDecorationManagerInterface::Mode::None; ServerSideDecorationManagerInterface *q; - static const struct org_kde_kwin_server_decoration_manager_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ServerSideDecorationManagerInterface::Private::s_version = 1; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_server_decoration_manager_interface ServerSideDecorationManagerInterface::Private::s_interface = { - createCallback +protected: + void org_kde_kwin_server_decoration_manager_bind_resource(Resource *resource) override; + void org_kde_kwin_server_decoration_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; }; -#endif -void ServerSideDecorationManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +static uint32_t modeWayland(ServerSideDecorationManagerInterface::Mode mode) { - reinterpret_cast(wl_resource_get_user_data(resource))->create(client, resource, id, surface); + switch (mode) { + case ServerSideDecorationManagerInterface::Mode::None: + return ServerSideDecorationManagerInterfacePrivate::mode_None; + case ServerSideDecorationManagerInterface::Mode::Client: + return ServerSideDecorationManagerInterfacePrivate::mode_Client; + case ServerSideDecorationManagerInterface::Mode::Server: + return ServerSideDecorationManagerInterfacePrivate::mode_Server; + default: + Q_UNREACHABLE(); + } } -void ServerSideDecorationManagerInterface::Private::create(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void ServerSideDecorationManagerInterfacePrivate::org_kde_kwin_server_decoration_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { - // TODO: send error? - qCWarning(KWAYLAND_SERVER) << "ServerSideDecorationInterface requested for non existing SurfaceInterface"; + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - ServerSideDecorationInterface *decoration = new ServerSideDecorationInterface(q, s, resource); - decoration->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!decoration->resource()) { - wl_resource_post_no_memory(resource); - delete decoration; + + wl_resource *decorationResource = wl_resource_create(resource->client(), &org_kde_kwin_server_decoration_interface, resource->version(), id); + if (!decorationResource) { + wl_client_post_no_memory(resource->client()); return; } + auto decoration = new ServerSideDecorationInterface(q, s, decorationResource); decoration->setMode(defaultMode); - emit q->decorationCreated(decoration); -} - -ServerSideDecorationManagerInterface::Mode ServerSideDecorationManagerInterface::defaultMode() const -{ - return d_func()->defaultMode; + Q_EMIT q->decorationCreated(decoration); } -ServerSideDecorationManagerInterface::Private::Private(ServerSideDecorationManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_server_decoration_manager_interface, s_version) - , q(q) +void ServerSideDecorationManagerInterfacePrivate::setDefaultMode(ServerSideDecorationManagerInterface::Mode mode) { -} + defaultMode = mode; + const uint32_t wlMode = modeWayland(mode); -namespace { -static uint32_t modeWayland(ServerSideDecorationManagerInterface::Mode mode) -{ - switch (mode) { - case ServerSideDecorationManagerInterface::Mode::None: - return ORG_KDE_KWIN_SERVER_DECORATION_MODE_NONE; - break; - case ServerSideDecorationManagerInterface::Mode::Client: - return ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT; - break; - case ServerSideDecorationManagerInterface::Mode::Server: - return ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER; - break; - default: - Q_UNREACHABLE(); + const auto clientResources = resourceMap(); + for (Resource *resource : clientResources) { + send_default_mode(resource->handle, wlMode); } } -} -void ServerSideDecorationManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +ServerSideDecorationManagerInterfacePrivate::ServerSideDecorationManagerInterfacePrivate(ServerSideDecorationManagerInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_server_decoration_manager(*display, s_version) + , q(_q) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_server_decoration_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - - resources << resource; - - org_kde_kwin_server_decoration_manager_send_default_mode(resource, modeWayland(defaultMode)); - c->flush(); } -void ServerSideDecorationManagerInterface::Private::unbind(wl_resource *resource) +void ServerSideDecorationManagerInterfacePrivate::org_kde_kwin_server_decoration_manager_bind_resource(Resource *resource) { - cast(resource)->resources.removeAll(resource); + send_default_mode(resource->handle, modeWayland(defaultMode)); } ServerSideDecorationManagerInterface::ServerSideDecorationManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new ServerSideDecorationManagerInterfacePrivate(this, display)) { } ServerSideDecorationManagerInterface::~ServerSideDecorationManagerInterface() = default; -ServerSideDecorationManagerInterface::Private *ServerSideDecorationManagerInterface::d_func() const +void ServerSideDecorationManagerInterface::setDefaultMode(Mode mode) { - return reinterpret_cast(d.data()); + d->setDefaultMode(mode); } -void ServerSideDecorationManagerInterface::setDefaultMode(Mode mode) +ServerSideDecorationManagerInterface::Mode ServerSideDecorationManagerInterface::defaultMode() const { - Q_D(); - d->defaultMode = mode; - const uint32_t wlMode = modeWayland(mode); - for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); it++) { - org_kde_kwin_server_decoration_manager_send_default_mode(*it, wlMode); - } + return d->defaultMode; } -class ServerSideDecorationInterface::Private : public Resource::Private +class ServerSideDecorationInterfacePrivate : public QtWaylandServer::org_kde_kwin_server_decoration { public: - Private(ServerSideDecorationInterface *q, ServerSideDecorationManagerInterface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); + ServerSideDecorationInterfacePrivate(ServerSideDecorationManagerInterface *manager, + ServerSideDecorationInterface *_q, + SurfaceInterface *surface, + wl_resource *resource); + ~ServerSideDecorationInterfacePrivate(); + + static ServerSideDecorationInterface *get(SurfaceInterface *surface); + void setMode(ServerSideDecorationManagerInterface::Mode mode); + ServerSideDecorationManagerInterface *manager; ServerSideDecorationManagerInterface::Mode mode = ServerSideDecorationManagerInterface::Mode::None; + std::optional preferredMode; SurfaceInterface *surface; - static ServerSideDecorationInterface *get(SurfaceInterface *s); - private: - static void requestModeCallback(wl_client *client, wl_resource *resource, uint32_t mode); + ServerSideDecorationInterface *q; + static QVector s_all; - ServerSideDecorationInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct org_kde_kwin_server_decoration_interface s_interface; - static QVector s_all; +protected: + void org_kde_kwin_server_decoration_destroy_resource(Resource *resource) override; + void org_kde_kwin_server_decoration_release(Resource *resource) override; + void org_kde_kwin_server_decoration_request_mode(Resource *resource, uint32_t mode) override; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_server_decoration_interface ServerSideDecorationInterface::Private::s_interface = { - resourceDestroyedCallback, - requestModeCallback -}; -QVector ServerSideDecorationInterface::Private::s_all; -#endif +QVector ServerSideDecorationInterfacePrivate::s_all; -void ServerSideDecorationInterface::Private::requestModeCallback(wl_client *client, wl_resource *resource, uint32_t mode) +void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_request_mode(Resource *resource, uint32_t mode) { - Q_UNUSED(client) + Q_UNUSED(resource) ServerSideDecorationManagerInterface::Mode m = ServerSideDecorationManagerInterface::Mode::None; switch (mode) { - case ORG_KDE_KWIN_SERVER_DECORATION_MODE_NONE: + case ServerSideDecorationManagerInterfacePrivate::mode_None: m = ServerSideDecorationManagerInterface::Mode::None; break; - case ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT: + case ServerSideDecorationManagerInterfacePrivate::mode_Client: m = ServerSideDecorationManagerInterface::Mode::Client; break; - case ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER: + case ServerSideDecorationManagerInterfacePrivate::mode_Server: m = ServerSideDecorationManagerInterface::Mode::Server; break; default: @@ -212,32 +152,57 @@ qCWarning(KWAYLAND_SERVER) << "Invalid mode:" << mode; return; } - emit cast(resource)->q_func()->modeRequested(m); + preferredMode = m; + Q_EMIT q->preferredModeChanged(); +} + +void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; } -ServerSideDecorationInterface *ServerSideDecorationInterface::Private::get(SurfaceInterface *s) +ServerSideDecorationInterface *ServerSideDecorationInterfacePrivate::get(SurfaceInterface *surface) { - auto it = std::find_if(s_all.constBegin(), s_all.constEnd(), [s] (Private *p) { return p->surface == s; }); - if (it == s_all.constEnd()) { - return nullptr; + for (ServerSideDecorationInterfacePrivate *decoration : qAsConst(s_all)) { + if (decoration->surface == surface) { + return decoration->q; + } } - return (*it)->q_func(); + return nullptr; } -ServerSideDecorationInterface::Private::Private(ServerSideDecorationInterface *q, ServerSideDecorationManagerInterface *c, SurfaceInterface *surface, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_server_decoration_interface, &s_interface) +ServerSideDecorationInterfacePrivate::ServerSideDecorationInterfacePrivate(ServerSideDecorationManagerInterface *manager, + ServerSideDecorationInterface *_q, + SurfaceInterface *surface, + wl_resource *resource) + : QtWaylandServer::org_kde_kwin_server_decoration(resource) + , manager(manager) , surface(surface) + , q(_q) { s_all << this; } -ServerSideDecorationInterface::Private::~Private() +ServerSideDecorationInterfacePrivate::~ServerSideDecorationInterfacePrivate() { s_all.removeAll(this); } -ServerSideDecorationInterface::ServerSideDecorationInterface(ServerSideDecorationManagerInterface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : Resource(new Private(this, parent, surface, parentResource)) +void ServerSideDecorationInterfacePrivate::setMode(ServerSideDecorationManagerInterface::Mode mode) +{ + this->mode = mode; + send_mode(modeWayland(mode)); +} + +ServerSideDecorationInterface::ServerSideDecorationInterface(ServerSideDecorationManagerInterface *manager, SurfaceInterface *surface, wl_resource *resource) + : QObject() + , d(new ServerSideDecorationInterfacePrivate(manager, this, surface, resource)) { } @@ -245,33 +210,27 @@ void ServerSideDecorationInterface::setMode(ServerSideDecorationManagerInterface::Mode mode) { - Q_D(); - d->mode = mode; - org_kde_kwin_server_decoration_send_mode(resource(), modeWayland(mode)); - client()->flush(); + d->setMode(mode); } ServerSideDecorationManagerInterface::Mode ServerSideDecorationInterface::mode() const { - Q_D(); return d->mode; } -SurfaceInterface *ServerSideDecorationInterface::surface() const +ServerSideDecorationManagerInterface::Mode ServerSideDecorationInterface::preferredMode() const { - Q_D(); - return d->surface; + return d->preferredMode.value_or(d->manager->defaultMode()); } -ServerSideDecorationInterface::Private *ServerSideDecorationInterface::d_func() const +SurfaceInterface *ServerSideDecorationInterface::surface() const { - return reinterpret_cast(d.data()); + return d->surface; } -ServerSideDecorationInterface *ServerSideDecorationInterface::get(SurfaceInterface *s) +ServerSideDecorationInterface *ServerSideDecorationInterface::get(SurfaceInterface *surface) { - return Private::get(s); + return ServerSideDecorationInterfacePrivate::get(surface); } } -} diff -Nru dwayland-5.57.0.23/src/server/server_decoration_interface.h dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_interface.h --- dwayland-5.57.0.23/src/server/server_decoration_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,128 +1,112 @@ -/**************************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_SERVER_DECORATION_INTERFACE_H -#define KWAYLAND_SERVER_SERVER_DECORATION_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" +#include -#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ class Display; class ServerSideDecorationInterface; class SurfaceInterface; +class ServerSideDecorationManagerInterfacePrivate; +class ServerSideDecorationInterfacePrivate; /** * @brief Manager to create ServerSideDecorationInterface. - * - * @since 5.6 - **/ -class KWAYLANDSERVER_EXPORT ServerSideDecorationManagerInterface : public Global + */ +class KWAYLANDSERVER_EXPORT ServerSideDecorationManagerInterface : public QObject { Q_OBJECT + public: - virtual ~ServerSideDecorationManagerInterface(); + explicit ServerSideDecorationManagerInterface(Display *display, QObject *parent = nullptr); + ~ServerSideDecorationManagerInterface() override; /** * Decoration mode used for SurfaceInterfaces. - **/ + */ enum class Mode { /** * Undecorated: neither client, nor server provide decoration. Example: popups. - **/ + */ None, /** * The decoration is part of the surface. - **/ + */ Client, /** * The surface gets embedded into a decoration frame provided by the Server. - **/ - Server + */ + Server, }; /** * Sets the default @p mode which is pushed to the Clients on creating a ServerSideDecorationInterface. * @param mode The new default mode. * @see defaultMode - **/ + */ void setDefaultMode(Mode mode); /** * @returns the current default mode. * @see setDefaultMode - **/ + */ Mode defaultMode() const; Q_SIGNALS: /** * Emitted whenever a new ServerSideDecorationInterface is created. - **/ - void decorationCreated(KWayland::Server::ServerSideDecorationInterface*); + */ + void decorationCreated(KWaylandServer::ServerSideDecorationInterface *); private: - explicit ServerSideDecorationManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; + QScopedPointer d; }; /** * @brief Representing how a SurfaceInterface should be decorated. * * Created by ServerSideDecorationManagerInterface and emitted with decorationCreated signal. - * - * @since 5.6 - **/ -class KWAYLANDSERVER_EXPORT ServerSideDecorationInterface : public Resource + */ +class KWAYLANDSERVER_EXPORT ServerSideDecorationInterface : public QObject { Q_OBJECT public: - virtual ~ServerSideDecorationInterface(); + ~ServerSideDecorationInterface() override; /** * Sets the @p mode on the SurfaceInterface. A client might refuse the provided @p mode, * in that case modeRequested will be emitted. * @see mode * @see modeRequested - **/ + */ void setMode(ServerSideDecorationManagerInterface::Mode mode); /** * @returns the currently set mode, not the requested mode. * @see setMode * @see modeRequested - **/ + */ ServerSideDecorationManagerInterface::Mode mode() const; + /** + * Returns the preferred decoration mode as specified by the client. + */ + ServerSideDecorationManagerInterface::Mode preferredMode() const; /** * @returns The SurfaceInterface this ServerSideDecorationInterface references. - **/ + */ SurfaceInterface *surface() const; /** * @returns The ServerSideDecorationInterface for the given @p surface, @c nullptr if there is none. - **/ + */ static ServerSideDecorationInterface *get(SurfaceInterface *surface); Q_SIGNALS: @@ -131,21 +115,17 @@ * The server needs to acknowledge the requested mode by setting it through setMode. * @see setMode * @see mode - **/ - void modeRequested(KWayland::Server::ServerSideDecorationManagerInterface::Mode); + */ + void preferredModeChanged(); private: - explicit ServerSideDecorationInterface(ServerSideDecorationManagerInterface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class ServerSideDecorationManagerInterface; + explicit ServerSideDecorationInterface(ServerSideDecorationManagerInterface *manager, SurfaceInterface *surface, wl_resource *resource); + friend class ServerSideDecorationManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::ServerSideDecorationInterface*) -Q_DECLARE_METATYPE(KWayland::Server::ServerSideDecorationManagerInterface::Mode) -#endif +Q_DECLARE_METATYPE(KWaylandServer::ServerSideDecorationInterface *) +Q_DECLARE_METATYPE(KWaylandServer::ServerSideDecorationManagerInterface::Mode) diff -Nru dwayland-5.57.0.23/src/server/server_decoration_palette_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_palette_interface.cpp --- dwayland-5.57.0.23/src/server/server_decoration_palette_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_palette_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,216 +1,145 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "server_decoration_palette_interface.h" #include "display.h" -#include "surface_interface.h" -#include "global_p.h" -#include "resource_p.h" #include "logging.h" +#include "surface_interface.h" #include -#include +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ -class ServerSideDecorationPaletteManagerInterface::Private : public Global::Private +static const quint32 s_version = 1; + +class ServerSideDecorationPaletteManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_server_decoration_palette_manager { public: - Private(ServerSideDecorationPaletteManagerInterface *q, Display *d); - - QVector palettes; -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); + ServerSideDecorationPaletteManagerInterfacePrivate(ServerSideDecorationPaletteManagerInterface *q, Display *display); + QVector palettes; ServerSideDecorationPaletteManagerInterface *q; - static const struct org_kde_kwin_server_decoration_palette_manager_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ServerSideDecorationPaletteManagerInterface::Private::s_version = 1; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_server_decoration_palette_manager_interface ServerSideDecorationPaletteManagerInterface::Private::s_interface = { - createCallback +protected: + void org_kde_kwin_server_decoration_palette_manager_create(Resource *resource, uint32_t id, struct ::wl_resource *surface) override; }; -#endif -void ServerSideDecorationPaletteManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) +void ServerSideDecorationPaletteManagerInterfacePrivate::org_kde_kwin_server_decoration_palette_manager_create(Resource *resource, + uint32_t id, + wl_resource *surface) { - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { - // TODO: send error? + wl_resource_post_error(resource->handle, 0, "invalid surface"); qCWarning(KWAYLAND_SERVER) << "ServerSideDecorationPaletteInterface requested for non existing SurfaceInterface"; return; } - auto palette = new ServerSideDecorationPaletteInterface(p->q, s, resource); - palette->create(p->display->getConnection(client), wl_resource_get_version(resource), id); - if (!palette->resource()) { - wl_resource_post_no_memory(resource); - delete palette; + + wl_resource *palette_resource = wl_resource_create(resource->client(), &org_kde_kwin_server_decoration_palette_interface, resource->version(), id); + if (!palette_resource) { + wl_client_post_no_memory(resource->client()); return; } - p->palettes.append(palette); - QObject::connect(palette, &QObject::destroyed, p->q, [=]() { - p->palettes.removeOne(palette); + auto palette = new ServerSideDecorationPaletteInterface(s, palette_resource); + + palettes.append(palette); + QObject::connect(palette, &QObject::destroyed, q, [=]() { + palettes.removeOne(palette); }); - emit p->q->paletteCreated(palette); + Q_EMIT q->paletteCreated(palette); } -ServerSideDecorationPaletteManagerInterface::Private::Private(ServerSideDecorationPaletteManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_server_decoration_palette_manager_interface, s_version) - , q(q) +ServerSideDecorationPaletteManagerInterfacePrivate::ServerSideDecorationPaletteManagerInterfacePrivate(ServerSideDecorationPaletteManagerInterface *_q, + Display *display) + : QtWaylandServer::org_kde_kwin_server_decoration_palette_manager(*display, s_version) + , q(_q) { } -void ServerSideDecorationPaletteManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +ServerSideDecorationPaletteManagerInterface::ServerSideDecorationPaletteManagerInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new ServerSideDecorationPaletteManagerInterfacePrivate(this, display)) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_server_decoration_palette_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); } -void ServerSideDecorationPaletteManagerInterface::Private::unbind(wl_resource *resource) +ServerSideDecorationPaletteManagerInterface::~ServerSideDecorationPaletteManagerInterface() = default; + +ServerSideDecorationPaletteInterface *ServerSideDecorationPaletteManagerInterface::paletteForSurface(SurfaceInterface *surface) { - Q_UNUSED(resource) + for (ServerSideDecorationPaletteInterface *menu : qAsConst(d->palettes)) { + if (menu->surface() == surface) { + return menu; + } + } + return nullptr; } -class ServerSideDecorationPaletteInterface::Private : public Resource::Private +class ServerSideDecorationPaletteInterfacePrivate : public QtWaylandServer::org_kde_kwin_server_decoration_palette { public: - Private(ServerSideDecorationPaletteInterface *q, ServerSideDecorationPaletteManagerInterface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); - + ServerSideDecorationPaletteInterfacePrivate(ServerSideDecorationPaletteInterface *_q, SurfaceInterface *surface, wl_resource *resource); SurfaceInterface *surface; QString palette; -private: - static void setPaletteCallback(wl_client *client, wl_resource *resource, const char * palette); - - ServerSideDecorationPaletteInterface *q_func() { - return reinterpret_cast(q); - } - static ServerSideDecorationPaletteInterface *get(SurfaceInterface *s); - static const struct org_kde_kwin_server_decoration_palette_interface s_interface; -}; + ServerSideDecorationPaletteInterface *q; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_server_decoration_palette_interface ServerSideDecorationPaletteInterface::Private::s_interface = { - setPaletteCallback, - resourceDestroyedCallback +protected: + void org_kde_kwin_server_decoration_palette_destroy_resource(Resource *resource) override; + void org_kde_kwin_server_decoration_palette_set_palette(Resource *resource, const QString &palette) override; + void org_kde_kwin_server_decoration_palette_release(Resource *resource) override; }; -#endif -void ServerSideDecorationPaletteInterface::Private::setPaletteCallback(wl_client *client, wl_resource *resource, const char * palette) +void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration_palette_release(Resource *resource) { - Q_UNUSED(client); - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - if (p->palette == QLatin1String(palette)) { - return; - } - p->palette = QString::fromUtf8(palette); - emit p->q_func()->paletteChanged(p->palette); + wl_resource_destroy(resource->handle); } -ServerSideDecorationPaletteInterface::Private::Private(ServerSideDecorationPaletteInterface *q, ServerSideDecorationPaletteManagerInterface *c, SurfaceInterface *s, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_server_decoration_palette_interface, &s_interface), - surface(s) +void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration_palette_set_palette(Resource *resource, const QString &palette) { -} + Q_UNUSED(resource) -ServerSideDecorationPaletteInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; + if (this->palette == palette) { + return; } + this->palette = palette; + Q_EMIT q->paletteChanged(this->palette); } -ServerSideDecorationPaletteManagerInterface::ServerSideDecorationPaletteManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -ServerSideDecorationPaletteManagerInterface::~ServerSideDecorationPaletteManagerInterface() +void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration_palette_destroy_resource(Resource *resource) { + Q_UNUSED(resource) + delete q; } -ServerSideDecorationPaletteManagerInterface::Private *ServerSideDecorationPaletteManagerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -ServerSideDecorationPaletteInterface* ServerSideDecorationPaletteManagerInterface::paletteForSurface(SurfaceInterface *surface) -{ - Q_D(); - for (ServerSideDecorationPaletteInterface* menu: d->palettes) { - if (menu->surface() == surface) { - return menu; - } - } - return nullptr; -} - -ServerSideDecorationPaletteInterface::ServerSideDecorationPaletteInterface(ServerSideDecorationPaletteManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource): - Resource(new Private(this, parent, s, parentResource)) +ServerSideDecorationPaletteInterfacePrivate::ServerSideDecorationPaletteInterfacePrivate(ServerSideDecorationPaletteInterface *_q, + SurfaceInterface *surface, + wl_resource *resource) + : QtWaylandServer::org_kde_kwin_server_decoration_palette(resource) + , surface(surface) + , q(_q) { } -ServerSideDecorationPaletteInterface::Private *ServerSideDecorationPaletteInterface::d_func() const +ServerSideDecorationPaletteInterface::ServerSideDecorationPaletteInterface(SurfaceInterface *surface, wl_resource *resource) + : QObject() + , d(new ServerSideDecorationPaletteInterfacePrivate(this, surface, resource)) { - return reinterpret_cast(d.data()); } -ServerSideDecorationPaletteInterface::~ServerSideDecorationPaletteInterface() -{} +ServerSideDecorationPaletteInterface::~ServerSideDecorationPaletteInterface() = default; QString ServerSideDecorationPaletteInterface::palette() const { - Q_D(); return d->palette; } -SurfaceInterface* ServerSideDecorationPaletteInterface::surface() const +SurfaceInterface *ServerSideDecorationPaletteInterface::surface() const { - Q_D(); return d->surface; } -}//namespace -} - +} // namespace diff -Nru dwayland-5.57.0.23/src/server/server_decoration_palette_interface.h dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_palette_interface.h --- dwayland-5.57.0.23/src/server/server_decoration_palette_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/server_decoration_palette_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,80 +1,61 @@ -/**************************************************************************** -Copyright 2017 David Edmundson +/* + SPDX-FileCopyrightText: 2017 David Edmundson -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_DECORATION_PALETTE_INTERFACE_H -#define KWAYLAND_SERVER_DECORATION_PALETTE_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" +struct wl_resource; -#include +#include +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class Display; class SurfaceInterface; class ServerSideDecorationPaletteInterface; +class ServerSideDecorationPaletteManagerInterfacePrivate; +class ServerSideDecorationPaletteInterfacePrivate; /** * Allows a client to specify a preferred palette to use for server-side window decorations * * This global can be used for clients to bind ServerSideDecorationPaletteInterface instances * and notifies when a new one is created - * @since 5.42 */ -class KWAYLANDSERVER_EXPORT ServerSideDecorationPaletteManagerInterface : public Global +class KWAYLANDSERVER_EXPORT ServerSideDecorationPaletteManagerInterface : public QObject { Q_OBJECT + public: - virtual ~ServerSideDecorationPaletteManagerInterface(); + explicit ServerSideDecorationPaletteManagerInterface(Display *display, QObject *parent = nullptr); + ~ServerSideDecorationPaletteManagerInterface() override; /** * Returns any existing palette for a given surface * This returns a null pointer if no ServerSideDecorationPaletteInterface exists. */ - ServerSideDecorationPaletteInterface* paletteForSurface(SurfaceInterface *); + ServerSideDecorationPaletteInterface *paletteForSurface(SurfaceInterface *); Q_SIGNALS: /** * Emitted whenever a new ServerSideDecorationPaletteInterface is created. - **/ - void paletteCreated(KWayland::Server::ServerSideDecorationPaletteInterface*); + */ + void paletteCreated(KWaylandServer::ServerSideDecorationPaletteInterface *); private: - explicit ServerSideDecorationPaletteManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; + QScopedPointer d; }; /** * Provides the palette * This interface is attached to a wl_surface and informs the server of a requested palette - * @since 5.42 */ -class KWAYLANDSERVER_EXPORT ServerSideDecorationPaletteInterface : public Resource +class KWAYLANDSERVER_EXPORT ServerSideDecorationPaletteInterface : public QObject { Q_OBJECT public: - virtual ~ServerSideDecorationPaletteInterface(); + ~ServerSideDecorationPaletteInterface() override; /** * @returns the palette or an empty string if unset @@ -83,7 +64,7 @@ /** * @returns The SurfaceInterface this ServerSideDecorationPaletteInterface references. - **/ + */ SurfaceInterface *surface() const; Q_SIGNALS: @@ -93,14 +74,10 @@ void paletteChanged(const QString &palette); private: - explicit ServerSideDecorationPaletteInterface(ServerSideDecorationPaletteManagerInterface *parent, SurfaceInterface *s, wl_resource *parentResource); - friend class ServerSideDecorationPaletteManagerInterface; + explicit ServerSideDecorationPaletteInterface(SurfaceInterface *surface, wl_resource *resource); + friend class ServerSideDecorationPaletteManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/shadow_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/shadow_interface.cpp --- dwayland-5.57.0.23/src/server/shadow_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shadow_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,144 +1,95 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "shadow_interface.h" -#include "buffer_interface.h" +#include "clientbuffer.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" #include "surface_interface_p.h" -#include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 2; -class ShadowManagerInterface::Private : public Global::Private +class ShadowManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_shadow_manager { public: - Private(ShadowManagerInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createShadow(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - static void unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface); - static void destroyCallback(wl_client *client, wl_resource *resource); - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } + ShadowManagerInterfacePrivate(ShadowManagerInterface *_q, Display *display); ShadowManagerInterface *q; - static const struct org_kde_kwin_shadow_manager_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ShadowManagerInterface::Private::s_version = 2; + Display *display; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_shadow_manager_interface ShadowManagerInterface::Private::s_interface = { - createCallback, - unsetCallback, - destroyCallback +protected: + void org_kde_kwin_shadow_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; + void org_kde_kwin_shadow_manager_unset(Resource *resource, wl_resource *surface) override; + void org_kde_kwin_shadow_manager_destroy(Resource *resource) override; }; -#endif - -ShadowManagerInterface::Private::Private(ShadowManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_shadow_manager_interface, s_version) - , q(q) -{ -} - -void ShadowManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_shadow_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void ShadowManagerInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} -void ShadowManagerInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) +ShadowManagerInterfacePrivate::ShadowManagerInterfacePrivate(ShadowManagerInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_shadow_manager(*display, s_version) + , q(_q) + , display(display) { - Q_UNUSED(client) - wl_resource_destroy(resource); } -void ShadowManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void ShadowManagerInterfacePrivate::org_kde_kwin_shadow_manager_destroy(Resource *resource) { - cast(resource)->createShadow(client, resource, id, surface); + wl_resource_destroy(resource->handle); } -void ShadowManagerInterface::Private::createShadow(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) +void ShadowManagerInterfacePrivate::org_kde_kwin_shadow_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - ShadowInterface *shadow = new ShadowInterface(q, resource); - shadow->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!shadow->resource()) { - wl_resource_post_no_memory(resource); - delete shadow; + wl_resource *shadow_resource = wl_resource_create(resource->client(), &org_kde_kwin_shadow_interface, resource->version(), id); + if (!shadow_resource) { + wl_client_post_no_memory(resource->client()); return; } - s->d_func()->setShadow(QPointer(shadow)); + + auto shadow = new ShadowInterface(q, shadow_resource); + + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setShadow(QPointer(shadow)); } -void ShadowManagerInterface::Private::unsetCallback(wl_client *client, wl_resource *resource, wl_resource *surface) +void ShadowManagerInterfacePrivate::org_kde_kwin_shadow_manager_unset(Resource *resource, wl_resource *surface) { - Q_UNUSED(client) Q_UNUSED(resource) SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - s->d_func()->setShadow(QPointer()); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setShadow(QPointer()); } ShadowManagerInterface::ShadowManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new ShadowManagerInterfacePrivate(this, display)) { } ShadowManagerInterface::~ShadowManagerInterface() = default; -class ShadowInterface::Private : public Resource::Private +Display *ShadowManagerInterface::display() const +{ + return d->display; +} + +class ShadowInterfacePrivate : public QtWaylandServer::org_kde_kwin_shadow { public: - Private(ShadowInterface *q, ShadowManagerInterface *c, wl_resource *parentResource); - ~Private(); + ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource); + ~ShadowInterfacePrivate(); struct State { enum Flags { @@ -151,82 +102,58 @@ BottomRightBuffer = 1 << 5, BottomBuffer = 1 << 6, BottomLeftBuffer = 1 << 7, - Offset = 1 << 8 + Offset = 1 << 8, }; - BufferInterface *left = nullptr; - BufferInterface *topLeft = nullptr; - BufferInterface *top = nullptr; - BufferInterface *topRight = nullptr; - BufferInterface *right = nullptr; - BufferInterface *bottomRight = nullptr; - BufferInterface *bottom = nullptr; - BufferInterface *bottomLeft = nullptr; + QPointer left; + QPointer topLeft; + QPointer top; + QPointer topRight; + QPointer right; + QPointer bottomRight; + QPointer bottom; + QPointer bottomLeft; QMarginsF offset; - Flags flags = Flags::None; + Flags flags = Flags::None; }; - State current; - State pending; -private: void commit(); void attach(State::Flags flag, wl_resource *buffer); - ShadowInterface *q_func() { - return reinterpret_cast(q); - } - static void commitCallback(wl_client *client, wl_resource *resource); - static void attachLeftCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachTopLeftCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachTopCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachTopRightCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachRightCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachBottomRightCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachBottomCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void attachBottomLeftCallback(wl_client *client, wl_resource *resource, wl_resource *buffer); - static void offsetLeftCallback(wl_client *client, wl_resource *resource, wl_fixed_t offset); - static void offsetTopCallback(wl_client *client, wl_resource *resource, wl_fixed_t offset); - static void offsetRightCallback(wl_client *client, wl_resource *resource, wl_fixed_t offset); - static void offsetBottomCallback(wl_client *client, wl_resource *resource, wl_fixed_t offset); - - static const struct org_kde_kwin_shadow_interface s_interface; -}; + ShadowManagerInterface *manager; + State current; + State pending; + ShadowInterface *q; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_shadow_interface ShadowInterface::Private::s_interface = { - commitCallback, - attachLeftCallback, - attachTopLeftCallback, - attachTopCallback, - attachTopRightCallback, - attachRightCallback, - attachBottomRightCallback, - attachBottomCallback, - attachBottomLeftCallback, - offsetLeftCallback, - offsetTopCallback, - offsetRightCallback, - offsetBottomCallback, - resourceDestroyedCallback +protected: + void org_kde_kwin_shadow_destroy_resource(Resource *resource) override; + void org_kde_kwin_shadow_commit(Resource *resource) override; + void org_kde_kwin_shadow_attach_left(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_top_left(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_top(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_top_right(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_right(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_bottom_right(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_bottom(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_attach_bottom_left(Resource *resource, wl_resource *buffer) override; + void org_kde_kwin_shadow_set_left_offset(Resource *resource, wl_fixed_t offset) override; + void org_kde_kwin_shadow_set_top_offset(Resource *resource, wl_fixed_t offset) override; + void org_kde_kwin_shadow_set_right_offset(Resource *resource, wl_fixed_t offset) override; + void org_kde_kwin_shadow_set_bottom_offset(Resource *resource, wl_fixed_t offset) override; + void org_kde_kwin_shadow_destroy(Resource *resource) override; }; -#endif -void ShadowInterface::Private::commitCallback(wl_client *client, wl_resource *resource) +void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource) { - Q_UNUSED(client) - cast(resource)->commit(); -} - -void ShadowInterface::Private::commit() -{ -#define BUFFER( __FLAG__, __PART__ ) \ - if (pending.flags & State::Flags::__FLAG__##Buffer) { \ - if (current.__PART__) { \ - current.__PART__->unref(); \ - } \ - if (pending.__PART__) { \ - pending.__PART__->ref(); \ - } \ - current.__PART__ = pending.__PART__; \ + Q_UNUSED(resource) +#define BUFFER(__FLAG__, __PART__) \ + if (pending.flags & State::Flags::__FLAG__##Buffer) { \ + if (current.__PART__) { \ + current.__PART__->unref(); \ + } \ + if (pending.__PART__) { \ + pending.__PART__->ref(); \ + } \ + current.__PART__ = pending.__PART__; \ } BUFFER(Left, left) BUFFER(TopLeft, topLeft) @@ -244,43 +171,9 @@ pending = State(); } -void ShadowInterface::Private::attach(ShadowInterface::Private::State::Flags flag, wl_resource *buffer) +void ShadowInterfacePrivate::attach(ShadowInterfacePrivate::State::Flags flag, wl_resource *buffer) { - BufferInterface *b = BufferInterface::get(buffer); - if (b) { - QObject::connect(b, &BufferInterface::aboutToBeDestroyed, q, - [this](BufferInterface *buffer) { - #define PENDING( __PART__ ) \ - if (pending.__PART__ == buffer) { \ - pending.__PART__ = nullptr; \ - } - PENDING(left) - PENDING(topLeft) - PENDING(top) - PENDING(topRight) - PENDING(right) - PENDING(bottomRight) - PENDING(bottom) - PENDING(bottomLeft) - #undef PENDING - - #define CURRENT( __PART__ ) \ - if (current.__PART__ == buffer) { \ - current.__PART__->unref(); \ - current.__PART__ = nullptr; \ - } - CURRENT(left) - CURRENT(topLeft) - CURRENT(top) - CURRENT(topRight) - CURRENT(right) - CURRENT(bottomRight) - CURRENT(bottom) - CURRENT(bottomLeft) - #undef CURRENT - } - ); - } + ClientBuffer *b = manager->display()->clientBufferForResource(buffer); switch (flag) { case State::LeftBuffer: pending.left = b; @@ -313,52 +206,104 @@ pending.flags = State::Flags(pending.flags | flag); } -#define ATTACH( __PART__ ) \ -void ShadowInterface::Private::attach##__PART__##Callback(wl_client *client, wl_resource *resource, wl_resource *buffer) \ -{ \ - Q_UNUSED(client) \ - Private *p = cast(resource); \ - p->attach(State::__PART__##Buffer, buffer); \ +void ShadowInterfacePrivate::org_kde_kwin_shadow_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); } -ATTACH(Left) -ATTACH(TopLeft) -ATTACH(Top) -ATTACH(TopRight) -ATTACH(Right) -ATTACH(BottomRight) -ATTACH(Bottom) -ATTACH(BottomLeft) +void ShadowInterfacePrivate::org_kde_kwin_shadow_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} -#undef ATTACH +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_left(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::LeftBuffer, buffer); +} -#define OFFSET( __PART__ ) \ -void ShadowInterface::Private::offset##__PART__##Callback(wl_client *client, wl_resource *resource, wl_fixed_t offset) \ -{ \ - Q_UNUSED(client) \ - Q_UNUSED(resource) \ - Private *p = cast(resource); \ - p->pending.flags = State::Flags(p->pending.flags | State::Offset); \ - p->pending.offset.set##__PART__(wl_fixed_to_double(offset)); \ +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top_left(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::TopLeftBuffer, buffer); } -OFFSET(Left) -OFFSET(Top) -OFFSET(Right) -OFFSET(Bottom) +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::TopBuffer, buffer); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top_right(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::TopRightBuffer, buffer); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_right(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::RightBuffer, buffer); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom_right(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::BottomRightBuffer, buffer); +} -#undef OFFSET +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom(Resource *resource, wl_resource *buffer) +{ + Q_UNUSED(resource) + attach(State::BottomBuffer, buffer); +} -ShadowInterface::Private::Private(ShadowInterface *q, ShadowManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_shadow_interface, &s_interface) +void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom_left(Resource *resource, wl_resource *buffer) { + Q_UNUSED(resource) + attach(State::BottomLeftBuffer, buffer); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_set_left_offset(Resource *resource, wl_fixed_t offset) +{ + Q_UNUSED(resource) + pending.flags = State::Flags(pending.flags | State::Offset); + pending.offset.setLeft(wl_fixed_to_double(offset)); } -ShadowInterface::Private::~Private() +void ShadowInterfacePrivate::org_kde_kwin_shadow_set_top_offset(Resource *resource, wl_fixed_t offset) { -#define CURRENT( __PART__ ) \ - if (current.__PART__) { \ - current.__PART__->unref(); \ + Q_UNUSED(resource) + pending.flags = State::Flags(pending.flags | State::Offset); + pending.offset.setTop(wl_fixed_to_double(offset)); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_set_right_offset(Resource *resource, wl_fixed_t offset) +{ + Q_UNUSED(resource) + pending.flags = State::Flags(pending.flags | State::Offset); + pending.offset.setRight(wl_fixed_to_double(offset)); +} + +void ShadowInterfacePrivate::org_kde_kwin_shadow_set_bottom_offset(Resource *resource, wl_fixed_t offset) +{ + Q_UNUSED(resource) + pending.flags = State::Flags(pending.flags | State::Offset); + pending.offset.setBottom(wl_fixed_to_double(offset)); +} + +ShadowInterfacePrivate::ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_shadow(resource) + , q(_q) +{ +} + +ShadowInterfacePrivate::~ShadowInterfacePrivate() +{ +#define CURRENT(__PART__) \ + if (current.__PART__) { \ + current.__PART__->unref(); \ } CURRENT(left) CURRENT(topLeft) @@ -371,25 +316,25 @@ #undef CURRENT } -ShadowInterface::ShadowInterface(ShadowManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +ShadowInterface::ShadowInterface(ShadowManagerInterface *manager, wl_resource *resource) + : QObject() + , d(new ShadowInterfacePrivate(this, resource)) { + d->manager = manager; } ShadowInterface::~ShadowInterface() = default; QMarginsF ShadowInterface::offset() const { - Q_D(); return d->current.offset; } -#define BUFFER( __PART__ ) \ -BufferInterface *ShadowInterface::__PART__() const \ -{ \ - Q_D(); \ - return d->current.__PART__; \ -} +#define BUFFER(__PART__) \ + ClientBuffer *ShadowInterface::__PART__() const \ + { \ + return d->current.__PART__; \ + } BUFFER(left) BUFFER(topLeft) @@ -400,10 +345,4 @@ BUFFER(bottom) BUFFER(bottomLeft) -ShadowInterface::Private *ShadowInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} } diff -Nru dwayland-5.57.0.23/src/server/shadow_interface.h dwayland-5.57.0.24+really5.24.3/src/server/shadow_interface.h --- dwayland-5.57.0.23/src/server/shadow_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shadow_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,85 +1,60 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_SERVER_SHADOW_INTERFACE_H -#define KWAYLAND_SERVER_SHADOW_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" - -#include #include +#include -#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; -class BufferInterface; +namespace KWaylandServer +{ +class ClientBuffer; class Display; +class ShadowManagerInterfacePrivate; +class ShadowInterfacePrivate; -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT ShadowManagerInterface : public Global +class KWAYLANDSERVER_EXPORT ShadowManagerInterface : public QObject { Q_OBJECT + public: - virtual ~ShadowManagerInterface(); + explicit ShadowManagerInterface(Display *display, QObject *parent = nullptr); + ~ShadowManagerInterface() override; + + Display *display() const; private: - explicit ShadowManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT ShadowInterface : public Resource +class KWAYLANDSERVER_EXPORT ShadowInterface : public QObject { Q_OBJECT public: - virtual ~ShadowInterface(); + ~ShadowInterface() override; - BufferInterface *left() const; - BufferInterface *topLeft() const; - BufferInterface *top() const; - BufferInterface *topRight() const; - BufferInterface *right() const; - BufferInterface *bottomRight() const; - BufferInterface *bottom() const; - BufferInterface *bottomLeft() const; + ClientBuffer *left() const; + ClientBuffer *topLeft() const; + ClientBuffer *top() const; + ClientBuffer *topRight() const; + ClientBuffer *right() const; + ClientBuffer *bottomRight() const; + ClientBuffer *bottom() const; + ClientBuffer *bottomLeft() const; QMarginsF offset() const; private: - explicit ShadowInterface(ShadowManagerInterface *parent, wl_resource *parentResource); - friend class ShadowManagerInterface; + explicit ShadowInterface(ShadowManagerInterface *manager, wl_resource *resource); + friend class ShadowManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/shell_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/shell_interface.cpp --- dwayland-5.57.0.23/src/server/shell_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shell_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,475 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "shell_interface.h" -#include "generic_shell_surface_p.h" -#include "global_p.h" -#include "resource_p.h" -#include "display.h" -#include "surface_interface.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ - -class ShellInterface::Private : public Global::Private -{ -public: - Private(ShellInterface *q, Display *d); - - QList surfaces; - -private: - static void createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - - ShellInterface *q; - static const struct wl_shell_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ShellInterface::Private::s_version = 1; - -ShellInterface::Private::Private(ShellInterface *q, Display *d) - : Global::Private(d, &wl_shell_interface, s_version) - , q(q) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_shell_interface ShellInterface::Private::s_interface = { - createSurfaceCallback -}; -#endif - - -class ShellSurfaceInterface::Private : public Resource::Private, public GenericShellSurface -{ -public: - Private(ShellSurfaceInterface *q, ShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource); - void ping(); - - QScopedPointer pingTimer; - quint32 pingSerial = 0; - enum class WindowMode { - Fullscreen, - Toplevel, - Maximized, - Popup - }; - WindowMode windowMode = WindowMode::Toplevel; - QPoint transientOffset; - QPointer transientFor; - bool acceptsKeyboardFocus = true; - void setWindowMode(WindowMode newWindowMode); - - ShellSurfaceInterface *q_func() { - return reinterpret_cast(q); - } - -private: - // interface callbacks - static void pongCallback(wl_client *client, wl_resource *resource, uint32_t serial); - static void setToplevelCallback(wl_client *client, wl_resource *resource); - static void setTransientCallback(wl_client *client, wl_resource *resource, wl_resource *parent, - int32_t x, int32_t y, uint32_t flags); - static void setFullscreenCallback(wl_client *client, wl_resource *resource, uint32_t method, - uint32_t framerate, wl_resource *output); - static void setPopupCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, - wl_resource *parent, int32_t x, int32_t y, uint32_t flags); - static void setMaximizedCallback(wl_client *client, wl_resource *resource, wl_resource *output); - - void pong(quint32 serial); - void setAcceptsFocus(quint32 flags); - - static const struct wl_shell_surface_interface s_interface; -}; - -ShellInterface::ShellInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -ShellInterface::~ShellInterface() = default; - -void ShellInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *shell = c->createResource(&wl_shell_interface, qMin(version, s_version), id); - if (!shell) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(shell, &s_interface, this, nullptr); -} - -void ShellInterface::Private::createSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface) -{ - auto s = reinterpret_cast(wl_resource_get_user_data(resource)); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void ShellInterface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](ShellSurfaceInterface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), WL_SHELL_ERROR_ROLE, "ShellSurface already created"); - return; - } - ShellSurfaceInterface *shellSurface = new ShellSurfaceInterface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &ShellSurfaceInterface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - shellSurface->d->create(display->getConnection(client), version, id); - emit q->surfaceCreated(shellSurface); -} - -/********************************* - * ShellSurfaceInterface - *********************************/ -ShellSurfaceInterface::Private::Private(ShellSurfaceInterface *q, ShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource) - : Resource::Private(q, shell, parentResource, &wl_shell_surface_interface, &s_interface) - , GenericShellSurface(q, surface) - , pingTimer(new QTimer) -{ - pingTimer->setSingleShot(true); - pingTimer->setInterval(1000); -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_shell_surface_interface ShellSurfaceInterface::Private::s_interface = { - pongCallback, - moveCallback, - resizeCallback, - setToplevelCallback, - setTransientCallback, - setFullscreenCallback, - setPopupCallback, - setMaximizedCallback, - setTitleCallback, - setAppIdCallback -}; -#endif - -ShellSurfaceInterface::ShellSurfaceInterface(ShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, shell, parent, parentResource)) -{ - Q_D(); - connect(d->pingTimer.data(), &QTimer::timeout, this, &ShellSurfaceInterface::pingTimeout); - auto unsetSurface = [this] { - Q_D(); - d->surface = nullptr; - }; - connect(parent, &Resource::unbound, this, unsetSurface); - connect(parent, &QObject::destroyed, this, unsetSurface); -} - -ShellSurfaceInterface::~ShellSurfaceInterface() = default; - -void ShellSurfaceInterface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->pong(serial); -} - -void ShellSurfaceInterface::Private::pong(quint32 serial) -{ - if (pingTimer->isActive() && serial == pingSerial) { - pingTimer->stop(); - Q_Q(ShellSurfaceInterface); - emit q->pongReceived(); - } -} - -void ShellSurfaceInterface::ping() -{ - Q_D(); - if (!d->resource) { - return; - } - d->ping(); -} - -void ShellSurfaceInterface::Private::ping() -{ - if (pingTimer->isActive()) { - return; - } - pingSerial = global->display()->nextSerial(); - wl_shell_surface_send_ping(resource, pingSerial); - client->flush(); - pingTimer->start(); -} - -void ShellSurfaceInterface::setPingTimeout(uint msec) -{ - Q_D(); - d->pingTimer->setInterval(msec); -} - -bool ShellSurfaceInterface::isPinged() const -{ - Q_D(); - return d->pingTimer->isActive(); -} - -void ShellSurfaceInterface::requestSize(const QSize &size) -{ - Q_D(); - if (!d->resource) { - return; - } - // TODO: what about the edges? - wl_shell_surface_send_configure(d->resource, 0, size.width(), size.height()); - d->client->flush(); -} - -namespace { -template <> -Qt::Edges edgesToQtEdges(wl_shell_surface_resize edges) -{ - Qt::Edges qtEdges; - switch (edges) { - case WL_SHELL_SURFACE_RESIZE_TOP: - qtEdges = Qt::TopEdge; - break; - case WL_SHELL_SURFACE_RESIZE_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case WL_SHELL_SURFACE_RESIZE_LEFT: - qtEdges = Qt::LeftEdge; - break; - case WL_SHELL_SURFACE_RESIZE_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case WL_SHELL_SURFACE_RESIZE_RIGHT: - qtEdges = Qt::RightEdge; - break; - case WL_SHELL_SURFACE_RESIZE_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case WL_SHELL_SURFACE_RESIZE_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - return qtEdges; -} -} - -void ShellSurfaceInterface::Private::setToplevelCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->setWindowMode(WindowMode::Toplevel); -} - -void ShellSurfaceInterface::Private::setTransientCallback(wl_client *client, wl_resource *resource, wl_resource *parent, - int32_t x, int32_t y, uint32_t flags) -{ - Q_UNUSED(flags) - auto s = cast(resource); - Q_ASSERT(client == *s->client); - auto surface = SurfaceInterface::get(parent); - if (surface && s->surface == surface) { - wl_resource_post_error(surface->resource(), WL_SHELL_ERROR_ROLE, "Cannot be a transient to itself"); - return; - } - s->transientFor = QPointer(surface); - s->transientOffset = QPoint(x, y); - emit s->q_func()->transientChanged(!s->transientFor.isNull()); - emit s->q_func()->transientOffsetChanged(s->transientOffset); - emit s->q_func()->transientForChanged(); - s->setAcceptsFocus(flags); -} - -void ShellSurfaceInterface::Private::setAcceptsFocus(quint32 flags) -{ - const bool acceptsFocus = !(flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE); - if (acceptsFocus != acceptsKeyboardFocus) { - acceptsKeyboardFocus = acceptsFocus; - Q_Q(ShellSurfaceInterface); - emit q->acceptsKeyboardFocusChanged(); - } -} - -void ShellSurfaceInterface::Private::setFullscreenCallback(wl_client *client, wl_resource *resource, uint32_t method, - uint32_t framerate, wl_resource *output) -{ - Q_UNUSED(method) - Q_UNUSED(framerate) - Q_UNUSED(output) - auto s = cast(resource); - Q_ASSERT(client == *s->client); - // TODO: add method, framerate and output - s->setWindowMode(WindowMode::Fullscreen); -} - -void ShellSurfaceInterface::Private::setWindowMode(WindowMode newWindowMode) -{ - if (windowMode == newWindowMode) { - return; - } - const WindowMode oldWindowMode = windowMode; - windowMode = newWindowMode; - Q_Q(ShellSurfaceInterface); - if (oldWindowMode == WindowMode::Fullscreen || newWindowMode == WindowMode::Fullscreen) { - emit q->fullscreenChanged(windowMode == WindowMode::Fullscreen); - } - if (oldWindowMode == WindowMode::Toplevel || newWindowMode == WindowMode::Toplevel) { - emit q->toplevelChanged(windowMode == WindowMode::Toplevel); - } - if (oldWindowMode == WindowMode::Maximized || newWindowMode == WindowMode::Maximized) { - emit q->maximizedChanged(windowMode == WindowMode::Maximized); - } - if (oldWindowMode == WindowMode::Popup || newWindowMode == WindowMode::Popup) { - emit q->popupChanged(windowMode == WindowMode::Popup); - } -} - -void ShellSurfaceInterface::Private::setPopupCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, - wl_resource *parent, int32_t x, int32_t y, uint32_t flags) -{ - Q_UNUSED(seat) - Q_UNUSED(serial) - Q_UNUSED(flags) - auto s = cast(resource); - Q_ASSERT(client == *s->client); - // TODO: what about seat and serial? - s->transientFor = QPointer(SurfaceInterface::get(parent)); - s->transientOffset = QPoint(x, y); - s->setWindowMode(WindowMode::Popup); - emit s->q_func()->transientChanged(!s->transientFor.isNull()); - emit s->q_func()->transientOffsetChanged(s->transientOffset); - emit s->q_func()->transientForChanged(); - // we ignore the flags as Qt requests keyboard focus for popups - // if we would honor the flag this could break compositors - // compare QtWayland (5.6), file qwaylandwlshellsurface.cpp:208 - s->setAcceptsFocus(WL_SHELL_SURFACE_TRANSIENT_INACTIVE); -} - -void ShellSurfaceInterface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource, wl_resource *output) -{ - Q_UNUSED(output) - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->setWindowMode(WindowMode::Maximized); -} - -SurfaceInterface *ShellSurfaceInterface::surface() const { - Q_D(); - return d->surface; -} - -ShellInterface *ShellSurfaceInterface::shell() const { - Q_D(); - return reinterpret_cast(d->global); -} - -QString ShellSurfaceInterface::title() const { - Q_D(); - return d->title; -} - -QByteArray ShellSurfaceInterface::windowClass() const { - Q_D(); - return d->windowClass; -} - -bool ShellSurfaceInterface::isFullscreen() const { - Q_D(); - return d->windowMode == Private::WindowMode::Fullscreen; -} - -bool ShellSurfaceInterface::isToplevel() const { - Q_D(); - return d->windowMode == Private::WindowMode::Toplevel; -} - -bool ShellSurfaceInterface::isMaximized() const { - Q_D(); - return d->windowMode == Private::WindowMode::Maximized; -} - -bool ShellSurfaceInterface::isPopup() const -{ - Q_D(); - return d->windowMode == Private::WindowMode::Popup; -} - -bool ShellSurfaceInterface::isTransient() const -{ - Q_D(); - return !d->transientFor.isNull(); -} - -QPoint ShellSurfaceInterface::transientOffset() const -{ - Q_D(); - return d->transientOffset; -} - -bool ShellSurfaceInterface::acceptsKeyboardFocus() const -{ - Q_D(); - return d->acceptsKeyboardFocus; -} - -void ShellSurfaceInterface::popupDone() -{ - Q_D(); - if (isPopup() && d->resource) { - wl_shell_surface_send_popup_done(d->resource); - } -} - -QPointer< SurfaceInterface > ShellSurfaceInterface::transientFor() const -{ - Q_D(); - return d->transientFor; -} - -ShellSurfaceInterface::Private *ShellSurfaceInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/shell_interface.h dwayland-5.57.0.24+really5.24.3/src/server/shell_interface.h --- dwayland-5.57.0.23/src/server/shell_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shell_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SHELL_INTERFACE_H -#define WAYLAND_SERVER_SHELL_INTERFACE_H - -#include - -#include -#include "seat_interface.h" - -#include "global.h" -#include "resource.h" - -class QSize; -struct wl_resource; - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SeatInterface; -class SurfaceInterface; -class ShellSurfaceInterface; -template -class GenericShellSurface; - -/** - * @brief Global for the wl_shell interface. - * - * @see ShellSurfaceInterface - * @see SurfaceInterface - **/ -class KWAYLANDSERVER_EXPORT ShellInterface : public Global -{ - Q_OBJECT -public: - virtual ~ShellInterface(); - -Q_SIGNALS: - /** - * Emitted whenever a new ShellSurfaceInterface gets created for a SurfaceInterface. - **/ - void surfaceCreated(KWayland::Server::ShellSurfaceInterface*); - -private: - friend class Display; - explicit ShellInterface(Display *display, QObject *parent); - class Private; -}; - -/** - * @brief Resource for a wl_shell_surface. - * - * The ShellSurfaceInterface represents a "normal window". It gets created for a - * SurfaceInterface, thus has visible content. Through the ShellSurfaceInterface the - * client can specify further meta-information about how the SurfaceInterface should be - * represented. - * - * @see SurfaceInterface - * @see ShellInterface - **/ -class KWAYLANDSERVER_EXPORT ShellSurfaceInterface : public Resource -{ - Q_OBJECT - /** - * The window title - **/ - Q_PROPERTY(QString title READ title NOTIFY titleChanged) - /** - * The window class, representing the desktop file name. - **/ - Q_PROPERTY(QByteArray windowClass READ windowClass NOTIFY windowClassChanged) - /** - * Whether the window is fullscreen. - **/ - Q_PROPERTY(bool fullscreen READ isFullscreen NOTIFY fullscreenChanged) - /** - * Whether the window is a normal toplevel window (not a child). - **/ - Q_PROPERTY(bool toplevel READ isToplevel NOTIFY toplevelChanged) - /** - * Whether the window is maximized. - **/ - Q_PROPERTY(bool maximized READ isMaximized NOTIFY maximizedChanged) - /** - * Whether the ShellSurfaceInterface is a popup for another SurfaceInterface. - * - * Popup implies transient. - * @since 5.5 - **/ - Q_PROPERTY(bool popup READ isPopup NOTIFY popupChanged) - /** - * Whether the ShellSurfaceInterface is a transient for another SurfaceInterface. - * - * Popup implies transient. - * @since 5.5 - **/ - Q_PROPERTY(bool transient READ isTransient NOTIFY transientChanged) - /** - * Offset of the upper left corner in the parent SurfaceInterface's coordinate system. - * @since 5.5 - **/ - Q_PROPERTY(QPoint transientOffset READ transientOffset NOTIFY transientOffsetChanged) - /** - * Whether the ShellSurfaceInterface can accept keyboard focus. - * - * By default ShellSurfaceInterface accepts keyboard focus, only transient surfaces - * might not want keyboard focus. - * - * @since 5.5 - **/ - Q_PROPERTY(bool acceptsKeyboardFocus READ acceptsKeyboardFocus NOTIFY acceptsKeyboardFocusChanged) -public: - virtual ~ShellSurfaceInterface(); - - /** - * Pings the client. - * The client is required to send a pong. If that is not received in the times tamp - * set through setPingTimeout the signal @link pingTimeout @endlink will be emitted. - * If a pong is received the signal @link pongReceived @endlink will be emitted. - * - * @see setPingTimeout - * @see pingTimeout - * @see pongReceived - * @see isPinged - **/ - void ping(); - /** - * Sets the ping time out for @link ping @endlink requests to @p msec. - * - * @param msec The time out in msec - * @see ping - * @see isPinged - **/ - void setPingTimeout(uint msec); - /** - * @returns whether the ShellSurfaceInterface got pinged, but no pong received. - * @see ping - **/ - bool isPinged() const; - /** - * Requests that the ShellSurfaceInterface resizes the SurfaceInterface to @p size. - **/ - void requestSize(const QSize &size); - - /** - * @return The SurfaceInterface this ShellSurfaceInterface got created for. - **/ - SurfaceInterface *surface() const; - /** - * @returns The ShellInterface which created this ShellSurfaceInterface. - **/ - ShellInterface *shell() const; - - QString title() const; - QByteArray windowClass() const; - bool isFullscreen() const; - bool isToplevel() const; - bool isMaximized() const; - /** - * @returns @c true if the ShellSurfaceInterface is a popup. - * @see isTransient - * @see transientOffset - * @see transientFor - * @since 5.5 - **/ - bool isPopup() const; - /** - * @returns @c true if the ShellSurfaceInterface is a transient or popup for another SurfaceInterface. - * @see isPopup - * @see transientOffset - * @see transientFor - * @since 5.5 - **/ - bool isTransient() const; - /** - * In case the ShellSurfaceInterface is a transient this is the offset of the ShellSurfaceInterface - * in the coordinate system of the SurfaceInterface this surface is a transient for. - * - * @returns offset in parent coordinate system. - * @see isTransient - * @see transientFor - * @since 5.5 - **/ - QPoint transientOffset() const; - /** - * The SurfaceInterface for which this ShellSurfaceInterface is a transient. - * This is only relevant if the ShellSurfaceInterface is either a transient or a - * popup. - * - * The transientOffset is in the local coordinate system of the SurfaceInterface - * returned by this method. - * - * @returns The SurfaceInterface for which this Surface is a transient - * @see isTransient - * @see isPopup - * @see transientOffset - * @since 5.5 - **/ - QPointer transientFor() const; - - /** - * Whether the ShellSurfaceInterface can accept keyboard focus. - * - * This is only relevant for transient and popup windows. By default all ShellSurfaces - * accept keyboard focus. - * - * @returns Whether the ShellSurfaceInterface can accept keyboard focus. - * @see isTransient() - * @see acceptsKeyboardFocusChanged - * @since 5.5 - **/ - bool acceptsKeyboardFocus() const; - - /** - * Sends a popup done event to the shell surface. - * This is only relevant for popup windows. It indicates that the popup grab - * got canceled. This happens when e.g. the user clicks outside of any surface - * of the same client as this ShellSurfaceInterface. It is the task of the - * compositor to send the popupDone event appropriately. - * - * @see isPopup - * @since 5.33 - **/ - void popupDone(); - -Q_SIGNALS: - /** - * Emitted whenever the title changes. - **/ - void titleChanged(const QString&); - /** - * Emitted whenever the window class changes. - **/ - void windowClassChanged(const QByteArray&); - /** - * Emitted when the ping timed out. - * @see ping - * @see pingTimeout - * @see isPinged - **/ - void pingTimeout(); - /** - * Emitted when the server received a pong for this ShellSurfaceInterface. - **/ - void pongReceived(); - void fullscreenChanged(bool); - void toplevelChanged(bool); - void maximizedChanged(bool); - /** - * @since 5.5 - **/ - void popupChanged(bool); - /** - * @since 5.5 - **/ - void transientChanged(bool); - /** - * @since 5.5 - **/ - void transientOffsetChanged(const QPoint&); - /** - * @since 5.5 - **/ - void transientForChanged(); - /** - * @since 5.5 - **/ - void acceptsKeyboardFocusChanged(); - /** - * The surface requested a window move. - * - * @param seat The SeatInterface on which the surface requested the move - * @param serial The serial of the implicit mouse grab which triggered the move - * @since 5.5 - **/ - void moveRequested(KWayland::Server::SeatInterface *seat, quint32 serial); - /** - * The surface requested a window resize. - * - * @param seat The SeatInterface on which the surface requested the resize - * @param serial The serial of the implicit mouse grab which triggered the resize - * @param edges A hint which edges are involved in the resize - * @since 5.5 - **/ - void resizeRequested(KWayland::Server::SeatInterface *seat, quint32 serial, Qt::Edges edges); - -private: - friend class ShellInterface; - explicit ShellSurfaceInterface(ShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource); - friend class GenericShellSurface; - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/shmclientbuffer.cpp dwayland-5.57.0.24+really5.24.3/src/server/shmclientbuffer.cpp --- dwayland-5.57.0.23/src/server/shmclientbuffer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shmclientbuffer.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,190 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "shmclientbuffer.h" +#include "clientbuffer_p.h" +#include "display.h" + +#include +#include + +namespace KWaylandServer +{ +static const ShmClientBuffer *s_accessedBuffer = nullptr; +static int s_accessCounter = 0; + +class ShmClientBufferPrivate : public ClientBufferPrivate +{ +public: + ShmClientBufferPrivate(ShmClientBuffer *q); + + static void buffer_destroy_callback(wl_listener *listener, void *data); + + ShmClientBuffer *q; + QImage::Format format = QImage::Format_Invalid; + uint32_t width = 0; + uint32_t height = 0; + bool hasAlphaChannel = false; + QImage savedData; + + struct DestroyListener { + wl_listener listener; + ShmClientBufferPrivate *receiver; + }; + DestroyListener destroyListener; +}; + +ShmClientBufferPrivate::ShmClientBufferPrivate(ShmClientBuffer *q) + : q(q) +{ +} + +static void cleanupShmPool(void *poolHandle) +{ + wl_shm_pool_unref(static_cast(poolHandle)); +} + +void ShmClientBufferPrivate::buffer_destroy_callback(wl_listener *listener, void *data) +{ + Q_UNUSED(data) + + auto bufferPrivate = reinterpret_cast(listener)->receiver; + wl_shm_buffer *buffer = wl_shm_buffer_get(bufferPrivate->q->resource()); + wl_shm_pool *pool = wl_shm_buffer_ref_pool(buffer); + + wl_list_remove(&bufferPrivate->destroyListener.listener.link); + wl_list_init(&bufferPrivate->destroyListener.listener.link); + + bufferPrivate->savedData = QImage(static_cast(wl_shm_buffer_get_data(buffer)), + bufferPrivate->width, + bufferPrivate->height, + wl_shm_buffer_get_stride(buffer), + bufferPrivate->format, + cleanupShmPool, + pool); +} + +static bool alphaChannelFromFormat(uint32_t format) +{ + switch (format) { + case WL_SHM_FORMAT_ABGR2101010: + case WL_SHM_FORMAT_ARGB2101010: + case WL_SHM_FORMAT_ARGB8888: + return true; + case WL_SHM_FORMAT_XBGR2101010: + case WL_SHM_FORMAT_XRGB2101010: + case WL_SHM_FORMAT_XRGB8888: + default: + return false; + } +} + +static QImage::Format imageFormatForShmFormat(uint32_t format) +{ + switch (format) { +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + case WL_SHM_FORMAT_ARGB2101010: + return QImage::Format_A2RGB30_Premultiplied; + case WL_SHM_FORMAT_XRGB2101010: + return QImage::Format_RGB30; + case WL_SHM_FORMAT_ABGR2101010: + return QImage::Format_A2BGR30_Premultiplied; + case WL_SHM_FORMAT_XBGR2101010: + return QImage::Format_BGR30; +#endif + case WL_SHM_FORMAT_ARGB8888: + return QImage::Format_ARGB32_Premultiplied; + case WL_SHM_FORMAT_XRGB8888: + return QImage::Format_RGB32; + default: + return QImage::Format_Invalid; + } +} + +ShmClientBuffer::ShmClientBuffer(wl_resource *resource) + : ClientBuffer(resource, *new ShmClientBufferPrivate(this)) +{ + Q_D(ShmClientBuffer); + + wl_shm_buffer *buffer = wl_shm_buffer_get(resource); + d->width = wl_shm_buffer_get_width(buffer); + d->height = wl_shm_buffer_get_height(buffer); + d->hasAlphaChannel = alphaChannelFromFormat(wl_shm_buffer_get_format(buffer)); + d->format = imageFormatForShmFormat(wl_shm_buffer_get_format(buffer)); + + // The underlying shm pool will be referenced if the wl_shm_buffer is destroyed so the + // compositor can access buffer data even after the buffer is gone. + d->destroyListener.receiver = d; + d->destroyListener.listener.notify = ShmClientBufferPrivate::buffer_destroy_callback; + wl_resource_add_destroy_listener(resource, &d->destroyListener.listener); +} + +QSize ShmClientBuffer::size() const +{ + Q_D(const ShmClientBuffer); + return QSize(d->width, d->height); +} + +bool ShmClientBuffer::hasAlphaChannel() const +{ + Q_D(const ShmClientBuffer); + return d->hasAlphaChannel; +} + +ClientBuffer::Origin ShmClientBuffer::origin() const +{ + return Origin::TopLeft; +} + +static void cleanupShmData(void *bufferHandle) +{ + Q_ASSERT_X(s_accessCounter > 0, "cleanup", "access counter must be positive"); + s_accessCounter--; + if (s_accessCounter == 0) { + s_accessedBuffer = nullptr; + } + wl_shm_buffer_end_access(static_cast(bufferHandle)); +} + +QImage ShmClientBuffer::data() const +{ + if (s_accessedBuffer && s_accessedBuffer != this) { + return QImage(); + } + + Q_D(const ShmClientBuffer); + if (wl_shm_buffer *buffer = wl_shm_buffer_get(resource())) { + s_accessedBuffer = this; + s_accessCounter++; + wl_shm_buffer_begin_access(buffer); + const uchar *data = static_cast(wl_shm_buffer_get_data(buffer)); + const uint32_t stride = wl_shm_buffer_get_stride(buffer); + return QImage(data, d->width, d->height, stride, d->format, cleanupShmData, buffer); + } + return d->savedData; +} + +ShmClientBufferIntegration::ShmClientBufferIntegration(Display *display) + : ClientBufferIntegration(display) +{ +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + wl_display_add_shm_format(*display, WL_SHM_FORMAT_ARGB2101010); + wl_display_add_shm_format(*display, WL_SHM_FORMAT_XRGB2101010); + wl_display_add_shm_format(*display, WL_SHM_FORMAT_ABGR2101010); + wl_display_add_shm_format(*display, WL_SHM_FORMAT_XBGR2101010); +#endif + wl_display_init_shm(*display); +} + +ClientBuffer *ShmClientBufferIntegration::createBuffer(::wl_resource *resource) +{ + if (wl_shm_buffer_get(resource)) { + return new ShmClientBuffer(resource); + } + return nullptr; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/shmclientbuffer.h dwayland-5.57.0.24+really5.24.3/src/server/shmclientbuffer.h --- dwayland-5.57.0.23/src/server/shmclientbuffer.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/shmclientbuffer.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,50 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "clientbuffer.h" +#include "clientbufferintegration.h" + +namespace KWaylandServer +{ +class ShmClientBufferPrivate; + +/** + * The ShmClientBuffer class represents a wl_shm_buffer client buffer. + * + * The buffer's data can be accessed using the data() function. Note that it is not allowed + * to access data of several shared memory buffers simultaneously. + */ +class KWAYLANDSERVER_EXPORT ShmClientBuffer : public ClientBuffer +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ShmClientBuffer) + +public: + explicit ShmClientBuffer(wl_resource *resource); + + QImage data() const; + + QSize size() const override; + bool hasAlphaChannel() const override; + Origin origin() const override; +}; + +/** + * The ShmClientBufferIntegration class provides support for wl_shm_buffer buffers. + */ +class ShmClientBufferIntegration : public ClientBufferIntegration +{ + Q_OBJECT + +public: + explicit ShmClientBufferIntegration(Display *display); + + ClientBuffer *createBuffer(::wl_resource *resource) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/slide_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/slide_interface.cpp --- dwayland-5.57.0.23/src/server/slide_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/slide_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,216 +1,157 @@ -/**************************************************************************** -Copyright 2015 Marco Martin +/* + SPDX-FileCopyrightText: 2015 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "slide_interface.h" #include "display.h" -#include "global_p.h" -#include "surface_interface.h" -#include "resource_p.h" #include "surface_interface_p.h" -#include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_version = 1; -class SlideManagerInterface::Private : public Global::Private +class SlideManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_slide_manager { public: - Private(SlideManagerInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void createSlide(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface); - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - static void unsetCallback(wl_client *client, wl_resource *resource, wl_resource * surface); + SlideManagerInterfacePrivate(SlideManagerInterface *_q, Display *display); SlideManagerInterface *q; - static const struct org_kde_kwin_slide_manager_interface s_interface; - //initializing here doesn't link - static const quint32 s_version; -}; -const quint32 SlideManagerInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_slide_manager_interface SlideManagerInterface::Private::s_interface = { - createCallback, - unsetCallback +protected: + void org_kde_kwin_slide_manager_destroy_global() override; + void org_kde_kwin_slide_manager_create(Resource *resource, uint32_t id, wl_resource *surface) override; + void org_kde_kwin_slide_manager_unset(Resource *resource, wl_resource *surface) override; }; -#endif -void SlideManagerInterface::Private::createCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) +void SlideManagerInterfacePrivate::org_kde_kwin_slide_manager_destroy_global() { - cast(resource)->createSlide(client, resource, id, surface); + delete q; } -void SlideManagerInterface::Private::createSlide(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) +void SlideManagerInterfacePrivate::org_kde_kwin_slide_manager_create(Resource *resource, uint32_t id, wl_resource *surface) { SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); return; } - SlideInterface *slide = new SlideInterface(q, resource); - slide->create(display->getConnection(client), wl_resource_get_version(resource), id); - if (!slide->resource()) { - wl_resource_post_no_memory(resource); - delete slide; + wl_resource *slide_resource = wl_resource_create(resource->client(), &org_kde_kwin_slide_interface, resource->version(), id); + if (!slide_resource) { + wl_client_post_no_memory(resource->client()); return; } - s->d_func()->setSlide(QPointer(slide)); + + auto slide = new SlideInterface(slide_resource); + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setSlide(QPointer(slide)); } -void SlideManagerInterface::Private::unsetCallback(wl_client *client, wl_resource *resource, wl_resource * surface) +void SlideManagerInterfacePrivate::org_kde_kwin_slide_manager_unset(Resource *resource, wl_resource *surface) { - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(surface) - // TODO: implement + SurfaceInterface *s = SurfaceInterface::get(surface); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); + return; + } + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(s); + surfacePrivate->setSlide(QPointer()); } -SlideManagerInterface::Private::Private(SlideManagerInterface *q, Display *d) - : Global::Private(d, &org_kde_kwin_slide_manager_interface, s_version) - , q(q) +SlideManagerInterfacePrivate::SlideManagerInterfacePrivate(SlideManagerInterface *_q, Display *display) + : QtWaylandServer::org_kde_kwin_slide_manager(*display, s_version) + , q(_q) { } -void SlideManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +SlideManagerInterface::SlideManagerInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new SlideManagerInterfacePrivate(this, display)) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&org_kde_kwin_slide_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? } -void SlideManagerInterface::Private::unbind(wl_resource *resource) +SlideManagerInterface::~SlideManagerInterface() { - Q_UNUSED(resource) - // TODO: implement? } -SlideManagerInterface::SlideManagerInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) +void SlideManagerInterface::remove() { + d->globalRemove(); } -SlideManagerInterface::~SlideManagerInterface() = default; - -class SlideInterface::Private : public Resource::Private +class SlideInterfacePrivate : public QtWaylandServer::org_kde_kwin_slide { public: - Private(SlideInterface *q, SlideManagerInterface *c, wl_resource *parentResource); - ~Private(); + SlideInterfacePrivate(SlideInterface *_q, wl_resource *resource); SlideInterface::Location pendingLocation; SlideInterface::Location currentLocation; uint32_t pendingOffset; uint32_t currentOffset; + SlideInterface *q; -private: - static void commitCallback(wl_client *client, wl_resource *resource); - static void setLocationCallback(wl_client *client, wl_resource *resource, uint32_t location); - static void setOffsetCallback(wl_client *client, wl_resource *resource, int32_t offset); - - SlideInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct org_kde_kwin_slide_interface s_interface; +protected: + void org_kde_kwin_slide_commit(Resource *resource) override; + void org_kde_kwin_slide_set_location(Resource *resource, uint32_t location) override; + void org_kde_kwin_slide_set_offset(Resource *resource, int32_t offset) override; + void org_kde_kwin_slide_release(Resource *resource) override; + void org_kde_kwin_slide_destroy_resource(Resource *resource) override; }; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct org_kde_kwin_slide_interface SlideInterface::Private::s_interface = { - commitCallback, - setLocationCallback, - setOffsetCallback, - resourceDestroyedCallback -}; -#endif +void SlideInterfacePrivate::org_kde_kwin_slide_commit(Resource *resource) +{ + Q_UNUSED(resource) + currentLocation = pendingLocation; + currentOffset = pendingOffset; +} -void SlideInterface::Private::commitCallback(wl_client *client, wl_resource *resource) +void SlideInterfacePrivate::org_kde_kwin_slide_set_location(Resource *resource, uint32_t location) { - Q_UNUSED(client) - Private *p = cast(resource); - p->currentLocation = p->pendingLocation; - p->currentOffset = p->pendingOffset; + Q_UNUSED(resource) + pendingLocation = (SlideInterface::Location)location; } -void SlideInterface::Private::setLocationCallback(wl_client *client, wl_resource *resource, uint32_t location) +void SlideInterfacePrivate::org_kde_kwin_slide_set_offset(Resource *resource, int32_t offset) { - Q_UNUSED(client) - Private *p = cast(resource); - p->pendingLocation = (SlideInterface::Location)location; + Q_UNUSED(resource) + pendingOffset = offset; } -void SlideInterface::Private::setOffsetCallback(wl_client *client, wl_resource *resource, int32_t offset) +void SlideInterfacePrivate::org_kde_kwin_slide_release(Resource *resource) { - Q_UNUSED(client) - Private *p = cast(resource); - p->pendingOffset = offset; + wl_resource_destroy(resource->handle); } -SlideInterface::Private::Private(SlideInterface *q, SlideManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &org_kde_kwin_slide_interface, &s_interface) +void SlideInterfacePrivate::org_kde_kwin_slide_destroy_resource(Resource *resource) { + Q_UNUSED(resource) + delete q; } -SlideInterface::Private::~Private() = default; +SlideInterfacePrivate::SlideInterfacePrivate(SlideInterface *_q, wl_resource *resource) + : QtWaylandServer::org_kde_kwin_slide(resource) + , q(_q) +{ +} -SlideInterface::SlideInterface(SlideManagerInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +SlideInterface::SlideInterface(wl_resource *resource) + : d(new SlideInterfacePrivate(this, resource)) { } SlideInterface::~SlideInterface() = default; - SlideInterface::Location SlideInterface::location() const { - Q_D(); return d->currentLocation; } qint32 SlideInterface::offset() const { - Q_D(); return d->currentOffset; } -SlideInterface::Private *SlideInterface::d_func() const -{ - return reinterpret_cast(d.data()); } - -} -} - diff -Nru dwayland-5.57.0.23/src/server/slide_interface.h dwayland-5.57.0.24+really5.24.3/src/server/slide_interface.h --- dwayland-5.57.0.23/src/server/slide_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/slide_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,67 +1,48 @@ -/**************************************************************************** -Copyright 2015 Marco Martin +/* + SPDX-FileCopyrightText: 2015 Marco Martin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_SLIDE_INTERFACE_H -#define KWAYLAND_SERVER_SLIDE_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include "global.h" -#include "resource.h" +#include -#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ class Display; +class SlideManagerInterfacePrivate; +class SlideInterfacePrivate; -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT SlideManagerInterface : public Global +class KWAYLANDSERVER_EXPORT SlideManagerInterface : public QObject { Q_OBJECT + public: - virtual ~SlideManagerInterface(); + explicit SlideManagerInterface(Display *display, QObject *parent = nullptr); + ~SlideManagerInterface() override; + + void remove(); private: - explicit SlideManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; -/** - * TODO - */ -class KWAYLANDSERVER_EXPORT SlideInterface : public Resource +class KWAYLANDSERVER_EXPORT SlideInterface : public QObject { Q_OBJECT public: enum Location { Left = 0, /**< Slide from the left edge of the screen */ - Top, /**< Slide from the top edge of the screen */ - Right, /**< Slide from the bottom edge of the screen */ - Bottom /**< Slide from the bottom edge of the screen */ + Top = 1, /**< Slide from the top edge of the screen */ + Right = 2, /**< Slide from the bottom edge of the screen */ + Bottom = 3, /**< Slide from the bottom edge of the screen */ }; - virtual ~SlideInterface(); + ~SlideInterface() override; /** * @returns the location the window will be slided from @@ -75,15 +56,9 @@ qint32 offset() const; private: - explicit SlideInterface(SlideManagerInterface *parent, wl_resource *parentResource); - friend class SlideManagerInterface; + explicit SlideInterface(wl_resource *resource); + friend class SlideManagerInterfacePrivate; - class Private; - Private *d_func() const; + QScopedPointer d; }; - - } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/strut_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/strut_interface.cpp --- dwayland-5.57.0.23/src/server/strut_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/strut_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -19,100 +19,62 @@ License along with this library. If not, see . *********************************************************************/ #include "strut_interface.h" -#include "region_interface.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" #include "surface_interface_p.h" -#include -#include +#include +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ -class StrutInterface::Private : public Global::Private -{ -public: - struct ResourceData { - wl_resource *resource; - uint32_t version; - }; - Private(StrutInterface *q, Display *d); - ~Private(); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - static void setStrutPartialCallback(wl_client *client, wl_resource *resource, wl_resource *surface, - int32_t left, - int32_t right, - int32_t top, - int32_t bottom, - int32_t left_start_y, - int32_t left_end_y, - int32_t right_start_y, - int32_t right_end_y, - int32_t top_start_x, - int32_t top_end_x, - int32_t bottom_start_x, - int32_t bottom_end_x); - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - if (!r) { - return nullptr; - } - auto strut = reinterpret_cast*>(wl_resource_get_user_data(r))->data(); - if (strut) { - return static_cast(strut->d.data()); - } - return nullptr; - } +static const quint32 s_version = 1; - StrutInterface *get(wl_resource *native); +class StrutInterfacePrivate: public QtWaylandServer::com_deepin_kwin_strut +{ +public: + StrutInterfacePrivate(StrutInterface *q, Display *d); StrutInterface *q; - static const struct com_deepin_kwin_strut_interface s_interface; - static const quint32 s_version; -}; - -const quint32 StrutInterface::Private::s_version = 1; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct com_deepin_kwin_strut_interface StrutInterface::Private::s_interface = { - setStrutPartialCallback, +private: + void com_deepin_kwin_strut_set_strut_partial(Resource *resource, + struct ::wl_resource *surface, + int32_t left, + int32_t right, + int32_t top, + int32_t bottom, + int32_t left_start_y, + int32_t left_end_y, + int32_t right_start_y, + int32_t right_end_y, + int32_t top_start_x, + int32_t top_end_x, + int32_t bottom_start_x, + int32_t bottom_end_x) override; }; -#endif -StrutInterface::Private::Private(StrutInterface *q, Display *d) - : Global::Private(d, &com_deepin_kwin_strut_interface, s_version) +StrutInterfacePrivate::StrutInterfacePrivate(StrutInterface *q, Display *d) + : QtWaylandServer::com_deepin_kwin_strut(*d, s_version) , q(q) { } -StrutInterface::Private::~Private() = default; - +void StrutInterfacePrivate::com_deepin_kwin_strut_set_strut_partial(Resource *resource, + struct ::wl_resource *surface, + int32_t left, + int32_t right, + int32_t top, + int32_t bottom, + int32_t left_start_y, + int32_t left_end_y, + int32_t right_start_y, + int32_t right_end_y, + int32_t top_start_x, + int32_t top_end_x, + int32_t bottom_start_x, + int32_t bottom_end_x) +{ + Q_UNUSED(resource); -void StrutInterface::Private::setStrutPartialCallback(wl_client *client, - wl_resource *resource, - wl_resource *surface, - int32_t left, - int32_t right, - int32_t top, - int32_t bottom, - int32_t left_start_y, - int32_t left_end_y, - int32_t right_start_y, - int32_t right_end_y, - int32_t top_start_x, - int32_t top_end_x, - int32_t bottom_start_x, - int32_t bottom_end_x) -{ - Q_UNUSED(client); - if (!resource || !surface) { - return; - } struct deepinKwinStrut kwinStrut(left, right, top, @@ -125,64 +87,25 @@ top_end_x, bottom_start_x, bottom_end_x); - auto m = cast(resource); - if (!m) { - return; - } SurfaceInterface *si = SurfaceInterface::get(surface); - if (m->q) { - emit m->q->setStrut(si, kwinStrut); - } -} - -StrutInterface *StrutInterface::Private::get(wl_resource *native) -{ - if (!native) { - return nullptr; - } - - if (Private *p = cast(native)) { - return p->q; - } - return nullptr; -} -void StrutInterface::Private::unbind(wl_resource *r) -{ - if (!r) { - return; - } - delete reinterpret_cast*>(wl_resource_get_user_data(r)); + Q_EMIT q->setStrut(si, kwinStrut); } -void StrutInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +StrutInterface *StrutInterface::get(wl_resource *native) { - if (!client) { - return; - } - auto c = display->getConnection(client); - if (!c) { - return; - } - wl_resource *resource = c->createResource(&com_deepin_kwin_strut_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; + if (auto surfacePrivate = resource_cast(native)) { + return surfacePrivate->q; } - auto ref = new QPointer(q);//deleted in unbind - if (!ref) { - return; - } - wl_resource_set_implementation(resource, &s_interface, ref, unbind); + return nullptr; } - StrutInterface::StrutInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new StrutInterfacePrivate(this, display)) { } StrutInterface::~StrutInterface() = default; } -} diff -Nru dwayland-5.57.0.23/src/server/strut_interface.h dwayland-5.57.0.24+really5.24.3/src/server/strut_interface.h --- dwayland-5.57.0.23/src/server/strut_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/strut_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -21,18 +21,18 @@ #ifndef KWAYLAND_SERVER_STRUT_INTERFACE_H #define KWAYLAND_SERVER_STRUT_INTERFACE_H -#include "global.h" -#include "resource.h" #include -#include +#include -namespace KWayland -{ -namespace Server +struct wl_resource; + +namespace KWaylandServer { + class Display; class wl_surface; class SurfaceInterface; +class StrutInterfacePrivate; struct deepinKwinStrut { @@ -120,11 +120,12 @@ * @see xxxx * @since 5.5 **/ -class KWAYLANDSERVER_EXPORT StrutInterface : public Global +class KWAYLANDSERVER_EXPORT StrutInterface : public QObject { Q_OBJECT public: - virtual ~StrutInterface(); + explicit StrutInterface(Display *display, QObject *parent = nullptr); + ~StrutInterface() override; static StrutInterface *get(wl_resource *native); @@ -135,13 +136,8 @@ void setStrut(SurfaceInterface *, struct deepinKwinStrut &); private: - friend class Display; - explicit StrutInterface(Display *display, QObject *parent = nullptr); - class Private; - Private *d_func() const; + QScopedPointer d; }; } -} - #endif diff -Nru dwayland-5.57.0.23/src/server/subcompositor_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/subcompositor_interface.cpp --- dwayland-5.57.0.23/src/server/subcompositor_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/subcompositor_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,355 +1,247 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "subcompositor_interface.h" -#include "subsurface_interface_p.h" -#include "global_p.h" #include "display.h" +#include "subsurface_interface_p.h" #include "surface_interface_p.h" -// Wayland -#include - -namespace KWayland -{ -namespace Server -{ -class SubCompositorInterface::Private : public Global::Private +namespace KWaylandServer { -public: - Private(SubCompositorInterface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - void subsurface(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *parent); - - static void unbind(wl_resource *resource); - static void destroyCallback(wl_client *client, wl_resource *resource); - static void subsurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *parent); - - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - SubCompositorInterface *q; - static const struct wl_subcompositor_interface s_interface; - static const quint32 s_version; -}; +static const int s_version = 1; -const quint32 SubCompositorInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_subcompositor_interface SubCompositorInterface::Private::s_interface = { - destroyCallback, - subsurfaceCallback -}; -#endif - -SubCompositorInterface::Private::Private(SubCompositorInterface *q, Display *d) - : Global::Private(d, &wl_subcompositor_interface, s_version) +SubCompositorInterfacePrivate::SubCompositorInterfacePrivate(Display *display, SubCompositorInterface *q) + : QtWaylandServer::wl_subcompositor(*display, s_version) , q(q) { } -void SubCompositorInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void SubCompositorInterfacePrivate::subcompositor_destroy(Resource *resource) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&wl_subcompositor_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); + wl_resource_destroy(resource->handle); } -void SubCompositorInterface::Private::unbind(wl_resource *resource) +void SubCompositorInterfacePrivate::subcompositor_get_subsurface(Resource *resource, + uint32_t id, + ::wl_resource *surface_resource, + ::wl_resource *parent_resource) { - Q_UNUSED(resource) -} + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + SurfaceInterface *parent = SurfaceInterface::get(parent_resource); -void SubCompositorInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - Q_UNUSED(resource) - wl_resource_destroy(resource); -} + if (!surface) { + wl_resource_post_error(resource->handle, error_bad_surface, "no surface"); + return; + } + if (!parent) { + wl_resource_post_error(resource->handle, error_bad_surface, "no parent"); + return; + } -void SubCompositorInterface::Private::subsurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *surface, wl_resource *sparent) -{ - cast(resource)->subsurface(client, resource, id, surface, sparent); -} + const SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_bad_surface, "the surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } -void SubCompositorInterface::Private::subsurface(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *nativeSurface, wl_resource *nativeParentSurface) -{ - Q_UNUSED(client) - SurfaceInterface *surface = SurfaceInterface::get(nativeSurface); - SurfaceInterface *parentSurface = SurfaceInterface::get(nativeParentSurface); - if (!surface || !parentSurface) { - wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "Surface or parent surface not found"); + if (surface == parent) { + wl_resource_post_error(resource->handle, error_bad_surface, "wl_surface@%d cannot be its own parent", wl_resource_get_id(surface_resource)); return; } - if (surface == parentSurface) { - wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "Cannot become sub composite to same surface"); + if (parent->subSurface() && parent->subSurface()->mainSurface() == surface) { + wl_resource_post_error(resource->handle, error_bad_surface, "wl_surface@%d is an ancestor of parent", wl_resource_get_id(surface_resource)); return; } - // TODO: add check that surface is not already used in an interface (e.g. Shell) - // TODO: add check that parentSurface is not a child of surface - SubSurfaceInterface *s = new SubSurfaceInterface(q, resource); - s->d_func()->create(display->getConnection(client), wl_resource_get_version(resource), id, surface, parentSurface); - if (!s->resource()) { - wl_resource_post_no_memory(resource); - delete s; + + wl_resource *subsurfaceResource = wl_resource_create(resource->client(), &wl_subsurface_interface, resource->version(), id); + if (!subsurfaceResource) { + wl_resource_post_no_memory(resource->handle); return; } - emit q->subSurfaceCreated(s); + + Q_EMIT q->subSurfaceCreated(new SubSurfaceInterface(surface, parent, subsurfaceResource)); } SubCompositorInterface::SubCompositorInterface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) + : QObject(parent) + , d(new SubCompositorInterfacePrivate(display, this)) + { } -SubCompositorInterface::~SubCompositorInterface() = default; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_subsurface_interface SubSurfaceInterface::Private::s_interface = { - resourceDestroyedCallback, - setPositionCallback, - placeAboveCallback, - placeBelowCallback, - setSyncCallback, - setDeSyncCallback -}; -#endif - -SubSurfaceInterface::Private::Private(SubSurfaceInterface *q, SubCompositorInterface *compositor, wl_resource *parentResource) - : Resource::Private(q, compositor, parentResource, &wl_subsurface_interface, &s_interface) +SubCompositorInterface::~SubCompositorInterface() { } -SubSurfaceInterface::Private::~Private() +SubSurfaceInterfacePrivate *SubSurfaceInterfacePrivate::get(SubSurfaceInterface *subsurface) { - // no need to notify the surface as it's tracking a QPointer which will be reset automatically - if (parent) { - Q_Q(SubSurfaceInterface); - reinterpret_cast(parent->d.data())->removeChild(QPointer(q)); - } + return subsurface->d.data(); } -void SubSurfaceInterface::Private::create(ClientConnection *client, quint32 version, quint32 id, SurfaceInterface *s, SurfaceInterface *p) +SubSurfaceInterfacePrivate::SubSurfaceInterfacePrivate(SubSurfaceInterface *q, SurfaceInterface *surface, SurfaceInterface *parent, ::wl_resource *resource) + : SurfaceRole(surface, QByteArrayLiteral("wl_subsurface")) + , QtWaylandServer::wl_subsurface(resource) + , q(q) + , surface(surface) + , parent(parent) { - create(client, version, id); - if (!resource) { - return; - } - surface = s; - parent = p; - Q_Q(SubSurfaceInterface); - surface->d_func()->subSurface = QPointer(q); - // copy current state to subSurfacePending state - // it's the reference for all new pending state which needs to be committed - surface->d_func()->subSurfacePending = surface->d_func()->current; - surface->d_func()->subSurfacePending.blurIsSet = false; - surface->d_func()->subSurfacePending.bufferIsSet = false; - surface->d_func()->subSurfacePending.childrenChanged = false; - surface->d_func()->subSurfacePending.contrastIsSet = false; - surface->d_func()->subSurfacePending.callbacks.clear(); - surface->d_func()->subSurfacePending.inputIsSet = false; - surface->d_func()->subSurfacePending.inputIsInfinite = true; - surface->d_func()->subSurfacePending.opaqueIsSet = false; - surface->d_func()->subSurfacePending.shadowIsSet = false; - surface->d_func()->subSurfacePending.slideIsSet = false; - parent->d_func()->addChild(QPointer(q)); +} - QObject::connect(surface.data(), &QObject::destroyed, q, - [this] { - // from spec: "If the wl_surface associated with the wl_subsurface is destroyed, - // the wl_subsurface object becomes inert. Note, that destroying either object - // takes effect immediately." - if (parent) { - Q_Q(SubSurfaceInterface); - reinterpret_cast(parent->d.data())->removeChild(QPointer(q)); - } - } - ); +void SubSurfaceInterfacePrivate::subsurface_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; } -void SubSurfaceInterface::Private::commit() +void SubSurfaceInterfacePrivate::subsurface_destroy(Resource *resource) { - if (scheduledPosChange) { - scheduledPosChange = false; - pos = scheduledPos; - scheduledPos = QPoint(); - Q_Q(SubSurfaceInterface); - emit q->positionChanged(pos); - } - if (surface) { - surface->d_func()->commitSubSurface(); - } + wl_resource_destroy(resource->handle); } -void SubSurfaceInterface::Private::setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y) +void SubSurfaceInterfacePrivate::subsurface_set_position(Resource *resource, int32_t x, int32_t y) { - Q_UNUSED(client) - // TODO: is this a fixed position? - cast(resource)->setPosition(QPoint(x, y)); + Q_UNUSED(resource) + if (pendingPosition == QPoint(x, y)) { + return; + } + pendingPosition = QPoint(x, y); + hasPendingPosition = true; } -void SubSurfaceInterface::Private::setPosition(const QPoint &p) +void SubSurfaceInterfacePrivate::subsurface_place_above(Resource *resource, struct ::wl_resource *sibling_resource) { - Q_Q(SubSurfaceInterface); - if (!q->isSynchronized()) { - // workaround for https://bugreports.qt.io/browse/QTBUG-52118 - // apply directly as Qt doesn't commit the parent surface - pos = p; - emit q->positionChanged(pos); + SurfaceInterface *sibling = SurfaceInterface::get(sibling_resource); + if (!sibling) { + wl_resource_post_error(resource->handle, error_bad_surface, "no sibling"); return; } - if (scheduledPos == p) { + if (!parent) { + wl_resource_post_error(resource->handle, error_bad_surface, "no parent"); return; } - scheduledPos = p; - scheduledPosChange = true; -} -void SubSurfaceInterface::Private::placeAboveCallback(wl_client *client, wl_resource *resource, wl_resource *sibling) -{ - Q_UNUSED(client) - cast(resource)->placeAbove(SurfaceInterface::get(sibling)); + SurfaceInterfacePrivate *parentPrivate = SurfaceInterfacePrivate::get(parent); + if (!parentPrivate->raiseChild(q, sibling)) { + wl_resource_post_error(resource->handle, error_bad_surface, "incorrect sibling"); + } } -void SubSurfaceInterface::Private::placeAbove(SurfaceInterface *sibling) +void SubSurfaceInterfacePrivate::subsurface_place_below(Resource *resource, struct ::wl_resource *sibling_resource) { - if (parent.isNull()) { - // TODO: raise error + SurfaceInterface *sibling = SurfaceInterface::get(sibling_resource); + if (!sibling) { + wl_resource_post_error(resource->handle, error_bad_surface, "no sibling"); return; } - Q_Q(SubSurfaceInterface); - if (!parent->d_func()->raiseChild(QPointer(q), sibling)) { - wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "Incorrect sibling"); + if (!parent) { + wl_resource_post_error(resource->handle, error_bad_surface, "no parent"); + return; } -} -void SubSurfaceInterface::Private::placeBelowCallback(wl_client *client, wl_resource *resource, wl_resource *sibling) -{ - Q_UNUSED(client) - cast(resource)->placeBelow(SurfaceInterface::get(sibling)); + SurfaceInterfacePrivate *parentPrivate = SurfaceInterfacePrivate::get(parent); + if (!parentPrivate->lowerChild(q, sibling)) { + wl_resource_post_error(resource->handle, error_bad_surface, "incorrect sibling"); + } } -void SubSurfaceInterface::Private::placeBelow(SurfaceInterface *sibling) +void SubSurfaceInterfacePrivate::subsurface_set_sync(Resource *) { - if (parent.isNull()) { - // TODO: raise error + if (mode == SubSurfaceInterface::Mode::Synchronized) { return; } - Q_Q(SubSurfaceInterface); - if (!parent->d_func()->lowerChild(QPointer(q), sibling)) { - wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "Incorrect sibling"); - } + mode = SubSurfaceInterface::Mode::Synchronized; + Q_EMIT q->modeChanged(SubSurfaceInterface::Mode::Synchronized); } -void SubSurfaceInterface::Private::setSyncCallback(wl_client *client, wl_resource *resource) +void SubSurfaceInterfacePrivate::subsurface_set_desync(Resource *) { - Q_UNUSED(client) - cast(resource)->setMode(Mode::Synchronized); + if (mode == SubSurfaceInterface::Mode::Desynchronized) { + return; + } + mode = SubSurfaceInterface::Mode::Desynchronized; + if (!q->isSynchronized()) { + auto surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->commitFromCache(); + } + Q_EMIT q->modeChanged(SubSurfaceInterface::Mode::Desynchronized); } -void SubSurfaceInterface::Private::setDeSyncCallback(wl_client *client, wl_resource *resource) +void SubSurfaceInterfacePrivate::commit() { - Q_UNUSED(client) - cast(resource)->setMode(Mode::Desynchronized); } -void SubSurfaceInterface::Private::setMode(Mode m) +void SubSurfaceInterfacePrivate::parentCommit() { - if (mode == m) { - return; + if (hasPendingPosition) { + hasPendingPosition = false; + position = pendingPosition; + Q_EMIT q->positionChanged(position); } - if (m == Mode::Desynchronized && (!parent->subSurface() || !parent->subSurface()->isSynchronized())) { - // no longer synchronized, this is like calling commit - if (surface) { - surface->d_func()->commit(); - surface->d_func()->commitSubSurface(); - } + + if (mode == SubSurfaceInterface::Mode::Synchronized) { + auto surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->commitFromCache(); } - mode = m; - Q_Q(SubSurfaceInterface); - emit q->modeChanged(m); } -SubSurfaceInterface::SubSurfaceInterface(SubCompositorInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +SubSurfaceInterface::SubSurfaceInterface(SurfaceInterface *surface, SurfaceInterface *parent, wl_resource *resource) + : d(new SubSurfaceInterfacePrivate(this, surface, parent, resource)) { - Q_UNUSED(parent) -} + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + SurfaceInterfacePrivate *parentPrivate = SurfaceInterfacePrivate::get(parent); + surfacePrivate->subSurface = this; + parentPrivate->addChild(this); -SubSurfaceInterface::~SubSurfaceInterface() = default; - -QPoint SubSurfaceInterface::position() const -{ - Q_D(); - return d->pos; + connect(surface, &SurfaceInterface::destroyed, this, [this]() { + delete this; + }); } -QPointer SubSurfaceInterface::surface() +SubSurfaceInterface::~SubSurfaceInterface() { - // TODO: remove with ABI break (KF6) - Q_D(); - return d->surface; + if (d->parent) { + SurfaceInterfacePrivate *parentPrivate = SurfaceInterfacePrivate::get(d->parent); + parentPrivate->removeChild(this); + } + if (d->surface) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(d->surface); + surfacePrivate->subSurface = nullptr; + } } -QPointer SubSurfaceInterface::surface() const +QPoint SubSurfaceInterface::position() const { - Q_D(); - return d->surface; + return d->position; } -QPointer SubSurfaceInterface::parentSurface() +SurfaceInterface *SubSurfaceInterface::surface() const { - // TODO: remove with ABI break (KF6) - Q_D(); - return d->parent; + return d->surface; } -QPointer SubSurfaceInterface::parentSurface() const +SurfaceInterface *SubSurfaceInterface::parentSurface() const { - Q_D(); return d->parent; } SubSurfaceInterface::Mode SubSurfaceInterface::mode() const { - Q_D(); return d->mode; } bool SubSurfaceInterface::isSynchronized() const { - Q_D(); if (d->mode == Mode::Synchronized) { return true; } - if (d->parent.isNull()) { + if (!d->parent) { // that shouldn't happen, but let's assume false return false; } - if (!d->parent->subSurface().isNull()) { + if (d->parent->subSurface()) { // follow parent's mode return d->parent->subSurface()->isSynchronized(); } @@ -357,22 +249,16 @@ return false; } -QPointer SubSurfaceInterface::mainSurface() const +SurfaceInterface *SubSurfaceInterface::mainSurface() const { - Q_D(); if (!d->parent) { - return QPointer(); + return nullptr; } - if (d->parent->d_func()->subSurface) { - return d->parent->d_func()->subSurface->mainSurface(); + SurfaceInterfacePrivate *parentPrivate = SurfaceInterfacePrivate::get(d->parent); + if (parentPrivate->subSurface) { + return parentPrivate->subSurface->mainSurface(); } return d->parent; } -SubSurfaceInterface::Private *SubSurfaceInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/subcompositor_interface.h dwayland-5.57.0.24+really5.24.3/src/server/subcompositor_interface.h --- dwayland-5.57.0.23/src/server/subcompositor_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/subcompositor_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,130 +1,125 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H -#define WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ -#include -#include +#pragma once -#include +#include -#include "global.h" -#include "resource.h" +#include struct wl_resource; -namespace KWayland -{ -namespace Server +namespace KWaylandServer { - class Display; +class SubCompositorInterfacePrivate; class SurfaceInterface; class SubSurfaceInterface; +class SubSurfaceInterfacePrivate; /** - * @todo Add documentation + * The SubCompositorInterface compositor extension provides applications a way to offload + * compositing work within a window from clients to the compositor. This may reduce the power + * usage for applications such as video players, etc. + * + * The SubCompositorInterface corresponds to the Wayland interface @c wl_subcompositor. */ -class KWAYLANDSERVER_EXPORT SubCompositorInterface : public Global +class KWAYLANDSERVER_EXPORT SubCompositorInterface : public QObject { Q_OBJECT + public: - virtual ~SubCompositorInterface(); + explicit SubCompositorInterface(Display *display, QObject *parent = nullptr); + ~SubCompositorInterface() override; Q_SIGNALS: - void subSurfaceCreated(KWayland::Server::SubSurfaceInterface*); + /** + * This signal is emitted when a new sub-surface @subsurface has been created. + */ + void subSurfaceCreated(KWaylandServer::SubSurfaceInterface *subsurface); private: - explicit SubCompositorInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; + QScopedPointer d; }; /** - * @todo Add documentation + * The SubSurfaceInterface corresponds to the Wayland interface @c wl_subsurface. */ -class KWAYLANDSERVER_EXPORT SubSurfaceInterface : public Resource +class KWAYLANDSERVER_EXPORT SubSurfaceInterface : public QObject { Q_OBJECT - Q_PROPERTY(QPoint position READ position NOTIFY positionChanged) - Q_PROPERTY(KWayland::Server::SubSurfaceInterface::Mode mode READ mode NOTIFY modeChanged) + public: - virtual ~SubSurfaceInterface(); + ~SubSurfaceInterface() override; + /** + * Returns the position of the sub-surface relative to the upper-left corner of its parent. + */ QPoint position() const; + /** + * This enum type is used to specify the commit behavior for a subsurface. + */ enum class Mode { Synchronized, - Desynchronized + Desynchronized, }; + + /** + * Returns the current commit mode. + * + * @see isSynchronized + */ Mode mode() const; /** - * Whether this SubSurfaceInterface is in synchronized mode. - * A SubSurface is in synchronized mode if either {@link mode} is - * @c Mode::Synchronized or if the parent surface is in synchronized - * mode. If a SubSurfaceInterface is in synchronized mode all child - * SubSurfaceInterfaces are also in synchronized mode ignoring the actual mode. - * @returns Whether this SubSurfaceInterface is in synchronized mode. + * Returns @c true if the sub-surface is in synchronized mode; otherwise returns @c false. + * + * This method checks whether this sub-surface or any of its ancestors is in the synchronized + * mode. Note that this function is not equivalent to calling mode() and checking whether + * the return value is Mode::Synchronized. + * * @see mode - * @since 5.22 - **/ + */ bool isSynchronized() const; - // TODO: remove with ABI break (KF6) - QPointer surface(); /** - * @returns The surface this SubSurfaceInterface was created on. - * @since 5.22 - **/ - QPointer surface() const; - // TODO: remove with ABI break (KF6) - QPointer parentSurface(); - /** - * @returns The parent surface for which this SubSurfaceInterface is a child - * @since 5.22 - **/ - QPointer parentSurface() const; - - /** - * @returns the main surface for the sub-surface tree, that is the first surface without a parent - * @since 5.22 - **/ - QPointer mainSurface() const; + * Returns the SurfaceInterface for this SubSurfaceInterface. This function never returns a + * @c null. + */ + SurfaceInterface *surface() const; + + /** + * Returns the parent surface for this SubSurfaceInterface. This function may return @c null. + */ + SurfaceInterface *parentSurface() const; + + /** + * Returns the main surface for the sub-surface tree, that is the first surface without a parent + */ + SurfaceInterface *mainSurface() const; Q_SIGNALS: - void positionChanged(const QPoint&); - void modeChanged(KWayland::Server::SubSurfaceInterface::Mode); + /** + * This signal is emitted when the position of the sub-surface has changed. + */ + void positionChanged(const QPoint &position); + /** + * This signal is emitted when the commit mode of the sub-surface has changed. + */ + void modeChanged(KWaylandServer::SubSurfaceInterface::Mode mode); private: - friend class SubCompositorInterface; - friend class SurfaceInterface; - explicit SubSurfaceInterface(SubCompositorInterface *parent, wl_resource *parentResource); - - class Private; - Private *d_func() const; + SubSurfaceInterface(SurfaceInterface *surface, SurfaceInterface *parent, wl_resource *resource); + QScopedPointer d; + friend class SubSurfaceInterfacePrivate; + friend class SubCompositorInterfacePrivate; }; -} -} - -Q_DECLARE_METATYPE(KWayland::Server::SubSurfaceInterface::Mode) +} // namespace KWaylandServer -#endif +Q_DECLARE_METATYPE(KWaylandServer::SubSurfaceInterface::Mode) diff -Nru dwayland-5.57.0.23/src/server/subsurface_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/subsurface_interface_p.h --- dwayland-5.57.0.23/src/server/subsurface_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/subsurface_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,73 +1,60 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SUBSURFACE_INTERFACE_P_H -#define WAYLAND_SERVER_SUBSURFACE_INTERFACE_P_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once #include "subcompositor_interface.h" -#include "resource_p.h" -// Qt +#include "surfacerole_p.h" + #include -// Wayland -#include +#include + +#include "qwayland-server-wayland.h" -namespace KWayland +namespace KWaylandServer { -namespace Server +class SubCompositorInterfacePrivate : public QtWaylandServer::wl_subcompositor { +public: + SubCompositorInterfacePrivate(Display *display, SubCompositorInterface *q); + + SubCompositorInterface *q; -class SubSurfaceInterface::Private : public Resource::Private +protected: + void subcompositor_destroy(Resource *resource) override; + void subcompositor_get_subsurface(Resource *resource, uint32_t id, struct ::wl_resource *surface_resource, struct ::wl_resource *parent_resource) override; +}; + +class SubSurfaceInterfacePrivate : public SurfaceRole, public QtWaylandServer::wl_subsurface { public: - Private(SubSurfaceInterface *q, SubCompositorInterface *compositor, wl_resource *parentResource); - ~Private(); + static SubSurfaceInterfacePrivate *get(SubSurfaceInterface *subsurface); + + SubSurfaceInterfacePrivate(SubSurfaceInterface *q, SurfaceInterface *surface, SurfaceInterface *parent, ::wl_resource *resource); + + void commit() override; + void parentCommit(); - using Resource::Private::create; - void create(ClientConnection *client, quint32 version, quint32 id, SurfaceInterface *surface, SurfaceInterface *parent); - void commit(); - - QPoint pos = QPoint(0, 0); - QPoint scheduledPos = QPoint(); - bool scheduledPosChange = false; - Mode mode = Mode::Synchronized; + SubSurfaceInterface *q; + QPoint position = QPoint(0, 0); + QPoint pendingPosition = QPoint(0, 0); + SubSurfaceInterface::Mode mode = SubSurfaceInterface::Mode::Synchronized; QPointer surface; QPointer parent; + bool hasPendingPosition = false; -private: - SubSurfaceInterface *q_func() { - return reinterpret_cast(q); - } - void setMode(Mode mode); - void setPosition(const QPoint &pos); - void placeAbove(SurfaceInterface *sibling); - void placeBelow(SurfaceInterface *sibling); - - static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); - static void placeAboveCallback(wl_client *client, wl_resource *resource, wl_resource *sibling); - static void placeBelowCallback(wl_client *client, wl_resource *resource, wl_resource *sibling); - static void setSyncCallback(wl_client *client, wl_resource *resource); - static void setDeSyncCallback(wl_client *client, wl_resource *resource); - - static const struct wl_subsurface_interface s_interface; +protected: + void subsurface_destroy_resource(Resource *resource) override; + void subsurface_destroy(Resource *resource) override; + void subsurface_set_position(Resource *resource, int32_t x, int32_t y) override; + void subsurface_place_above(Resource *resource, struct ::wl_resource *sibling_resource) override; + void subsurface_place_below(Resource *resource, struct ::wl_resource *sibling_resource) override; + void subsurface_set_sync(Resource *resource) override; + void subsurface_set_desync(Resource *resource) override; }; -} -} - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/surface_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/surface_interface.cpp --- dwayland-5.57.0.23/src/server/surface_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/surface_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,811 +1,834 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "surface_interface.h" -#include "surface_interface_p.h" -#include "buffer_interface.h" +#include "clientbuffer.h" #include "clientconnection.h" #include "compositor_interface.h" -#include "idleinhibit_interface_p.h" -#include "pointerconstraints_interface_p.h" -#include "region_interface.h" +#include "display.h" +#include "idleinhibit_v1_interface_p.h" +#include "linuxdmabufv1clientbuffer.h" +#include "pointerconstraints_v1_interface_p.h" +#include "region_interface_p.h" #include "subcompositor_interface.h" #include "subsurface_interface_p.h" -// Qt -#include -// Wayland -#include +#include "surface_interface_p.h" +#include "surfacerole_p.h" +#include "utils.h" // std #include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - -SurfaceInterface::Private::Private(SurfaceInterface *q, CompositorInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &wl_surface_interface, &s_interface) +SurfaceInterfacePrivate::SurfaceInterfacePrivate(SurfaceInterface *q) + : q(q) { + wl_list_init(¤t.frameCallbacks); + wl_list_init(&pending.frameCallbacks); + wl_list_init(&cached.frameCallbacks); } -SurfaceInterface::Private::~Private() +SurfaceInterfacePrivate::~SurfaceInterfacePrivate() { - destroy(); + wl_resource *resource; + wl_resource *tmp; + + wl_resource_for_each_safe(resource, tmp, ¤t.frameCallbacks) + { + wl_resource_destroy(resource); + } + wl_resource_for_each_safe(resource, tmp, &pending.frameCallbacks) + { + wl_resource_destroy(resource); + } + wl_resource_for_each_safe(resource, tmp, &cached.frameCallbacks) + { + wl_resource_destroy(resource); + } + + if (current.buffer) { + current.buffer->unref(); + } } -void SurfaceInterface::Private::addChild(QPointer< SubSurfaceInterface > child) +void SurfaceInterfacePrivate::addChild(SubSurfaceInterface *child) { // protocol is not precise on how to handle the addition of new sub surfaces - pending.children.append(child); - subSurfacePending.children.append(child); - current.children.append(child); - Q_Q(SurfaceInterface); - emit q->subSurfaceTreeChanged(); - QObject::connect(child.data(), &SubSurfaceInterface::positionChanged, q, &SurfaceInterface::subSurfaceTreeChanged); - QObject::connect(child->surface().data(), &SurfaceInterface::damaged, q, &SurfaceInterface::subSurfaceTreeChanged); - QObject::connect(child->surface().data(), &SurfaceInterface::unmapped, q, &SurfaceInterface::subSurfaceTreeChanged); - QObject::connect(child->surface().data(), &SurfaceInterface::subSurfaceTreeChanged, q, &SurfaceInterface::subSurfaceTreeChanged); + pending.above.append(child); + cached.above.append(child); + current.above.append(child); + child->surface()->setOutputs(outputs); + Q_EMIT q->childSubSurfaceAdded(child); + Q_EMIT q->childSubSurfacesChanged(); } -void SurfaceInterface::Private::removeChild(QPointer< SubSurfaceInterface > child) +void SurfaceInterfacePrivate::removeChild(SubSurfaceInterface *child) { // protocol is not precise on how to handle the addition of new sub surfaces - pending.children.removeAll(child); - subSurfacePending.children.removeAll(child); - current.children.removeAll(child); - Q_Q(SurfaceInterface); - emit q->subSurfaceTreeChanged(); - QObject::disconnect(child.data(), &SubSurfaceInterface::positionChanged, q, &SurfaceInterface::subSurfaceTreeChanged); - if (!child->surface().isNull()) { - QObject::disconnect(child->surface().data(), &SurfaceInterface::damaged, q, &SurfaceInterface::subSurfaceTreeChanged); - QObject::disconnect(child->surface().data(), &SurfaceInterface::unmapped, q, &SurfaceInterface::subSurfaceTreeChanged); - QObject::disconnect(child->surface().data(), &SurfaceInterface::subSurfaceTreeChanged, q, &SurfaceInterface::subSurfaceTreeChanged); + pending.below.removeAll(child); + pending.above.removeAll(child); + cached.below.removeAll(child); + cached.above.removeAll(child); + current.below.removeAll(child); + current.above.removeAll(child); + Q_EMIT q->childSubSurfaceRemoved(child); + Q_EMIT q->childSubSurfacesChanged(); +} + +bool SurfaceInterfacePrivate::raiseChild(SubSurfaceInterface *subsurface, SurfaceInterface *anchor) +{ + Q_ASSERT(subsurface->parentSurface() == q); + + QList *anchorList; + int anchorIndex; + + pending.below.removeOne(subsurface); + pending.above.removeOne(subsurface); + + if (anchor == q) { + // Pretend as if the parent surface were before the first child in the above list. + anchorList = &pending.above; + anchorIndex = -1; + } else if (anchorIndex = pending.above.indexOf(anchor->subSurface()); anchorIndex != -1) { + anchorList = &pending.above; + } else if (anchorIndex = pending.below.indexOf(anchor->subSurface()); anchorIndex != -1) { + anchorList = &pending.below; + } else { + return false; // The anchor belongs to other sub-surface tree. } -} -bool SurfaceInterface::Private::raiseChild(QPointer subsurface, SurfaceInterface *sibling) -{ - Q_Q(SurfaceInterface); - auto it = std::find(pending.children.begin(), pending.children.end(), subsurface); - if (it == pending.children.end()) { - return false; - } - if (pending.children.count() == 1) { - // nothing to do - return true; - } - if (sibling == q) { - // it's to the parent, so needs to become last item - pending.children.append(*it); - pending.children.erase(it); - pending.childrenChanged = true; - return true; - } - if (!sibling->subSurface()) { - // not a sub surface - return false; - } - auto siblingIt = std::find(pending.children.begin(), pending.children.end(), sibling->subSurface()); - if (siblingIt == pending.children.end() || siblingIt == it) { - // not a sibling - return false; - } - auto value = (*it); - pending.children.erase(it); - // find the iterator again - siblingIt = std::find(pending.children.begin(), pending.children.end(), sibling->subSurface()); - pending.children.insert(++siblingIt, value); + anchorList->insert(anchorIndex + 1, subsurface); pending.childrenChanged = true; return true; } -bool SurfaceInterface::Private::lowerChild(QPointer subsurface, SurfaceInterface *sibling) +bool SurfaceInterfacePrivate::lowerChild(SubSurfaceInterface *subsurface, SurfaceInterface *anchor) { - Q_Q(SurfaceInterface); - auto it = std::find(pending.children.begin(), pending.children.end(), subsurface); - if (it == pending.children.end()) { - return false; - } - if (pending.children.count() == 1) { - // nothing to do - return true; - } - if (sibling == q) { - // it's to the parent, so needs to become first item - auto value = *it; - pending.children.erase(it); - pending.children.prepend(value); - pending.childrenChanged = true; - return true; - } - if (!sibling->subSurface()) { - // not a sub surface - return false; - } - auto siblingIt = std::find(pending.children.begin(), pending.children.end(), sibling->subSurface()); - if (siblingIt == pending.children.end() || siblingIt == it) { - // not a sibling - return false; - } - auto value = (*it); - pending.children.erase(it); - // find the iterator again - siblingIt = std::find(pending.children.begin(), pending.children.end(), sibling->subSurface()); - pending.children.insert(siblingIt, value); + Q_ASSERT(subsurface->parentSurface() == q); + + QList *anchorList; + int anchorIndex; + + pending.below.removeOne(subsurface); + pending.above.removeOne(subsurface); + + if (anchor == q) { + // Pretend as if the parent surface were after the last child in the below list. + anchorList = &pending.below; + anchorIndex = pending.below.count(); + } else if (anchorIndex = pending.above.indexOf(anchor->subSurface()); anchorIndex != -1) { + anchorList = &pending.above; + } else if (anchorIndex = pending.below.indexOf(anchor->subSurface()); anchorIndex != -1) { + anchorList = &pending.below; + } else { + return false; // The anchor belongs to other sub-surface tree. + } + + anchorList->insert(anchorIndex, subsurface); pending.childrenChanged = true; return true; } -void SurfaceInterface::Private::setShadow(const QPointer &shadow) +void SurfaceInterfacePrivate::setShadow(const QPointer &shadow) { pending.shadow = shadow; pending.shadowIsSet = true; } -void SurfaceInterface::Private::setBlur(const QPointer &blur) +void SurfaceInterfacePrivate::setBlur(const QPointer &blur) { pending.blur = blur; pending.blurIsSet = true; } -void SurfaceInterface::Private::setSlide(const QPointer &slide) +void SurfaceInterfacePrivate::setSlide(const QPointer &slide) { pending.slide = slide; pending.slideIsSet = true; } -void SurfaceInterface::Private::setContrast(const QPointer &contrast) +void SurfaceInterfacePrivate::setContrast(const QPointer &contrast) { pending.contrast = contrast; pending.contrastIsSet = true; } -void SurfaceInterface::Private::installPointerConstraint(LockedPointerInterface *lock) +void SurfaceInterfacePrivate::installPointerConstraint(LockedPointerV1Interface *lock) { - Q_ASSERT(lockedPointer.isNull()); - Q_ASSERT(confinedPointer.isNull()); - lockedPointer = QPointer(lock); + Q_ASSERT(!lockedPointer); + Q_ASSERT(!confinedPointer); + + lockedPointer = lock; auto cleanUp = [this]() { - lockedPointer.clear(); - disconnect(constrainsOneShotConnection); + lockedPointer = nullptr; + QObject::disconnect(constrainsOneShotConnection); constrainsOneShotConnection = QMetaObject::Connection(); - disconnect(constrainsUnboundConnection); + QObject::disconnect(constrainsUnboundConnection); constrainsUnboundConnection = QMetaObject::Connection(); - emit q_func()->pointerConstraintsChanged(); + Q_EMIT q->pointerConstraintsChanged(); }; - if (lock->lifeTime() == LockedPointerInterface::LifeTime::OneShot) { - constrainsOneShotConnection = QObject::connect(lock, &LockedPointerInterface::lockedChanged, q_func(), - [this, cleanUp] { - if (lockedPointer.isNull() || lockedPointer->isLocked()) { - return; - } - cleanUp(); - } - ); - } - constrainsUnboundConnection = QObject::connect(lock, &LockedPointerInterface::unbound, q_func(), - [this, cleanUp] { - if (lockedPointer.isNull()) { + if (lock->lifeTime() == LockedPointerV1Interface::LifeTime::OneShot) { + constrainsOneShotConnection = QObject::connect(lock, &LockedPointerV1Interface::lockedChanged, q, [this, cleanUp] { + if (lockedPointer->isLocked()) { return; } cleanUp(); - } - ); - emit q_func()->pointerConstraintsChanged(); + }); + } + constrainsUnboundConnection = QObject::connect(lock, &LockedPointerV1Interface::destroyed, q, cleanUp); + Q_EMIT q->pointerConstraintsChanged(); } -void SurfaceInterface::Private::installPointerConstraint(ConfinedPointerInterface *confinement) +void SurfaceInterfacePrivate::installPointerConstraint(ConfinedPointerV1Interface *confinement) { - Q_ASSERT(lockedPointer.isNull()); - Q_ASSERT(confinedPointer.isNull()); - confinedPointer = QPointer(confinement); + Q_ASSERT(!lockedPointer); + Q_ASSERT(!confinedPointer); + + confinedPointer = confinement; auto cleanUp = [this]() { - confinedPointer.clear(); - disconnect(constrainsOneShotConnection); + confinedPointer = nullptr; + QObject::disconnect(constrainsOneShotConnection); constrainsOneShotConnection = QMetaObject::Connection(); - disconnect(constrainsUnboundConnection); + QObject::disconnect(constrainsUnboundConnection); constrainsUnboundConnection = QMetaObject::Connection(); - emit q_func()->pointerConstraintsChanged(); + Q_EMIT q->pointerConstraintsChanged(); }; - if (confinement->lifeTime() == ConfinedPointerInterface::LifeTime::OneShot) { - constrainsOneShotConnection = QObject::connect(confinement, &ConfinedPointerInterface::confinedChanged, q_func(), - [this, cleanUp] { - if (confinedPointer.isNull() || confinedPointer->isConfined()) { - return; - } - cleanUp(); - } - ); - } - constrainsUnboundConnection = QObject::connect(confinement, &ConfinedPointerInterface::unbound, q_func(), - [this, cleanUp] { - if (confinedPointer.isNull()) { + if (confinement->lifeTime() == ConfinedPointerV1Interface::LifeTime::OneShot) { + constrainsOneShotConnection = QObject::connect(confinement, &ConfinedPointerV1Interface::confinedChanged, q, [this, cleanUp] { + if (confinedPointer->isConfined()) { return; } cleanUp(); - } - ); - emit q_func()->pointerConstraintsChanged(); + }); + } + constrainsUnboundConnection = QObject::connect(confinement, &ConfinedPointerV1Interface::destroyed, q, cleanUp); + Q_EMIT q->pointerConstraintsChanged(); } -void SurfaceInterface::Private::installIdleInhibitor(IdleInhibitorInterface *inhibitor) +void SurfaceInterfacePrivate::installIdleInhibitor(IdleInhibitorV1Interface *inhibitor) { idleInhibitors << inhibitor; - QObject::connect(inhibitor, &IdleInhibitorInterface::aboutToBeUnbound, q, - [this, inhibitor] { - idleInhibitors.removeOne(inhibitor); - if (idleInhibitors.isEmpty()) { - emit q_func()->inhibitsIdleChanged(); - } + QObject::connect(inhibitor, &IdleInhibitorV1Interface::destroyed, q, [this, inhibitor] { + idleInhibitors.removeOne(inhibitor); + if (idleInhibitors.isEmpty()) { + Q_EMIT q->inhibitsIdleChanged(); } - ); + }); if (idleInhibitors.count() == 1) { - emit q_func()->inhibitsIdleChanged(); + Q_EMIT q->inhibitsIdleChanged(); + } +} + +void SurfaceInterfacePrivate::surface_destroy_resource(Resource *) +{ + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void SurfaceInterfacePrivate::surface_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void SurfaceInterfacePrivate::surface_attach(Resource *resource, struct ::wl_resource *buffer, int32_t x, int32_t y) +{ + Q_UNUSED(resource) + pending.bufferIsSet = true; + pending.offset = QPoint(x, y); + if (!buffer) { + // got a null buffer, deletes content in next frame + pending.buffer = nullptr; + pending.damage = QRegion(); + pending.bufferDamage = QRegion(); + return; + } + pending.buffer = compositor->display()->clientBufferForResource(buffer); + + // set default damage to force initial rendering + auto bufferSize = pending.buffer->size(); + pending.damage = QRegion(0, 0, bufferSize.width(), bufferSize.height()); +} + +void SurfaceInterfacePrivate::surface_damage(Resource *, int32_t x, int32_t y, int32_t width, int32_t height) +{ + pending.damage |= QRect(x, y, width, height); +} + +void SurfaceInterfacePrivate::surface_frame(Resource *resource, uint32_t callback) +{ + wl_resource *callbackResource = wl_resource_create(resource->client(), + &wl_callback_interface, + /* version */ 1, + callback); + if (!callbackResource) { + wl_resource_post_no_memory(resource->handle); + return; + } + + wl_resource_set_implementation(callbackResource, nullptr, nullptr, [](wl_resource *resource) { + wl_list_remove(wl_resource_get_link(resource)); + }); + + wl_list_insert(pending.frameCallbacks.prev, wl_resource_get_link(callbackResource)); +} + +void SurfaceInterfacePrivate::surface_set_opaque_region(Resource *resource, struct ::wl_resource *region) +{ + Q_UNUSED(resource) + RegionInterface *r = RegionInterface::get(region); + pending.opaque = r ? r->region() : QRegion(); + pending.opaqueIsSet = true; +} + +void SurfaceInterfacePrivate::surface_set_input_region(Resource *resource, struct ::wl_resource *region) +{ + Q_UNUSED(resource) + RegionInterface *r = RegionInterface::get(region); + pending.input = r ? r->region() : infiniteRegion(); + pending.inputIsSet = true; +} + +void SurfaceInterfacePrivate::surface_commit(Resource *resource) +{ + Q_UNUSED(resource) + if (subSurface) { + commitSubSurface(); + } else { + applyState(&pending); + } +} + +void SurfaceInterfacePrivate::surface_set_buffer_transform(Resource *resource, int32_t transform) +{ + if (transform < 0 || transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) { + wl_resource_post_error(resource->handle, error_invalid_transform, "buffer transform must be a valid transform (%d specified)", transform); + return; + } + pending.bufferTransform = OutputInterface::Transform(transform); + pending.bufferTransformIsSet = true; +} + +void SurfaceInterfacePrivate::surface_set_buffer_scale(Resource *resource, int32_t scale) +{ + if (scale < 1) { + wl_resource_post_error(resource->handle, error_invalid_scale, "buffer scale must be at least one (%d specified)", scale); + return; } + pending.bufferScale = scale; + pending.bufferScaleIsSet = true; +} + +void SurfaceInterfacePrivate::surface_damage_buffer(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +{ + Q_UNUSED(resource) + pending.bufferDamage |= QRect(x, y, width, height); +} + +SurfaceInterface::SurfaceInterface(CompositorInterface *compositor, wl_resource *resource) + : QObject(compositor) + , d(new SurfaceInterfacePrivate(this)) +{ + d->compositor = compositor; + d->init(resource); + d->client = compositor->display()->getConnection(d->resource()->client()); +} + +SurfaceInterface::~SurfaceInterface() +{ +} + +uint32_t SurfaceInterface::id() const +{ + return wl_resource_get_id(resource()); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_surface_interface SurfaceInterface::Private::s_interface = { - resourceDestroyedCallback, - attachCallback, - damageCallback, - frameCallback, - opaqueRegionCallback, - inputRegionCallback, - commitCallback, - bufferTransformCallback, - bufferScaleCallback -}; -#endif +ClientConnection *SurfaceInterface::client() const +{ + return d->client; +} -SurfaceInterface::SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +wl_resource *SurfaceInterface::resource() const { + return d->resource()->handle; } -SurfaceInterface::~SurfaceInterface() = default; +CompositorInterface *SurfaceInterface::compositor() const +{ + return d->compositor; +} void SurfaceInterface::frameRendered(quint32 msec) { - Q_D(); // notify all callbacks - const bool needsFlush = !d->current.callbacks.isEmpty(); - while (!d->current.callbacks.isEmpty()) { - wl_resource *r = d->current.callbacks.takeFirst(); - wl_callback_send_done(r, msec); - wl_resource_destroy(r); - } - for (auto it = d->current.children.constBegin(); it != d->current.children.constEnd(); ++it) { - const auto &subSurface = *it; - if (subSurface.isNull() || subSurface->d_func()->surface.isNull()) { - continue; - } - subSurface->d_func()->surface->frameRendered(msec); - } - if (needsFlush) { - client()->flush(); + wl_resource *resource; + wl_resource *tmp; + + wl_resource_for_each_safe(resource, tmp, &d->current.frameCallbacks) + { + wl_callback_send_done(resource, msec); + wl_resource_destroy(resource); } -} -void SurfaceInterface::Private::destroy() -{ - // copy all existing callbacks to new list and clear existing lists - // the wl_resource_destroy on the callback resource goes into destroyFrameCallback - // which would modify the list we are iterating on - QList callbacksToDestroy; - callbacksToDestroy << current.callbacks; - current.callbacks.clear(); - callbacksToDestroy << pending.callbacks; - pending.callbacks.clear(); - callbacksToDestroy << subSurfacePending.callbacks; - subSurfacePending.callbacks.clear(); - for (auto it = callbacksToDestroy.constBegin(), end = callbacksToDestroy.constEnd(); it != end; it++) { - wl_resource_destroy(*it); + for (SubSurfaceInterface *subsurface : qAsConst(d->current.below)) { + subsurface->surface()->frameRendered(msec); } - if (current.buffer) { - current.buffer->unref(); + for (SubSurfaceInterface *subsurface : qAsConst(d->current.above)) { + subsurface->surface()->frameRendered(msec); } } -void SurfaceInterface::Private::swapStates(State *source, State *target, bool emitChanged) +bool SurfaceInterface::hasFrameCallbacks() const { - Q_Q(SurfaceInterface); - bool bufferChanged = source->bufferIsSet; - const bool opaqueRegionChanged = source->opaqueIsSet; - const bool inputRegionChanged = source->inputIsSet; - const bool offsetChanged = source->offsetIsSet; - const bool scaleFactorChanged = source->scaleIsSet && (target->scale != source->scale); - const bool transformChanged = source->transformIsSet && (target->transform != source->transform); - const bool shadowChanged = source->shadowIsSet; - const bool blurChanged = source->blurIsSet; - const bool contrastChanged = source->contrastIsSet; - const bool slideChanged = source->slideIsSet; - const bool childrenChanged = source->childrenChanged; - bool sizeChanged = false; - auto buffer = target->buffer; - if (bufferChanged) { - // TODO: is the reffing correct for subsurfaces? - QSize oldSize; - if (target->buffer) { - oldSize = target->buffer->size(); - if (emitChanged) { - target->buffer->unref(); - QObject::disconnect(target->buffer, &BufferInterface::sizeChanged, q, &SurfaceInterface::sizeChanged); - } else { - delete target->buffer; - target->buffer = nullptr; - } - } - if (source->buffer) { - if (emitChanged) { - source->buffer->ref(); - QObject::connect(source->buffer, &BufferInterface::sizeChanged, q, &SurfaceInterface::sizeChanged); - } - const QSize newSize = source->buffer->size(); - sizeChanged = newSize.isValid() && newSize != oldSize; - } - if (!target->buffer && !source->buffer && emitChanged) { - // null buffer set on a not mapped surface, don't emit unmapped - bufferChanged = false; - } - buffer = source->buffer; + return !wl_list_empty(&d->current.frameCallbacks); +} + +QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix() +{ + // The order of transforms is reversed, i.e. the viewport transform is the first one. + + QMatrix4x4 surfaceToBufferMatrix; + + if (!current.buffer) { + return surfaceToBufferMatrix; } - // copy values - if (bufferChanged) { + + surfaceToBufferMatrix.scale(current.bufferScale, current.bufferScale); + + switch (current.bufferTransform) { + case OutputInterface::Transform::Normal: + case OutputInterface::Transform::Flipped: + break; + case OutputInterface::Transform::Rotated90: + case OutputInterface::Transform::Flipped90: + surfaceToBufferMatrix.translate(0, bufferSize.height() / current.bufferScale); + surfaceToBufferMatrix.rotate(-90, 0, 0, 1); + break; + case OutputInterface::Transform::Rotated180: + case OutputInterface::Transform::Flipped180: + surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, bufferSize.height() / current.bufferScale); + surfaceToBufferMatrix.rotate(-180, 0, 0, 1); + break; + case OutputInterface::Transform::Rotated270: + case OutputInterface::Transform::Flipped270: + surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, 0); + surfaceToBufferMatrix.rotate(-270, 0, 0, 1); + break; + } + + switch (current.bufferTransform) { + case OutputInterface::Transform::Flipped: + case OutputInterface::Transform::Flipped180: + surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, 0); + surfaceToBufferMatrix.scale(-1, 1); + break; + case OutputInterface::Transform::Flipped90: + case OutputInterface::Transform::Flipped270: + surfaceToBufferMatrix.translate(bufferSize.height() / current.bufferScale, 0); + surfaceToBufferMatrix.scale(-1, 1); + break; + default: + break; + } + + if (current.viewport.sourceGeometry.isValid()) { + surfaceToBufferMatrix.translate(current.viewport.sourceGeometry.x(), current.viewport.sourceGeometry.y()); + } + + QSizeF sourceSize; + if (current.viewport.sourceGeometry.isValid()) { + sourceSize = current.viewport.sourceGeometry.size(); + } else { + sourceSize = implicitSurfaceSize; + } + + if (sourceSize != surfaceSize) { + surfaceToBufferMatrix.scale(sourceSize.width() / surfaceSize.width(), sourceSize.height() / surfaceSize.height()); + } + + return surfaceToBufferMatrix; +} + +void SurfaceState::mergeInto(SurfaceState *target) +{ + if (bufferIsSet) { target->buffer = buffer; - target->damage = source->damage; - target->bufferIsSet = source->bufferIsSet; + target->offset = offset; + target->damage = damage; + target->bufferDamage = bufferDamage; + target->bufferIsSet = bufferIsSet; + } + if (viewport.sourceGeometryIsSet) { + target->viewport.sourceGeometry = viewport.sourceGeometry; + target->viewport.sourceGeometryIsSet = true; + } + if (viewport.destinationSizeIsSet) { + target->viewport.destinationSize = viewport.destinationSize; + target->viewport.destinationSizeIsSet = true; } if (childrenChanged) { - target->childrenChanged = source->childrenChanged; - target->children = source->children; + target->below = below; + target->above = above; + target->childrenChanged = true; } - target->callbacks.append(source->callbacks); + wl_list_insert_list(&target->frameCallbacks, &frameCallbacks); - if (shadowChanged) { - target->shadow = source->shadow; + if (shadowIsSet) { + target->shadow = shadow; target->shadowIsSet = true; } - if (blurChanged) { - target->blur = source->blur; + if (blurIsSet) { + target->blur = blur; target->blurIsSet = true; } - if (contrastChanged) { - target->contrast = source->contrast; + if (contrastIsSet) { + target->contrast = contrast; target->contrastIsSet = true; } - if (slideChanged) { - target->slide = source->slide; + if (slideIsSet) { + target->slide = slide; target->slideIsSet = true; } - if (inputRegionChanged) { - target->input = source->input; - target->inputIsInfinite = source->inputIsInfinite; + if (inputIsSet) { + target->input = input; target->inputIsSet = true; } - if (opaqueRegionChanged) { - target->opaque = source->opaque; + if (opaqueIsSet) { + target->opaque = opaque; target->opaqueIsSet = true; } - if (offsetChanged && (target->offset != source->offset)) { - target->offset = source->offset; - target->offsetIsSet = true; + if (bufferScaleIsSet) { + target->bufferScale = bufferScale; + target->bufferScaleIsSet = true; } - if (scaleFactorChanged) { - target->scale = source->scale; - target->scaleIsSet = true; + if (bufferTransformIsSet) { + target->bufferTransform = bufferTransform; + target->bufferTransformIsSet = true; } - if (transformChanged) { - target->transform = source->transform; - target->transformIsSet = true; + + *this = SurfaceState{}; + below = target->below; + above = target->above; + wl_list_init(&frameCallbacks); +} + +void SurfaceInterfacePrivate::applyState(SurfaceState *next) +{ + const bool bufferChanged = next->bufferIsSet; + const bool opaqueRegionChanged = next->opaqueIsSet; + const bool scaleFactorChanged = next->bufferScaleIsSet && (current.bufferScale != next->bufferScale); + const bool transformChanged = next->bufferTransformIsSet && (current.bufferTransform != next->bufferTransform); + const bool shadowChanged = next->shadowIsSet; + const bool blurChanged = next->blurIsSet; + const bool contrastChanged = next->contrastIsSet; + const bool slideChanged = next->slideIsSet; + const bool childrenChanged = next->childrenChanged; + const bool visibilityChanged = bufferChanged && bool(current.buffer) != bool(next->buffer); + + const QSize oldSurfaceSize = surfaceSize; + const QSize oldBufferSize = bufferSize; + const QMatrix4x4 oldSurfaceToBufferMatrix = surfaceToBufferMatrix; + const QRegion oldInputRegion = inputRegion; + + next->mergeInto(¤t); + + if (lockedPointer) { + auto lockedPointerPrivate = LockedPointerV1InterfacePrivate::get(lockedPointer); + lockedPointerPrivate->commit(); } - if (!lockedPointer.isNull()) { - lockedPointer->d_func()->commit(); + if (confinedPointer) { + auto confinedPointerPrivate = ConfinedPointerV1InterfacePrivate::get(confinedPointer); + confinedPointerPrivate->commit(); } - if (!confinedPointer.isNull()) { - confinedPointer->d_func()->commit(); + + if (bufferRef != current.buffer) { + if (bufferRef) { + bufferRef->unref(); + } + bufferRef = current.buffer; + if (bufferRef) { + bufferRef->ref(); + } + } + + // TODO: Refactor the state management code because it gets more clumsy. + if (current.buffer) { + bufferSize = current.buffer->size(); + + implicitSurfaceSize = current.buffer->size() / current.bufferScale; + switch (current.bufferTransform) { + case OutputInterface::Transform::Rotated90: + case OutputInterface::Transform::Rotated270: + case OutputInterface::Transform::Flipped90: + case OutputInterface::Transform::Flipped270: + implicitSurfaceSize.transpose(); + break; + case OutputInterface::Transform::Normal: + case OutputInterface::Transform::Rotated180: + case OutputInterface::Transform::Flipped: + case OutputInterface::Transform::Flipped180: + break; + } + + if (current.viewport.destinationSize.isValid()) { + surfaceSize = current.viewport.destinationSize; + } else if (current.viewport.sourceGeometry.isValid()) { + surfaceSize = current.viewport.sourceGeometry.size().toSize(); + } else { + surfaceSize = implicitSurfaceSize; + } + } else { + surfaceSize = QSize(); + implicitSurfaceSize = QSize(); + bufferSize = QSize(); } - *source = State{}; - source->children = target->children; + surfaceToBufferMatrix = buildSurfaceToBufferMatrix(); + bufferToSurfaceMatrix = surfaceToBufferMatrix.inverted(); + inputRegion = current.input & QRect(QPoint(0, 0), surfaceSize); if (opaqueRegionChanged) { - emit q->opaqueChanged(target->opaque); + Q_EMIT q->opaqueChanged(current.opaque); } - if (inputRegionChanged) { - emit q->inputChanged(target->input); + if (oldInputRegion != inputRegion) { + Q_EMIT q->inputChanged(inputRegion); } if (scaleFactorChanged) { - emit q->scaleChanged(target->scale); - if (buffer && !sizeChanged) { - emit q->sizeChanged(); - } + Q_EMIT q->bufferScaleChanged(current.bufferScale); } if (transformChanged) { - emit q->transformChanged(target->transform); + Q_EMIT q->bufferTransformChanged(current.bufferTransform); } - if (bufferChanged && emitChanged) { - if (target->buffer && !target->damage.isEmpty()) { + if (visibilityChanged) { + updateEffectiveMapped(); + } + if (bufferChanged) { + if (current.buffer && (!current.damage.isEmpty() || !current.bufferDamage.isEmpty())) { const QRegion windowRegion = QRegion(0, 0, q->size().width(), q->size().height()); - if (!windowRegion.isEmpty()) { - target->damage = windowRegion.intersected(target->damage); - if (emitChanged) { - subSurfaceIsMapped = true; - trackedDamage = trackedDamage.united(target->damage); - emit q->damaged(target->damage); - // workaround for https://bugreports.qt.io/browse/QTBUG-52092 - // if the surface is a sub-surface, but the main surface is not yet mapped, fake frame rendered - if (subSurface) { - const auto mainSurface = subSurface->mainSurface(); - if (!mainSurface || !mainSurface->buffer()) { - q->frameRendered(0); - } - } - } - } - } else if (!target->buffer && emitChanged) { - subSurfaceIsMapped = false; - emit q->unmapped(); + const QRegion bufferDamage = q->mapFromBuffer(current.bufferDamage); + current.damage = windowRegion.intersected(current.damage.united(bufferDamage)); + Q_EMIT q->damaged(current.damage); } } - if (!emitChanged) { - return; + if (surfaceToBufferMatrix != oldSurfaceToBufferMatrix) { + Q_EMIT q->surfaceToBufferMatrixChanged(); + } + if (bufferSize != oldBufferSize) { + Q_EMIT q->bufferSizeChanged(); } - if (sizeChanged) { - emit q->sizeChanged(); + if (surfaceSize != oldSurfaceSize) { + Q_EMIT q->sizeChanged(); } if (shadowChanged) { - emit q->shadowChanged(); + Q_EMIT q->shadowChanged(); } if (blurChanged) { - emit q->blurChanged(); + Q_EMIT q->blurChanged(); } if (contrastChanged) { - emit q->contrastChanged(); + Q_EMIT q->contrastChanged(); } if (slideChanged) { - emit q->slideOnShowHideChanged(); + Q_EMIT q->slideOnShowHideChanged(); } if (childrenChanged) { - emit q->subSurfaceTreeChanged(); + Q_EMIT q->childSubSurfacesChanged(); } -} - -void SurfaceInterface::Private::commit() -{ - if (!subSurface.isNull() && subSurface->isSynchronized()) { - swapStates(&pending, &subSurfacePending, false); - } else { - swapStates(&pending, ¤t, true); - if (!subSurface.isNull()) { - subSurface->d_func()->commit(); - } - // commit all subSurfaces to apply position changes - // "The cached state is applied to the sub-surface immediately after the parent surface's state is applied" - for (auto it = current.children.constBegin(); it != current.children.constEnd(); ++it) { - const auto &subSurface = *it; - if (subSurface.isNull()) { - continue; - } - subSurface->d_func()->commit(); - } + // The position of a sub-surface is applied when its parent is committed. + for (SubSurfaceInterface *subsurface : qAsConst(current.below)) { + auto subsurfacePrivate = SubSurfaceInterfacePrivate::get(subsurface); + subsurfacePrivate->parentCommit(); } -} - -void SurfaceInterface::Private::commitSubSurface() -{ - if (subSurface.isNull() || !subSurface->isSynchronized()) { - return; + for (SubSurfaceInterface *subsurface : qAsConst(current.above)) { + auto subsurfacePrivate = SubSurfaceInterfacePrivate::get(subsurface); + subsurfacePrivate->parentCommit(); } - swapStates(&subSurfacePending, ¤t, true); - // "The cached state is applied to the sub-surface immediately after the parent surface's state is applied" - for (auto it = current.children.constBegin(); it != current.children.constEnd(); ++it) { - const auto &subSurface = *it; - if (subSurface.isNull() || !subSurface->isSynchronized()) { - continue; - } - subSurface->d_func()->commit(); + if (role) { + role->commit(); } + Q_EMIT q->committed(); } -void SurfaceInterface::Private::damage(const QRect &rect) +void SurfaceInterfacePrivate::commitSubSurface() { - pending.damage = pending.damage.united(rect); + if (subSurface->isSynchronized()) { + commitToCache(); + } else { + if (hasCacheState) { + commitToCache(); + commitFromCache(); + } else { + applyState(&pending); + } + } } -void SurfaceInterface::Private::setScale(qint32 scale) +void SurfaceInterfacePrivate::commitToCache() { - pending.scale = scale; - pending.scaleIsSet = true; + pending.mergeInto(&cached); + hasCacheState = true; } -void SurfaceInterface::Private::setTransform(OutputInterface::Transform transform) +void SurfaceInterfacePrivate::commitFromCache() { - pending.transform = transform; + applyState(&cached); + hasCacheState = false; } -void SurfaceInterface::Private::addFrameCallback(uint32_t callback) +bool SurfaceInterfacePrivate::computeEffectiveMapped() const { - wl_resource *r = client->createResource(&wl_callback_interface, 1, callback); - if (!r) { - wl_resource_post_no_memory(resource); - return; - } - wl_resource_set_implementation(r, nullptr, this, destroyFrameCallback); - pending.callbacks << r; + return bufferRef && (!subSurface || subSurface->parentSurface()->isMapped()); } -void SurfaceInterface::Private::attachBuffer(wl_resource *buffer, const QPoint &offset) +void SurfaceInterfacePrivate::updateEffectiveMapped() { - pending.bufferIsSet = true; - pending.offset = offset; - pending.offsetIsSet = true; - if (pending.buffer) { - delete pending.buffer; - } - if (!buffer) { - // got a null buffer, deletes content in next frame - pending.buffer = nullptr; - pending.damage = QRegion(); + const bool effectiveMapped = computeEffectiveMapped(); + if (mapped == effectiveMapped) { return; } - Q_Q(SurfaceInterface); - pending.buffer = new BufferInterface(buffer, q); - - // set default damage to force initial rendering - auto bufferSize = pending.buffer->size(); - pending.damage = QRegion(0, 0, bufferSize.width(), bufferSize.height()); - - QObject::connect(pending.buffer, &BufferInterface::aboutToBeDestroyed, q, - [this](BufferInterface *buffer) { - if (pending.buffer == buffer) { - pending.buffer = nullptr; - } - if (subSurfacePending.buffer == buffer) { - subSurfacePending.buffer = nullptr; - } - if (current.buffer == buffer) { - current.buffer->unref(); - current.buffer = nullptr; - } - } - ); -} - -void SurfaceInterface::Private::destroyFrameCallback(wl_resource *r) -{ - auto s = cast(r); - s->current.callbacks.removeAll(r); - s->pending.callbacks.removeAll(r); - s->subSurfacePending.callbacks.removeAll(r); -} - -void SurfaceInterface::Private::attachCallback(wl_client *client, wl_resource *resource, wl_resource *buffer, int32_t sx, int32_t sy) -{ - Q_UNUSED(client) - cast(resource)->attachBuffer(buffer, QPoint(sx, sy)); -} - -void SurfaceInterface::Private::damageCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - Q_UNUSED(client) - cast(resource)->damage(QRect(x, y, width, height)); -} - -void SurfaceInterface::Private::frameCallback(wl_client *client, wl_resource *resource, uint32_t callback) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->addFrameCallback(callback); -} - -void SurfaceInterface::Private::opaqueRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - auto r = RegionInterface::get(region); - s->setOpaque(r ? r->region() : QRegion()); -} - -void SurfaceInterface::Private::setOpaque(const QRegion ®ion) -{ - pending.opaqueIsSet = true; - pending.opaque = region; -} - -void SurfaceInterface::Private::inputRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - auto r = RegionInterface::get(region); - s->setInput(r ? r->region() : QRegion(), !r); -} -void SurfaceInterface::Private::setInput(const QRegion ®ion, bool isInfinite) -{ - pending.inputIsSet = true; - pending.inputIsInfinite = isInfinite; - pending.input = region; -} + mapped = effectiveMapped; -void SurfaceInterface::Private::commitCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - cast(resource)->commit(); -} - -void SurfaceInterface::Private::bufferTransformCallback(wl_client *client, wl_resource *resource, int32_t transform) -{ - Q_UNUSED(client) - cast(resource)->setTransform(OutputInterface::Transform(transform)); -} + if (mapped) { + Q_EMIT q->mapped(); + } else { + Q_EMIT q->unmapped(); + } -void SurfaceInterface::Private::bufferScaleCallback(wl_client *client, wl_resource *resource, int32_t scale) -{ - Q_UNUSED(client) - cast(resource)->setScale(scale); + for (SubSurfaceInterface *subsurface : qAsConst(current.below)) { + auto surfacePrivate = SurfaceInterfacePrivate::get(subsurface->surface()); + surfacePrivate->updateEffectiveMapped(); + } + for (SubSurfaceInterface *subsurface : qAsConst(current.above)) { + auto surfacePrivate = SurfaceInterfacePrivate::get(subsurface->surface()); + surfacePrivate->updateEffectiveMapped(); + } } QRegion SurfaceInterface::damage() const { - Q_D(); return d->current.damage; } QRegion SurfaceInterface::opaque() const { - Q_D(); return d->current.opaque; } QRegion SurfaceInterface::input() const { - Q_D(); - return d->current.input; -} - -bool SurfaceInterface::inputIsInfitine() const -{ - return inputIsInfinite(); -} - -bool SurfaceInterface::inputIsInfinite() const -{ - Q_D(); - return d->current.inputIsInfinite; + return d->inputRegion; } -qint32 SurfaceInterface::scale() const +qint32 SurfaceInterface::bufferScale() const { - Q_D(); - return d->current.scale; + return d->current.bufferScale; } -OutputInterface::Transform SurfaceInterface::transform() const +OutputInterface::Transform SurfaceInterface::bufferTransform() const { - Q_D(); - return d->current.transform; + return d->current.bufferTransform; } -BufferInterface *SurfaceInterface::buffer() +ClientBuffer *SurfaceInterface::buffer() const { - Q_D(); - return d->current.buffer; + return d->bufferRef; } QPoint SurfaceInterface::offset() const { - Q_D(); return d->current.offset; } SurfaceInterface *SurfaceInterface::get(wl_resource *native) { - return Private::get(native); + if (auto surfacePrivate = resource_cast(native)) { + return surfacePrivate->q; + } + return nullptr; } SurfaceInterface *SurfaceInterface::get(quint32 id, const ClientConnection *client) { - return Private::get(id, client); + if (client) { + return get(client->getResource(id)); + } + return nullptr; } -QList< QPointer< SubSurfaceInterface > > SurfaceInterface::childSubSurfaces() const +QList SurfaceInterface::below() const { - Q_D(); - return d->current.children; + return d->current.below; } -QPointer< SubSurfaceInterface > SurfaceInterface::subSurface() const +QList SurfaceInterface::above() const +{ + return d->current.above; +} + +SubSurfaceInterface *SurfaceInterface::subSurface() const { - Q_D(); return d->subSurface; } QSize SurfaceInterface::size() const { - Q_D(); - // TODO: apply transform to the buffer size - if (d->current.buffer) { - return d->current.buffer->size() / scale(); + return d->surfaceSize; +} + +QRect SurfaceInterface::boundingRect() const +{ + QRect rect(QPoint(0, 0), size()); + + for (const SubSurfaceInterface *subSurface : qAsConst(d->current.below)) { + const SurfaceInterface *childSurface = subSurface->surface(); + rect |= childSurface->boundingRect().translated(subSurface->position()); + } + for (const SubSurfaceInterface *subSurface : qAsConst(d->current.above)) { + const SurfaceInterface *childSurface = subSurface->surface(); + rect |= childSurface->boundingRect().translated(subSurface->position()); } - return QSize(); + + return rect; } -QPointer< ShadowInterface > SurfaceInterface::shadow() const +QPointer SurfaceInterface::shadow() const { - Q_D(); return d->current.shadow; } -QPointer< BlurInterface > SurfaceInterface::blur() const +QPointer SurfaceInterface::blur() const { - Q_D(); return d->current.blur; } -QPointer< ContrastInterface > SurfaceInterface::contrast() const +QPointer SurfaceInterface::contrast() const { - Q_D(); return d->current.contrast; } -QPointer< SlideInterface > SurfaceInterface::slideOnShowHide() const +QPointer SurfaceInterface::slideOnShowHide() const { - Q_D(); return d->current.slide; } bool SurfaceInterface::isMapped() const { - Q_D(); - if (d->subSurface) { - // from spec: - // "A sub-surface becomes mapped, when a non-NULL wl_buffer is applied and the parent surface is mapped." - return d->subSurfaceIsMapped && !d->subSurface->parentSurface().isNull() && d->subSurface->parentSurface()->isMapped(); - } - return d->current.buffer != nullptr; -} - -QRegion SurfaceInterface::trackedDamage() const -{ - Q_D(); - return d->trackedDamage; -} - -void SurfaceInterface::resetTrackedDamage() -{ - Q_D(); - d->trackedDamage = QRegion(); + return d->mapped; } QVector SurfaceInterface::outputs() const { - Q_D(); return d->outputs; } void SurfaceInterface::setOutputs(const QVector &outputs) { - Q_D(); QVector removedOutputs = d->outputs; for (auto it = outputs.constBegin(), end = outputs.constEnd(); it != end; ++it) { const auto o = *it; @@ -813,12 +836,11 @@ } for (auto it = removedOutputs.constBegin(), end = removedOutputs.constEnd(); it != end; ++it) { const auto resources = (*it)->clientResources(client()); - for (wl_resource *r : resources) { - if (d->resource && r) { - wl_surface_send_leave(d->resource, r); - } + for (wl_resource *outputResource : resources) { + d->send_leave(outputResource); } disconnect(d->outputDestroyedConnections.take(*it)); + disconnect(d->outputBoundConnections.take(*it)); } QVector addedOutputsOutputs = outputs; for (auto it = d->outputs.constBegin(), end = d->outputs.constEnd(); it != end; ++it) { @@ -828,21 +850,32 @@ for (auto it = addedOutputsOutputs.constBegin(), end = addedOutputsOutputs.constEnd(); it != end; ++it) { const auto o = *it; const auto resources = o->clientResources(client()); - for (wl_resource *r : resources) { - if (d->resource && r) { - wl_surface_send_enter(d->resource, r); - } + for (wl_resource *outputResource : resources) { + d->send_enter(outputResource); } - d->outputDestroyedConnections[o] = connect(o, &Global::aboutToDestroyGlobal, this, [this, o] { - Q_D(); + d->outputDestroyedConnections[o] = connect(o, &OutputInterface::removed, this, [this, o] { auto outputs = d->outputs; if (outputs.removeAll(o)) { setOutputs(outputs); - }}); + } + }); + + Q_ASSERT(!d->outputBoundConnections.contains(o)); + d->outputBoundConnections[o] = connect(o, &OutputInterface::bound, this, [this](ClientConnection *c, wl_resource *outputResource) { + if (c != client()) { + return; + } + d->send_enter(outputResource); + }); } - // TODO: send enter when the client binds the OutputInterface another time d->outputs = outputs; + for (auto child : qAsConst(d->current.below)) { + child->surface()->setOutputs(outputs); + } + for (auto child : qAsConst(d->current.above)) { + child->surface()->setOutputs(outputs); + } } SurfaceInterface *SurfaceInterface::surfaceAt(const QPointF &position) @@ -850,24 +883,27 @@ if (!isMapped()) { return nullptr; } - Q_D(); - // go from top to bottom. Top most child is last in list - QListIterator> it(d->current.children); - it.toBack(); - while (it.hasPrevious()) { - const auto ¤t = it.previous(); - auto surface = current->surface(); - if (surface.isNull()) { - continue; - } + + for (auto it = d->current.above.crbegin(); it != d->current.above.crend(); ++it) { + const SubSurfaceInterface *current = *it; + SurfaceInterface *surface = current->surface(); if (auto s = surface->surfaceAt(position - current->position())) { return s; } } + // check whether the geometry contains the pos if (!size().isEmpty() && QRectF(QPoint(0, 0), size()).contains(position)) { return this; } + + for (auto it = d->current.below.crbegin(); it != d->current.below.crend(); ++it) { + const SubSurfaceInterface *current = *it; + SurfaceInterface *surface = current->surface(); + if (auto s = surface->surfaceAt(position - current->position())) { + return s; + } + } return nullptr; } @@ -878,62 +914,110 @@ if (!isMapped()) { return nullptr; } - Q_D(); - // go from top to bottom. Top most child is last in list - QListIterator> it(d->current.children); - it.toBack(); - while (it.hasPrevious()) { - const auto ¤t = it.previous(); + + for (auto it = d->current.above.crbegin(); it != d->current.above.crend(); ++it) { + const SubSurfaceInterface *current = *it; auto surface = current->surface(); - if (surface.isNull()) { - continue; - } if (auto s = surface->inputSurfaceAt(position - current->position())) { return s; } } + // check whether the geometry and input region contain the pos - if (!size().isEmpty() && QRectF(QPoint(0, 0), size()).contains(position) && - (inputIsInfinite() || input().contains(position.toPoint()))) { + if (!size().isEmpty() && QRectF(QPoint(0, 0), size()).contains(position) && input().contains(position.toPoint())) { return this; } + + for (auto it = d->current.below.crbegin(); it != d->current.below.crend(); ++it) { + const SubSurfaceInterface *current = *it; + auto surface = current->surface(); + if (auto s = surface->inputSurfaceAt(position - current->position())) { + return s; + } + } + return nullptr; } -QPointer SurfaceInterface::lockedPointer() const +LockedPointerV1Interface *SurfaceInterface::lockedPointer() const { - Q_D(); return d->lockedPointer; } -QPointer SurfaceInterface::confinedPointer() const +ConfinedPointerV1Interface *SurfaceInterface::confinedPointer() const { - Q_D(); return d->confinedPointer; } bool SurfaceInterface::inhibitsIdle() const { - Q_D(); return !d->idleInhibitors.isEmpty(); } -void SurfaceInterface::setDataProxy(SurfaceInterface *surface) +LinuxDmaBufV1Feedback *SurfaceInterface::dmabufFeedbackV1() const +{ + return d->dmabufFeedbackV1.data(); +} + +QPointF SurfaceInterface::mapToBuffer(const QPointF &point) const +{ + return d->surfaceToBufferMatrix.map(point); +} + +QPointF SurfaceInterface::mapFromBuffer(const QPointF &point) const { - Q_D(); - d->dataProxy = surface; + return d->bufferToSurfaceMatrix.map(point); } -SurfaceInterface* SurfaceInterface::dataProxy() const +static QRegion map_helper(const QMatrix4x4 &matrix, const QRegion ®ion) { - Q_D(); - return d->dataProxy; + QRegion result; + for (const QRect &rect : region) { + result += matrix.mapRect(rect); + } + return result; } -SurfaceInterface::Private *SurfaceInterface::d_func() const +QRegion SurfaceInterface::mapToBuffer(const QRegion ®ion) const { - return reinterpret_cast(d.data()); + return map_helper(d->surfaceToBufferMatrix, region); } +QRegion SurfaceInterface::mapFromBuffer(const QRegion ®ion) const +{ + return map_helper(d->bufferToSurfaceMatrix, region); } + +QMatrix4x4 SurfaceInterface::surfaceToBufferMatrix() const +{ + return d->surfaceToBufferMatrix; } + +QPointF SurfaceInterface::mapToChild(SurfaceInterface *child, const QPointF &point) const +{ + QPointF local = point; + SurfaceInterface *surface = child; + + while (true) { + if (surface == this) { + return local; + } + + SubSurfaceInterface *subsurface = surface->subSurface(); + if (Q_UNLIKELY(!subsurface)) { + return QPointF(); + } + + local -= subsurface->position(); + surface = subsurface->parentSurface(); + } + + return QPointF(); +} + +QSize SurfaceInterface::bufferSize() const +{ + return d->bufferSize; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/surface_interface.h dwayland-5.57.0.24+really5.24.3/src/server/surface_interface.h --- dwayland-5.57.0.23/src/server/surface_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/surface_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,52 +1,33 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SURFACE_INTERFACE_H -#define WAYLAND_SERVER_SURFACE_INTERFACE_H - -#include "resource.h" #include "output_interface.h" +#include #include #include #include -#include +#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { -class BlurManagerInterface; class BlurInterface; -class BufferInterface; -class ConfinedPointerInterface; +class ClientBuffer; +class ConfinedPointerV1Interface; class ContrastInterface; -class ContrastManagerInterface; class CompositorInterface; -class IdleInhibitManagerUnstableV1Interface; -class LockedPointerInterface; -class PointerConstraintsUnstableV1Interface; -class ShadowManagerInterface; +class LockedPointerV1Interface; class ShadowInterface; class SlideInterface; class SubSurfaceInterface; +class SurfaceInterfacePrivate; +class LinuxDmaBufV1Feedback; /** * @brief Resource representing a wl_surface. @@ -60,144 +41,208 @@ * This should make interacting from the server easier, it only needs to monitor the SurfaceInterface * and does not need to track each specific interface. * - * The SurfaceInterface takes care of reference/unreferencing the BufferInterface attached to it. - * As long as a BufferInterface is attached, the released signal won't be sent. If the BufferInterface + * The SurfaceInterface takes care of reference/unreferencing the ClientBuffer attached to it. + * As long as a ClientBuffer is attached, the released signal won't be sent. If the ClientBuffer * is no longer needed by the SurfaceInterface, it will get unreferenced and might be automatically * deleted (if it's no longer referenced). * * @see CompositorInterface - * @see BufferInterface + * @see ClientBuffer * @see SubSurfaceInterface * @see BlurInterface * @see ContrastInterface * @see ShadowInterface * @see SlideInterface - **/ -class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource + * @see LinuxDmaBufV1Feedback + */ +class KWAYLANDSERVER_EXPORT SurfaceInterface : public QObject { Q_OBJECT /** * The current damage region. - **/ + */ Q_PROPERTY(QRegion damage READ damage NOTIFY damaged) /** * The opaque region for a translucent buffer. - **/ + */ Q_PROPERTY(QRegion opaque READ opaque NOTIFY opaqueChanged) /** * The current input region. - **/ + */ Q_PROPERTY(QRegion input READ input NOTIFY inputChanged) - Q_PROPERTY(qint32 scale READ scale NOTIFY scaleChanged) - Q_PROPERTY(KWayland::Server::OutputInterface::Transform transform READ transform NOTIFY transformChanged) + Q_PROPERTY(qint32 bufferScale READ bufferScale NOTIFY bufferScaleChanged) + Q_PROPERTY(KWaylandServer::OutputInterface::Transform bufferTransform READ bufferTransform NOTIFY bufferTransformChanged) Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) public: - virtual ~SurfaceInterface(); + explicit SurfaceInterface(CompositorInterface *compositor, wl_resource *resource); + ~SurfaceInterface() override; + + /** + * Returns the object id for this Wayland surface. + */ + uint32_t id() const; + /** + * Returns the Wayland client that owns this SurfaceInterface. + */ + ClientConnection *client() const; + /** + * Returns the Wayland resource corresponding to this SurfaceInterface. + */ + wl_resource *resource() const; + /** + * Returns the compositor for this SurfaceInterface. + */ + CompositorInterface *compositor() const; + + /** + * Maps the specified @a point from the surface-local coordinates to buffer pixel coordinates. + * + * Note that there is no direct connection between points in the surface-local coordinates + * and points in the buffer pixel coordinates. In order to map points between the two spaces, + * one has to use mapToBuffer() and mapFromBuffer(). + * + * The returned value will become invalid when the surfaceToBufferMatrixChanged() signal is emitted. + * + * @see surfaceToBufferMatrix(), surfaceToBufferMatrixChanged() + */ + QPointF mapToBuffer(const QPointF &point) const; + /** + * Maps the specified @a point from the buffer pixel coordinates to surface-local coordinates. + * + * Note that there is no direct connection between points in the surface-local coordinates + * and points in the buffer pixel coordinates. In order to map points between the two spaces, + * one has to use mapToBuffer() and mapFromBuffer(). + * + * The returned value will become invalid when the surfaceToBufferMatrixChanged() signal is emitted. + * + * @see surfaceToBufferMatrix(), surfaceToBufferMatrixChanged() + */ + QPointF mapFromBuffer(const QPointF &point) const; + /** + * Maps the specified @a region from the surface-local coordinates to buffer pixel coordinates. + * + * Note that there is no direct connection between regions in the surface-local coordinates + * and regions in the buffer pixel coordinates. In order to map regions between the two spaces, + * one has to use mapToBuffer() and mapFromBuffer(). + * + * The returned value will become invalid when the surfaceToBufferMatrixChanged() signal is emitted. + * + * @see surfaceToBufferMatrix(), surfaceToBufferMatrixChanged() + */ + QRegion mapToBuffer(const QRegion ®ion) const; + /** + * Maps the specified @a region from the buffer pixel coordinates to surface-local coordinates. + * + * Note that there is no direct connection between regions in the surface-local coordinates + * and regions in the buffer pixel coordinates. In order to map regions between the two spaces, + * one has to use mapToBuffer() and mapFromBuffer(). + * + * The returned value will become invalid when the surfaceToBufferMatrixChanged() signal is emitted. + * + * @see surfaceToBufferMatrix(), surfaceToBufferMatrixChanged() + */ + QRegion mapFromBuffer(const QRegion ®ion) const; + /** + * Returns the projection matrix from the surface-local coordinates to buffer coordinates. + * + * @see surfaceToBufferMatrixChanged() + */ + QMatrix4x4 surfaceToBufferMatrix() const; + + /** + * Maps the specified @a point in this surface's coordinate system to the equivalent point + * within the @a child's coordinate system, and returns the mapped point. + * + * If this surface is not an ancestor of the @a child, a null point is returned. + */ + QPointF mapToChild(SurfaceInterface *child, const QPointF &point) const; void frameRendered(quint32 msec); + bool hasFrameCallbacks() const; QRegion damage() const; QRegion opaque() const; QRegion input() const; + qint32 bufferScale() const; + /** + * Returns the buffer transform that had been applied to the buffer to compensate for + * output rotation. + * + * If the surface is on an output that is rotated 90 degrees clockwise, the buffer will + * be rotated 90 degrees counter clockwise. + */ + OutputInterface::Transform bufferTransform() const; /** - * Use Surface::inputIsInfinite instead. - * @deprecated - * @see inputIsInfinite - */ - bool inputIsInfitine() const; - /** - * Replaces Surface::inputIsInfitine instead. - * @since 5.5 - */ - bool inputIsInfinite() const; - qint32 scale() const; - OutputInterface::Transform transform() const; - /** - * @returns the current BufferInterface, might be @c nullptr. - **/ - BufferInterface *buffer(); + * @returns the current ClientBuffer, might be @c nullptr. + */ + ClientBuffer *buffer() const; QPoint offset() const; /** - * The size of the Surface in global compositor space. - * @see For buffer size use BufferInterface::size - * from SurfaceInterface::buffer - * @since 5.3 - **/ + * Returns the current size of the surface, in surface coordinates. + * + * Note that there is no direct relationship between the surface size and the buffer size. + * In order to determine the size of the currently attached buffer, use buffer()->size(). + */ QSize size() const; + /** + * Returns the rectangle that bounds this surface and all of its sub-surfaces. + * + * QPoint(0, 0) corresponds to the upper left corner of this surface. + */ + QRect boundingRect() const; + /** + * Returns the size of the attached buffer, in device pixels. + * + * If no buffer is attached to this surface, an invalid QSize will be returned. + */ + QSize bufferSize() const; /** * @returns The SubSurface for this Surface in case there is one. - **/ - QPointer subSurface() const; + */ + SubSurfaceInterface *subSurface() const; + /** + * Returns the sub-surfaces that are below this surface. The sub-surfaces are sorted + * from bottom to top. + */ + QList below() const; /** - * @returns Children in stacking order from bottom (first) to top (last). - **/ - QList> childSubSurfaces() const; + * Returns the sub-surfaces that are above this surface. The sub-surfaces are sorted + * from bottom to top. + */ + QList above() const; /** * @returns The Shadow for this Surface. - * @since 5.4 - **/ + */ QPointer shadow() const; /** * @returns The Blur for this Surface. - * @since 5.5 - **/ + */ QPointer blur() const; /** * @returns The Slide for this Surface. - * @since 5.5 - **/ + */ QPointer slideOnShowHide() const; /** * @returns The Contrast for this Surface. - * @since 5.5 - **/ + */ QPointer contrast() const; /** * Whether the SurfaceInterface is currently considered to be mapped. - * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. + * A SurfaceInterface is mapped if it has a non-null ClientBuffer attached. * If the SurfaceInterface references a SubSurfaceInterface it is only considered - * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. + * mapped if it has a ClientBuffer attached and the parent SurfaceInterface is mapped. * * @returns Whether the SurfaceInterface is currently mapped - * @since 5.22 - **/ + */ bool isMapped() const; /** - * Returns the tracked damage since the last call to {@link resetTrackedDamage}. - * In contrast to {@link damage} this method does not reset the damage when - * a new BufferInterface gets committed. This allows a compositor to properly - * track the damage over multiple commits even if it didn't render each new - * BufferInterface. - * - * The damage gets reset whenever {@link resetTrackedDamage} is called. - * This allows a compositor to properly track the change in its rendering scene - * for this SurfaceInterface. After it updates its internal state (e.g. by creating - * an OpenGL texture from the BufferInterface) it can invoke {@link resetTrackedDamage} - * and the damage tracker will start to track further damage changes. - * - * @returns Combined damage since last call to resetTrackedDamage - * @see damage - * @see resetTrackedDamage - * @since 5.22 - **/ - QRegion trackedDamage() const; - - /** - * Reset the damage tracking. The compositor should invoke this method once it updated - * it's internal state and processed the current damage. - * @see trackedDamage - * @since 5.22 - **/ - void resetTrackedDamage(); - - /** * Finds the SurfaceInterface at the given @p position in surface-local coordinates. * This can be either a descendant SurfaceInterface honoring the stacking order or * the SurfaceInterface itself if its geometry contains the given @p position. @@ -207,8 +252,7 @@ * * @param position The position in surface-local coordinates * @returns Child surface at the given @p position or surface itself at the position, might be @c nullptr - * @since 5.22 - **/ + */ SurfaceInterface *surfaceAt(const QPointF &position); /** @@ -222,8 +266,7 @@ * * @param position The position in surface-local coordinates * @returns Input receiving child surface at the given @p position or surface itself at the position, might be @c nullptr - * @since 5.52 - **/ + */ SurfaceInterface *inputSurfaceAt(const QPointF &position); /** @@ -233,111 +276,117 @@ * an OutputInterface by e.g. getting (un)mapped, resized, moved, etc. * * @see outputs - * @since 5.27 - **/ + */ void setOutputs(const QVector &outputs); /** * @returns All OutputInterfaces the SurfaceInterface is on. * @see setOutputs - * @since 5.27 - **/ + */ QVector outputs() const; /** * Pointer confinement installed on this SurfaceInterface. * @see pointerConstraintsChanged - * @since 5.29 - **/ - QPointer confinedPointer() const; + */ + ConfinedPointerV1Interface *confinedPointer() const; /** * Pointer lock installed on this SurfaceInterface. * @see pointerConstraintsChanged - * @since 5.29 - **/ - QPointer lockedPointer() const; + */ + LockedPointerV1Interface *lockedPointer() const; /** * @returns Whether this SurfaceInterface wants idle to be inhibited on the Output it is shown * @see inhibitsIdleChanged - * @since 5.41 - **/ + */ bool inhibitsIdle() const; /** + * dmabuf feedback installed on this SurfaceInterface + */ + LinuxDmaBufV1Feedback *dmabufFeedbackV1() const; + + /** * @returns The SurfaceInterface for the @p native resource. - **/ + */ static SurfaceInterface *get(wl_resource *native); /** * @returns The SurfaceInterface with given @p id for @p client, if it exists, otherwise @c nullptr. - * @since 5.3 - **/ + */ static SurfaceInterface *get(quint32 id, const ClientConnection *client); +Q_SIGNALS: /** - * Set @p surface as a data proxy for this SurfaceInterface. This enables - * the proxy to conduct drags on the surface's client behalf. + * This signal is emitted when the underlying wl_surface resource is about to be freed. * - * Setting a data proxy is only allowed when the client owning this surface - * has not created a data device itself. - * @since 5.56 - **/ - void setDataProxy(SurfaceInterface *surface); - /** - * Returns the data proxy of this SurfaceInterface or null if there - * is none set. - * @since 5.56 - **/ - SurfaceInterface* dataProxy() const; - -Q_SIGNALS: + * The unbound() signal is emitted either when the client that owns the surface has been + * destroyed or if the surface has been destroyed due to a destructor request. + * + * The SurfaceInterface object and the associated wl_surface resource are valid when this + * signal is emitted. + */ + void aboutToBeDestroyed(); + /** + * This signal is emitted when the projection matrix from the surface-local coordinate space + * to the buffer coordinate space has been changed. + * + * Note that the compositor will most likely need to re-compute the texture coordinates after + * the surface-to-buffer matrix has been changed. + */ + void surfaceToBufferMatrixChanged(); /** * Emitted whenever the SurfaceInterface got damaged. * The signal is only emitted during the commit of state. - * A damage means that a new BufferInterface got attached. + * A damage means that a new ClientBuffer got attached. * * @see buffer * @see damage - **/ - void damaged(const QRegion&); - void opaqueChanged(const QRegion&); - void inputChanged(const QRegion&); - void scaleChanged(qint32); - void transformChanged(KWayland::Server::OutputInterface::Transform); + */ + void damaged(const QRegion &); + void opaqueChanged(const QRegion &); + void inputChanged(const QRegion &); + /** + * This signal is emitted when the scale of the attached buffer has changed. + */ + void bufferScaleChanged(qint32); + /** + * This signal is emitted when the buffer transform has changed. + */ + void bufferTransformChanged(KWaylandServer::OutputInterface::Transform); + /** + * This signal is emitted when the size of the attached buffer has changed. + */ + void bufferSizeChanged(); + /** + * Emitted when the Surface becomes visible, i.e. a non-null buffer has been attached. + */ + void mapped(); /** * Emitted when the Surface removes its content - **/ + */ void unmapped(); /** - * @since 5.3 - **/ + * This signal is emitted when the surface size has changed. + */ void sizeChanged(); - /** - * @since 5.3 - **/ - void dragPositionChanged(const QPointF &globalPos); - /** - * @since 5.4 - **/ void shadowChanged(); - /** - * @since 5.5 - **/ void blurChanged(); - /** - * @since 5.5 - **/ void slideOnShowHideChanged(); - /** - * @since 5.5 - **/ void contrastChanged(); /** - * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. - * @since 5.22 - **/ - void subSurfaceTreeChanged(); + * Emitted whenever a new child sub-surface @p subSurface is added. + */ + void childSubSurfaceAdded(SubSurfaceInterface *subSurface); + /** + * Emitted whenver the child sub-surface @p subSurface is removed. + */ + void childSubSurfaceRemoved(SubSurfaceInterface *subSurface); + /** + * This signal is emitted when the list of child subsurfaces changes. + */ + void childSubSurfacesChanged(); /** * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. @@ -347,35 +396,28 @@ * * @see confinedPointer * @see lockedPointer - * @since 5.29 - **/ + */ void pointerConstraintsChanged(); /** * Emitted whenever the SurfaceInterface starts/ends to inhibit idle. * @see inhibitsIdle - * @since 5.41 - **/ + */ void inhibitsIdleChanged(); -private: - friend class CompositorInterface; - friend class SubSurfaceInterface; - friend class ShadowManagerInterface; - friend class BlurManagerInterface; - friend class SlideManagerInterface; - friend class ContrastManagerInterface; - friend class IdleInhibitManagerUnstableV1Interface; - friend class PointerConstraintsUnstableV1Interface; - explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); + /** + * Emitted when the Surface has been committed. + * + * This signal is emitted after all the relevant damage and xyzChanged signals + * for this commit are emitted. + */ + void committed(); - class Private; - Private *d_func() const; +private: + QScopedPointer d; + friend class SurfaceInterfacePrivate; }; } -} - -Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) -#endif +Q_DECLARE_METATYPE(KWaylandServer::SurfaceInterface *) diff -Nru dwayland-5.57.0.23/src/server/surface_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/surface_interface_p.h --- dwayland-5.57.0.23/src/server/surface_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/surface_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,144 +1,144 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_SURFACE_INTERFACE_P_H -#define WAYLAND_SERVER_SURFACE_INTERFACE_P_H +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include "surface_interface.h" -#include "resource_p.h" +#include "utils.h" // Qt +#include #include // Wayland -#include +#include "qwayland-server-wayland.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class IdleInhibitorV1Interface; +class SurfaceRole; +class ViewportInterface; + +struct SurfaceState { + void mergeInto(SurfaceState *target); + + QRegion damage = QRegion(); + QRegion bufferDamage = QRegion(); + QRegion opaque = QRegion(); + QRegion input = infiniteRegion(); + bool inputIsSet = false; + bool opaqueIsSet = false; + bool bufferIsSet = false; + bool shadowIsSet = false; + bool blurIsSet = false; + bool contrastIsSet = false; + bool slideIsSet = false; + bool childrenChanged = false; + bool bufferScaleIsSet = false; + bool bufferTransformIsSet = false; + qint32 bufferScale = 1; + OutputInterface::Transform bufferTransform = OutputInterface::Transform::Normal; + wl_list frameCallbacks; + QPoint offset = QPoint(); + QPointer buffer; + QPointer shadow; + QPointer blur; + QPointer contrast; + QPointer slide; + + // Subsurfaces are stored in two lists. The below list contains subsurfaces that + // are below their parent surface; the above list contains subsurfaces that are + // placed above the parent surface. + QList below; + QList above; + + struct { + QRectF sourceGeometry = QRectF(); + QSize destinationSize = QSize(); + bool sourceGeometryIsSet = false; + bool destinationSizeIsSet = false; + } viewport; +}; -class IdleInhibitorInterface; - -class SurfaceInterface::Private : public Resource::Private +class SurfaceInterfacePrivate : public QtWaylandServer::wl_surface { public: - struct State { - QRegion damage = QRegion(); - QRegion opaque = QRegion(); - QRegion input = QRegion(); - bool inputIsSet = false; - bool opaqueIsSet = false; - bool offsetIsSet = false; - bool bufferIsSet = false; - bool shadowIsSet = false; - bool blurIsSet = false; - bool contrastIsSet = false; - bool slideIsSet = false; - bool inputIsInfinite = true; - bool childrenChanged = false; - bool scaleIsSet = false; - bool transformIsSet = false; - qint32 scale = 1; - OutputInterface::Transform transform = OutputInterface::Transform::Normal; - QList callbacks = QList(); - QPoint offset = QPoint(); - BufferInterface *buffer = nullptr; - // stacking order: bottom (first) -> top (last) - QList> children; - QPointer shadow; - QPointer blur; - QPointer contrast; - QPointer slide; - }; - Private(SurfaceInterface *q, CompositorInterface *c, wl_resource *parentResource); - ~Private(); - - void destroy(); - - void addChild(QPointer subsurface); - void removeChild(QPointer subsurface); - bool raiseChild(QPointer subsurface, SurfaceInterface *sibling); - bool lowerChild(QPointer subsurface, SurfaceInterface *sibling); + static SurfaceInterfacePrivate *get(SurfaceInterface *surface) + { + return surface->d.data(); + } + + explicit SurfaceInterfacePrivate(SurfaceInterface *q); + ~SurfaceInterfacePrivate() override; + + void addChild(SubSurfaceInterface *subsurface); + void removeChild(SubSurfaceInterface *subsurface); + bool raiseChild(SubSurfaceInterface *subsurface, SurfaceInterface *anchor); + bool lowerChild(SubSurfaceInterface *subsurface, SurfaceInterface *anchor); void setShadow(const QPointer &shadow); void setBlur(const QPointer &blur); void setContrast(const QPointer &contrast); void setSlide(const QPointer &slide); - void installPointerConstraint(LockedPointerInterface *lock); - void installPointerConstraint(ConfinedPointerInterface *confinement); - void installIdleInhibitor(IdleInhibitorInterface *inhibitor); + void installPointerConstraint(LockedPointerV1Interface *lock); + void installPointerConstraint(ConfinedPointerV1Interface *confinement); + void installIdleInhibitor(IdleInhibitorV1Interface *inhibitor); + + void commitToCache(); + void commitFromCache(); void commitSubSurface(); - void commit(); + QMatrix4x4 buildSurfaceToBufferMatrix(); + void applyState(SurfaceState *next); - State current; - State pending; - State subSurfacePending; - QPointer subSurface; - QRegion trackedDamage; - - // workaround for https://bugreports.qt.io/browse/QTBUG-52192 - // A subsurface needs to be considered mapped even if it doesn't have a buffer attached - // Otherwise Qt's sub-surfaces will never be visible and the client will freeze due to - // waiting on the frame callback of the never visible surface - bool subSurfaceIsMapped = true; + bool computeEffectiveMapped() const; + void updateEffectiveMapped(); - QVector outputs; + CompositorInterface *compositor; + SurfaceInterface *q; + SurfaceRole *role = nullptr; + SurfaceState current; + SurfaceState pending; + SurfaceState cached; + SubSurfaceInterface *subSurface = nullptr; + QMatrix4x4 surfaceToBufferMatrix; + QMatrix4x4 bufferToSurfaceMatrix; + QSize bufferSize; + QSize implicitSurfaceSize; + QSize surfaceSize; + QRegion inputRegion; + ClientBuffer *bufferRef = nullptr; + bool mapped = false; + bool hasCacheState = false; - QPointer lockedPointer; - QPointer confinedPointer; - QHash outputDestroyedConnections; - QVector idleInhibitors; + QVector outputs; - SurfaceInterface *dataProxy = nullptr; + LockedPointerV1Interface *lockedPointer = nullptr; + ConfinedPointerV1Interface *confinedPointer = nullptr; + QHash outputDestroyedConnections; + QHash outputBoundConnections; + + QVector idleInhibitors; + ViewportInterface *viewportExtension = nullptr; + QScopedPointer dmabufFeedbackV1; + ClientConnection *client = nullptr; + +protected: + void surface_destroy_resource(Resource *resource) override; + void surface_destroy(Resource *resource) override; + void surface_attach(Resource *resource, struct ::wl_resource *buffer, int32_t x, int32_t y) override; + void surface_damage(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void surface_frame(Resource *resource, uint32_t callback) override; + void surface_set_opaque_region(Resource *resource, struct ::wl_resource *region) override; + void surface_set_input_region(Resource *resource, struct ::wl_resource *region) override; + void surface_commit(Resource *resource) override; + void surface_set_buffer_transform(Resource *resource, int32_t transform) override; + void surface_set_buffer_scale(Resource *resource, int32_t scale) override; + void surface_damage_buffer(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; private: QMetaObject::Connection constrainsOneShotConnection; QMetaObject::Connection constrainsUnboundConnection; - - SurfaceInterface *q_func() { - return reinterpret_cast(q); - } - void swapStates(State *source, State *target, bool emitChanged); - void damage(const QRect &rect); - void setScale(qint32 scale); - void setTransform(OutputInterface::Transform transform); - void addFrameCallback(uint32_t callback); - void attachBuffer(wl_resource *buffer, const QPoint &offset); - void setOpaque(const QRegion ®ion); - void setInput(const QRegion ®ion, bool isInfinite); - - static void destroyFrameCallback(wl_resource *r); - - static void attachCallback(wl_client *client, wl_resource *resource, wl_resource *buffer, int32_t sx, int32_t sy); - static void damageCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static void frameCallback(wl_client *client, wl_resource *resource, uint32_t callback); - static void opaqueRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region); - static void inputRegionCallback(wl_client *client, wl_resource *resource, wl_resource *region); - static void commitCallback(wl_client *client, wl_resource *resource); - // since version 2 - static void bufferTransformCallback(wl_client *client, wl_resource *resource, int32_t transform); - // since version 3 - static void bufferScaleCallback(wl_client *client, wl_resource *resource, int32_t scale); - - static const struct wl_surface_interface s_interface; }; -} -} - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/surfacerole.cpp dwayland-5.57.0.24+really5.24.3/src/server/surfacerole.cpp --- dwayland-5.57.0.23/src/server/surfacerole.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/surfacerole.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,45 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "surface_interface.h" +#include "surface_interface_p.h" +#include "surfacerole_p.h" + +namespace KWaylandServer +{ +SurfaceRole::SurfaceRole(SurfaceInterface *surface, const QByteArray &name) + : m_surface(surface) + , m_name(name) +{ + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->role = this; +} + +SurfaceRole::~SurfaceRole() +{ + // Lifetime of the surface role is not bounded to the associated surface. + if (m_surface) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(m_surface); + surfacePrivate->role = nullptr; + } +} + +QByteArray SurfaceRole::name() const +{ + return m_name; +} + +SurfaceRole *SurfaceRole::get(SurfaceInterface *surface) +{ + if (surface) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + return surfacePrivate->role; + } + + return nullptr; +} + +} diff -Nru dwayland-5.57.0.23/src/server/surfacerole_p.h dwayland-5.57.0.24+really5.24.3/src/server/surfacerole_p.h --- dwayland-5.57.0.23/src/server/surfacerole_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/surfacerole_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,38 @@ +/* + SPDX-FileCopyrightText: 2019 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include +#include + +namespace KWaylandServer +{ +class SurfaceInterface; + +class SurfaceRole +{ +public: + SurfaceRole(SurfaceInterface *surface, const QByteArray &name); + virtual ~SurfaceRole(); + + QByteArray name() const; + const QPointer &surface() const + { + return m_surface; + } + + virtual void commit() = 0; + + static SurfaceRole *get(SurfaceInterface *surface); + +private: + QPointer m_surface; + QByteArray m_name; + + Q_DISABLE_COPY(SurfaceRole) +}; + +} diff -Nru dwayland-5.57.0.23/src/server/tablet_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/tablet_v2_interface.cpp --- dwayland-5.57.0.23/src/server/tablet_v2_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/tablet_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,850 @@ +/* + SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "tablet_v2_interface.h" +#include "display.h" +#include "seat_interface.h" +#include "surface_interface.h" + +#include "qwayland-server-tablet-unstable-v2.h" +#include + +namespace KWaylandServer +{ +static int s_version = 1; + +class TabletV2InterfacePrivate : public QtWaylandServer::zwp_tablet_v2 +{ +public: + TabletV2InterfacePrivate(TabletV2Interface *q, uint32_t vendorId, uint32_t productId, const QString &name, const QStringList &paths) + : zwp_tablet_v2() + , q(q) + , m_vendorId(vendorId) + , m_productId(productId) + , m_name(name) + , m_paths(paths) + { + } + + wl_resource *resourceForSurface(SurfaceInterface *surface) const + { + ClientConnection *client = surface->client(); + Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + TabletV2Interface *const q; + TabletPadV2Interface *m_pad = nullptr; + const uint32_t m_vendorId; + const uint32_t m_productId; + const QString m_name; + const QStringList m_paths; +}; + +TabletV2Interface::TabletV2Interface(uint32_t vendorId, uint32_t productId, const QString &name, const QStringList &paths, QObject *parent) + : QObject(parent) + , d(new TabletV2InterfacePrivate(this, vendorId, productId, name, paths)) +{ +} + +TabletV2Interface::~TabletV2Interface() +{ + const auto tabletResources = d->resourceMap(); + for (TabletV2InterfacePrivate::Resource *resource : tabletResources) { + d->send_removed(resource->handle); + } +} + +bool TabletV2Interface::isSurfaceSupported(SurfaceInterface *surface) const +{ + return d->resourceForSurface(surface); +} + +TabletPadV2Interface *TabletV2Interface::pad() const +{ + return d->m_pad; +} + +class TabletCursorV2Private +{ +public: + TabletCursorV2Private(TabletCursorV2 *q) + : q(q) + { + } + + void update(quint32 serial, SurfaceInterface *surface, const QPoint &hotspot) + { + const bool diff = m_serial != serial || m_surface != surface || m_hotspot != hotspot; + if (diff) { + m_serial = serial; + m_surface = surface; + m_hotspot = hotspot; + + Q_EMIT q->changed(); + } + } + + TabletCursorV2 *const q; + + quint32 m_serial = 0; + QPointer m_surface; + QPoint m_hotspot; +}; + +TabletCursorV2::TabletCursorV2() + : QObject() + , d(new TabletCursorV2Private(this)) +{ +} + +TabletCursorV2::~TabletCursorV2() = default; + +QPoint TabletCursorV2::hotspot() const +{ + return d->m_hotspot; +} + +quint32 TabletCursorV2::enteredSerial() const +{ + return d->m_serial; +} + +SurfaceInterface *TabletCursorV2::surface() const +{ + return d->m_surface; +} + +class TabletToolV2InterfacePrivate : public QtWaylandServer::zwp_tablet_tool_v2 +{ +public: + TabletToolV2InterfacePrivate(TabletToolV2Interface *q, + Display *display, + TabletToolV2Interface::Type type, + uint32_t hsh, + uint32_t hsl, + uint32_t hih, + uint32_t hil, + const QVector &capabilities) + : zwp_tablet_tool_v2() + , m_display(display) + , m_type(type) + , m_hardwareSerialHigh(hsh) + , m_hardwareSerialLow(hsl) + , m_hardwareIdHigh(hih) + , m_hardwareIdLow(hil) + , m_capabilities(capabilities) + , q(q) + { + } + + wl_resource *targetResource() + { + if (!m_surface) + return nullptr; + + ClientConnection *client = m_surface->client(); + const Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + quint64 hardwareId() const + { + return quint64(quint64(m_hardwareIdHigh) << 32) + m_hardwareIdLow; + } + quint64 hardwareSerial() const + { + return quint64(quint64(m_hardwareSerialHigh) << 32) + m_hardwareSerialLow; + } + + void zwp_tablet_tool_v2_bind_resource(QtWaylandServer::zwp_tablet_tool_v2::Resource *resource) override + { + TabletCursorV2 *&c = m_cursors[resource->handle]; + if (!c) + c = new TabletCursorV2; + } + + void zwp_tablet_tool_v2_set_cursor(Resource *resource, uint32_t serial, struct ::wl_resource *_surface, int32_t hotspot_x, int32_t hotspot_y) override + { + TabletCursorV2 *c = m_cursors[resource->handle]; + c->d->update(serial, SurfaceInterface::get(_surface), {hotspot_x, hotspot_y}); + if (resource->handle == targetResource()) + q->cursorChanged(c); + } + + void zwp_tablet_tool_v2_destroy_resource(Resource *resource) override + { + delete m_cursors.take(resource->handle); + if (m_removed && resourceMap().isEmpty()) { + delete q; + } + } + + void zwp_tablet_tool_v2_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + + Display *const m_display; + bool m_cleanup = false; + bool m_removed = false; + QPointer m_surface; + QPointer m_lastTablet; + const uint32_t m_type; + const uint32_t m_hardwareSerialHigh, m_hardwareSerialLow; + const uint32_t m_hardwareIdHigh, m_hardwareIdLow; + const QVector m_capabilities; + QHash m_cursors; + TabletToolV2Interface *const q; +}; + +TabletToolV2Interface::TabletToolV2Interface(Display *display, + Type type, + uint32_t hsh, + uint32_t hsl, + uint32_t hih, + uint32_t hil, + const QVector &capabilities, + QObject *parent) + : QObject(parent) + , d(new TabletToolV2InterfacePrivate(this, display, type, hsh, hsl, hih, hil, capabilities)) +{ +} + +TabletToolV2Interface::~TabletToolV2Interface() +{ + const auto toolResources = d->resourceMap(); + for (TabletToolV2InterfacePrivate::Resource *resource : toolResources) { + d->send_removed(resource->handle); + } +} + +void TabletToolV2Interface::setCurrentSurface(SurfaceInterface *surface) +{ + if (d->m_surface == surface) + return; + + TabletV2Interface *const lastTablet = d->m_lastTablet; + if (d->m_surface && d->resourceMap().contains(*d->m_surface->client())) { + sendProximityOut(); + sendFrame(0); + } + + d->m_surface = surface; + + if (lastTablet && lastTablet->d->resourceForSurface(surface)) { + sendProximityIn(lastTablet); + } else { + d->m_lastTablet = lastTablet; + } + + Q_EMIT cursorChanged(d->m_cursors.value(d->targetResource())); +} + +bool TabletToolV2Interface::isClientSupported() const +{ + return d->m_surface && d->targetResource(); +} + +void TabletToolV2Interface::sendButton(uint32_t button, bool pressed) +{ + d->send_button(d->targetResource(), + d->m_display->nextSerial(), + button, + pressed ? QtWaylandServer::zwp_tablet_tool_v2::button_state_pressed : QtWaylandServer::zwp_tablet_tool_v2::button_state_released); +} + +void TabletToolV2Interface::sendMotion(const QPointF &pos) +{ + d->send_motion(d->targetResource(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +} + +void TabletToolV2Interface::sendDistance(uint32_t distance) +{ + d->send_distance(d->targetResource(), distance); +} + +void TabletToolV2Interface::sendFrame(uint32_t time) +{ + d->send_frame(d->targetResource(), time); + + if (d->m_cleanup) { + d->m_surface = nullptr; + d->m_lastTablet = nullptr; + d->m_cleanup = false; + } +} + +void TabletToolV2Interface::sendPressure(uint32_t pressure) +{ + d->send_pressure(d->targetResource(), pressure); +} + +void TabletToolV2Interface::sendRotation(qreal rotation) +{ + d->send_rotation(d->targetResource(), wl_fixed_from_double(rotation)); +} + +void TabletToolV2Interface::sendSlider(int32_t position) +{ + d->send_slider(d->targetResource(), position); +} + +void TabletToolV2Interface::sendTilt(qreal degreesX, qreal degreesY) +{ + d->send_tilt(d->targetResource(), wl_fixed_from_double(degreesX), wl_fixed_from_double(degreesY)); +} + +void TabletToolV2Interface::sendWheel(int32_t degrees, int32_t clicks) +{ + d->send_wheel(d->targetResource(), degrees, clicks); +} + +void TabletToolV2Interface::sendProximityIn(TabletV2Interface *tablet) +{ + wl_resource *tabletResource = tablet->d->resourceForSurface(d->m_surface); + d->send_proximity_in(d->targetResource(), d->m_display->nextSerial(), tabletResource, d->m_surface->resource()); + d->m_lastTablet = tablet; +} + +void TabletToolV2Interface::sendProximityOut() +{ + d->send_proximity_out(d->targetResource()); + d->m_cleanup = true; +} + +void TabletToolV2Interface::sendDown() +{ + d->send_down(d->targetResource(), d->m_display->nextSerial()); +} + +void TabletToolV2Interface::sendUp() +{ + d->send_up(d->targetResource()); +} + +class TabletPadRingV2InterfacePrivate : public QtWaylandServer::zwp_tablet_pad_ring_v2 +{ +public: + TabletPadRingV2InterfacePrivate(TabletPadRingV2Interface *q) + : zwp_tablet_pad_ring_v2() + , q(q) + { + } + + wl_resource *resourceForSurface(SurfaceInterface *surface) const + { + ClientConnection *client = surface->client(); + Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + void zwp_tablet_pad_ring_v2_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + TabletPadRingV2Interface *const q; + TabletPadV2Interface *m_pad; +}; + +TabletPadRingV2Interface::TabletPadRingV2Interface(TabletPadV2Interface *parent) + : QObject(parent) + , d(new TabletPadRingV2InterfacePrivate(this)) +{ + d->m_pad = parent; +} + +TabletPadRingV2Interface::~TabletPadRingV2Interface() = default; + +void TabletPadRingV2Interface::sendAngle(qreal angle) +{ + d->send_angle(d->resourceForSurface(d->m_pad->currentSurface()), wl_fixed_from_double(angle)); +} + +void TabletPadRingV2Interface::sendFrame(quint32 time) +{ + d->send_frame(d->resourceForSurface(d->m_pad->currentSurface()), time); +} + +void TabletPadRingV2Interface::sendSource(Source source) +{ + d->send_source(d->resourceForSurface(d->m_pad->currentSurface()), source); +} + +void TabletPadRingV2Interface::sendStop() +{ + d->send_stop(d->resourceForSurface(d->m_pad->currentSurface())); +} + +class TabletPadStripV2InterfacePrivate : public QtWaylandServer::zwp_tablet_pad_strip_v2 +{ +public: + TabletPadStripV2InterfacePrivate(TabletPadStripV2Interface *q) + : zwp_tablet_pad_strip_v2() + , q(q) + { + } + + wl_resource *resourceForSurface(SurfaceInterface *surface) const + { + ClientConnection *client = surface->client(); + Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + void zwp_tablet_pad_strip_v2_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + TabletPadV2Interface *m_pad = nullptr; + TabletPadStripV2Interface *const q; +}; + +TabletPadStripV2Interface::TabletPadStripV2Interface(TabletPadV2Interface *parent) + : QObject(parent) + , d(new TabletPadStripV2InterfacePrivate(this)) +{ + d->m_pad = parent; +} + +TabletPadStripV2Interface::~TabletPadStripV2Interface() = default; + +void TabletPadStripV2Interface::sendFrame(quint32 time) +{ + d->send_frame(d->resourceForSurface(d->m_pad->currentSurface()), time); +} + +void TabletPadStripV2Interface::sendPosition(quint32 position) +{ + d->send_position(d->resourceForSurface(d->m_pad->currentSurface()), position); +} + +void TabletPadStripV2Interface::sendSource(Source source) +{ + d->send_source(d->resourceForSurface(d->m_pad->currentSurface()), source); +} + +void TabletPadStripV2Interface::sendStop() +{ + d->send_stop(d->resourceForSurface(d->m_pad->currentSurface())); +} + +class TabletPadGroupV2InterfacePrivate : public QtWaylandServer::zwp_tablet_pad_group_v2 +{ +public: + TabletPadGroupV2InterfacePrivate(quint32 currentMode, TabletPadGroupV2Interface *q) + : zwp_tablet_pad_group_v2() + , q(q) + , m_currentMode(currentMode) + { + } + + wl_resource *resourceForSurface(SurfaceInterface *surface) const + { + ClientConnection *client = surface->client(); + Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + void zwp_tablet_pad_group_v2_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + + TabletPadGroupV2Interface *const q; + TabletPadV2Interface *m_pad = nullptr; + quint32 m_currentMode; +}; + +TabletPadGroupV2Interface::TabletPadGroupV2Interface(quint32 currentMode, TabletPadV2Interface *parent) + : QObject(parent) + , d(new TabletPadGroupV2InterfacePrivate(currentMode, this)) +{ + d->m_pad = parent; +} + +TabletPadGroupV2Interface::~TabletPadGroupV2Interface() = default; + +void TabletPadGroupV2Interface::sendModeSwitch(quint32 time, quint32 serial, quint32 mode) +{ + d->m_currentMode = mode; + d->send_mode_switch(d->resourceForSurface(d->m_pad->currentSurface()), time, serial, mode); +} + +class TabletPadV2InterfacePrivate : public QtWaylandServer::zwp_tablet_pad_v2 +{ +public: + TabletPadV2InterfacePrivate(const QString &path, + quint32 buttons, + quint32 rings, + quint32 strips, + quint32 modes, + quint32 currentMode, + Display *display, + TabletPadV2Interface *q) + : zwp_tablet_pad_v2() + , q(q) + , m_path(path) + , m_buttons(buttons) + , m_modes(modes) + , m_padGroup(new TabletPadGroupV2Interface(currentMode, q)) + , m_display(display) + { + for (uint i = 0; i < buttons; ++i) { + m_buttons[i] = i; + } + + m_rings.reserve(rings); + for (quint32 i = 0; i < rings; ++i) { + m_rings += new TabletPadRingV2Interface(q); + } + + m_strips.reserve(strips); + for (quint32 i = 0; i < strips; ++i) { + m_strips += new TabletPadStripV2Interface(q); + } + } + + ~TabletPadV2InterfacePrivate() override + { + qDeleteAll(m_rings); + qDeleteAll(m_strips); + } + + void zwp_tablet_pad_v2_destroy(Resource *resource) override + { + wl_resource_destroy(resource->handle); + } + + void zwp_tablet_pad_v2_set_feedback(Resource *resource, quint32 button, const QString &description, quint32 serial) override + { + Q_EMIT q->feedback(m_display->getConnection(resource->client()), button, description, serial); + } + + wl_resource *resourceForSurface(SurfaceInterface *surface) const + { + ClientConnection *client = surface->client(); + Resource *r = resourceMap().value(*client); + return r ? r->handle : nullptr; + } + + TabletPadV2Interface *const q; + + const QString m_path; + QVector m_buttons; + const int m_modes; + + QVector m_rings; + QVector m_strips; + TabletPadGroupV2Interface *const m_padGroup; + TabletSeatV2Interface *m_seat = nullptr; + SurfaceInterface *m_currentSurface = nullptr; + Display *const m_display; +}; + +TabletPadV2Interface::TabletPadV2Interface(const QString &path, + quint32 buttons, + quint32 rings, + quint32 strips, + quint32 modes, + quint32 currentMode, + Display *display, + TabletSeatV2Interface *parent) + : QObject(parent) + , d(new TabletPadV2InterfacePrivate(path, buttons, rings, strips, modes, currentMode, display, this)) +{ + d->m_seat = parent; +} + +TabletPadV2Interface::~TabletPadV2Interface() +{ + const auto tabletPadResources = d->resourceMap(); + for (TabletPadV2InterfacePrivate::Resource *resource : tabletPadResources) { + d->send_removed(resource->handle); + } +} + +void TabletPadV2Interface::sendButton(quint32 time, quint32 button, bool pressed) +{ + d->send_button(d->resourceForSurface(currentSurface()), time, button, pressed); +} + +TabletPadRingV2Interface *TabletPadV2Interface::ring(uint at) const +{ + return d->m_rings[at]; +} + +TabletPadStripV2Interface *TabletPadV2Interface::strip(uint at) const +{ + return d->m_strips[at]; +} + +void TabletPadV2Interface::setCurrentSurface(SurfaceInterface *surface, TabletV2Interface *tablet) +{ + if (surface == d->m_currentSurface) { + return; + } + + if (d->m_currentSurface) { + d->send_leave(d->m_display->nextSerial(), surface->resource()); + } + + d->m_currentSurface = surface; + if (surface) { + wl_resource *tabletResource = tablet->d->resourceForSurface(surface); + + d->send_enter(d->resourceForSurface(surface), d->m_display->nextSerial(), tabletResource, surface->resource()); + d->m_padGroup->sendModeSwitch(0, d->m_display->nextSerial(), d->m_padGroup->d->m_currentMode); + } +} + +SurfaceInterface *TabletPadV2Interface::currentSurface() const +{ + return d->m_currentSurface; +} + +class TabletSeatV2InterfacePrivate : public QtWaylandServer::zwp_tablet_seat_v2 +{ +public: + TabletSeatV2InterfacePrivate(Display *display, TabletSeatV2Interface *q) + : zwp_tablet_seat_v2() + , q(q) + , m_display(display) + { + } + + void zwp_tablet_seat_v2_bind_resource(Resource *resource) override + { + for (auto tablet : qAsConst(m_tablets)) { + sendTabletAdded(resource, tablet); + } + + for (auto pad : qAsConst(m_pads)) { + sendPadAdded(resource, pad); + } + + for (auto *tool : qAsConst(m_tools)) { + sendToolAdded(resource, tool); + } + } + + void sendToolAdded(Resource *resource, TabletToolV2Interface *tool) + { + wl_resource *toolResource = tool->d->add(resource->client(), resource->version())->handle; + send_tool_added(resource->handle, toolResource); + + tool->d->send_type(toolResource, tool->d->m_type); + tool->d->send_hardware_serial(toolResource, tool->d->m_hardwareSerialHigh, tool->d->m_hardwareSerialLow); + tool->d->send_hardware_id_wacom(toolResource, tool->d->m_hardwareIdHigh, tool->d->m_hardwareIdLow); + for (uint32_t cap : qAsConst(tool->d->m_capabilities)) { + tool->d->send_capability(toolResource, cap); + } + tool->d->send_done(toolResource); + } + void sendTabletAdded(Resource *resource, TabletV2Interface *tablet) + { + wl_resource *tabletResource = tablet->d->add(resource->client(), resource->version())->handle; + send_tablet_added(resource->handle, tabletResource); + + tablet->d->send_name(tabletResource, tablet->d->m_name); + if (tablet->d->m_vendorId && tablet->d->m_productId) { + tablet->d->send_id(tabletResource, tablet->d->m_vendorId, tablet->d->m_productId); + } + for (const QString &path : qAsConst(tablet->d->m_paths)) { + tablet->d->send_path(tabletResource, path); + } + tablet->d->send_done(tabletResource); + } + + void sendPadAdded(Resource *resource, TabletPadV2Interface *pad) + { + wl_resource *tabletResource = pad->d->add(resource->client(), resource->version())->handle; + send_pad_added(resource->handle, tabletResource); + + pad->d->send_buttons(tabletResource, pad->d->m_buttons.size()); + pad->d->send_path(tabletResource, pad->d->m_path); + + auto groupResource = pad->d->m_padGroup->d->add(resource->client(), resource->version()); + pad->d->send_group(tabletResource, groupResource->handle); + pad->d->m_padGroup->d->send_modes(groupResource->handle, pad->d->m_modes); + + pad->d->m_padGroup->d->send_buttons( + groupResource->handle, + QByteArray::fromRawData(reinterpret_cast(pad->d->m_buttons.data()), pad->d->m_buttons.size() * sizeof(quint32))); + + for (auto ring : qAsConst(pad->d->m_rings)) { + auto ringResource = ring->d->add(resource->client(), resource->version()); + pad->d->m_padGroup->d->send_ring(groupResource->handle, ringResource->handle); + } + + for (auto strip : qAsConst(pad->d->m_strips)) { + auto stripResource = strip->d->add(resource->client(), resource->version()); + pad->d->m_padGroup->d->send_strip(groupResource->handle, stripResource->handle); + } + pad->d->m_padGroup->d->send_done(groupResource->handle); + pad->d->send_done(tabletResource); + } + + TabletSeatV2Interface *const q; + QVector m_tools; + QHash m_tablets; + QHash m_pads; + Display *const m_display; +}; + +TabletSeatV2Interface::TabletSeatV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new TabletSeatV2InterfacePrivate(display, this)) +{ +} + +TabletSeatV2Interface::~TabletSeatV2Interface() = default; + +TabletToolV2Interface *TabletSeatV2Interface::addTool(TabletToolV2Interface::Type type, + quint64 hardwareSerial, + quint64 hardwareId, + const QVector &capabilities) +{ + constexpr auto MAX_UINT_32 = std::numeric_limits::max(); + auto tool = new TabletToolV2Interface(d->m_display, + type, + hardwareSerial >> 32, + hardwareSerial & MAX_UINT_32, + hardwareId >> 32, + hardwareId & MAX_UINT_32, + capabilities, + this); + for (QtWaylandServer::zwp_tablet_seat_v2::Resource *resource : d->resourceMap()) { + d->sendToolAdded(resource, tool); + } + + d->m_tools.append(tool); + QObject::connect(tool, &QObject::destroyed, this, [this](QObject *object) { + auto tti = static_cast(object); + d->m_tools.removeAll(tti); + }); + return tool; +} + +TabletV2Interface * +TabletSeatV2Interface::addTablet(uint32_t vendorId, uint32_t productId, const QString &sysname, const QString &name, const QStringList &paths) +{ + Q_ASSERT(!d->m_tablets.contains(sysname)); + + auto iface = new TabletV2Interface(vendorId, productId, name, paths, this); + + for (QtWaylandServer::zwp_tablet_seat_v2::Resource *r : d->resourceMap()) { + d->sendTabletAdded(r, iface); + } + + d->m_tablets[sysname] = iface; + return iface; +} + +TabletPadV2Interface *TabletSeatV2Interface::addTabletPad(const QString &sysname, + const QString &name, + const QStringList &paths, + quint32 buttons, + quint32 rings, + quint32 strips, + quint32 modes, + quint32 currentMode, + TabletV2Interface *tablet) +{ + Q_UNUSED(name); + auto iface = new TabletPadV2Interface(paths.at(0), buttons, rings, strips, modes, currentMode, d->m_display, this); + iface->d->m_seat = this; + for (auto r : d->resourceMap()) { + d->sendPadAdded(r, iface); + } + + tablet->d->m_pad = iface; + + d->m_pads[sysname] = iface; + return iface; +} + +void TabletSeatV2Interface::removeDevice(const QString &sysname) +{ + delete d->m_tablets.take(sysname); + delete d->m_pads.take(sysname); +} + +TabletToolV2Interface *TabletSeatV2Interface::toolByHardwareId(quint64 hardwareId) const +{ + for (TabletToolV2Interface *tool : qAsConst(d->m_tools)) { + if (tool->d->hardwareId() == hardwareId) { + return tool; + } + } + return nullptr; +} + +TabletToolV2Interface *TabletSeatV2Interface::toolByHardwareSerial(quint64 hardwareSerial, TabletToolV2Interface::Type type) const +{ + for (TabletToolV2Interface *tool : qAsConst(d->m_tools)) { + if (tool->d->hardwareSerial() == hardwareSerial && tool->d->m_type == type) + return tool; + } + return nullptr; +} + +TabletPadV2Interface *TabletSeatV2Interface::padByName(const QString &name) const +{ + Q_ASSERT(d->m_pads.contains(name)); + return d->m_pads.value(name); +} + +class TabletManagerV2InterfacePrivate : public QtWaylandServer::zwp_tablet_manager_v2 +{ +public: + TabletManagerV2InterfacePrivate(Display *display, TabletManagerV2Interface *q) + : zwp_tablet_manager_v2(*display, s_version) + , q(q) + , m_display(display) + { + } + + void zwp_tablet_manager_v2_get_tablet_seat(Resource *resource, uint32_t tablet_seat, struct ::wl_resource *seat_resource) override + { + SeatInterface *seat = SeatInterface::get(seat_resource); + TabletSeatV2Interface *tsi = get(seat); + tsi->d->add(resource->client(), tablet_seat, s_version); + } + + TabletSeatV2Interface *get(SeatInterface *seat) + { + TabletSeatV2Interface *&tabletSeat = m_seats[seat]; + if (!tabletSeat) { + tabletSeat = new TabletSeatV2Interface(m_display, q); + } + return tabletSeat; + } + + TabletManagerV2Interface *const q; + Display *const m_display; + QHash m_seats; +}; + +TabletManagerV2Interface::TabletManagerV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new TabletManagerV2InterfacePrivate(display, this)) +{ +} + +TabletSeatV2Interface *TabletManagerV2Interface::seat(SeatInterface *seat) const +{ + return d->get(seat); +} + +bool TabletSeatV2Interface::isClientSupported(ClientConnection *client) const +{ + return d->resourceMap().value(*client); +} + +TabletManagerV2Interface::~TabletManagerV2Interface() = default; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/tablet_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/tablet_v2_interface.h --- dwayland-5.57.0.23/src/server/tablet_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/tablet_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,294 @@ +/* + SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include +#include + +namespace KWaylandServer +{ +class ClientConnection; +class Display; +class SeatInterface; +class SurfaceInterface; +class TabletCursorV2; +class TabletCursorV2Private; +class TabletManagerV2InterfacePrivate; +class TabletSeatV2Interface; +class TabletSeatV2InterfacePrivate; +class TabletToolV2InterfacePrivate; +class TabletV2Interface; +class TabletV2InterfacePrivate; +class TabletPadV2Interface; +class TabletPadV2InterfacePrivate; +class TabletPadRingV2Interface; +class TabletPadRingV2InterfacePrivate; +class TabletPadStripV2Interface; +class TabletPadStripV2InterfacePrivate; +class TabletPadGroupV2Interface; +class TabletPadGroupV2InterfacePrivate; + +/** + * This is an implementation of wayland-protocols/unstable/tablet/tablet-unstable-v2.xml + * + * This class is just the means to get a @class TabletSeatInterface, which is + * the class that will have all of the information we need. + */ + +class KWAYLANDSERVER_EXPORT TabletManagerV2Interface : public QObject +{ + Q_OBJECT +public: + explicit TabletManagerV2Interface(Display *d, QObject *parent); + virtual ~TabletManagerV2Interface(); + + TabletSeatV2Interface *seat(SeatInterface *seat) const; + +private: + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletToolV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletToolV2Interface(); + + enum Type { + Pen = 0x140, ///< Pen + Eraser = 0x141, ///< Eraser + Brush = 0x142, ///< Brush + Pencil = 0x143, ///< Pencil + Airbrush = 0x144, ///< Airbrush + Finger = 0x145, ///< Finger + Mouse = 0x146, ///< Mouse + Lens = 0x147, ///< Lens + Totem + }; + Q_ENUM(Type) + + enum Capability { + Tilt = 1, ///< Tilt axeis + Pressure = 2, ///< Pressure axis + Distance = 3, ///< Distance axis + Rotation = 4, ///< Z-rotation axis + Slider = 5, ///< Slider axis + Wheel = 6, ///< Wheel axis + }; + Q_ENUM(Capability) + + /** + * Sets the surface the events will be sent to. + * + * Make sure the surface supports being sent events to. + * + * @see TabletV2Interface::isSurfaceSupported + */ + void setCurrentSurface(SurfaceInterface *surface); + bool isClientSupported() const; + + void sendProximityIn(TabletV2Interface *tablet); + void sendProximityOut(); + void sendUp(); + void sendDown(); + void sendPressure(quint32 pressure); + void sendDistance(quint32 distance); + void sendTilt(qreal degreesX, qreal degreesY); + void sendRotation(qreal degrees); + void sendSlider(qint32 position); + void sendWheel(qint32 degrees, qint32 clicks); + void sendButton(quint32 button, bool pressed); + void sendFrame(quint32 time); + void sendMotion(const QPointF &pos); + +Q_SIGNALS: + void cursorChanged(TabletCursorV2 *cursor) const; + +private: + friend class TabletSeatV2InterfacePrivate; + friend class TabletSeatV2Interface; + explicit TabletToolV2Interface(Display *display, + Type type, + quint32 hsh, + quint32 hsl, + quint32 hih, + quint32 hil, + const QVector &capability, + QObject *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletCursorV2 : public QObject +{ + Q_OBJECT +public: + ~TabletCursorV2() override; + QPoint hotspot() const; + quint32 enteredSerial() const; + SurfaceInterface *surface() const; + +Q_SIGNALS: + void changed(); + +private: + TabletCursorV2(); + const QScopedPointer d; + friend class TabletToolV2InterfacePrivate; +}; + +class KWAYLANDSERVER_EXPORT TabletPadV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletPadV2Interface(); + + TabletPadRingV2Interface *ring(uint at) const; + TabletPadStripV2Interface *strip(uint at) const; + void sendButton(quint32 time, quint32 button, bool pressed); + + void setCurrentSurface(SurfaceInterface *surface, TabletV2Interface *tablet); + SurfaceInterface *currentSurface() const; + +Q_SIGNALS: + void feedback(KWaylandServer::ClientConnection *client, quint32 button, const QString &description, quint32 serial); + +private: + friend class TabletSeatV2Interface; + friend class TabletSeatV2InterfacePrivate; + explicit TabletPadV2Interface(const QString &path, + quint32 buttons, + quint32 rings, + quint32 strips, + quint32 modes, + quint32 currentMode, + Display *display, + TabletSeatV2Interface *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletPadRingV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletPadRingV2Interface(); + + enum Source { + SourceFinger = 1, // finger + }; + Q_ENUM(Source) + + void sendSource(Source source); + void sendAngle(qreal angle); + void sendStop(); + void sendFrame(quint32 time); + +private: + friend class TabletPadGroupV2Interface; + friend class TabletPadV2InterfacePrivate; + friend class TabletSeatV2InterfacePrivate; + explicit TabletPadRingV2Interface(TabletPadV2Interface *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletPadStripV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletPadStripV2Interface(); + + enum Source { + SourceFinger = 1, // finger + }; + + void sendSource(Source source); + void sendPosition(quint32 position); + void sendFrame(quint32 time); + void sendStop(); + +private: + friend class TabletPadGroupV2Interface; + friend class TabletPadV2InterfacePrivate; + friend class TabletSeatV2InterfacePrivate; + explicit TabletPadStripV2Interface(TabletPadV2Interface *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletPadGroupV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletPadGroupV2Interface(); + + void sendModeSwitch(quint32 time, quint32 serial, quint32 mode); + +private: + friend class TabletPadV2Interface; + friend class TabletPadV2InterfacePrivate; + friend class TabletSeatV2InterfacePrivate; + explicit TabletPadGroupV2Interface(quint32 currentMode, TabletPadV2Interface *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletV2Interface(); + + /** + * @returns true if the surface has been bound to the tablet. + */ + bool isSurfaceSupported(SurfaceInterface *surface) const; + + TabletPadV2Interface *pad() const; + +private: + friend class TabletSeatV2Interface; + friend class TabletSeatV2InterfacePrivate; + friend class TabletPadV2Interface; + friend class TabletToolV2Interface; + explicit TabletV2Interface(quint32 vendorId, quint32 productId, const QString &name, const QStringList &paths, QObject *parent); + QScopedPointer d; +}; + +class KWAYLANDSERVER_EXPORT TabletSeatV2Interface : public QObject +{ + Q_OBJECT +public: + virtual ~TabletSeatV2Interface(); + + TabletV2Interface *addTablet(quint32 vendorId, quint32 productId, const QString &sysname, const QString &name, const QStringList &paths); + TabletPadV2Interface *addTabletPad(const QString &sysname, + const QString &name, + const QStringList &paths, + quint32 buttons, + quint32 rings, + quint32 strips, + quint32 modes, + quint32 currentMode, + TabletV2Interface *tablet); + TabletToolV2Interface * + addTool(TabletToolV2Interface::Type type, quint64 hardwareSerial, quint64 hardwareId, const QVector &capabilities); + + TabletToolV2Interface *toolByHardwareId(quint64 hardwareId) const; + TabletToolV2Interface *toolByHardwareSerial(quint64 hardwareSerial, TabletToolV2Interface::Type type) const; + TabletPadV2Interface *padByName(const QString &sysname) const; + + void removeDevice(const QString &sysname); + + bool isClientSupported(ClientConnection *client) const; + +private: + friend class TabletManagerV2InterfacePrivate; + explicit TabletSeatV2Interface(Display *display, QObject *parent); + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::TabletSeatV2Interface *) diff -Nru dwayland-5.57.0.23/src/server/textinput.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput.cpp --- dwayland-5.57.0.23/src/server/textinput.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,7 @@ +/* + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "textinput.h" diff -Nru dwayland-5.57.0.23/src/server/textinput.h dwayland-5.57.0.24+really5.24.3/src/server/textinput.h --- dwayland-5.57.0.23/src/server/textinput.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,157 @@ +/* + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include +#include +#include + +#include + +namespace KWaylandServer +{ +Q_NAMESPACE_EXPORT(KWAYLANDSERVER_EXPORT) +/** + * ContentHint allows to modify the behavior of the text input. + */ +enum class TextInputContentHint { + /** + * no special behaviour + */ + None = 0, + /** + * suggest word completions + */ + AutoCompletion = 1 << 0, + /** + * suggest word corrections + */ + AutoCorrection = 1 << 1, + /** + * switch to uppercase letters at the start of a sentence + */ + AutoCapitalization = 1 << 2, + /** + * prefer lowercase letters + */ + LowerCase = 1 << 3, + /** + * prefer uppercase letters + */ + UpperCase = 1 << 4, + /** + * prefer casing for titles and headings (can be language dependent) + */ + TitleCase = 1 << 5, + /** + * characters should be hidden + */ + HiddenText = 1 << 6, + /** + * typed text should not be stored + */ + SensitiveData = 1 << 7, + /** + * just latin characters should be entered + */ + Latin = 1 << 8, + /** + * the text input is multi line + */ + MultiLine = 1 << 9, +}; + +Q_DECLARE_FLAGS(TextInputContentHints, TextInputContentHint) +Q_ENUM_NS(TextInputContentHint) + +/** + * The ContentPurpose allows to specify the primary purpose of a text input. + * + * This allows an input method to show special purpose input panels with + * extra characters or to disallow some characters. + */ +enum class TextInputContentPurpose { + /** + * default input, allowing all characters + */ + Normal, + /** + * allow only alphabetic characters + */ + Alpha, + /** + * allow only digits + */ + Digits, + /** + * input a number (including decimal separator and sign) + */ + Number, + /** + * input a phone number + */ + Phone, + /** + * input an URL + */ + Url, + /** + * input an email address + */ + Email, + /** + * input a name of a person + */ + Name, + /** + * input a password + */ + Password, + /** + * input a date + */ + Date, + /** + * input a time + */ + Time, + /** + * input a date and time + */ + DateTime, + /** + * input for a terminal + */ + Terminal, + /** + * input is numeric password + */ + Pin, +}; +Q_ENUM_NS(TextInputContentPurpose) + +enum class TextInputChangeCause { + /** + * Change caused by input method + */ + InputMethod, + + /** + * Something else other than input method caused change + */ + Other, +}; +Q_ENUM_NS(TextInputChangeCause) + +} + +Q_DECLARE_METATYPE(KWaylandServer::TextInputContentHint) +Q_DECLARE_METATYPE(KWaylandServer::TextInputContentHints) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::TextInputContentHints) +Q_DECLARE_METATYPE(KWaylandServer::TextInputContentPurpose) +Q_DECLARE_METATYPE(KWaylandServer::TextInputChangeCause) diff -Nru dwayland-5.57.0.23/src/server/textinput_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface.cpp --- dwayland-5.57.0.23/src/server/textinput_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,273 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "textinput_interface_p.h" -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "seat_interface_p.h" -#include "surface_interface.h" - -#include - -#include -#include - -namespace KWayland -{ -namespace Server -{ - -void TextInputInterface::Private::showInputPanelCallback(wl_client *client, wl_resource *resource) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - emit p->q_func()->requestShowInputPanel(); -} - -void TextInputInterface::Private::hideInputPanelCallback(wl_client *client, wl_resource *resource) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - emit p->q_func()->requestHideInputPanel(); -} - -void TextInputInterface::Private::setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->surroundingText = QByteArray(text); - // TODO: make qint32 - p->surroundingTextCursorPosition = cursor; - p->surroundingTextSelectionAnchor = anchor; - emit p->q_func()->surroundingTextChanged(); -} - -void TextInputInterface::Private::setContentTypeCallback(wl_client *client, wl_resource *resource, uint32_t hint, uint32_t purpose) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - const auto contentHints = p->convertContentHint(hint); - const auto contentPurpose = p->convertContentPurpose(purpose); - if (contentHints != p->contentHints || contentPurpose != p->contentPurpose) { - p->contentHints = contentHints; - p->contentPurpose = contentPurpose; - emit p->q_func()->contentTypeChanged(); - } -} - -void TextInputInterface::Private::setCursorRectangleCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - const QRect rect = QRect(x, y, width, height); - if (p->cursorRectangle != rect) { - p->cursorRectangle = rect; - emit p->q_func()->cursorRectangleChanged(p->cursorRectangle); - } -} - -void TextInputInterface::Private::setPreferredLanguageCallback(wl_client *client, wl_resource *resource, const char * language) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - const QByteArray preferredLanguage = QByteArray(language); - if (p->preferredLanguage != preferredLanguage) { - p->preferredLanguage = preferredLanguage; - emit p->q_func()->preferredLanguageChanged(p->preferredLanguage); - } -} - -TextInputInterface::Private::Private(TextInputInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) -{ -} - -TextInputInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -QByteArray TextInputInterface::preferredLanguage() const -{ - Q_D(); - return d->preferredLanguage; -} - -TextInputInterface::ContentHints TextInputInterface::contentHints() const -{ - Q_D(); - return d->contentHints; -} - -TextInputInterface::ContentPurpose TextInputInterface::contentPurpose() const -{ - Q_D(); - return d->contentPurpose; -} - -QByteArray TextInputInterface::surroundingText() const -{ - Q_D(); - return d->surroundingText; -} - -qint32 TextInputInterface::surroundingTextCursorPosition() const -{ - Q_D(); - return d->surroundingTextCursorPosition; -} - -qint32 TextInputInterface::surroundingTextSelectionAnchor() const -{ - Q_D(); - return d->surroundingTextSelectionAnchor; -} - -void TextInputInterface::preEdit(const QByteArray &text, const QByteArray &commit) -{ - Q_D(); - d->preEdit(text, commit); -} - -void TextInputInterface::commit(const QByteArray &text) -{ - Q_D(); - d->commit(text); -} - -void TextInputInterface::keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_UNUSED(modifiers) - Q_D(); - d->keysymPressed(keysym, modifiers); -} - -void TextInputInterface::keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_D(); - d->keysymReleased(keysym, modifiers); -} - -void TextInputInterface::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) -{ - Q_D(); - d->deleteSurroundingText(beforeLength, afterLength); -} - -void TextInputInterface::setCursorPosition(qint32 index, qint32 anchor) -{ - Q_D(); - d->setCursorPosition(index, anchor); -} - -void TextInputInterface::setTextDirection(Qt::LayoutDirection direction) -{ - Q_D(); - d->setTextDirection(direction); -} - -void TextInputInterface::setPreEditCursor(qint32 index) -{ - Q_D(); - d->setPreEditCursor(index); -} - -void TextInputInterface::setInputPanelState(bool visible, const QRect &overlappedSurfaceArea) -{ - Q_D(); - if (d->inputPanelVisible == visible && d->overlappedSurfaceArea == overlappedSurfaceArea) { - // not changed - return; - } - d->inputPanelVisible = visible; - d->overlappedSurfaceArea = overlappedSurfaceArea; - d->sendInputPanelState(); -} - -void TextInputInterface::setLanguage(const QByteArray &languageTag) -{ - Q_D(); - if (d->language == languageTag) { - // not changed - return; - } - d->language = languageTag; - d->sendLanguage(); -} - -TextInputInterfaceVersion TextInputInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion(); -} - -QPointer TextInputInterface::surface() const -{ - Q_D(); - return d->surface; -} - -QRect TextInputInterface::cursorRectangle() const -{ - Q_D(); - return d->cursorRectangle; -} - -bool TextInputInterface::isEnabled() const -{ - Q_D(); - return d->enabled; -} - -TextInputInterface::Private *TextInputInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -TextInputInterface::TextInputInterface(Private *p, QObject *parent) - : Resource(p, parent) -{ -} - -TextInputInterface::~TextInputInterface() = default; - -TextInputManagerInterface::TextInputManagerInterface(Private *d, QObject *parent) - : Global(d, parent) -{ -} - -TextInputManagerInterface::~TextInputManagerInterface() = default; - -TextInputInterfaceVersion TextInputManagerInterface::interfaceVersion() const -{ - Q_D(); - return d->interfaceVersion; -} - -TextInputManagerInterface::Private *TextInputManagerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} diff -Nru dwayland-5.57.0.23/src/server/textinput_interface.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface.h --- dwayland-5.57.0.23/src/server/textinput_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,439 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_TEXTINPUT_INTERFACE_H -#define KWAYLAND_SERVER_TEXTINPUT_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SeatInterface; -class SurfaceInterface; -class TextInputInterface; - -/** - * Enum describing the different InterfaceVersion encapsulated in this implementation - * - * @since 5.23 - **/ -enum class TextInputInterfaceVersion { - /** - * wl_text_input as the non-standardized version - **/ - UnstableV0, - /** - * not supported version - **/ - UnstableV1, - /** - * zwp_text_input_v2 as used by Qt 5.7 - **/ - UnstableV2 -}; - -/** - * @brief Represent the Global for the interface. - * - * The class can represent different interfaces. Which concrete interface is represented - * can be determined through {@link interfaceVersion}. - * - * To create a TextInputManagerInterface use {@link Display::createTextInputManager} - * - * @since 5.23 - **/ -class KWAYLANDSERVER_EXPORT TextInputManagerInterface : public Global -{ - Q_OBJECT -public: - virtual ~TextInputManagerInterface(); - - /** - * @returns The interface version used by this TextInputManagerInterface - **/ - TextInputInterfaceVersion interfaceVersion() const; - -protected: - class Private; - explicit TextInputManagerInterface(Private *d, QObject *parent = nullptr); - -private: - Private *d_func() const; -}; - -/** - * @brief Represents a generic Resource for a text input object. - * - * This class does not directly correspond to a Wayland resource, but is a generic contract - * for any interface which implements a text input, e.g. the unstable wl_text_input interface. - * - * It does not expose the actual interface to cover up the fact that the interface is unstable - * and might change. If one needs to know the actual used protocol, use the method {@link interfaceVersion}. - * - * A TextInputInterface gets created by the {@link TextInputManagerInterface}. The individual - * instances are not exposed directly. The SeatInterface provides access to the currently active - * TextInputInterface. This is evaluated automatically based on which SurfaceInterface has - * keyboard focus. - * - * @see TextInputManagerInterface - * @see SeatInterface - * @since 5.23 - **/ -class KWAYLANDSERVER_EXPORT TextInputInterface : public Resource -{ - Q_OBJECT -public: - virtual ~TextInputInterface(); - - /** - * ContentHint allows to modify the behavior of the text input. - **/ - enum class ContentHint : uint32_t { - /** - * no special behaviour - */ - None = 0, - /** - * suggest word completions - */ - AutoCompletion = 1 << 0, - /** - * suggest word corrections - */ - AutoCorrection = 1 << 1, - /** - * switch to uppercase letters at the start of a sentence - */ - AutoCapitalization = 1 << 2, - /** - * prefer lowercase letters - */ - LowerCase = 1 << 3, - /** - * prefer uppercase letters - */ - UpperCase = 1 << 4, - /** - * prefer casing for titles and headings (can be language dependent) - */ - TitleCase = 1 << 5, - /** - * characters should be hidden - */ - HiddenText = 1 << 6, - /** - * typed text should not be stored - */ - SensitiveData = 1 << 7, - /** - * just latin characters should be entered - */ - Latin = 1 << 8, - /** - * the text input is multi line - */ - MultiLine = 1 << 9 - }; - Q_DECLARE_FLAGS(ContentHints, ContentHint) - - /** - * The ContentPurpose allows to specify the primary purpose of a text input. - * - * This allows an input method to show special purpose input panels with - * extra characters or to disallow some characters. - */ - enum class ContentPurpose : uint32_t { - /** - * default input, allowing all characters - */ - Normal, - /** - * allow only alphabetic characters - **/ - Alpha, - /** - * allow only digits - */ - Digits, - /** - * input a number (including decimal separator and sign) - */ - Number, - /** - * input a phone number - */ - Phone, - /** - * input an URL - */ - Url, - /** - * input an email address - **/ - Email, - /** - * input a name of a person - */ - Name, - /** - * input a password - */ - Password, - /** - * input a date - */ - Date, - /** - * input a time - */ - Time, - /** - * input a date and time - */ - DateTime, - /** - * input for a terminal - */ - Terminal - }; - - /** - * @returns The interface version used by this TextInputInterface - **/ - TextInputInterfaceVersion interfaceVersion() const; - - /** - * The preferred language as a RFC-3066 format language tag. - * - * This can be used by the server to show a language specific virtual keyboard layout. - * @see preferredLanguageChanged - **/ - QByteArray preferredLanguage() const; - - /** - * @see cursorRectangleChanged - **/ - QRect cursorRectangle() const; - - /** - * @see contentTypeChanged - **/ - ContentPurpose contentPurpose() const; - - /** - *@see contentTypeChanged - **/ - ContentHints contentHints() const; - - /** - * @returns The plain surrounding text around the input position. - * @see surroundingTextChanged - * @see surroundingTextCursorPosition - * @see surroundingTextSelectionAnchor - **/ - QByteArray surroundingText() const; - /** - * @returns The byte offset of current cursor position within the {@link surroundingText} - * @see surroundingText - * @see surroundingTextChanged - **/ - qint32 surroundingTextCursorPosition() const; - /** - * The byte offset of the selection anchor within the {@link surroundingText}. - * - * If there is no selected text this is the same as cursor. - * @return The byte offset of the selection anchor - * @see surroundingText - * @see surroundingTextChanged - **/ - qint32 surroundingTextSelectionAnchor() const; - - /** - * @return The surface the TextInputInterface is enabled on - * @see isEnabled - * @see enabledChanged - **/ - QPointer surface() const; - - /** - * @return Whether the TextInputInterface is currently enabled for a SurfaceInterface. - * @see surface - * @see enabledChanged - **/ - bool isEnabled() const; - - /** - * Notify when a new composing @p text (pre-edit) should be set around the - * current cursor position. Any previously set composing text should - * be removed. - * - * The @p commitText can be used to replace the preedit text on reset - * (for example on unfocus). - * - * @param text The new utf8-encoded pre-edit text - * @param commitText Utf8-encoded text to replace preedit text on reset - * @see commit - * @see preEditCursor - **/ - void preEdit(const QByteArray &text, const QByteArray &commitText); - - /** - * Notify when @p text should be inserted into the editor widget. - * The text to commit could be either just a single character after a key press or the - * result of some composing ({@link preEdit}). It could be also an empty text - * when some text should be removed (see {@link deleteSurroundingText}) or when - * the input cursor should be moved (see {@link cursorPosition}). - * - * Any previously set composing text should be removed. - * @param text The utf8-encoded text to be inserted into the editor widget - * @see preEdit - * @see deleteSurroundingText - **/ - void commit(const QByteArray &text); - - /** - * Sets the cursor position inside the composing text (as byte offset) relative to the - * start of the composing text. When @p index is a negative number no cursor is shown. - * - * The Client applies the @p index together with {@link preEdit}. - * @param index The cursor position relative to the start of the composing text - * @see preEdit - **/ - void setPreEditCursor(qint32 index); - - /** - * Notify when the text around the current cursor position should be deleted. - * - * The Client processes this event together with the commit string - * - * @param beforeLength length of text before current cursor position. - * @param afterLength length of text after current cursor position. - * @see commit - **/ - void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); - - /** - * Notify when the cursor @p index or @p anchor position should be modified. - * - * The Client applies this together with the commit string. - **/ - void setCursorPosition(qint32 index, qint32 anchor); - - /** - * Sets the text @p direction of input text. - **/ - void setTextDirection(Qt::LayoutDirection direction); - - void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); - void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); - - /** - * Informs the client about changes in the visibility of the input panel (virtual keyboard). - * - * The @p overlappedSurfaceArea defines the area overlapped by the input panel (virtual keyboard) - * on the SurfaceInterface having the text focus in surface local coordinates. - * - * @param visible Whether the input panel is currently visible - * @param overlappedSurfaceArea The overlapping area in surface local coordinates - **/ - void setInputPanelState(bool visible, const QRect &overlappedSurfaceArea); - - /** - * Sets the language of the input text. The @p languageTag is a RFC-3066 format language tag. - **/ - void setLanguage(const QByteArray &languageTag); - -Q_SIGNALS: - /** - * Requests input panels (virtual keyboard) to show. - * @see requestHideInputPanel - **/ - void requestShowInputPanel(); - /** - * Requests input panels (virtual keyboard) to hide. - * @see requestShowInputPanel - **/ - void requestHideInputPanel(); - /** - * Invoked by the client when the input state should be - * reset, for example after the text was changed outside of the normal - * input method flow. - **/ - void requestReset(); - /** - * Emitted whenever the preferred @p language changes. - * @see preferredLanguage - **/ - void preferredLanguageChanged(const QByteArray &language); - /** - * @see cursorRectangle - **/ - void cursorRectangleChanged(const QRect &rect); - /** - * Emitted when the {@link contentPurpose} and/or {@link contentHints} changes. - * @see contentPurpose - * @see contentHints - **/ - void contentTypeChanged(); - /** - * Emitted when the {@link surroundingText}, {@link surroundingTextCursorPosition} - * and/or {@link surroundingTextSelectionAnchor} changed. - * @see surroundingText - * @see surroundingTextCursorPosition - * @see surroundingTextSelectionAnchor - **/ - void surroundingTextChanged(); - /** - * Emitted whenever this TextInputInterface gets enabled or disabled for a SurfaceInterface. - * @see isEnabled - * @see surface - **/ - void enabledChanged(); - -protected: - class Private; - explicit TextInputInterface(Private *p, QObject *parent = nullptr); - -private: - friend class TextInputManagerUnstableV0Interface; - friend class TextInputManagerUnstableV2Interface; - friend class SeatInterface; - - Private *d_func() const; -}; - - -} -} - -Q_DECLARE_METATYPE(KWayland::Server::TextInputInterfaceVersion) -Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface *) -Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentHint) -Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentHints) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::TextInputInterface::ContentHints) -Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentPurpose) - -#endif diff -Nru dwayland-5.57.0.23/src/server/textinput_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_p.h --- dwayland-5.57.0.23/src/server/textinput_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_TEXTINPUT_INTERFACE_P_H -#define KWAYLAND_SERVER_TEXTINPUT_INTERFACE_P_H -#include "textinput_interface.h" -#include "resource_p.h" -#include "global_p.h" - -#include -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class TextInputManagerUnstableV0Interface; -class TextInputManagerUnstableV2Interface; - -class TextInputManagerInterface::Private : public Global::Private -{ -public: - QVector inputs; - TextInputInterfaceVersion interfaceVersion; - -protected: - Private(TextInputInterfaceVersion interfaceVersion, TextInputManagerInterface *q, Display *d, const wl_interface *interface, quint32 version); - TextInputManagerInterface *q; -}; - -class TextInputInterface::Private : public Resource::Private -{ -public: - ~Private(); - - virtual void sendEnter(SurfaceInterface *surface, quint32 serial) = 0; - virtual void sendLeave(quint32 serial, SurfaceInterface *surface) = 0; - - virtual void preEdit(const QByteArray &text, const QByteArray &commit) = 0; - virtual void commit(const QByteArray &text) = 0; - virtual void deleteSurroundingText(quint32 beforeLength, quint32 afterLength) = 0; - virtual void setTextDirection(Qt::LayoutDirection direction) = 0; - virtual void setPreEditCursor(qint32 index) = 0; - virtual void setCursorPosition(qint32 index, qint32 anchor) = 0; - virtual void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) = 0; - virtual void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) = 0; - virtual TextInputInterfaceVersion interfaceVersion() const = 0; - virtual void sendInputPanelState() = 0; - virtual void sendLanguage() = 0; - - virtual TextInputInterface::ContentHints convertContentHint(uint32_t hint) const = 0; - virtual TextInputInterface::ContentPurpose convertContentPurpose(uint32_t purpose) const = 0; - - QByteArray preferredLanguage; - QRect cursorRectangle; - TextInputInterface::ContentHints contentHints = TextInputInterface::ContentHint::None; - TextInputInterface::ContentPurpose contentPurpose = TextInputInterface::ContentPurpose::Normal; - SeatInterface *seat = nullptr; - QPointer surface; - bool enabled = false; - QByteArray surroundingText; - qint32 surroundingTextCursorPosition = 0; - qint32 surroundingTextSelectionAnchor = 0; - bool inputPanelVisible = false; - QRect overlappedSurfaceArea; - QByteArray language; - -protected: - Private(TextInputInterface *q, Global *c, wl_resource *parentResource, const wl_interface *interface, const void *implementation); - - static void showInputPanelCallback(wl_client *client, wl_resource *resource); - static void hideInputPanelCallback(wl_client *client, wl_resource *resource); - static void setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor); - static void setContentTypeCallback(wl_client *client, wl_resource *resource, uint32_t hint, uint32_t purpose); - static void setCursorRectangleCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static void setPreferredLanguageCallback(wl_client *client, wl_resource *resource, const char * language); - -private: - TextInputInterface *q_func() { - return reinterpret_cast(q); - } -}; - -class TextInputUnstableV0Interface : public TextInputInterface -{ - Q_OBJECT -public: - virtual ~TextInputUnstableV0Interface(); - -Q_SIGNALS: - /** - * @internal - **/ - void requestActivate(KWayland::Server::SeatInterface *seat, KWayland::Server::SurfaceInterface *surface); - -private: - explicit TextInputUnstableV0Interface(TextInputManagerUnstableV0Interface *parent, wl_resource *parentResource); - friend class TextInputManagerUnstableV0Interface; - class Private; -}; - -class TextInputUnstableV2Interface : public TextInputInterface -{ - Q_OBJECT -public: - virtual ~TextInputUnstableV2Interface(); - -private: - explicit TextInputUnstableV2Interface(TextInputManagerUnstableV2Interface *parent, wl_resource *parentResource); - friend class TextInputManagerUnstableV2Interface; - class Private; -}; - -class TextInputManagerUnstableV0Interface : public TextInputManagerInterface -{ - Q_OBJECT -public: - explicit TextInputManagerUnstableV0Interface(Display *display, QObject *parent = nullptr); - virtual ~TextInputManagerUnstableV0Interface(); - -private: - class Private; -}; - -class TextInputManagerUnstableV2Interface : public TextInputManagerInterface -{ - Q_OBJECT -public: - explicit TextInputManagerUnstableV2Interface(Display *display, QObject *parent = nullptr); - virtual ~TextInputManagerUnstableV2Interface(); - -private: - class Private; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/textinput_interface_v0.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_v0.cpp --- dwayland-5.57.0.23/src/server/textinput_interface_v0.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_v0.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,441 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "textinput_interface_p.h" -#include "display.h" -#include "resource_p.h" -#include "seat_interface_p.h" -#include "surface_interface.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class TextInputUnstableV0Interface::Private : public TextInputInterface::Private -{ -public: - Private(TextInputInterface *q, TextInputManagerUnstableV0Interface *c, wl_resource *parentResource); - ~Private(); - - void activate(SeatInterface *seat, SurfaceInterface *surface); - void deactivate(); - - void sendEnter(SurfaceInterface *surface, quint32 serial) override; - void sendLeave(quint32 serial, SurfaceInterface *surface) override; - void preEdit(const QByteArray &text, const QByteArray &commit) override; - void commit(const QByteArray &text) override; - void deleteSurroundingText(quint32 beforeLength, quint32 afterLength) override; - void setTextDirection(Qt::LayoutDirection direction) override; - void setPreEditCursor(qint32 index) override; - void setCursorPosition(qint32 index, qint32 anchor) override; - void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) override; - void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) override; - TextInputInterfaceVersion interfaceVersion() const override { - return TextInputInterfaceVersion::UnstableV0; - } - void sendInputPanelState() override; - void sendLanguage() override; - -private: - static const struct wl_text_input_interface s_interface; - TextInputUnstableV0Interface *q_func() { - return reinterpret_cast(q); - } - - static void activateCallback(wl_client *client, wl_resource *resource, wl_resource * seat, wl_resource * surface); - static void deactivateCallback(wl_client *client, wl_resource *resource, wl_resource * seat); - static void resetCallback(wl_client *client, wl_resource *resource); - static void setSurroundingTextUintCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor); - static void commitStateCallback(wl_client *client, wl_resource *resource, uint32_t serial); - static void invokeActionCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t index); - - // helpers - TextInputInterface::ContentHints convertContentHint(uint32_t hint) const override; - TextInputInterface::ContentPurpose convertContentPurpose(uint32_t purpose) const override; - - quint32 latestState = 0; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_text_input_interface TextInputUnstableV0Interface::Private::s_interface = { - activateCallback, - deactivateCallback, - showInputPanelCallback, - hideInputPanelCallback, - resetCallback, - setSurroundingTextUintCallback, - setContentTypeCallback, - setCursorRectangleCallback, - setPreferredLanguageCallback, - commitStateCallback, - invokeActionCallback -}; -#endif - -void TextInputUnstableV0Interface::Private::activate(SeatInterface *seat, SurfaceInterface *s) -{ - surface = QPointer(s); - enabled = true; - emit q_func()->enabledChanged(); - emit q_func()->requestActivate(seat, surface); -} - -void TextInputUnstableV0Interface::Private::deactivate() -{ - surface.clear(); - enabled = false; - emit q_func()->enabledChanged(); -} - -void TextInputUnstableV0Interface::Private::sendEnter(SurfaceInterface *surface, quint32 serial) -{ - Q_UNUSED(serial) - if (!resource) { - return; - } - wl_text_input_send_enter(resource, surface->resource()); -} - -void TextInputUnstableV0Interface::Private::sendLeave(quint32 serial, SurfaceInterface *surface) -{ - Q_UNUSED(serial) - Q_UNUSED(surface) - if (!resource) { - return; - } - wl_text_input_send_leave(resource); -} - -void TextInputUnstableV0Interface::Private::preEdit(const QByteArray &text, const QByteArray &commit) -{ - if (!resource) { - return; - } - wl_text_input_send_preedit_string(resource, latestState, text.constData(), commit.constData()); -} - -void TextInputUnstableV0Interface::Private::commit(const QByteArray &text) -{ - if (!resource) { - return; - } - wl_text_input_send_commit_string(resource, latestState, text.constData()); -} - -void TextInputUnstableV0Interface::Private::keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_UNUSED(modifiers) - if (!resource) { - return; - } - wl_text_input_send_keysym(resource, latestState, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_PRESSED, 0); -} - -void TextInputUnstableV0Interface::Private::keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_UNUSED(modifiers) - if (!resource) { - return; - } - wl_text_input_send_keysym(resource, latestState, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_RELEASED, 0); -} - -void TextInputUnstableV0Interface::Private::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) -{ - if (!resource) { - return; - } - wl_text_input_send_delete_surrounding_text(resource, -1 * beforeLength, beforeLength + afterLength); -} - -void TextInputUnstableV0Interface::Private::setCursorPosition(qint32 index, qint32 anchor) -{ - if (!resource) { - return; - } - wl_text_input_send_cursor_position(resource, index, anchor); -} - -void TextInputUnstableV0Interface::Private::setTextDirection(Qt::LayoutDirection direction) -{ - if (!resource) { - return; - } - wl_text_input_text_direction wlDirection; - switch (direction) { - case Qt::LeftToRight: - wlDirection = WL_TEXT_INPUT_TEXT_DIRECTION_LTR; - break; - case Qt::RightToLeft: - wlDirection = WL_TEXT_INPUT_TEXT_DIRECTION_RTL; - break; - case Qt::LayoutDirectionAuto: - wlDirection = WL_TEXT_INPUT_TEXT_DIRECTION_AUTO; - break; - default: - Q_UNREACHABLE(); - break; - } - wl_text_input_send_text_direction(resource, latestState, wlDirection); -} - -void TextInputUnstableV0Interface::Private::setPreEditCursor(qint32 index) -{ - if (!resource) { - return; - } - wl_text_input_send_preedit_cursor(resource, index); -} - -void TextInputUnstableV0Interface::Private::sendInputPanelState() -{ - if (!resource) { - return; - } - wl_text_input_send_input_panel_state(resource, inputPanelVisible); -} - -void TextInputUnstableV0Interface::Private::sendLanguage() -{ - if (!resource) { - return; - } - wl_text_input_send_language(resource, latestState, language.constData()); -} - -TextInputUnstableV0Interface::Private::Private(TextInputInterface *q, TextInputManagerUnstableV0Interface *c, wl_resource *parentResource) - : TextInputInterface::Private(q, c, parentResource, &wl_text_input_interface, &s_interface) -{ -} - -TextInputUnstableV0Interface::Private::~Private() = default; - -void TextInputUnstableV0Interface::Private::activateCallback(wl_client *client, wl_resource *resource, wl_resource *seat, wl_resource *surface) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->activate(SeatInterface::get(seat), SurfaceInterface::get(surface)); -} - -void TextInputUnstableV0Interface::Private::deactivateCallback(wl_client *client, wl_resource *resource, wl_resource *seat) -{ - Q_UNUSED(seat) - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->deactivate(); -} - -void TextInputUnstableV0Interface::Private::resetCallback(wl_client *client, wl_resource *resource) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - emit p->q_func()->requestReset(); -} - -void TextInputUnstableV0Interface::Private::setSurroundingTextUintCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor) -{ - setSurroundingTextCallback(client, resource, text, cursor, anchor); -} - -void TextInputUnstableV0Interface::Private::commitStateCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->latestState = serial; -} - -void TextInputUnstableV0Interface::Private::invokeActionCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t index) -{ - Q_UNUSED(button) - Q_UNUSED(index) - // TODO: implement - auto p = cast(resource); - Q_ASSERT(*p->client == client); -} - -TextInputInterface::ContentHints TextInputUnstableV0Interface::Private::convertContentHint(uint32_t hint) const -{ - const auto hints = wl_text_input_content_hint(hint); - TextInputInterface::ContentHints ret = TextInputInterface::ContentHint::None; - - if (hints & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION) { - ret |= TextInputInterface::ContentHint::AutoCompletion; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION) { - ret |= TextInputInterface::ContentHint::AutoCorrection; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION) { - ret |= TextInputInterface::ContentHint::AutoCapitalization; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE) { - ret |= TextInputInterface::ContentHint::LowerCase; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE) { - ret |= TextInputInterface::ContentHint::UpperCase; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_TITLECASE) { - ret |= TextInputInterface::ContentHint::TitleCase; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT) { - ret |= TextInputInterface::ContentHint::HiddenText; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA) { - ret |= TextInputInterface::ContentHint::SensitiveData; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_LATIN) { - ret |= TextInputInterface::ContentHint::Latin; - } - if (hints & WL_TEXT_INPUT_CONTENT_HINT_MULTILINE) { - ret |= TextInputInterface::ContentHint::MultiLine; - } - return ret; -} - -TextInputInterface::ContentPurpose TextInputUnstableV0Interface::Private::convertContentPurpose(uint32_t purpose) const -{ - const auto wlPurpose = wl_text_input_content_purpose(purpose); - - switch (wlPurpose) { - case WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA: - return TextInputInterface::ContentPurpose::Alpha; - case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: - return TextInputInterface::ContentPurpose::Digits; - case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: - return TextInputInterface::ContentPurpose::Number; - case WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE: - return TextInputInterface::ContentPurpose::Phone; - case WL_TEXT_INPUT_CONTENT_PURPOSE_URL: - return TextInputInterface::ContentPurpose::Url; - case WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL: - return TextInputInterface::ContentPurpose::Email; - case WL_TEXT_INPUT_CONTENT_PURPOSE_NAME: - return TextInputInterface::ContentPurpose::Name; - case WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: - return TextInputInterface::ContentPurpose::Password; - case WL_TEXT_INPUT_CONTENT_PURPOSE_DATE: - return TextInputInterface::ContentPurpose::Date; - case WL_TEXT_INPUT_CONTENT_PURPOSE_TIME: - return TextInputInterface::ContentPurpose::Time; - case WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME: - return TextInputInterface::ContentPurpose::DateTime; - case WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL: - return TextInputInterface::ContentPurpose::Terminal; - case WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL: - default: - return TextInputInterface::ContentPurpose::Normal; - } -} - -TextInputUnstableV0Interface::TextInputUnstableV0Interface(TextInputManagerUnstableV0Interface *parent, wl_resource *parentResource) - : TextInputInterface(new Private(this, parent, parentResource)) -{ -} - -TextInputUnstableV0Interface::~TextInputUnstableV0Interface() = default; - -class TextInputManagerUnstableV0Interface::Private : public TextInputManagerInterface::Private -{ -public: - Private(TextInputManagerUnstableV0Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void createTextInputCallback(wl_client *client, wl_resource *resource, uint32_t id); - - TextInputManagerUnstableV0Interface *q; - static const struct wl_text_input_manager_interface s_interface; - static const quint32 s_version; -}; -const quint32 TextInputManagerUnstableV0Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_text_input_manager_interface TextInputManagerUnstableV0Interface::Private::s_interface = { - createTextInputCallback -}; -#endif - -void TextInputManagerUnstableV0Interface::Private::createTextInputCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - auto m = cast(resource); - auto *t = new TextInputUnstableV0Interface(m->q, resource); - m->inputs << t; - QObject::connect(t, &QObject::destroyed, m->q, - [t, m] { - m->inputs.removeAll(t); - } - ); - QObject::connect(t, &TextInputUnstableV0Interface::requestActivate, m->q, - [t, m] (SeatInterface *seat) { - // TODO: disallow for other seat - seat->d_func()->registerTextInput(t); - t->d_func()->seat = seat; - } - ); - t->d->create(m->display->getConnection(client), version, id); -} - -TextInputManagerInterface::Private::Private(TextInputInterfaceVersion interfaceVersion, TextInputManagerInterface *q, Display *d, const wl_interface *interface, quint32 version) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) -{ -} - -TextInputManagerUnstableV0Interface::Private::Private(TextInputManagerUnstableV0Interface *q, Display *d) - : TextInputManagerInterface::Private(TextInputInterfaceVersion::UnstableV0, q, d, &wl_text_input_manager_interface, s_version) - , q(q) -{ -} - -void TextInputManagerUnstableV0Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&wl_text_input_manager_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void TextInputManagerUnstableV0Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -TextInputManagerUnstableV0Interface::TextInputManagerUnstableV0Interface(Display *display, QObject *parent) - : TextInputManagerInterface(new Private(this, display), parent) -{ -} - -TextInputManagerUnstableV0Interface::~TextInputManagerUnstableV0Interface() = default; - -} -} diff -Nru dwayland-5.57.0.23/src/server/textinput_interface_v2.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_v2.cpp --- dwayland-5.57.0.23/src/server/textinput_interface_v2.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_interface_v2.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,417 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "textinput_interface_p.h" -#include "display.h" -#include "resource_p.h" -#include "seat_interface_p.h" -#include "surface_interface.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class TextInputUnstableV2Interface::Private : public TextInputInterface::Private -{ -public: - Private(TextInputInterface *q, TextInputManagerUnstableV2Interface *c, wl_resource *parentResource); - ~Private(); - - void sendEnter(SurfaceInterface *surface, quint32 serial) override; - void sendLeave(quint32 serial, SurfaceInterface *surface) override; - void preEdit(const QByteArray &text, const QByteArray &commit) override; - void commit(const QByteArray &text) override; - void deleteSurroundingText(quint32 beforeLength, quint32 afterLength) override; - void setTextDirection(Qt::LayoutDirection direction) override; - void setPreEditCursor(qint32 index) override; - void setCursorPosition(qint32 index, qint32 anchor) override; - void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) override; - void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) override; - TextInputInterfaceVersion interfaceVersion() const override { - return TextInputInterfaceVersion::UnstableV2; - } - void sendInputPanelState() override; - void sendLanguage() override; - -private: - static const struct zwp_text_input_v2_interface s_interface; - TextInputUnstableV2Interface *q_func() { - return reinterpret_cast(q); - } - - static void enableCallback(wl_client *client, wl_resource *resource, wl_resource * surface); - static void disableCallback(wl_client *client, wl_resource *resource, wl_resource * surface); - static void updateStateCallback(wl_client *client, wl_resource *resource, uint32_t serial, uint32_t reason); - - // helpers - TextInputInterface::ContentHints convertContentHint(uint32_t hint) const override; - TextInputInterface::ContentPurpose convertContentPurpose(uint32_t purpose) const override; - - void enable(SurfaceInterface *s); - void disable(); -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_text_input_v2_interface TextInputUnstableV2Interface::Private::s_interface = { - resourceDestroyedCallback, - enableCallback, - disableCallback, - showInputPanelCallback, - hideInputPanelCallback, - setSurroundingTextCallback, - setContentTypeCallback, - setCursorRectangleCallback, - setPreferredLanguageCallback, - updateStateCallback -}; -#endif - -void TextInputUnstableV2Interface::Private::enable(SurfaceInterface *s) -{ - surface = QPointer(s); - enabled = true; - emit q_func()->enabledChanged(); -} - -void TextInputUnstableV2Interface::Private::disable() -{ - surface.clear(); - enabled = false; - emit q_func()->enabledChanged(); -} - -void TextInputUnstableV2Interface::Private::sendEnter(SurfaceInterface *surface, quint32 serial) -{ - if (!resource || !surface || !surface->resource()) { - return; - } - zwp_text_input_v2_send_enter(resource, serial, surface->resource()); -} - -void TextInputUnstableV2Interface::Private::sendLeave(quint32 serial, SurfaceInterface *surface) -{ - if (!resource || !surface || !surface->resource()) { - return; - } - zwp_text_input_v2_send_leave(resource, serial, surface->resource()); -} - -void TextInputUnstableV2Interface::Private::preEdit(const QByteArray &text, const QByteArray &commit) -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_preedit_string(resource, text.constData(), commit.constData()); -} - -void TextInputUnstableV2Interface::Private::commit(const QByteArray &text) -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_commit_string(resource, text.constData()); -} - -void TextInputUnstableV2Interface::Private::keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_UNUSED(modifiers) - if (!resource) { - return; - } - zwp_text_input_v2_send_keysym(resource, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_PRESSED, 0); -} - -void TextInputUnstableV2Interface::Private::keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) -{ - Q_UNUSED(modifiers) - if (!resource) { - return; - } - zwp_text_input_v2_send_keysym(resource, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_RELEASED, 0); -} - -void TextInputUnstableV2Interface::Private::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_delete_surrounding_text(resource, beforeLength, afterLength); -} - -void TextInputUnstableV2Interface::Private::setCursorPosition(qint32 index, qint32 anchor) -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_cursor_position(resource, index, anchor); -} - -void TextInputUnstableV2Interface::Private::setTextDirection(Qt::LayoutDirection direction) -{ - if (!resource) { - return; - } - zwp_text_input_v2_text_direction wlDirection; - switch (direction) { - case Qt::LeftToRight: - wlDirection = ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_LTR; - break; - case Qt::RightToLeft: - wlDirection = ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_RTL; - break; - case Qt::LayoutDirectionAuto: - wlDirection = ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_AUTO; - break; - default: - Q_UNREACHABLE(); - break; - } - zwp_text_input_v2_send_text_direction(resource, wlDirection); -} - -void TextInputUnstableV2Interface::Private::setPreEditCursor(qint32 index) -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_preedit_cursor(resource, index); -} - -void TextInputUnstableV2Interface::Private::sendInputPanelState() -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_input_panel_state(resource, - inputPanelVisible ? ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_VISIBLE : ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_HIDDEN, - overlappedSurfaceArea.x(), overlappedSurfaceArea.y(), overlappedSurfaceArea.width(), overlappedSurfaceArea.height()); -} - -void TextInputUnstableV2Interface::Private::sendLanguage() -{ - if (!resource) { - return; - } - zwp_text_input_v2_send_language(resource, language.constData()); -} - -TextInputUnstableV2Interface::Private::Private(TextInputInterface *q, TextInputManagerUnstableV2Interface *c, wl_resource *parentResource) - : TextInputInterface::Private(q, c, parentResource, &zwp_text_input_v2_interface, &s_interface) -{ -} - -TextInputUnstableV2Interface::Private::~Private() = default; - -void TextInputUnstableV2Interface::Private::enableCallback(wl_client *client, wl_resource *resource, wl_resource *surface) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->enable(SurfaceInterface::get(surface)); -} - -void TextInputUnstableV2Interface::Private::disableCallback(wl_client *client, wl_resource *resource, wl_resource *surface) -{ - Q_UNUSED(surface) - auto p = cast(resource); - Q_ASSERT(*p->client == client); - p->disable(); -} - -void TextInputUnstableV2Interface::Private::updateStateCallback(wl_client *client, wl_resource *resource, uint32_t serial, uint32_t reason) -{ - auto p = cast(resource); - Q_ASSERT(*p->client == client); - Q_UNUSED(serial) - // TODO: use other reason values reason - if (reason == ZWP_TEXT_INPUT_V2_UPDATE_STATE_RESET) { - emit p->q_func()->requestReset(); - } -} - -TextInputInterface::ContentHints TextInputUnstableV2Interface::Private::convertContentHint(uint32_t hint) const -{ - const auto hints = zwp_text_input_v2_content_hint(hint); - TextInputInterface::ContentHints ret = TextInputInterface::ContentHint::None; - - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_COMPLETION) { - ret |= TextInputInterface::ContentHint::AutoCompletion; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CORRECTION) { - ret |= TextInputInterface::ContentHint::AutoCorrection; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CAPITALIZATION) { - ret |= TextInputInterface::ContentHint::AutoCapitalization; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_LOWERCASE) { - ret |= TextInputInterface::ContentHint::LowerCase; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_UPPERCASE) { - ret |= TextInputInterface::ContentHint::UpperCase; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_TITLECASE) { - ret |= TextInputInterface::ContentHint::TitleCase; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_HIDDEN_TEXT) { - ret |= TextInputInterface::ContentHint::HiddenText; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_SENSITIVE_DATA) { - ret |= TextInputInterface::ContentHint::SensitiveData; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_LATIN) { - ret |= TextInputInterface::ContentHint::Latin; - } - if (hints & ZWP_TEXT_INPUT_V2_CONTENT_HINT_MULTILINE) { - ret |= TextInputInterface::ContentHint::MultiLine; - } - return ret; -} - -TextInputInterface::ContentPurpose TextInputUnstableV2Interface::Private::convertContentPurpose(uint32_t purpose) const -{ - const auto wlPurpose = zwp_text_input_v2_content_purpose(purpose); - - switch (wlPurpose) { - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ALPHA: - return TextInputInterface::ContentPurpose::Alpha; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DIGITS: - return TextInputInterface::ContentPurpose::Digits; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NUMBER: - return TextInputInterface::ContentPurpose::Number; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PHONE: - return TextInputInterface::ContentPurpose::Phone; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_URL: - return TextInputInterface::ContentPurpose::Url; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_EMAIL: - return TextInputInterface::ContentPurpose::Email; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NAME: - return TextInputInterface::ContentPurpose::Name; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PASSWORD: - return TextInputInterface::ContentPurpose::Password; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATE: - return TextInputInterface::ContentPurpose::Date; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TIME: - return TextInputInterface::ContentPurpose::Time; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATETIME: - return TextInputInterface::ContentPurpose::DateTime; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TERMINAL: - return TextInputInterface::ContentPurpose::Terminal; - case ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NORMAL: - default: - return TextInputInterface::ContentPurpose::Normal; - } -} - -TextInputUnstableV2Interface::TextInputUnstableV2Interface(TextInputManagerUnstableV2Interface *parent, wl_resource *parentResource) - : TextInputInterface(new Private(this, parent, parentResource)) -{ -} - -TextInputUnstableV2Interface::~TextInputUnstableV2Interface() = default; - -class TextInputManagerUnstableV2Interface::Private : public TextInputManagerInterface::Private -{ -public: - Private(TextInputManagerUnstableV2Interface *q, Display *d); - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getTextInputCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * seat); - - TextInputManagerUnstableV2Interface *q; - static const struct zwp_text_input_manager_v2_interface s_interface; - static const quint32 s_version; -}; -const quint32 TextInputManagerUnstableV2Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_text_input_manager_v2_interface TextInputManagerUnstableV2Interface::Private::s_interface = { - destroyCallback, - getTextInputCallback -}; -#endif - -void TextInputManagerUnstableV2Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void TextInputManagerUnstableV2Interface::Private::getTextInputCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * seat) -{ - SeatInterface *s = SeatInterface::get(seat); - if (!s) { - // TODO: send error - return; - } - auto m = cast(resource); - auto *t = new TextInputUnstableV2Interface(m->q, resource); - t->d_func()->seat = s; - m->inputs << t; - QObject::connect(t, &QObject::destroyed, m->q, - [t, m] { - m->inputs.removeAll(t); - } - ); - t->d->create(m->display->getConnection(client), version, id); - s->d_func()->registerTextInput(t); -} - -TextInputManagerUnstableV2Interface::Private::Private(TextInputManagerUnstableV2Interface *q, Display *d) - : TextInputManagerInterface::Private(TextInputInterfaceVersion::UnstableV2, q, d, &zwp_text_input_manager_v2_interface, s_version) - , q(q) -{ -} - -void TextInputManagerUnstableV2Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_text_input_manager_v2_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? -} - -void TextInputManagerUnstableV2Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) - // TODO: implement? -} - -TextInputManagerUnstableV2Interface::TextInputManagerUnstableV2Interface(Display *display, QObject *parent) - : TextInputManagerInterface(new Private(this, display), parent) -{ -} - -TextInputManagerUnstableV2Interface::~TextInputManagerUnstableV2Interface() = default; - -} -} diff -Nru dwayland-5.57.0.23/src/server/textinput_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface.cpp --- dwayland-5.57.0.23/src/server/textinput_v2_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,564 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "display.h" +#include "seat_interface_p.h" +#include "surface_interface_p.h" +#include "textinput_v2_interface_p.h" + +namespace KWaylandServer +{ + +namespace +{ +const quint32 s_version = 1; + +// helpers +TextInputContentHints convertContentHint(uint32_t hint) +{ + const auto hints = zwp_text_input_v2_content_hint(hint); + TextInputContentHints ret = TextInputContentHint::None; + + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_auto_completion) { + ret |= TextInputContentHint::AutoCompletion; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_auto_correction) { + ret |= TextInputContentHint::AutoCorrection; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_auto_capitalization) { + ret |= TextInputContentHint::AutoCapitalization; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_lowercase) { + ret |= TextInputContentHint::LowerCase; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_uppercase) { + ret |= TextInputContentHint::UpperCase; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_titlecase) { + ret |= TextInputContentHint::TitleCase; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_hidden_text) { + ret |= TextInputContentHint::HiddenText; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_sensitive_data) { + ret |= TextInputContentHint::SensitiveData; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_latin) { + ret |= TextInputContentHint::Latin; + } + if (hints & QtWaylandServer::zwp_text_input_v2::content_hint_multiline) { + ret |= TextInputContentHint::MultiLine; + } + return ret; +} + +TextInputContentPurpose convertContentPurpose(uint32_t purpose) +{ + const auto wlPurpose = QtWaylandServer::zwp_text_input_v2::content_purpose(purpose); + + switch (wlPurpose) { + case QtWaylandServer::zwp_text_input_v2::content_purpose_alpha: + return TextInputContentPurpose::Alpha; + case QtWaylandServer::zwp_text_input_v2::content_purpose_digits: + return TextInputContentPurpose::Digits; + case QtWaylandServer::zwp_text_input_v2::content_purpose_number: + return TextInputContentPurpose::Number; + case QtWaylandServer::zwp_text_input_v2::content_purpose_phone: + return TextInputContentPurpose::Phone; + case QtWaylandServer::zwp_text_input_v2::content_purpose_url: + return TextInputContentPurpose::Url; + case QtWaylandServer::zwp_text_input_v2::content_purpose_email: + return TextInputContentPurpose::Email; + case QtWaylandServer::zwp_text_input_v2::content_purpose_name: + return TextInputContentPurpose::Name; + case QtWaylandServer::zwp_text_input_v2::content_purpose_password: + return TextInputContentPurpose::Password; + case QtWaylandServer::zwp_text_input_v2::content_purpose_date: + return TextInputContentPurpose::Date; + case QtWaylandServer::zwp_text_input_v2::content_purpose_time: + return TextInputContentPurpose::Time; + case QtWaylandServer::zwp_text_input_v2::content_purpose_datetime: + return TextInputContentPurpose::DateTime; + case QtWaylandServer::zwp_text_input_v2::content_purpose_terminal: + return TextInputContentPurpose::Terminal; + case QtWaylandServer::zwp_text_input_v2::content_purpose_normal: + return TextInputContentPurpose::Normal; + default: + return TextInputContentPurpose::Normal; + } +} + +class EnabledEmitter +{ +public: + EnabledEmitter(TextInputV2Interface *q) + : q(q) + , m_wasEnabled(q->isEnabled()) + { + } + ~EnabledEmitter() + { + if (m_wasEnabled != q->isEnabled()) { + Q_EMIT q->enabledChanged(); + } + } + +private: + TextInputV2Interface *q; + const bool m_wasEnabled; +}; + +} + +TextInputManagerV2InterfacePrivate::TextInputManagerV2InterfacePrivate(TextInputManagerV2Interface *_q, Display *display) + : QtWaylandServer::zwp_text_input_manager_v2(*display, s_version) + , q(_q) +{ +} + +void TextInputManagerV2InterfacePrivate::zwp_text_input_manager_v2_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void TextInputManagerV2InterfacePrivate::zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) +{ + SeatInterface *s = SeatInterface::get(seat); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid seat"); + return; + } + + TextInputV2InterfacePrivate *textInputPrivate = TextInputV2InterfacePrivate::get(s->textInputV2()); + auto *textInputResource = textInputPrivate->add(resource->client(), id, resource->version()); + // Send enter to this new text input object if the surface is already focused. + const quint32 serial = s->display()->nextSerial(); + if (textInputPrivate->surface && textInputPrivate->surface->client()->client() == resource->client()) { + textInputPrivate->send_enter(textInputResource->handle, serial, textInputPrivate->surface->resource()); + } +} + +TextInputManagerV2Interface::TextInputManagerV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new TextInputManagerV2InterfacePrivate(this, display)) +{ +} + +TextInputManagerV2Interface::~TextInputManagerV2Interface() = default; + +void TextInputV2InterfacePrivate::sendEnter(SurfaceInterface *newSurface, quint32 serial) +{ + EnabledEmitter emitter(q); + // It should be always synchronized with SeatInterface::focusedTextInputSurface. + Q_ASSERT(!surface && newSurface); + surface = newSurface; + const auto clientResources = textInputsForClient(newSurface->client()); + for (auto resource : clientResources) { + send_enter(resource->handle, serial, newSurface->resource()); + } +} + +void TextInputV2InterfacePrivate::sendLeave(quint32 serial, SurfaceInterface *leavingSurface) +{ + // It should be always synchronized with SeatInterface::focusedTextInputSurface. + Q_ASSERT(leavingSurface && surface == leavingSurface); + EnabledEmitter emitter(q); + surface.clear(); + const auto clientResources = textInputsForClient(leavingSurface->client()); + for (auto resource : clientResources) { + send_leave(resource->handle, serial, leavingSurface->resource()); + } +} + +void TextInputV2InterfacePrivate::preEdit(const QString &text, const QString &commit) +{ + if (!surface) { + return; + } + + const auto clientResources = textInputsForClient(surface->client()); + for (auto resource : clientResources) { + send_preedit_string(resource->handle, text, commit); + } +} + +void TextInputV2InterfacePrivate::preEditStyling(uint32_t index, uint32_t length, uint32_t style) +{ + if (!surface) { + return; + } + + const auto clientResources = textInputsForClient(surface->client()); + for (auto resource : clientResources) { + send_preedit_styling(resource->handle, index, length, style); + } +} + +void TextInputV2InterfacePrivate::commitString(const QString &text) +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_commit_string(resource->handle, text); + } +} + +void TextInputV2InterfacePrivate::keysymPressed(quint32 keysym, quint32 modifiers) +{ + if (!surface) { + return; + } + + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_PRESSED, modifiers); + } +} + +void TextInputV2InterfacePrivate::keysymReleased(quint32 keysym, quint32 modifiers) +{ + if (!surface) { + return; + } + + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_RELEASED, modifiers); + } +} + +void TextInputV2InterfacePrivate::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_delete_surrounding_text(resource->handle, beforeLength, afterLength); + } +} + +void TextInputV2InterfacePrivate::setCursorPosition(qint32 index, qint32 anchor) +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_cursor_position(resource->handle, index, anchor); + } +} + +void TextInputV2InterfacePrivate::setTextDirection(Qt::LayoutDirection direction) +{ + if (!surface) { + return; + } + text_direction wlDirection; + switch (direction) { + case Qt::LeftToRight: + wlDirection = text_direction::text_direction_ltr; + break; + case Qt::RightToLeft: + wlDirection = text_direction::text_direction_rtl; + break; + case Qt::LayoutDirectionAuto: + wlDirection = text_direction::text_direction_auto; + break; + default: + Q_UNREACHABLE(); + break; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_text_direction(resource->handle, wlDirection); + } +} + +void TextInputV2InterfacePrivate::setPreEditCursor(qint32 index) +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_preedit_cursor(resource->handle, index); + } +} + +void TextInputV2InterfacePrivate::sendInputPanelState() +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_input_panel_state(resource->handle, + inputPanelVisible ? ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_VISIBLE : ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_HIDDEN, + overlappedSurfaceArea.x(), + overlappedSurfaceArea.y(), + overlappedSurfaceArea.width(), + overlappedSurfaceArea.height()); + } +} + +void TextInputV2InterfacePrivate::sendLanguage() +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_language(resource->handle, language); + } +} + +void TextInputV2InterfacePrivate::sendModifiersMap() +{ + if (!surface) { + return; + } + const QList textInputs = textInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_modifiers_map(resource->handle, modifiersMap); + } +} + +TextInputV2InterfacePrivate::TextInputV2InterfacePrivate(SeatInterface *seat, TextInputV2Interface *_q) + : seat(seat) + , q(_q) +{ +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_enable(Resource *resource, wl_resource *s) +{ + Q_UNUSED(resource) + EnabledEmitter emitter(q); + auto enabledSurface = SurfaceInterface::get(s); + if (m_enabledSurfaces.contains(enabledSurface)) { + return; + } + m_enabledSurfaces.insert(enabledSurface); + QObject::connect(enabledSurface, &SurfaceInterface::aboutToBeDestroyed, q, [this, enabledSurface] { + EnabledEmitter emitter(q); + m_enabledSurfaces.remove(enabledSurface); + }); +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_disable(Resource *resource, wl_resource *s) +{ + Q_UNUSED(resource) + EnabledEmitter emitter(q); + auto disabledSurface = SurfaceInterface::get(s); + QObject::disconnect(disabledSurface, &SurfaceInterface::aboutToBeDestroyed, q, nullptr); + m_enabledSurfaces.remove(disabledSurface); + if (disabledSurface == surface) { + q->setInputPanelState(false, {0, 0, 0, 0}); + } +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t reason) +{ + Q_UNUSED(resource) + Q_EMIT q->stateUpdated(serial, TextInputV2Interface::UpdateReason(reason)); +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_hide_input_panel(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->requestHideInputPanel(); +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) +{ + Q_UNUSED(resource) + surroundingText = text; + surroundingTextCursorPosition = cursor; + surroundingTextSelectionAnchor = anchor; + Q_EMIT q->surroundingTextChanged(); +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) +{ + Q_UNUSED(resource) + const auto contentHints = convertContentHint(hint); + const auto contentPurpose = convertContentPurpose(purpose); + if (this->contentHints != contentHints || this->contentPurpose != contentPurpose) { + this->contentHints = contentHints; + this->contentPurpose = contentPurpose; + Q_EMIT q->contentTypeChanged(); + } +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +{ + Q_UNUSED(resource) + const QRect rect = QRect(x, y, width, height); + if (cursorRectangle != rect) { + cursorRectangle = rect; + Q_EMIT q->cursorRectangleChanged(cursorRectangle); + } +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) +{ + Q_UNUSED(resource) + if (preferredLanguage != language) { + preferredLanguage = language; + Q_EMIT q->preferredLanguageChanged(preferredLanguage); + } +} + +void TextInputV2InterfacePrivate::zwp_text_input_v2_show_input_panel(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->requestShowInputPanel(); +} + +QList TextInputV2InterfacePrivate::textInputsForClient(ClientConnection *client) const +{ + return resourceMap().values(client->client()); +} + +TextInputV2Interface::TextInputV2Interface(SeatInterface *seat) + : QObject(seat) + , d(new TextInputV2InterfacePrivate(seat, this)) +{ +} + +TextInputV2Interface::~TextInputV2Interface() = default; + +QString TextInputV2Interface::preferredLanguage() const +{ + return d->preferredLanguage; +} + +TextInputContentHints TextInputV2Interface::contentHints() const +{ + return d->contentHints; +} + +TextInputContentPurpose KWaylandServer::TextInputV2Interface::contentPurpose() const +{ + return d->contentPurpose; +} + +QString TextInputV2Interface::surroundingText() const +{ + return d->surroundingText; +} + +qint32 TextInputV2Interface::surroundingTextCursorPosition() const +{ + return d->surroundingTextCursorPosition; +} + +qint32 TextInputV2Interface::surroundingTextSelectionAnchor() const +{ + return d->surroundingTextSelectionAnchor; +} + +void TextInputV2Interface::preEdit(const QString &text, const QString &commit) +{ + d->preEdit(text, commit); +} + +void TextInputV2Interface::preEditStyling(uint32_t index, uint32_t length, uint32_t style) +{ + d->preEditStyling(index, length, style); +} + +void TextInputV2Interface::commitString(const QString &text) +{ + d->commitString(text); +} + +void TextInputV2Interface::keysymPressed(quint32 keysym, quint32 modifiers) +{ + d->keysymPressed(keysym, modifiers); +} + +void TextInputV2Interface::keysymReleased(quint32 keysym, quint32 modifiers) +{ + d->keysymReleased(keysym, modifiers); +} + +void TextInputV2Interface::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) +{ + d->deleteSurroundingText(beforeLength, afterLength); +} + +void TextInputV2Interface::setCursorPosition(qint32 index, qint32 anchor) +{ + d->setCursorPosition(index, anchor); +} + +void TextInputV2Interface::setTextDirection(Qt::LayoutDirection direction) +{ + d->setTextDirection(direction); +} + +void TextInputV2Interface::setPreEditCursor(qint32 index) +{ + d->setPreEditCursor(index); +} + +void TextInputV2Interface::setInputPanelState(bool visible, const QRect &overlappedSurfaceArea) +{ + if (d->inputPanelVisible == visible && d->overlappedSurfaceArea == overlappedSurfaceArea) { + // not changed + return; + } + d->inputPanelVisible = visible; + d->overlappedSurfaceArea = overlappedSurfaceArea; + d->sendInputPanelState(); +} + +void TextInputV2Interface::setLanguage(const QString &languageTag) +{ + if (d->language == languageTag) { + // not changed + return; + } + d->language = languageTag; + d->sendLanguage(); +} + +void TextInputV2Interface::setModifiersMap(const QByteArray &modifiersMap) +{ + if (d->modifiersMap == modifiersMap) { + // not changed + return; + } + d->modifiersMap = modifiersMap; + d->sendModifiersMap(); +} + +QPointer TextInputV2Interface::surface() const +{ + if (!d->surface) { + return nullptr; + } + + if (!d->resourceMap().contains(d->surface->client()->client())) { + return nullptr; + } + + return d->surface; +} + +QRect TextInputV2Interface::cursorRectangle() const +{ + return d->cursorRectangle; +} + +bool TextInputV2Interface::isEnabled() const +{ + return d->surface && d->m_enabledSurfaces.contains(d->surface); +} + +} diff -Nru dwayland-5.57.0.23/src/server/textinput_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface.h --- dwayland-5.57.0.23/src/server/textinput_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,288 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +#include "textinput.h" + +struct wl_resource; +namespace KWaylandServer +{ +class Display; +class SeatInterface; +class SurfaceInterface; +class TextInputV2Interface; +class TextInputV2InterfacePrivate; +class TextInputManagerV2InterfacePrivate; + +/** + * @brief Represent the Global for the interface. + * + * The class can represent different interfaces. Which concrete interface is represented + * can be determined through {@link interfaceVersion}. + * + * To create a TextInputManagerV2Interface use {@link Display::createTextInputManager} + */ +class KWAYLANDSERVER_EXPORT TextInputManagerV2Interface : public QObject +{ + Q_OBJECT +public: + explicit TextInputManagerV2Interface(Display *display, QObject *parent = nullptr); + ~TextInputManagerV2Interface() override; + +private: + QScopedPointer d; +}; + +/** + * @brief Represents a generic Resource for a text input object. + * + * This class does not directly correspond to a Wayland resource, but is a generic contract + * for any interface which implements a text input, e.g. the unstable wl_text_input interface. + * + * It does not expose the actual interface to cover up the fact that the interface is unstable + * and might change. If one needs to know the actual used protocol, use the method {@link interfaceVersion}. + * + * A TextInputV2Interface gets created by the {@link TextInputManagerV2Interface}. The individual + * instances are not exposed directly. The SeatInterface provides access to the currently active + * TextInputV2Interface. This is evaluated automatically based on which SurfaceInterface has + * keyboard focus. + * + * @see TextInputManagerV2Interface + * @see SeatInterface + */ +class KWAYLANDSERVER_EXPORT TextInputV2Interface : public QObject +{ + Q_OBJECT +public: + ~TextInputV2Interface() override; + + enum class UpdateReason : uint32_t { + StateChange = 0, // updated state because it changed + StateFull = 1, // full state after enter or input_method_changed event + StateReset = 2, // full state after reset + StateEnter = 3, // full state after switching focus to a different widget on client side + }; + Q_ENUM(UpdateReason); + /** + * The preferred language as a RFC-3066 format language tag. + * + * This can be used by the server to show a language specific virtual keyboard layout. + * @see preferredLanguageChanged + */ + QString preferredLanguage() const; + + /** + * @see cursorRectangleChanged + */ + QRect cursorRectangle() const; + + /** + * @see contentTypeChanged + */ + TextInputContentPurpose contentPurpose() const; + + /** + *@see contentTypeChanged + */ + TextInputContentHints contentHints() const; + + /** + * @returns The plain surrounding text around the input position. + * @see surroundingTextChanged + * @see surroundingTextCursorPosition + * @see surroundingTextSelectionAnchor + */ + QString surroundingText() const; + /** + * @returns The byte offset of current cursor position within the {@link surroundingText} + * @see surroundingText + * @see surroundingTextChanged + */ + qint32 surroundingTextCursorPosition() const; + /** + * The byte offset of the selection anchor within the {@link surroundingText}. + * + * If there is no selected text this is the same as cursor. + * @return The byte offset of the selection anchor + * @see surroundingText + * @see surroundingTextChanged + */ + qint32 surroundingTextSelectionAnchor() const; + + /** + * @return The surface the TextInputV2Interface is enabled on + * @see isEnabled + * @see enabledChanged + */ + QPointer surface() const; + + /** + * @return Whether the TextInputV2Interface is currently enabled for a SurfaceInterface. + * @see surface + * @see enabledChanged + */ + bool isEnabled() const; + + /** + * Notify when a new composing @p text (pre-edit) should be set around the + * current cursor position. Any previously set composing text should + * be removed. + * + * The @p commitText can be used to replace the preedit text on reset + * (for example on unfocus). + * + * @param text The new utf8-encoded pre-edit text + * @param commitText Utf8-encoded text to replace preedit text on reset + * @see commit + * @see preEditCursor + */ + void preEdit(const QString &text, const QString &commitText); + + /** + * Notify when @p text should be inserted into the editor widget. + * The text to commit could be either just a single character after a key press or the + * result of some composing ({@link preEdit}). It could be also an empty text + * when some text should be removed (see {@link deleteSurroundingText}) or when + * the input cursor should be moved (see {@link cursorPosition}). + * + * Any previously set composing text should be removed. + * @param text The utf8-encoded text to be inserted into the editor widget + * @see preEdit + * @see deleteSurroundingText + */ + void commitString(const QString &text); + + /** + * Sets the cursor position inside the composing text (as byte offset) relative to the + * start of the composing text. When @p index is a negative number no cursor is shown. + * + * The Client applies the @p index together with {@link preEdit}. + * @param index The cursor position relative to the start of the composing text + * @see preEdit + */ + void setPreEditCursor(qint32 index); + + /** + * Sets the style for a range of text for the composing text (as byte offset). + * + * The Client applies the @p index together with {@link preEdit}. + * @param index The position relative to the start of the composing text + * @param length The length of the style to apply on + * @param style style flag + * @see preEdit + */ + void preEditStyling(uint32_t index, uint32_t length, uint32_t style); + + /** + * Notify when the text around the current cursor position should be deleted. + * + * The Client processes this event together with the commit string + * + * @param beforeLength length of text before current cursor position. + * @param afterLength length of text after current cursor position. + * @see commit + */ + void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); + + /** + * Notify when the cursor @p index or @p anchor position should be modified. + * + * The Client applies this together with the commit string. + */ + void setCursorPosition(qint32 index, qint32 anchor); + + /** + * Sets the text @p direction of input text. + */ + void setTextDirection(Qt::LayoutDirection direction); + + void keysymPressed(quint32 keysym, quint32 modifiers = 0); + void keysymReleased(quint32 keysym, quint32 modifiers = 0); + + /** + * Informs the client about changes in the visibility of the input panel (virtual keyboard). + * + * The @p overlappedSurfaceArea defines the area overlapped by the input panel (virtual keyboard) + * on the SurfaceInterface having the text focus in surface local coordinates. + * + * @param visible Whether the input panel is currently visible + * @param overlappedSurfaceArea The overlapping area in surface local coordinates + */ + void setInputPanelState(bool visible, const QRect &overlappedSurfaceArea); + + /** + * Sets the language of the input text. The @p languageTag is a RFC-3066 format language tag. + */ + void setLanguage(const QString &languageTag); + + /** + * Sets the modifiers map to use when modifiers are included in a key event. + */ + void setModifiersMap(const QByteArray &modifiersMap); + +Q_SIGNALS: + /** + * Requests input panels (virtual keyboard) to show. + * @see requestHideInputPanel + */ + void requestShowInputPanel(); + /** + * Requests input panels (virtual keyboard) to hide. + * @see requestShowInputPanel + */ + void requestHideInputPanel(); + /** + * Emitted whenever the preferred @p language changes. + * @see preferredLanguage + */ + void preferredLanguageChanged(const QString &language); + /** + * @see cursorRectangle + */ + void cursorRectangleChanged(const QRect &rect); + /** + * Emitted when the {@link contentPurpose} and/or {@link contentHints} changes. + * @see contentPurpose + * @see contentHints + */ + void contentTypeChanged(); + /** + * Emitted when the {@link surroundingText}, {@link surroundingTextCursorPosition} + * and/or {@link surroundingTextSelectionAnchor} changed. + * @see surroundingText + * @see surroundingTextCursorPosition + * @see surroundingTextSelectionAnchor + */ + void surroundingTextChanged(); + /** + * Emitted whenever this TextInputV2Interface gets enabled or disabled for a SurfaceInterface. + * @see isEnabled + * @see surface + */ + void enabledChanged(); + /** + * Emitted whenever TextInputInterface should update the current state. + */ + void stateUpdated(uint32_t serial, UpdateReason reason); + +private: + friend class TextInputManagerV2InterfacePrivate; + friend class SeatInterface; + friend class SeatInterfacePrivate; + friend class TextInputV2InterfacePrivate; + explicit TextInputV2Interface(SeatInterface *seat); + + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::TextInputV2Interface *) +Q_DECLARE_METATYPE(KWaylandServer::TextInputV2Interface::UpdateReason) diff -Nru dwayland-5.57.0.23/src/server/textinput_v2_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface_p.h --- dwayland-5.57.0.23/src/server/textinput_v2_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v2_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,86 @@ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "clientconnection.h" +#include "textinput_v2_interface.h" + +#include +#include +#include +#include + +#include + +namespace KWaylandServer +{ +class TextInputManagerV2InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v2 +{ +public: + TextInputManagerV2InterfacePrivate(TextInputManagerV2Interface *_q, Display *display); + + TextInputManagerV2Interface *q; + +protected: + void zwp_text_input_manager_v2_destroy(Resource *resource) override; + void zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) override; +}; + +class TextInputV2InterfacePrivate : public QtWaylandServer::zwp_text_input_v2 +{ +public: + TextInputV2InterfacePrivate(SeatInterface *seat, TextInputV2Interface *_q); + + void sendEnter(SurfaceInterface *surface, quint32 serial); + void sendLeave(quint32 serial, SurfaceInterface *surface); + void preEdit(const QString &text, const QString &commit); + void preEditStyling(uint32_t index, uint32_t length, uint32_t style); + void commitString(const QString &text); + void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); + void setTextDirection(Qt::LayoutDirection direction); + void setPreEditCursor(qint32 index); + void setCursorPosition(qint32 index, qint32 anchor); + void keysymPressed(quint32 keysym, quint32 modifiers); + void keysymReleased(quint32 keysym, quint32 modifiers); + void sendInputPanelState(); + void sendLanguage(); + void sendModifiersMap(); + + QList textInputsForClient(ClientConnection *client) const; + static TextInputV2InterfacePrivate *get(TextInputV2Interface *inputInterface) + { + return inputInterface->d.data(); + } + + QString preferredLanguage; + QRect cursorRectangle; + TextInputContentHints contentHints = TextInputContentHint::None; + TextInputContentPurpose contentPurpose = TextInputContentPurpose::Normal; + SeatInterface *seat = nullptr; + QPointer surface; + QString surroundingText; + qint32 surroundingTextCursorPosition = 0; + qint32 surroundingTextSelectionAnchor = 0; + bool inputPanelVisible = false; + QRect overlappedSurfaceArea; + QString language; + QByteArray modifiersMap; + TextInputV2Interface *q; + QSet m_enabledSurfaces; + +protected: + void zwp_text_input_v2_enable(Resource *resource, wl_resource *surface) override; + void zwp_text_input_v2_disable(Resource *resource, wl_resource *surface) override; + void zwp_text_input_v2_show_input_panel(Resource *resource) override; + void zwp_text_input_v2_hide_input_panel(Resource *resource) override; + void zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override; + void zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override; + void zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) override; + void zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t reason) override; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/textinput_v3_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface.cpp --- dwayland-5.57.0.23/src/server/textinput_v3_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,470 @@ +/* + SPDX-FileCopyrightText: 2020 Bhushan Shah + SPDX-FileCopyrightText: 2018 Roman Glig + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "display.h" +#include "seat_interface.h" +#include "surface_interface_p.h" +#include "textinput_v3_interface_p.h" + +namespace KWaylandServer +{ +namespace +{ +const quint32 s_version = 1; + +TextInputContentHints convertContentHint(uint32_t hint) +{ + const auto hints = zwp_text_input_v3_content_hint(hint); + TextInputContentHints ret = TextInputContentHint::None; + + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_completion) { + ret |= TextInputContentHint::AutoCompletion; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_auto_capitalization) { + ret |= TextInputContentHint::AutoCapitalization; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_lowercase) { + ret |= TextInputContentHint::LowerCase; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_uppercase) { + ret |= TextInputContentHint::UpperCase; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_titlecase) { + ret |= TextInputContentHint::TitleCase; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_hidden_text) { + ret |= TextInputContentHint::HiddenText; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_sensitive_data) { + ret |= TextInputContentHint::SensitiveData; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_latin) { + ret |= TextInputContentHint::Latin; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_multiline) { + ret |= TextInputContentHint::MultiLine; + } + if (hints & QtWaylandServer::zwp_text_input_v3::content_hint_spellcheck) { + ret |= TextInputContentHint::AutoCorrection; + } + return ret; +} + +TextInputContentPurpose convertContentPurpose(uint32_t purpose) +{ + const auto wlPurpose = QtWaylandServer::zwp_text_input_v3::content_purpose(purpose); + + switch (wlPurpose) { + case QtWaylandServer::zwp_text_input_v3::content_purpose_alpha: + return TextInputContentPurpose::Alpha; + case QtWaylandServer::zwp_text_input_v3::content_purpose_digits: + return TextInputContentPurpose::Digits; + case QtWaylandServer::zwp_text_input_v3::content_purpose_number: + return TextInputContentPurpose::Number; + case QtWaylandServer::zwp_text_input_v3::content_purpose_phone: + return TextInputContentPurpose::Phone; + case QtWaylandServer::zwp_text_input_v3::content_purpose_url: + return TextInputContentPurpose::Url; + case QtWaylandServer::zwp_text_input_v3::content_purpose_email: + return TextInputContentPurpose::Email; + case QtWaylandServer::zwp_text_input_v3::content_purpose_name: + return TextInputContentPurpose::Name; + case QtWaylandServer::zwp_text_input_v3::content_purpose_password: + return TextInputContentPurpose::Password; + case QtWaylandServer::zwp_text_input_v3::content_purpose_pin: + return TextInputContentPurpose::Pin; + case QtWaylandServer::zwp_text_input_v3::content_purpose_date: + return TextInputContentPurpose::Date; + case QtWaylandServer::zwp_text_input_v3::content_purpose_time: + return TextInputContentPurpose::Time; + case QtWaylandServer::zwp_text_input_v3::content_purpose_datetime: + return TextInputContentPurpose::DateTime; + case QtWaylandServer::zwp_text_input_v3::content_purpose_terminal: + return TextInputContentPurpose::Terminal; + case QtWaylandServer::zwp_text_input_v3::content_purpose_normal: + return TextInputContentPurpose::Normal; + default: + return TextInputContentPurpose::Normal; + } +} + +TextInputChangeCause convertChangeCause(uint32_t cause) +{ + const auto wlCause = QtWaylandServer::zwp_text_input_v3::change_cause(cause); + switch (wlCause) { + case QtWaylandServer::zwp_text_input_v3::change_cause_input_method: + return TextInputChangeCause::InputMethod; + case QtWaylandServer::zwp_text_input_v3::change_cause_other: + default: + return TextInputChangeCause::Other; + } +} + +class EnabledEmitter +{ +public: + EnabledEmitter(TextInputV3Interface *q) + : q(q) + , m_wasEnabled(q->isEnabled()) + { + } + ~EnabledEmitter() + { + if (m_wasEnabled != q->isEnabled()) { + Q_EMIT q->enabledChanged(); + } + } + +private: + TextInputV3Interface *q; + const bool m_wasEnabled; +}; + +} + +TextInputManagerV3InterfacePrivate::TextInputManagerV3InterfacePrivate(TextInputManagerV3Interface *_q, Display *display) + : QtWaylandServer::zwp_text_input_manager_v3(*display, s_version) + , q(_q) +{ +} + +void TextInputManagerV3InterfacePrivate::zwp_text_input_manager_v3_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void TextInputManagerV3InterfacePrivate::zwp_text_input_manager_v3_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) +{ + SeatInterface *s = SeatInterface::get(seat); + if (!s) { + wl_resource_post_error(resource->handle, 0, "Invalid seat"); + return; + } + TextInputV3InterfacePrivate *textInputPrivate = TextInputV3InterfacePrivate::get(s->textInputV3()); + auto *textInputResource = textInputPrivate->add(resource->client(), id, resource->version()); + // Send enter to this new text input object if the surface is already focused. + if (textInputPrivate->surface && textInputPrivate->surface->client()->client() == resource->client()) { + textInputPrivate->send_enter(textInputResource->handle, textInputPrivate->surface->resource()); + } +} + +TextInputManagerV3Interface::TextInputManagerV3Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new TextInputManagerV3InterfacePrivate(this, display)) +{ +} + +TextInputManagerV3Interface::~TextInputManagerV3Interface() = default; + +TextInputV3InterfacePrivate::TextInputV3InterfacePrivate(SeatInterface *seat, TextInputV3Interface *_q) + : seat(seat) + , q(_q) +{ +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_bind_resource(Resource *resource) +{ + // we initialize the serial for the resource to be 0 + serialHash.insert(resource, 0); + enabled.insert(resource, false); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_destroy(Resource *resource) +{ + // drop resource from the serial hash + serialHash.remove(resource); + enabled.remove(resource); +} + +void TextInputV3InterfacePrivate::sendEnter(SurfaceInterface *newSurface) +{ + EnabledEmitter emitter(q); + // It should be always synchronized with SeatInterface::focusedTextInputSurface. + Q_ASSERT(!surface && newSurface); + surface = newSurface; + const auto clientResources = textInputsForClient(newSurface->client()); + for (auto resource : clientResources) { + send_enter(resource->handle, newSurface->resource()); + } +} + +void TextInputV3InterfacePrivate::sendLeave(SurfaceInterface *leavingSurface) +{ + EnabledEmitter emitter(q); + // It should be always synchronized with SeatInterface::focusedTextInputSurface. + Q_ASSERT(leavingSurface && surface == leavingSurface); + surface.clear(); + const auto clientResources = textInputsForClient(leavingSurface->client()); + for (auto resource : clientResources) { + send_leave(resource->handle, leavingSurface->resource()); + } +} + +void TextInputV3InterfacePrivate::sendPreEdit(const QString &text, const quint32 cursorBegin, const quint32 cursorEnd) +{ + if (!surface) { + return; + } + const QList textInputs = enabledTextInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_preedit_string(resource->handle, text, cursorBegin, cursorEnd); + } +} + +void TextInputV3InterfacePrivate::commitString(const QString &text) +{ + if (!surface) { + return; + } + const QList textInputs = enabledTextInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_commit_string(resource->handle, text); + } +} + +void TextInputV3InterfacePrivate::deleteSurroundingText(quint32 before, quint32 after) +{ + if (!surface) { + return; + } + const QList textInputs = enabledTextInputsForClient(surface->client()); + for (auto resource : textInputs) { + send_delete_surrounding_text(resource->handle, before, after); + } +} + +void TextInputV3InterfacePrivate::done() +{ + if (!surface) { + return; + } + const QList textInputs = enabledTextInputsForClient(surface->client()); + + for (auto resource : textInputs) { + // zwp_text_input_v3.done takes the serial argument which is equal to number of commit requests issued + send_done(resource->handle, serialHash[resource]); + } +} + +QList TextInputV3InterfacePrivate::textInputsForClient(ClientConnection *client) const +{ + return resourceMap().values(client->client()); +} + +QList TextInputV3InterfacePrivate::enabledTextInputsForClient(ClientConnection *client) const +{ + QList result; + const auto [start, end] = resourceMap().equal_range(client->client()); + for (auto it = start; it != end; ++it) { + if (enabled[*it]) { + result.append(*it); + } + } + return result; +} + +bool TextInputV3InterfacePrivate::isEnabled() const +{ + if (!surface) { + return false; + } + const auto clientResources = textInputsForClient(surface->client()); + return std::any_of(clientResources.begin(), clientResources.end(), [this](Resource *resource) { + return enabled[resource]; + }); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_enable(Resource *resource) +{ + // reset pending state to default + Q_UNUSED(resource) + defaultPending(); + pending.enabled = true; +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_disable(Resource *resource) +{ + // reset pending state to default + Q_UNUSED(resource) + defaultPending(); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) +{ + Q_UNUSED(resource) + // zwp_text_input_v3_set_surrounding_text is no-op if enabled request is not pending + if (!pending.enabled) { + return; + } + pending.surroundingText = text; + pending.surroundingTextCursorPosition = cursor; + pending.surroundingTextSelectionAnchor = anchor; +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) +{ + Q_UNUSED(resource) + // zwp_text_input_v3_set_content_type is no-op if enabled request is not pending + if (!pending.enabled) { + return; + } + pending.contentHints = convertContentHint(hint); + pending.contentPurpose = convertContentPurpose(purpose); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +{ + Q_UNUSED(resource) + // zwp_text_input_v3_set_cursor_rectangle is no-op if enabled request is not pending + if (!pending.enabled) { + return; + } + pending.cursorRectangle = QRect(x, y, width, height); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_set_text_change_cause(Resource *resource, uint32_t cause) +{ + Q_UNUSED(resource) + // zwp_text_input_v3_set_text_change_cause is no-op if enabled request is not pending + if (!pending.enabled) { + return; + } + pending.surroundingTextChangeCause = convertChangeCause(cause); +} + +void TextInputV3InterfacePrivate::zwp_text_input_v3_commit(Resource *resource) +{ + EnabledEmitter emitter(q); + serialHash[resource]++; + + auto &resourceEnabled = enabled[resource]; + if (resourceEnabled != pending.enabled) { + resourceEnabled = pending.enabled; + } + + if (surroundingTextChangeCause != pending.surroundingTextChangeCause) { + surroundingTextChangeCause = pending.surroundingTextChangeCause; + pending.surroundingTextChangeCause = TextInputChangeCause::InputMethod; + } + + if (contentHints != pending.contentHints || contentPurpose != pending.contentPurpose) { + contentHints = pending.contentHints; + contentPurpose = pending.contentPurpose; + if (resourceEnabled) { + Q_EMIT q->contentTypeChanged(); + } + } + + if (cursorRectangle != pending.cursorRectangle) { + cursorRectangle = pending.cursorRectangle; + if (resourceEnabled) { + Q_EMIT q->cursorRectangleChanged(cursorRectangle); + } + } + + if (surroundingText != pending.surroundingText || surroundingTextCursorPosition != pending.surroundingTextCursorPosition + || surroundingTextSelectionAnchor != pending.surroundingTextSelectionAnchor) { + surroundingText = pending.surroundingText; + surroundingTextCursorPosition = pending.surroundingTextCursorPosition; + surroundingTextSelectionAnchor = pending.surroundingTextSelectionAnchor; + if (resourceEnabled) { + Q_EMIT q->surroundingTextChanged(); + } + } + + Q_EMIT q->stateCommitted(serialHash[resource]); +} + +void TextInputV3InterfacePrivate::defaultPending() +{ + pending.cursorRectangle = QRect(); + pending.surroundingTextChangeCause = TextInputChangeCause::InputMethod; + pending.contentHints = TextInputContentHints(TextInputContentHint::None); + pending.contentPurpose = TextInputContentPurpose::Normal; + pending.enabled = false; + pending.surroundingText = QString(); + pending.surroundingTextCursorPosition = 0; + pending.surroundingTextSelectionAnchor = 0; +} + +TextInputV3Interface::TextInputV3Interface(SeatInterface *seat) + : QObject(seat) + , d(new TextInputV3InterfacePrivate(seat, this)) +{ +} + +TextInputV3Interface::~TextInputV3Interface() = default; + +TextInputContentHints TextInputV3Interface::contentHints() const +{ + return d->contentHints; +} + +TextInputContentPurpose TextInputV3Interface::contentPurpose() const +{ + return d->contentPurpose; +} + +QString TextInputV3Interface::surroundingText() const +{ + return d->surroundingText; +} + +qint32 TextInputV3Interface::surroundingTextCursorPosition() const +{ + return d->surroundingTextCursorPosition; +} + +qint32 TextInputV3Interface::surroundingTextSelectionAnchor() const +{ + return d->surroundingTextSelectionAnchor; +} + +void TextInputV3Interface::deleteSurroundingText(quint32 beforeLength, quint32 afterLength) +{ + d->deleteSurroundingText(beforeLength, afterLength); +} + +void TextInputV3Interface::sendPreEditString(const QString &text, quint32 cursorBegin, quint32 cursorEnd) +{ + d->sendPreEdit(text, cursorBegin, cursorEnd); +} + +void TextInputV3Interface::commitString(const QString &text) +{ + d->commitString(text); +} + +void TextInputV3Interface::done() +{ + d->done(); +} + +QPointer TextInputV3Interface::surface() const +{ + if (!d->surface) { + return nullptr; + } + + if (!d->resourceMap().contains(d->surface->client()->client())) { + return nullptr; + } + + return d->surface; +} + +QRect TextInputV3Interface::cursorRectangle() const +{ + return d->cursorRectangle; +} + +bool TextInputV3Interface::isEnabled() const +{ + return d->isEnabled(); +} + +} diff -Nru dwayland-5.57.0.23/src/server/textinput_v3_interface.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface.h --- dwayland-5.57.0.23/src/server/textinput_v3_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,198 @@ +/* + SPDX-FileCopyrightText: 2018 Roman Glig + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include "textinput.h" +#include + +struct wl_resource; +namespace KWaylandServer +{ +class Display; +class SeatInterface; +class SurfaceInterface; +class TextInputV3Interface; +class TextInputV3InterfacePrivate; +class TextInputManagerV3InterfacePrivate; + +/** + * @brief Represent the Global for the interface. + * + * The class can represent different interfaces. Which concrete interface is represented + * can be determined through {@link interfaceVersion}. + * + * To create a TextInputManagerV3Interface use {@link Display::createTextInputManager} + */ +class KWAYLANDSERVER_EXPORT TextInputManagerV3Interface : public QObject +{ + Q_OBJECT +public: + explicit TextInputManagerV3Interface(Display *display, QObject *parent = nullptr); + ~TextInputManagerV3Interface() override; + +private: + QScopedPointer d; +}; + +/** + * @brief Represents a generic Resource for a text input object. + * * + * A TextInputV3Interface gets created by the {@link TextInputManagerV3Interface}. The individual + * instances are not exposed directly. The SeatInterface provides access to the currently active + * TextInputV3Interface. This is evaluated automatically based on which SurfaceInterface has + * keyboard focus. + * + * @see TextInputManagerV3Interface + * @see SeatInterface + */ +class KWAYLANDSERVER_EXPORT TextInputV3Interface : public QObject +{ + Q_OBJECT +public: + ~TextInputV3Interface() override; + + /** + * @see cursorRectangleChanged + */ + QRect cursorRectangle() const; + + /** + * @see contentTypeChanged + */ + TextInputContentPurpose contentPurpose() const; + + /** + *@see contentTypeChanged + */ + TextInputContentHints contentHints() const; + + /** + * @returns The plain surrounding text around the input position. + * @see surroundingTextChanged + * @see surroundingTextCursorPosition + * @see surroundingTextSelectionAnchor + */ + QString surroundingText() const; + /** + * @returns The byte offset of current cursor position within the {@link surroundingText} + * @see surroundingText + * @see surroundingTextChanged + */ + qint32 surroundingTextCursorPosition() const; + /** + * The byte offset of the selection anchor within the {@link surroundingText}. + * + * If there is no selected text this is the same as cursor. + * @return The byte offset of the selection anchor + * @see surroundingText + * @see surroundingTextChanged + */ + qint32 surroundingTextSelectionAnchor() const; + + /** + * @return The surface the TextInputV3Interface is enabled on + * @see isEnabled + * @see enabledChanged + */ + QPointer surface() const; + + /** + * @return Whether the TextInputV3Interface is currently enabled for a SurfaceInterface. + * @see surface + * @see enabledChanged + */ + bool isEnabled() const; + + /** + * Notify when the text around the current cursor position should be deleted. + * + * The Client processes this event together with the commit string + * + * @param beforeLength length of text before current cursor position. + * @param afterLength length of text after current cursor position. + * @see commit + */ + void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); + + /** + * Send preEditString to the client + * + * @param text pre-edit string + * @param cursorBegin + * @param cursorEnd + */ + void sendPreEditString(const QString &text, quint32 cursorBegin, quint32 cursorEnd); + + /** + * Notify when @p text should be inserted into the editor widget. + * The text to commit could be either just a single character after a key press or the + * result of some composing ({@link preEdit}). It could be also an empty text + * when some text should be removed (see {@link deleteSurroundingText}) or when + * the input cursor should be moved (see {@link cursorPosition}). + * + * Any previously set composing text should be removed. + * @param text The utf8-encoded text to be inserted into the editor widget + * @see preEdit + * @see deleteSurroundingText + */ + void commitString(const QString &text); + + /** + * Notify when changes and state requested by sendPreEditString, commitString and deleteSurroundingText + * should be applied. + */ + void done(); + +Q_SIGNALS: + + /** + * @see cursorRectangle + */ + void cursorRectangleChanged(const QRect &rect); + /** + * Emitted when the {@link contentPurpose} and/or {@link contentHints} changes. + * @see contentPurpose + * @see contentHints + */ + void contentTypeChanged(); + + /** + * Emitted when the {@link surroundingText}, {@link surroundingTextCursorPosition} + * and/or {@link surroundingTextSelectionAnchor} changed. + * @see surroundingText + * @see surroundingTextCursorPosition + * @see surroundingTextSelectionAnchor + */ + void surroundingTextChanged(); + + /** + * Emitted whenever this TextInputV3Interface gets enabled or disabled for a SurfaceInterface. + * @see isEnabled + * @see surface + */ + void enabledChanged(); + + /** + * Emitted when state should be committed + */ + void stateCommitted(quint32 serial); + +private: + friend class TextInputManagerV3InterfacePrivate; + friend class SeatInterface; + friend class SeatInterfacePrivate; + friend class TextInputV3InterfacePrivate; + explicit TextInputV3Interface(SeatInterface *seat); + + QScopedPointer d; +}; + +} + +Q_DECLARE_METATYPE(KWaylandServer::TextInputV3Interface *) diff -Nru dwayland-5.57.0.23/src/server/textinput_v3_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface_p.h --- dwayland-5.57.0.23/src/server/textinput_v3_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/textinput_v3_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,97 @@ +/* + SPDX-FileCopyrightText: 2020 Bhushan Shah + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include "clientconnection.h" +#include "textinput_v3_interface.h" + +#include +#include +#include +#include + +#include + +namespace KWaylandServer +{ +class TextInputManagerV3InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v3 +{ +public: + TextInputManagerV3InterfacePrivate(TextInputManagerV3Interface *_q, Display *display); + + TextInputManagerV3Interface *q; + +protected: + void zwp_text_input_manager_v3_destroy(Resource *resource) override; + void zwp_text_input_manager_v3_get_text_input(Resource *resource, uint32_t id, wl_resource *seat) override; +}; + +class TextInputV3InterfacePrivate : public QtWaylandServer::zwp_text_input_v3 +{ +public: + TextInputV3InterfacePrivate(SeatInterface *seat, TextInputV3Interface *_q); + + // events + void sendEnter(SurfaceInterface *surface); + void sendLeave(SurfaceInterface *surface); + void sendPreEdit(const QString &text, const quint32 cursorBegin, const quint32 cursorEnd); + void commitString(const QString &text); + void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); + void done(); + + bool isEnabled() const; + QList textInputsForClient(ClientConnection *client) const; + QList enabledTextInputsForClient(ClientConnection *client) const; + + static TextInputV3InterfacePrivate *get(TextInputV3Interface *inputInterface) + { + return inputInterface->d.data(); + } + + QRect cursorRectangle; + TextInputContentHints contentHints = TextInputContentHint::None; + TextInputContentPurpose contentPurpose = TextInputContentPurpose::Normal; + + SeatInterface *seat = nullptr; + QPointer surface; + + QString surroundingText; + qint32 surroundingTextCursorPosition = 0; + qint32 surroundingTextSelectionAnchor = 0; + TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; + + struct { + QRect cursorRectangle; + TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; + TextInputContentHints contentHints = TextInputContentHint::None; + TextInputContentPurpose contentPurpose = TextInputContentPurpose::Normal; + bool enabled = false; + QString surroundingText; + qint32 surroundingTextCursorPosition = 0; + qint32 surroundingTextSelectionAnchor = 0; + } pending; + + QHash serialHash; + QHash enabled; + + void defaultPending(); + + TextInputV3Interface *q; + +protected: + void zwp_text_input_v3_bind_resource(Resource *resource) override; + void zwp_text_input_v3_destroy(Resource *resource) override; + // requests + void zwp_text_input_v3_enable(Resource *resource) override; + void zwp_text_input_v3_disable(Resource *resource) override; + void zwp_text_input_v3_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) override; + void zwp_text_input_v3_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) override; + void zwp_text_input_v3_set_text_change_cause(Resource *resource, uint32_t cause) override; + void zwp_text_input_v3_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void zwp_text_input_v3_commit(Resource *resource) override; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/touch_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/touch_interface.cpp --- dwayland-5.57.0.23/src/server/touch_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/touch_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,130 +1,123 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Adrien Faveraux + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "touch_interface.h" -#include "resource_p.h" -#include "seat_interface.h" +#include "clientconnection.h" #include "display.h" +#include "seat_interface.h" #include "surface_interface.h" -// Wayland -#include +#include "touch_interface_p.h" -namespace KWayland +namespace KWaylandServer { - -namespace Server +TouchInterfacePrivate *TouchInterfacePrivate::get(TouchInterface *touch) { + return touch->d.data(); +} -class TouchInterface::Private : public Resource::Private +TouchInterfacePrivate::TouchInterfacePrivate(TouchInterface *q, SeatInterface *seat) + : q(q) + , seat(seat) { -public: - Private(SeatInterface *parent, wl_resource *parentResource, TouchInterface *q); - - SeatInterface *seat; - QMetaObject::Connection destroyConnection; +} -private: - TouchInterface *q_func() { - return reinterpret_cast(q); - } +void TouchInterfacePrivate::touch_release(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} - static const struct wl_touch_interface s_interface; -}; +QList TouchInterfacePrivate::touchesForClient(ClientConnection *client) const +{ + return resourceMap().values(client->client()); +} -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct wl_touch_interface TouchInterface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif +TouchInterface::TouchInterface(SeatInterface *seat) + : d(new TouchInterfacePrivate(this, seat)) +{ +} -TouchInterface::Private::Private(SeatInterface *parent, wl_resource *parentResource, TouchInterface *q) - : Resource::Private(q, parent, parentResource, &wl_touch_interface, &s_interface) - , seat(parent) +TouchInterface::~TouchInterface() { } -TouchInterface::TouchInterface(SeatInterface *parent, wl_resource *parentResource) - : Resource(new Private(parent, parentResource, this)) +SurfaceInterface *TouchInterface::focusedSurface() const { + return d->focusedSurface; } -TouchInterface::~TouchInterface() = default; +void TouchInterface::setFocusedSurface(SurfaceInterface *surface) +{ + d->focusedSurface = surface; +} -void TouchInterface::cancel() +void TouchInterface::sendCancel() { - Q_D(); - if (!d->resource) { + if (!d->focusedSurface) { return; } - wl_touch_send_cancel(d->resource); - d->client->flush(); + + const auto touchResources = d->touchesForClient(d->focusedSurface->client()); + for (TouchInterfacePrivate::Resource *resource : touchResources) { + d->send_cancel(resource->handle); + } } -void TouchInterface::frame() +void TouchInterface::sendFrame() { - Q_D(); - if (!d->resource) { + if (!d->focusedSurface) { return; } - wl_touch_send_frame(d->resource); - d->client->flush(); + + const auto touchResources = d->touchesForClient(d->focusedSurface->client()); + for (TouchInterfacePrivate::Resource *resource : touchResources) { + d->send_frame(resource->handle); + } } -void TouchInterface::move(qint32 id, const QPointF &localPos) +void TouchInterface::sendMotion(qint32 id, const QPointF &localPos) { - Q_D(); - if (!d->resource) { + if (!d->focusedSurface) { return; } - if (d->seat->isDragTouch()) { - // handled by DataDevice - return; + + const auto touchResources = d->touchesForClient(d->focusedSurface->client()); + for (TouchInterfacePrivate::Resource *resource : touchResources) { + d->send_motion(resource->handle, d->seat->timestamp(), id, wl_fixed_from_double(localPos.x()), wl_fixed_from_double(localPos.y())); } - wl_touch_send_motion(d->resource, d->seat->timestamp(), id, wl_fixed_from_double(localPos.x()), wl_fixed_from_double(localPos.y())); - d->client->flush(); } -void TouchInterface::up(qint32 id, quint32 serial) +void TouchInterface::sendUp(qint32 id, quint32 serial) { - Q_D(); - if (!d->resource) { + if (!d->focusedSurface) { return; } - wl_touch_send_up(d->resource, serial, d->seat->timestamp(), id); - d->client->flush(); + + const auto touchResources = d->touchesForClient(d->focusedSurface->client()); + for (TouchInterfacePrivate::Resource *resource : touchResources) { + d->send_up(resource->handle, serial, d->seat->timestamp(), id); + } } -void TouchInterface::down(qint32 id, quint32 serial, const QPointF &localPos) +void TouchInterface::sendDown(qint32 id, quint32 serial, const QPointF &localPos) { - Q_D(); - if (!d->resource) { + if (!d->focusedSurface) { return; } - wl_touch_send_down(d->resource, serial, d->seat->timestamp(), d->seat->focusedTouchSurface()->resource(), - id, wl_fixed_from_double(localPos.x()), wl_fixed_from_double(localPos.y())); - d->client->flush(); -} -TouchInterface::Private *TouchInterface::d_func() const -{ - return reinterpret_cast(d.data()); + const auto touchResources = d->touchesForClient(d->focusedSurface->client()); + for (TouchInterfacePrivate::Resource *resource : touchResources) { + d->send_down(resource->handle, + serial, + d->seat->timestamp(), + d->focusedSurface->resource(), + id, + wl_fixed_from_double(localPos.x()), + wl_fixed_from_double(localPos.y())); + } } -} -} +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/touch_interface.h dwayland-5.57.0.24+really5.24.3/src/server/touch_interface.h --- dwayland-5.57.0.23/src/server/touch_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/touch_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,61 +1,48 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + SPDX-FileCopyrightText: 2020 Adrien Faveraux + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef WAYLAND_SERVER_TOUCH_INTERFACE_H -#define WAYLAND_SERVER_TOUCH_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -#include +#include -#include "resource.h" +#include -namespace KWayland +namespace KWaylandServer { -namespace Server -{ - class SeatInterface; +class SurfaceInterface; +class TouchInterfacePrivate; /** - * @brief Resource for the wl_touch interface. - * - **/ -class KWAYLANDSERVER_EXPORT TouchInterface : public Resource + * The TouchInterface class repserents a touchscreen associated with a wl_seat. It + * corresponds to the Wayland interface @c wl_touch. + */ +class KWAYLANDSERVER_EXPORT TouchInterface : public QObject { Q_OBJECT + public: - virtual ~TouchInterface(); + ~TouchInterface() override; + + SurfaceInterface *focusedSurface() const; + void setFocusedSurface(SurfaceInterface *surface); + + void sendDown(qint32 id, quint32 serial, const QPointF &localPos); + void sendUp(qint32 id, quint32 serial); + void sendFrame(); + void sendCancel(); + void sendMotion(qint32 id, const QPointF &localPos); private: - void down(qint32 id, quint32 serial, const QPointF &localPos); - void up(qint32 id, quint32 serial); - void frame(); - void cancel(); - void move(qint32 id, const QPointF &localPos); + explicit TouchInterface(SeatInterface *seat); + QScopedPointer d; + friend class SeatInterface; - explicit TouchInterface(SeatInterface *parent, wl_resource *parentResource); - class Private; - Private *d_func() const; + friend class TouchInterfacePrivate; }; -} -} - -Q_DECLARE_METATYPE(KWayland::Server::TouchInterface*) - -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/touch_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/touch_interface_p.h --- dwayland-5.57.0.23/src/server/touch_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/touch_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "touch_interface.h" + +#include "qwayland-server-wayland.h" + +namespace KWaylandServer +{ +class ClientConnection; + +class TouchInterfacePrivate : public QtWaylandServer::wl_touch +{ +public: + static TouchInterfacePrivate *get(TouchInterface *touch); + TouchInterfacePrivate(TouchInterface *q, SeatInterface *seat); + + QList touchesForClient(ClientConnection *client) const; + + TouchInterface *q; + QPointer focusedSurface; + SeatInterface *seat; + +protected: + void touch_release(Resource *resource) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/utils/executable_path.h dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path.h --- dwayland-5.57.0.23/src/server/utils/executable_path.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,11 @@ +/* + SPDX-FileCopyrightText: 2021 Tobias C. Berner + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +QString executablePathFromPid(pid_t); diff -Nru dwayland-5.57.0.23/src/server/utils/executable_path_proc.cpp dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path_proc.cpp --- dwayland-5.57.0.23/src/server/utils/executable_path_proc.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path_proc.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,14 @@ +/* + SPDX-FileCopyrightText: 2021 Tobias C. Berner + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "executable_path.h" + +#include + +QString executablePathFromPid(pid_t pid) +{ + return QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); +} diff -Nru dwayland-5.57.0.23/src/server/utils/executable_path_sysctl.cpp dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path_sysctl.cpp --- dwayland-5.57.0.23/src/server/utils/executable_path_sysctl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/utils/executable_path_sysctl.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,22 @@ +/* + SPDX-FileCopyrightText: 2021 Tobias C. Berner + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include +#include +#include + +#include "executable_path.h" + +QString executablePathFromPid(pid_t pid) +{ + const int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, static_cast(pid)}; + char buf[MAXPATHLEN]; + size_t cb = sizeof(buf); + if (sysctl(mib, 4, buf, &cb, nullptr, 0) == 0) { + return QString::fromLocal8Bit(realpath(buf, nullptr)); + } + return QString(); +} diff -Nru dwayland-5.57.0.23/src/server/utils.h dwayland-5.57.0.24+really5.24.3/src/server/utils.h --- dwayland-5.57.0.23/src/server/utils.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/utils.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,54 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ +template +struct SafeGlobalDeleter { + static inline void cleanup(T *global) + { + if (global) { + global->remove(); + } + } +}; + +template +using ScopedGlobalPointer = QScopedPointer>; + +/** + * Returns an infinite region. + */ +inline QRegion KWAYLANDSERVER_EXPORT infiniteRegion() +{ + return QRegion(std::numeric_limits::min() / 2, // "/ 2" is to avoid integer overflows + std::numeric_limits::min() / 2, + std::numeric_limits::max(), + std::numeric_limits::max()); +} + +template +T resource_cast(::wl_resource *resource) +{ + using ObjectType = std::remove_pointer_t>; + if (auto resourceContainer = ObjectType::Resource::fromResource(resource)) { + return static_cast(resourceContainer->object()); + } + return T(); +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/viewporter_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface.cpp --- dwayland-5.57.0.23/src/server/viewporter_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,147 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "viewporter_interface.h" +#include "display.h" +#include "surface_interface_p.h" +#include "viewporter_interface_p.h" + +static const int s_version = 1; + +namespace KWaylandServer +{ +class ViewporterInterfacePrivate : public QtWaylandServer::wp_viewporter +{ +protected: + void wp_viewporter_destroy(Resource *resource) override; + void wp_viewporter_get_viewport(Resource *resource, uint32_t id, struct ::wl_resource *surface) override; +}; + +void ViewporterInterfacePrivate::wp_viewporter_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void ViewporterInterfacePrivate::wp_viewporter_get_viewport(Resource *resource, uint32_t id, struct ::wl_resource *surface_resource) +{ + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + ViewportInterface *viewport = ViewportInterface::get(surface); + + if (viewport) { + wl_resource_post_error(resource->handle, error_viewport_exists, "the specified surface already has a viewport"); + return; + } + + wl_resource *viewportResource = wl_resource_create(resource->client(), &wp_viewport_interface, resource->version(), id); + + new ViewportInterface(surface, viewportResource); +} + +ViewportInterface::ViewportInterface(SurfaceInterface *surface, wl_resource *resource) + : QtWaylandServer::wp_viewport(resource) + , surface(surface) +{ + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->viewportExtension = this; +} + +ViewportInterface::~ViewportInterface() +{ + if (surface) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->viewportExtension = nullptr; + } +} + +ViewportInterface *ViewportInterface::get(SurfaceInterface *surface) +{ + return SurfaceInterfacePrivate::get(surface)->viewportExtension; +} + +void ViewportInterface::wp_viewport_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; +} + +void ViewportInterface::wp_viewport_destroy(Resource *resource) +{ + if (surface) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->pending.viewport.sourceGeometry = QRectF(); + surfacePrivate->pending.viewport.sourceGeometryIsSet = true; + surfacePrivate->pending.viewport.destinationSize = QSize(); + surfacePrivate->pending.viewport.destinationSizeIsSet = true; + } + + wl_resource_destroy(resource->handle); +} + +void ViewportInterface::wp_viewport_set_source(Resource *resource, wl_fixed_t x_fixed, wl_fixed_t y_fixed, wl_fixed_t width_fixed, wl_fixed_t height_fixed) +{ + if (!surface) { + wl_resource_post_error(resource->handle, error_no_surface, "the wl_surface for this viewport no longer exists"); + return; + } + + const qreal x = wl_fixed_to_double(x_fixed); + const qreal y = wl_fixed_to_double(y_fixed); + const qreal width = wl_fixed_to_double(width_fixed); + const qreal height = wl_fixed_to_double(height_fixed); + + if (x == -1 && y == -1 && width == -1 && height == -1) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->pending.viewport.sourceGeometry = QRectF(); + surfacePrivate->pending.viewport.sourceGeometryIsSet = true; + return; + } + + if (x < 0 || y < 0 || width <= 0 || height <= 0) { + wl_resource_post_error(resource->handle, error_bad_value, "invalid source geometry"); + return; + } + + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->pending.viewport.sourceGeometry = QRectF(x, y, width, height); + surfacePrivate->pending.viewport.sourceGeometryIsSet = true; +} + +void ViewportInterface::wp_viewport_set_destination(Resource *resource, int32_t width, int32_t height) +{ + if (!surface) { + wl_resource_post_error(resource->handle, error_no_surface, "the wl_surface for this viewport no longer exists"); + return; + } + + if (width == -1 && height == -1) { + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->pending.viewport.destinationSize = QSize(); + surfacePrivate->pending.viewport.destinationSizeIsSet = true; + return; + } + + if (width <= 0 || height <= 0) { + wl_resource_post_error(resource->handle, error_bad_value, "invalid destination size"); + return; + } + + SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(surface); + surfacePrivate->pending.viewport.destinationSize = QSize(width, height); + surfacePrivate->pending.viewport.destinationSizeIsSet = true; +} + +ViewporterInterface::ViewporterInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new ViewporterInterfacePrivate) +{ + d->init(*display, s_version); +} + +ViewporterInterface::~ViewporterInterface() +{ +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/viewporter_interface.h dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface.h --- dwayland-5.57.0.23/src/server/viewporter_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,38 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class ViewporterInterfacePrivate; + +/** + * The ViewporterInterface is an extension that allows clients to crop and scale surfaces. + * + * The ViewporterInterface extensions provides a way for Wayland clients to crop and scale their + * surfaces. This effectively breaks the direct connection between the buffer and the surface size. + * + * ViewporterInterface corresponds to the Wayland interface @c wp_viewporter. + */ +class KWAYLANDSERVER_EXPORT ViewporterInterface : public QObject +{ + Q_OBJECT + +public: + explicit ViewporterInterface(Display *display, QObject *parent = nullptr); + ~ViewporterInterface() override; + +private: + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/viewporter_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface_p.h --- dwayland-5.57.0.23/src/server/viewporter_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/viewporter_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,34 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "qwayland-server-viewporter.h" + +#include + +namespace KWaylandServer +{ +class SurfaceInterface; + +class ViewportInterface : public QtWaylandServer::wp_viewport +{ +public: + ViewportInterface(SurfaceInterface *surface, wl_resource *resource); + ~ViewportInterface() override; + + static ViewportInterface *get(SurfaceInterface *surface); + + QPointer surface; + +protected: + void wp_viewport_destroy_resource(Resource *resource) override; + void wp_viewport_destroy(Resource *resource) override; + void wp_viewport_set_source(Resource *resource, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height) override; + void wp_viewport_set_destination(Resource *resource, int32_t width, int32_t height) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgactivation_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgactivation_v1_interface.cpp --- dwayland-5.57.0.23/src/server/xdgactivation_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgactivation_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,142 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "xdgactivation_v1_interface.h" +#include "display.h" +#include "logging.h" +#include "seat_interface.h" +#include "surface_interface.h" + +#include "qwayland-server-xdg-activation-v1.h" + +namespace KWaylandServer +{ +static const int s_version = 1; + +class XdgActivationTokenV1Interface : public QtWaylandServer::xdg_activation_token_v1 +{ +public: + XdgActivationTokenV1Interface(XdgActivationV1Interface::CreatorFunction creator, ClientConnection *client, uint32_t newId) + : QtWaylandServer::xdg_activation_token_v1(*client, newId, s_version) + , m_creator(creator) + , m_client(client) + { + } + +protected: + void xdg_activation_token_v1_set_serial(Resource *resource, uint32_t serial, struct ::wl_resource *seat) override; + void xdg_activation_token_v1_set_app_id(Resource *resource, const QString &app_id) override; + void xdg_activation_token_v1_set_surface(QtWaylandServer::xdg_activation_token_v1::Resource *resource, struct ::wl_resource *surface) override; + void xdg_activation_token_v1_commit(Resource *resource) override; + void xdg_activation_token_v1_destroy(Resource *resource) override; + void xdg_activation_token_v1_destroy_resource(Resource *resource) override; + + const XdgActivationV1Interface::CreatorFunction m_creator; + QPointer m_surface; + uint m_serial = 0; + struct ::wl_resource *m_seat = nullptr; + QString m_appId; + bool m_committed = false; + ClientConnection *const m_client; +}; + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_serial(Resource *resource, uint32_t serial, struct ::wl_resource *seat) +{ + Q_UNUSED(resource); + m_serial = serial; + m_seat = seat; +} + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_app_id(Resource *resource, const QString &app_id) +{ + Q_UNUSED(resource); + m_appId = app_id; +} + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_surface(Resource *resource, struct ::wl_resource *surface) +{ + Q_UNUSED(resource); + m_surface = SurfaceInterface::get(surface); +} + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_commit(Resource *resource) +{ + QString token; + if (m_creator) { + token = m_creator(m_client, m_surface, m_serial, SeatInterface::get(m_seat), m_appId); + } + + m_committed = true; + send_done(resource->handle, token); +} + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_destroy(Resource *resource) +{ + if (!m_committed) { + send_done(resource->handle, {}); + } + wl_resource_destroy(resource->handle); +} + +void XdgActivationTokenV1Interface::xdg_activation_token_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource); + delete this; +} + +class XdgActivationV1InterfacePrivate : public QtWaylandServer::xdg_activation_v1 +{ +public: + XdgActivationV1InterfacePrivate(Display *display, XdgActivationV1Interface *q) + : QtWaylandServer::xdg_activation_v1(*display, s_version) + , q(q) + , m_display(display) + { + } + +protected: + void xdg_activation_v1_get_activation_token(Resource *resource, uint32_t id) override; + void xdg_activation_v1_activate(Resource *resource, const QString &token, struct ::wl_resource *surface) override; + void xdg_activation_v1_destroy(Resource *resource) override; + +public: + XdgActivationV1Interface::CreatorFunction m_creator; + XdgActivationV1Interface *const q; + Display *const m_display; +}; + +void XdgActivationV1InterfacePrivate::xdg_activation_v1_get_activation_token(Resource *resource, uint32_t id) +{ + new XdgActivationTokenV1Interface(m_creator, m_display->getConnection(resource->client()), id); +} + +void XdgActivationV1InterfacePrivate::xdg_activation_v1_activate(Resource *resource, const QString &token, struct ::wl_resource *surface) +{ + Q_UNUSED(resource); + Q_EMIT q->activateRequested(SurfaceInterface::get(surface), token); +} + +void XdgActivationV1InterfacePrivate::xdg_activation_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +XdgActivationV1Interface::XdgActivationV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new XdgActivationV1InterfacePrivate(display, this)) +{ +} + +XdgActivationV1Interface::~XdgActivationV1Interface() +{ +} + +void XdgActivationV1Interface::setActivationTokenCreator(const CreatorFunction &creator) +{ + d->m_creator = creator; +} + +} diff -Nru dwayland-5.57.0.23/src/server/xdgactivation_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgactivation_v1_interface.h --- dwayland-5.57.0.23/src/server/xdgactivation_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgactivation_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,50 @@ +/* + SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include +#include +#include +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class Display; +class SurfaceInterface; +class SeatInterface; +class ClientConnection; + +class XdgActivationV1InterfacePrivate; + +class KWAYLANDSERVER_EXPORT XdgActivationV1Interface : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(XdgActivationV1Interface) +public: + explicit XdgActivationV1Interface(Display *display, QObject *parent = nullptr); + ~XdgActivationV1Interface() override; + + using CreatorFunction = std::function; + + /// Provide the @p creator function that will be used to create a token given its parameters + void setActivationTokenCreator(const CreatorFunction &creator); + +Q_SIGNALS: + /// Notifies about the @p surface being activated using @p token. + void activateRequested(SurfaceInterface *surface, const QString &token); + +private: + friend class XdgActivationV1InterfacePrivate; + XdgActivationV1Interface(XdgActivationV1Interface *parent); + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/xdgdecoration_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_interface.cpp --- dwayland-5.57.0.23/src/server/xdgdecoration_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ -/**************************************************************************** -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgdecoration_interface.h" - - -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "xdgshell_interface.h" -#include "xdgshell_stable_interface_p.h" - -#include "wayland-xdg-decoration-server-protocol.h" - -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class XdgDecorationManagerInterface::Private : public Global::Private -{ -public: - Private(XdgDecorationManagerInterface *q, XdgShellInterface *shellInterface, Display *d); - - QHash m_decorations; - KWayland::Server::XdgShellStableInterface *m_shellInterface; -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getToplevelDecorationCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * toplevel); - - XdgDecorationManagerInterface *q; - static const struct zxdg_decoration_manager_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 XdgDecorationManagerInterface::Private::s_version = 1; - -XdgDecorationManagerInterface::XdgDecorationManagerInterface(Display *display, XdgShellInterface *shellInterface, QObject *parent): - Global(new Private(this, shellInterface, display), parent) -{ -} - -XdgDecorationManagerInterface::~XdgDecorationManagerInterface() {} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_decoration_manager_v1_interface XdgDecorationManagerInterface::Private::s_interface = { - destroyCallback, - getToplevelDecorationCallback -}; -#endif - -void XdgDecorationManagerInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void XdgDecorationManagerInterface::Private::getToplevelDecorationCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * toplevel) -{ - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - auto shell = p->m_shellInterface->getSurface(toplevel); - if (!shell) { - wl_resource_post_error(resource, ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED, "No XDGToplevel found object"); - return; - } - if (p->m_decorations.contains(shell)) { - wl_resource_post_error(resource, ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED, "XDGDecoration already exists for this surface"); - return; - } - - auto xdgDecoration = new XdgDecorationInterface(p->q, shell, resource); - xdgDecoration->create(p->display->getConnection(client), wl_resource_get_version(resource), id); - if (!xdgDecoration->resource()) { - wl_resource_post_no_memory(resource); - delete xdgDecoration; - return; - } - p->m_decorations[shell] = xdgDecoration; - QObject::connect(xdgDecoration, &QObject::destroyed, p->q, [=]() { - p->m_decorations.remove(shell); - }); - emit p->q->xdgDecorationInterfaceCreated(xdgDecoration); -} - -XdgDecorationManagerInterface::Private::Private(XdgDecorationManagerInterface *q, XdgShellInterface *shellInterface, Display *d) - : Global::Private(d, &zxdg_decoration_manager_v1_interface, s_version) - , q(q) -{ - m_shellInterface = qobject_cast(shellInterface); - Q_ASSERT(m_shellInterface); -} - -void XdgDecorationManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zxdg_decoration_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void XdgDecorationManagerInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -class XdgDecorationInterface::Private : public Resource::Private -{ -public: - Private(XdgDecorationInterface *q, XdgDecorationManagerInterface *c, XdgShellSurfaceInterface *s, wl_resource *parentResource); - ~Private(); - Mode m_requestedMode = Mode::Undefined; - XdgShellSurfaceInterface* m_shell; - -private: - static void setModeCallback(wl_client *client, wl_resource *resource, uint32_t mode); - static void unsetModeCallback(wl_client *client, wl_resource *resource); - - XdgDecorationInterface *q_func() { - return reinterpret_cast(q); - } - - static const struct zxdg_toplevel_decoration_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_toplevel_decoration_v1_interface XdgDecorationInterface::Private::s_interface = { - resourceDestroyedCallback, - setModeCallback, - unsetModeCallback -}; -#endif - -void XdgDecorationInterface::Private::setModeCallback(wl_client *client, wl_resource *resource, uint32_t mode_raw) -{ - Q_UNUSED(client); - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - Mode mode = Mode::Undefined; - switch (mode_raw) { - case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE: - mode = Mode::ClientSide; - break; - case ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE: - mode = Mode::ServerSide; - break; - default: - break; - } - - p->m_requestedMode = mode; - emit p->q_func()->modeRequested(p->m_requestedMode); -} - -void XdgDecorationInterface::Private::unsetModeCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client); - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - p->m_requestedMode = Mode::Undefined; - emit p->q_func()->modeRequested(p->m_requestedMode); -} - -XdgDecorationInterface::Private::Private(XdgDecorationInterface *q, XdgDecorationManagerInterface *c, XdgShellSurfaceInterface *shell, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zxdg_toplevel_decoration_v1_interface, &s_interface) - , m_shell(shell) -{ -} - -XdgDecorationInterface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -XdgDecorationInterface::XdgDecorationInterface(XdgDecorationManagerInterface *parent, XdgShellSurfaceInterface *shell, wl_resource *parentResource) - : Resource(new Private(this, parent, shell, parentResource)) -{ -} - -XdgDecorationInterface::~XdgDecorationInterface() {} - -void XdgDecorationInterface::configure(XdgDecorationInterface::Mode mode) -{ - switch(mode) { - case Mode::ClientSide: - zxdg_toplevel_decoration_v1_send_configure(resource(), ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE); - break; - case Mode::ServerSide: - zxdg_toplevel_decoration_v1_send_configure(resource(), ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); - break; - default: - //configure(Mode::Undefined) should no-op, as it semantically makes no sense - break; - } -} - -XdgDecorationInterface::Mode XdgDecorationInterface::requestedMode() const -{ - Q_D(); - return d->m_requestedMode; -} - -XdgShellSurfaceInterface* XdgDecorationInterface::surface() const -{ - Q_D(); - return d->m_shell; -} - -XdgDecorationInterface::Private *XdgDecorationInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgdecoration_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_interface.h --- dwayland-5.57.0.23/src/server/xdgdecoration_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/**************************************************************************** -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDG_DECORATION_UNSTABLE_V1_H -#define KWAYLAND_SERVER_XDG_DECORATION_UNSTABLE_V1_H - -#include "global.h" -#include "resource.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class XdgDecorationInterface; -class XdgShellInterface; -class XdgShellSurfaceInterface; - -/** - * @brief The XdgDecorationManagerInterface class - * @since 5.54 - */ -class KWAYLANDSERVER_EXPORT XdgDecorationManagerInterface : public Global -{ - Q_OBJECT -public: - ~XdgDecorationManagerInterface() override; -Q_SIGNALS: - void xdgDecorationInterfaceCreated(XdgDecorationInterface *iface); -private: - explicit XdgDecorationManagerInterface(Display *display, XdgShellInterface *shellInterface, QObject *parent = nullptr); - friend class Display; - class Private; -}; - -/** - * @brief The XdgDecorationInterface class - * @since 5.54 - */ -class KWAYLANDSERVER_EXPORT XdgDecorationInterface : public Resource -{ - Q_OBJECT -public: - enum class Mode { - Undefined, - ClientSide, - ServerSide - }; - - Q_ENUM(Mode); - - ~XdgDecorationInterface() override; - - /** - * Sets the mode the client should be using. - * It should be followed by a call to XDGShellSurface::configure() - * Once acked, it can relied upon to be applied in the next surface - */ - void configure(Mode requestedMode); - - /** - * The last mode requested by the client - */ - Mode requestedMode() const; - - /** - * The surface this decoration is attached to - */ - XdgShellSurfaceInterface *surface() const; - -Q_SIGNALS: - /** - * New mode requested by the client - */ - void modeRequested(KWayland::Server::XdgDecorationInterface::Mode requestedMode); - -private: - explicit XdgDecorationInterface(XdgDecorationManagerInterface *parent, XdgShellSurfaceInterface *surface, wl_resource *parentResource); - friend class XdgDecorationManagerInterface; - - class Private; - Private *d_func() const; -}; - - -} -} - - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface.cpp --- dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,146 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "xdgdecoration_v1_interface.h" +#include "display.h" +#include "xdgdecoration_v1_interface_p.h" +#include "xdgshell_interface_p.h" + +namespace KWaylandServer +{ +// TODO: We need to wait for an ack_configure either here or in xdgshellclient.cpp. + +XdgDecorationManagerV1InterfacePrivate::XdgDecorationManagerV1InterfacePrivate(XdgDecorationManagerV1Interface *manager) + : q(manager) +{ +} + +void XdgDecorationManagerV1InterfacePrivate::zxdg_decoration_manager_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void XdgDecorationManagerV1InterfacePrivate::zxdg_decoration_manager_v1_get_toplevel_decoration(Resource *resource, + uint32_t id, + ::wl_resource *toplevelResource) +{ + XdgToplevelInterfacePrivate *toplevelPrivate = XdgToplevelInterfacePrivate::get(toplevelResource); + if (!toplevelPrivate) { + wl_resource_post_error(resource->handle, QtWaylandServer::zxdg_toplevel_decoration_v1::error_orphaned, "no xdg-toplevel object"); + return; + } + + if (toplevelPrivate->decoration) { + wl_resource_post_error(resource->handle, + QtWaylandServer::zxdg_toplevel_decoration_v1::error_already_constructed, + "decoration has been already constructed"); + return; + } + + wl_resource *decorationResource = wl_resource_create(resource->client(), &zxdg_toplevel_decoration_v1_interface, resource->version(), id); + + auto decoration = new XdgToplevelDecorationV1Interface(toplevelPrivate->q, decorationResource); + toplevelPrivate->decoration = decoration; + + Q_EMIT q->decorationCreated(decoration); +} + +XdgDecorationManagerV1Interface::XdgDecorationManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new XdgDecorationManagerV1InterfacePrivate(this)) +{ + d->init(*display, 1); +} + +XdgDecorationManagerV1Interface::~XdgDecorationManagerV1Interface() +{ +} + +XdgToplevelDecorationV1InterfacePrivate::XdgToplevelDecorationV1InterfacePrivate(XdgToplevelDecorationV1Interface *decoration) + : q(decoration) +{ +} + +void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete q; +} + +void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_set_mode(Resource *resource, uint32_t mode) +{ + Q_UNUSED(resource) + + switch (mode) { + case mode_client_side: + preferredMode = XdgToplevelDecorationV1Interface::Mode::Client; + break; + case mode_server_side: + preferredMode = XdgToplevelDecorationV1Interface::Mode::Server; + break; + default: + preferredMode = XdgToplevelDecorationV1Interface::Mode::Undefined; + break; + } + + Q_EMIT q->preferredModeChanged(preferredMode); +} + +void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_unset_mode(Resource *resource) +{ + Q_UNUSED(resource) + preferredMode = XdgToplevelDecorationV1Interface::Mode::Undefined; + Q_EMIT q->preferredModeChanged(preferredMode); +} + +XdgToplevelDecorationV1Interface::XdgToplevelDecorationV1Interface(XdgToplevelInterface *toplevel, ::wl_resource *resource) + : d(new XdgToplevelDecorationV1InterfacePrivate(this)) +{ + d->toplevel = toplevel; + d->init(resource); +} + +XdgToplevelDecorationV1Interface::~XdgToplevelDecorationV1Interface() +{ +} + +XdgToplevelInterface *XdgToplevelDecorationV1Interface::toplevel() const +{ + return d->toplevel; +} + +XdgToplevelDecorationV1Interface::Mode XdgToplevelDecorationV1Interface::preferredMode() const +{ + return d->preferredMode; +} + +void XdgToplevelDecorationV1Interface::sendConfigure(Mode mode) +{ + switch (mode) { + case Mode::Client: + d->send_configure(QtWaylandServer::zxdg_toplevel_decoration_v1::mode_client_side); + break; + case Mode::None: // Faked as server_side mode. + case Mode::Server: + d->send_configure(QtWaylandServer::zxdg_toplevel_decoration_v1::mode_server_side); + break; + case Mode::Undefined: + break; + } +} + +XdgToplevelDecorationV1Interface *XdgToplevelDecorationV1Interface::get(XdgToplevelInterface *toplevel) +{ + XdgToplevelInterfacePrivate *toplevelPrivate = XdgToplevelInterfacePrivate::get(toplevel); + return toplevelPrivate->decoration; +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface.h --- dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,109 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include + +#include + +struct wl_resource; + +namespace KWaylandServer +{ +class Display; +class XdgDecorationManagerV1InterfacePrivate; +class XdgToplevelDecorationV1Interface; +class XdgToplevelDecorationV1InterfacePrivate; +class XdgToplevelInterface; + +/** + * The XdgDecorationManagerV1Interface class provides a way for the compositor and an xdg-shell + * client to negotiate the use of server-side window decorations. + * + * XdgDecorationManagerV1Interface corresponds to the interface \c zxdg_decoration_manager_v1. + */ +class KWAYLANDSERVER_EXPORT XdgDecorationManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + /** + * Constructs a decoration manager with the given \a display and \a parent. + */ + XdgDecorationManagerV1Interface(Display *display, QObject *parent = nullptr); + /** + * Destructs the XdgDecorationManagerV1Interface object. + */ + ~XdgDecorationManagerV1Interface() override; + +Q_SIGNALS: + /** + * This signal is emitted when a new \a decoration has been created. + */ + void decorationCreated(XdgToplevelDecorationV1Interface *decoration); + +private: + QScopedPointer d; +}; + +/** + * The XdgToplevelDecorationV1Interface class allows the compositor to toggle server-side window + * decoration on an xdg-toplevel surface. + * + * XdgToplevelDecorationV1Interface corresponds to the interface \c zxdg_toplevel_decoration_v1. + */ +class KWAYLANDSERVER_EXPORT XdgToplevelDecorationV1Interface : public QObject +{ + Q_OBJECT + +public: + enum class Mode { Undefined, None, Client, Server }; + Q_ENUM(Mode) + + /** + * Constructs a XdgToplevelDecorationV1Interface for the given \a toplevel and initializes + * it with \a resource. + */ + XdgToplevelDecorationV1Interface(XdgToplevelInterface *toplevel, ::wl_resource *resource); + /** + * Destructs the XdgToplevelDecorationV1Interface object. + */ + ~XdgToplevelDecorationV1Interface() override; + + /** + * Returns the toplevel for this XdgToplevelDecorationV1Interface. + */ + XdgToplevelInterface *toplevel() const; + /** + * Returns the decoration mode preferred by the client. + */ + Mode preferredMode() const; + /** + * Sends a configure event to the client. \a mode indicates the decoration mode the client + * should be using. The client must send an ack_configure in response to this event. + * + * \see XdgToplevelInterface::sendConfigure + */ + void sendConfigure(Mode mode); + + /** + * Returns the XdgToplevelDecorationV1Interface for the specified \a toplevel. + */ + static XdgToplevelDecorationV1Interface *get(XdgToplevelInterface *toplevel); + +Q_SIGNALS: + /** + * This signal is emitted when the client has specified the preferred decoration mode. The + * compositor can decide not to use the client's mode and enforce a different mode instead. + */ + void preferredModeChanged(KWaylandServer::XdgToplevelDecorationV1Interface::Mode mode); + +private: + QScopedPointer d; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface_p.h --- dwayland-5.57.0.23/src/server/xdgdecoration_v1_interface_p.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgdecoration_v1_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,43 @@ +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "xdgdecoration_v1_interface.h" + +#include "qwayland-server-xdg-decoration-unstable-v1.h" + +namespace KWaylandServer +{ +class XdgDecorationManagerV1InterfacePrivate : public QtWaylandServer::zxdg_decoration_manager_v1 +{ +public: + XdgDecorationManagerV1InterfacePrivate(XdgDecorationManagerV1Interface *manager); + + XdgDecorationManagerV1Interface *q; + +protected: + void zxdg_decoration_manager_v1_destroy(Resource *resource) override; + void zxdg_decoration_manager_v1_get_toplevel_decoration(Resource *resource, uint32_t id, ::wl_resource *toplevel) override; +}; + +class XdgToplevelDecorationV1InterfacePrivate : public QtWaylandServer::zxdg_toplevel_decoration_v1 +{ +public: + XdgToplevelDecorationV1InterfacePrivate(XdgToplevelDecorationV1Interface *decoration); + + XdgToplevelDecorationV1Interface *q; + XdgToplevelInterface *toplevel; + XdgToplevelDecorationV1Interface::Mode preferredMode = XdgToplevelDecorationV1Interface::Mode::Undefined; + +protected: + void zxdg_toplevel_decoration_v1_destroy_resource(Resource *resource) override; + void zxdg_toplevel_decoration_v1_destroy(Resource *resource) override; + void zxdg_toplevel_decoration_v1_set_mode(Resource *resource, uint32_t mode) override; + void zxdg_toplevel_decoration_v1_unset_mode(Resource *resource) override; +}; + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgforeign_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_interface.cpp --- dwayland-5.57.0.23/src/server/xdgforeign_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/**************************************************************************** -Copyright 2017 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ - -#include "xdgforeign_interface.h" -#include "xdgforeign_v2_interface_p.h" -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "surface_interface_p.h" - -#include "wayland-xdg-foreign-unstable-v2-server-protocol.h" - -#include -#include - -namespace KWayland -{ -namespace Server -{ - -XdgForeignInterface::Private::Private(Display *display, XdgForeignInterface *q) - : q(q) -{ - exporter = new XdgExporterUnstableV2Interface(display, q); - importer = new XdgImporterUnstableV2Interface(display, q); - - connect(importer, &XdgImporterUnstableV2Interface::transientChanged, - q, &XdgForeignInterface::transientChanged); -} - -XdgForeignInterface::XdgForeignInterface(Display *display, QObject *parent) - : QObject(parent), - d(new Private(display, this)) -{ -} - -XdgForeignInterface::~XdgForeignInterface() -{ - delete d->exporter; - delete d->importer; - delete d; -} - -void XdgForeignInterface::create() -{ - d->exporter->create(); - d->importer->create(); -} - -bool XdgForeignInterface::isValid() -{ - return d->exporter->isValid() && d->importer->isValid(); -} - -SurfaceInterface *XdgForeignInterface::transientFor(SurfaceInterface *surface) -{ - return d->importer->transientFor(surface); -} - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgforeign_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_interface.h --- dwayland-5.57.0.23/src/server/xdgforeign_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/**************************************************************************** -Copyright 2017 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGFOREIGN_INTERFACE_H -#define KWAYLAND_SERVER_XDGFOREIGN_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SurfaceInterface; -class XdgExporterUnstableV2Interface; -class XdgImporterUnstableV2Interface; - -/** - * This class encapsulates the server side logic of the XdgForeign protocol. - * a process can export a surface to be identifiable by a server-wide unique - * string handle, and another process can in turn import that surface, and set it - * as transient parent for one of its own surfaces. - * This parent relationship is traced by the transientChanged signal and the - * transientFor method. - * - * @since 5.40 - */ -class KWAYLANDSERVER_EXPORT XdgForeignInterface : public QObject -{ - Q_OBJECT -public: - XdgForeignInterface(Display *display, QObject *parent = nullptr); - ~XdgForeignInterface(); - - /** - * Creates the native zxdg_exporter_v2 and zxdg_importer_v2 interfaces - * and announces them to the client. - */ - void create(); - - /** - * @returns true if theimporter and exporter are valid and functional - */ - bool isValid(); - - /** - * If a client did import a surface and set one of its own as child of the - * imported one, this returns the mapping. - * @param surface the child surface we want to search an imported transientParent for. - * @returns the transient parent of the surface, if found, nullptr otherwise. - */ - SurfaceInterface *transientFor(SurfaceInterface *surface); - -Q_SIGNALS: - /** - * A surface got a new imported transient parent - * @param parent is the surface exported by one client and imported into another, which will act as parent. - * @param child is the surface that the importer client did set as child of the surface - * that it imported. - * If one of the two paramenters is nullptr, it means that a previously relation is not - * valid anymore and either one of the surfaces has been unmapped, or the parent surface - * is not exported anymore. - */ - void transientChanged(KWayland::Server::SurfaceInterface *child, KWayland::Server::SurfaceInterface *parent); - -private: - friend class Display; - friend class XdgExporterUnstableV2Interface; - friend class XdgImporterUnstableV2Interface; - class Private; - Private *d; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgforeign_v2_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface.cpp --- dwayland-5.57.0.23/src/server/xdgforeign_v2_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,466 +1,269 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ -#include "xdgforeign_interface.h" -#include "xdgforeign_v2_interface_p.h" #include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "surface_interface_p.h" - -#include "wayland-xdg-foreign-unstable-v2-server-protocol.h" +#include "xdgforeign_v2_interface_p.h" #include -#include -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +static const quint32 s_exporterVersion = 1; +static const quint32 s_importerVersion = 1; -class Q_DECL_HIDDEN XdgExporterUnstableV2Interface::Private : public Global::Private -{ -public: - Private(XdgExporterUnstableV2Interface *q, Display *d, XdgForeignInterface *foreignInterface); - - XdgForeignInterface *foreignInterface; - QHash exportedSurfaces; - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void exportCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - - XdgExporterUnstableV2Interface *q; - static const struct zxdg_exporter_v2_interface s_interface; - static const quint32 s_version; -}; - -const quint32 XdgExporterUnstableV2Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_exporter_v2_interface XdgExporterUnstableV2Interface::Private::s_interface = { - destroyCallback, - exportCallback -}; -#endif - -XdgExporterUnstableV2Interface::XdgExporterUnstableV2Interface(Display *display, XdgForeignInterface *parent) - : Global(new Private(this, display, parent), parent) +XdgForeignV2InterfacePrivate::XdgForeignV2InterfacePrivate(Display *display, XdgForeignV2Interface *_q) + : q(_q) + , exporter(new XdgExporterV2Interface(display, _q)) + , importer(new XdgImporterV2Interface(display, _q)) { } -XdgExporterUnstableV2Interface::~XdgExporterUnstableV2Interface() -{} - -XdgExporterUnstableV2Interface::Private *XdgExporterUnstableV2Interface::d_func() const +XdgForeignV2Interface::XdgForeignV2Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new XdgForeignV2InterfacePrivate(display, this)) { - return reinterpret_cast(d.data()); } -XdgExportedUnstableV2Interface *XdgExporterUnstableV2Interface::exportedSurface(const QString &handle) +XdgForeignV2Interface::~XdgForeignV2Interface() { - Q_D(); - - auto it = d->exportedSurfaces.constFind(handle); - if (it != d->exportedSurfaces.constEnd()) { - return it.value(); - } - return nullptr; } -void XdgExporterUnstableV2Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) +SurfaceInterface *XdgForeignV2Interface::transientFor(SurfaceInterface *surface) { - Q_UNUSED(client) - Q_UNUSED(resource) + return d->importer->transientFor(surface); } -void XdgExporterUnstableV2Interface::Private::exportCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) -{ - auto s = cast(resource); - QPointer e = new XdgExportedUnstableV2Interface(s->q, surface); - - e->create(s->display->getConnection(client), wl_resource_get_version(resource), id); - - if (!e->resource()) { - wl_resource_post_no_memory(resource); - delete e; - return; - } - - const QString handle = QUuid::createUuid().toString(); - - //a surface not exported anymore - connect(e.data(), &XdgExportedUnstableV2Interface::unbound, - s->q, [s, handle]() { - s->exportedSurfaces.remove(handle); - emit s->q->surfaceUnexported(handle); - }); - - //if the surface dies before this, this dies too - connect(SurfaceInterface::get(surface), &Resource::unbound, - s->q, [s, e, handle]() { - if (e) { - e->deleteLater(); - } - s->exportedSurfaces.remove(handle); - emit s->q->surfaceUnexported(handle); - }); - - s->exportedSurfaces[handle] = e; - zxdg_exported_v2_send_handle(e->resource(), handle.toUtf8().constData()); - emit s->q->surfaceExported(handle, e); -} - -XdgExporterUnstableV2Interface::Private::Private(XdgExporterUnstableV2Interface *q, Display *d,XdgForeignInterface *foreignInterface) - : Global::Private(d, &zxdg_exporter_v2_interface, s_version) - , foreignInterface(foreignInterface) - , q(q) +XdgExporterV2Interface::XdgExporterV2Interface(Display *display, XdgForeignV2Interface *foreign) + : QObject(foreign) + , QtWaylandServer::zxdg_exporter_v2(*display, s_exporterVersion) + , m_foreign(foreign) { } -void XdgExporterUnstableV2Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zxdg_exporter_v2_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? +XdgExportedV2Interface *XdgExporterV2Interface::exportedSurface(const QString &handle) +{ + return m_exportedSurfaces.value(handle); } -void XdgExporterUnstableV2Interface::Private::unbind(wl_resource *resource) +void XdgExporterV2Interface::zxdg_exporter_v2_destroy(Resource *resource) { - Q_UNUSED(resource) - // TODO: implement? + wl_resource_destroy(resource->handle); } -class Q_DECL_HIDDEN XdgImporterUnstableV2Interface::Private : public Global::Private +void XdgExporterV2Interface::zxdg_exporter_v2_export_toplevel(Resource *resource, uint32_t id, wl_resource *surface_resource) { -public: - Private(XdgImporterUnstableV2Interface *q, Display *d, XdgForeignInterface *foreignInterface); - - XdgForeignInterface *foreignInterface; - - QHash importedSurfaces; - - //child->parent hash - QHash parents; - //parent->child hash - QHash children; - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); + SurfaceInterface *surface = SurfaceInterface::get(surface_resource); + if (!surface) { + wl_resource_post_error(resource->handle, 0, "Invalid surface"); + return; } - static void destroyCallback(wl_client *client, wl_resource *resource); - static void importCallback(wl_client *client, wl_resource *resource, uint32_t id, const char * handle); - - XdgImporterUnstableV2Interface *q; - static const struct zxdg_importer_v2_interface s_interface; - static const quint32 s_version; -}; + wl_resource *exportedResource = wl_resource_create(resource->client(), &zxdg_exported_v2_interface, resource->version(), id); + if (!exportedResource) { + wl_client_post_no_memory(resource->client()); + return; + } -const quint32 XdgImporterUnstableV2Interface::Private::s_version = 1; + XdgExportedV2Interface *exported = new XdgExportedV2Interface(surface, exportedResource); + const QString handle = QUuid::createUuid().toString(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_importer_v2_interface XdgImporterUnstableV2Interface::Private::s_interface = { - destroyCallback, - importCallback -}; -#endif + // a surface not exported anymore + connect(exported, &XdgExportedV2Interface::destroyed, this, [this, handle]() { + m_exportedSurfaces.remove(handle); + }); -XdgImporterUnstableV2Interface::XdgImporterUnstableV2Interface(Display *display, XdgForeignInterface *parent) - : Global(new Private(this, display, parent), parent) -{ + m_exportedSurfaces[handle] = exported; + exported->send_handle(handle); } -XdgImporterUnstableV2Interface::~XdgImporterUnstableV2Interface() +XdgImporterV2Interface::XdgImporterV2Interface(Display *display, XdgForeignV2Interface *foreign) + : QObject(foreign) + , QtWaylandServer::zxdg_importer_v2(*display, s_importerVersion) + , m_foreign(foreign) { } -XdgImportedUnstableV2Interface *XdgImporterUnstableV2Interface::importedSurface(const QString &handle) +SurfaceInterface *XdgImporterV2Interface::transientFor(SurfaceInterface *surface) { - Q_D(); - - auto it = d->importedSurfaces.constFind(handle); - if (it != d->importedSurfaces.constEnd()) { - return it.value(); - } - return nullptr; -} - -SurfaceInterface *XdgImporterUnstableV2Interface::transientFor(SurfaceInterface *surface) -{ - Q_D(); - - auto it = d->parents.constFind(surface); - if (it == d->parents.constEnd()) { + auto it = m_parents.constFind(surface); + if (it == m_parents.constEnd()) { return nullptr; } - return SurfaceInterface::get((*it)->parentResource()); -} - -XdgImporterUnstableV2Interface::Private *XdgImporterUnstableV2Interface::d_func() const -{ - return reinterpret_cast(d.data()); + return (*it)->surface(); } -void XdgImporterUnstableV2Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) +void XdgImporterV2Interface::zxdg_importer_v2_destroy(Resource *resource) { - Q_UNUSED(client) - Q_UNUSED(resource) + wl_resource_destroy(resource->handle); } -void XdgImporterUnstableV2Interface::Private::importCallback(wl_client *client, wl_resource *resource, uint32_t id, const char *h) +void XdgImporterV2Interface::zxdg_importer_v2_import_toplevel(Resource *resource, uint32_t id, const QString &handle) { - auto s = cast(resource); - - Q_ASSERT(s->foreignInterface); - const QString handle = QString::fromUtf8(h); - - XdgExportedUnstableV2Interface *exp = s->foreignInterface->d->exporter->exportedSurface(handle); - if (!exp) { - zxdg_imported_v2_send_destroyed(resource); + wl_resource *importedResource = wl_resource_create(resource->client(), &zxdg_imported_v2_interface, resource->version(), id); + if (!importedResource) { + wl_client_post_no_memory(resource->client()); return; } - wl_resource *surface = exp->parentResource(); - if (!surface) { - zxdg_imported_v2_send_destroyed(resource); + // If there is no exported surface with the specified handle, we must still create an + // inert xdg_imported object and send the destroyed event right afterwards. + XdgExportedV2Interface *exported = m_foreign->d->exporter->exportedSurface(handle); + if (!exported) { + auto imported = new XdgDummyImportedV2Interface(importedResource); + imported->send_destroyed(); return; } - QPointer imp = new XdgImportedUnstableV2Interface(s->q, surface); - imp->create(s->display->getConnection(client), wl_resource_get_version(resource), id); + XdgImportedV2Interface *imported = new XdgImportedV2Interface(exported, importedResource); - //surface no longer exported - connect(exp, &XdgExportedUnstableV2Interface::unbound, - s->q, [s, imp, handle]() { - //imp valid when the exported is deleted before the imported - if (imp) { - zxdg_imported_v2_send_destroyed(imp->resource()); - imp->deleteLater(); - } - s->importedSurfaces.remove(handle); - emit s->q->surfaceUnimported(handle); - }); - - connect(imp.data(), &XdgImportedUnstableV2Interface::childChanged, - s->q, [s, imp](SurfaceInterface *child) { - //remove any previous association - auto it = s->children.find(imp); - if (it != s->children.end()) { - s->parents.remove(*it); - s->children.erase(it); - } - - s->parents[child] = imp; - s->children[imp] = child; - SurfaceInterface *parent = SurfaceInterface::get(imp->parentResource()); - emit s->q->transientChanged(child, parent); - - //child surface destroyed - connect(child, &Resource::unbound, - s->q, [s, child]() { - auto it = s->parents.find(child); - if (it != s->parents.end()) { - KWayland::Server::XdgImportedUnstableV2Interface* parent = *it; - s->children.remove(*it); - s->parents.erase(it); - emit s->q->transientChanged(nullptr, SurfaceInterface::get(parent->parentResource())); - } - }); - }); - - //surface no longer imported - connect(imp.data(), &XdgImportedUnstableV2Interface::unbound, - s->q, [s, handle, imp]() { - s->importedSurfaces.remove(handle); - emit s->q->surfaceUnimported(handle); - - auto it = s->children.find(imp); - if (it != s->children.end()) { - KWayland::Server::SurfaceInterface* child = *it; - s->parents.remove(*it); - s->children.erase(it); - emit s->q->transientChanged(child, nullptr); - } - }); - - if (!imp->resource()) { - wl_resource_post_no_memory(resource); - delete imp; - return; - } + connect(imported, &XdgImportedV2Interface::childChanged, this, [this, imported](SurfaceInterface *child) { + link(imported, child); + + // child surface destroyed + connect(child, &QObject::destroyed, this, [this, child]() { + unlink(nullptr, child); + }); + }); - s->importedSurfaces[handle] = imp; - emit s->q->surfaceImported(handle, imp); + // surface no longer imported + connect(imported, &XdgImportedV2Interface::destroyed, this, [this, imported]() { + unlink(imported, nullptr); + }); } -XdgImporterUnstableV2Interface::Private::Private(XdgImporterUnstableV2Interface *q, Display *d, XdgForeignInterface *foreignInterface) - : Global::Private(d, &zxdg_importer_v2_interface, s_version) - , foreignInterface(foreignInterface) - , q(q) +void XdgImporterV2Interface::link(XdgImportedV2Interface *parent, SurfaceInterface *child) { + // remove any previous association + auto it = m_children.find(parent); + if (it != m_children.end()) { + m_parents.remove(*it); + m_children.erase(it); + } + + m_parents[child] = parent; + m_children[parent] = child; + + Q_EMIT m_foreign->transientChanged(child, parent->surface()); } -void XdgImporterUnstableV2Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) +void XdgImporterV2Interface::unlink(XdgImportedV2Interface *parent, SurfaceInterface *child) { - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zxdg_importer_v2_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; + if (parent) { + // If the parent endpoint is unlinked, the transientChanged() signal will indicate + // the orphaned child. + auto it = m_children.find(parent); + if (it != m_children.end()) { + SurfaceInterface *child = *it; + m_parents.remove(*it); + m_children.erase(it); + Q_EMIT m_foreign->transientChanged(child, nullptr); + } + } else if (child) { + // If the child endpoint is unlinked, the transientChanged() signal will indicate + // what parent has lost a child. + auto it = m_parents.find(child); + if (it != m_parents.end()) { + XdgImportedV2Interface *parent = *it; + m_children.remove(*it); + m_parents.erase(it); + Q_EMIT m_foreign->transientChanged(nullptr, parent->surface()); + } } - wl_resource_set_implementation(resource, &s_interface, this, unbind); - // TODO: should we track? } -void XdgImporterUnstableV2Interface::Private::unbind(wl_resource *resource) +XdgExportedV2Interface::XdgExportedV2Interface(SurfaceInterface *surface, wl_resource *resource) + : QtWaylandServer::zxdg_exported_v2(resource) + , m_surface(surface) { - Q_UNUSED(resource) - // TODO: implement? + connect(surface, &QObject::destroyed, this, &XdgExportedV2Interface::handleSurfaceDestroyed); } -class Q_DECL_HIDDEN XdgExportedUnstableV2Interface::Private : public Resource::Private +SurfaceInterface *XdgExportedV2Interface::surface() { -public: - Private(XdgExportedUnstableV2Interface *q, XdgExporterUnstableV2Interface *c, wl_resource *parentResource); - ~Private(); - -private: - - XdgExportedUnstableV2Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zxdg_exported_v2_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_exported_v2_interface XdgExportedUnstableV2Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif + return m_surface; +} -XdgExportedUnstableV2Interface::XdgExportedUnstableV2Interface(XdgExporterUnstableV2Interface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +void XdgExportedV2Interface::zxdg_exported_v2_destroy(Resource *resource) { + wl_resource_destroy(resource->handle); } -XdgExportedUnstableV2Interface::~XdgExportedUnstableV2Interface() -{} - -XdgExportedUnstableV2Interface::Private *XdgExportedUnstableV2Interface::d_func() const +void XdgExportedV2Interface::zxdg_exported_v2_destroy_resource(Resource *resource) { - return reinterpret_cast(d.data()); + Q_UNUSED(resource) + delete this; } -XdgExportedUnstableV2Interface::Private::Private(XdgExportedUnstableV2Interface *q, XdgExporterUnstableV2Interface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zxdg_exported_v2_interface, &s_interface) +void XdgExportedV2Interface::handleSurfaceDestroyed() { + delete this; } -XdgExportedUnstableV2Interface::Private::~Private() -{} - -class Q_DECL_HIDDEN XdgImportedUnstableV2Interface::Private : public Resource::Private +XdgDummyImportedV2Interface::XdgDummyImportedV2Interface(wl_resource *resource) + : QtWaylandServer::zxdg_imported_v2(resource) { -public: - Private(XdgImportedUnstableV2Interface *q, XdgImporterUnstableV2Interface *c, wl_resource *parentResource); - ~Private(); - - QPointer parentOf; - -private: - static void setParentOfCallback(wl_client *client, wl_resource *resource, wl_resource * surface); - - XdgImportedUnstableV2Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zxdg_imported_v2_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_imported_v2_interface XdgImportedUnstableV2Interface::Private::s_interface = { - resourceDestroyedCallback, - setParentOfCallback -}; -#endif +} -XdgImportedUnstableV2Interface::XdgImportedUnstableV2Interface(XdgImporterUnstableV2Interface *parent, wl_resource *parentResource) - : Resource(new Private(this, parent, parentResource)) +void XdgDummyImportedV2Interface::zxdg_imported_v2_destroy(Resource *resource) { + wl_resource_destroy(resource->handle); } -XdgImportedUnstableV2Interface::~XdgImportedUnstableV2Interface() -{} +void XdgDummyImportedV2Interface::zxdg_imported_v2_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; +} -XdgImportedUnstableV2Interface::Private *XdgImportedUnstableV2Interface::d_func() const +XdgImportedV2Interface::XdgImportedV2Interface(XdgExportedV2Interface *exported, wl_resource *resource) + : QtWaylandServer::zxdg_imported_v2(resource) + , m_exported(exported) { - return reinterpret_cast(d.data()); + connect(exported, &QObject::destroyed, this, &XdgImportedV2Interface::handleExportedDestroyed); } -SurfaceInterface *XdgImportedUnstableV2Interface::child() const +SurfaceInterface *XdgImportedV2Interface::child() const { - Q_D(); - return d->parentOf.data(); + return m_child; } -void XdgImportedUnstableV2Interface::Private::setParentOfCallback(wl_client *client, wl_resource *resource, wl_resource * surface) +SurfaceInterface *XdgImportedV2Interface::surface() const { - Q_UNUSED(client) + return m_exported->surface(); +} - auto s = cast(resource); +void XdgImportedV2Interface::zxdg_imported_v2_set_parent_of(Resource *resource, wl_resource *surface) +{ + Q_UNUSED(resource) SurfaceInterface *surf = SurfaceInterface::get(surface); if (!surf) { return; } - s->parentOf = surf; - emit s->q_func()->childChanged(surf); + m_child = surf; + Q_EMIT childChanged(surf); } -XdgImportedUnstableV2Interface::Private::Private(XdgImportedUnstableV2Interface *q, XdgImporterUnstableV2Interface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zxdg_imported_v2_interface, &s_interface) +void XdgImportedV2Interface::zxdg_imported_v2_destroy(Resource *resource) { + wl_resource_destroy(resource->handle); } -XdgImportedUnstableV2Interface::Private::~Private() -{} - +void XdgImportedV2Interface::zxdg_imported_v2_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + delete this; } + +void XdgImportedV2Interface::handleExportedDestroyed() +{ + send_destroyed(); + delete this; } +} diff -Nru dwayland-5.57.0.23/src/server/xdgforeign_v2_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface.h --- dwayland-5.57.0.23/src/server/xdgforeign_v2_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,60 @@ +/* + SPDX-FileCopyrightText: 2017 Marco Martin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once + +#include + +#include + +namespace KWaylandServer +{ +class Display; +class SurfaceInterface; +class XdgForeignV2InterfacePrivate; + +/** + * This class encapsulates the server side logic of the XdgForeign protocol. + * a process can export a surface to be identifiable by a server-wide unique + * string handle, and another process can in turn import that surface, and set it + * as transient parent for one of its own surfaces. + * This parent relationship is traced by the transientChanged signal and the + * transientFor method. + */ +class KWAYLANDSERVER_EXPORT XdgForeignV2Interface : public QObject +{ + Q_OBJECT +public: + XdgForeignV2Interface(Display *display, QObject *parent = nullptr); + ~XdgForeignV2Interface() override; + + /** + * If a client did import a surface and set one of its own as child of the + * imported one, this returns the mapping. + * @param surface the child surface we want to search an imported transientParent for. + * @returns the transient parent of the surface, if found, nullptr otherwise. + */ + SurfaceInterface *transientFor(SurfaceInterface *surface); + +Q_SIGNALS: + /** + * A surface got a new imported transient parent + * @param parent is the surface exported by one client and imported into another, which will act as parent. + * @param child is the surface that the importer client did set as child of the surface + * that it imported. + * If one of the two paramenters is nullptr, it means that a previously relation is not + * valid anymore and either one of the surfaces has been unmapped, or the parent surface + * is not exported anymore. + */ + void transientChanged(KWaylandServer::SurfaceInterface *child, KWaylandServer::SurfaceInterface *parent); + +private: + friend class XdgExporterV2Interface; + friend class XdgImporterV2Interface; + QScopedPointer d; +}; + +} diff -Nru dwayland-5.57.0.23/src/server/xdgforeign_v2_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface_p.h --- dwayland-5.57.0.23/src/server/xdgforeign_v2_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgforeign_v2_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,124 +1,125 @@ -/**************************************************************************** -Copyright 2017 Marco Martin +/* + SPDX-FileCopyrightText: 2017 Marco Martin + SPDX-FileCopyrightText: 2021 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. +#include "surface_interface_p.h" +#include "xdgforeign_v2_interface.h" -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGFOREIGNV2_INTERFACE_P_H -#define KWAYLAND_SERVER_XDGFOREIGNV2_INTERFACE_P_H +#include -#include "global.h" -#include "resource.h" - -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class XdgExportedV2Interface; +class XdgImportedV2Interface; +class XdgImporterV2Interface; +class XdgExporterV2Interface; -class Display; -class SurfaceInterface; -class XdgExportedUnstableV2Interface; -class XdgImportedUnstableV2Interface; - -class Q_DECL_HIDDEN XdgForeignInterface::Private +class XdgForeignV2InterfacePrivate { public: - Private(Display *display, XdgForeignInterface *q); + XdgForeignV2InterfacePrivate(Display *display, XdgForeignV2Interface *q); - XdgForeignInterface *q; - XdgExporterUnstableV2Interface *exporter; - XdgImporterUnstableV2Interface *importer; + XdgForeignV2Interface *q; + QScopedPointer exporter; + QScopedPointer importer; }; -class Q_DECL_HIDDEN XdgExporterUnstableV2Interface : public Global +class XdgExporterV2Interface : public QObject, public QtWaylandServer::zxdg_exporter_v2 { Q_OBJECT + public: - virtual ~XdgExporterUnstableV2Interface(); + XdgExporterV2Interface(Display *display, XdgForeignV2Interface *foreign); - XdgExportedUnstableV2Interface *exportedSurface(const QString &handle); + XdgExportedV2Interface *exportedSurface(const QString &handle); -Q_SIGNALS: - void surfaceExported(const QString &handle, XdgExportedUnstableV2Interface *exported); - void surfaceUnexported(const QString &handle); +protected: + void zxdg_exporter_v2_destroy(Resource *resource) override; + void zxdg_exporter_v2_export_toplevel(Resource *resource, uint32_t id, wl_resource *surface) override; private: - explicit XdgExporterUnstableV2Interface(Display *display, XdgForeignInterface *parent = nullptr); - friend class Display; - friend class XdgForeignInterface; - class Private; - Private *d_func() const; + XdgForeignV2Interface *m_foreign; + QHash m_exportedSurfaces; }; -class Q_DECL_HIDDEN XdgImporterUnstableV2Interface : public Global +class XdgImporterV2Interface : public QObject, public QtWaylandServer::zxdg_importer_v2 { Q_OBJECT + public: - virtual ~XdgImporterUnstableV2Interface(); + XdgImporterV2Interface(Display *display, XdgForeignV2Interface *foreign); + + void link(XdgImportedV2Interface *parent, SurfaceInterface *child); + void unlink(XdgImportedV2Interface *parent, SurfaceInterface *child); - XdgImportedUnstableV2Interface *importedSurface(const QString &handle); SurfaceInterface *transientFor(SurfaceInterface *surface); -Q_SIGNALS: - void surfaceImported(const QString &handle, XdgImportedUnstableV2Interface *imported); - void surfaceUnimported(const QString &handle); - void transientChanged(KWayland::Server::SurfaceInterface *child, KWayland::Server::SurfaceInterface *parent); +protected: + void zxdg_importer_v2_destroy(Resource *resource) override; + void zxdg_importer_v2_import_toplevel(Resource *resource, uint32_t id, const QString &handle) override; private: - explicit XdgImporterUnstableV2Interface(Display *display, XdgForeignInterface *parent = nullptr); - friend class Display; - friend class XdgForeignInterface; - class Private; - Private *d_func() const; + XdgForeignV2Interface *m_foreign; + QHash m_parents; // child->parent hash + QHash m_children; // parent->child hash }; -class Q_DECL_HIDDEN XdgExportedUnstableV2Interface : public Resource +class XdgExportedV2Interface : public QObject, public QtWaylandServer::zxdg_exported_v2 { Q_OBJECT + public: - virtual ~XdgExportedUnstableV2Interface(); + explicit XdgExportedV2Interface(SurfaceInterface *surface, wl_resource *resource); + + SurfaceInterface *surface(); + +protected: + void zxdg_exported_v2_destroy(Resource *resource) override; + void zxdg_exported_v2_destroy_resource(Resource *resource) override; + +private Q_SLOTS: + void handleSurfaceDestroyed(); private: - explicit XdgExportedUnstableV2Interface(XdgExporterUnstableV2Interface *parent, wl_resource *parentResource); - friend class XdgExporterUnstableV2Interface; + SurfaceInterface *m_surface; +}; + +class XdgDummyImportedV2Interface : public QtWaylandServer::zxdg_imported_v2 +{ +public: + explicit XdgDummyImportedV2Interface(wl_resource *resource); - class Private; - Private *d_func() const; +protected: + void zxdg_imported_v2_destroy(Resource *resource) override; + void zxdg_imported_v2_destroy_resource(Resource *resource) override; }; -class Q_DECL_HIDDEN XdgImportedUnstableV2Interface : public Resource +class XdgImportedV2Interface : public QObject, QtWaylandServer::zxdg_imported_v2 { Q_OBJECT public: - virtual ~XdgImportedUnstableV2Interface(); + explicit XdgImportedV2Interface(XdgExportedV2Interface *exported, wl_resource *resource); SurfaceInterface *child() const; + SurfaceInterface *surface() const; Q_SIGNALS: - void childChanged(KWayland::Server::SurfaceInterface *child); + void childChanged(KWaylandServer::SurfaceInterface *child); + +private Q_SLOTS: + void handleExportedDestroyed(); private: - explicit XdgImportedUnstableV2Interface(XdgImporterUnstableV2Interface *parent, wl_resource *parentResource); - friend class XdgImporterUnstableV2Interface; + XdgExportedV2Interface *m_exported; + QPointer m_child; - class Private; - Private *d_func() const; +protected: + void zxdg_imported_v2_set_parent_of(Resource *resource, wl_resource *surface) override; + void zxdg_imported_v2_destroy(Resource *resource) override; + void zxdg_imported_v2_destroy_resource(Resource *resource) override; }; - } -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgoutput_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_interface.cpp --- dwayland-5.57.0.23/src/server/xdgoutput_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,390 +0,0 @@ -/**************************************************************************** -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgoutput_interface.h" -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "output_interface.h" - -#include -#include -#include - -namespace KWayland -{ -namespace Server -{ - -class XdgOutputManagerInterface::Private : public Global::Private -{ -public: - Private(XdgOutputManagerInterface *q, Display *d); - QHash outputs; - -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getXdgOutputCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * output); - - XdgOutputManagerInterface *q; - static const struct zxdg_output_manager_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 XdgOutputManagerInterface::Private::s_version = 2; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_output_manager_v1_interface XdgOutputManagerInterface::Private::s_interface = { - destroyCallback, - getXdgOutputCallback -}; -#endif - -class XdgOutputV1Interface: public Resource -{ -public: - XdgOutputV1Interface(XdgOutputManagerInterface *parent, wl_resource *parentResource); - ~XdgOutputV1Interface(); - void setLogicalSize(const QSize &size); - void setLogicalPosition(const QPoint &pos); - void setName(const QString &name); - void setDescription(const QString &description); - void done(); -private: - class Private; -}; - -class XdgOutputInterface::Private -{ -public: - void resourceConnected(XdgOutputV1Interface *resource); - void resourceDisconnected(XdgOutputV1Interface *resource); - QPoint pos; - QSize size; - QString name; - QString description; - bool dirty = false; - bool doneOnce = false; - QList resources; -}; - - -XdgOutputManagerInterface::XdgOutputManagerInterface(Display *display, QObject *parent) - : Global(new XdgOutputManagerInterface::Private(this, display), parent) -{ -} - -XdgOutputManagerInterface::~XdgOutputManagerInterface() -{} - -XdgOutputInterface* XdgOutputManagerInterface::createXdgOutput(OutputInterface *output, QObject *parent) -{ - Q_D(); - if (!d->outputs.contains(output)) { - auto xdgOutput = new XdgOutputInterface(parent); - d->outputs[output] = xdgOutput; - //as XdgOutput lifespan is managed by user, delete our mapping when either - //it or the relevant Output gets deleted - connect(output, &QObject::destroyed, this, [this, output]() { - Q_D(); - d->outputs.remove(output); - }); - connect(xdgOutput, &QObject::destroyed, this, [this, output]() { - Q_D(); - d->outputs.remove(output); - }); - - } - return d->outputs[output]; -} - -XdgOutputManagerInterface::Private* XdgOutputManagerInterface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -void XdgOutputManagerInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void XdgOutputManagerInterface::Private::getXdgOutputCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * outputResource) -{ - auto d = cast(resource); - auto output = OutputInterface::get(outputResource); - if (!output) { // output client is requesting XdgOutput for an Output that doesn't exist - return; - } - if (!d->outputs.contains(output)) { - return; //server hasn't created an XdgOutput for this output yet, give the client nothing - } - auto iface = new XdgOutputV1Interface(d->q, resource); - iface->create(d->display->getConnection(client), wl_resource_get_version(resource), id); - if (!iface->resource()) { - wl_resource_post_no_memory(resource); - delete iface; - return; - } - - auto xdgOutput = d->outputs[output]; - - // when output global gets destroyed, remove connected resource to avoid - // invalid events sent. - connect(output, &OutputInterface::aboutToDestroyGlobal, xdgOutput, [xdgOutput, iface]() { - xdgOutput->d->resourceDisconnected(iface); - }, Qt::QueuedConnection); - - xdgOutput->d->resourceConnected(iface); - connect(iface, &XdgOutputV1Interface::unbound, xdgOutput, [xdgOutput, iface]() { - xdgOutput->d->resourceDisconnected(iface); - }); -} - -XdgOutputManagerInterface::Private::Private(XdgOutputManagerInterface *qptr, Display *d) - : Global::Private(d, &zxdg_output_manager_v1_interface, s_version) - , q(qptr) -{ -} - -void XdgOutputManagerInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zxdg_output_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void XdgOutputManagerInterface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -XdgOutputInterface::XdgOutputInterface(QObject *parent): - QObject(parent), - d(new XdgOutputInterface::Private) -{ -} - -XdgOutputInterface::~XdgOutputInterface() -{} - -void XdgOutputInterface::setLogicalSize(const QSize &size) -{ - if (size == d->size) { - return; - } - d->size = size; - d->dirty = true; - for(auto resource: d->resources) { - resource->setLogicalSize(size); - } -} - -QSize XdgOutputInterface::logicalSize() const -{ - return d->size; -} - -void XdgOutputInterface::setLogicalPosition(const QPoint &pos) -{ - if (pos == d->pos) { - return; - } - d->pos = pos; - d->dirty = true; - for(auto resource: d->resources) { - resource->setLogicalPosition(pos); - } -} - -QPoint XdgOutputInterface::logicalPosition() const -{ - return d->pos; -} - -void XdgOutputInterface::setName(const QString &name) -{ - if (name == d->name) { - return; - } - d->name = name; - d->dirty = true; - for(auto resource: d->resources) { - resource->setName(name); - } -} - -QString XdgOutputInterface::name() const -{ - return d->name; -} - -void XdgOutputInterface::setDescription(const QString &description) -{ - if (description == d->description) { - return; - } - d->description = description; - d->dirty = true; - for(auto resource: d->resources) { - resource->setDescription(description); - } -} - -QString XdgOutputInterface::description() const -{ - return d->description; -} - -void XdgOutputInterface::done() -{ - d->doneOnce = true; - if (!d->dirty) { - return; - } - d->dirty = false; - for(auto resource: d->resources) { - resource->done(); - } -} - -void XdgOutputInterface::Private::resourceConnected(XdgOutputV1Interface *resource) -{ - qDebug() << "resouce" << pos << size << name << description; - resource->setLogicalPosition(pos); - resource->setLogicalSize(size); - if (!name.isEmpty()) { - resource->setName(name); - } - if (!description.isEmpty()) { - resource->setDescription(description); - } - if (doneOnce) { - resource->done(); - } - resources << resource; -} - -void XdgOutputInterface::Private::resourceDisconnected(XdgOutputV1Interface *resource) -{ - resources.removeOne(resource); -} - - -class XdgOutputV1Interface::Private : public Resource::Private -{ -public: - Private(XdgOutputV1Interface *q, XdgOutputManagerInterface *c, wl_resource *parentResource); - ~Private(); - -private: - - XdgOutputV1Interface *q_func() { - return reinterpret_cast(q); - } - - static const struct zxdg_output_v1_interface s_interface; -}; - -XdgOutputV1Interface::XdgOutputV1Interface(XdgOutputManagerInterface *parent, wl_resource *parentResource) - :Resource(new XdgOutputV1Interface::Private(this, parent, parentResource)) -{} - -XdgOutputV1Interface::~XdgOutputV1Interface() -{} - -void XdgOutputV1Interface::setLogicalSize(const QSize &size) -{ - if (!d->resource) { - return; - } - zxdg_output_v1_send_logical_size(d->resource, size.width(), size.height()); -} - -void XdgOutputV1Interface::setLogicalPosition(const QPoint &pos) -{ - if (!d->resource) { - return; - } - zxdg_output_v1_send_logical_position(d->resource, pos.x(), pos.y()); -} - -void XdgOutputV1Interface::setName(const QString &name) -{ - if (!d->resource) { - return; - } - if (wl_resource_get_version(d->resource) < ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) { - return; - } - zxdg_output_v1_send_name(d->resource, name.toUtf8().constData()); -} - -void XdgOutputV1Interface::setDescription(const QString &description) -{ - if (!d->resource) { - return; - } - if (wl_resource_get_version(d->resource) < ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION) { - return; - } - zxdg_output_v1_send_description(d->resource, description.toUtf8().constData()); -} - -void XdgOutputV1Interface::done() -{ - if (!d->resource) { - return; - } - zxdg_output_v1_send_done(d->resource); -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_output_v1_interface XdgOutputV1Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -XdgOutputV1Interface::Private::Private(XdgOutputV1Interface *q, XdgOutputManagerInterface *c, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zxdg_output_v1_interface, &s_interface) -{ -} - -XdgOutputV1Interface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgoutput_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_interface.h --- dwayland-5.57.0.23/src/server/xdgoutput_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -/**************************************************************************** -Copyright 2018 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H -#define KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H - -#include "global.h" -#include "resource.h" - - -#include - - -/* - * In terms of protocol XdgOutputInterface are a resource - * but for the sake of sanity, we should treat XdgOutputs as globals like Output is - * Hence this doesn't match most of kwayland API paradigms. - */ - -namespace KWayland -{ -namespace Server -{ - -class Display; -class OutputInterface; -class XdgOutputInterface; - -/** - * Global manager for XdgOutputs - * @since 5.47 - */ -class KWAYLANDSERVER_EXPORT XdgOutputManagerInterface : public Global -{ - Q_OBJECT -public: - virtual ~XdgOutputManagerInterface(); - /** - * Creates an XdgOutputInterface object for an existing Output - * which exposes XDG specific properties of outputs - * - * @arg output the wl_output interface this XDG output is for - * @parent the parent of the newly created object - */ - XdgOutputInterface* createXdgOutput(OutputInterface *output, QObject *parent); -private: - explicit XdgOutputManagerInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -/** - * Extension to Output - * Users should set all relevant values on creation and on future changes. - * done() should be explicitly called after change batches including initial setting. - * @since 5.47 - */ -class KWAYLANDSERVER_EXPORT XdgOutputInterface : public QObject -{ - Q_OBJECT -public: - virtual ~XdgOutputInterface(); - - /** - * Sets the size of this output in logical co-ordinates. - * Users should call done() after setting all values - */ - void setLogicalSize(const QSize &size); - - /** - * Returns the last set logical size on this output - */ - QSize logicalSize() const; - - /** - * Sets the topleft position of this output in logical co-ordinates. - * Users should call done() after setting all values - * @see OutputInterface::setPosition - */ - void setLogicalPosition(const QPoint &pos); - - /** - * Returns the last set logical position on this output - */ - QPoint logicalPosition() const; - - /** - * @brief Sets a short name of the output - * This should be consistent across reboots for the same monitor - * It should be set once before the first done call - * @since 5.XDGOUTPUT - */ - void setName(const QString &name); - /** - * The last set name - * @since 5.XDGOUTPUT - */ - QString name() const; - - /** - * @brief Sets a longer description of the output - * This should be consistent across reboots for the same monitor - * It should be set once before the first done call - * @since 5.XDGOUTPUT - */ - void setDescription(const QString &description); - /** - * The last set description - * @since 5.XDGOUTPUT - */ - QString description() const; - - /** - * Submit changes to all clients - */ - void done(); - -private: - explicit XdgOutputInterface(QObject *parent); - friend class XdgOutputManagerInterface; - - class Private; - QScopedPointer d; -}; - - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgoutput_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_v1_interface.cpp --- dwayland-5.57.0.23/src/server/xdgoutput_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_v1_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,211 @@ +/* + SPDX-FileCopyrightText: 2018 David Edmundson + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "xdgoutput_v1_interface.h" +#include "display.h" +#include "output_interface.h" + +#include "qwayland-server-xdg-output-unstable-v1.h" + +#include +#include +#include + +namespace KWaylandServer +{ +static const quint32 s_version = 3; + +class XdgOutputManagerV1InterfacePrivate : public QtWaylandServer::zxdg_output_manager_v1 +{ +public: + XdgOutputManagerV1InterfacePrivate(XdgOutputManagerV1Interface *q, Display *display); + QHash outputs; + + XdgOutputManagerV1Interface *q; + +protected: + void zxdg_output_manager_v1_destroy(Resource *resource) override; + void zxdg_output_manager_v1_get_xdg_output(Resource *resource, uint32_t id, wl_resource *output) override; +}; + +class XdgOutputV1InterfacePrivate : public QtWaylandServer::zxdg_output_v1 +{ +public: + XdgOutputV1InterfacePrivate(OutputInterface *wlOutput) + : output(wlOutput) + { + } + + QPoint pos; + QSize size; + QString name; + QString description; + bool dirty = false; + bool doneOnce = false; + QPointer output; + +protected: + void zxdg_output_v1_bind_resource(Resource *resource) override; + void zxdg_output_v1_destroy(Resource *resource) override; +}; + +XdgOutputManagerV1Interface::XdgOutputManagerV1Interface(Display *display, QObject *parent) + : QObject(parent) + , d(new XdgOutputManagerV1InterfacePrivate(this, display)) +{ +} + +XdgOutputManagerV1Interface::~XdgOutputManagerV1Interface() +{ +} + +XdgOutputV1Interface *XdgOutputManagerV1Interface::createXdgOutput(OutputInterface *output, QObject *parent) +{ + Q_ASSERT_X(!d->outputs.contains(output), "createXdgOutput", "An XdgOuputInterface already exists for this output"); + + auto xdgOutput = new XdgOutputV1Interface(output, parent); + d->outputs[output] = xdgOutput; + + // as XdgOutput lifespan is managed by user, delete our mapping when either + // it or the relevant Output gets deleted + connect(output, &QObject::destroyed, this, [this, output]() { + d->outputs.remove(output); + }); + connect(xdgOutput, &QObject::destroyed, this, [this, output]() { + d->outputs.remove(output); + }); + + return xdgOutput; +} + +XdgOutputManagerV1InterfacePrivate::XdgOutputManagerV1InterfacePrivate(XdgOutputManagerV1Interface *qptr, Display *d) + : QtWaylandServer::zxdg_output_manager_v1(*d, s_version) + , q(qptr) +{ +} + +void XdgOutputManagerV1InterfacePrivate::zxdg_output_manager_v1_get_xdg_output(Resource *resource, uint32_t id, wl_resource *outputResource) +{ + auto output = OutputInterface::get(outputResource); + if (!output) { // output client is requesting XdgOutput for an Output that doesn't exist + return; + } + auto xdgOutput = outputs.value(output); + if (!xdgOutput) { + return; // client is requesting XdgOutput for an Output that doesn't exist + } + xdgOutput->d->add(resource->client(), id, resource->version()); +} + +void XdgOutputManagerV1InterfacePrivate::zxdg_output_manager_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +XdgOutputV1Interface::XdgOutputV1Interface(OutputInterface *output, QObject *parent) + : QObject(parent) + , d(new XdgOutputV1InterfacePrivate(output)) +{ +} + +XdgOutputV1Interface::~XdgOutputV1Interface() +{ +} + +void XdgOutputV1Interface::setLogicalSize(const QSize &size) +{ + if (size == d->size) { + return; + } + d->size = size; + d->dirty = true; + + const auto outputResources = d->resourceMap(); + for (auto resource : outputResources) { + d->send_logical_size(resource->handle, size.width(), size.height()); + } +} + +QSize XdgOutputV1Interface::logicalSize() const +{ + return d->size; +} + +void XdgOutputV1Interface::setLogicalPosition(const QPoint &pos) +{ + if (pos == d->pos) { + return; + } + d->pos = pos; + d->dirty = true; + + const auto outputResources = d->resourceMap(); + for (auto resource : outputResources) { + d->send_logical_position(resource->handle, pos.x(), pos.y()); + } +} + +QPoint XdgOutputV1Interface::logicalPosition() const +{ + return d->pos; +} + +void XdgOutputV1Interface::setName(const QString &name) +{ + d->name = name; + // this can only be set once before the client connects +} + +void XdgOutputV1Interface::setDescription(const QString &description) +{ + d->description = description; + // this can only be set once before the client connects +} + +void XdgOutputV1Interface::done() +{ + d->doneOnce = true; + if (!d->dirty) { + return; + } + d->dirty = false; + + const auto outputResources = d->resourceMap(); + for (auto resource : outputResources) { + if (wl_resource_get_version(resource->handle) < 3) { + d->send_done(resource->handle); + } + } +} + +void XdgOutputV1InterfacePrivate::zxdg_output_v1_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void XdgOutputV1InterfacePrivate::zxdg_output_v1_bind_resource(Resource *resource) +{ + send_logical_position(resource->handle, pos.x(), pos.y()); + send_logical_size(resource->handle, size.width(), size.height()); + if (resource->version() >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) { + send_name(resource->handle, name); + } + if (resource->version() >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION) { + send_description(resource->handle, description); + } + + if (doneOnce) { + if (wl_resource_get_version(resource->handle) >= 3) { + if (output) { + output->done(resource->client()); + } + } else { + send_done(resource->handle); + } + } +} + +} diff -Nru dwayland-5.57.0.23/src/server/xdgoutput_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_v1_interface.h --- dwayland-5.57.0.23/src/server/xdgoutput_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgoutput_v1_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,123 @@ +/* + SPDX-FileCopyrightText: 2018 David Edmundson + SPDX-FileCopyrightText: 2020 David Edmundson + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#ifndef KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H +#define KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H + +#include + +#include + +/* + * In terms of protocol XdgOutputInterface are a resource + * but for the sake of sanity, we should treat XdgOutputs as globals like Output is + * Hence this doesn't match most of kwayland API paradigms. + */ + +namespace KWaylandServer +{ +class Display; +class OutputInterface; +class XdgOutputV1Interface; + +class XdgOutputManagerV1InterfacePrivate; +class XdgOutputV1InterfacePrivate; + +/** + * Global manager for XdgOutputs + */ +class KWAYLANDSERVER_EXPORT XdgOutputManagerV1Interface : public QObject +{ + Q_OBJECT + +public: + explicit XdgOutputManagerV1Interface(Display *display, QObject *parent = nullptr); + ~XdgOutputManagerV1Interface() override; + /** + * Creates an XdgOutputInterface object for an existing Output + * which exposes XDG specific properties of outputs + * + * @arg output the wl_output interface this XDG output is for + * @parent the parent of the newly created object + */ + XdgOutputV1Interface *createXdgOutput(OutputInterface *output, QObject *parent); + +private: + QScopedPointer d; +}; + +/** + * Extension to Output + * Users should set all relevant values on creation and on future changes. + * done() should be explicitly called after change batches including initial setting. + */ +class KWAYLANDSERVER_EXPORT XdgOutputV1Interface : public QObject +{ + Q_OBJECT +public: + ~XdgOutputV1Interface() override; + + /** + * Sets the size of this output in logical co-ordinates. + * Users should call done() after setting all values + */ + void setLogicalSize(const QSize &size); + + /** + * Returns the last set logical size on this output + */ + QSize logicalSize() const; + + /** + * Sets the topleft position of this output in logical co-ordinates. + * Users should call done() after setting all values + * @see OutputInterface::setPosition + */ + void setLogicalPosition(const QPoint &pos); + + /** + * Returns the last set logical position on this output + */ + QPoint logicalPosition() const; + + /** + * @brief Sets a short name of the output + * This should be consistent across reboots for the same monitor + * It should be set once before the first done call + */ + void setName(const QString &name); + /** + * The last set name + */ + void name() const; + + /** + * @brief Sets a longer description of the output + * This should be consistent across reboots for the same monitor + * It should be set once before the first done call + */ + void setDescription(const QString &description); + /** + * The last set description + */ + void description() const; + + /** + * Submit changes to all clients + */ + void done(); + +private: + explicit XdgOutputV1Interface(OutputInterface *output, QObject *parent); + friend class XdgOutputManagerV1Interface; + friend class XdgOutputManagerV1InterfacePrivate; + + QScopedPointer d; +}; + +} + +#endif diff -Nru dwayland-5.57.0.23/src/server/xdgshell_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface.cpp --- dwayland-5.57.0.23/src/server/xdgshell_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,273 +1,1026 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#include "xdgshell_interface.h" #include "xdgshell_interface_p.h" -namespace KWayland +#include "display.h" +#include "output_interface.h" +#include "seat_interface.h" +#include "utils.h" + +#include + +namespace KWaylandServer +{ +static const int s_version = 3; + +XdgShellInterfacePrivate::XdgShellInterfacePrivate(XdgShellInterface *shell) + : q(shell) +{ +} + +static wl_client *clientFromXdgSurface(XdgSurfaceInterface *surface) { -namespace Server + return XdgSurfaceInterfacePrivate::get(surface)->resource()->client(); +} + +XdgShellInterfacePrivate::Resource *XdgShellInterfacePrivate::resourceForXdgSurface(XdgSurfaceInterface *surface) const { + return resourceMap().value(clientFromXdgSurface(surface)); +} -XdgShellInterface::Private::Private(XdgShellInterfaceVersion interfaceVersion, XdgShellInterface *q, Display *d, const wl_interface *interface, quint32 version) - : Global::Private(d, interface, version) - , interfaceVersion(interfaceVersion) - , q(q) +void XdgShellInterfacePrivate::registerXdgSurface(XdgSurfaceInterface *surface) { + xdgSurfaces.insert(clientFromXdgSurface(surface), surface); } -void XdgShellInterface::Private::setupTimer(quint32 serial) +void XdgShellInterfacePrivate::unregisterXdgSurface(XdgSurfaceInterface *surface) { - QTimer *pingTimer = new QTimer(); - pingTimer->setSingleShot(false); - pingTimer->setInterval(1000); - int attempt = 0; - connect(pingTimer, &QTimer::timeout, q, [this, serial, attempt]() mutable { + xdgSurfaces.remove(clientFromXdgSurface(surface), surface); +} + +/** + * @todo Whether the ping is delayed or has timed out is out of domain of the XdgShellInterface. + * Such matter must be handled somewhere else, e.g. XdgToplevelClient, not here! + */ +void XdgShellInterfacePrivate::registerPing(quint32 serial) +{ + QTimer *timer = new QTimer(q); + timer->setInterval(1000); + QObject::connect(timer, &QTimer::timeout, q, [this, serial, attempt = 0]() mutable { ++attempt; if (attempt == 1) { - emit q->pingDelayed(serial); - } else { - emit q->pingTimeout(serial); - auto timerIt = pingTimers.find(serial); - if (timerIt != pingTimers.end()) { - delete timerIt.value(); - pingTimers.erase(timerIt); - } + Q_EMIT q->pingDelayed(serial); + return; } + Q_EMIT q->pingTimeout(serial); + delete pings.take(serial); }); + pings.insert(serial, timer); + timer->start(); +} - pingTimers.insert(serial, pingTimer); - pingTimer->start(); +XdgShellInterfacePrivate *XdgShellInterfacePrivate::get(XdgShellInterface *shell) +{ + return shell->d.data(); } -XdgShellInterface::XdgShellInterface(Private *d, QObject *parent) - : Global(d, parent) +void XdgShellInterfacePrivate::xdg_wm_base_destroy(Resource *resource) { + if (xdgSurfaces.contains(resource->client())) { + wl_resource_post_error(resource->handle, error_defunct_surfaces, "xdg_wm_base was destroyed before children"); + return; + } + wl_resource_destroy(resource->handle); } -XdgShellInterface::~XdgShellInterface() = default; +void XdgShellInterfacePrivate::xdg_wm_base_create_positioner(Resource *resource, uint32_t id) +{ + wl_resource *positionerResource = wl_resource_create(resource->client(), &xdg_positioner_interface, resource->version(), id); + new XdgPositionerPrivate(positionerResource); +} -XdgShellSurfaceInterface *XdgShellInterface::getSurface(wl_resource *native) +void XdgShellInterfacePrivate::xdg_wm_base_get_xdg_surface(Resource *resource, uint32_t id, ::wl_resource *surfaceResource) { - Q_UNUSED(native) - return nullptr; + SurfaceInterface *surface = SurfaceInterface::get(surfaceResource); + + if (surface->buffer()) { + wl_resource_post_error(resource->handle, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER, "xdg_surface must not have a buffer at creation"); + return; + } + + wl_resource *xdgSurfaceResource = wl_resource_create(resource->client(), &xdg_surface_interface, resource->version(), id); + + XdgSurfaceInterface *xdgSurface = new XdgSurfaceInterface(q, surface, xdgSurfaceResource); + registerXdgSurface(xdgSurface); } -XdgShellInterfaceVersion XdgShellInterface::interfaceVersion() const +void XdgShellInterfacePrivate::xdg_wm_base_pong(Resource *resource, uint32_t serial) { - Q_D(); - return d->interfaceVersion; + Q_UNUSED(resource) + if (QTimer *timer = pings.take(serial)) { + delete timer; + } + Q_EMIT q->pongReceived(serial); } -quint32 XdgShellInterface::ping(XdgShellSurfaceInterface * surface) +XdgShellInterface::XdgShellInterface(Display *display, QObject *parent) + : QObject(parent) + , d(new XdgShellInterfacePrivate(this)) { - return d_func()->ping(surface); + d->display = display; + d->init(*display, s_version); } -XdgShellInterface::Private *XdgShellInterface::d_func() const +XdgShellInterface::~XdgShellInterface() { - return reinterpret_cast(d.data()); } -XdgShellSurfaceInterface::Private::Private(XdgShellInterfaceVersion interfaceVersion, XdgShellSurfaceInterface *q, Global *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) - , GenericShellSurface(q, surface) - , interfaceVersion(interfaceVersion) +Display *XdgShellInterface::display() const { + return d->display; } -XdgShellSurfaceInterface::Private::~Private() = default; +quint32 XdgShellInterface::ping(XdgSurfaceInterface *surface) +{ + XdgShellInterfacePrivate::Resource *clientResource = d->resourceForXdgSurface(surface); + if (!clientResource) + return 0; + + quint32 serial = d->display->nextSerial(); + d->send_ping(clientResource->handle, serial); + d->registerPing(serial); + + return serial; +} -XdgShellSurfaceInterface::XdgShellSurfaceInterface(Private *p) - : Resource(p) +XdgSurfaceInterfacePrivate::XdgSurfaceInterfacePrivate(XdgSurfaceInterface *xdgSurface) + : q(xdgSurface) { } -XdgShellSurfaceInterface::~XdgShellSurfaceInterface() = default; +void XdgSurfaceInterfacePrivate::commit() +{ + if (surface->buffer()) { + firstBufferAttached = true; + } + + if (next.acknowledgedConfigureIsSet) { + current.acknowledgedConfigure = next.acknowledgedConfigure; + next.acknowledgedConfigureIsSet = false; + Q_EMIT q->configureAcknowledged(current.acknowledgedConfigure); + } + + if (next.windowGeometryIsSet) { + current.windowGeometry = next.windowGeometry; + next.windowGeometryIsSet = false; + Q_EMIT q->windowGeometryChanged(current.windowGeometry); + } +} + +void XdgSurfaceInterfacePrivate::reset() +{ + firstBufferAttached = false; + isConfigured = false; + current = XdgSurfaceState{}; + next = XdgSurfaceState{}; + Q_EMIT q->resetOccurred(); +} -XdgShellInterfaceVersion XdgShellSurfaceInterface::interfaceVersion() const +XdgSurfaceInterfacePrivate *XdgSurfaceInterfacePrivate::get(XdgSurfaceInterface *surface) { - Q_D(); - return d->interfaceVersion; + return surface->d.data(); } -quint32 XdgShellSurfaceInterface::configure(States states, const QSize &size) +void XdgSurfaceInterfacePrivate::xdg_surface_destroy_resource(Resource *resource) { - Q_D(); - return d->configure(states, size); + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + XdgShellInterfacePrivate::get(shell)->unregisterXdgSurface(q); + delete q; } -bool XdgShellSurfaceInterface::isConfigurePending() const +void XdgSurfaceInterfacePrivate::xdg_surface_destroy(Resource *resource) { - Q_D(); - return !d->configureSerials.isEmpty(); + if (toplevel || popup) { + qWarning() << "Tried to destroy xdg_surface before its role object"; + } + wl_resource_destroy(resource->handle); } -SurfaceInterface *XdgShellSurfaceInterface::surface() const +void XdgSurfaceInterfacePrivate::xdg_surface_get_toplevel(Resource *resource, uint32_t id) +{ + const SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_already_constructed, "the surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } + + wl_resource *toplevelResource = wl_resource_create(resource->client(), &xdg_toplevel_interface, resource->version(), id); + + toplevel = new XdgToplevelInterface(q, toplevelResource); + Q_EMIT shell->toplevelCreated(toplevel); +} + +void XdgSurfaceInterfacePrivate::xdg_surface_get_popup(Resource *resource, uint32_t id, ::wl_resource *parentResource, ::wl_resource *positionerResource) +{ + const SurfaceRole *surfaceRole = SurfaceRole::get(surface); + if (surfaceRole) { + wl_resource_post_error(resource->handle, error_already_constructed, "the surface already has a role assigned %s", surfaceRole->name().constData()); + return; + } + + XdgPositioner positioner = XdgPositioner::get(positionerResource); + if (!positioner.isComplete()) { + auto shellPrivate = XdgShellInterfacePrivate::get(shell); + wl_resource_post_error(shellPrivate->resourceForXdgSurface(q)->handle, + QtWaylandServer::xdg_wm_base::error_invalid_positioner, + "xdg_positioner is incomplete"); + return; + } + + XdgSurfaceInterface *parentXdgSurface = XdgSurfaceInterface::get(parentResource); + SurfaceInterface *parentSurface = nullptr; + if (parentXdgSurface) { + parentSurface = parentXdgSurface->surface(); + } + + wl_resource *popupResource = wl_resource_create(resource->client(), &xdg_popup_interface, resource->version(), id); + + popup = new XdgPopupInterface(q, parentSurface, positioner, popupResource); + Q_EMIT shell->popupCreated(popup); +} + +void XdgSurfaceInterfacePrivate::xdg_surface_set_window_geometry(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +{ + if (!toplevel && !popup) { + wl_resource_post_error(resource->handle, error_not_constructed, "xdg_surface must have a role"); + return; + } + + if (width < 1 || height < 1) { + wl_resource_post_error(resource->handle, -1, "invalid window geometry size (%dx%d)", width, height); + return; + } + + next.windowGeometry = QRect(x, y, width, height); + next.windowGeometryIsSet = true; +} + +void XdgSurfaceInterfacePrivate::xdg_surface_ack_configure(Resource *resource, uint32_t serial) +{ + Q_UNUSED(resource) + next.acknowledgedConfigure = serial; + next.acknowledgedConfigureIsSet = true; +} + +XdgSurfaceInterface::XdgSurfaceInterface(XdgShellInterface *shell, SurfaceInterface *surface, ::wl_resource *resource) + : d(new XdgSurfaceInterfacePrivate(this)) +{ + d->shell = shell; + d->surface = surface; + d->init(resource); +} + +XdgSurfaceInterface::~XdgSurfaceInterface() +{ +} + +XdgToplevelInterface *XdgSurfaceInterface::toplevel() const +{ + return d->toplevel; +} + +XdgPopupInterface *XdgSurfaceInterface::popup() const +{ + return d->popup; +} + +XdgShellInterface *XdgSurfaceInterface::shell() const +{ + return d->shell; +} + +SurfaceInterface *XdgSurfaceInterface::surface() const { - Q_D(); return d->surface; } -QString XdgShellSurfaceInterface::title() const +bool XdgSurfaceInterface::isConfigured() const +{ + return d->isConfigured; +} + +QRect XdgSurfaceInterface::windowGeometry() const +{ + return d->current.windowGeometry; +} + +XdgSurfaceInterface *XdgSurfaceInterface::get(::wl_resource *resource) +{ + if (auto surfacePrivate = resource_cast(resource)) { + return surfacePrivate->q; + } + return nullptr; +} + +XdgToplevelInterfacePrivate::XdgToplevelInterfacePrivate(XdgToplevelInterface *toplevel, XdgSurfaceInterface *surface) + : SurfaceRole(surface->surface(), QByteArrayLiteral("xdg_toplevel")) + , q(toplevel) + , xdgSurface(surface) +{ +} + +void XdgToplevelInterfacePrivate::commit() +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + if (xdgSurfacePrivate->firstBufferAttached && !xdgSurfacePrivate->surface->buffer()) { + reset(); + return; + } + + xdgSurfacePrivate->commit(); + + if (current.minimumSize != next.minimumSize) { + current.minimumSize = next.minimumSize; + Q_EMIT q->minimumSizeChanged(current.minimumSize); + } + if (current.maximumSize != next.maximumSize) { + current.maximumSize = next.maximumSize; + Q_EMIT q->maximumSizeChanged(current.maximumSize); + } + + if (!xdgSurfacePrivate->isConfigured) { + Q_EMIT q->initializeRequested(); + } +} + +void XdgToplevelInterfacePrivate::reset() +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + xdgSurfacePrivate->reset(); + + windowTitle = QString(); + windowClass = QString(); + current = next = State(); + + Q_EMIT q->resetOccurred(); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_parent(Resource *resource, ::wl_resource *parentResource) +{ + Q_UNUSED(resource) + XdgToplevelInterface *parent = XdgToplevelInterface::get(parentResource); + if (parentXdgToplevel == parent) { + return; + } + parentXdgToplevel = parent; + Q_EMIT q->parentXdgToplevelChanged(); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_title(Resource *resource, const QString &title) +{ + Q_UNUSED(resource) + if (windowTitle == title) { + return; + } + windowTitle = title; + Q_EMIT q->windowTitleChanged(title); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_app_id(Resource *resource, const QString &app_id) +{ + Q_UNUSED(resource) + if (windowClass == app_id) { + return; + } + windowClass = app_id; + Q_EMIT q->windowClassChanged(app_id); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_show_window_menu(Resource *resource, ::wl_resource *seatResource, uint32_t serial, int32_t x, int32_t y) +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + + if (!xdgSurfacePrivate->isConfigured) { + wl_resource_post_error(resource->handle, QtWaylandServer::xdg_surface::error_not_constructed, "surface has not been configured yet"); + return; + } + + SeatInterface *seat = SeatInterface::get(seatResource); + Q_EMIT q->windowMenuRequested(seat, QPoint(x, y), serial); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_move(Resource *resource, ::wl_resource *seatResource, uint32_t serial) +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + + if (!xdgSurfacePrivate->isConfigured) { + wl_resource_post_error(resource->handle, QtWaylandServer::xdg_surface::error_not_constructed, "surface has not been configured yet"); + return; + } + + SeatInterface *seat = SeatInterface::get(seatResource); + Q_EMIT q->moveRequested(seat, serial); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_resize(Resource *resource, ::wl_resource *seatResource, uint32_t serial, uint32_t xdgEdges) +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + + if (!xdgSurfacePrivate->isConfigured) { + wl_resource_post_error(resource->handle, QtWaylandServer::xdg_surface::error_not_constructed, "surface has not been configured yet"); + return; + } + + SeatInterface *seat = SeatInterface::get(seatResource); + Q_EMIT q->resizeRequested(seat, XdgToplevelInterface::ResizeAnchor(xdgEdges), serial); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_max_size(Resource *resource, int32_t width, int32_t height) +{ + if (width < 0 || height < 0) { + wl_resource_post_error(resource->handle, -1, "width and height must be positive or zero"); + return; + } + next.maximumSize = QSize(width, height); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_min_size(Resource *resource, int32_t width, int32_t height) +{ + if (width < 0 || height < 0) { + wl_resource_post_error(resource->handle, -1, "width and height must be positive or zero"); + return; + } + next.minimumSize = QSize(width, height); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_maximized(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->maximizeRequested(); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_unset_maximized(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->unmaximizeRequested(); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_fullscreen(Resource *resource, ::wl_resource *outputResource) +{ + Q_UNUSED(resource) + OutputInterface *output = OutputInterface::get(outputResource); + Q_EMIT q->fullscreenRequested(output); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_unset_fullscreen(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->unfullscreenRequested(); +} + +void XdgToplevelInterfacePrivate::xdg_toplevel_set_minimized(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->minimizeRequested(); +} + +XdgToplevelInterfacePrivate *XdgToplevelInterfacePrivate::get(XdgToplevelInterface *toplevel) +{ + return toplevel->d.data(); +} + +XdgToplevelInterfacePrivate *XdgToplevelInterfacePrivate::get(wl_resource *resource) +{ + return resource_cast(resource); +} + +XdgToplevelInterface::XdgToplevelInterface(XdgSurfaceInterface *surface, ::wl_resource *resource) + : d(new XdgToplevelInterfacePrivate(this, surface)) +{ + d->init(resource); +} + +XdgToplevelInterface::~XdgToplevelInterface() +{ +} + +XdgShellInterface *XdgToplevelInterface::shell() const +{ + return d->xdgSurface->shell(); +} + +XdgSurfaceInterface *XdgToplevelInterface::xdgSurface() const +{ + return d->xdgSurface; +} + +SurfaceInterface *XdgToplevelInterface::surface() const { - Q_D(); - return d->title; + return d->xdgSurface->surface(); } -QByteArray XdgShellSurfaceInterface::windowClass() const +bool XdgToplevelInterface::isConfigured() const +{ + return d->xdgSurface->isConfigured(); +} + +XdgToplevelInterface *XdgToplevelInterface::parentXdgToplevel() const +{ + return d->parentXdgToplevel; +} + +QString XdgToplevelInterface::windowTitle() const +{ + return d->windowTitle; +} + +QString XdgToplevelInterface::windowClass() const { - Q_D(); return d->windowClass; } -bool XdgShellSurfaceInterface::isTransient() const +QSize XdgToplevelInterface::minimumSize() const { - Q_D(); - return !d->parent.isNull(); + return d->current.minimumSize.isEmpty() ? QSize(0, 0) : d->current.minimumSize; } -QPointer XdgShellSurfaceInterface::transientFor() const +QSize XdgToplevelInterface::maximumSize() const { - Q_D(); - return d->parent; + return d->current.maximumSize.isEmpty() ? QSize(INT_MAX, INT_MAX) : d->current.maximumSize; } -void XdgShellSurfaceInterface::close() +quint32 XdgToplevelInterface::sendConfigure(const QSize &size, const States &states) { - Q_D(); - d->close(); + // Note that the states listed in the configure event must be an array of uint32_t. + + uint32_t statesData[8] = {0}; + int i = 0; + + if (states & State::MaximizedHorizontal && states & State::MaximizedVertical) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_maximized; + } + if (states & State::FullScreen) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_fullscreen; + } + if (states & State::Resizing) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_resizing; + } + if (states & State::Activated) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_activated; + } + + if (d->resource()->version() >= XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION) { + if (states & State::TiledLeft) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_tiled_left; + } + if (states & State::TiledTop) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_tiled_top; + } + if (states & State::TiledRight) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_tiled_right; + } + if (states & State::TiledBottom) { + statesData[i++] = QtWaylandServer::xdg_toplevel::state_tiled_bottom; + } + } + + const QByteArray xdgStates = QByteArray::fromRawData(reinterpret_cast(statesData), sizeof(uint32_t) * i); + const quint32 serial = xdgSurface()->shell()->display()->nextSerial(); + + d->send_configure(size.width(), size.height(), xdgStates); + + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface()); + xdgSurfacePrivate->send_configure(serial); + xdgSurfacePrivate->isConfigured = true; + + return serial; } -XdgShellSurfaceInterface::Private *XdgShellSurfaceInterface::d_func() const +void XdgToplevelInterface::sendClose() { - return reinterpret_cast(d.data()); + d->send_close(); } -XdgShellPopupInterface::Private::Private(XdgShellInterfaceVersion interfaceVersion, XdgShellPopupInterface *q, XdgShellInterface *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation) - : Resource::Private(q, c, parentResource, interface, implementation) - , GenericShellSurface(q, surface) - , interfaceVersion(interfaceVersion) +XdgToplevelInterface *XdgToplevelInterface::get(::wl_resource *resource) { + if (auto toplevelPrivate = resource_cast(resource)) { + return toplevelPrivate->q; + } + return nullptr; } -XdgShellPopupInterface::Private::~Private() = default; +XdgPopupInterfacePrivate *XdgPopupInterfacePrivate::get(XdgPopupInterface *popup) +{ + return popup->d.data(); +} -XdgShellPopupInterface::XdgShellPopupInterface(Private *p) - : Resource(p) +XdgPopupInterfacePrivate::XdgPopupInterfacePrivate(XdgPopupInterface *popup, XdgSurfaceInterface *surface) + : SurfaceRole(surface->surface(), QByteArrayLiteral("xdg_popup")) + , q(popup) + , xdgSurface(surface) { } -XdgShellPopupInterface::~XdgShellPopupInterface() = default; +void XdgPopupInterfacePrivate::commit() +{ + if (!parentSurface) { + auto shellPrivate = XdgShellInterfacePrivate::get(xdgSurface->shell()); + wl_resource_post_error(shellPrivate->resourceForXdgSurface(xdgSurface)->handle, + QtWaylandServer::xdg_wm_base::error_invalid_popup_parent, + "no xdg_popup parent surface has been specified"); + return; + } + + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + if (xdgSurfacePrivate->firstBufferAttached && !xdgSurfacePrivate->surface->buffer()) { + reset(); + return; + } -SurfaceInterface *XdgShellPopupInterface::surface() const + xdgSurfacePrivate->commit(); + + if (!xdgSurfacePrivate->isConfigured) { + Q_EMIT q->initializeRequested(); + } +} + +void XdgPopupInterfacePrivate::reset() +{ + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface); + xdgSurfacePrivate->reset(); +} + +void XdgPopupInterfacePrivate::xdg_popup_destroy_resource(Resource *resource) +{ + Q_UNUSED(resource) + Q_EMIT q->aboutToBeDestroyed(); + delete q; +} + +void XdgPopupInterfacePrivate::xdg_popup_destroy(Resource *resource) +{ + // TODO: We need to post an error with the code XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP if + // this popup is not the topmost grabbing popup. We most likely need a grab abstraction or + // something to determine whether the given popup has an explicit grab. + wl_resource_destroy(resource->handle); +} + +void XdgPopupInterfacePrivate::xdg_popup_grab(Resource *resource, ::wl_resource *seatHandle, uint32_t serial) +{ + if (xdgSurface->surface()->buffer()) { + wl_resource_post_error(resource->handle, error_invalid_grab, "xdg_surface is already mapped"); + return; + } + SeatInterface *seat = SeatInterface::get(seatHandle); + Q_EMIT q->grabRequested(seat, serial); +} + +void XdgPopupInterfacePrivate::xdg_popup_reposition(Resource *resource, ::wl_resource *positionerResource, uint32_t token) +{ + Q_UNUSED(resource) + positioner = XdgPositioner::get(positionerResource); + Q_EMIT q->repositionRequested(token); +} + +XdgPopupInterface::XdgPopupInterface(XdgSurfaceInterface *surface, SurfaceInterface *parentSurface, const XdgPositioner &positioner, ::wl_resource *resource) + : d(new XdgPopupInterfacePrivate(this, surface)) +{ + d->parentSurface = parentSurface; + d->positioner = positioner; + d->init(resource); +} + +XdgPopupInterface::~XdgPopupInterface() { - Q_D(); - return d->surface; } -QPointer XdgShellPopupInterface::transientFor() const +SurfaceInterface *XdgPopupInterface::parentSurface() const { - Q_D(); - return d->parent; + return d->parentSurface; } -QSize XdgShellPopupInterface::initialSize() const +XdgSurfaceInterface *XdgPopupInterface::xdgSurface() const { - Q_D(); - return d->initialSize; + return d->xdgSurface; } -QPoint XdgShellPopupInterface::transientOffset() const +SurfaceInterface *XdgPopupInterface::surface() const { - QRect rect = anchorRect(); - const QPoint center = rect.isEmpty() ? rect.topLeft() : rect.center(); - rect = rect.adjusted(0,0,1,1); //compensate for the stupid QRect::right +1 fiasco + return d->xdgSurface->surface(); +} + +bool XdgPopupInterface::isConfigured() const +{ + return d->xdgSurface->isConfigured(); +} + +XdgPositioner XdgPopupInterface::positioner() const +{ + return d->positioner; +} + +quint32 XdgPopupInterface::sendConfigure(const QRect &rect) +{ + const quint32 serial = xdgSurface()->shell()->display()->nextSerial(); + + d->send_configure(rect.x(), rect.y(), rect.width(), rect.height()); + + auto xdgSurfacePrivate = XdgSurfaceInterfacePrivate::get(xdgSurface()); + xdgSurfacePrivate->send_configure(serial); + xdgSurfacePrivate->isConfigured = true; - switch(anchorEdge()) { - case Qt::TopEdge | Qt::LeftEdge: - return rect.topLeft(); - case Qt::TopEdge: - return QPoint(center.x(), rect.y()); - case Qt::TopEdge | Qt::RightEdge: - return rect.topRight(); - case Qt::RightEdge: - return QPoint(rect.right(), center.y()); - case Qt::BottomEdge | Qt::RightEdge: - return rect.bottomRight(); - case Qt::BottomEdge: - return QPoint(center.x(), rect.bottom()); - case Qt::BottomEdge | Qt::LeftEdge: - return rect.bottomLeft(); - case Qt::LeftEdge: - return QPoint(rect.left(), center.y()); - default: - return center; + return serial; +} + +void XdgPopupInterface::sendPopupDone() +{ + d->send_popup_done(); +} + +void XdgPopupInterface::sendRepositioned(quint32 token) +{ + Q_ASSERT(d->resource()->version() >= XDG_POPUP_REPOSITIONED_SINCE_VERSION); + d->send_repositioned(token); +} + +XdgPopupInterface *XdgPopupInterface::get(::wl_resource *resource) +{ + if (auto popupPrivate = resource_cast(resource)) { + return popupPrivate->q; } - Q_UNREACHABLE(); + return nullptr; } -QRect XdgShellPopupInterface::anchorRect() const +XdgPositionerPrivate::XdgPositionerPrivate(::wl_resource *resource) + : data(new XdgPositionerData) { - Q_D(); - return d->anchorRect; + init(resource); } -Qt::Edges XdgShellPopupInterface::anchorEdge() const +XdgPositionerPrivate *XdgPositionerPrivate::get(wl_resource *resource) { - Q_D(); - return d->anchorEdge; + return resource_cast(resource); } -Qt::Edges XdgShellPopupInterface::gravity() const +void XdgPositionerPrivate::xdg_positioner_destroy_resource(Resource *resource) { - Q_D(); - return d->gravity; + Q_UNUSED(resource) + delete this; } -QPoint XdgShellPopupInterface::anchorOffset() const +void XdgPositionerPrivate::xdg_positioner_destroy(Resource *resource) { - Q_D(); - return d->anchorOffset; + wl_resource_destroy(resource->handle); } -PositionerConstraints XdgShellPopupInterface::constraintAdjustments() const +void XdgPositionerPrivate::xdg_positioner_set_size(Resource *resource, int32_t width, int32_t height) { - Q_D(); - return d->constraintAdjustments; + if (width < 1 || height < 1) { + wl_resource_post_error(resource->handle, error_invalid_input, "width and height must be positive and non-zero"); + return; + } + data->size = QSize(width, height); +} + +void XdgPositionerPrivate::xdg_positioner_set_anchor_rect(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +{ + if (width < 1 || height < 1) { + wl_resource_post_error(resource->handle, error_invalid_input, "width and height must be positive and non-zero"); + return; + } + data->anchorRect = QRect(x, y, width, height); +} + +void XdgPositionerPrivate::xdg_positioner_set_anchor(Resource *resource, uint32_t anchor) +{ + if (anchor > anchor_bottom_right) { + wl_resource_post_error(resource->handle, error_invalid_input, "unknown anchor point"); + return; + } + + switch (anchor) { + case anchor_top: + data->anchorEdges = Qt::TopEdge; + break; + case anchor_top_right: + data->anchorEdges = Qt::TopEdge | Qt::RightEdge; + break; + case anchor_right: + data->anchorEdges = Qt::RightEdge; + break; + case anchor_bottom_right: + data->anchorEdges = Qt::BottomEdge | Qt::RightEdge; + break; + case anchor_bottom: + data->anchorEdges = Qt::BottomEdge; + break; + case anchor_bottom_left: + data->anchorEdges = Qt::BottomEdge | Qt::LeftEdge; + break; + case anchor_left: + data->anchorEdges = Qt::LeftEdge; + break; + case anchor_top_left: + data->anchorEdges = Qt::TopEdge | Qt::LeftEdge; + break; + default: + data->anchorEdges = Qt::Edges(); + break; + } +} + +void XdgPositionerPrivate::xdg_positioner_set_parent_size(Resource *resource, int32_t width, int32_t height) +{ + Q_UNUSED(resource) + data->parentSize = QSize(width, height); +} + +void XdgPositionerPrivate::xdg_positioner_set_reactive(Resource *resource) +{ + Q_UNUSED(resource) + data->isReactive = true; +} + +void XdgPositionerPrivate::xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) +{ + Q_UNUSED(resource) + data->parentConfigure = serial; +} + +void XdgPositionerPrivate::xdg_positioner_set_gravity(Resource *resource, uint32_t gravity) +{ + if (gravity > gravity_bottom_right) { + wl_resource_post_error(resource->handle, error_invalid_input, "unknown gravity direction"); + return; + } + + switch (gravity) { + case gravity_top: + data->gravityEdges = Qt::TopEdge; + break; + case gravity_top_right: + data->gravityEdges = Qt::TopEdge | Qt::RightEdge; + break; + case gravity_right: + data->gravityEdges = Qt::RightEdge; + break; + case gravity_bottom_right: + data->gravityEdges = Qt::BottomEdge | Qt::RightEdge; + break; + case gravity_bottom: + data->gravityEdges = Qt::BottomEdge; + break; + case gravity_bottom_left: + data->gravityEdges = Qt::BottomEdge | Qt::LeftEdge; + break; + case gravity_left: + data->gravityEdges = Qt::LeftEdge; + break; + case gravity_top_left: + data->gravityEdges = Qt::TopEdge | Qt::LeftEdge; + break; + default: + data->gravityEdges = Qt::Edges(); + break; + } +} + +void XdgPositionerPrivate::xdg_positioner_set_constraint_adjustment(Resource *resource, uint32_t constraint_adjustment) +{ + Q_UNUSED(resource) + + if (constraint_adjustment & constraint_adjustment_flip_x) { + data->flipConstraintAdjustments |= Qt::Horizontal; + } else { + data->flipConstraintAdjustments &= ~Qt::Horizontal; + } + + if (constraint_adjustment & constraint_adjustment_flip_y) { + data->flipConstraintAdjustments |= Qt::Vertical; + } else { + data->flipConstraintAdjustments &= ~Qt::Vertical; + } + + if (constraint_adjustment & constraint_adjustment_slide_x) { + data->slideConstraintAdjustments |= Qt::Horizontal; + } else { + data->slideConstraintAdjustments &= ~Qt::Horizontal; + } + + if (constraint_adjustment & constraint_adjustment_slide_y) { + data->slideConstraintAdjustments |= Qt::Vertical; + } else { + data->slideConstraintAdjustments &= ~Qt::Vertical; + } + + if (constraint_adjustment & constraint_adjustment_resize_x) { + data->resizeConstraintAdjustments |= Qt::Horizontal; + } else { + data->resizeConstraintAdjustments &= ~Qt::Horizontal; + } + + if (constraint_adjustment & constraint_adjustment_resize_y) { + data->resizeConstraintAdjustments |= Qt::Vertical; + } else { + data->resizeConstraintAdjustments &= ~Qt::Vertical; + } +} + +void XdgPositionerPrivate::xdg_positioner_set_offset(Resource *resource, int32_t x, int32_t y) +{ + Q_UNUSED(resource) + data->offset = QPoint(x, y); } -void XdgShellPopupInterface::popupDone() +XdgPositioner::XdgPositioner() + : d(new XdgPositionerData) { - Q_D(); - return d->popupDone(); } -quint32 XdgShellPopupInterface::configure(const QRect &rect) +XdgPositioner::XdgPositioner(const XdgPositioner &other) + : d(other.d) { - Q_D(); - return d->configure(rect); } -XdgShellPopupInterface::Private *XdgShellPopupInterface::d_func() const +XdgPositioner::~XdgPositioner() { - return reinterpret_cast(d.data()); } +XdgPositioner &XdgPositioner::operator=(const XdgPositioner &other) +{ + d = other.d; + return *this; +} + +bool XdgPositioner::isComplete() const +{ + return d->size.isValid() && d->anchorRect.isValid(); +} + +Qt::Orientations XdgPositioner::slideConstraintAdjustments() const +{ + return d->slideConstraintAdjustments; +} + +Qt::Orientations XdgPositioner::flipConstraintAdjustments() const +{ + return d->flipConstraintAdjustments; +} + +Qt::Orientations XdgPositioner::resizeConstraintAdjustments() const +{ + return d->resizeConstraintAdjustments; +} + +Qt::Edges XdgPositioner::anchorEdges() const +{ + return d->anchorEdges; +} + +Qt::Edges XdgPositioner::gravityEdges() const +{ + return d->gravityEdges; +} + +QSize XdgPositioner::size() const +{ + return d->size; } + +QRect XdgPositioner::anchorRect() const +{ + return d->anchorRect; +} + +QPoint XdgPositioner::offset() const +{ + return d->offset; +} + +QSize XdgPositioner::parentSize() const +{ + return d->parentSize; +} + +bool XdgPositioner::isReactive() const +{ + return d->isReactive; +} + +quint32 XdgPositioner::parentConfigure() const +{ + return d->parentConfigure; } + +XdgPositioner XdgPositioner::get(::wl_resource *resource) +{ + XdgPositionerPrivate *xdgPositionerPrivate = XdgPositionerPrivate::get(resource); + if (xdgPositionerPrivate) + return XdgPositioner(xdgPositionerPrivate->data); + return XdgPositioner(); +} + +XdgPositioner::XdgPositioner(const QSharedDataPointer &data) + : d(data) +{ +} + +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgshell_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface.h --- dwayland-5.57.0.23/src/server/xdgshell_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,484 +1,582 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGSHELL_INTERFACE_H -#define KWAYLAND_SERVER_XDGSHELL_INTERFACE_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ -#include "global.h" -#include "resource.h" +#pragma once -#include +#include -#include +#include +#include -namespace KWayland -{ -namespace Server -{ +struct wl_resource; +namespace KWaylandServer +{ +class Display; class OutputInterface; class SeatInterface; class SurfaceInterface; -class XdgShellPopupInterface; -class XdgShellSurfaceInterface; -template -class GenericShellSurface; +class XdgShellInterfacePrivate; +class XdgSurfaceInterfacePrivate; +class XdgToplevelInterfacePrivate; +class XdgPopupInterfacePrivate; +class XdgPositionerData; +class XdgToplevelInterface; +class XdgPopupInterface; +class XdgSurfaceInterface; /** - * Enum describing the different InterfaceVersion encapsulated in this implementation. + * The XdgShellInterface class represents an extension for destrop-style user interfaces. + * + * The XdgShellInterface class provides a way for a client to extend a regular Wayland surface + * with functionality required to construct user interface elements, e.g. toplevel windows or + * menus. * - * @since 5.25 - **/ -enum class XdgShellInterfaceVersion + * XdgShellInterface corresponds to the WaylandInterface \c xdg_wm_base. + */ +class KWAYLANDSERVER_EXPORT XdgShellInterface : public QObject { + Q_OBJECT + +public: /** - * xdg_shell (unstable v5) - **/ - UnstableV5, - /** - * zxdg_shell_v6 (unstable v6) - * @since 5.39 - **/ - UnstableV6, - /** - xdg_wm_base (stable) - @since 5.48 - */ - Stable -}; + * Constructs an XdgShellInterface object with the given wayland display \a display. + */ + XdgShellInterface(Display *display, QObject *parent = nullptr); + /** + * Destructs the XdgShellInterface object. + */ + ~XdgShellInterface() override; -/** - * Flags describing how a popup should be reposition if constrained - * @since 5.39 - */ -enum class PositionerConstraint { /** - * Slide the popup on the X axis until there is room + * Returns the wayland display of the XdgShellInterface. */ - SlideX = 1 << 0, + Display *display() const; + /** - * Slide the popup on the Y axis until there is room + * Sends a ping event to the client with the given xdg-surface \a surface. If the client + * replies to the event within a reasonable amount of time, pongReceived signal will be + * emitted. */ - SlideY = 1 << 1, + quint32 ping(XdgSurfaceInterface *surface); + +Q_SIGNALS: /** - * Invert the anchor and gravity on the X axis + * This signal is emitted when a new XdgToplevelInterface object is created. */ - FlipX = 1 << 2, + void toplevelCreated(XdgToplevelInterface *toplevel); + /** - * Invert the anchor and gravity on the Y axis + * This signal is emitted when a new XdgPopupInterface object is created. */ - FlipY = 1 << 3, + void popupCreated(XdgPopupInterface *popup); + /** - * Resize the popup in the X axis + * This signal is emitted when the client has responded to a ping event with serial \a serial. */ - ResizeX = 1 << 4, + void pongReceived(quint32 serial); + /** - * Resize the popup in the Y axis + * @todo Drop this signal. + * + * This signal is emitted when the client has not responded to a ping event with serial + * \a serial within a reasonable amount of time and the compositor gave up on it. */ - ResizeY = 1 << 5 -}; + void pingTimeout(quint32 serial); -Q_DECLARE_FLAGS(PositionerConstraints, PositionerConstraint) + /** + * This signal is emitted when the client has not responded to a ping event with serial + * \a serial within a reasonable amount of time. + */ + void pingDelayed(quint32 serial); + +private: + QScopedPointer d; + friend class XdgShellInterfacePrivate; +}; /** + * The XdgSurfaceInterface class provides a base set of functionality required to construct + * user interface elements. * - * @since 5.25 - **/ -class KWAYLANDSERVER_EXPORT XdgShellInterface : public Global + * XdgSurfaceInterface corresponds to the Wayland interface \c xdg_surface. + */ +class KWAYLANDSERVER_EXPORT XdgSurfaceInterface : public QObject { Q_OBJECT -public: - virtual ~XdgShellInterface(); +public: /** - * @returns The interface version used by this XdgShellInterface - **/ - XdgShellInterfaceVersion interfaceVersion() const; - + * Constructs an XdgSurfaceInterface for the given \a shell and \a surface. + */ + XdgSurfaceInterface(XdgShellInterface *shell, SurfaceInterface *surface, ::wl_resource *resource); /** - * @returns The XdgShellSurfaceInterface for the @p native resource. - **/ - //TODO KF6 make virtual - XdgShellSurfaceInterface *getSurface(wl_resource *native); + * Destructs the XdgSurfaceInterface object. + */ + ~XdgSurfaceInterface() override; /** - * Confirm the client is still alive and responding + * Returns the XdgToplevelInterface associated with this XdgSurfaceInterface. * - * Will result in pong being emitted + * This method will return \c null if no xdg_toplevel object is associated with this surface. + */ + XdgToplevelInterface *toplevel() const; + + /** + * Returns the XdgPopupInterface associated with this XdgSurfaceInterface. * - * @returns unique identifier for this request - * @since 5.39 + * This method will return \c null if no xdg_popup object is associated with this surface. */ - quint32 ping(XdgShellSurfaceInterface * surface); + XdgPopupInterface *popup() const; -Q_SIGNALS: - void surfaceCreated(KWayland::Server::XdgShellSurfaceInterface *surface); + /** + * Returns the XdgShellInterface associated with this XdgSurfaceInterface. + */ + XdgShellInterface *shell() const; /** - * Emitted whenever a new popup got created. - * - * A popup only gets created in response to an action on the @p seat. - * - * - * @param surface The popup xdg shell surface which got created - * @param seat The seat on which an action triggered the popup - * @param serial The serial of the action on the seat - * - * XDGV5 only - * Use both xdgPopupCreated and XdgShellPopupInterface::grabbed to cover both XDGV5 and XDGV6 - **/ + * Returns the SurfaceInterface assigned to this XdgSurfaceInterface. + */ + SurfaceInterface *surface() const; - void popupCreated(KWayland::Server::XdgShellPopupInterface *surface, KWayland::Server::SeatInterface *seat, quint32 serial); + /** + * Returns \c true if the surface has been configured; otherwise returns \c false. + */ + bool isConfigured() const; - /* - * Emitted whenever a new popup gets created. + /** + * Returns the window geometry of the XdgSurfaceInterface. * - * @param surface The popup xdg shell surface which got created - * @since 5.39 + * This method will return an invalid QRect if the window geometry is not set by the client. */ - void xdgPopupCreated(KWayland::Server::XdgShellPopupInterface *surface); + QRect windowGeometry() const; - /* - * Emitted in response to a ping request - * - * @param serial unique identifier for the request - * @since 5.39 + /** + * Returns the XdgSurfaceInterface for the specified wayland resource object \a resource. */ - void pongReceived(quint32 serial); + static XdgSurfaceInterface *get(::wl_resource *resource); - /* - * Emitted when the application takes more than expected - * to answer to a ping, this will always be emitted before - * eventuallt pingTimeout gets emitted - * - * @param serial unique identifier for the request - * @since 5.39 +Q_SIGNALS: + /** + * This signal is emitted when the xdg-surface is about to be destroyed. */ - void pingDelayed(quint32 serial); + void aboutToBeDestroyed(); - /* - * Emitted when the application doesn't answer to a ping - * and the serve gave up on it - * - * @param serial unique identifier for the request - * @since 5.39 + /** + * This signal is emitted when a configure event with serial \a serial has been acknowledged. */ - void pingTimeout(quint32 serial); + void configureAcknowledged(quint32 serial); + + /** + * This signal is emitted when the window geometry has been changed. + */ + void windowGeometryChanged(const QRect &rect); -protected: - class Private; - explicit XdgShellInterface(Private *d, QObject *parent = nullptr); + /** + * This signal is emitted when the surface has been unmapped and its state has been reset. + */ + void resetOccurred(); private: - Private *d_func() const; + QScopedPointer d; + friend class XdgSurfaceInterfacePrivate; }; - /** + * The XdgToplevelInterface class represents a surface with window-like functionality such + * as maximize, fullscreen, resizing, minimizing, etc. * - * @since 5.25 - **/ -class KWAYLANDSERVER_EXPORT XdgShellSurfaceInterface : public Resource + * XdgToplevelInterface corresponds to the Wayland interface \c xdg_toplevel. + */ +class KWAYLANDSERVER_EXPORT XdgToplevelInterface : public QObject { Q_OBJECT -public: - virtual ~XdgShellSurfaceInterface(); - /** - * @returns The interface version used by this XdgShellSurfaceInterface - **/ - XdgShellInterfaceVersion interfaceVersion() const; - - /** - * States the Surface can be in - **/ - enum class State { - /** - * The Surface is maximized. - **/ - Maximized = 1 << 0, - /** - * The Surface is fullscreen. - **/ - Fullscreen = 1 << 1, - /** - * The Surface is currently being resized by the Compositor. - **/ - Resizing = 1 << 2, - /** - * The Surface is considered active. Does not imply keyboard focus. - **/ - Activated = 1 << 3 +public: + enum State { + MaximizedHorizontal = 0x1, + MaximizedVertical = 0x2, + FullScreen = 0x4, + Resizing = 0x8, + Activated = 0x10, + TiledLeft = 0x20, + TiledTop = 0x40, + TiledRight = 0x80, + TiledBottom = 0x100, + Maximized = MaximizedHorizontal | MaximizedVertical, }; Q_DECLARE_FLAGS(States, State) + enum class ResizeAnchor { + None = 0, + Top = 1, + Bottom = 2, + Left = 4, + TopLeft = 5, + BottomLeft = 6, + Right = 8, + TopRight = 9, + BottomRight = 10, + }; + Q_ENUM(ResizeAnchor) + /** - * Sends a configure event to the Surface. - * This tells the Surface the current @p states it is in and the @p size it should have. - * If @p size has width and height at @c 0, the Surface can choose the size. - * - * The Surface acknowledges the configure event with {@link configureAcknowledged}. + * Constructs an XdgToplevelInterface for the given xdg-surface \a surface. + */ + XdgToplevelInterface(XdgSurfaceInterface *surface, ::wl_resource *resource); + /** + * Destructs the XdgToplevelInterface object. + */ + ~XdgToplevelInterface() override; + + /** + * Returns the XdgShellInterface for this XdgToplevelInterface. * - * @param states The states the surface is in - * @param size The requested size - * @returns The serial of the configure event - * @see configureAcknowledged - * @see isConfigurePending - **/ - quint32 configure(States states, const QSize &size = QSize(0, 0)); - - /** - * @returns @c true if there is a not yet acknowledged configure event. - * @see configure - * @see configureAcknowledged - **/ - bool isConfigurePending() const; + * This is equivalent to xdgSurface()->shell(). + */ + XdgShellInterface *shell() const; /** - * @return The SurfaceInterface this XdgSurfaceV5Interface got created for. - **/ + * Returns the XdgSurfaceInterface associated with the XdgToplevelInterface. + */ + XdgSurfaceInterface *xdgSurface() const; + + /** + * Returns the SurfaceInterface associated with the XdgToplevelInterface. + */ SurfaceInterface *surface() const; /** - * @returns The title of this surface. - * @see titleChanged - **/ - QString title() const; - QByteArray windowClass() const; - - /** - * @returns Whether this Surface is a transient for another Surface, that is it has a parent. - * @see transientFor - **/ - bool isTransient() const; - /** - * @returns the parent surface if the surface is a transient for another surface - * @see isTransient - **/ - QPointer transientFor() const; - - /** - * Request the client to close the window. - **/ - void close(); + * Returns the parent XdgToplevelInterface above which this toplevel is stacked. + */ + XdgToplevelInterface *parentXdgToplevel() const; + + /** + * Returns \c true if the toplevel has been configured; otherwise returns \c false. + */ + bool isConfigured() const; + + /** + * Returns the window title of the toplevel surface. + */ + QString windowTitle() const; + + /** + * Returns the window class of the toplevel surface. + */ + QString windowClass() const; + + /** + * Returns the minimum window geometry size of the toplevel surface. + */ + QSize minimumSize() const; + + /** + * Returns the maximum window geometry size of the toplevel surface. + */ + QSize maximumSize() const; + + /** + * Sends a configure event to the client. \a size specifies the new window geometry size. A size + * of zero means the client should decide its own window dimensions. + */ + quint32 sendConfigure(const QSize &size, const States &states); + + /** + * Sends a close event to the client. The client may choose to ignore this request. + */ + void sendClose(); + + /** + * Returns the XdgToplevelInterface for the specified wayland resource object \a resource. + */ + static XdgToplevelInterface *get(::wl_resource *resource); Q_SIGNALS: /** - * Emitted whenever the title changes. - * - * @see title - **/ - void titleChanged(const QString&); + * This signal is emitted when the xdg-toplevel is about to be destroyed. + */ + void aboutToBeDestroyed(); + /** - * Emitted whenever the window class changes. - * - * @see windowClass - **/ - void windowClassChanged(const QByteArray&); + * This signal is emitted when the xdg-toplevel has commited the initial state and wants to + * be configured. After initializing the toplevel, you must send a configure event. + */ + void initializeRequested(); + /** - * The surface requested a window move. - * - * @param seat The SeatInterface on which the surface requested the move - * @param serial The serial of the implicit mouse grab which triggered the move - **/ - void moveRequested(KWayland::Server::SeatInterface *seat, quint32 serial); + * This signal is emitted when the toplevel has been unmapped and its state has been reset. + */ + void resetOccurred(); + /** - * The surface requested a window resize. - * - * @param seat The SeatInterface on which the surface requested the resize - * @param serial The serial of the implicit mouse grab which triggered the resize - * @param edges A hint which edges are involved in the resize - **/ - void resizeRequested(KWayland::Server::SeatInterface *seat, quint32 serial, Qt::Edges edges); - void windowMenuRequested(KWayland::Server::SeatInterface *seat, quint32 serial, const QPoint &surfacePos); - /** - * The surface requested a change of maximized state. - * @param maximized Whether the window wants to be maximized - **/ - void maximizedChanged(bool maximized); - /** - * The surface requested a change of fullscreen state - * @param fullscreen Whether the window wants to be fullscreen - * @param output An optional output hint on which the window wants to be fullscreen - **/ - void fullscreenChanged(bool fullscreen, KWayland::Server::OutputInterface *output); + * This signal is emitted when the toplevel's title has been changed. + */ + void windowTitleChanged(const QString &windowTitle); + /** - * The surface requested to be minimized. - **/ - void minimizeRequested(); + * This signal is emitted when the toplevel's application id has been changed. + */ + void windowClassChanged(const QString &windowClass); + /** - * A configure event with @p serial got acknowledged. - * @see configure - **/ - void configureAcknowledged(quint32 serial); + * This signal is emitted when the toplevel has requested the window menu to be shown at + * \a pos. The \a seat and the \a serial indicate the user action that triggerred the request. + */ + void windowMenuRequested(KWaylandServer::SeatInterface *seat, const QPoint &pos, quint32 serial); + + /** + * This signal is emitted when the toplevel's minimum size has been changed. + */ + void minimumSizeChanged(const QSize &size); + + /** + * This signal is emitted when the toplevel's maximum size has been changed. + */ + void maximumSizeChanged(const QSize &size); + + /** + * This signal is emitted when the toplevel wants to be interactively moved. The \a seat and + * the \a serial indicate the user action in response to which this request has been issued. + */ + void moveRequested(KWaylandServer::SeatInterface *seat, quint32 serial); + + /** + * This signal is emitted when the toplevel wants to be interactively resized by dragging + * the specified \a anchor. The \a seat and the \a serial indicate the user action + * in response to which this request has been issued. + */ + void resizeRequested(KWaylandServer::SeatInterface *seat, KWaylandServer::XdgToplevelInterface::ResizeAnchor anchor, quint32 serial); + + /** + * This signal is emitted when the toplevel surface wants to become maximized. + */ + void maximizeRequested(); + /** - * Emitted whenever the parent surface changes. - * @see isTransient - * @see transientFor - **/ - void transientForChanged(); + * This signal is emitted when the toplevel surface wants to become unmaximized. + */ + void unmaximizeRequested(); /** - * Emitted whenever the maximum size hint changes - * @since 5.39 + * This signal is emitted when the toplevel wants to be shown in the full screen mode. */ - void maxSizeChanged(const QSize &size); + void fullscreenRequested(KWaylandServer::OutputInterface *output); /** - * Emitted whenever the minimum size hint changes - * @since 5.39 + * This signal is emitted when the toplevel surface wants to leave the full screen mode. */ - void minSizeChanged(const QSize &size); + void unfullscreenRequested(); + + /** + * This signal is emitted when the toplevel wants to be iconified. + */ + void minimizeRequested(); -protected: - class Private; - explicit XdgShellSurfaceInterface(Private *p); + /** + * This signal is emitted when the parent toplevel has changed. + */ + void parentXdgToplevelChanged(); private: - Private *d_func() const; - friend class GenericShellSurface; + QScopedPointer d; + friend class XdgToplevelInterfacePrivate; }; /** + * The XdgPositioner class provides a collection of rules for the placement of a popup surface. * - * @since 5.25 - **/ -class KWAYLANDSERVER_EXPORT XdgShellPopupInterface : public Resource + * XdgPositioner corresponds to the Wayland interface \c xdg_positioner. + */ +class KWAYLANDSERVER_EXPORT XdgPositioner { - Q_OBJECT public: - virtual ~XdgShellPopupInterface(); + /** + * Constructs an incomplete XdgPositioner object. + */ + XdgPositioner(); + /** + * Constructs a copy of the XdgPositioner object. + */ + XdgPositioner(const XdgPositioner &other); + /** + * Destructs the XdgPositioner object. + */ + ~XdgPositioner(); /** - * @return The SurfaceInterface this XdgShellPopupInterface got created for. - **/ - SurfaceInterface *surface() const; + * Assigns the value of \a other to this XdgPositioner object. + */ + XdgPositioner &operator=(const XdgPositioner &other); - /* - * Ask the popup surface to configure itself for the given configuration. + /** + * Returns \c true if the positioner object is complete; otherwise returns \c false. * - * @arg rect. The position of the surface relative to the transient parent - * @since 5.39 + * An xdg positioner considered complete if it has a valid size and a valid anchor rect. + */ + bool isComplete() const; + + /** + * Returns the set of orientations along which the compositor may slide the popup to ensure + * that it is entirely inside the compositor's defined "work area." */ - quint32 configure(const QRect &rect); + Qt::Orientations slideConstraintAdjustments() const; /** - * @returns the parent surface. - * @see transientOffset - **/ - QPointer transientFor() const; + * Returns the set of orientations along which the compositor may flip the popup to ensure + * that it is entirely inside the compositor's defined "work area." + */ + Qt::Orientations flipConstraintAdjustments() const; /** - * The offset of the Surface in the coordinate system of the SurfaceInterface this surface is a transient for. - * - * For XDG V6 this returns the point on the anchorRect defined by the anchor edge. - * - * @returns offset in parent coordinate system. - * @see transientFor - **/ - QPoint transientOffset() const; + * Returns the set of orientations along which the compositor can resize the popup to ensure + * that it is entirely inside the compositor's defined "work area." + */ + Qt::Orientations resizeConstraintAdjustments() const; /** - * The size of the surface that is to be positioned. - * - * @since 5.39 + * Returns the set of edges on the anchor rectangle that the surface should be positioned + * around. */ - QSize initialSize() const; + Qt::Edges anchorEdges() const; /** - * The area this popup should be positioned around - * @since 5.39 + * Returns the direction in which the surface should be positioned, relative to the anchor + * point of the parent surface. + */ + Qt::Edges gravityEdges() const; + + /** + * Returns the window geometry size of the surface that is to be positioned. + */ + QSize size() const; + + /** + * Returns the anchor rectangle relative to the upper left corner of the window geometry of + * the parent surface that the popup should be positioned around. */ QRect anchorRect() const; /** - * Which edge of the anchor should the popup be positioned around - * @since 5.39 + * Returns the surface position offset relative to the position of the anchor on the anchor + * rectangle and the anchor on the surface. */ - Qt::Edges anchorEdge() const; + QPoint offset() const; /** - * An additional offset that should be applied to the popup from the anchor rect - * - * @since 5.39 + * Returns whether the surface should respond to movements in its parent window. */ - QPoint anchorOffset() const; + bool isReactive() const; /** - * Specifies in what direction the popup should be positioned around the anchor - * i.e if the gravity is "bottom", then then the top of top of the popup will be at the anchor edge - * if the gravity is top, then the bottom of the popup will be at the anchor edge - * - * @since 5.39 + * Returns the parent size to use when positioning the popup. + */ + QSize parentSize() const; + + /** + * Returns the serial of the configure event for the parent window. + */ + quint32 parentConfigure() const; + + /** + * Returns the current state of the xdg positioner object identified by \a resource. + */ + static XdgPositioner get(::wl_resource *resource); + +private: + XdgPositioner(const QSharedDataPointer &data); + QSharedDataPointer d; +}; + +/** + * The XdgPopupInterface class represents a surface that can be used to implement context menus, + * popovers and other similar short-lived user interface elements. + * + * XdgPopupInterface corresponds to the Wayland interface \c xdg_popup. + */ +class KWAYLANDSERVER_EXPORT XdgPopupInterface : public QObject +{ + Q_OBJECT + +public: + XdgPopupInterface(XdgSurfaceInterface *surface, SurfaceInterface *parentSurface, const XdgPositioner &positioner, ::wl_resource *resource); + /** + * Destructs the XdgPopupInterface object. + */ + ~XdgPopupInterface() override; + + XdgShellInterface *shell() const; + + /** + * Returns the parent surface for this popup surface. If the initial state hasn't been + * committed yet, this function may return \c null. + */ + SurfaceInterface *parentSurface() const; + + /** + * Returns the XdgSurfaceInterface associated with the XdgPopupInterface. + */ + XdgSurfaceInterface *xdgSurface() const; + + /** + * Returns the SurfaceInterface associated with the XdgPopupInterface. + */ + SurfaceInterface *surface() const; + + /** + * Returns the XdgPositioner assigned to this XdgPopupInterface. + */ + XdgPositioner positioner() const; + + /** + * Returns \c true if the popup has been configured; otherwise returns \c false. */ + bool isConfigured() const; - //DAVE left + right is illegal, so this is possible a useless return value? Maybe an enum with 9 entries left, topleft, top, .. - Qt::Edges gravity() const; + /** + * Sends a configure event to the client and returns the serial number of the event. + */ + quint32 sendConfigure(const QRect &rect); + + /** + * Sends a popup done event to the client. + */ + void sendPopupDone(); /** - * Specifies how the compositor should position the popup if it does not fit in the requested position - * @since 5.39 + * Sends a popup repositioned event to the client. */ - PositionerConstraints constraintAdjustments() const; + void sendRepositioned(quint32 token); /** - * Dismiss this popup. This indicates to the client that it should destroy this popup. - * The Compositor can invoke this method when e.g. the user clicked outside the popup - * to dismiss it. - **/ - void popupDone(); + * Returns the XdgPopupInterface for the specified wayland resource object \a resource. + */ + static XdgPopupInterface *get(::wl_resource *resource); Q_SIGNALS: /** - * A configure event with @p serial got acknowledged. - * Note: XdgV6 only - * @see configure - * @since 5.39 - **/ - void configureAcknowledged(quint32 serial); + * This signal is emitted when the xdg-popup is about to be destroyed. + */ + void aboutToBeDestroyed(); /** - * The client requested that this popup takes an explicit grab - * - * @param seat The seat on which an action triggered the popup - * @param serial The serial of the action on the seat - * @since 5.39 - */ - void grabRequested(KWayland::Server::SeatInterface *seat, quint32 serial); - -protected: - class Private; - explicit XdgShellPopupInterface(Private *p); + * This signal is emitted when the xdg-popup has commited the initial state and wants to + * be configured. After initializing the popup, you must send a configure event. + */ + void initializeRequested(); + void grabRequested(SeatInterface *seat, quint32 serial); + void repositionRequested(quint32 token); private: - friend class GenericShellSurface; - - Private *d_func() const; + QScopedPointer d; + friend class XdgPopupInterfacePrivate; }; -} -} - -Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface *) -Q_DECLARE_METATYPE(KWayland::Server::XdgShellPopupInterface *) -Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface::State) -Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface::States) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::PositionerConstraints) +} // namespace KWaylandServer -#endif +Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::XdgToplevelInterface::States) +Q_DECLARE_METATYPE(KWaylandServer::XdgToplevelInterface::State) +Q_DECLARE_METATYPE(KWaylandServer::XdgToplevelInterface::States) diff -Nru dwayland-5.57.0.23/src/server/xdgshell_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface_p.h --- dwayland-5.57.0.23/src/server/xdgshell_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_interface_p.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,107 +1,190 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2020 Vlad Zahorodnii -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H -#define KWAYLAND_SERVER_XDGSHELL_INTERFACE_P_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "qwayland-server-xdg-shell.h" #include "xdgshell_interface.h" -#include "global_p.h" -#include "generic_shell_surface_p.h" -#include "resource_p.h" -#include +#include "surface_interface.h" +#include "surfacerole_p.h" -namespace KWayland -{ -namespace Server +namespace KWaylandServer { +class XdgToplevelDecorationV1Interface; -class XdgShellInterface::Private : public Global::Private +class XdgShellInterfacePrivate : public QtWaylandServer::xdg_wm_base { public: - XdgShellInterfaceVersion interfaceVersion; + XdgShellInterfacePrivate(XdgShellInterface *shell); - virtual quint32 ping(XdgShellSurfaceInterface * surface) = 0; - void setupTimer(quint32 serial); - //pingserial/timer correspondence - QHash pingTimers; + Resource *resourceForXdgSurface(XdgSurfaceInterface *surface) const; + + void registerXdgSurface(XdgSurfaceInterface *surface); + void unregisterXdgSurface(XdgSurfaceInterface *surface); + + void registerPing(quint32 serial); + + static XdgShellInterfacePrivate *get(XdgShellInterface *shell); -protected: - Private(XdgShellInterfaceVersion interfaceVersion, XdgShellInterface *q, Display *d, const wl_interface *interface, quint32 version); XdgShellInterface *q; + Display *display; + QMap pings; + +protected: + void xdg_wm_base_destroy(Resource *resource) override; + void xdg_wm_base_create_positioner(Resource *resource, uint32_t id) override; + void xdg_wm_base_get_xdg_surface(Resource *resource, uint32_t id, ::wl_resource *surface) override; + void xdg_wm_base_pong(Resource *resource, uint32_t serial) override; + +private: + QMultiMap xdgSurfaces; }; -class XdgShellSurfaceInterface::Private : public Resource::Private, public GenericShellSurface +class XdgPositionerData : public QSharedData { public: - virtual ~Private(); + Qt::Orientations slideConstraintAdjustments; + Qt::Orientations flipConstraintAdjustments; + Qt::Orientations resizeConstraintAdjustments; + Qt::Edges anchorEdges; + Qt::Edges gravityEdges; + QPoint offset; + QSize size; + QRect anchorRect; + bool isReactive = false; + QSize parentSize; + quint32 parentConfigure; +}; - virtual void close() = 0; - virtual quint32 configure(States states, const QSize &size) = 0; +class XdgPositionerPrivate : public QtWaylandServer::xdg_positioner +{ +public: + XdgPositionerPrivate(::wl_resource *resource); - XdgShellSurfaceInterface *q_func() { - return reinterpret_cast(q); - } + QSharedDataPointer data; - QVector configureSerials; - QPointer parent; - XdgShellInterfaceVersion interfaceVersion; + static XdgPositionerPrivate *get(::wl_resource *resource); protected: - Private(XdgShellInterfaceVersion interfaceVersion, XdgShellSurfaceInterface *q, Global *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); + void xdg_positioner_destroy_resource(Resource *resource) override; + void xdg_positioner_destroy(Resource *resource) override; + void xdg_positioner_set_size(Resource *resource, int32_t width, int32_t height) override; + void xdg_positioner_set_anchor_rect(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void xdg_positioner_set_anchor(Resource *resource, uint32_t anchor) override; + void xdg_positioner_set_gravity(Resource *resource, uint32_t gravity) override; + void xdg_positioner_set_constraint_adjustment(Resource *resource, uint32_t constraint_adjustment) override; + void xdg_positioner_set_offset(Resource *resource, int32_t x, int32_t y) override; + void xdg_positioner_set_reactive(Resource *resource) override; + void xdg_positioner_set_parent_size(Resource *resource, int32_t width, int32_t height) override; + void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override; }; -class XdgShellPopupInterface::Private : public Resource::Private, public GenericShellSurface +struct XdgSurfaceState { + QRect windowGeometry; + quint32 acknowledgedConfigure; + bool acknowledgedConfigureIsSet = false; + bool windowGeometryIsSet = false; +}; + +class XdgSurfaceInterfacePrivate : public QtWaylandServer::xdg_surface { public: - virtual ~Private(); - virtual void popupDone() = 0; + XdgSurfaceInterfacePrivate(XdgSurfaceInterface *xdgSurface); - XdgShellPopupInterface *q_func() { - return reinterpret_cast(q); - } + void commit(); + void reset(); - virtual quint32 configure(const QRect &rect) { - Q_UNUSED(rect) - return 0; - }; + XdgSurfaceInterface *q; + XdgShellInterface *shell; + QPointer toplevel; + QPointer popup; + QPointer surface; + bool firstBufferAttached = false; + bool isConfigured = false; - QVector configureSerials; - QPointer parent; - QSize initialSize; - - /* - * - */ - QRect anchorRect; - Qt::Edges anchorEdge; - Qt::Edges gravity; - PositionerConstraints constraintAdjustments; - QPoint anchorOffset; + XdgSurfaceState next; + XdgSurfaceState current; - XdgShellInterfaceVersion interfaceVersion; + static XdgSurfaceInterfacePrivate *get(XdgSurfaceInterface *surface); protected: - Private(XdgShellInterfaceVersion interfaceVersion, XdgShellPopupInterface *q, XdgShellInterface *c, SurfaceInterface *surface, wl_resource *parentResource, const wl_interface *interface, const void *implementation); + void xdg_surface_destroy_resource(Resource *resource) override; + void xdg_surface_destroy(Resource *resource) override; + void xdg_surface_get_toplevel(Resource *resource, uint32_t id) override; + void xdg_surface_get_popup(Resource *resource, uint32_t id, ::wl_resource *parent, ::wl_resource *positioner) override; + void xdg_surface_set_window_geometry(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; + void xdg_surface_ack_configure(Resource *resource, uint32_t serial) override; +}; +class XdgToplevelInterfacePrivate : public SurfaceRole, public QtWaylandServer::xdg_toplevel +{ +public: + XdgToplevelInterfacePrivate(XdgToplevelInterface *toplevel, XdgSurfaceInterface *surface); + + void commit() override; + void reset(); + + static XdgToplevelInterfacePrivate *get(XdgToplevelInterface *toplevel); + static XdgToplevelInterfacePrivate *get(::wl_resource *resource); + + XdgToplevelInterface *q; + QPointer parentXdgToplevel; + QPointer decoration; + XdgSurfaceInterface *xdgSurface; + + QString windowTitle; + QString windowClass; + + struct State { + QSize minimumSize; + QSize maximumSize; + }; + + State next; + State current; + +protected: + void xdg_toplevel_destroy_resource(Resource *resource) override; + void xdg_toplevel_destroy(Resource *resource) override; + void xdg_toplevel_set_parent(Resource *resource, ::wl_resource *parent) override; + void xdg_toplevel_set_title(Resource *resource, const QString &title) override; + void xdg_toplevel_set_app_id(Resource *resource, const QString &app_id) override; + void xdg_toplevel_show_window_menu(Resource *resource, ::wl_resource *seat, uint32_t serial, int32_t x, int32_t y) override; + void xdg_toplevel_move(Resource *resource, ::wl_resource *seat, uint32_t serial) override; + void xdg_toplevel_resize(Resource *resource, ::wl_resource *seat, uint32_t serial, uint32_t edges) override; + void xdg_toplevel_set_max_size(Resource *resource, int32_t width, int32_t height) override; + void xdg_toplevel_set_min_size(Resource *resource, int32_t width, int32_t height) override; + void xdg_toplevel_set_maximized(Resource *resource) override; + void xdg_toplevel_unset_maximized(Resource *resource) override; + void xdg_toplevel_set_fullscreen(Resource *resource, ::wl_resource *output) override; + void xdg_toplevel_unset_fullscreen(Resource *resource) override; + void xdg_toplevel_set_minimized(Resource *resource) override; }; -} -} +class XdgPopupInterfacePrivate : public SurfaceRole, public QtWaylandServer::xdg_popup +{ +public: + static XdgPopupInterfacePrivate *get(XdgPopupInterface *popup); + + XdgPopupInterfacePrivate(XdgPopupInterface *popup, XdgSurfaceInterface *surface); + + void commit() override; + void reset(); + + XdgPopupInterface *q; + SurfaceInterface *parentSurface; + XdgSurfaceInterface *xdgSurface; + XdgPositioner positioner; + +protected: + void xdg_popup_destroy_resource(Resource *resource) override; + void xdg_popup_destroy(Resource *resource) override; + void xdg_popup_grab(Resource *resource, ::wl_resource *seat, uint32_t serial) override; + void xdg_popup_reposition(Resource *resource, struct ::wl_resource *positioner, uint32_t token) override; +}; -#endif +} // namespace KWaylandServer diff -Nru dwayland-5.57.0.23/src/server/xdgshell_stable_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_stable_interface.cpp --- dwayland-5.57.0.23/src/server/xdgshell_stable_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_stable_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,980 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_stable_interface_p.h" -#include "xdgshell_interface_p.h" -#include "generic_shell_surface_p.h" -#include "display.h" -#include "global_p.h" -#include "global.h" -#include "resource_p.h" -#include "output_interface.h" -#include "seat_interface.h" -#include "surface_interface.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class XdgShellStableInterface::Private : public XdgShellInterface::Private -{ -public: - Private(XdgShellStableInterface *q, Display *d); - - QVector surfaces; - QVector positioners; - -private: - - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - void createPositioner(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource); - - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - quint32 ping(XdgShellSurfaceInterface * surface) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return static_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void createPositionerCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - static void pongCallback(wl_client *client, wl_resource *resource, uint32_t serial); - - XdgShellStableInterface *q; - static const struct xdg_wm_base_interface s_interface; - static const quint32 s_version; - QHash resources; -}; - -class XdgPopupStableInterface::Private : public XdgShellPopupInterface::Private -{ -public: - Private(XdgPopupStableInterface *q, XdgShellStableInterface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private() override; - - void ackConfigure(quint32 serial) { - if (!configureSerials.contains(serial)) { - return; - } - while (!configureSerials.isEmpty()) { - quint32 i = configureSerials.takeFirst(); - emit q_func()->configureAcknowledged(i); - if (i == serial) { - break; - } - } - } - - void popupDone() override; - quint32 configure(const QRect &rect) override; - - XdgPopupStableInterface *q_func() { - return static_cast(q); - } -private: - static void grabCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial); - - static const struct xdg_popup_interface s_interface; -}; - -class XdgSurfaceStableInterface::Private : public KWayland::Server::Resource::Private -{ -public: - Private(XdgSurfaceStableInterface* q, XdgShellStableInterface* c, SurfaceInterface* surface, wl_resource* parentResource); - - ~Private() override; - - XdgSurfaceStableInterface *q_func() { - return static_cast(q); - } - - void createTopLevel(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource); - void createPopup(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource, wl_resource *parentWindow, wl_resource *positioner); - XdgShellStableInterface *m_shell; - SurfaceInterface *m_surface; - - //effectively a union, only one of these should be populated. - //a surface cannot have two roles - QPointer m_topLevel; - QPointer m_popup; - -private: - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getTopLevelCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *parent, wl_resource *positioner); - static void ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial); - static void setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static const struct xdg_surface_interface s_interface; -}; - -class XdgTopLevelStableInterface::Private : public XdgShellSurfaceInterface::Private -{ -public: - Private(XdgTopLevelStableInterface* q, XdgShellStableInterface* c, SurfaceInterface* surface, wl_resource* parentResource); - ~Private() override; - - void close() override; - - void ackConfigure(quint32 serial) { - if (!configureSerials.contains(serial)) { - return; - } - while (!configureSerials.isEmpty()) { - quint32 i = configureSerials.takeFirst(); - emit q_func()->configureAcknowledged(i); - if (i == serial) { - break; - } - } - } - - quint32 configure(States states, const QSize &size) override { - if (!resource) { - return 0; - } - const quint32 serial = global->display()->nextSerial(); - wl_array configureStates; - wl_array_init(&configureStates); - if (states.testFlag(State::Maximized)) { - uint32_t *s = static_cast(wl_array_add(&configureStates, sizeof(uint32_t))); - *s = XDG_TOPLEVEL_STATE_MAXIMIZED; - } - if (states.testFlag(State::Fullscreen)) { - uint32_t *s = static_cast(wl_array_add(&configureStates, sizeof(uint32_t))); - *s = XDG_TOPLEVEL_STATE_FULLSCREEN; - } - if (states.testFlag(State::Resizing)) { - uint32_t *s = static_cast(wl_array_add(&configureStates, sizeof(uint32_t))); - *s = XDG_TOPLEVEL_STATE_RESIZING; - } - if (states.testFlag(State::Activated)) { - uint32_t *s = static_cast(wl_array_add(&configureStates, sizeof(uint32_t))); - *s = XDG_TOPLEVEL_STATE_ACTIVATED; - } - configureSerials << serial; - xdg_toplevel_send_configure(resource, size.width(), size.height(), &configureStates); - - xdg_surface_send_configure(parentResource, serial); - - client->flush(); - wl_array_release(&configureStates); - return serial; - }; - - XdgTopLevelStableInterface *q_func() { - return static_cast(q); - } - -private: - static void destroyCallback(wl_client *client, wl_resource *resource); - static void setParentCallback(struct wl_client *client, struct wl_resource *resource, wl_resource *parent); - static void showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, int32_t x, int32_t y); - static void setMaxSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setMinSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setMaximizedCallback(wl_client *client, wl_resource *resource); - static void unsetMaximizedCallback(wl_client *client, wl_resource *resource); - static void setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource *output); - static void unsetFullscreenCallback(wl_client *client, wl_resource *resource); - static void setMinimizedCallback(wl_client *client, wl_resource *resource); - - static const struct xdg_toplevel_interface s_interface; -}; - - -const quint32 XdgShellStableInterface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct xdg_wm_base_interface XdgShellStableInterface::Private::s_interface = { - destroyCallback, - createPositionerCallback, - getXdgSurfaceCallback, - pongCallback -}; -#endif - -void XdgShellStableInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - auto s = cast(resource); - if (!s->surfaces.isEmpty()) { - wl_resource_post_error(resource, XDG_WM_BASE_ERROR_DEFUNCT_SURFACES, "WMBase destroyed before surfaces"); - } - - wl_resource_destroy(resource); -} - -void XdgShellStableInterface::Private::createPositionerCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - auto s = cast(resource); - s->createPositioner(client, wl_resource_get_version(resource), id, resource); -} - -void XdgShellStableInterface::Private::getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) -{ - auto s = cast(resource); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void XdgShellStableInterface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](XdgSurfaceStableInterface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), XDG_WM_BASE_ERROR_ROLE, "XDG Surface already created"); - return; - } - XdgSurfaceStableInterface *shellSurface = new XdgSurfaceStableInterface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &XdgSurfaceStableInterface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - - shellSurface->d->create(display->getConnection(client), version, id); -} - -void XdgShellStableInterface::Private::createPositioner(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource) -{ - Q_UNUSED(client) - - XdgPositionerStableInterface *positioner = new XdgPositionerStableInterface(q, parentResource); - positioners << positioner; - QObject::connect(positioner, &Resource::destroyed, q, - [this, positioner] { - positioners.removeAll(positioner); - } - ); - positioner->d->create(display->getConnection(client), version, id); -} - -void XdgShellStableInterface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - Q_UNUSED(client) - auto s = cast(resource); - auto timerIt = s->pingTimers.find(serial); - if (timerIt != s->pingTimers.end() && timerIt.value()->isActive()) { - delete timerIt.value(); - s->pingTimers.erase(timerIt); - emit s->q->pongReceived(serial); - } -} - -XdgShellStableInterface::Private::Private(XdgShellStableInterface *q, Display *d) - : XdgShellInterface::Private(XdgShellInterfaceVersion::Stable, q, d, &xdg_wm_base_interface, 1) - , q(q) -{ -} - -void XdgShellStableInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - auto resource = c->createResource(&xdg_wm_base_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - resources[client] = resource; - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void XdgShellStableInterface::Private::unbind(wl_resource *resource) -{ - auto s = cast(resource); - auto client = wl_resource_get_client(resource); - s->resources.remove(client); -} - -XdgTopLevelStableInterface *XdgShellStableInterface::getSurface(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - - for (auto it = d->surfaces.constBegin(); it != d->surfaces.constEnd() ; it++) { - auto topLevel = (*it)->topLevel(); - if (topLevel && topLevel->resource() == resource) { - return topLevel; - } - } - return nullptr; -} - -XdgSurfaceStableInterface *XdgShellStableInterface::realGetSurface(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - - for (auto it = d->surfaces.constBegin(); it != d->surfaces.constEnd() ; it++) { - if ((*it)->resource() == resource) { - return (*it); - } - } - return nullptr; -} - -XdgPositionerStableInterface *XdgShellStableInterface::getPositioner(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - for (auto it = d->positioners.constBegin(); it != d->positioners.constEnd() ; it++) { - if ((*it)->resource() == resource) { - return *it; - } - } - return nullptr; -} - -quint32 XdgShellStableInterface::Private::ping(XdgShellSurfaceInterface *surface) -{ - auto client = surface->client()->client(); - //from here we can get the resource bound to our global. - - auto clientXdgShellResource = resources.value(client); - if (!clientXdgShellResource) { - return 0; - } - - const quint32 pingSerial = display->nextSerial(); - xdg_wm_base_send_ping(clientXdgShellResource, pingSerial); - - setupTimer(pingSerial); - return pingSerial; -} - -XdgShellStableInterface::Private *XdgShellStableInterface::d_func() const -{ - return static_cast(d.data()); -} - -namespace { -template <> -Qt::Edges edgesToQtEdges(xdg_toplevel_resize_edge edges) -{ - Qt::Edges qtEdges; - switch (edges) { - case XDG_TOPLEVEL_RESIZE_EDGE_TOP: - qtEdges = Qt::TopEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_LEFT: - qtEdges = Qt::LeftEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_RIGHT: - qtEdges = Qt::RightEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case XDG_TOPLEVEL_RESIZE_EDGE_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - return qtEdges; -} -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct xdg_surface_interface XdgSurfaceStableInterface::Private::s_interface = { - destroyCallback, - getTopLevelCallback, - getPopupCallback, - setWindowGeometryCallback, - ackConfigureCallback -}; -#endif - -void XdgSurfaceStableInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void XdgSurfaceStableInterface::Private::getTopLevelCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - auto s = cast(resource); - s->createTopLevel(client, wl_resource_get_version(resource), id, resource); -} - -void XdgSurfaceStableInterface::Private::createTopLevel(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource) -{ - if (m_topLevel) { - wl_resource_post_error(parentResource, XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED, "Toplevel already created on this surface"); - return; - } - if (m_popup) { - wl_resource_post_error(parentResource, XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED, "Popup already created on this surface"); - return; - } - m_topLevel = new XdgTopLevelStableInterface (m_shell, m_surface, parentResource); - m_topLevel->d->create(m_shell->display()->getConnection(client), version, id); - - emit m_shell->surfaceCreated(m_topLevel); -} - - -void XdgSurfaceStableInterface::Private::getPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *parent, wl_resource *positioner) -{ - auto s = cast(resource); - s->createPopup(client, wl_resource_get_version(resource), id, resource, parent, positioner); -} - -void XdgSurfaceStableInterface::Private::createPopup(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource, wl_resource *parentSurface, wl_resource *positioner) -{ - - if (m_topLevel) { - wl_resource_post_error(parentResource, XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED, "Toplevel already created on this surface"); - return; - } - if (m_popup) { - wl_resource_post_error(parentResource, XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED, "Popup already created on this surface"); - return; - } - - auto xdgPositioner = m_shell->getPositioner(positioner); - if (!xdgPositioner) { - wl_resource_post_error(parentResource, XDG_WM_BASE_ERROR_INVALID_POSITIONER, "Invalid positioner"); - return; - } - m_popup = new XdgPopupStableInterface(m_shell, m_surface, parentResource); - auto pd = m_popup->d_func(); - - pd->create(m_shell->display()->getConnection(client), version, id); - - auto parentXdgSurface = m_shell->realGetSurface(parentSurface); - if (!parentXdgSurface) { - wl_resource_post_error(parentResource, XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT, "Invalid popup parent"); - return; - } - pd->parent = parentXdgSurface->surface(); - pd->initialSize = xdgPositioner->initialSize(); - pd->anchorRect = xdgPositioner->anchorRect(); - pd->anchorEdge = xdgPositioner->anchorEdge(); - pd->gravity = xdgPositioner->gravity(); - pd->constraintAdjustments = xdgPositioner->constraintAdjustments(); - pd->anchorOffset = xdgPositioner->anchorOffset(); - - emit m_shell->xdgPopupCreated(m_popup.data()); -} - - -void XdgSurfaceStableInterface::Private::ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - - if (s->m_topLevel) { - s->m_topLevel->d_func()->ackConfigure(serial); - } else if (s->m_popup) { - s->m_popup->d_func()->ackConfigure(serial); - } -} - -void XdgSurfaceStableInterface::Private::setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - // TODO: implement - not done for v5 either - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(x) - Q_UNUSED(y) - Q_UNUSED(width) - Q_UNUSED(height) -} - -XdgSurfaceStableInterface::Private::Private(XdgSurfaceStableInterface *q, XdgShellStableInterface *c, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::Resource::Private(q, c, parentResource, &xdg_surface_interface, &s_interface), - m_shell(c), - m_surface(surface) -{ -} - -XdgSurfaceStableInterface::Private::~Private() = default; - - -class XdgPositionerStableInterface::Private : public KWayland::Server::Resource::Private -{ -public: - Private(XdgPositionerStableInterface *q, XdgShellStableInterface *c, wl_resource* parentResource); - - QSize initialSize; - QRect anchorRect; - Qt::Edges anchorEdge; - Qt::Edges gravity; - PositionerConstraints constraintAdjustments; - QPoint anchorOffset; - -private: - static void setSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setAnchorRectCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static void setAnchorCallback(wl_client *client, wl_resource *resource, uint32_t anchor); - static void setGravityCallback(wl_client *client, wl_resource *resource, uint32_t gravity); - static void setConstraintAdjustmentCallback(wl_client *client, wl_resource *resource, uint32_t constraint_adjustment); - static void setOffsetCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); - - static const struct xdg_positioner_interface s_interface; -}; - -XdgPositionerStableInterface::Private::Private(XdgPositionerStableInterface *q, XdgShellStableInterface *c, wl_resource *parentResource) - : KWayland::Server::Resource::Private(q, c, parentResource, &xdg_positioner_interface, &s_interface) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct xdg_positioner_interface XdgPositionerStableInterface::Private::s_interface = { - resourceDestroyedCallback, - setSizeCallback, - setAnchorRectCallback, - setAnchorCallback, - setGravityCallback, - setConstraintAdjustmentCallback, - setOffsetCallback -}; -#endif - - -void XdgPositionerStableInterface::Private::setSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) { - Q_UNUSED(client) - auto s = cast(resource); - s->initialSize = QSize(width, height); -} - -void XdgPositionerStableInterface::Private::setAnchorRectCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - Q_UNUSED(client) - auto s = cast(resource); - s->anchorRect = QRect(x, y, width, height); -} - -void XdgPositionerStableInterface::Private::setAnchorCallback(wl_client *client, wl_resource *resource, uint32_t anchor) { - Q_UNUSED(client) - - auto s = cast(resource); - - Qt::Edges qtEdges; - switch (anchor) { - case XDG_POSITIONER_ANCHOR_TOP: - qtEdges = Qt::TopEdge; - break; - case XDG_POSITIONER_ANCHOR_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case XDG_POSITIONER_ANCHOR_LEFT: - qtEdges = Qt::LeftEdge; - break; - case XDG_POSITIONER_ANCHOR_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case XDG_POSITIONER_ANCHOR_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case XDG_POSITIONER_ANCHOR_RIGHT: - qtEdges = Qt::RightEdge; - break; - case XDG_POSITIONER_ANCHOR_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case XDG_POSITIONER_ANCHOR_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - - s->anchorEdge = qtEdges; -} - -void XdgPositionerStableInterface::Private::setGravityCallback(wl_client *client, wl_resource *resource, uint32_t gravity) { - Q_UNUSED(client) - auto s = cast(resource); - - Qt::Edges qtEdges; - switch (gravity) { - case XDG_POSITIONER_GRAVITY_TOP: - qtEdges = Qt::TopEdge; - break; - case XDG_POSITIONER_GRAVITY_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case XDG_POSITIONER_GRAVITY_LEFT: - qtEdges = Qt::LeftEdge; - break; - case XDG_POSITIONER_GRAVITY_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case XDG_POSITIONER_GRAVITY_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case XDG_POSITIONER_GRAVITY_RIGHT: - qtEdges = Qt::RightEdge; - break; - case XDG_POSITIONER_GRAVITY_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case XDG_POSITIONER_GRAVITY_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - - s->gravity = qtEdges; -} - -void XdgPositionerStableInterface::Private::setConstraintAdjustmentCallback(wl_client *client, wl_resource *resource, uint32_t constraint_adjustment) { - Q_UNUSED(client) - auto s = cast(resource); - PositionerConstraints constraints; - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X) { - constraints |= PositionerConstraint::SlideX; - } - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y) { - constraints |= PositionerConstraint::SlideY; - } - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X) { - constraints |= PositionerConstraint::FlipX; - } - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y) { - constraints |= PositionerConstraint::FlipY; - } - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X) { - constraints |= PositionerConstraint::ResizeX; - } - if (constraint_adjustment & XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y) { - constraints |= PositionerConstraint::ResizeY; - } - s->constraintAdjustments = constraints; -} - -void XdgPositionerStableInterface::Private::setOffsetCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y) -{ - Q_UNUSED(client) - auto s = cast(resource); - s->anchorOffset = QPoint(x,y); -} - -void XdgTopLevelStableInterface::Private::close() -{ - xdg_toplevel_send_close(resource); - client->flush(); -} - -void XdgTopLevelStableInterface::Private::setMaxSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maxSizeChanged(QSize(width, height)); -} - -void XdgTopLevelStableInterface::Private::setMinSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->minSizeChanged(QSize(width, height)); -} - -const struct xdg_toplevel_interface XdgTopLevelStableInterface::Private::s_interface = { - destroyCallback, - setParentCallback, - setTitleCallback, - setAppIdCallback, - showWindowMenuCallback, - moveCallback, - resizeCallback, - setMaxSizeCallback, - setMinSizeCallback, - setMaximizedCallback, - unsetMaximizedCallback, - setFullscreenCallback, - unsetFullscreenCallback, - setMinimizedCallback -}; - -void XdgTopLevelStableInterface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void XdgTopLevelStableInterface::Private::setParentCallback(wl_client *client, wl_resource *resource, wl_resource *parent) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - if (!parent) { - //setting null is valid API. Clear - s->parent = nullptr; - emit s->q_func()->transientForChanged(); - } else { - auto parentSurface = static_cast(s->q->global())->getSurface(parent); - if (s->parent.data() != parentSurface) { - s->parent = QPointer(parentSurface); - emit s->q_func()->transientForChanged(); - } - } -} - -void XdgTopLevelStableInterface::Private::showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, int32_t x, int32_t y) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - emit s->q_func()->windowMenuRequested(SeatInterface::get(seat), serial, QPoint(x, y)); -} - -XdgTopLevelStableInterface::Private::Private(XdgTopLevelStableInterface *q, XdgShellStableInterface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellSurfaceInterface::Private(XdgShellInterfaceVersion::Stable, q, c, surface, parentResource, &xdg_toplevel_interface, &s_interface) -{ -} - -void XdgTopLevelStableInterface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(true); -} - -void XdgTopLevelStableInterface::Private::unsetMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(false); -} - -void XdgTopLevelStableInterface::Private::setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource *output) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - OutputInterface *o = nullptr; - if (output) { - o = OutputInterface::get(output); - } - s->q_func()->fullscreenChanged(true, o); -} - -void XdgTopLevelStableInterface::Private::unsetFullscreenCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->fullscreenChanged(false, nullptr); -} - -void XdgTopLevelStableInterface::Private::setMinimizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->minimizeRequested(); -} - -XdgTopLevelStableInterface::Private::~Private() = default; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct xdg_popup_interface XdgPopupStableInterface::Private::s_interface = { - resourceDestroyedCallback, - grabCallback -}; -#endif - -XdgPopupStableInterface::Private::Private(XdgPopupStableInterface *q, XdgShellStableInterface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface::Private(XdgShellInterfaceVersion::Stable, q, c, surface, parentResource, &xdg_popup_interface, &s_interface) -{ -} - -void XdgPopupStableInterface::Private::grabCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial) -{ - Q_UNUSED(client) - auto s = cast(resource); - auto seatInterface = SeatInterface::get(seat); - s->q_func()->grabRequested(seatInterface, serial); -} - -XdgPopupStableInterface::Private::~Private() = default; - -quint32 XdgPopupStableInterface::Private::configure(const QRect &rect) -{ - if (!resource) { - return 0; - } - const quint32 serial = global->display()->nextSerial(); - configureSerials << serial; - xdg_popup_send_configure(resource, rect.x(), rect.y(), rect.width(), rect.height()); - xdg_surface_send_configure(parentResource, serial); - client->flush(); - - return serial; -} - -void XdgPopupStableInterface::Private::popupDone() -{ - if (!resource) { - return; - } - // TODO: dismiss all child popups - xdg_popup_send_popup_done(resource); - client->flush(); -} - -XdgShellStableInterface::XdgShellStableInterface(Display *display, QObject *parent) - : XdgShellInterface(new Private(this, display), parent) -{ -} - -Display* XdgShellStableInterface::display() const -{ - return d->display; -} - -XdgShellStableInterface::~XdgShellStableInterface() = default; - -XdgSurfaceStableInterface::XdgSurfaceStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::Resource(new Private(this, parent, surface, parentResource)) -{ -} - -XdgSurfaceStableInterface::~XdgSurfaceStableInterface() = default; - -SurfaceInterface* XdgSurfaceStableInterface::surface() const -{ - Q_D(); - return d->m_surface; -} - -XdgPositionerStableInterface::XdgPositionerStableInterface(XdgShellStableInterface *parent, wl_resource *parentResource) - : KWayland::Server::Resource(new Private(this, parent, parentResource)) -{ -} - -QSize XdgPositionerStableInterface::initialSize() const -{ - Q_D(); - return d->initialSize; -} - -QRect XdgPositionerStableInterface::anchorRect() const -{ - Q_D(); - return d->anchorRect; -} - -Qt::Edges XdgPositionerStableInterface::anchorEdge() const -{ - Q_D(); - return d->anchorEdge; -} - -Qt::Edges XdgPositionerStableInterface::gravity() const -{ - Q_D(); - return d->gravity; -} - -PositionerConstraints XdgPositionerStableInterface::constraintAdjustments() const -{ - Q_D(); - return d->constraintAdjustments; -} - -QPoint XdgPositionerStableInterface::anchorOffset() const -{ - Q_D(); - return d->anchorOffset; -} - - -XdgPositionerStableInterface::Private *XdgPositionerStableInterface::d_func() const -{ - return static_cast(d.data()); -} - - -XdgTopLevelStableInterface* XdgSurfaceStableInterface::topLevel() const -{ - Q_D(); - return d->m_topLevel.data(); -} - -XdgPopupStableInterface* XdgSurfaceStableInterface::popup() const -{ - Q_D(); - return d->m_popup.data(); -} - -XdgSurfaceStableInterface::Private *XdgSurfaceStableInterface::d_func() const -{ - return static_cast(d.data()); -} - - -XdgTopLevelStableInterface::XdgTopLevelStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::XdgShellSurfaceInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgTopLevelStableInterface::~XdgTopLevelStableInterface() = default; - -XdgTopLevelStableInterface::Private *XdgTopLevelStableInterface::d_func() const -{ - return static_cast(d.data()); -} - -XdgPopupStableInterface::XdgPopupStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgPopupStableInterface::~XdgPopupStableInterface() = default; - -XdgPopupStableInterface::Private *XdgPopupStableInterface::d_func() const -{ - return static_cast(d.data()); -} - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgshell_stable_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_stable_interface_p.h --- dwayland-5.57.0.23/src/server/xdgshell_stable_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_stable_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGSHELL_STABLE_INTERFACE_P_H -#define KWAYLAND_SERVER_XDGSHELL_STABLE_INTERFACE_P_H - -#include "global.h" -#include "resource.h" -#include "xdgshell_interface.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class OutputInterface; -class SeatInterface; -class SurfaceInterface; -class XdgTopLevelStableInterface; -class XdgPopupStableInterface; -class XdgPositionerStableInterface; -class XdgSurfaceStableInterface; -template -class GenericShellSurface; - -class XdgShellStableInterface : public XdgShellInterface -{ - Q_OBJECT -public: - virtual ~XdgShellStableInterface(); - - /** - * @returns The XdgTopLevelV6Interface for the @p native resource. - **/ - XdgTopLevelStableInterface *getSurface(wl_resource *native); - //DAVE we want to rename this, as it's bloody confusing. But XdgShellInterface::getSurface exists and expects that - //also use a less terrible argument name than native. It's obvious it's native from the type - - XdgPositionerStableInterface *getPositioner(wl_resource *native); - - XdgSurfaceStableInterface *realGetSurface(wl_resource *native); - - Display *display() const; - - void ping(XdgShellSurfaceInterface * surface); - -private: - explicit XdgShellStableInterface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -class XdgSurfaceStableInterface : public KWayland::Server::Resource -{ - Q_OBJECT -public: - virtual ~XdgSurfaceStableInterface(); - SurfaceInterface* surface() const; - XdgTopLevelStableInterface* topLevel() const; - XdgPopupStableInterface *popup() const; - -private: - explicit XdgSurfaceStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellStableInterface; - - class Private; - Private *d_func() const; -}; - -class XdgTopLevelStableInterface : public -XdgShellSurfaceInterface -{ - Q_OBJECT -public: - virtual ~XdgTopLevelStableInterface(); - -private: - explicit XdgTopLevelStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellStableInterface; - friend class XdgSurfaceStableInterface; - - class Private; - Private *d_func() const; -}; - -class XdgPopupStableInterface : public XdgShellPopupInterface -{ - Q_OBJECT -public: - virtual ~XdgPopupStableInterface(); - -private: - explicit XdgPopupStableInterface(XdgShellStableInterface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellStableInterface; - friend class XdgSurfaceStableInterface; - friend class GenericShellSurface; - - class Private; - Private *d_func() const; -}; - -/* - * This is a private internal class that keeps track of sent data - * At the time of PopupCreation these values are copied to the popup - */ -class XdgPositionerStableInterface: public KWayland::Server::Resource -{ -public: - QSize initialSize() const; - QRect anchorRect() const; - Qt::Edges anchorEdge() const; - Qt::Edges gravity() const; - PositionerConstraints constraintAdjustments() const; - QPoint anchorOffset() const; -private: - explicit XdgPositionerStableInterface(XdgShellStableInterface *parent, wl_resource *parentResource); - friend class XdgShellStableInterface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgshell_v5_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v5_interface.cpp --- dwayland-5.57.0.23/src/server/xdgshell_v5_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v5_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,508 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_v5_interface_p.h" -#include "xdgshell_interface_p.h" -#include "generic_shell_surface_p.h" -#include "display.h" -#include "global_p.h" -#include "resource_p.h" -#include "output_interface.h" -#include "seat_interface.h" -#include "surface_interface.h" - -#include "../compat/wayland-xdg-shell-v5-server-protocol.h" - -namespace KWayland -{ -namespace Server -{ - -class XdgShellV5Interface::Private : public XdgShellInterface::Private -{ -public: - Private(XdgShellV5Interface *q, Display *d); - - QVector surfaces; - -private: - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - void createPopup(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, SurfaceInterface *parent, SeatInterface *seat, quint32 serial, const QPoint &pos, wl_resource *parentResource); - void bind(wl_client *client, uint32_t version, uint32_t id) override; - quint32 ping(XdgShellSurfaceInterface * surface) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - QHash resources; - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void useUnstableVersionCallback(wl_client *client, wl_resource *resource, int32_t version); - static void getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - static void getXdgPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * parent, wl_resource * seat, uint32_t serial, int32_t x, int32_t y); - static void pongCallback(wl_client *client, wl_resource *resource, uint32_t serial); - - XdgShellV5Interface *q; - static const struct zxdg_shell_v5_interface s_interface; - static const quint32 s_version; -}; - -class XdgPopupV5Interface::Private : public XdgShellPopupInterface::Private -{ -public: - Private(XdgPopupV5Interface *q, XdgShellV5Interface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); - - void popupDone() override; - - XdgPopupV5Interface *q_func() { - return reinterpret_cast(q); - } - -private: - - static const struct zxdg_popup_v5_interface s_interface; -}; - -const quint32 XdgShellV5Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_shell_v5_interface XdgShellV5Interface::Private::s_interface = { - destroyCallback, - useUnstableVersionCallback, - getXdgSurfaceCallback, - getXdgPopupCallback, - pongCallback -}; -#endif - -void XdgShellV5Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - // TODO: send protocol error if there are still surfaces mapped - wl_resource_destroy(resource); -} - -void XdgShellV5Interface::Private::useUnstableVersionCallback(wl_client *client, wl_resource *resource, int32_t version) -{ - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(version) - // TODO: implement -} - -void XdgShellV5Interface::Private::getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) -{ - auto s = cast(resource); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void XdgShellV5Interface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](XdgSurfaceV5Interface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), ZXDG_SHELL_V5_ERROR_ROLE, "ShellSurface already created"); - return; - } - XdgSurfaceV5Interface *shellSurface = new XdgSurfaceV5Interface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &XdgSurfaceV5Interface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - shellSurface->d->create(display->getConnection(client), version, id); - emit q->surfaceCreated(shellSurface); -} - -void XdgShellV5Interface::Private::getXdgPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * parent, wl_resource * seat, uint32_t serial, int32_t x, int32_t y) -{ - auto s = cast(resource); - s->createPopup(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), SurfaceInterface::get(parent), SeatInterface::get(seat), serial, QPoint(x, y), resource); -} - -void XdgShellV5Interface::Private::createPopup(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, SurfaceInterface *parent, SeatInterface *seat, quint32 serial, const QPoint &pos, wl_resource *parentResource) -{ - XdgPopupV5Interface *popupSurface = new XdgPopupV5Interface(q, surface, parentResource); - auto d = popupSurface->d_func(); - d->parent = QPointer(parent); - d->anchorRect = QRect(pos, QSize(0,0)); - //default open like a normal popup - d->anchorEdge = Qt::BottomEdge; - d->gravity = Qt::TopEdge; - d->create(display->getConnection(client), version, id); - - //compat - emit q->popupCreated(popupSurface, seat, serial); - - //new system - emit q->xdgPopupCreated(popupSurface); - emit popupSurface->grabRequested(seat, serial); -} - -void XdgShellV5Interface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - Q_UNUSED(client) - auto s = cast(resource); - auto timerIt = s->pingTimers.find(serial); - if (timerIt != s->pingTimers.end() && timerIt.value()->isActive()) { - delete timerIt.value(); - s->pingTimers.erase(timerIt); - emit s->q->pongReceived(serial); - } -} - -XdgShellV5Interface::Private::Private(XdgShellV5Interface *q, Display *d) - : XdgShellInterface::Private(XdgShellInterfaceVersion::UnstableV5, q, d, &zxdg_shell_v5_interface, s_version) - , q(q) -{ -} - -void XdgShellV5Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - auto resource = c->createResource(&zxdg_shell_v5_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - resources[client] = resource; - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void XdgShellV5Interface::Private::unbind(wl_resource *resource) -{ - auto s = cast(resource); - auto client = wl_resource_get_client(resource); - s->resources.remove(client); -} - -XdgSurfaceV5Interface *XdgShellV5Interface::getSurface(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - auto it = std::find_if(d->surfaces.constBegin(), d->surfaces.constEnd(), - [resource] (XdgSurfaceV5Interface *surface) { - return surface->resource() == resource; - } - ); - if (it != d->surfaces.constEnd()) { - return *it; - } - return nullptr; -} - -quint32 XdgShellV5Interface::Private::ping(XdgShellSurfaceInterface * surface) -{ - auto client = surface->client()->client(); - //from here we can get the resource bound to our global. - - auto clientXdgShellResource = resources.value(client); - if (!clientXdgShellResource) { - return 0; - } - const quint32 pingSerial = display->nextSerial(); - zxdg_shell_v5_send_ping(clientXdgShellResource, pingSerial); - - setupTimer(pingSerial); - return pingSerial; -} - -XdgShellV5Interface::Private *XdgShellV5Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -class XdgSurfaceV5Interface::Private : public XdgShellSurfaceInterface::Private -{ -public: - Private(XdgSurfaceV5Interface *q, XdgShellV5Interface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); - - void close() override; - quint32 configure(States states, const QSize &size) override; - - XdgSurfaceV5Interface *q_func() { - return reinterpret_cast(q); - } - -private: - static void setParentCallback(wl_client *client, wl_resource *resource, wl_resource * parent); - static void showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource * seat, uint32_t serial, int32_t x, int32_t y); - static void ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial); - static void setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static void setMaximizedCallback(wl_client *client, wl_resource *resource); - static void unsetMaximizedCallback(wl_client *client, wl_resource *resource); - static void setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource * output); - static void unsetFullscreenCallback(wl_client *client, wl_resource *resource); - static void setMinimizedCallback(wl_client *client, wl_resource *resource); - - static const struct zxdg_surface_v5_interface s_interface; -}; - -namespace { -template <> -Qt::Edges edgesToQtEdges(zxdg_surface_v5_resize_edge edges) -{ - Qt::Edges qtEdges; - switch (edges) { - case ZXDG_SURFACE_V5_RESIZE_EDGE_TOP: - qtEdges = Qt::TopEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT: - qtEdges = Qt::LeftEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT: - qtEdges = Qt::RightEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case ZXDG_SURFACE_V5_RESIZE_EDGE_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - return qtEdges; -} -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_surface_v5_interface XdgSurfaceV5Interface::Private::s_interface = { - resourceDestroyedCallback, - setParentCallback, - setTitleCallback, - setAppIdCallback, - showWindowMenuCallback, - moveCallback, - resizeCallback, - ackConfigureCallback, - setWindowGeometryCallback, - setMaximizedCallback, - unsetMaximizedCallback, - setFullscreenCallback, - unsetFullscreenCallback, - setMinimizedCallback -}; -#endif - -void XdgSurfaceV5Interface::Private::setParentCallback(wl_client *client, wl_resource *resource, wl_resource *parent) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - auto parentSurface = static_cast(s->q->global())->getSurface(parent); - if (s->parent.data() != parentSurface) { - s->parent = QPointer(parentSurface); - emit s->q_func()->transientForChanged(); - } -} - -void XdgSurfaceV5Interface::Private::showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, int32_t x, int32_t y) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - emit s->q_func()->windowMenuRequested(SeatInterface::get(seat), serial, QPoint(x, y)); -} - -void XdgSurfaceV5Interface::Private::ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - if (!s->configureSerials.contains(serial)) { - // TODO: send error? - return; - } - while (!s->configureSerials.isEmpty()) { - quint32 i = s->configureSerials.takeFirst(); - emit s->q_func()->configureAcknowledged(i); - if (i == serial) { - break; - } - } -} - -void XdgSurfaceV5Interface::Private::setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - // TODO: implement - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(x) - Q_UNUSED(y) - Q_UNUSED(width) - Q_UNUSED(height) -} - -void XdgSurfaceV5Interface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(true); -} - -void XdgSurfaceV5Interface::Private::unsetMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(false); -} - -void XdgSurfaceV5Interface::Private::setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource *output) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - OutputInterface *o = nullptr; - if (output) { - o = OutputInterface::get(output); - } - s->q_func()->fullscreenChanged(true, o); -} - -void XdgSurfaceV5Interface::Private::unsetFullscreenCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->fullscreenChanged(false, nullptr); -} - -void XdgSurfaceV5Interface::Private::setMinimizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->minimizeRequested(); -} - -XdgSurfaceV5Interface::Private::Private(XdgSurfaceV5Interface *q, XdgShellV5Interface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellSurfaceInterface::Private(XdgShellInterfaceVersion::UnstableV5, q, c, surface, parentResource, &zxdg_surface_v5_interface, &s_interface) -{ -} - -XdgSurfaceV5Interface::Private::~Private() = default; - -void XdgSurfaceV5Interface::Private::close() -{ - zxdg_surface_v5_send_close(resource); - client->flush(); -} - -quint32 XdgSurfaceV5Interface::Private::configure(States states, const QSize &size) -{ - if (!resource) { - return 0; - } - const quint32 serial = global->display()->nextSerial(); - wl_array state; - wl_array_init(&state); - if (states.testFlag(State::Maximized)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_SURFACE_V5_STATE_MAXIMIZED; - } - if (states.testFlag(State::Fullscreen)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_SURFACE_V5_STATE_FULLSCREEN; - } - if (states.testFlag(State::Resizing)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_SURFACE_V5_STATE_RESIZING; - } - if (states.testFlag(State::Activated)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_SURFACE_V5_STATE_ACTIVATED; - } - configureSerials << serial; - zxdg_surface_v5_send_configure(resource, size.width(), size.height(), &state, serial); - client->flush(); - wl_array_release(&state); - - return serial; -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_popup_v5_interface XdgPopupV5Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -XdgPopupV5Interface::Private::Private(XdgPopupV5Interface *q, XdgShellV5Interface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface::Private(XdgShellInterfaceVersion::UnstableV5, q, c, surface, parentResource, &zxdg_popup_v5_interface, &s_interface) -{ -} - -XdgPopupV5Interface::Private::~Private() = default; - - -void XdgPopupV5Interface::Private::popupDone() -{ - if (!resource) { - return; - } - // TODO: dismiss all child popups - zxdg_popup_v5_send_popup_done(resource); - client->flush(); -} - -XdgShellV5Interface::XdgShellV5Interface(Display *display, QObject *parent) - : XdgShellInterface(new Private(this, display), parent) -{ -} - -XdgShellV5Interface::~XdgShellV5Interface() = default; - -XdgSurfaceV5Interface::XdgSurfaceV5Interface(XdgShellV5Interface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::XdgShellSurfaceInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgSurfaceV5Interface::~XdgSurfaceV5Interface() = default; - -XdgPopupV5Interface::XdgPopupV5Interface(XdgShellV5Interface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgPopupV5Interface::~XdgPopupV5Interface() = default; - -XdgPopupV5Interface::Private *XdgPopupV5Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgshell_v5_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v5_interface_p.h --- dwayland-5.57.0.23/src/server/xdgshell_v5_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v5_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/**************************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGSHELL_V5_INTERFACE_P_H -#define KWAYLAND_SERVER_XDGSHELL_V5_INTERFACE_P_H - -#include "global.h" -#include "resource.h" -#include "xdgshell_interface.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class OutputInterface; -class SeatInterface; -class SurfaceInterface; -class XdgPopupV5Interface; -class XdgSurfaceV5Interface; -template -class GenericShellSurface; - -class XdgShellV5Interface : public XdgShellInterface -{ - Q_OBJECT -public: - virtual ~XdgShellV5Interface(); - - /** - * @returns The XdgSurfaceV5Interface for the @p native resource. - **/ - XdgSurfaceV5Interface *getSurface(wl_resource *native); - - void ping(); - -private: - explicit XdgShellV5Interface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -class XdgSurfaceV5Interface : public XdgShellSurfaceInterface -{ - Q_OBJECT -public: - virtual ~XdgSurfaceV5Interface(); - -private: - explicit XdgSurfaceV5Interface(XdgShellV5Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellV5Interface; - - class Private; -}; - -class XdgPopupV5Interface : public XdgShellPopupInterface -{ - Q_OBJECT -public: - virtual ~XdgPopupV5Interface(); - -private: - explicit XdgPopupV5Interface(XdgShellV5Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellV5Interface; - friend class GenericShellSurface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xdgshell_v6_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v6_interface.cpp --- dwayland-5.57.0.23/src/server/xdgshell_v6_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v6_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,968 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xdgshell_v6_interface_p.h" -#include "xdgshell_interface_p.h" -#include "generic_shell_surface_p.h" -#include "display.h" -#include "global_p.h" -#include "global.h" -#include "resource_p.h" -#include "output_interface.h" -#include "seat_interface.h" -#include "surface_interface.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class XdgShellV6Interface::Private : public XdgShellInterface::Private -{ -public: - Private(XdgShellV6Interface *q, Display *d); - - QVector surfaces; - QVector positioners; - -private: - - void createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource); - void createPositioner(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource); - - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - quint32 ping(XdgShellSurfaceInterface * surface) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void destroyCallback(wl_client *client, wl_resource *resource); - static void createPositionerCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface); - static void pongCallback(wl_client *client, wl_resource *resource, uint32_t serial); - - XdgShellV6Interface *q; - static const struct zxdg_shell_v6_interface s_interface; - static const quint32 s_version; - QHash resources; -}; - -class XdgPopupV6Interface::Private : public XdgShellPopupInterface::Private -{ -public: - Private(XdgPopupV6Interface *q, XdgShellV6Interface *c, SurfaceInterface *surface, wl_resource *parentResource); - ~Private(); - - void ackConfigure(quint32 serial) { - if (!configureSerials.contains(serial)) { - // TODO: send error? - return; - } - while (!configureSerials.isEmpty()) { - quint32 i = configureSerials.takeFirst(); - emit q_func()->configureAcknowledged(i); - if (i == serial) { - break; - } - } - } - - void popupDone() override; - quint32 configure(const QRect &rect) override; - - XdgPopupV6Interface *q_func() { - return reinterpret_cast(q); - } -private: - static void grabCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial); - - static const struct zxdg_popup_v6_interface s_interface; -}; - -class XdgSurfaceV6Interface::Private : public KWayland::Server::Resource::Private -{ -public: - Private(XdgSurfaceV6Interface* q, XdgShellV6Interface* c, SurfaceInterface* surface, wl_resource* parentResource); - - ~Private(); - - XdgSurfaceV6Interface *q_func() { - return reinterpret_cast(q); - } - - void createTopLevel(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource); - void createPopup(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource, wl_resource *parentWindow, wl_resource *positioner); - XdgShellV6Interface *m_shell; - SurfaceInterface *m_surface; - - //effectively a union, only one of these should be populated. - //a surface cannot have two roles - QPointer m_topLevel; - QPointer m_popup; - -private: - static void destroyCallback(wl_client *client, wl_resource *resource); - static void getTopLevelCallback(wl_client *client, wl_resource *resource, uint32_t id); - static void getPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *parent, wl_resource *positioner); - static void ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial); - static void setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static const struct zxdg_surface_v6_interface s_interface; -}; - -class XdgTopLevelV6Interface::Private : public XdgShellSurfaceInterface::Private -{ -public: - Private(XdgTopLevelV6Interface* q, XdgShellV6Interface* c, SurfaceInterface* surface, wl_resource* parentResource); - ~Private(); - - void close() override; - - void ackConfigure(quint32 serial) { - if (!configureSerials.contains(serial)) { - // TODO: send error? - return; - } - while (!configureSerials.isEmpty()) { - quint32 i = configureSerials.takeFirst(); - emit q_func()->configureAcknowledged(i); - if (i == serial) { - break; - } - } - } - - quint32 configure(States states, const QSize &size) override { - if (!resource) { - return 0; - } - const quint32 serial = global->display()->nextSerial(); - wl_array state; - wl_array_init(&state); - if (states.testFlag(State::Maximized)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED; - } - if (states.testFlag(State::Fullscreen)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN; - } - if (states.testFlag(State::Resizing)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_TOPLEVEL_V6_STATE_RESIZING; - } - if (states.testFlag(State::Activated)) { - uint32_t *s = reinterpret_cast(wl_array_add(&state, sizeof(uint32_t))); - *s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED; - } - configureSerials << serial; - if (resource) { - zxdg_toplevel_v6_send_configure(resource, size.width(), size.height(), &state); - } - - if (parentResource) { - zxdg_surface_v6_send_configure(parentResource, serial); - } - - client->flush(); - wl_array_release(&state); - return serial; - }; - - XdgTopLevelV6Interface *q_func() { - return reinterpret_cast(q); - } - -private: - static void destroyCallback(wl_client *client, wl_resource *resource); - static void setParentCallback(struct wl_client *client, struct wl_resource *resource, wl_resource *parent); - static void showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, int32_t x, int32_t y); - static void setMaxSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setMinSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setMaximizedCallback(wl_client *client, wl_resource *resource); - static void unsetMaximizedCallback(wl_client *client, wl_resource *resource); - static void setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource *output); - static void unsetFullscreenCallback(wl_client *client, wl_resource *resource); - static void setMinimizedCallback(wl_client *client, wl_resource *resource); - - static const struct zxdg_toplevel_v6_interface s_interface; -}; - - -const quint32 XdgShellV6Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_shell_v6_interface XdgShellV6Interface::Private::s_interface = { - destroyCallback, - createPositionerCallback, - getXdgSurfaceCallback, - pongCallback -}; -#endif - -void XdgShellV6Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - // TODO: send protocol error if there are still surfaces mapped - wl_resource_destroy(resource); -} - -void XdgShellV6Interface::Private::createPositionerCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - auto s = cast(resource); - s->createPositioner(client, wl_resource_get_version(resource), id, resource); -} - -void XdgShellV6Interface::Private::getXdgSurfaceCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface) -{ - auto s = cast(resource); - s->createSurface(client, wl_resource_get_version(resource), id, SurfaceInterface::get(surface), resource); -} - -void XdgShellV6Interface::Private::createSurface(wl_client *client, uint32_t version, uint32_t id, SurfaceInterface *surface, wl_resource *parentResource) -{ - auto it = std::find_if(surfaces.constBegin(), surfaces.constEnd(), - [surface](XdgSurfaceV6Interface *s) { - return surface == s->surface(); - } - ); - if (it != surfaces.constEnd()) { - wl_resource_post_error(surface->resource(), ZXDG_SHELL_V6_ERROR_ROLE, "ShellSurface already created"); - return; - } - XdgSurfaceV6Interface *shellSurface = new XdgSurfaceV6Interface(q, surface, parentResource); - surfaces << shellSurface; - QObject::connect(shellSurface, &XdgSurfaceV6Interface::destroyed, q, - [this, shellSurface] { - surfaces.removeAll(shellSurface); - } - ); - - shellSurface->d->create(display->getConnection(client), version, id); -} - -void XdgShellV6Interface::Private::createPositioner(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource) -{ - Q_UNUSED(client) - - XdgPositionerV6Interface *positioner = new XdgPositionerV6Interface(q, parentResource); - positioners << positioner; - QObject::connect(positioner, &Resource::destroyed, q, - [this, positioner] { - positioners.removeAll(positioner); - } - ); - positioner->d->create(display->getConnection(client), version, id); -} - -void XdgShellV6Interface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - Q_UNUSED(client) - auto s = cast(resource); - auto timerIt = s->pingTimers.find(serial); - if (timerIt != s->pingTimers.end() && timerIt.value()->isActive()) { - delete timerIt.value(); - s->pingTimers.erase(timerIt); - emit s->q->pongReceived(serial); - } -} - -XdgShellV6Interface::Private::Private(XdgShellV6Interface *q, Display *d) - : XdgShellInterface::Private(XdgShellInterfaceVersion::UnstableV6, q, d, &zxdg_shell_v6_interface, 1) - , q(q) -{ -} - -void XdgShellV6Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - auto resource = c->createResource(&zxdg_shell_v6_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - resources[client] = resource; - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void XdgShellV6Interface::Private::unbind(wl_resource *resource) -{ - auto s = cast(resource); - auto client = wl_resource_get_client(resource); - s->resources.remove(client); -} - -XdgTopLevelV6Interface *XdgShellV6Interface::getSurface(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - - for (auto it = d->surfaces.constBegin(); it != d->surfaces.constEnd() ; it++) { - auto topLevel = (*it)->topLevel(); - if (topLevel && topLevel->resource() == resource) { - return topLevel; - } - } - return nullptr; -} - -XdgSurfaceV6Interface *XdgShellV6Interface::realGetSurface(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - - for (auto it = d->surfaces.constBegin(); it != d->surfaces.constEnd() ; it++) { - if ((*it)->resource() == resource) { - return (*it); - } - } - return nullptr; -} - -XdgPositionerV6Interface *XdgShellV6Interface::getPositioner(wl_resource *resource) -{ - if (!resource) { - return nullptr; - } - Q_D(); - for (auto it = d->positioners.constBegin(); it != d->positioners.constEnd() ; it++) { - if ((*it)->resource() == resource) { - return *it; - } - } - return nullptr; -} - -quint32 XdgShellV6Interface::Private::ping(XdgShellSurfaceInterface *surface) -{ - auto client = surface->client()->client(); - //from here we can get the resource bound to our global. - - auto clientXdgShellResource = resources.value(client); - if (!clientXdgShellResource) { - return 0; - } - - const quint32 pingSerial = display->nextSerial(); - zxdg_shell_v6_send_ping(clientXdgShellResource, pingSerial); - - setupTimer(pingSerial); - return pingSerial; -} - -XdgShellV6Interface::Private *XdgShellV6Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -namespace { -template <> -Qt::Edges edgesToQtEdges(zxdg_toplevel_v6_resize_edge edges) -{ - Qt::Edges qtEdges; - switch (edges) { - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP: - qtEdges = Qt::TopEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM: - qtEdges = Qt::BottomEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT: - qtEdges = Qt::LeftEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT: - qtEdges = Qt::TopEdge | Qt::LeftEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT: - qtEdges = Qt::BottomEdge | Qt::LeftEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT: - qtEdges = Qt::RightEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT: - qtEdges = Qt::TopEdge | Qt::RightEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT: - qtEdges = Qt::BottomEdge | Qt::RightEdge; - break; - case ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE: - break; - default: - Q_UNREACHABLE(); - break; - } - return qtEdges; -} -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_surface_v6_interface XdgSurfaceV6Interface::Private::s_interface = { - destroyCallback, - getTopLevelCallback, - getPopupCallback, - setWindowGeometryCallback, - ackConfigureCallback -}; -#endif - -void XdgSurfaceV6Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - //FIXME check if we have attached toplevels first and throw an error - wl_resource_destroy(resource); -} - -void XdgSurfaceV6Interface::Private::getTopLevelCallback(wl_client *client, wl_resource *resource, uint32_t id) -{ - auto s = cast(resource); - s->createTopLevel(client, wl_resource_get_version(resource), id, resource); -} - -void XdgSurfaceV6Interface::Private::createTopLevel(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource) -{ - if (m_topLevel) { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_ROLE, "Toplevel already created on this surface"); - return; - } - if (m_popup) { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_ROLE, "Popup already created on this surface"); - return; - } - m_topLevel = new XdgTopLevelV6Interface (m_shell, m_surface, parentResource); - m_topLevel->d->create(m_shell->display()->getConnection(client), version, id); - - emit m_shell->surfaceCreated(m_topLevel); -} - - -void XdgSurfaceV6Interface::Private::getPopupCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource *parent, wl_resource *positioner) -{ - auto s = cast(resource); - s->createPopup(client, wl_resource_get_version(resource), id, resource, parent, positioner); -} - -void XdgSurfaceV6Interface::Private::createPopup(wl_client *client, uint32_t version, uint32_t id, wl_resource *parentResource, wl_resource *parentSurface, wl_resource *positioner) -{ - - if (m_topLevel) { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_ROLE, "Toplevel already created on this surface"); - return; - } - if (m_popup) { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_ROLE, "Popup already created on this surface"); - return; - } - - auto xdgPositioner = m_shell->getPositioner(positioner); - if (!xdgPositioner) { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_INVALID_POSITIONER, "Invalid positioner"); - return; - } - m_popup = new XdgPopupV6Interface(m_shell, m_surface, parentResource); - auto pd = m_popup->d_func(); - - pd->create(m_shell->display()->getConnection(client), version, id); - - auto parentXdgSurface = m_shell->realGetSurface(parentSurface); - if (parentXdgSurface) { - pd->parent = parentXdgSurface->surface(); - } else { - wl_resource_post_error(parentResource, ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT, "Invalid popup parent"); - return; - } - - pd->initialSize = xdgPositioner->initialSize(); - pd->anchorRect = xdgPositioner->anchorRect(); - pd->anchorEdge = xdgPositioner->anchorEdge(); - pd->gravity = xdgPositioner->gravity(); - pd->constraintAdjustments = xdgPositioner->constraintAdjustments(); - pd->anchorOffset = xdgPositioner->anchorOffset(); - - emit m_shell->xdgPopupCreated(m_popup.data()); -} - - -void XdgSurfaceV6Interface::Private::ackConfigureCallback(wl_client *client, wl_resource *resource, uint32_t serial) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - - if (s->m_topLevel) { - s->m_topLevel->d_func()->ackConfigure(serial); - } else if (s->m_popup) { - s->m_popup->d_func()->ackConfigure(serial); - } -} - -void XdgSurfaceV6Interface::Private::setWindowGeometryCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - // TODO: implement - not done for v5 either - Q_UNUSED(client) - Q_UNUSED(resource) - Q_UNUSED(x) - Q_UNUSED(y) - Q_UNUSED(width) - Q_UNUSED(height) -} - -XdgSurfaceV6Interface::Private::Private(XdgSurfaceV6Interface *q, XdgShellV6Interface *c, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::Resource::Private(q, c, parentResource, &zxdg_surface_v6_interface, &s_interface), - m_shell(c), - m_surface(surface) -{ -} - -XdgSurfaceV6Interface::Private::~Private() = default; - - -class XdgPositionerV6Interface::Private : public KWayland::Server::Resource::Private -{ -public: - Private(XdgPositionerV6Interface *q, XdgShellV6Interface *c, wl_resource* parentResource); - - QSize initialSize; - QRect anchorRect; - Qt::Edges anchorEdge; - Qt::Edges gravity; - PositionerConstraints constraintAdjustments; - QPoint anchorOffset; - -private: - static void setSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height); - static void setAnchorRectCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); - static void setAnchorCallback(wl_client *client, wl_resource *resource, uint32_t anchor); - static void setGravityCallback(wl_client *client, wl_resource *resource, uint32_t gravity); - static void setConstraintAdjustmentCallback(wl_client *client, wl_resource *resource, uint32_t constraint_adjustment); - static void setOffsetCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); - - static const struct zxdg_positioner_v6_interface s_interface; -}; - -XdgPositionerV6Interface::Private::Private(XdgPositionerV6Interface *q, XdgShellV6Interface *c, wl_resource *parentResource) - : KWayland::Server::Resource::Private(q, c, parentResource, &zxdg_positioner_v6_interface, &s_interface) -{ -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_positioner_v6_interface XdgPositionerV6Interface::Private::s_interface = { - resourceDestroyedCallback, - setSizeCallback, - setAnchorRectCallback, - setAnchorCallback, - setGravityCallback, - setConstraintAdjustmentCallback, - setOffsetCallback -}; -#endif - - -void XdgPositionerV6Interface::Private::setSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) { - Q_UNUSED(client) - auto s = cast(resource); - s->initialSize = QSize(width, height); -} - -void XdgPositionerV6Interface::Private::setAnchorRectCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) -{ - Q_UNUSED(client) - auto s = cast(resource); - s->anchorRect = QRect(x, y, width, height); -} - -void XdgPositionerV6Interface::Private::setAnchorCallback(wl_client *client, wl_resource *resource, uint32_t anchor) { - Q_UNUSED(client) - - auto s = cast(resource); - //Note - see David E's email to wayland-devel about this being bad API - if ((anchor & ZXDG_POSITIONER_V6_ANCHOR_LEFT) && - (anchor & ZXDG_POSITIONER_V6_ANCHOR_RIGHT)) { - wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid arguments"); - return; - } - if ((anchor & ZXDG_POSITIONER_V6_ANCHOR_TOP) && - (anchor & ZXDG_POSITIONER_V6_ANCHOR_BOTTOM)) { - wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid arguments"); - return; - } - - Qt::Edges edges; - if (anchor & ZXDG_POSITIONER_V6_ANCHOR_LEFT) { - edges |= Qt::LeftEdge; - } - if (anchor & ZXDG_POSITIONER_V6_ANCHOR_TOP) { - edges |= Qt::TopEdge; - } - if (anchor & ZXDG_POSITIONER_V6_ANCHOR_RIGHT) { - edges |= Qt::RightEdge; - } - if (anchor & ZXDG_POSITIONER_V6_ANCHOR_BOTTOM) { - edges |= Qt::BottomEdge; - } - - s->anchorEdge = edges; -} - -void XdgPositionerV6Interface::Private::setGravityCallback(wl_client *client, wl_resource *resource, uint32_t gravity) { - Q_UNUSED(client) - auto s = cast(resource); - if ((gravity & ZXDG_POSITIONER_V6_GRAVITY_LEFT) && - (gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT)) { - wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid arguments"); - return; - } - if ((gravity & ZXDG_POSITIONER_V6_GRAVITY_TOP) && - (gravity & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM)) { - wl_resource_post_error(resource, ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT, "Invalid arguments"); - return; - } - - Qt::Edges edges; - if (gravity & ZXDG_POSITIONER_V6_ANCHOR_LEFT) { - edges |= Qt::LeftEdge; - } - if (gravity & ZXDG_POSITIONER_V6_ANCHOR_TOP) { - edges |= Qt::TopEdge; - } - if (gravity & ZXDG_POSITIONER_V6_ANCHOR_RIGHT) { - edges |= Qt::RightEdge; - } - if (gravity & ZXDG_POSITIONER_V6_ANCHOR_BOTTOM) { - edges |= Qt::BottomEdge; - } - - s->gravity = edges; -} - -void XdgPositionerV6Interface::Private::setConstraintAdjustmentCallback(wl_client *client, wl_resource *resource, uint32_t constraint_adjustment) { - Q_UNUSED(client) - auto s = cast(resource); - PositionerConstraints constraints; - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X) { - constraints |= PositionerConstraint::SlideX; - } - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y) { - constraints |= PositionerConstraint::SlideY; - } - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X) { - constraints |= PositionerConstraint::FlipX; - } - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y) { - constraints |= PositionerConstraint::FlipY; - } - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X) { - constraints |= PositionerConstraint::ResizeX; - } - if (constraint_adjustment & ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y) { - constraints |= PositionerConstraint::ResizeY; - } - s->constraintAdjustments = constraints; -} - -void XdgPositionerV6Interface::Private::setOffsetCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y) -{ - Q_UNUSED(client) - auto s = cast(resource); - s->anchorOffset = QPoint(x,y); -} - -void XdgTopLevelV6Interface::Private::close() -{ - zxdg_toplevel_v6_send_close(resource); - client->flush(); -} - -void XdgTopLevelV6Interface::Private::setMaxSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maxSizeChanged(QSize(width, height)); -} - -void XdgTopLevelV6Interface::Private::setMinSizeCallback(wl_client *client, wl_resource *resource, int32_t width, int32_t height) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->minSizeChanged(QSize(width, height)); -} - -const struct zxdg_toplevel_v6_interface XdgTopLevelV6Interface::Private::s_interface = { - destroyCallback, - setParentCallback, - setTitleCallback, - setAppIdCallback, - showWindowMenuCallback, - moveCallback, - resizeCallback, - setMaxSizeCallback, - setMinSizeCallback, - setMaximizedCallback, - unsetMaximizedCallback, - setFullscreenCallback, - unsetFullscreenCallback, - setMinimizedCallback -}; - -void XdgTopLevelV6Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void XdgTopLevelV6Interface::Private::setParentCallback(wl_client *client, wl_resource *resource, wl_resource *parent) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - if (!parent) { - //setting null is valid API. Clear - s->parent = nullptr; - emit s->q_func()->transientForChanged(); - } else { - auto parentSurface = static_cast(s->q->global())->getSurface(parent); - if (s->parent.data() != parentSurface) { - s->parent = QPointer(parentSurface); - emit s->q_func()->transientForChanged(); - } - } -} - -void XdgTopLevelV6Interface::Private::showWindowMenuCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial, int32_t x, int32_t y) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - emit s->q_func()->windowMenuRequested(SeatInterface::get(seat), serial, QPoint(x, y)); -} - -XdgTopLevelV6Interface::Private::Private(XdgTopLevelV6Interface *q, XdgShellV6Interface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellSurfaceInterface::Private(XdgShellInterfaceVersion::UnstableV6, q, c, surface, parentResource, &zxdg_toplevel_v6_interface, &s_interface) -{ -} - -void XdgTopLevelV6Interface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(true); -} - -void XdgTopLevelV6Interface::Private::unsetMaximizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->maximizedChanged(false); -} - -void XdgTopLevelV6Interface::Private::setFullscreenCallback(wl_client *client, wl_resource *resource, wl_resource *output) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - OutputInterface *o = nullptr; - if (output) { - o = OutputInterface::get(output); - } - s->q_func()->fullscreenChanged(true, o); -} - -void XdgTopLevelV6Interface::Private::unsetFullscreenCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->fullscreenChanged(false, nullptr); -} - -void XdgTopLevelV6Interface::Private::setMinimizedCallback(wl_client *client, wl_resource *resource) -{ - auto s = cast(resource); - Q_ASSERT(client == *s->client); - s->q_func()->minimizeRequested(); -} - -XdgTopLevelV6Interface::Private::~Private() = default; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zxdg_popup_v6_interface XdgPopupV6Interface::Private::s_interface = { - resourceDestroyedCallback, - grabCallback -}; -#endif - -XdgPopupV6Interface::Private::Private(XdgPopupV6Interface *q, XdgShellV6Interface *c, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface::Private(XdgShellInterfaceVersion::UnstableV6, q, c, surface, parentResource, &zxdg_popup_v6_interface, &s_interface) -{ -} - -void XdgPopupV6Interface::Private::grabCallback(wl_client *client, wl_resource *resource, wl_resource *seat, uint32_t serial) -{ - Q_UNUSED(client) - auto s = cast(resource); - auto seatInterface = SeatInterface::get(seat); - s->q_func()->grabRequested(seatInterface, serial); -} - -XdgPopupV6Interface::Private::~Private() = default; - -quint32 XdgPopupV6Interface::Private::configure(const QRect &rect) -{ - if (!resource) { - return 0; - } - const quint32 serial = global->display()->nextSerial(); - configureSerials << serial; - zxdg_popup_v6_send_configure(resource, rect.x(), rect.y(), rect.width(), rect.height()); - zxdg_surface_v6_send_configure(parentResource, serial); - client->flush(); - - return serial; -} - -void XdgPopupV6Interface::Private::popupDone() -{ - if (!resource) { - return; - } - // TODO: dismiss all child popups - zxdg_popup_v6_send_popup_done(resource); - client->flush(); -} - -XdgShellV6Interface::XdgShellV6Interface(Display *display, QObject *parent) - : XdgShellInterface(new Private(this, display), parent) -{ -} - -Display* XdgShellV6Interface::display() const -{ - return d->display; -} - -XdgShellV6Interface::~XdgShellV6Interface() = default; - -XdgSurfaceV6Interface::XdgSurfaceV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::Resource(new Private(this, parent, surface, parentResource)) -{ -} - -XdgSurfaceV6Interface::~XdgSurfaceV6Interface() = default; - -SurfaceInterface* XdgSurfaceV6Interface::surface() const -{ - Q_D(); - return d->m_surface; -} - -XdgPositionerV6Interface::XdgPositionerV6Interface(XdgShellV6Interface *parent, wl_resource *parentResource) - : KWayland::Server::Resource(new Private(this, parent, parentResource)) -{ -} - -QSize XdgPositionerV6Interface::initialSize() const -{ - Q_D(); - return d->initialSize; -} - -QRect XdgPositionerV6Interface::anchorRect() const -{ - Q_D(); - return d->anchorRect; -} - -Qt::Edges XdgPositionerV6Interface::anchorEdge() const -{ - Q_D(); - return d->anchorEdge; -} - -Qt::Edges XdgPositionerV6Interface::gravity() const -{ - Q_D(); - return d->gravity; -} - -PositionerConstraints XdgPositionerV6Interface::constraintAdjustments() const -{ - Q_D(); - return d->constraintAdjustments; -} - -QPoint XdgPositionerV6Interface::anchorOffset() const -{ - Q_D(); - return d->anchorOffset; -} - - -XdgPositionerV6Interface::Private *XdgPositionerV6Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - -XdgTopLevelV6Interface* XdgSurfaceV6Interface::topLevel() const -{ - Q_D(); - return d->m_topLevel.data(); -} - -XdgPopupV6Interface* XdgSurfaceV6Interface::popup() const -{ - Q_D(); - return d->m_popup.data(); -} - -XdgSurfaceV6Interface::Private *XdgSurfaceV6Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - -XdgTopLevelV6Interface::XdgTopLevelV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : KWayland::Server::XdgShellSurfaceInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgTopLevelV6Interface::~XdgTopLevelV6Interface() = default; - -XdgTopLevelV6Interface::Private *XdgTopLevelV6Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -XdgPopupV6Interface::XdgPopupV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource) - : XdgShellPopupInterface(new Private(this, parent, surface, parentResource)) -{ -} - -XdgPopupV6Interface::~XdgPopupV6Interface() = default; - -XdgPopupV6Interface::Private *XdgPopupV6Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -} -} - diff -Nru dwayland-5.57.0.23/src/server/xdgshell_v6_interface_p.h dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v6_interface_p.h --- dwayland-5.57.0.23/src/server/xdgshell_v6_interface_p.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xdgshell_v6_interface_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XDGSHELL_V6_INTERFACE_P_H -#define KWAYLAND_SERVER_XDGSHELL_V6_INTERFACE_P_H - -#include "global.h" -#include "resource.h" -#include "xdgshell_interface.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class OutputInterface; -class SeatInterface; -class SurfaceInterface; -class XdgTopLevelV6Interface; -class XdgPopupV6Interface; -class XdgPositionerV6Interface; -class XdgSurfaceV6Interface; -template -class GenericShellSurface; - -class XdgShellV6Interface : public XdgShellInterface -{ - Q_OBJECT -public: - virtual ~XdgShellV6Interface(); - - /** - * @returns The XdgTopLevelV6Interface for the @p native resource. - **/ - XdgTopLevelV6Interface *getSurface(wl_resource *native); - //DAVE we want to rename this, as it's bloody confusing. But XdgShellInterface::getSurface exists and expects that - //also use a less terrible argument name than native. It's obvious it's native from the type - - XdgPositionerV6Interface *getPositioner(wl_resource *native); - - XdgSurfaceV6Interface *realGetSurface(wl_resource *native); - - Display *display() const; - - void ping(XdgShellSurfaceInterface * surface); - -private: - explicit XdgShellV6Interface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -class XdgSurfaceV6Interface : public KWayland::Server::Resource -{ - Q_OBJECT -public: - virtual ~XdgSurfaceV6Interface(); - SurfaceInterface* surface() const; - XdgTopLevelV6Interface* topLevel() const; - XdgPopupV6Interface *popup() const; - -private: - explicit XdgSurfaceV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellV6Interface; - - class Private; - Private *d_func() const; -}; - -class XdgTopLevelV6Interface : public -XdgShellSurfaceInterface -{ - Q_OBJECT -public: - virtual ~XdgTopLevelV6Interface(); - -private: - explicit XdgTopLevelV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellV6Interface; - friend class XdgSurfaceV6Interface; - - class Private; - Private *d_func() const; -}; - -class XdgPopupV6Interface : public XdgShellPopupInterface -{ - Q_OBJECT -public: - virtual ~XdgPopupV6Interface(); - -private: - explicit XdgPopupV6Interface(XdgShellV6Interface *parent, SurfaceInterface *surface, wl_resource *parentResource); - friend class XdgShellV6Interface; - friend class XdgSurfaceV6Interface; - friend class GenericShellSurface; - - class Private; - Private *d_func() const; -}; - -/* - * This is a private internal class that keeps track of sent data - * At the time of PopupCreation these values are copied to the popup - */ -class XdgPositionerV6Interface: public KWayland::Server::Resource -{ -public: - QSize initialSize() const; - QRect anchorRect() const; - Qt::Edges anchorEdge() const; - Qt::Edges gravity() const; - PositionerConstraints constraintAdjustments() const; - QPoint anchorOffset() const; -private: - explicit XdgPositionerV6Interface(XdgShellV6Interface *parent, wl_resource *parentResource); - friend class XdgShellV6Interface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/server/xwayland_keyboard_grab_v1_interface.cpp dwayland-5.57.0.24+really5.24.3/src/server/xwayland_keyboard_grab_v1_interface.cpp --- dwayland-5.57.0.23/src/server/xwayland_keyboard_grab_v1_interface.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xwayland_keyboard_grab_v1_interface.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,225 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#include "xwayland_keyboard_grab_v1_interface.h" -#include "display.h" -#include "surface_interface.h" -#include "seat_interface.h" -#include "global_p.h" -#include "resource_p.h" -#include "logging.h" - -#include - -#include - -namespace KWayland -{ -namespace Server -{ -class ZWPXwaylandKeyboardGrabManagerV1Interface::Private : public Global::Private -{ -public: - Private(ZWPXwaylandKeyboardGrabManagerV1Interface *q, Display *d); - - ZWPXwaylandKeyboardGrabV1Interface* grab; -private: - void bind(wl_client *client, uint32_t version, uint32_t id) override; - - static void unbind(wl_resource *resource); - static Private *cast(wl_resource *r) { - return reinterpret_cast(wl_resource_get_user_data(r)); - } - - static void grabKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * seat); - static void destroyCallback(wl_client *client, wl_resource *resource); - - ZWPXwaylandKeyboardGrabManagerV1Interface *q; - static const struct zwp_xwayland_keyboard_grab_manager_v1_interface s_interface; - static const quint32 s_version; -}; - -const quint32 ZWPXwaylandKeyboardGrabManagerV1Interface::Private::s_version = 1; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_xwayland_keyboard_grab_manager_v1_interface ZWPXwaylandKeyboardGrabManagerV1Interface::Private::s_interface = { - destroyCallback, - grabKeyboardCallback -}; -#endif - -void ZWPXwaylandKeyboardGrabManagerV1Interface::Private::destroyCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -void ZWPXwaylandKeyboardGrabManagerV1Interface::Private::grabKeyboardCallback(wl_client *client, wl_resource *resource, uint32_t id, wl_resource * surface, wl_resource * seat) -{ - auto p = reinterpret_cast(wl_resource_get_user_data(resource)); - Q_ASSERT(p); - - SurfaceInterface *s = SurfaceInterface::get(surface); - if (!s) { - // TODO: send error? - qCWarning(KWAYLAND_SERVER) << "ServerSideDecorationInterface requested for non existing SurfaceInterface"; - return; - } - - SeatInterface *st = SeatInterface::get(seat); - if (!st) { - // TODO: send error? - qCWarning(KWAYLAND_SERVER) << "ServerSideDecorationInterface requested for non existing SeatInterface"; - return; - } - auto grab = new ZWPXwaylandKeyboardGrabV1Interface(p->q, s, st, resource); - grab->create(p->display->getConnection(client), wl_resource_get_version(resource), id); - if (!grab->resource()) { - wl_resource_post_no_memory(resource); - delete grab; - return; - } - p->grab = grab; - QObject::connect(grab, &QObject::destroyed, p->q, [=]() { - p->grab = nullptr; - emit p->q->zwpXwaylandKeyboardGrabV1Destroyed(); - }); - emit p->q->zwpXwaylandKeyboardGrabV1Created(grab); -} - -ZWPXwaylandKeyboardGrabManagerV1Interface::Private::Private(ZWPXwaylandKeyboardGrabManagerV1Interface *q, Display *d) - : Global::Private(d, &zwp_xwayland_keyboard_grab_manager_v1_interface, s_version) - , q(q) -{ -} - -void ZWPXwaylandKeyboardGrabManagerV1Interface::Private::bind(wl_client *client, uint32_t version, uint32_t id) -{ - auto c = display->getConnection(client); - wl_resource *resource = c->createResource(&zwp_xwayland_keyboard_grab_manager_v1_interface, qMin(version, s_version), id); - if (!resource) { - wl_client_post_no_memory(client); - return; - } - wl_resource_set_implementation(resource, &s_interface, this, unbind); -} - -void ZWPXwaylandKeyboardGrabManagerV1Interface::Private::unbind(wl_resource *resource) -{ - Q_UNUSED(resource) -} - -class ZWPXwaylandKeyboardGrabV1Interface::Private : public Resource::Private -{ -public: - Private(ZWPXwaylandKeyboardGrabV1Interface *q, ZWPXwaylandKeyboardGrabManagerV1Interface *c, SurfaceInterface *surface, SeatInterface *seat, wl_resource *parentResource); - ~Private(); - - - SurfaceInterface *surface; - SeatInterface *seat; -private: - - ZWPXwaylandKeyboardGrabV1Interface *q_func() - { - return reinterpret_cast(q); - } - static ZWPXwaylandKeyboardGrabV1Interface *get(SurfaceInterface *s); - - static void resourceDestroyedCallback(wl_client *client, wl_resource *resource); - static const struct zwp_xwayland_keyboard_grab_v1_interface s_interface; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -const struct zwp_xwayland_keyboard_grab_v1_interface ZWPXwaylandKeyboardGrabV1Interface::Private::s_interface = { - resourceDestroyedCallback -}; -#endif - -void ZWPXwaylandKeyboardGrabV1Interface::Private::resourceDestroyedCallback(wl_client *client, wl_resource *resource) -{ - Q_UNUSED(client) - wl_resource_destroy(resource); -} - -ZWPXwaylandKeyboardGrabV1Interface::Private::Private(ZWPXwaylandKeyboardGrabV1Interface *q, ZWPXwaylandKeyboardGrabManagerV1Interface *c, SurfaceInterface *s, SeatInterface *seat, wl_resource *parentResource) - : Resource::Private(q, c, parentResource, &zwp_xwayland_keyboard_grab_v1_interface, &s_interface), - surface(s), - seat(seat) -{ -} - -ZWPXwaylandKeyboardGrabV1Interface::Private::~Private() -{ - if (resource) { - wl_resource_destroy(resource); - resource = nullptr; - } -} - -ZWPXwaylandKeyboardGrabManagerV1Interface::ZWPXwaylandKeyboardGrabManagerV1Interface(Display *display, QObject *parent) - : Global(new Private(this, display), parent) -{ -} - -ZWPXwaylandKeyboardGrabManagerV1Interface::~ZWPXwaylandKeyboardGrabManagerV1Interface() -{ -} - -ZWPXwaylandKeyboardGrabV1Interface* ZWPXwaylandKeyboardGrabManagerV1Interface::getGrabClient() -{ - Q_D(); - return d->grab; -} - -ZWPXwaylandKeyboardGrabManagerV1Interface::Private *ZWPXwaylandKeyboardGrabManagerV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - - -ZWPXwaylandKeyboardGrabV1Interface::ZWPXwaylandKeyboardGrabV1Interface(ZWPXwaylandKeyboardGrabManagerV1Interface *parent, SurfaceInterface *s, SeatInterface *seat, wl_resource *parentResource): - Resource(new Private(this, parent, s, seat, parentResource)) -{ -} - -ZWPXwaylandKeyboardGrabV1Interface::Private *ZWPXwaylandKeyboardGrabV1Interface::d_func() const -{ - return reinterpret_cast(d.data()); -} - -ZWPXwaylandKeyboardGrabV1Interface::~ZWPXwaylandKeyboardGrabV1Interface() -{} - - -SurfaceInterface* ZWPXwaylandKeyboardGrabV1Interface::surface() const -{ - Q_D(); - return d->surface; -} - -SeatInterface* ZWPXwaylandKeyboardGrabV1Interface::seat() const -{ - Q_D(); - return d->seat; -} - -}//namespace -} - diff -Nru dwayland-5.57.0.23/src/server/xwayland_keyboard_grab_v1_interface.h dwayland-5.57.0.24+really5.24.3/src/server/xwayland_keyboard_grab_v1_interface.h --- dwayland-5.57.0.23/src/server/xwayland_keyboard_grab_v1_interface.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/server/xwayland_keyboard_grab_v1_interface.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/**************************************************************************** -Copyright 2017 David Edmundson - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -****************************************************************************/ -#ifndef KWAYLAND_SERVER_XWAYLAND_KEYBOARD_INTERFACE_H -#define KWAYLAND_SERVER_XWAYLAND_KEYBOARD_INTERFACE_H - -#include "global.h" -#include "resource.h" - -#include - -namespace KWayland -{ -namespace Server -{ - -class Display; -class SurfaceInterface; -class SeatInterface; -class ZWPXwaylandKeyboardGrabV1Interface; - -/** - * Provides the DBus service name and object path to a ZWPXwaylandKeyboardGrabV1 DBus interface. - * - * This global can be used for clients to bind AppmenuInterface instances - * and notifies when a new one is created - * @since 5.42 - */ -class KWAYLANDSERVER_EXPORT ZWPXwaylandKeyboardGrabManagerV1Interface : public Global -{ - Q_OBJECT -public: - virtual ~ZWPXwaylandKeyboardGrabManagerV1Interface(); - - ZWPXwaylandKeyboardGrabV1Interface* getGrabClient(); - -Q_SIGNALS: - /** - * Emitted whenever a new AppmenuInterface is created. - **/ - void zwpXwaylandKeyboardGrabV1Created(KWayland::Server::ZWPXwaylandKeyboardGrabV1Interface*); - /** - * Emitted whenever a new AppmenuInterface is created. - **/ - void zwpXwaylandKeyboardGrabV1Destroyed(); - -private: - explicit ZWPXwaylandKeyboardGrabManagerV1Interface(Display *display, QObject *parent = nullptr); - friend class Display; - class Private; - Private *d_func() const; -}; - -/** - * Provides the DBus service name and object path to a ZWPXwaylandKeyboardGrabV1 DBus interface. - * This interface is attached to a wl_surface and provides access to where - * the ZWPXwaylandKeyboardGrabV1 DBus interface is registered. - * @since 5.42 - */ -class KWAYLANDSERVER_EXPORT ZWPXwaylandKeyboardGrabV1Interface : public Resource -{ - Q_OBJECT -public: - enum GrabType { - GrabServer, - GrabKeyboard, - GrabPointer - }; - virtual ~ZWPXwaylandKeyboardGrabV1Interface(); - - - /** - * @returns The SurfaceInterface this AppmenuInterface references. - **/ - SurfaceInterface *surface() const; - - SeatInterface *seat() const; - -private: - explicit ZWPXwaylandKeyboardGrabV1Interface(ZWPXwaylandKeyboardGrabManagerV1Interface *parent, SurfaceInterface *s, SeatInterface *seat, wl_resource *parentResource); - friend class ZWPXwaylandKeyboardGrabManagerV1Interface; - - class Private; - Private *d_func() const; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/tools/.clang-format dwayland-5.57.0.24+really5.24.3/src/tools/.clang-format --- dwayland-5.57.0.23/src/tools/.clang-format 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/.clang-format 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff -Nru dwayland-5.57.0.23/src/tools/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/src/tools/CMakeLists.txt --- dwayland-5.57.0.23/src/tools/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -1,10 +1,40 @@ -add_subdirectory(testserver) +remove_definitions(-DQT_NO_CAST_FROM_ASCII) +add_executable(qtwaylandscanner_kde qtwaylandscanner.cpp) +target_link_libraries(qtwaylandscanner_kde Qt::Core) -include(ECMMarkAsTest) +function(ecm_add_qtwayland_server_protocol_kde out_var) + # Parse arguments + set(oneValueArgs PROTOCOL BASENAME PREFIX) + cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) -set(scannerSRCS generator.cpp) + if(ARGS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_server_protocol_kde(): \"${ARGS_UNPARSED_ARGUMENTS}\"") + endif() -add_definitions(-DMAPPING_FILE="${CMAKE_CURRENT_SOURCE_DIR}/mapping.txt") -add_executable(kwaylandScanner ${scannerSRCS}) -target_link_libraries(kwaylandScanner Qt5::Core Qt5::Concurrent) -ecm_mark_as_test(kwaylandScanner) + set(_prefix "${ARGS_PREFIX}") + + + find_package(WaylandScanner REQUIRED QUIET) + ecm_add_wayland_server_protocol(${out_var} + PROTOCOL ${ARGS_PROTOCOL} + BASENAME ${ARGS_BASENAME}) + + get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) + set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.h") + set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.cpp") + + set_source_files_properties(${_header} ${_code} GENERATED) + + add_custom_command(OUTPUT "${_header}" + COMMAND qtwaylandscanner_kde server-header ${_infile} "" ${_prefix} > ${_header} + DEPENDS ${_infile} qtwaylandscanner_kde VERBATIM) + + add_custom_command(OUTPUT "${_code}" + COMMAND qtwaylandscanner_kde server-code ${_infile} "" ${_prefix} > ${_code} + DEPENDS ${_infile} ${_header} qtwaylandscanner_kde VERBATIM) + + set_property(SOURCE ${_header} ${_code} PROPERTY SKIP_AUTOMOC ON) + + list(APPEND ${out_var} "${_code}") + set(${out_var} ${${out_var}} PARENT_SCOPE) +endfunction() diff -Nru dwayland-5.57.0.23/src/tools/generator.cpp dwayland-5.57.0.24+really5.24.3/src/tools/generator.cpp --- dwayland-5.57.0.23/src/tools/generator.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/generator.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1587 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "generator.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -namespace KWayland -{ -namespace Tools -{ - -static QMap s_clientClassNameMapping; - -static QString toQtInterfaceName(const QString &wlInterface) -{ - auto it = s_clientClassNameMapping.constFind(wlInterface); - if (it != s_clientClassNameMapping.constEnd()) { - return it.value(); - } else { - qWarning() << "Cannot find mapping for " << wlInterface; - } - return wlInterface; -} - -static QString toCamelCase(const QString &underscoreName) -{ - const QStringList parts = underscoreName.split(QStringLiteral("_")); - if (parts.count() < 2) { - return underscoreName; - } - auto it = parts.constBegin(); - QString camelCase = (*it); - it++; - for (; it != parts.constEnd(); ++it) { - camelCase.append((*it).left(1).toUpper()); - camelCase.append((*it).mid(1)); - } - return camelCase; -} - -Argument::Argument() -{ -} - -Argument::Argument(const QXmlStreamAttributes &attributes) - : m_name(attributes.value(QStringLiteral("name")).toString()) - , m_type(parseType(attributes.value(QStringLiteral("type")))) - , m_allowNull(attributes.hasAttribute(QStringLiteral("allow-null"))) - , m_inteface(attributes.value(QStringLiteral("interface")).toString()) -{ -} - -Argument::~Argument() = default; - -Argument::Type Argument::parseType(const QStringRef &type) -{ - if (type.compare(QLatin1String("new_id")) == 0) { - return Type::NewId; - } - if (type.compare(QLatin1String("destructor")) == 0) { - return Type::Destructor; - } - if (type.compare(QLatin1String("object")) == 0) { - return Type::Object; - } - if (type.compare(QLatin1String("fd")) == 0) { - return Type::FileDescriptor; - } - if (type.compare(QLatin1String("fixed")) == 0) { - return Type::Fixed; - } - if (type.compare(QLatin1String("uint")) == 0) { - return Type::Uint; - } - if (type.compare(QLatin1String("int")) == 0) { - return Type::Int; - } - if (type.compare(QLatin1String("string")) == 0) { - return Type::String; - } - - return Type::Unknown; -} - -QString Argument::typeAsQt() const -{ - switch (m_type) { - case Type::Destructor: - return QString(); - case Type::FileDescriptor: - return QStringLiteral("int"); - case Type::Fixed: - return QStringLiteral("qreal"); - case Type::Int: - return QStringLiteral("qint32"); - case Type::NewId: - case Type::Object: - return toQtInterfaceName(m_inteface); - case Type::String: - return QStringLiteral("const QString &"); - case Type::Uint: - return QStringLiteral("quint32"); - case Type::Unknown: - return QString(); - default: - Q_UNREACHABLE(); - } -} - -QString Argument::typeAsServerWl() const -{ - switch (m_type) { - case Type::Destructor: - return QString(); - case Type::FileDescriptor: - return QStringLiteral("int32_t"); - case Type::Fixed: - return QStringLiteral("wl_fixed"); - case Type::Int: - return QStringLiteral("int32_t"); - case Type::Object: - return QStringLiteral("wl_resource *"); - case Type::String: - return QStringLiteral("const char *"); - case Type::Uint: - case Type::NewId: - return QStringLiteral("uint32_t"); - case Type::Unknown: - return QString(); - default: - Q_UNREACHABLE(); - } -} - -Request::Request() -{ -} - -Request::Request(const QString &name) - : m_name(name) -{ -} - -Request::~Request() = default; - -bool Request::isFactory() const -{ - for (const auto a: m_arguments) { - if (a.type() == Argument::Type::NewId) { - return true; - } - } - return false; -} - -Event::Event() -{ -} - -Event::Event(const QString &name) - : m_name(name) -{ -} - -Event::~Event() = default; - -Interface::Interface() = default; - -Interface::Interface(const QXmlStreamAttributes &attributes) - : m_name(attributes.value(QStringLiteral("name")).toString()) - , m_version(attributes.value(QStringLiteral("version")).toUInt()) - , m_factory(nullptr) -{ - auto it = s_clientClassNameMapping.constFind(m_name); - if (it != s_clientClassNameMapping.constEnd()) { - m_clientName = it.value(); - } else { - qWarning() << "Failed to map " << m_name << " to a KWayland name"; - } -} - -Interface::~Interface() = default; - -Generator::Generator(QObject *parent) - : QObject(parent) -{ -} - -Generator::~Generator() = default; - -void Generator::start() -{ - startAuthorNameProcess(); - startAuthorEmailProcess(); - - startParseXml(); - - startGenerateHeaderFile(); - startGenerateCppFile(); - startGenerateServerHeaderFile(); - startGenerateServerCppFile(); -} - -void Generator::startParseXml() -{ - if (m_xmlFileName.isEmpty()) { - return; - } - QFile xmlFile(m_xmlFileName); - xmlFile.open(QIODevice::ReadOnly); - m_xmlReader.setDevice(&xmlFile); - while (!m_xmlReader.atEnd()) { - if (!m_xmlReader.readNextStartElement()) { - continue; - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("protocol")) == 0) { - parseProtocol(); - } - } - - auto findFactory = [this] (const QString interfaceName) -> Interface* { - for (auto it = m_interfaces.begin(); it != m_interfaces.end(); ++it) { - if ((*it).name().compare(interfaceName) == 0) { - continue; - } - for (auto r: (*it).requests()) { - for (auto a: r.arguments()) { - if (a.type() == Argument::Type::NewId && a.interface().compare(interfaceName) == 0) { - return &(*it); - } - } - } - } - return nullptr; - }; - for (auto it = m_interfaces.begin(); it != m_interfaces.end(); ++it) { - Interface *factory = findFactory((*it).name()); - if (factory) { - qDebug() << (*it).name() << "gets factored by" << factory->kwaylandClientName(); - (*it).setFactory(factory); - } else { - qDebug() << (*it).name() << "considered as a global"; - (*it).markAsGlobal(); - } - } -} - -void Generator::parseProtocol() -{ - const auto attributes = m_xmlReader.attributes(); - const QString protocolName = attributes.value(QStringLiteral("name")).toString(); - - if (m_baseFileName.isEmpty()) { - m_baseFileName = protocolName.toLower(); - } - - while (!m_xmlReader.atEnd()) { - if (!m_xmlReader.readNextStartElement()) { - if (m_xmlReader.qualifiedName().compare(QLatin1String("protocol")) == 0) { - return; - } - continue; - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("interface")) == 0) { - m_interfaces << parseInterface(); - } - } -} - -Interface Generator::parseInterface() -{ - Interface interface(m_xmlReader.attributes()); - while (!m_xmlReader.atEnd()) { - if (!m_xmlReader.readNextStartElement()) { - if (m_xmlReader.qualifiedName().compare(QLatin1String("interface")) == 0) { - break; - } - continue; - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("request")) == 0) { - interface.addRequest(parseRequest()); - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("event")) == 0) { - interface.addEvent(parseEvent()); - } - } - return interface; -} - -Request Generator::parseRequest() -{ - const auto attributes = m_xmlReader.attributes(); - Request request(attributes.value(QStringLiteral("name")).toString()); - if (attributes.value(QStringLiteral("type")).toString().compare(QLatin1String("destructor")) == 0) { - request.markAsDestructor(); - } - while (!m_xmlReader.atEnd()) { - if (!m_xmlReader.readNextStartElement()) { - if (m_xmlReader.qualifiedName().compare(QLatin1String("request")) == 0) { - break; - } - continue; - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("arg")) == 0) { - request.addArgument(Argument(m_xmlReader.attributes())); - } - } - return request; -} - -Event Generator::parseEvent() -{ - const auto attributes = m_xmlReader.attributes(); - Event event(attributes.value(QStringLiteral("name")).toString()); - while (!m_xmlReader.atEnd()) { - if (!m_xmlReader.readNextStartElement()) { - if (m_xmlReader.qualifiedName().compare(QLatin1String("event")) == 0) { - break; - } - continue; - } - if (m_xmlReader.qualifiedName().compare(QLatin1String("arg")) == 0) { - event.addArgument(Argument(m_xmlReader.attributes())); - } - } - return event; -} - -void Generator::startGenerateHeaderFile() -{ - QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, &QFutureWatcher::finished, this, &Generator::checkEnd); - m_finishedCounter++; - watcher->setFuture(QtConcurrent::run([this] { - QFile file(QStringLiteral("%1.h").arg(m_baseFileName)); - file.open(QIODevice::WriteOnly); - m_stream.setLocalData(new QTextStream(&file)); - m_project.setLocalData(Project::Client); - generateCopyrightHeader(); - generateStartIncludeGuard(); - generateHeaderIncludes(); - generateWaylandForwardDeclarations(); - generateStartNamespace(); - generateNamespaceForwardDeclarations(); - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - generateClass(*it); - } - generateEndNamespace(); - generateEndIncludeGuard(); - - m_stream.setLocalData(nullptr); - file.close(); - })); -} - -void Generator::startGenerateCppFile() -{ - QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, &QFutureWatcher::finished, this, &Generator::checkEnd); - m_finishedCounter++; - watcher->setFuture(QtConcurrent::run([this] { - QFile file(QStringLiteral("%1.cpp").arg(m_baseFileName)); - file.open(QIODevice::WriteOnly); - m_stream.setLocalData(new QTextStream(&file)); - m_project.setLocalData(Project::Client); - generateCopyrightHeader(); - generateCppIncludes(); - generateStartNamespace(); - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - generatePrivateClass(*it); - generateClientCpp(*it); - generateClientCppRequests(*it); - } - - generateEndNamespace(); - - m_stream.setLocalData(nullptr); - file.close(); - })); -} - -void Generator::startGenerateServerHeaderFile() -{ - QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, &QFutureWatcher::finished, this, &Generator::checkEnd); - m_finishedCounter++; - watcher->setFuture(QtConcurrent::run([this] { - QFile file(QStringLiteral("%1_interface.h").arg(m_baseFileName)); - file.open(QIODevice::WriteOnly); - m_stream.setLocalData(new QTextStream(&file)); - m_project.setLocalData(Project::Server); - generateCopyrightHeader(); - generateStartIncludeGuard(); - generateHeaderIncludes(); - generateStartNamespace(); - generateNamespaceForwardDeclarations(); - if (std::any_of(m_interfaces.constBegin(), m_interfaces.constEnd(), [] (const Interface &i) { return i.isUnstableInterface(); })) { - // generate the unstable semantic version - auto it = std::find_if(m_interfaces.constBegin(), m_interfaces.constEnd(), [] (const Interface &i) { return i.isGlobal(); }); - if (it != m_interfaces.constEnd()) { - const QString templateString = QStringLiteral( -"/**\n" -" * Enum describing the interface versions the %1 can support.\n" -" *\n" -" * @since 5.XX\n" -" **/\n" -"enum class %1Version {\n" -" /**\n" -" * %2\n" -" **/\n" -" UnstableV%3\n" -"};\n\n"); - *m_stream.localData() << templateString.arg((*it).kwaylandServerName()) - .arg((*it).name()) - .arg((*it).name().mid((*it).name().lastIndexOf(QStringLiteral("_v")) + 2)); - } - } - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - generateClass(*it); - } - generateEndNamespace(); - generateEndIncludeGuard(); - - m_stream.setLocalData(nullptr); - file.close(); - })); -} - -void Generator::startGenerateServerCppFile() -{ - QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, &QFutureWatcher::finished, this, &Generator::checkEnd); - m_finishedCounter++; - watcher->setFuture(QtConcurrent::run([this] { - QFile file(QStringLiteral("%1_interface.cpp").arg(m_baseFileName)); - file.open(QIODevice::WriteOnly); - m_stream.setLocalData(new QTextStream(&file)); - m_project.setLocalData(Project::Server); - generateCopyrightHeader(); - generateCppIncludes(); - generateStartNamespace(); - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - generatePrivateClass(*it); -// generateClientCpp(*it); -// generateClientCppRequests(*it); - } - - generateEndNamespace(); - - m_stream.setLocalData(nullptr); - file.close(); - })); -} - -void Generator::checkEnd() -{ - m_finishedCounter--; - if (m_finishedCounter == 0) { - QCoreApplication::quit(); - } -} - -void Generator::startAuthorNameProcess() -{ - QProcess *git = new QProcess(this); - git->setArguments(QStringList{ - QStringLiteral("config"), - QStringLiteral("--get"), - QStringLiteral("user.name") - }); - git->setProgram(QStringLiteral("git")); - connect(git, static_cast(&QProcess::finished), this, - [this, git] { - QMutexLocker locker(&m_mutex); - m_authorName = QString::fromLocal8Bit(git->readAllStandardOutput()).trimmed(); - git->deleteLater(); - m_waitCondition.wakeAll(); - } - ); - git->start(); -} - -void Generator::startAuthorEmailProcess() -{ - QProcess *git = new QProcess(this); - git->setArguments(QStringList{ - QStringLiteral("config"), - QStringLiteral("--get"), - QStringLiteral("user.email") - }); - git->setProgram(QStringLiteral("git")); - connect(git, static_cast(&QProcess::finished), this, - [this, git] { - QMutexLocker locker(&m_mutex); - m_authorEmail = QString::fromLocal8Bit(git->readAllStandardOutput()).trimmed(); - git->deleteLater(); - m_waitCondition.wakeAll(); - } - ); - git->start(); -} - -void Generator::generateCopyrightHeader() -{ - m_mutex.lock(); - while (m_authorEmail.isEmpty() || m_authorName.isEmpty()) { - m_waitCondition.wait(&m_mutex); - } - m_mutex.unlock(); - const QString templateString = QStringLiteral( -"/****************************************************************************\n" -"Copyright %1 %2 <%3>\n" -"\n" -"This library is free software; you can redistribute it and/or\n" -"modify it under the terms of the GNU Lesser General Public\n" -"License as published by the Free Software Foundation; either\n" -"version 2.1 of the License, or (at your option) version 3, or any\n" -"later version accepted by the membership of KDE e.V. (or its\n" -"successor approved by the membership of KDE e.V.), which shall\n" -"act as a proxy defined in Section 6 of version 3 of the license.\n" -"\n" -"This library is distributed in the hope that it will be useful,\n" -"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" -"Lesser General Public License for more details.\n" -"\n" -"You should have received a copy of the GNU Lesser General Public\n" -"License along with this library. If not, see .\n" -"****************************************************************************/\n" -); - QDate date = QDate::currentDate(); - *m_stream.localData() << templateString.arg(date.year()).arg(m_authorName).arg(m_authorEmail); -} - -void Generator::generateEndIncludeGuard() -{ - *m_stream.localData() << QStringLiteral("#endif\n"); -} - -void Generator::generateStartIncludeGuard() -{ - const QString templateString = QStringLiteral( -"#ifndef KWAYLAND_%1_%2_H\n" -"#define KWAYLAND_%1_%2_H\n\n"); - - *m_stream.localData() << templateString.arg(projectToName().toUpper()).arg(m_baseFileName.toUpper()); -} - -void Generator::generateStartNamespace() -{ - const QString templateString = QStringLiteral( -"namespace KWayland\n" -"{\n" -"namespace %1\n" -"{\n\n"); - *m_stream.localData() << templateString.arg(projectToName()); -} - -void Generator::generateEndNamespace() -{ - *m_stream.localData() << QStringLiteral("\n}\n}\n\n"); -} - -void Generator::generateHeaderIncludes() -{ - switch (m_project.localData()) { - case Project::Client: - *m_stream.localData() << QStringLiteral("#include \n\n"); - break; - case Project::Server: - *m_stream.localData() << QStringLiteral( -"#include \"global.h\"\n" -"#include \"resource.h\"\n\n"); - break; - default: - Q_UNREACHABLE(); - } - *m_stream.localData() << QStringLiteral("#include \n\n").arg(projectToName()).arg(projectToName().toLower()); -} - -void Generator::generateCppIncludes() -{ - switch (m_project.localData()) { - case Project::Client: - *m_stream.localData() << QStringLiteral("#include \"%1.h\"\n").arg(m_baseFileName.toLower()); - *m_stream.localData() << QStringLiteral("#include \"event_queue.h\"\n"); - *m_stream.localData() << QStringLiteral("#include \"wayland_pointer_p.h\"\n\n"); - break; - case Project::Server: - *m_stream.localData() << QStringLiteral("#include \"%1_interface.h\"\n").arg(m_baseFileName.toLower()); - *m_stream.localData() << QStringLiteral( -"#include \"display.h\"\n" -"#include \"global_p.h\"\n" -"#include \"resource_p.h\"\n\n"); - break; - default: - Q_UNREACHABLE(); - } -} - -void Generator::generateClass(const Interface &interface) -{ - switch (m_project.localData()) { - case Project::Client: - if (interface.isGlobal()) { - generateClientGlobalClass(interface); - } else { - generateClientResourceClass(interface); - } - break; - case Project::Server: - if (interface.isGlobal()) { - generateServerGlobalClass(interface); - } else { - generateServerResourceClass(interface); - } - break; - default: - Q_UNREACHABLE(); - } -} - -void Generator::generateClientGlobalClass(const Interface &interface) -{ - generateClientGlobalClassDoxy(interface); - generateClientClassQObjectDerived(interface); - generateClientGlobalClassCtor(interface); - generateClientClassDtor(interface); - generateClientGlobalClassSetup(interface); - generateClientClassReleaseDestroy(interface); - generateClientClassStart(interface); - generateClientClassRequests(interface); - generateClientClassCasts(interface); - generateClientClassSignals(interface); - generateClientGlobalClassEnd(interface); -} - -void Generator::generateClientResourceClass(const Interface &interface) -{ - generateClientClassQObjectDerived(interface); - generateClientClassDtor(interface); - generateClientResourceClassSetup(interface); - generateClientClassReleaseDestroy(interface); - generateClientClassRequests(interface); - generateClientClassCasts(interface); - generateClientResourceClassEnd(interface); -} - -void Generator::generateServerGlobalClass(const Interface &interface) -{ - if (interface.isUnstableInterface()) { - generateServerGlobalClassUnstable(interface); - return; - } - const QString templateString = QStringLiteral( -"class KWAYLANDSERVER_EXPORT %1 : public Global\n" -"{\n" -" Q_OBJECT\n" -"public:\n" -" virtual ~%1();\n" -"\n" -"private:\n" -" explicit %1(Display *display, QObject *parent = nullptr);\n" -" friend class Display;\n" -" class Private;\n" -"};\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()); -} - -void Generator::generateServerGlobalClassUnstable(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"class KWAYLANDSERVER_EXPORT %1 : public Global\n" -"{\n" -" Q_OBJECT\n" -"public:\n" -" virtual ~%1();\n" -"\n" -" /**\n" -" * @returns The interface version used by this %1\n" -" **/\n" -" %1Version interfaceVersion() const;\n" -"\n" -"protected:\n" -" class Private;\n" -" explicit %1(Private *d, QObject *parent = nullptr);\n" -"\n" -"private:\n" -" Private *d_func() const;\n" -"};\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()); -} - -void Generator::generateServerResourceClass(const Interface &interface) -{ - if (interface.factory()->isUnstableInterface()) { - generateServerResourceClassUnstable(interface); - return; - } - const QString templateString = QStringLiteral( -"class KWAYLANDSERVER_EXPORT %1 : public Resource\n" -"{\n" -" Q_OBJECT\n" -"public:\n" -" virtual ~%1();\n" -"\n" -"private:\n" -" explicit %1(%2 *parent, wl_resource *parentResource);\n" -" friend class %2;\n" -"\n" -" class Private;\n" -" Private *d_func() const;\n" -"};\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.factory()->kwaylandServerName()); -} - -void Generator::generateServerResourceClassUnstable(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"class KWAYLANDSERVER_EXPORT %1 : public Resource\n" -"{\n" -" Q_OBJECT\n" -"public:\n" -"\n" -" virtual ~%1();\n" -"\n" -" /**\n" -" * @returns The interface version used by this %1\n" -" **/\n" -" %2Version interfaceVersion() const;\n" -"\n" -"protected:\n" -" class Private;\n" -" explicit %1(Private *p, QObject *parent = nullptr);\n" -"\n" -"private:\n" -" Private *d_func() const;\n" -"};\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.factory()->kwaylandServerName()); -} - -void Generator::generatePrivateClass(const Interface &interface) -{ - switch (m_project.localData()) { - case Project::Client: - generateClientPrivateClass(interface); - break; - case Project::Server: - if (interface.isGlobal()) { - generateServerPrivateGlobalClass(interface); - } else { - generateServerPrivateResourceClass(interface); - } - break; - default: - Q_UNREACHABLE(); - } -} - -void Generator::generateServerPrivateGlobalClass(const Interface &interface) -{ - QString templateString = QStringLiteral( -"class %1::Private : public Global::Private\n" -"{\n" -"public:\n" -" Private(%1 *q, Display *d);\n" -"\n" -"private:\n" -" void bind(wl_client *client, uint32_t version, uint32_t id) override;\n" -"\n" -" static void unbind(wl_resource *resource);\n" -" static Private *cast(wl_resource *r) {\n" -" return reinterpret_cast(wl_resource_get_user_data(r));\n" -" }\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()); - - generateServerPrivateCallbackDefinitions(interface); - - templateString = QStringLiteral( -" %1 *q;\n" -" static const struct %2_interface s_interface;\n" -" static const quint32 s_version;\n" -"};\n" -"\n" -"const quint32 %1::Private::s_version = %3;\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.name()).arg(interface.version()); - generateServerPrivateInterfaceClass(interface); - generateServerPrivateCallbackImpl(interface); - generateServerPrivateGlobalCtorBindClass(interface); -} - -void Generator::generateServerPrivateCallbackDefinitions(const Interface &interface) -{ - for (const auto &r: interface.requests()) { - if (r.isDestructor() && !interface.isGlobal()) { - continue; - } - *m_stream.localData() << QStringLiteral(" static void %1Callback(wl_client *client, wl_resource *resource").arg(toCamelCase(r.name())); - for (const auto &a: r.arguments()) { - *m_stream.localData() << QStringLiteral(", %1 %2").arg(a.typeAsServerWl()).arg(a.name()); - } - *m_stream.localData() << QStringLiteral(");\n"); - } - *m_stream.localData() << QStringLiteral("\n"); -} - -void Generator::generateServerPrivateCallbackImpl(const Interface &interface) -{ - for (const auto &r: interface.requests()) { - if (r.isDestructor() && !interface.isGlobal()) { - continue; - } - *m_stream.localData() << QStringLiteral("void %2::Private::%1Callback(wl_client *client, wl_resource *resource").arg(toCamelCase(r.name())).arg(interface.kwaylandServerName()); - for (const auto &a: r.arguments()) { - *m_stream.localData() << QStringLiteral(", %1 %2").arg(a.typeAsServerWl()).arg(a.name()); - } - *m_stream.localData() << QStringLiteral( -")\n" -"{\n"); - if (r.isDestructor()) { - *m_stream.localData() << QStringLiteral( -" Q_UNUSED(client)\n" -" wl_resource_destroy(resource);\n"); - } else { - *m_stream.localData() << QStringLiteral(" // TODO: implement\n"); - } - *m_stream.localData() << QStringLiteral( -"}\n" -"\n"); - } -} - -void Generator::generateServerPrivateGlobalCtorBindClass(const Interface &interface) -{ - QString templateString = QStringLiteral( -"%1::Private::Private(%1 *q, Display *d)\n" -" : Global::Private(d, &%2_interface, s_version)\n" -" , q(q)\n" -"{\n" -"}\n" -"\n" -"void %1::Private::bind(wl_client *client, uint32_t version, uint32_t id)\n" -"{\n" -" auto c = display->getConnection(client);\n" -" wl_resource *resource = c->createResource(&%2_interface, qMin(version, s_version), id);\n" -" if (!resource) {\n" -" wl_client_post_no_memory(client);\n" -" return;\n" -" }\n" -" wl_resource_set_implementation(resource, &s_interface, this, unbind);\n" -" // TODO: should we track?\n" -"}\n" -"\n" -"void %1::Private::unbind(wl_resource *resource)\n" -"{\n" -" Q_UNUSED(resource)\n" -" // TODO: implement?\n" -"}\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.name()); -} - -void Generator::generateServerPrivateResourceClass(const Interface &interface) -{ - QString templateString = QStringLiteral( -"class %1::Private : public Resource::Private\n" -"{\n" -"public:\n" -" Private(%1 *q, %2 *c, wl_resource *parentResource);\n" -" ~Private();\n" -"\n" -"private:\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.factory()->kwaylandServerName()); - - generateServerPrivateCallbackDefinitions(interface); - - templateString = QStringLiteral( -" %1 *q_func() {\n" -" return reinterpret_cast<%1 *>(q);\n" -" }\n" -"\n" -" static const struct %2_interface s_interface;\n" -"};\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.name()); - - generateServerPrivateInterfaceClass(interface); - generateServerPrivateCallbackImpl(interface); - generateServerPrivateResourceCtorDtorClass(interface); -} - -void Generator::generateServerPrivateInterfaceClass(const Interface &interface) -{ - *m_stream.localData() << QStringLiteral("#ifndef DOXYGEN_SHOULD_SKIP_THIS\n"); - *m_stream.localData() << QStringLiteral("const struct %2_interface %1::Private::s_interface = {\n").arg(interface.kwaylandServerName()).arg(interface.name()); - bool first = true; - for (auto r: interface.requests()) { - if (!first) { - *m_stream.localData() << QStringLiteral(",\n"); - } else { - first = false; - } - if (r.isDestructor() && !interface.isGlobal()) { - *m_stream.localData() << QStringLiteral(" resourceDestroyedCallback"); - } else { - *m_stream.localData() << QStringLiteral(" %1Callback").arg(toCamelCase(r.name())); - } - } - *m_stream.localData() << QStringLiteral("\n};\n#endif\n\n"); -} - -void Generator::generateServerPrivateResourceCtorDtorClass(const Interface &interface) -{ - QString templateString = QStringLiteral( -"%1::Private::Private(%1 *q, %2 *c, wl_resource *parentResource)\n" -" : Resource::Private(q, c, parentResource, &%3_interface, &s_interface)\n" -"{\n" -"}\n" -"\n" -"%1::Private::~Private()\n" -"{\n" -" if (resource) {\n" -" wl_resource_destroy(resource);\n" -" resource = nullptr;\n" -" }\n" -"}\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandServerName()).arg(interface.factory()->kwaylandServerName()).arg(interface.name()); -} - -void Generator::generateClientPrivateClass(const Interface &interface) -{ - if (interface.isGlobal()) { - generateClientPrivateGlobalClass(interface); - } else { - generateClientPrivateResourceClass(interface); - } - - const auto events = interface.events(); - if (!events.isEmpty()) { - *m_stream.localData() << QStringLiteral("\nprivate:\n"); - // generate the callbacks - for (auto event : events) { - const QString templateString = QStringLiteral(" static void %1Callback(void *data, %2 *%2"); - *m_stream.localData() << templateString.arg(event.name()).arg(interface.name()); - const auto arguments = event.arguments(); - for (auto argument : arguments) { - if (argument.interface().isNull()) { - *m_stream.localData() << QStringLiteral(", %1 %2").arg(argument.typeAsServerWl()).arg(argument.name()); - } else { - *m_stream.localData() << QStringLiteral(", %1 *%2").arg(argument.interface()).arg(argument.name()); - } - } - *m_stream.localData() << ");\n"; - } - *m_stream.localData() << QStringLiteral("\n static const %1_listener s_listener;\n").arg(interface.name()); - } - - *m_stream.localData() << QStringLiteral("};\n\n"); -} - -void Generator::generateClientPrivateResourceClass(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"class %1::Private\n" -"{\n" -"public:\n" -" Private(%1 *q);\n" -"\n" -" void setup(%2 *arg);\n" -"\n" -" WaylandPointer<%2, %2_destroy> %3;\n" -"\n" -"private:\n" -" %1 *q;\n"); - - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()).arg(interface.name()).arg(interface.kwaylandClientName().toLower()); -} - -void Generator::generateClientPrivateGlobalClass(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"class %1::Private\n" -"{\n" -"public:\n" -" Private() = default;\n" -"\n" -" void setup(%2 *arg);\n" -"\n" -" WaylandPointer<%2, %2_destroy> %3;\n" -" EventQueue *queue = nullptr;\n"); - - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()).arg(interface.name()).arg(interface.kwaylandClientName().toLower()); -} - -void Generator::generateClientCpp(const Interface &interface) -{ - // TODO: generate listener and callbacks - const auto events = interface.events(); - if (!events.isEmpty()) { - // listener - *m_stream.localData() << QStringLiteral("const %1_listener %2::Private::s_listener = {\n").arg(interface.name()).arg(interface.kwaylandClientName()); - bool first = true; - for (auto event : events) { - if (!first) { - *m_stream.localData() << QStringLiteral(",\n"); - } - *m_stream.localData() << QStringLiteral(" %1Callback").arg(event.name()); - first = false; - } - *m_stream.localData() << QStringLiteral("\n};\n\n"); - - // callbacks - for (auto event : events) { - *m_stream.localData() << QStringLiteral("void %1::Private::%2Callback(void *data, %3 *%3").arg(interface.kwaylandClientName()).arg(event.name()).arg(interface.name()); - - const auto arguments = event.arguments(); - for (auto argument : arguments) { - if (argument.interface().isNull()) { - *m_stream.localData() << QStringLiteral(", %1 %2").arg(argument.typeAsServerWl()).arg(argument.name()); - } else { - *m_stream.localData() << QStringLiteral(", %1 *%2").arg(argument.interface()).arg(argument.name()); - } - } - - *m_stream.localData() << QStringLiteral( -")\n" -"{\n" -" auto p = reinterpret_cast<%1::Private*>(data);\n" -" Q_ASSERT(p->%2 == %3);\n").arg(interface.kwaylandClientName()) - .arg(interface.kwaylandClientName().toLower()) - .arg(interface.name()); - for (auto argument : arguments) { - *m_stream.localData() << QStringLiteral(" Q_UNUSED(%1)\n").arg(argument.name()); - } - *m_stream.localData() << QStringLiteral(" // TODO: implement\n}\n\n"); - } - } - - if (interface.isGlobal()) { - // generate ctor without this pointer to Private - const QString templateString = QStringLiteral( -"%1::%1(QObject *parent)\n" -" : QObject(parent)\n" -" , d(new Private)\n" -"{\n" -"}\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); - } else { - // Private ctor - const QString templateString = QStringLiteral( -"%1::Private::Private(%1 *q)\n" -" : q(q)\n" -"{\n" -"}\n" -"\n" -"%1::%1(QObject *parent)\n" -" : QObject(parent)\n" -" , d(new Private(this))\n" -"{\n" -"}\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); - } - - // setup call with optional add_listener - const QString setupTemplate = QStringLiteral( -"\n" -"void %1::Private::setup(%3 *arg)\n" -"{\n" -" Q_ASSERT(arg);\n" -" Q_ASSERT(!%2);\n" -" %2.setup(arg);\n"); - *m_stream.localData() << setupTemplate.arg(interface.kwaylandClientName()) - .arg(interface.kwaylandClientName().toLower()) - .arg(interface.name()); - if (!interface.events().isEmpty()) { - *m_stream.localData() << QStringLiteral(" %1_add_listener(%2, &s_listener, this);\n").arg(interface.name()).arg(interface.kwaylandClientName().toLower()); - } - *m_stream.localData() << QStringLiteral("}\n"); - - const QString templateString = QStringLiteral( -"\n" -"%1::~%1()\n" -"{\n" -" release();\n" -"}\n" -"\n" -"void %1::setup(%3 *%2)\n" -"{\n" -" d->setup(%2);\n" -"}\n" -"\n" -"void %1::release()\n" -"{\n" -" d->%2.release();\n" -"}\n" -"\n" -"void %1::destroy()\n" -"{\n" -" d->%2.destroy();\n" -"}\n" -"\n" -"%1::operator %3*() {\n" -" return d->%2;\n" -"}\n" -"\n" -"%1::operator %3*() const {\n" -" return d->%2;\n" -"}\n" -"\n" -"bool %1::isValid() const\n" -"{\n" -" return d->%2.isValid();\n" -"}\n\n"); - - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()) - .arg(interface.kwaylandClientName().toLower()) - .arg(interface.name()); - if (interface.isGlobal()) { - const QString templateStringGlobal = QStringLiteral( -"void %1::setEventQueue(EventQueue *queue)\n" -"{\n" -" d->queue = queue;\n" -"}\n" -"\n" -"EventQueue *%1::eventQueue()\n" -"{\n" -" return d->queue;\n" -"}\n\n" - ); - *m_stream.localData() << templateStringGlobal.arg(interface.kwaylandClientName()); - } -} - -void Generator::generateClientGlobalClassDoxy(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"/**\n" -" * @short Wrapper for the %2 interface.\n" -" *\n" -" * This class provides a convenient wrapper for the %2 interface.\n" -" *\n" -" * To use this class one needs to interact with the Registry. There are two\n" -" * possible ways to create the %1 interface:\n" -" * @code\n" -" * %1 *c = registry->create%1(name, version);\n" -" * @endcode\n" -" *\n" -" * This creates the %1 and sets it up directly. As an alternative this\n" -" * can also be done in a more low level way:\n" -" * @code\n" -" * %1 *c = new %1;\n" -" * c->setup(registry->bind%1(name, version));\n" -" * @endcode\n" -" *\n" -" * The %1 can be used as a drop-in replacement for any %2\n" -" * pointer as it provides matching cast operators.\n" -" *\n" -" * @see Registry\n" -" **/\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()).arg(interface.name()); -} - -void Generator::generateClientClassQObjectDerived(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"class KWAYLANDCLIENT_EXPORT %1 : public QObject\n" -"{\n" -" Q_OBJECT\n" -"public:\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); -} - -void Generator::generateClientGlobalClassCtor(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" /**\n" -" * Creates a new %1.\n" -" * Note: after constructing the %1 it is not yet valid and one needs\n" -" * to call setup. In order to get a ready to use %1 prefer using\n" -" * Registry::create%1.\n" -" **/\n" -" explicit %1(QObject *parent = nullptr);\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); -} - -void Generator::generateClientClassDtor(const Interface &interface) -{ - *m_stream.localData() << QStringLiteral(" virtual ~%1();\n\n").arg(interface.kwaylandClientName()); -} - -void Generator::generateClientClassReleaseDestroy(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" /**\n" -" * @returns @c true if managing a %2.\n" -" **/\n" -" bool isValid() const;\n" -" /**\n" -" * Releases the %2 interface.\n" -" * After the interface has been released the %1 instance is no\n" -" * longer valid and can be setup with another %2 interface.\n" -" **/\n" -" void release();\n" -" /**\n" -" * Destroys the data held by this %1.\n" -" * This method is supposed to be used when the connection to the Wayland\n" -" * server goes away. If the connection is not valid anymore, it's not\n" -" * possible to call release anymore as that calls into the Wayland\n" -" * connection and the call would fail. This method cleans up the data, so\n" -" * that the instance can be deleted or set up to a new %2 interface\n" -" * once there is a new connection available.\n" -" *\n" -" * It is suggested to connect this method to ConnectionThread::connectionDied:\n" -" * @code\n" -" * connect(connection, &ConnectionThread::connectionDied, %3, &%1::destroy);\n" -" * @endcode\n" -" *\n" -" * @see release\n" -" **/\n" -" void destroy();\n" -"\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()).arg(interface.name()).arg(interface.kwaylandClientName().toLower()); -} - -void Generator::generateClientGlobalClassSetup(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" /**\n" -" * Setup this %1 to manage the @p %3.\n" -" * When using Registry::create%1 there is no need to call this\n" -" * method.\n" -" **/\n" -" void setup(%2 *%3);\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()).arg(interface.name()).arg(interface.kwaylandClientName().toLower()); -} - -void Generator::generateClientResourceClassSetup(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" /**\n" -" * Setup this %1 to manage the @p %3.\n" -" * When using %4::create%1 there is no need to call this\n" -" * method.\n" -" **/\n" -" void setup(%2 *%3);\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()) - .arg(interface.name()) - .arg(interface.kwaylandClientName().toLower()) - .arg(interface.factory()->kwaylandClientName()); - -} - -void Generator::generateClientClassStart(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" /**\n" -" * Sets the @p queue to use for creating objects with this %1.\n" -" **/\n" -" void setEventQueue(EventQueue *queue);\n" -" /**\n" -" * @returns The event queue to use for creating objects with this %1.\n" -" **/\n" -" EventQueue *eventQueue();\n\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); -} - -void Generator::generateClientClassRequests(const Interface &interface) -{ - const auto requests = interface.requests(); - const QString templateString = QStringLiteral(" void %1(%2);\n\n"); - const QString factoryTemplateString = QStringLiteral(" %1 *%2(%3);\n\n"); - for (const auto &r: requests) { - if (r.isDestructor()) { - continue; - } - QString arguments; - bool first = true; - QString factored; - for (const auto &a: r.arguments()) { - if (a.type() == Argument::Type::NewId) { - factored = a.interface(); - continue; - } - if (!first) { - arguments.append(QStringLiteral(", ")); - } else { - first = false; - } - if (a.type() == Argument::Type::Object) { - arguments.append(QStringLiteral("%1 *%2").arg(a.typeAsQt()).arg(toCamelCase(a.name()))); - } else { - arguments.append(QStringLiteral("%1 %2").arg(a.typeAsQt()).arg(toCamelCase(a.name()))); - } - } - if (factored.isEmpty()) { - *m_stream.localData() << templateString.arg(toCamelCase((r.name()))).arg(arguments); - } else { - if (!first) { - arguments.append(QStringLiteral(", ")); - } - arguments.append(QStringLiteral("QObject *parent = nullptr")); - *m_stream.localData() << factoryTemplateString.arg(toQtInterfaceName(factored)).arg(toCamelCase(r.name())).arg(arguments); - } - } -} - -void Generator::generateClientCppRequests(const Interface &interface) -{ - const auto requests = interface.requests(); - const QString templateString = QStringLiteral( -"void %1::%2(%3)\n" -"{\n" -" Q_ASSERT(isValid());\n" -" %4_%5(d->%6%7);\n" -"}\n\n"); - const QString factoryTemplateString = QStringLiteral( -"%2 *%1::%3(%4)\n" -"{\n" -" Q_ASSERT(isValid());\n" -" auto p = new %2(parent);\n" -" auto w = %5_%6(d->%7%8);\n" -" if (d->queue) {\n" -" d->queue->addProxy(w);\n" -" }\n" -" p->setup(w);\n" -" return p;\n" -"}\n\n" - ); - for (const auto &r: requests) { - if (r.isDestructor()) { - continue; - } - QString arguments; - QString requestArguments; - bool first = true; - QString factored; - for (const auto &a: r.arguments()) { - if (a.type() == Argument::Type::NewId) { - factored = a.interface(); - continue; - } - if (!first) { - arguments.append(QStringLiteral(", ")); - } else { - first = false; - } - if (a.type() == Argument::Type::Object) { - arguments.append(QStringLiteral("%1 *%2").arg(a.typeAsQt()).arg(toCamelCase(a.name()))); - requestArguments.append(QStringLiteral(", *%1").arg(toCamelCase(a.name()))); - } else { - arguments.append(QStringLiteral("%1 %2").arg(a.typeAsQt()).arg(toCamelCase(a.name()))); - QString arg = toCamelCase(a.name()); - if (a.type() == Argument::Type::Fixed) { - arg = QStringLiteral("wl_fixed_from_double(%1)").arg(arg); - } - requestArguments.append(QStringLiteral(", %1").arg(arg)); - } - } - if (factored.isEmpty()) { - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()) - .arg(toCamelCase(r.name())) - .arg(arguments) - .arg(interface.name()) - .arg(r.name()) - .arg(interface.kwaylandClientName().toLower()) - .arg(requestArguments); - } else { - if (!first) { - arguments.append(QStringLiteral(", ")); - } - arguments.append(QStringLiteral("QObject *parent")); - *m_stream.localData() << factoryTemplateString.arg(interface.kwaylandClientName()) - .arg(toQtInterfaceName(factored)) - .arg(toCamelCase(r.name())) - .arg(arguments) - .arg(interface.name()) - .arg(r.name()) - .arg(interface.kwaylandClientName().toLower()) - .arg(requestArguments); - } - } -} - -void Generator::generateClientClassCasts(const Interface &interface) -{ - const QString templateString = QStringLiteral( -" operator %1*();\n" -" operator %1*() const;\n\n"); - *m_stream.localData() << templateString.arg(interface.name()); -} - -void Generator::generateClientGlobalClassEnd(const Interface &interface) -{ - Q_UNUSED(interface) - *m_stream.localData() << QStringLiteral("private:\n"); - generateClientClassDptr(interface); - *m_stream.localData() << QStringLiteral("};\n\n"); -} - -void Generator::generateClientClassDptr(const Interface &interface) -{ - Q_UNUSED(interface) - *m_stream.localData() << QStringLiteral( -" class Private;\n" -" QScopedPointer d;\n"); -} - -void Generator::generateClientResourceClassEnd(const Interface &interface) -{ - *m_stream.localData() << QStringLiteral( -"private:\n" -" friend class %2;\n" -" explicit %1(QObject *parent = nullptr);\n" - ).arg(interface.kwaylandClientName()).arg(interface.factory()->kwaylandClientName()); - generateClientClassDptr(interface); - *m_stream.localData() << QStringLiteral("};\n\n"); -} - -void Generator::generateWaylandForwardDeclarations() -{ - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - *m_stream.localData() << QStringLiteral("struct %1;\n").arg((*it).name()); - } - *m_stream.localData() << "\n"; -} - -void Generator::generateNamespaceForwardDeclarations() -{ - QSet referencedObjects; - for (auto it = m_interfaces.constBegin(); it != m_interfaces.constEnd(); ++it) { - const auto events = (*it).events(); - const auto requests = (*it).requests(); - for (const auto &e: events) { - const auto args = e.arguments(); - for (const auto &a: args) { - if (a.type() != Argument::Type::Object && a.type() != Argument::Type::NewId) { - continue; - } - referencedObjects << a.interface(); - } - } - for (const auto &r: requests) { - const auto args = r.arguments(); - for (const auto &a: args) { - if (a.type() != Argument::Type::Object && a.type() != Argument::Type::NewId) { - continue; - } - referencedObjects << a.interface(); - } - } - } - - switch (m_project.localData()) { - case Project::Client: - *m_stream.localData() << QStringLiteral("class EventQueue;\n"); - for (const auto &o : referencedObjects) { - auto it = s_clientClassNameMapping.constFind(o); - if (it != s_clientClassNameMapping.constEnd()) { - *m_stream.localData() << QStringLiteral("class %1;\n").arg(it.value()); - } else { - qWarning() << "Cannot forward declare KWayland class for interface " << o; - } - } - *m_stream.localData() << QStringLiteral("\n"); - break; - case Project::Server: - *m_stream.localData() << QStringLiteral("class Display;\n\n"); - break; - default: - Q_UNREACHABLE(); - } -} - -void Generator::generateClientClassSignals(const Interface &interface) -{ - const QString templateString = QStringLiteral( -"Q_SIGNALS:\n" -" /**\n" -" * The corresponding global for this interface on the Registry got removed.\n" -" *\n" -" * This signal gets only emitted if the %1 got created by\n" -" * Registry::create%1\n" -" **/\n" -" void removed();\n\n"); - *m_stream.localData() << templateString.arg(interface.kwaylandClientName()); -} - -QString Generator::projectToName() const -{ - switch (m_project.localData()) { - case Project::Client: - return QStringLiteral("Client"); - case Project::Server: - return QStringLiteral("Server"); - default: - Q_UNREACHABLE(); - } -} - -static void parseMapping() -{ - QFile mappingFile(QStringLiteral(MAPPING_FILE)); - mappingFile.open(QIODevice::ReadOnly); - QTextStream stream(&mappingFile); - while (!stream.atEnd()) { - QString line = stream.readLine(); - if (line.startsWith(QLatin1String("#")) || line.isEmpty()) { - continue; - } - const QStringList parts = line.split(QStringLiteral(";")); - if (parts.count() < 2) { - continue; - } - s_clientClassNameMapping.insert(parts.first(), parts.at(1)); - } -} - -} -} - -int main(int argc, char **argv) -{ - using namespace KWayland::Tools; - - parseMapping(); - - QCoreApplication app(argc, argv); - - QCommandLineParser parser; - QCommandLineOption xmlFile(QStringList{QStringLiteral("x"), QStringLiteral("xml")}, - QStringLiteral("The wayland protocol to parse."), - QStringLiteral("FileName")); - QCommandLineOption fileName(QStringList{QStringLiteral("f"), QStringLiteral("file")}, - QStringLiteral("The base name of files to be generated. E.g. for \"foo\" the files \"foo.h\" and \"foo.cpp\" are generated." - "If not provided the base name gets derived from the xml protocol name"), - QStringLiteral("FileName")); - - parser.addHelpOption(); - parser.addOption(xmlFile); - parser.addOption(fileName); - - parser.process(app); - - Generator generator(&app); - generator.setXmlFileName(parser.value(xmlFile)); - generator.setBaseFileName(parser.value(fileName)); - generator.start(); - - return app.exec(); -} diff -Nru dwayland-5.57.0.23/src/tools/generator.h dwayland-5.57.0.24+really5.24.3/src/tools/generator.h --- dwayland-5.57.0.23/src/tools/generator.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/generator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,298 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef KWAYLAND_TOOLS_GENERATOR_H -#define KWAYLAND_TOOLS_GENERATOR_H - -#include -#include -#include -#include -#include -#include - -class QTextStream; - -namespace KWayland -{ -namespace Tools -{ - -class Argument -{ -public: - explicit Argument(); - explicit Argument(const QXmlStreamAttributes &attributes); - ~Argument(); - - enum class Type { - Unknown, - NewId, - Destructor, - Object, - FileDescriptor, - Fixed, - Uint, - Int, - String - }; - - QString name() const { - return m_name; - } - Type type() const { - return m_type; - } - bool isNullAllowed() const { - return m_allowNull; - } - QString interface() const { - return m_inteface; - } - QString typeAsQt() const; - QString typeAsServerWl() const; - -private: - Type parseType(const QStringRef &type); - QString m_name; - Type m_type = Type::Unknown; - bool m_allowNull = false; - QString m_inteface; -}; - -class Request -{ -public: - explicit Request(); - explicit Request(const QString &name); - ~Request(); - - void addArgument(const Argument &arg) { - m_arguments << arg; - } - - QString name() const { - return m_name; - } - - QVector arguments() const { - return m_arguments; - } - - bool isDestructor() const { - return m_destructor; - } - bool isFactory() const; - - void markAsDestructor() { - m_destructor = true; - } - -private: - QString m_name; - QVector m_arguments; - bool m_destructor = false; -}; - -class Event -{ -public: - explicit Event(); - explicit Event(const QString &name); - ~Event(); - - void addArgument(const Argument &arg) { - m_arguments << arg; - } - - QString name() const { - return m_name; - } - - QVector arguments() const { - return m_arguments; - } - -private: - QString m_name; - QVector m_arguments; -}; - -class Interface -{ -public: - explicit Interface(); - explicit Interface(const QXmlStreamAttributes &attributes); - virtual ~Interface(); - - void addRequest(const Request &request) { - m_requests << request; - } - void addEvent(const Event &event) { - m_events << event; - } - - QString name() const { - return m_name; - } - quint32 version() const { - return m_version; - } - QString kwaylandClientName() const { - return m_clientName; - } - QString kwaylandServerName() const { - return m_clientName + QStringLiteral("Interface"); - } - - QVector requests() const { - return m_requests; - } - - QVector events() const { - return m_events; - } - - void markAsGlobal() { - m_global = true; - } - bool isGlobal() const { - return m_global; - } - void setFactory(Interface *factory) { - m_factory = factory; - } - Interface *factory() const { - return m_factory; - } - - bool isUnstableInterface() const { - return m_name.startsWith(QLatin1String("zwp")); - } - -private: - QString m_name; - QString m_clientName; - quint32 m_version; - QVector m_requests; - QVector m_events; - bool m_global = false; - Interface *m_factory; -}; - - -class Generator : public QObject -{ - Q_OBJECT -public: - explicit Generator(QObject *parent = nullptr); - virtual ~Generator(); - - void setXmlFileName(const QString &name) { - m_xmlFileName = name; - } - void setBaseFileName(const QString &name) { - m_baseFileName = name; - } - void start(); - -private: - void generateCopyrightHeader(); - void generateStartIncludeGuard(); - void generateEndIncludeGuard(); - void generateStartNamespace(); - void generateEndNamespace(); - void generateHeaderIncludes(); - void generateCppIncludes(); - void generatePrivateClass(const Interface &interface); - void generateClientPrivateClass(const Interface &interface); - void generateClientPrivateResourceClass(const Interface &interface); - void generateClientPrivateGlobalClass(const Interface &interface); - void generateServerPrivateGlobalClass(const Interface &interface); - void generateServerPrivateResourceClass(const Interface &interface); - void generateServerPrivateInterfaceClass(const Interface &interface); - void generateServerPrivateGlobalCtorBindClass(const Interface &interface); - void generateServerPrivateResourceCtorDtorClass(const Interface &interface); - void generateServerPrivateCallbackDefinitions(const Interface &interface); - void generateServerPrivateCallbackImpl(const Interface &interface); - void generateClientCpp(const Interface &interface); - void generateClass(const Interface &interface); - void generateClientGlobalClass(const Interface &interface); - void generateClientResourceClass(const Interface &interface); - void generateServerGlobalClass(const Interface &interface); - void generateServerGlobalClassUnstable(const Interface &interface); - void generateServerResourceClass(const Interface &interface); - void generateServerResourceClassUnstable(const Interface &interface); - void generateClientClassQObjectDerived(const Interface &interface); - void generateClientGlobalClassDoxy(const Interface &interface); - void generateClientGlobalClassCtor(const Interface &interface); - void generateClientGlobalClassSetup(const Interface &interface); - void generateClientResourceClassSetup(const Interface &interface); - void generateClientClassDtor(const Interface &interface); - void generateClientClassReleaseDestroy(const Interface &interface); - void generateClientClassStart(const Interface &interface); - void generateClientClassCasts(const Interface &interface); - void generateClientClassSignals(const Interface &interface); - void generateClientClassDptr(const Interface &interface); - void generateClientGlobalClassEnd(const Interface &interface); - void generateClientResourceClassEnd(const Interface &interface); - void generateClientClassRequests(const Interface &interface); - void generateClientCppRequests(const Interface &interface); - void generateWaylandForwardDeclarations(); - void generateNamespaceForwardDeclarations(); - void startParseXml(); - void startAuthorNameProcess(); - void startAuthorEmailProcess(); - void startGenerateHeaderFile(); - void startGenerateCppFile(); - void startGenerateServerHeaderFile(); - void startGenerateServerCppFile(); - - void checkEnd(); - - void parseProtocol(); - Interface parseInterface(); - Request parseRequest(); - Event parseEvent(); - - QString projectToName() const; - - QThreadStorage m_stream; - QString m_xmlFileName; - enum class Project { - Client, - Server - }; - QThreadStorage m_project; - QString m_authorName; - QString m_authorEmail; - QString m_baseFileName; - - QMutex m_mutex; - QWaitCondition m_waitCondition; - QXmlStreamReader m_xmlReader; - QVector m_interfaces; - - int m_finishedCounter = 0; -}; - -} -} - -#endif diff -Nru dwayland-5.57.0.23/src/tools/mapping.txt dwayland-5.57.0.24+really5.24.3/src/tools/mapping.txt --- dwayland-5.57.0.23/src/tools/mapping.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/mapping.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -#wl_name;KWayland::ClientName -wl_buffer;Buffer -wl_compositor;Compositor -wl_data_device;DataDevice -wl_data_device_manager;DataDeviceManager -wl_data_offer;DataOffer -wl_data_source;DataSource -wl_event_queue;EventQueue -wl_keyboard;Keyboard -wl_output;Output -wl_pointer;Pointer -wl_region;Region -wl_registry;Registry -wl_seat;Seat -wl_shell;Shell -wl_shell_surface;ShellSurface -wl_shm;ShmPool -wl_subcompositor;SubCompositor -wl_subsurface;SubSurface -wl_surface;Surface -wl_touch;Touch -_wl_fullscreen_shell;FullscreenShell -org_kde_kwin_blur;Blur -org_kde_kwin_blur_manager;BlurManager -org_kde_kwin_contrast;Contrast -org_kde_kwin_contrast_manager;ContrastManager -org_kde_kwin_slide;Slide -org_kde_kwin_slide_manager;SlideManager -org_kde_kwin_fake_input;FakeInput -org_kde_kwin_idle;Idle -org_kde_kwin_idle_timeout;IdleTimeout -org_kde_kwin_outputmanagement;OutputManagement -org_kde_kwin_outputconfiguration;OutputConfiguration -org_kde_kwin_outputdevice;OutputDevice -org_kde_kwin_shadow;Shadow -org_kde_kwin_shadow_manager;ShadowManager -org_kde_plasma_shell;PlasmaShell -org_kde_plasma_surface;PlasmaShellSurface -org_kde_plasma_virtual_desktop_management;PlasmaVirtualDesktopManagement -org_kde_plasma_virtual_desktop;PlasmaVirtualDesktop -org_kde_plasma_window_management;PlasmaWindowManagement -org_kde_plasma_window;PlasmaWindow -org_kde_kwin_server_decoration_manager;ServerSideDecorationManager -org_kde_kwin_server_decoration;ServerSideDecoration -wl_text_input;TextInputUnstableV0 -wl_text_input_manager;TextInputManagerUnstableV0 -zwp_text_input_v2;TextInputUnstableV2 -zwp_text_input_manager_v2;TextInputManagerUnstableV2 -xdg_shell;XdgShellV5 -xdg_surface;XdgSurfaceV5 -xdg_popup;XdgPopupV5 -xdg_toplevel;XdgShell -zxdg_shell_v6;XdgShellV6 -zxdg_surface_v6;XdgSurfaceV6 -zxdg_popup_v6;XdgPopupV6 -zwp_relative_pointer_manager_v1;RelativePointerManagerUnstableV1 -zwp_relative_pointer_v1;RelativePointerUnstableV1 -zwp_pointer_gestures_v1;PointerGesturesUnstableV1 -zwp_pointer_gesture_swipe_v1;PointerSwipeGestureUnstableV1 -zwp_pointer_gesture_pinch_v1;PointerPinchGestureUnstableV1 -zwp_pointer_constraints_v1;PointerConstraints -zwp_locked_pointer_v1;LockedPointer -zwp_confined_pointer_v1;ConfinedPointer -zwp_idle_inhibit_manager_v1;IdleInhibitManager -zwp_idle_inhibitor_v1;IdleInhibitor -org_kde_kwin_remote_access_manager;RemoteAccessManager -org_kde_kwin_remote_buffer;RemoteBuffer -zxdg_output_v1;XdgOutput -zxdg_output_manager_v1;XdgOutputManager -zxdg_decoration_manager_v1;XdgDecorationManager -zxdg_toplevel_decoration_v1;XdgDecoration -com_deepin_client_management;ClientManagement -dde_seat;DDESeat -dde_shell;DDEShell -com_deepin_kwin_strut;Strut -zwp_primary_selection_device_manager_v1;PrimarySelectionDeviceManagerV1 diff -Nru dwayland-5.57.0.23/src/tools/qtwaylandscanner.cpp dwayland-5.57.0.24+really5.24.3/src/tools/qtwaylandscanner.cpp --- dwayland-5.57.0.23/src/tools/qtwaylandscanner.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/qtwaylandscanner.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,1405 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include + +class Scanner +{ +public: + explicit Scanner() {} + ~Scanner() { delete m_xml; } + + bool parseArguments(int argc, char **argv); + void printUsage(); + bool process(); + void printErrors(); + +private: + struct WaylandEnumEntry { + QByteArray name; + QByteArray value; + QByteArray summary; + }; + + struct WaylandEnum { + QByteArray name; + + std::vector entries; + }; + + struct WaylandArgument { + QByteArray name; + QByteArray type; + QByteArray interface; + QByteArray summary; + bool allowNull; + }; + + struct WaylandEvent { + bool request; + QByteArray name; + QByteArray type; + std::vector arguments; + }; + + struct WaylandInterface { + QByteArray name; + int version; + + std::vector enums; + std::vector events; + std::vector requests; + }; + + bool isServerSide(); + bool parseOption(const QByteArray &str); + + QByteArray byteArrayValue(const QXmlStreamReader &xml, const char *name); + int intValue(const QXmlStreamReader &xml, const char *name, int defaultValue = 0); + bool boolValue(const QXmlStreamReader &xml, const char *name); + WaylandEvent readEvent(QXmlStreamReader &xml, bool request); + Scanner::WaylandEnum readEnum(QXmlStreamReader &xml); + Scanner::WaylandInterface readInterface(QXmlStreamReader &xml); + QByteArray waylandToCType(const QByteArray &waylandType, const QByteArray &interface); + QByteArray waylandToQtType(const QByteArray &waylandType, const QByteArray &interface, bool cStyleArray); + const Scanner::WaylandArgument *newIdArgument(const std::vector &arguments); + + void printEvent(const WaylandEvent &e, bool omitNames = false, bool withResource = false); + void printEventHandlerSignature(const WaylandEvent &e, const char *interfaceName, bool deepIndent = true); + void printEnums(const std::vector &enums); + + QByteArray stripInterfaceName(const QByteArray &name); + bool ignoreInterface(const QByteArray &name); + + enum Option { + ClientHeader, + ServerHeader, + ClientCode, + ServerCode, + } m_option; + + QByteArray m_protocolName; + QByteArray m_protocolFilePath; + QByteArray m_scannerName; + QByteArray m_headerPath; + QByteArray m_prefix; + QVector m_includes; + QXmlStreamReader *m_xml = nullptr; +}; + +bool Scanner::parseArguments(int argc, char **argv) +{ + QVector args; + args.reserve(argc); + for (int i = 0; i < argc; ++i) + args << QByteArray(argv[i]); + + m_scannerName = args[0]; + + if (argc <= 2 || !parseOption(args[1])) + return false; + + m_protocolFilePath = args[2]; + + if (argc > 3 && !args[3].startsWith('-')) { + // legacy positional arguments + m_headerPath = args[3]; + if (argc == 5) + m_prefix = args[4]; + } else { + // --header-path= (14 characters) + // --prefix= (9 characters) + // --add-include= (14 characters) + for (int pos = 3; pos < argc; pos++) { + const QByteArray &option = args[pos]; + if (option.startsWith("--header-path=")) { + m_headerPath = option.mid(14); + } else if (option.startsWith("--prefix=")) { + m_prefix = option.mid(10); + } else if (option.startsWith("--add-include=")) { + auto include = option.mid(14); + if (!include.isEmpty()) + m_includes << include; + } else { + return false; + } + } + } + + return true; +} + +void Scanner::printUsage() +{ + fprintf(stderr, "Usage: %s [client-header|server-header|client-code|server-code] specfile [--header-path=] [--prefix=] [--add-include=]\n", m_scannerName.constData()); +} + +bool Scanner::isServerSide() +{ + return m_option == ServerHeader || m_option == ServerCode; +} + +bool Scanner::parseOption(const QByteArray &str) +{ + if (str == "client-header") + m_option = ClientHeader; + else if (str == "server-header") + m_option = ServerHeader; + else if (str == "client-code") + m_option = ClientCode; + else if (str == "server-code") + m_option = ServerCode; + else + return false; + + return true; +} + +QByteArray Scanner::byteArrayValue(const QXmlStreamReader &xml, const char *name) +{ + if (xml.attributes().hasAttribute(name)) + return xml.attributes().value(name).toUtf8(); + return QByteArray(); +} + +int Scanner::intValue(const QXmlStreamReader &xml, const char *name, int defaultValue) +{ + bool ok; + int result = byteArrayValue(xml, name).toInt(&ok); + return ok ? result : defaultValue; +} + +bool Scanner::boolValue(const QXmlStreamReader &xml, const char *name) +{ + return byteArrayValue(xml, name) == "true"; +} + +Scanner::WaylandEvent Scanner::readEvent(QXmlStreamReader &xml, bool request) +{ + WaylandEvent event = { + .request = request, + .name = byteArrayValue(xml, "name"), + .type = byteArrayValue(xml, "type"), + .arguments = {}, + }; + while (xml.readNextStartElement()) { + if (xml.name() == "arg") { + WaylandArgument argument = { + .name = byteArrayValue(xml, "name"), + .type = byteArrayValue(xml, "type"), + .interface = byteArrayValue(xml, "interface"), + .summary = byteArrayValue(xml, "summary"), + .allowNull = boolValue(xml, "allowNull"), + }; + event.arguments.push_back(std::move(argument)); + } + + xml.skipCurrentElement(); + } + return event; +} + +Scanner::WaylandEnum Scanner::readEnum(QXmlStreamReader &xml) +{ + WaylandEnum result = { + .name = byteArrayValue(xml, "name"), + .entries = {}, + }; + + while (xml.readNextStartElement()) { + if (xml.name() == "entry") { + WaylandEnumEntry entry = { + .name = byteArrayValue(xml, "name"), + .value = byteArrayValue(xml, "value"), + .summary = byteArrayValue(xml, "summary"), + }; + result.entries.push_back(std::move(entry)); + } + + xml.skipCurrentElement(); + } + + return result; +} + +Scanner::WaylandInterface Scanner::readInterface(QXmlStreamReader &xml) +{ + WaylandInterface interface = { + .name = byteArrayValue(xml, "name"), + .version = intValue(xml, "version", 1), + .enums = {}, + .events = {}, + .requests = {}, + }; + + while (xml.readNextStartElement()) { + if (xml.name() == "event") + interface.events.push_back(readEvent(xml, false)); + else if (xml.name() == "request") + interface.requests.push_back(readEvent(xml, true)); + else if (xml.name() == "enum") + interface.enums.push_back(readEnum(xml)); + else + xml.skipCurrentElement(); + } + + return interface; +} + +QByteArray Scanner::waylandToCType(const QByteArray &waylandType, const QByteArray &interface) +{ + if (waylandType == "string") + return "const char *"; + else if (waylandType == "int") + return "int32_t"; + else if (waylandType == "uint") + return "uint32_t"; + else if (waylandType == "fixed") + return "wl_fixed_t"; + else if (waylandType == "fd") + return "int32_t"; + else if (waylandType == "array") + return "wl_array *"; + else if (waylandType == "object" || waylandType == "new_id") { + if (isServerSide()) + return "struct ::wl_resource *"; + if (interface.isEmpty()) + return "struct ::wl_object *"; + return "struct ::" + interface + " *"; + } + return waylandType; +} + +QByteArray Scanner::waylandToQtType(const QByteArray &waylandType, const QByteArray &interface, bool cStyleArray) +{ + if (waylandType == "string") + return "const QString &"; + else if (waylandType == "array") + return cStyleArray ? "wl_array *" : "const QByteArray &"; + else + return waylandToCType(waylandType, interface); +} + +const Scanner::WaylandArgument *Scanner::newIdArgument(const std::vector &arguments) +{ + for (const WaylandArgument &a : arguments) { + if (a.type == "new_id") + return &a; + } + return nullptr; +} + +void Scanner::printEvent(const WaylandEvent &e, bool omitNames, bool withResource) +{ + printf("%s(", e.name.constData()); + bool needsComma = false; + if (isServerSide()) { + if (e.request) { + printf("Resource *%s", omitNames ? "" : "resource"); + needsComma = true; + } else if (withResource) { + printf("struct ::wl_resource *%s", omitNames ? "" : "resource"); + needsComma = true; + } + } + for (const WaylandArgument &a : e.arguments) { + bool isNewId = a.type == "new_id"; + if (isNewId && !isServerSide() && (a.interface.isEmpty() != e.request)) + continue; + if (needsComma) + printf(", "); + needsComma = true; + if (isNewId) { + if (isServerSide()) { + if (e.request) { + printf("uint32_t"); + if (!omitNames) + printf(" %s", a.name.constData()); + continue; + } + } else { + if (e.request) { + printf("const struct ::wl_interface *%s, uint32_t%s", omitNames ? "" : "interface", omitNames ? "" : " version"); + continue; + } + } + } + + QByteArray qtType = waylandToQtType(a.type, a.interface, e.request == isServerSide()); + printf("%s%s%s", qtType.constData(), qtType.endsWith("&") || qtType.endsWith("*") ? "" : " ", omitNames ? "" : a.name.constData()); + } + printf(")"); +} + +void Scanner::printEventHandlerSignature(const WaylandEvent &e, const char *interfaceName, bool deepIndent) +{ + const char *indent = deepIndent ? " " : ""; + printf("handle_%s(\n", e.name.constData()); + if (isServerSide()) { + printf(" %s::wl_client *client,\n", indent); + printf(" %sstruct wl_resource *resource", indent); + } else { + printf(" %svoid *data,\n", indent); + printf(" %sstruct ::%s *object", indent, interfaceName); + } + for (const WaylandArgument &a : e.arguments) { + printf(",\n"); + bool isNewId = a.type == "new_id"; + if (isServerSide() && isNewId) { + printf(" %suint32_t %s", indent, a.name.constData()); + } else { + QByteArray cType = waylandToCType(a.type, a.interface); + printf(" %s%s%s%s", indent, cType.constData(), cType.endsWith("*") ? "" : " ", a.name.constData()); + } + } + printf(")"); +} + +void Scanner::printEnums(const std::vector &enums) +{ + for (const WaylandEnum &e : enums) { + printf("\n"); + printf(" enum %s {\n", e.name.constData()); + for (const WaylandEnumEntry &entry : e.entries) { + printf(" %s_%s = %s,", e.name.constData(), entry.name.constData(), entry.value.constData()); + if (!entry.summary.isNull()) + printf(" // %s", entry.summary.constData()); + printf("\n"); + } + printf(" };\n"); + } +} + +QByteArray Scanner::stripInterfaceName(const QByteArray &name) +{ + if (!m_prefix.isEmpty() && name.startsWith(m_prefix)) + return name.mid(m_prefix.size()); + if (name.startsWith("qt_") || name.startsWith("wl_")) + return name.mid(3); + + return name; +} + +bool Scanner::ignoreInterface(const QByteArray &name) +{ + return name == "wl_display" + || (isServerSide() && name == "wl_registry"); +} + +bool Scanner::process() +{ + QFile file(m_protocolFilePath); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + fprintf(stderr, "Unable to open file %s\n", m_protocolFilePath.constData()); + return false; + } + + m_xml = new QXmlStreamReader(&file); + if (!m_xml->readNextStartElement()) + return false; + + if (m_xml->name() != "protocol") { + m_xml->raiseError(QStringLiteral("The file is not a wayland protocol file.")); + return false; + } + + m_protocolName = byteArrayValue(*m_xml, "name"); + + if (m_protocolName.isEmpty()) { + m_xml->raiseError(QStringLiteral("Missing protocol name.")); + return false; + } + + //We should convert - to _ so that the preprocessor wont generate code which will lead to unexpected behavior + //However, the wayland-scanner doesn't do so we will do the same for now + //QByteArray preProcessorProtocolName = QByteArray(m_protocolName).replace('-', '_').toUpper(); + QByteArray preProcessorProtocolName = QByteArray(m_protocolName).toUpper(); + + std::vector interfaces; + + while (m_xml->readNextStartElement()) { + if (m_xml->name() == "interface") + interfaces.push_back(readInterface(*m_xml)); + else + m_xml->skipCurrentElement(); + } + + if (m_xml->hasError()) + return false; + + printf("// This file was generated by qtwaylandscanner\n"); + printf("// source file is %s\n\n", qPrintable(m_protocolFilePath)); + + for (auto b : qAsConst(m_includes)) + printf("#include %s\n", b.constData()); + + if (m_option == ServerHeader) { + QByteArray inclusionGuard = QByteArray("QT_WAYLAND_SERVER_") + preProcessorProtocolName.constData(); + printf("#ifndef %s\n", inclusionGuard.constData()); + printf("#define %s\n", inclusionGuard.constData()); + printf("\n"); + printf("#include \"wayland-server-core.h\"\n"); + if (m_headerPath.isEmpty()) + printf("#include \"wayland-%s-server-protocol.h\"\n", QByteArray(m_protocolName).replace('_', '-').constData()); + else + printf("#include <%s/wayland-%s-server-protocol.h>\n", m_headerPath.constData(), QByteArray(m_protocolName).replace('_', '-').constData()); + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + + printf("\n"); + printf("#include \n"); + + printf("\n"); + printf("#ifndef WAYLAND_VERSION_CHECK\n"); + printf("#define WAYLAND_VERSION_CHECK(major, minor, micro) \\\n"); + printf(" ((WAYLAND_VERSION_MAJOR > (major)) || \\\n"); + printf(" (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR > (minor)) || \\\n"); + printf(" (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR == (minor) && WAYLAND_VERSION_MICRO >= (micro)))\n"); + printf("#endif\n"); + + printf("\n"); + printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); + printf("QT_WARNING_DISABLE_CLANG(\"-Wmissing-field-initializers\")\n"); + QByteArray serverExport; + if (m_headerPath.size()) { + serverExport = QByteArray("Q_WAYLAND_SERVER_") + preProcessorProtocolName + "_EXPORT"; + printf("\n"); + printf("#if !defined(%s)\n", serverExport.constData()); + printf("# if defined(QT_SHARED)\n"); + printf("# define %s Q_DECL_EXPORT\n", serverExport.constData()); + printf("# else\n"); + printf("# define %s\n", serverExport.constData()); + printf("# endif\n"); + printf("#endif\n"); + } + printf("\n"); + printf("namespace QtWaylandServer {\n"); + + bool needsNewLine = false; + for (const WaylandInterface &interface : interfaces) { + + if (ignoreInterface(interface.name)) + continue; + + if (needsNewLine) + printf("\n"); + needsNewLine = true; + + const char *interfaceName = interface.name.constData(); + + QByteArray stripped = stripInterfaceName(interface.name); + const char *interfaceNameStripped = stripped.constData(); + + printf(" class %s %s\n {\n", serverExport.constData(), interfaceName); + printf(" public:\n"); + printf(" %s(struct ::wl_client *client, int id, int version);\n", interfaceName); + printf(" %s(struct ::wl_display *display, int version);\n", interfaceName); + printf(" %s(struct ::wl_resource *resource);\n", interfaceName); + printf(" %s();\n", interfaceName); + printf("\n"); + printf(" virtual ~%s();\n", interfaceName); + printf("\n"); + printf(" class Resource\n"); + printf(" {\n"); + printf(" public:\n"); + printf(" Resource() : %s_object(nullptr), handle(nullptr) {}\n", interfaceNameStripped); + printf(" virtual ~Resource() {}\n"); + printf("\n"); + printf(" %s *%s_object;\n", interfaceName, interfaceNameStripped); + printf(" %s *object() { return %s_object; } \n", interfaceName, interfaceNameStripped); + printf(" struct ::wl_resource *handle;\n"); + printf("\n"); + printf(" struct ::wl_client *client() const { return wl_resource_get_client(handle); }\n"); + printf(" int version() const { return wl_resource_get_version(handle); }\n"); + printf("\n"); + printf(" static Resource *fromResource(struct ::wl_resource *resource);\n"); + printf(" };\n"); + printf("\n"); + printf(" void init(struct ::wl_client *client, int id, int version);\n"); + printf(" void init(struct ::wl_display *display, int version);\n"); + printf(" void init(struct ::wl_resource *resource);\n"); + printf("\n"); + printf(" Resource *add(struct ::wl_client *client, int version);\n"); + printf(" Resource *add(struct ::wl_client *client, int id, int version);\n"); + printf(" Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);\n"); + printf("\n"); + printf(" Resource *resource() { return m_resource; }\n"); + printf(" const Resource *resource() const { return m_resource; }\n"); + printf("\n"); + printf(" QMultiMap resourceMap() { return m_resource_map; }\n"); + printf(" const QMultiMap resourceMap() const { return m_resource_map; }\n"); + printf("\n"); + printf(" bool isGlobalRemoved() const { return m_globalRemovedEvent; }\n"); + printf(" void globalRemove();\n"); + printf("\n"); + printf(" bool isGlobal() const { return m_global != nullptr; }\n"); + printf(" bool isResource() const { return m_resource != nullptr; }\n"); + printf("\n"); + printf(" static const struct ::wl_interface *interface();\n"); + printf(" static QByteArray interfaceName() { return interface()->name; }\n"); + printf(" static int interfaceVersion() { return interface()->version; }\n"); + printf("\n"); + + printEnums(interface.enums); + + bool hasEvents = !interface.events.empty(); + + if (hasEvents) { + printf("\n"); + for (const WaylandEvent &e : interface.events) { + printf(" void send_"); + printEvent(e); + printf(";\n"); + printf(" void send_"); + printEvent(e, false, true); + printf(";\n"); + } + } + + printf("\n"); + printf(" protected:\n"); + printf(" virtual Resource *%s_allocate();\n", interfaceNameStripped); + printf("\n"); + printf(" virtual void %s_destroy_global();\n", interfaceNameStripped); + printf("\n"); + printf(" virtual void %s_bind_resource(Resource *resource);\n", interfaceNameStripped); + printf(" virtual void %s_destroy_resource(Resource *resource);\n", interfaceNameStripped); + + bool hasRequests = !interface.requests.empty(); + + if (hasRequests) { + printf("\n"); + for (const WaylandEvent &e : interface.requests) { + printf(" virtual void %s_", interfaceNameStripped); + printEvent(e); + printf(";\n"); + } + } + + printf("\n"); + printf(" private:\n"); + printf(" static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);\n"); + printf(" static void destroy_func(struct ::wl_resource *client_resource);\n"); + printf(" static void display_destroy_func(struct ::wl_listener *listener, void *data);\n"); + printf(" static int deferred_destroy_global_func(void *data);\n"); + printf("\n"); + printf(" Resource *bind(struct ::wl_client *client, uint32_t id, int version);\n"); + printf(" Resource *bind(struct ::wl_resource *handle);\n"); + + if (hasRequests) { + printf("\n"); + printf(" static const struct ::%s_interface m_%s_interface;\n", interfaceName, interfaceName); + + printf("\n"); + for (const WaylandEvent &e : interface.requests) { + printf(" static void "); + + printEventHandlerSignature(e, interfaceName); + printf(";\n"); + } + } + + printf("\n"); + printf(" QMultiMap m_resource_map;\n"); + printf(" Resource *m_resource;\n"); + printf(" struct ::wl_global *m_global;\n"); + printf(" struct ::wl_display *m_display;\n"); + printf(" struct wl_event_source *m_globalRemovedEvent;\n"); + printf(" struct DisplayDestroyedListener : ::wl_listener {\n"); + printf(" %s *parent;\n", interfaceName); + printf(" };\n"); + printf(" DisplayDestroyedListener m_displayDestroyedListener;\n"); + printf(" };\n"); + } + + printf("}\n"); + printf("\n"); + printf("QT_WARNING_POP\n"); + printf("QT_END_NAMESPACE\n"); + printf("\n"); + printf("#endif\n"); + } + + if (m_option == ServerCode) { + if (m_headerPath.isEmpty()) + printf("#include \"qwayland-server-%s.h\"\n", QByteArray(m_protocolName).replace('_', '-').constData()); + else + printf("#include <%s/qwayland-server-%s.h>\n", m_headerPath.constData(), QByteArray(m_protocolName).replace('_', '-').constData()); + printf("\n"); + printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); + printf("\n"); + printf("namespace QtWaylandServer {\n"); + + bool needsNewLine = false; + + for (const WaylandInterface &interface : interfaces) { + + if (ignoreInterface(interface.name)) + continue; + + if (needsNewLine) + printf("\n"); + + needsNewLine = true; + + const char *interfaceName = interface.name.constData(); + + QByteArray stripped = stripInterfaceName(interface.name); + const char *interfaceNameStripped = stripped.constData(); + + printf("\n"); + printf(" int %s::deferred_destroy_global_func(void *data) {\n", interfaceName); + printf(" auto object = static_cast<%s *>(data);\n", interfaceName); + printf(" wl_global_destroy(object->m_global);\n"); + printf(" object->m_global = nullptr;\n"); + printf(" wl_event_source_remove(object->m_globalRemovedEvent);\n"); + printf(" object->m_globalRemovedEvent = nullptr;\n"); + printf(" wl_list_remove(&object->m_displayDestroyedListener.link);\n"); + printf(" object->%s_destroy_global();\n", interfaceNameStripped); + printf(" return 0;\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s(struct ::wl_client *client, int id, int version)\n", interfaceName, interfaceName); + printf(" : m_resource_map()\n"); + printf(" , m_resource(nullptr)\n"); + printf(" , m_global(nullptr)\n"); + printf(" , m_display(nullptr)\n"); + printf(" , m_globalRemovedEvent(nullptr)\n"); + printf(" {\n"); + printf(" init(client, id, version);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s(struct ::wl_display *display, int version)\n", interfaceName, interfaceName); + printf(" : m_resource_map()\n"); + printf(" , m_resource(nullptr)\n"); + printf(" , m_global(nullptr)\n"); + printf(" , m_display(nullptr)\n"); + printf(" , m_globalRemovedEvent(nullptr)\n"); + printf(" {\n"); + printf(" init(display, version);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s(struct ::wl_resource *resource)\n", interfaceName, interfaceName); + printf(" : m_resource_map()\n"); + printf(" , m_resource(nullptr)\n"); + printf(" , m_global(nullptr)\n"); + printf(" , m_display(nullptr)\n"); + printf(" , m_globalRemovedEvent(nullptr)\n"); + printf(" {\n"); + printf(" init(resource);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s()\n", interfaceName, interfaceName); + printf(" : m_resource_map()\n"); + printf(" , m_resource(nullptr)\n"); + printf(" , m_global(nullptr)\n"); + printf(" , m_display(nullptr)\n"); + printf(" , m_globalRemovedEvent(nullptr)\n"); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::~%s()\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" for (auto resource : qAsConst(m_resource_map))\n"); + printf(" resource->%s_object = nullptr;\n", interfaceNameStripped); + printf("\n"); + printf(" if (m_resource)\n"); + printf(" m_resource->%s_object = nullptr;\n", interfaceNameStripped); + printf("\n"); + printf(" if (m_global) {\n"); + printf(" if (m_globalRemovedEvent)\n"); + printf(" wl_event_source_remove(m_globalRemovedEvent);\n"); + printf(" wl_global_destroy(m_global);\n"); + printf(" wl_list_remove(&m_displayDestroyedListener.link);\n"); + printf(" }\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::init(struct ::wl_client *client, int id, int version)\n", interfaceName); + printf(" {\n"); + printf(" m_resource = bind(client, id, version);\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::init(struct ::wl_resource *resource)\n", interfaceName); + printf(" {\n"); + printf(" m_resource = bind(resource);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::Resource *%s::add(struct ::wl_client *client, int version)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" Resource *resource = bind(client, 0, version);\n"); + printf(" m_resource_map.insert(client, resource);\n"); + printf(" return resource;\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::Resource *%s::add(struct ::wl_client *client, int id, int version)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" Resource *resource = bind(client, id, version);\n"); + printf(" m_resource_map.insert(client, resource);\n"); + printf(" return resource;\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::init(struct ::wl_display *display, int version)\n", interfaceName); + printf(" {\n"); + printf(" m_display = display;\n"); + printf(" m_global = wl_global_create(display, &::%s_interface, version, this, bind_func);\n", interfaceName); + printf(" m_displayDestroyedListener.notify = %s::display_destroy_func;\n", interfaceName); + printf(" m_displayDestroyedListener.parent = this;\n"); + printf(" wl_display_add_destroy_listener(display, &m_displayDestroyedListener);\n"); + printf(" }\n"); + printf("\n"); + + printf(" const struct wl_interface *%s::interface()\n", interfaceName); + printf(" {\n"); + printf(" return &::%s_interface;\n", interfaceName); + printf(" }\n"); + printf("\n"); + + printf(" %s::Resource *%s::%s_allocate()\n", interfaceName, interfaceName, interfaceNameStripped); + printf(" {\n"); + printf(" return new Resource;\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::%s_destroy_global()\n", interfaceName, interfaceNameStripped); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::%s_bind_resource(Resource *)\n", interfaceName, interfaceNameStripped); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::%s_destroy_resource(Resource *)\n", interfaceName, interfaceNameStripped); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)\n", interfaceName); + printf(" {\n"); + printf(" %s *that = static_cast<%s *>(data);\n", interfaceName, interfaceName); + printf(" that->add(client, id, version);\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::display_destroy_func(struct ::wl_listener *listener, void *data)\n", interfaceName); + printf(" {\n"); + printf(" Q_UNUSED(data);\n"); + printf(" %s *that = static_cast<%s::DisplayDestroyedListener *>(listener)->parent;\n", interfaceName, interfaceName); + printf(" that->m_global = nullptr;\n"); + printf(" that->m_globalRemovedEvent = nullptr;\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::destroy_func(struct ::wl_resource *client_resource)\n", interfaceName); + printf(" {\n"); + printf(" Resource *resource = Resource::fromResource(client_resource);\n"); + printf(" Q_ASSERT(resource);\n"); + printf(" %s *that = resource->%s_object;\n", interfaceName, interfaceNameStripped); + printf(" if (Q_LIKELY(that)) {\n"); + printf(" that->m_resource_map.remove(resource->client(), resource);\n"); + printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped); + printf("\n"); + printf(" that = resource->%s_object;\n", interfaceNameStripped); + printf(" if (that && that->m_resource == resource)\n"); + printf(" that->m_resource = nullptr;\n"); + printf(" }\n"); + printf(" delete resource;\n"); + printf(" }\n"); + printf("\n"); + + // Removing a global is racey. Announce removal, and then only perform internal cleanup after a delay + // See https://gitlab.freedesktop.org/wayland/wayland/issues/10 + printf("\n"); + printf(" void %s::globalRemove()\n", interfaceName); + printf(" {\n"); + printf(" if (!m_global || m_globalRemovedEvent)\n"); + printf(" return;\n"); + printf("\n"); + printf(" wl_global_remove(m_global);\n"); + printf("\n"); + printf(" struct wl_event_loop *event_loop = wl_display_get_event_loop(m_display);\n"); + printf(" m_globalRemovedEvent = wl_event_loop_add_timer(event_loop, deferred_destroy_global_func, this);\n"); + printf(" wl_event_source_timer_update(m_globalRemovedEvent, 5000);\n"); + printf(" }\n"); + printf("\n"); + + bool hasRequests = !interface.requests.empty(); + + QByteArray interfaceMember = hasRequests ? "&m_" + interface.name + "_interface" : QByteArray("nullptr"); + + //We should consider changing bind so that it doesn't special case id == 0 + //and use function overloading instead. Jan do you have a lot of code dependent on this behavior? + printf(" %s::Resource *%s::bind(struct ::wl_client *client, uint32_t id, int version)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" Q_ASSERT_X(!wl_client_get_object(client, id), \"QWaylandObject bind\", QStringLiteral(\"binding to object %%1 more than once\").arg(id).toLocal8Bit().constData());\n"); + printf(" struct ::wl_resource *handle = wl_resource_create(client, &::%s_interface, version, id);\n", interfaceName); + printf(" return bind(handle);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::Resource *%s::bind(struct ::wl_resource *handle)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" Resource *resource = %s_allocate();\n", interfaceNameStripped); + printf(" resource->%s_object = this;\n", interfaceNameStripped); + printf("\n"); + printf(" wl_resource_set_implementation(handle, %s, resource, destroy_func);", interfaceMember.constData()); + printf("\n"); + printf(" resource->handle = handle;\n"); + printf(" %s_bind_resource(resource);\n", interfaceNameStripped); + printf(" return resource;\n"); + printf(" }\n"); + + printf(" %s::Resource *%s::Resource::fromResource(struct ::wl_resource *resource)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" if (Q_UNLIKELY(!resource))\n"); + printf(" return nullptr;\n"); + printf(" if (wl_resource_instance_of(resource, &::%s_interface, %s))\n", interfaceName, interfaceMember.constData()); + printf(" return static_cast(wl_resource_get_user_data(resource));\n"); + printf(" return nullptr;\n"); + printf(" }\n"); + + if (hasRequests) { + printf("\n"); + printf(" const struct ::%s_interface %s::m_%s_interface = {", interfaceName, interfaceName, interfaceName); + bool needsComma = false; + for (const WaylandEvent &e : interface.requests) { + if (needsComma) + printf(","); + needsComma = true; + printf("\n"); + printf(" %s::handle_%s", interfaceName, e.name.constData()); + } + printf("\n"); + printf(" };\n"); + + for (const WaylandEvent &e : interface.requests) { + printf("\n"); + printf(" void %s::%s_", interfaceName, interfaceNameStripped); + printEvent(e, true); + printf("\n"); + printf(" {\n"); + printf(" }\n"); + } + printf("\n"); + + for (const WaylandEvent &e : interface.requests) { + printf("\n"); + printf(" void %s::", interfaceName); + + printEventHandlerSignature(e, interfaceName, false); + + printf("\n"); + printf(" {\n"); + printf(" Q_UNUSED(client);\n"); + printf(" Resource *r = Resource::fromResource(resource);\n"); + printf(" if (Q_UNLIKELY(!r->%s_object)) {\n", interfaceNameStripped); + for (const WaylandArgument &a : e.arguments) { + if (a.type == QByteArrayLiteral("fd")) + printf(" close(%s);\n", a.name.constData()); + } + if (e.type == "destructor") + printf(" wl_resource_destroy(resource);\n"); + printf(" return;\n"); + printf(" }\n"); + printf(" static_cast<%s *>(r->%s_object)->%s_%s(\n", interfaceName, interfaceNameStripped, interfaceNameStripped, e.name.constData()); + printf(" r"); + for (const WaylandArgument &a : e.arguments) { + printf(",\n"); + QByteArray cType = waylandToCType(a.type, a.interface); + QByteArray qtType = waylandToQtType(a.type, a.interface, e.request); + const char *argumentName = a.name.constData(); + if (cType == qtType) + printf(" %s", argumentName); + else if (a.type == "string") + printf(" QString::fromUtf8(%s)", argumentName); + } + printf(");\n"); + printf(" }\n"); + } + } + + for (const WaylandEvent &e : interface.events) { + printf("\n"); + printf(" void %s::send_", interfaceName); + printEvent(e); + printf("\n"); + printf(" {\n"); + printf(" Q_ASSERT_X(m_resource, \"%s::%s\", \"Uninitialised resource\");\n", interfaceName, e.name.constData()); + printf(" if (Q_UNLIKELY(!m_resource)) {\n"); + printf(" qWarning(\"could not call %s::%s as it's not initialised\");\n", interfaceName, e.name.constData()); + printf(" return;\n"); + printf(" }\n"); + printf(" send_%s(\n", e.name.constData()); + printf(" m_resource->handle"); + for (const WaylandArgument &a : e.arguments) { + printf(",\n"); + printf(" %s", a.name.constData()); + } + printf(");\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::send_", interfaceName); + printEvent(e, false, true); + printf("\n"); + printf(" {\n"); + + for (const WaylandArgument &a : e.arguments) { + if (a.type != "array") + continue; + QByteArray array = a.name + "_data"; + const char *arrayName = array.constData(); + const char *variableName = a.name.constData(); + printf(" struct wl_array %s;\n", arrayName); + printf(" %s.size = %s.size();\n", arrayName, variableName); + printf(" %s.data = static_cast(const_cast(%s.constData()));\n", arrayName, variableName); + printf(" %s.alloc = 0;\n", arrayName); + printf("\n"); + } + + printf(" %s_send_%s(\n", interfaceName, e.name.constData()); + printf(" resource"); + + for (const WaylandArgument &a : e.arguments) { + printf(",\n"); + QByteArray cType = waylandToCType(a.type, a.interface); + QByteArray qtType = waylandToQtType(a.type, a.interface, e.request); + if (a.type == "string") + printf(" %s.toUtf8().constData()", a.name.constData()); + else if (a.type == "array") + printf(" &%s_data", a.name.constData()); + else if (cType == qtType) + printf(" %s", a.name.constData()); + } + + printf(");\n"); + printf(" }\n"); + printf("\n"); + } + } + printf("}\n"); + printf("\n"); + printf("QT_WARNING_POP\n"); + printf("QT_END_NAMESPACE\n"); + } + + if (m_option == ClientHeader) { + QByteArray inclusionGuard = QByteArray("QT_WAYLAND_") + preProcessorProtocolName.constData(); + printf("#ifndef %s\n", inclusionGuard.constData()); + printf("#define %s\n", inclusionGuard.constData()); + printf("\n"); + if (m_headerPath.isEmpty()) + printf("#include \"wayland-%s-client-protocol.h\"\n", QByteArray(m_protocolName).replace('_', '-').constData()); + else + printf("#include <%s/wayland-%s-client-protocol.h>\n", m_headerPath.constData(), QByteArray(m_protocolName).replace('_', '-').constData()); + printf("#include \n"); + printf("#include \n"); + printf("\n"); + printf("struct wl_registry;\n"); + printf("\n"); + printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); + + QByteArray clientExport; + + if (m_headerPath.size()) { + clientExport = QByteArray("Q_WAYLAND_CLIENT_") + preProcessorProtocolName + "_EXPORT"; + printf("\n"); + printf("#if !defined(%s)\n", clientExport.constData()); + printf("# if defined(QT_SHARED)\n"); + printf("# define %s Q_DECL_EXPORT\n", clientExport.constData()); + printf("# else\n"); + printf("# define %s\n", clientExport.constData()); + printf("# endif\n"); + printf("#endif\n"); + } + printf("\n"); + printf("namespace QtWayland {\n"); + + bool needsNewLine = false; + for (const WaylandInterface &interface : interfaces) { + + if (ignoreInterface(interface.name)) + continue; + + if (needsNewLine) + printf("\n"); + needsNewLine = true; + + const char *interfaceName = interface.name.constData(); + + QByteArray stripped = stripInterfaceName(interface.name); + const char *interfaceNameStripped = stripped.constData(); + + printf(" class %s %s\n {\n", clientExport.constData(), interfaceName); + printf(" public:\n"); + printf(" %s(struct ::wl_registry *registry, int id, int version);\n", interfaceName); + printf(" %s(struct ::%s *object);\n", interfaceName, interfaceName); + printf(" %s();\n", interfaceName); + printf("\n"); + printf(" virtual ~%s();\n", interfaceName); + printf("\n"); + printf(" void init(struct ::wl_registry *registry, int id, int version);\n"); + printf(" void init(struct ::%s *object);\n", interfaceName); + printf("\n"); + printf(" struct ::%s *object() { return m_%s; }\n", interfaceName, interfaceName); + printf(" const struct ::%s *object() const { return m_%s; }\n", interfaceName, interfaceName); + printf(" static %s *fromObject(struct ::%s *object);\n", interfaceName, interfaceName); + printf("\n"); + printf(" bool isInitialized() const;\n"); + printf("\n"); + printf(" static const struct ::wl_interface *interface();\n"); + + printEnums(interface.enums); + + if (!interface.requests.empty()) { + printf("\n"); + for (const WaylandEvent &e : interface.requests) { + const WaylandArgument *new_id = newIdArgument(e.arguments); + QByteArray new_id_str = "void "; + if (new_id) { + if (new_id->interface.isEmpty()) + new_id_str = "void *"; + else + new_id_str = "struct ::" + new_id->interface + " *"; + } + printf(" %s", new_id_str.constData()); + printEvent(e); + printf(";\n"); + } + } + + bool hasEvents = !interface.events.empty(); + + if (hasEvents) { + printf("\n"); + printf(" protected:\n"); + for (const WaylandEvent &e : interface.events) { + printf(" virtual void %s_", interfaceNameStripped); + printEvent(e); + printf(";\n"); + } + } + + printf("\n"); + printf(" private:\n"); + if (hasEvents) { + printf(" void init_listener();\n"); + printf(" static const struct %s_listener m_%s_listener;\n", interfaceName, interfaceName); + for (const WaylandEvent &e : interface.events) { + printf(" static void "); + + printEventHandlerSignature(e, interfaceName); + printf(";\n"); + } + } + printf(" struct ::%s *m_%s;\n", interfaceName, interfaceName); + printf(" };\n"); + } + printf("}\n"); + printf("\n"); + printf("QT_WARNING_POP\n"); + printf("QT_END_NAMESPACE\n"); + printf("\n"); + printf("#endif\n"); + } + + if (m_option == ClientCode) { + if (m_headerPath.isEmpty()) + printf("#include \"qwayland-%s.h\"\n", QByteArray(m_protocolName).replace('_', '-').constData()); + else + printf("#include <%s/qwayland-%s.h>\n", m_headerPath.constData(), QByteArray(m_protocolName).replace('_', '-').constData()); + printf("\n"); + printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); + printf("\n"); + printf("namespace QtWayland {\n"); + printf("\n"); + + // wl_registry_bind is part of the protocol, so we can't use that... instead we use core + // libwayland API to do the same thing a wayland-scanner generated wl_registry_bind would. + printf("static inline void *wlRegistryBind(struct ::wl_registry *registry, uint32_t name, const struct ::wl_interface *interface, uint32_t version)\n"); + printf("{\n"); + printf(" const uint32_t bindOpCode = 0;\n"); + printf("#if (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR > 10) || WAYLAND_VERSION_MAJOR > 1\n"); + printf(" return (void *) wl_proxy_marshal_constructor_versioned((struct wl_proxy *) registry,\n"); + printf(" bindOpCode, interface, version, name, interface->name, version, nullptr);\n"); + printf("#else\n"); + printf(" return (void *) wl_proxy_marshal_constructor((struct wl_proxy *) registry,\n"); + printf(" bindOpCode, interface, name, interface->name, version, nullptr);\n"); + printf("#endif\n"); + printf("}\n"); + printf("\n"); + + bool needsNewLine = false; + for (const WaylandInterface &interface : interfaces) { + + if (ignoreInterface(interface.name)) + continue; + + if (needsNewLine) + printf("\n"); + needsNewLine = true; + + const char *interfaceName = interface.name.constData(); + + QByteArray stripped = stripInterfaceName(interface.name); + const char *interfaceNameStripped = stripped.constData(); + + bool hasEvents = !interface.events.empty(); + + printf(" %s::%s(struct ::wl_registry *registry, int id, int version)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" init(registry, id, version);\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s(struct ::%s *obj)\n", interfaceName, interfaceName, interfaceName); + printf(" : m_%s(obj)\n", interfaceName); + printf(" {\n"); + if (hasEvents) + printf(" init_listener();\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::%s()\n", interfaceName, interfaceName); + printf(" : m_%s(nullptr)\n", interfaceName); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s::~%s()\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::init(struct ::wl_registry *registry, int id, int version)\n", interfaceName); + printf(" {\n"); + printf(" m_%s = static_cast(wlRegistryBind(registry, id, &%s_interface, version));\n", interfaceName, interfaceName, interfaceName); + if (hasEvents) + printf(" init_listener();\n"); + printf(" }\n"); + printf("\n"); + + printf(" void %s::init(struct ::%s *obj)\n", interfaceName, interfaceName); + printf(" {\n"); + printf(" m_%s = obj;\n", interfaceName); + if (hasEvents) + printf(" init_listener();\n"); + printf(" }\n"); + printf("\n"); + + printf(" %s *%s::fromObject(struct ::%s *object)\n", interfaceName, interfaceName, interfaceName); + printf(" {\n"); + if (hasEvents) { + printf(" if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_%s_listener)\n", interfaceName); + printf(" return nullptr;\n"); + } + printf(" return static_cast<%s *>(%s_get_user_data(object));\n", interfaceName, interfaceName); + printf(" }\n"); + printf("\n"); + + printf(" bool %s::isInitialized() const\n", interfaceName); + printf(" {\n"); + printf(" return m_%s != nullptr;\n", interfaceName); + printf(" }\n"); + printf("\n"); + + printf(" const struct wl_interface *%s::interface()\n", interfaceName); + printf(" {\n"); + printf(" return &::%s_interface;\n", interfaceName); + printf(" }\n"); + + for (const WaylandEvent &e : interface.requests) { + printf("\n"); + const WaylandArgument *new_id = newIdArgument(e.arguments); + QByteArray new_id_str = "void "; + if (new_id) { + if (new_id->interface.isEmpty()) + new_id_str = "void *"; + else + new_id_str = "struct ::" + new_id->interface + " *"; + } + printf(" %s%s::", new_id_str.constData(), interfaceName); + printEvent(e); + printf("\n"); + printf(" {\n"); + for (const WaylandArgument &a : e.arguments) { + if (a.type != "array") + continue; + QByteArray array = a.name + "_data"; + const char *arrayName = array.constData(); + const char *variableName = a.name.constData(); + printf(" struct wl_array %s;\n", arrayName); + printf(" %s.size = %s.size();\n", arrayName, variableName); + printf(" %s.data = static_cast(const_cast(%s.constData()));\n", arrayName, variableName); + printf(" %s.alloc = 0;\n", arrayName); + printf("\n"); + } + int actualArgumentCount = new_id ? int(e.arguments.size()) - 1 : int(e.arguments.size()); + printf(" %s%s_%s(\n", new_id ? "return " : "", interfaceName, e.name.constData()); + printf(" m_%s%s", interfaceName, actualArgumentCount > 0 ? "," : ""); + bool needsComma = false; + for (const WaylandArgument &a : e.arguments) { + bool isNewId = a.type == "new_id"; + if (isNewId && !a.interface.isEmpty()) + continue; + if (needsComma) + printf(","); + needsComma = true; + printf("\n"); + if (isNewId) { + printf(" interface,\n"); + printf(" version"); + } else { + QByteArray cType = waylandToCType(a.type, a.interface); + QByteArray qtType = waylandToQtType(a.type, a.interface, e.request); + if (a.type == "string") + printf(" %s.toUtf8().constData()", a.name.constData()); + else if (a.type == "array") + printf(" &%s_data", a.name.constData()); + else if (cType == qtType) + printf(" %s", a.name.constData()); + } + } + printf(");\n"); + if (e.type == "destructor") + printf(" m_%s = nullptr;\n", interfaceName); + printf(" }\n"); + } + + if (hasEvents) { + printf("\n"); + for (const WaylandEvent &e : interface.events) { + printf(" void %s::%s_", interfaceName, interfaceNameStripped); + printEvent(e, true); + printf("\n"); + printf(" {\n"); + printf(" }\n"); + printf("\n"); + printf(" void %s::", interfaceName); + printEventHandlerSignature(e, interfaceName, false); + printf("\n"); + printf(" {\n"); + printf(" Q_UNUSED(object);\n"); + printf(" static_cast<%s *>(data)->%s_%s(", interfaceName, interfaceNameStripped, e.name.constData()); + bool needsComma = false; + for (const WaylandArgument &a : e.arguments) { + if (needsComma) + printf(","); + needsComma = true; + printf("\n"); + const char *argumentName = a.name.constData(); + if (a.type == "string") + printf(" QString::fromUtf8(%s)", argumentName); + else + printf(" %s", argumentName); + } + printf(");\n"); + + printf(" }\n"); + printf("\n"); + } + printf(" const struct %s_listener %s::m_%s_listener = {\n", interfaceName, interfaceName, interfaceName); + for (const WaylandEvent &e : interface.events) { + printf(" %s::handle_%s,\n", interfaceName, e.name.constData()); + } + printf(" };\n"); + printf("\n"); + + printf(" void %s::init_listener()\n", interfaceName); + printf(" {\n"); + printf(" %s_add_listener(m_%s, &m_%s_listener, this);\n", interfaceName, interfaceName, interfaceName); + printf(" }\n"); + } + } + printf("}\n"); + printf("\n"); + printf("QT_WARNING_POP\n"); + printf("QT_END_NAMESPACE\n"); + } + + return true; +} + +void Scanner::printErrors() +{ + if (m_xml->hasError()) + fprintf(stderr, "XML error: %s\nLine %lld, column %lld\n", m_xml->errorString().toLocal8Bit().constData(), m_xml->lineNumber(), m_xml->columnNumber()); +} + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + Scanner scanner; + + if (!scanner.parseArguments(argc, argv)) { + scanner.printUsage(); + return EXIT_FAILURE; + } + + if (!scanner.process()) { + scanner.printErrors(); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff -Nru dwayland-5.57.0.23/src/tools/README.md dwayland-5.57.0.24+really5.24.3/src/tools/README.md --- dwayland-5.57.0.23/src/tools/README.md 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/README.md 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,7 @@ +QtWayland scanner;s home is inside QtWayland in Qt (https://code.qt.io/cgit/qt/qtwayland.git/tree/src/qtwaylandscanner) + +We have a temporary fork to deliver some crucial fixes that are affecting our code that is not released in Qt5.15, including an API change which can't be relied upon via patching. + +Patches should still go via upstream to Qt and be "cherry-picked" here. + +This folder should be dropped in Plasma 6 diff -Nru dwayland-5.57.0.23/src/tools/testserver/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/src/tools/testserver/CMakeLists.txt --- dwayland-5.57.0.23/src/tools/testserver/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/testserver/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -add_executable(org-kde-kf5-kwayland-testserver main.cpp testserver.cpp) -target_link_libraries(org-kde-kf5-kwayland-testserver Qt5::Core KF5::WaylandServer) -install(TARGETS org-kde-kf5-kwayland-testserver DESTINATION ${LIBEXEC_INSTALL_DIR} ) diff -Nru dwayland-5.57.0.23/src/tools/testserver/main.cpp dwayland-5.57.0.24+really5.24.3/src/tools/testserver/main.cpp --- dwayland-5.57.0.23/src/tools/testserver/main.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/testserver/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "testserver.h" - -#include - -int main(int argc, char *argv[]) -{ - QCoreApplication a(argc, argv); - auto arguments = QCoreApplication::arguments(); - // get rid of our own application path - arguments.removeFirst(); - if (arguments.size() < 1) { - return 1; - } - - TestServer *server = new TestServer(&a); - server->init(); - server->startTestApp(arguments.takeFirst(), arguments); - - return a.exec(); -} diff -Nru dwayland-5.57.0.23/src/tools/testserver/testserver.cpp dwayland-5.57.0.24+really5.24.3/src/tools/testserver/testserver.cpp --- dwayland-5.57.0.23/src/tools/testserver/testserver.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/testserver/testserver.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "testserver.h" -#include "../../server/display.h" -#include "../../server/compositor_interface.h" -#include "../../server/datadevicemanager_interface.h" -#include "../../server/idle_interface.h" -#include "../../server/fakeinput_interface.h" -#include "../../server/seat_interface.h" -#include "../../server/shell_interface.h" -#include "../../server/surface_interface.h" -#include "../../server/subcompositor_interface.h" - -#include -#include -#include -#include -// system -#include -#include -#include - -using namespace KWayland::Server; - -TestServer::TestServer(QObject *parent) - : QObject(parent) - , m_repaintTimer(new QTimer(this)) - , m_timeSinceStart(new QElapsedTimer) - , m_cursorPos(QPointF(0, 0)) -{ -} - -TestServer::~TestServer() = default; - -void TestServer::init() -{ - Q_ASSERT(!m_display); - m_display = new Display(this); - m_display->start(Display::StartMode::ConnectClientsOnly); - m_display->createShm(); - m_display->createCompositor()->create(); - m_shell = m_display->createShell(m_display); - connect(m_shell, &ShellInterface::surfaceCreated, this, - [this] (ShellSurfaceInterface *surface) { - m_shellSurfaces << surface; - // TODO: pass keyboard/pointer/touch focus on mapped - connect(surface, &QObject::destroyed, this, - [this, surface] { - m_shellSurfaces.removeOne(surface); - } - ); - } - ); - - m_shell->create(); - m_seat = m_display->createSeat(m_display); - m_seat->setHasKeyboard(true); - m_seat->setHasPointer(true); - m_seat->setHasTouch(true); - m_seat->create(); - m_display->createDataDeviceManager(m_display)->create(); - m_display->createIdle(m_display)->create(); - m_display->createSubCompositor(m_display)->create(); - // output - auto output = m_display->createOutput(m_display); - const QSize size(1280, 1024); - output->setGlobalPosition(QPoint(0, 0)); - output->setPhysicalSize(size / 3.8); - output->addMode(size); - output->create(); - - auto fakeInput = m_display->createFakeInput(m_display); - fakeInput->create(); - connect(fakeInput, &FakeInputInterface::deviceCreated, this, - [this] (FakeInputDevice *device) { - device->setAuthentication(true); - connect(device, &FakeInputDevice::pointerMotionRequested, this, - [this] (const QSizeF &delta) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_cursorPos = m_cursorPos + QPointF(delta.width(), delta.height()); - m_seat->setPointerPos(m_cursorPos); - } - ); - connect(device, &FakeInputDevice::pointerButtonPressRequested, this, - [this] (quint32 button) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_seat->pointerButtonPressed(button); - } - ); - connect(device, &FakeInputDevice::pointerButtonReleaseRequested, this, - [this] (quint32 button) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_seat->pointerButtonReleased(button); - } - ); - /*connect(device, &FakeInputDevice::pointerAxisRequested, this, - [this] (Qt::Orientation orientation, qreal delta) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_seat->pointerAxis(orientation, delta); - } - );*/ - connect(device, &FakeInputDevice::touchDownRequested, this, - [this] (quint32 id, const QPointF &pos) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_touchIdMapper.insert(id, m_seat->touchDown(pos)); - } - ); - connect(device, &FakeInputDevice::touchMotionRequested, this, - [this] (quint32 id, const QPointF &pos) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - const auto it = m_touchIdMapper.constFind(id); - if (it != m_touchIdMapper.constEnd()) { - m_seat->touchMove(it.value(), pos); - } - } - ); - connect(device, &FakeInputDevice::touchUpRequested, this, - [this] (quint32 id) { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - const auto it = m_touchIdMapper.find(id); - if (it != m_touchIdMapper.end()) { - m_seat->touchUp(it.value()); - m_touchIdMapper.erase(it); - } - } - ); - connect(device, &FakeInputDevice::touchCancelRequested, this, - [this] { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_seat->cancelTouchSequence(); - } - ); - connect(device, &FakeInputDevice::touchFrameRequested, this, - [this] { - m_seat->setTimestamp(m_timeSinceStart->elapsed()); - m_seat->touchFrame(); - } - ); - } - ); - - m_repaintTimer->setInterval(1000 / 60); - connect(m_repaintTimer, &QTimer::timeout, this, &TestServer::repaint); - m_repaintTimer->start(); - m_timeSinceStart->start(); -} - -void TestServer::startTestApp(const QString &app, const QStringList &arguments) -{ - int sx[2]; - if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sx) < 0) { - QCoreApplication::instance()->exit(1); - return; - } - m_display->createClient(sx[0]); - int socket = dup(sx[1]); - if (socket == -1) { - QCoreApplication::instance()->exit(1); - return; - } - QProcess *p = new QProcess(this); - p->setProcessChannelMode(QProcess::ForwardedChannels); - QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); - environment.insert(QStringLiteral("QT_QPA_PLATFORM"), QStringLiteral("wayland")); - environment.insert(QStringLiteral("WAYLAND_SOCKET"), QString::fromUtf8(QByteArray::number(socket))); - p->setProcessEnvironment(environment); - auto finishedSignal = static_cast(&QProcess::finished); - connect(p, finishedSignal, QCoreApplication::instance(), &QCoreApplication::exit); - auto errorSignal = static_cast(&QProcess::error); - connect(p, errorSignal, this, - [] { - QCoreApplication::instance()->exit(1); - } - ); - p->start(app, arguments); -} - -void TestServer::repaint() -{ - for (auto it = m_shellSurfaces.constBegin(), end = m_shellSurfaces.constEnd(); it != end; ++it) { - (*it)->surface()->frameRendered(m_timeSinceStart->elapsed()); - } -} diff -Nru dwayland-5.57.0.23/src/tools/testserver/testserver.h dwayland-5.57.0.24+really5.24.3/src/tools/testserver/testserver.h --- dwayland-5.57.0.23/src/tools/testserver/testserver.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/src/tools/testserver/testserver.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef TESTSERVER_H -#define TESTSERVER_H - -#include -#include -#include -#include - -class QElapsedTimer; -class QTimer; - -namespace KWayland -{ -namespace Server -{ -class Display; -class SeatInterface; -class ShellInterface; -class ShellSurfaceInterface; -} -} - -class TestServer : public QObject -{ - Q_OBJECT -public: - explicit TestServer(QObject *parent); - virtual ~TestServer(); - - void init(); - void startTestApp(const QString &app, const QStringList &arguments); - -private: - void repaint(); - - KWayland::Server::Display *m_display = nullptr; - KWayland::Server::ShellInterface *m_shell = nullptr; - KWayland::Server::SeatInterface *m_seat = nullptr; - QVector m_shellSurfaces; - QTimer *m_repaintTimer; - QScopedPointer m_timeSinceStart; - QPointF m_cursorPos; - QHash m_touchIdMapper; -}; - -#endif diff -Nru dwayland-5.57.0.23/tests/clientManagementTest.cpp dwayland-5.57.0.24+really5.24.3/tests/clientManagementTest.cpp --- dwayland-5.57.0.23/tests/clientManagementTest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/clientManagementTest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -96,10 +96,11 @@ << m_windowStates.at(i).geometry.width << m_windowStates.at(i).geometry.height \ <<"isMinimized("< - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/client/connection_thread.h" -#include "../src/client/clientmanagement.h" -#include "../src/client/event_queue.h" -#include "../src/client/registry.h" -#include "../src/client/outputmanagement.h" -#include "../src/client/outputdevice.h" -#include "../src/client/outputconfiguration.h" - - -// Qt -#include -#include -#include -#include -// system -#include - -using namespace KWayland::Client; - -class KwaylandTest : public QObject -{ - Q_OBJECT -public: - explicit KwaylandTest(QObject *parent = nullptr); - virtual ~KwaylandTest(); - void init(); - -private: - void setupRegistry(Registry *registry); - QThread *m_connectionThread; - ConnectionThread *m_connectionThreadObject; - EventQueue *m_eventQueue = nullptr; - OutputManagement *m_outputManagement = nullptr; - OutputDevice * m_outputDevice = nullptr; - OutputConfiguration *m_outputConfiguration = nullptr; - QVector m_windowStates; -}; - -KwaylandTest::KwaylandTest(QObject *parent) - : QObject(parent) - , m_connectionThread(new QThread(this)) - , m_connectionThreadObject(new ConnectionThread()) -{ -} - -KwaylandTest::~KwaylandTest() -{ - m_connectionThread->quit(); - m_connectionThread->wait(); - m_connectionThreadObject->deleteLater(); -} - -void KwaylandTest::init() -{ - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - - m_connectionThreadObject->initConnection(); -} - -void KwaylandTest::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::outputManagementAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_outputManagement = registry->createOutputManagement(name, version, this); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createOutputManagement"; - m_outputManagement->setEventQueue(m_eventQueue); - } - ); - - connect(registry, &Registry::outputDeviceAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_outputDevice = registry->createOutputDevice(name, version, this); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createOutputDevice"; - m_outputDevice->setEventQueue(m_eventQueue); - } - ); - - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_outputManagement); - Q_ASSERT(m_outputDevice); - m_outputConfiguration = m_outputManagement->createConfiguration(this); - qDebug() << "send setBrightness "; - m_outputConfiguration->setBrightness(m_outputDevice, 90); - m_outputConfiguration->apply(); - - } - ); - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -int main(int argc, char **argv) -{ - QGuiApplication app(argc, argv); - KwaylandTest client; - client.init(); - - return app.exec(); -} -#include "clientWaylandDemo.moc" - diff -Nru dwayland-5.57.0.23/tests/CMakeLists.txt dwayland-5.57.0.24+really5.24.3/tests/CMakeLists.txt --- dwayland-5.57.0.23/tests/CMakeLists.txt 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/CMakeLists.txt 2022-11-18 03:38:26.000000000 +0000 @@ -6,7 +6,7 @@ waylandservertest.cpp ) add_executable(testServer ${testServer_SRCS}) -target_link_libraries(testServer KF5::WaylandServer) +target_link_libraries(testServer Deepin::DWaylandServer) ecm_mark_as_test(testServer) find_package(Qt5Widgets ${QT_MIN_VERSION} CONFIG QUIET) @@ -15,78 +15,57 @@ renderingservertest.cpp ) add_executable(testRenderingServer ${testRenderingServer_SRCS}) - target_link_libraries(testRenderingServer KF5::WaylandServer Qt5::Concurrent Qt5::Widgets) + target_link_libraries(testRenderingServer Deepin::DWaylandServer Qt::Concurrent Qt::Widgets) ecm_mark_as_test(testRenderingServer) endif() add_executable(copyClient copyclient.cpp) -target_link_libraries(copyClient KF5::WaylandClient) +target_link_libraries(copyClient Deepin::WaylandClient) ecm_mark_as_test(copyClient) add_executable(pasteClient pasteclient.cpp) -target_link_libraries(pasteClient Qt5::Concurrent KF5::WaylandClient) +target_link_libraries(pasteClient Qt::Concurrent Deepin::WaylandClient) ecm_mark_as_test(pasteClient) add_executable(clientManagementTest clientManagementTest.cpp) -target_link_libraries(clientManagementTest KF5::WaylandClient) +target_link_libraries(clientManagementTest Deepin::WaylandClient) ecm_mark_as_test(clientManagementTest) -add_executable(clientWaylandDemo clientWaylandDemo.cpp) -target_link_libraries(clientWaylandDemo KF5::WaylandClient) -ecm_mark_as_test(clientWaylandDemo) - -add_executable(screenDump screenDump.cpp) -target_link_libraries(screenDump KF5::WaylandClient) -ecm_mark_as_test(screenDump) -if (HAVE_LINUX_INPUT_H) - add_executable(touchClientTest touchclienttest.cpp) - target_link_libraries(touchClientTest KF5::WaylandClient) - - - add_executable(panelTest paneltest.cpp) - target_link_libraries(panelTest KF5::WaylandClient) - ecm_mark_as_test(panelTest) - - add_executable(grabTest grabtest.cpp) - target_link_libraries(grabTest KF5::WaylandClient) - ecm_mark_as_test(grabTest) - - add_executable(qtwayland-integration-test qtwaylandintegrationtest.cpp) - target_link_libraries(qtwayland-integration-test Qt5::Core Qt5::Gui KF5::WaylandClient) - ecm_mark_as_test(qtwayland-integration-test) - - add_executable(subsurface-test subsurfacetest.cpp) - target_link_libraries(subsurface-test Qt5::Core Qt5::Gui KF5::WaylandClient) - ecm_mark_as_test(subsurface-test) -endif() +add_executable(touchClientTest touchclienttest.cpp) +target_link_libraries(touchClientTest Deepin::WaylandClient) + +add_executable(panelTest paneltest.cpp) +target_link_libraries(panelTest Deepin::WaylandClient) +ecm_mark_as_test(panelTest) + +add_executable(subsurface-test subsurfacetest.cpp) +target_link_libraries(subsurface-test Qt::Core Qt::Gui Deepin::WaylandClient) +ecm_mark_as_test(subsurface-test) add_executable(shadowTest shadowtest.cpp) -target_link_libraries(shadowTest KF5::WaylandClient) +target_link_libraries(shadowTest Deepin::WaylandClient) ecm_mark_as_test(shadowTest) -add_executable(gammaTest gammatest.cpp) -target_link_libraries(gammaTest KF5::WaylandClient) -ecm_mark_as_test(gammaTest) - -add_executable(rendersequenceTest rendersequencetest.cpp) -target_link_libraries(rendersequenceTest KF5::WaylandClient) -ecm_mark_as_test(rendersequenceTest) if (Qt5Widgets_FOUND) add_executable(dpmsTest dpmstest.cpp) - target_link_libraries(dpmsTest KF5::WaylandClient Qt5::Widgets) + target_link_libraries(dpmsTest Deepin::WaylandClient Qt::Widgets) ecm_mark_as_test(dpmsTest) endif() add_executable(plasmasurface-test plasmasurfacetest.cpp) -target_link_libraries(plasmasurface-test Qt5::Gui KF5::WaylandClient) +target_link_libraries(plasmasurface-test Qt::Gui Deepin::WaylandClient) ecm_mark_as_test(plasmasurface-test) +add_executable(globalproperty-test globalpropertytest.cpp) +target_link_libraries(globalproperty-test Qt::Gui Deepin::WaylandClient) +ecm_mark_as_test(globalproperty-test) + add_executable(xdgforeign-test xdgforeigntest.cpp) -target_link_libraries(xdgforeign-test Qt5::Gui KF5::WaylandClient) +target_link_libraries(xdgforeign-test Qt::Gui Deepin::WaylandClient) ecm_mark_as_test(xdgforeign-test) add_executable(xdg-test xdgtest.cpp) -target_link_libraries(xdg-test Qt5::Gui KF5::WaylandClient) +target_link_libraries(xdg-test Qt::Gui Deepin::WaylandClient) ecm_mark_as_test(xdg-test) diff -Nru dwayland-5.57.0.23/tests/copyclient.cpp dwayland-5.57.0.24+really5.24.3/tests/copyclient.cpp --- dwayland-5.57.0.23/tests/copyclient.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/copyclient.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/datadevice.h" @@ -82,7 +68,10 @@ void CopyClient::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -90,8 +79,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -100,63 +88,47 @@ void CopyClient::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_seat = registry->createSeat(name, version, this); - connect(m_seat, &Seat::hasPointerChanged, this, - [this] { - auto p = m_seat->createPointer(this); - connect(p, &Pointer::entered, this, - [this] (quint32 serial) { - if (m_copySource) { - m_dataDevice->setSelection(serial, m_copySource); - } - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_seat = registry->createSeat(name, version, this); + connect(m_seat, &Seat::hasPointerChanged, this, [this] { + auto p = m_seat->createPointer(this); + connect(p, &Pointer::entered, this, [this](quint32 serial) { + if (m_copySource) { + m_dataDevice->setSelection(serial, m_copySource); } - ); - } - ); - connect(registry, &Registry::dataDeviceManagerAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_dataDeviceManager = registry->createDataDeviceManager(name, version, this); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_dataDeviceManager); - Q_ASSERT(m_seat); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setFullscreen(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &CopyClient::render); - - m_dataDevice = m_dataDeviceManager->getDataDevice(m_seat, this); - m_copySource = m_dataDeviceManager->createDataSource(this); - m_copySource->offer(QStringLiteral("text/plain")); - connect(m_copySource, &DataSource::sendDataRequested, this, &CopyClient::copy); - } - ); + }); + }); + }); + connect(registry, &Registry::dataDeviceManagerAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_dataDeviceManager = registry->createDataDeviceManager(name, version, this); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_dataDeviceManager); + Q_ASSERT(m_seat); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setFullscreen(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &CopyClient::render); + + m_dataDevice = m_dataDeviceManager->getDataDevice(m_seat, this); + m_copySource = m_dataDeviceManager->createDataSource(this); + m_copySource->offer(QStringLiteral("text/plain")); + connect(m_copySource, &DataSource::sendDataRequested, this, &CopyClient::copy); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); diff -Nru dwayland-5.57.0.23/tests/dpmstest.cpp dwayland-5.57.0.24+really5.24.3/tests/dpmstest.cpp --- dwayland-5.57.0.23/tests/dpmstest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/dpmstest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,12 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../src/client/dpms.h" +#include "../src/client/connection_thread.h" +#include "../src/client/output.h" +#include "../src/client/registry.h" #include #include #include @@ -24,10 +14,6 @@ #include #include #include -#include "../src/client/connection_thread.h" -#include "../src/client/dpms.h" -#include "../src/client/registry.h" -#include "../src/client/output.h" using namespace KWayland::Client; @@ -56,11 +42,14 @@ { Output *output = registry->createOutput(outputInterface.name, outputInterface.version, registry); QLabel *label = new QLabel(output->model()); - QObject::connect(output, &Output::changed, label, + QObject::connect( + output, + &Output::changed, + label, [label, output] { label->setText(output->model()); - }, Qt::QueuedConnection - ); + }, + Qt::QueuedConnection); Dpms *dpms = nullptr; if (manager) { @@ -77,37 +66,44 @@ QPushButton *standbyButton = new QPushButton(QStringLiteral("Standby")); QPushButton *suspendButton = new QPushButton(QStringLiteral("Suspend")); QPushButton *offButton = new QPushButton(QStringLiteral("Off")); - QPushButton *onButton = new QPushButton(QStringLiteral("On")); standbyButton->setEnabled(supported); suspendButton->setEnabled(supported); offButton->setEnabled(supported); - onButton->setEnabled(supported); QDialogButtonBox *bg = new QDialogButtonBox; bg->addButton(standbyButton, QDialogButtonBox::ActionRole); bg->addButton(suspendButton, QDialogButtonBox::ActionRole); bg->addButton(offButton, QDialogButtonBox::ActionRole); - bg->addButton(onButton, QDialogButtonBox::ActionRole); if (dpms) { - QObject::connect(dpms, &Dpms::supportedChanged, supportedLabel, - [supportedLabel, dpms, standbyButton, suspendButton, offButton, onButton] { + QObject::connect( + dpms, + &Dpms::supportedChanged, + supportedLabel, + [supportedLabel, dpms, standbyButton, suspendButton, offButton] { const bool supported = dpms->isSupported(); supportedLabel->setText(supportedToString(supported)); standbyButton->setEnabled(supported); suspendButton->setEnabled(supported); offButton->setEnabled(supported); - onButton->setEnabled(supported); - }, Qt::QueuedConnection - ); - QObject::connect(dpms, &Dpms::modeChanged, modeLabel, + }, + Qt::QueuedConnection); + QObject::connect( + dpms, + &Dpms::modeChanged, + modeLabel, [modeLabel, dpms] { modeLabel->setText(modeToString(dpms->mode())); - }, Qt::QueuedConnection - ); - QObject::connect(standbyButton, &QPushButton::clicked, dpms, [dpms] { dpms->requestMode(Dpms::Mode::Standby);}); - QObject::connect(suspendButton, &QPushButton::clicked, dpms, [dpms] { dpms->requestMode(Dpms::Mode::Suspend);}); - QObject::connect(offButton, &QPushButton::clicked, dpms, [dpms] { dpms->requestMode(Dpms::Mode::Off);}); - QObject::connect(onButton, &QPushButton::clicked, dpms, [dpms] { dpms->requestMode(Dpms::Mode::On);}); + }, + Qt::QueuedConnection); + QObject::connect(standbyButton, &QPushButton::clicked, dpms, [dpms] { + dpms->requestMode(Dpms::Mode::Standby); + }); + QObject::connect(suspendButton, &QPushButton::clicked, dpms, [dpms] { + dpms->requestMode(Dpms::Mode::Suspend); + }); + QObject::connect(offButton, &QPushButton::clicked, dpms, [dpms] { + dpms->requestMode(Dpms::Mode::Off); + }); } QVBoxLayout *layout = new QVBoxLayout; @@ -127,7 +123,10 @@ ConnectionThread *connection = ConnectionThread::fromApplication(); Registry registry; registry.create(connection); - QObject::connect(®istry, &Registry::interfacesAnnounced, &app, + QObject::connect( + ®istry, + &Registry::interfacesAnnounced, + &app, [®istry, &window] { const bool hasDpms = registry.hasInterface(Registry::Interface::Dpms); QLabel *hasDpmsLabel = new QLabel(&window); @@ -160,8 +159,8 @@ window.setLayout(layout); window.show(); - }, Qt::QueuedConnection - ); + }, + Qt::QueuedConnection); registry.setup(); return app.exec(); diff -Nru dwayland-5.57.0.23/tests/gammatest.cpp dwayland-5.57.0.24+really5.24.3/tests/gammatest.cpp --- dwayland-5.57.0.23/tests/gammatest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/gammatest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,528 +0,0 @@ -/******************************************************************** -Copyright 2022 diguoliang - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/client/connection_thread.h" -#include "../src/client/clientmanagement.h" -#include "../src/client/event_queue.h" -#include "../src/client/registry.h" -#include "../src/client/outputmanagement.h" -#include "../src/client/outputdevice.h" -#include "../src/client/outputconfiguration.h" - -#include "../src/server/display.h" -#include "../src/server/shell_interface.h" -#include "../src/server/compositor_interface.h" -#include "../src/server/outputconfiguration_interface.h" -#include "../src/server/outputdevice_interface.h" -#include "../src/server/outputmanagement_interface.h" - - -// Qt -#include -#include -#include -#include -#include -// system -#include -#include - -using namespace KWayland::Client; - -static const int MIN_TEMPERATURE = 1000; -static const int NEUTRAL_TEMPERATURE = 6500; -static const int DEFAULT_NIGHT_TEMPERATURE = 4500; - -static float g_brightness; -static int g_temperature; - -static bool g_setBrightness = false; -static bool g_setTemperature = false; - -static const float blackbodyColor[] = { - 1.00000000, 0.18172716, 0.00000000, /* 1000K */ - 1.00000000, 0.25503671, 0.00000000, /* 1100K */ - 1.00000000, 0.30942099, 0.00000000, /* 1200K */ - 1.00000000, 0.35357379, 0.00000000, /* ... */ - 1.00000000, 0.39091524, 0.00000000, - 1.00000000, 0.42322816, 0.00000000, - 1.00000000, 0.45159884, 0.00000000, - 1.00000000, 0.47675916, 0.00000000, - 1.00000000, 0.49923747, 0.00000000, - 1.00000000, 0.51943421, 0.00000000, - 1.00000000, 0.54360078, 0.08679949, /* 2000K */ - 1.00000000, 0.56618736, 0.14065513, - 1.00000000, 0.58734976, 0.18362641, - 1.00000000, 0.60724493, 0.22137978, - 1.00000000, 0.62600248, 0.25591950, - 1.00000000, 0.64373109, 0.28819679, - 1.00000000, 0.66052319, 0.31873863, - 1.00000000, 0.67645822, 0.34786758, - 1.00000000, 0.69160518, 0.37579588, - 1.00000000, 0.70602449, 0.40267128, - 1.00000000, 0.71976951, 0.42860152, /* 3000K */ - 1.00000000, 0.73288760, 0.45366838, - 1.00000000, 0.74542112, 0.47793608, - 1.00000000, 0.75740814, 0.50145662, - 1.00000000, 0.76888303, 0.52427322, - 1.00000000, 0.77987699, 0.54642268, - 1.00000000, 0.79041843, 0.56793692, - 1.00000000, 0.80053332, 0.58884417, - 1.00000000, 0.81024551, 0.60916971, - 1.00000000, 0.81957693, 0.62893653, - 1.00000000, 0.82854786, 0.64816570, /* 4000K */ - 1.00000000, 0.83717703, 0.66687674, - 1.00000000, 0.84548188, 0.68508786, - 1.00000000, 0.85347859, 0.70281616, - 1.00000000, 0.86118227, 0.72007777, - 1.00000000, 0.86860704, 0.73688797, /* 4500K */ - 1.00000000, 0.87576611, 0.75326132, - 1.00000000, 0.88267187, 0.76921169, - 1.00000000, 0.88933596, 0.78475236, - 1.00000000, 0.89576933, 0.79989606, - 1.00000000, 0.90198230, 0.81465502, /* 5000K */ - 1.00000000, 0.90963069, 0.82838210, - 1.00000000, 0.91710889, 0.84190889, - 1.00000000, 0.92441842, 0.85523742, - 1.00000000, 0.93156127, 0.86836903, - 1.00000000, 0.93853986, 0.88130458, - 1.00000000, 0.94535695, 0.89404470, - 1.00000000, 0.95201559, 0.90658983, - 1.00000000, 0.95851906, 0.91894041, - 1.00000000, 0.96487079, 0.93109690, - 1.00000000, 0.97107439, 0.94305985, /* 6000K */ - 1.00000000, 0.97713351, 0.95482993, - 1.00000000, 0.98305189, 0.96640795, - 1.00000000, 0.98883326, 0.97779486, - 1.00000000, 0.99448139, 0.98899179, - 1.00000000, 1.00000000, 1.00000000, /* 6500K */ - 0.98947904, 0.99348723, 1.00000000, - 0.97940448, 0.98722715, 1.00000000, - 0.96975025, 0.98120637, 1.00000000, - 0.96049223, 0.97541240, 1.00000000, - 0.95160805, 0.96983355, 1.00000000, /* 7000K */ - 0.94303638, 0.96443333, 1.00000000, - 0.93480451, 0.95923080, 1.00000000, - 0.92689056, 0.95421394, 1.00000000, - 0.91927697, 0.94937330, 1.00000000, - 0.91194747, 0.94470005, 1.00000000, - 0.90488690, 0.94018594, 1.00000000, - 0.89808115, 0.93582323, 1.00000000, - 0.89151710, 0.93160469, 1.00000000, - 0.88518247, 0.92752354, 1.00000000, - 0.87906581, 0.92357340, 1.00000000, /* 8000K */ - 0.87315640, 0.91974827, 1.00000000, - 0.86744421, 0.91604254, 1.00000000, - 0.86191983, 0.91245088, 1.00000000, - 0.85657444, 0.90896831, 1.00000000, - 0.85139976, 0.90559011, 1.00000000, - 0.84638799, 0.90231183, 1.00000000, - 0.84153180, 0.89912926, 1.00000000, - 0.83682430, 0.89603843, 1.00000000, - 0.83225897, 0.89303558, 1.00000000, - 0.82782969, 0.89011714, 1.00000000, /* 9000K */ - 0.82353066, 0.88727974, 1.00000000, - 0.81935641, 0.88452017, 1.00000000, - 0.81530175, 0.88183541, 1.00000000, - 0.81136180, 0.87922257, 1.00000000, - 0.80753191, 0.87667891, 1.00000000, - 0.80380769, 0.87420182, 1.00000000, - 0.80018497, 0.87178882, 1.00000000, - 0.79665980, 0.86943756, 1.00000000, - 0.79322843, 0.86714579, 1.00000000, - 0.78988728, 0.86491137, 1.00000000, /* 10000K */ - 0.78663296, 0.86273225, 1.00000000, - 0.78346225, 0.86060650, 1.00000000, - 0.78037207, 0.85853224, 1.00000000, - 0.77735950, 0.85650771, 1.00000000, - 0.77442176, 0.85453121, 1.00000000, - 0.77155617, 0.85260112, 1.00000000, - 0.76876022, 0.85071588, 1.00000000, - 0.76603147, 0.84887402, 1.00000000, - 0.76336762, 0.84707411, 1.00000000, - 0.76076645, 0.84531479, 1.00000000, /* 11000K */ - 0.75822586, 0.84359476, 1.00000000, - 0.75574383, 0.84191277, 1.00000000, - 0.75331843, 0.84026762, 1.00000000, - 0.75094780, 0.83865816, 1.00000000, - 0.74863017, 0.83708329, 1.00000000, - 0.74636386, 0.83554194, 1.00000000, - 0.74414722, 0.83403311, 1.00000000, - 0.74197871, 0.83255582, 1.00000000, - 0.73985682, 0.83110912, 1.00000000, - 0.73778012, 0.82969211, 1.00000000, /* 12000K */ - 0.73574723, 0.82830393, 1.00000000, - 0.73375683, 0.82694373, 1.00000000, - 0.73180765, 0.82561071, 1.00000000, - 0.72989845, 0.82430410, 1.00000000, - 0.72802807, 0.82302316, 1.00000000, - 0.72619537, 0.82176715, 1.00000000, - 0.72439927, 0.82053539, 1.00000000, - 0.72263872, 0.81932722, 1.00000000, - 0.72091270, 0.81814197, 1.00000000, - 0.71922025, 0.81697905, 1.00000000, /* 13000K */ - 0.71756043, 0.81583783, 1.00000000, - 0.71593234, 0.81471775, 1.00000000, - 0.71433510, 0.81361825, 1.00000000, - 0.71276788, 0.81253878, 1.00000000, - 0.71122987, 0.81147883, 1.00000000, - 0.70972029, 0.81043789, 1.00000000, - 0.70823838, 0.80941546, 1.00000000, - 0.70678342, 0.80841109, 1.00000000, - 0.70535469, 0.80742432, 1.00000000, - 0.70395153, 0.80645469, 1.00000000, /* 14000K */ - 0.70257327, 0.80550180, 1.00000000, - 0.70121928, 0.80456522, 1.00000000, - 0.69988894, 0.80364455, 1.00000000, - 0.69858167, 0.80273941, 1.00000000, - 0.69729688, 0.80184943, 1.00000000, - 0.69603402, 0.80097423, 1.00000000, - 0.69479255, 0.80011347, 1.00000000, - 0.69357196, 0.79926681, 1.00000000, - 0.69237173, 0.79843391, 1.00000000, - 0.69119138, 0.79761446, 1.00000000, /* 15000K */ - 0.69003044, 0.79680814, 1.00000000, - 0.68888844, 0.79601466, 1.00000000, - 0.68776494, 0.79523371, 1.00000000, - 0.68665951, 0.79446502, 1.00000000, - 0.68557173, 0.79370830, 1.00000000, - 0.68450119, 0.79296330, 1.00000000, - 0.68344751, 0.79222975, 1.00000000, - 0.68241029, 0.79150740, 1.00000000, - 0.68138918, 0.79079600, 1.00000000, - 0.68038380, 0.79009531, 1.00000000, /* 16000K */ - 0.67939381, 0.78940511, 1.00000000, - 0.67841888, 0.78872517, 1.00000000, - 0.67745866, 0.78805526, 1.00000000, - 0.67651284, 0.78739518, 1.00000000, - 0.67558112, 0.78674472, 1.00000000, - 0.67466317, 0.78610368, 1.00000000, - 0.67375872, 0.78547186, 1.00000000, - 0.67286748, 0.78484907, 1.00000000, - 0.67198916, 0.78423512, 1.00000000, - 0.67112350, 0.78362984, 1.00000000, /* 17000K */ - 0.67027024, 0.78303305, 1.00000000, - 0.66942911, 0.78244457, 1.00000000, - 0.66859988, 0.78186425, 1.00000000, - 0.66778228, 0.78129191, 1.00000000, - 0.66697610, 0.78072740, 1.00000000, - 0.66618110, 0.78017057, 1.00000000, - 0.66539706, 0.77962127, 1.00000000, - 0.66462376, 0.77907934, 1.00000000, - 0.66386098, 0.77854465, 1.00000000, - 0.66310852, 0.77801705, 1.00000000, /* 18000K */ - 0.66236618, 0.77749642, 1.00000000, - 0.66163375, 0.77698261, 1.00000000, - 0.66091106, 0.77647551, 1.00000000, - 0.66019791, 0.77597498, 1.00000000, - 0.65949412, 0.77548090, 1.00000000, - 0.65879952, 0.77499315, 1.00000000, - 0.65811392, 0.77451161, 1.00000000, - 0.65743716, 0.77403618, 1.00000000, - 0.65676908, 0.77356673, 1.00000000, - 0.65610952, 0.77310316, 1.00000000, /* 19000K */ - 0.65545831, 0.77264537, 1.00000000, - 0.65481530, 0.77219324, 1.00000000, - 0.65418036, 0.77174669, 1.00000000, - 0.65355332, 0.77130560, 1.00000000, - 0.65293404, 0.77086988, 1.00000000, - 0.65232240, 0.77043944, 1.00000000, - 0.65171824, 0.77001419, 1.00000000, - 0.65112144, 0.76959404, 1.00000000, - 0.65053187, 0.76917889, 1.00000000, - 0.64994941, 0.76876866, 1.00000000, /* 20000K */ - 0.64937392, 0.76836326, 1.00000000, - 0.64880528, 0.76796263, 1.00000000, - 0.64824339, 0.76756666, 1.00000000, - 0.64768812, 0.76717529, 1.00000000, - 0.64713935, 0.76678844, 1.00000000, - 0.64659699, 0.76640603, 1.00000000, - 0.64606092, 0.76602798, 1.00000000, - 0.64553103, 0.76565424, 1.00000000, - 0.64500722, 0.76528472, 1.00000000, - 0.64448939, 0.76491935, 1.00000000, /* 21000K */ - 0.64397745, 0.76455808, 1.00000000, - 0.64347129, 0.76420082, 1.00000000, - 0.64297081, 0.76384753, 1.00000000, - 0.64247594, 0.76349813, 1.00000000, - 0.64198657, 0.76315256, 1.00000000, - 0.64150261, 0.76281076, 1.00000000, - 0.64102399, 0.76247267, 1.00000000, - 0.64055061, 0.76213824, 1.00000000, - 0.64008239, 0.76180740, 1.00000000, - 0.63961926, 0.76148010, 1.00000000, /* 22000K */ - 0.63916112, 0.76115628, 1.00000000, - 0.63870790, 0.76083590, 1.00000000, - 0.63825953, 0.76051890, 1.00000000, - 0.63781592, 0.76020522, 1.00000000, - 0.63737701, 0.75989482, 1.00000000, - 0.63694273, 0.75958764, 1.00000000, - 0.63651299, 0.75928365, 1.00000000, - 0.63608774, 0.75898278, 1.00000000, - 0.63566691, 0.75868499, 1.00000000, - 0.63525042, 0.75839025, 1.00000000, /* 23000K */ - 0.63483822, 0.75809849, 1.00000000, - 0.63443023, 0.75780969, 1.00000000, - 0.63402641, 0.75752379, 1.00000000, - 0.63362667, 0.75724075, 1.00000000, - 0.63323097, 0.75696053, 1.00000000, - 0.63283925, 0.75668310, 1.00000000, - 0.63245144, 0.75640840, 1.00000000, - 0.63206749, 0.75613641, 1.00000000, - 0.63168735, 0.75586707, 1.00000000, - 0.63131096, 0.75560036, 1.00000000, /* 24000K */ - 0.63093826, 0.75533624, 1.00000000, - 0.63056920, 0.75507467, 1.00000000, - 0.63020374, 0.75481562, 1.00000000, - 0.62984181, 0.75455904, 1.00000000, - 0.62948337, 0.75430491, 1.00000000, - 0.62912838, 0.75405319, 1.00000000, - 0.62877678, 0.75380385, 1.00000000, - 0.62842852, 0.75355685, 1.00000000, - 0.62808356, 0.75331217, 1.00000000, - 0.62774186, 0.75306977, 1.00000000, /* 25000K */ - 0.62740336, 0.75282962, 1.00000000 -}; - -#define UINT16_MAX (65535) - -/* Because fmin requires C99 suppport */ -static inline double dmin (double x, double y) -{ - return x < y ? x : y; -} - -class GammaTest : public QObject -{ - Q_OBJECT -public: - explicit GammaTest(QObject *parent = nullptr); - virtual ~GammaTest(); - void init(); - void setColorCurves(OutputDevice* outputDevice, float brightness); - void setColorCurves(OutputDevice* outputDevice, int temperature); -private: - void setupRegistry(Registry *registry); - QThread *m_connectionThread; - ConnectionThread *m_connectionThreadObject; - EventQueue *m_eventQueue = nullptr; - OutputManagement *m_outputManagement = nullptr; - OutputDevice * m_outputDevice = nullptr; - OutputConfiguration *m_outputConfiguration = nullptr; - QVector m_windowStates; - KWayland::Server::OutputManagementInterface *m_outputManagementInterface; - OutputDevice *m_outputDevice0 = nullptr; - OutputDevice *m_outputDevice1 = nullptr; -}; - -GammaTest::GammaTest(QObject *parent) - : QObject(parent) - , m_connectionThread(new QThread(this)) - , m_connectionThreadObject(new ConnectionThread()) -{ -} - -GammaTest::~GammaTest() -{ - m_connectionThread->quit(); - m_connectionThread->wait(); - m_connectionThreadObject->deleteLater(); -} - -void GammaTest::init() -{ - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - - m_connectionThreadObject->initConnection(); -} - -void GammaTest::setColorCurves(OutputDevice* outputDevice, float brightness) -{ - OutputDevice::ColorCurves colorCurves = outputDevice->colorCurves(); - - m_outputConfiguration = m_outputManagement->createConfiguration(this); - int rampsize = colorCurves.red.size(); - - float gammaRed = 1.0; - float gammaGreen = 1.0; - float gammaBlue = 1.0; - QVector vecRed; - QVector vecGreen; - QVector vecBlue; - - - for (int i = 0; i < rampsize; i++) { - if (gammaRed == 1.0 && brightness == 1.0) - vecRed.append((double)i / (double)(rampsize - 1) * (double)UINT16_MAX); - else - vecRed.append(dmin(pow((double)i/(double)(rampsize - 1), - gammaRed) * brightness, - 1.0) * (double)UINT16_MAX); - - if (gammaGreen == 1.0 && brightness == 1.0) - vecGreen.append((double)i / (double)(rampsize - 1) * (double)UINT16_MAX); - else - vecGreen.append(dmin(pow((double)i/(double)(rampsize - 1), - gammaGreen) * brightness, - 1.0) * (double)UINT16_MAX); - - if (gammaBlue == 1.0 && brightness == 1.0) - vecBlue.append((double)i / (double)(rampsize - 1) * (double)UINT16_MAX); - else - vecBlue.append(dmin(pow((double)i/(double)(rampsize - 1), - gammaBlue) * brightness, - 1.0) * (double)UINT16_MAX); - } - qDebug() << "========== setColorCurves, gamma size is " << rampsize; - m_outputConfiguration->setColorCurves(outputDevice, vecRed, vecGreen, vecBlue); - m_outputConfiguration->apply(); -} - -void GammaTest::setColorCurves(OutputDevice* outputDevice, int temperature) -{ - OutputDevice::ColorCurves colorCurves = outputDevice->colorCurves(); - - m_outputConfiguration = m_outputManagement->createConfiguration(this); - int rampsize = colorCurves.red.size(); - - QVector vecRed; - QVector vecGreen; - QVector vecBlue; - - // linear default state - for (int i = 0; i < rampsize; i++) { - uint16_t value = (double)i / rampsize * (UINT16_MAX + 1); - vecRed.push_back(value); - vecGreen.push_back(value); - vecBlue.push_back(value); - } - - // approximate white point - float whitePoint[3]; - float alpha = (temperature % 100) / 100.; - int bbCIndex = ((temperature - 1000) / 100) * 3; - whitePoint[0] = (1. - alpha) * blackbodyColor[bbCIndex] + alpha * blackbodyColor[bbCIndex + 3]; - whitePoint[1] = (1. - alpha) * blackbodyColor[bbCIndex + 1] + alpha * blackbodyColor[bbCIndex + 4]; - whitePoint[2] = (1. - alpha) * blackbodyColor[bbCIndex + 2] + alpha * blackbodyColor[bbCIndex + 5]; - - for (int i = 0; i < rampsize; i++) { - vecRed[i] = (double)vecRed[i] / (UINT16_MAX+1) * whitePoint[0] * (UINT16_MAX+1); - vecGreen[i] = (double)vecGreen[i] / (UINT16_MAX+1) * whitePoint[1] * (UINT16_MAX+1); - vecBlue[i] = (double)vecBlue[i] / (UINT16_MAX+1) * whitePoint[2] * (UINT16_MAX+1); - } - qDebug() << "========== setColorCurves, gamma size is " << rampsize; - m_outputConfiguration->setColorCurves(outputDevice, vecRed, vecGreen, vecBlue); - m_outputConfiguration->apply(); -} - -void GammaTest::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::outputManagementAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_outputManagement = registry->createOutputManagement(name, version, this); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createOutputManagement"; - m_outputManagement->setEventQueue(m_eventQueue); - } - ); - - connect(registry, &Registry::outputDeviceAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - auto outputDevice = registry->createOutputDevice(name, version, this); - if (outputDevice) { - if (!m_outputDevice0) { - m_outputDevice0 = outputDevice; - connect(m_outputDevice0, &OutputDevice::changed, this, [=]() { - //qDebug() << m_outputDevice0->model() << " " << m_outputDevice0->uuid(); - }); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createOutputDevice"; - m_outputDevice0->setEventQueue(m_eventQueue); - - connect(m_outputDevice0, &OutputDevice::colorCurvesChanged, this, [=]() { - qDebug() << m_outputDevice0->model() << " " << m_outputDevice0->uuid(); - if (g_setBrightness) { - this->setColorCurves(m_outputDevice0, g_brightness); - } else if (g_setTemperature) { - this->setColorCurves(m_outputDevice0, g_temperature); - } - - }); - } - if (!m_outputDevice1 && (outputDevice != m_outputDevice0)) { - m_outputDevice1 = outputDevice; - connect(m_outputDevice1, &OutputDevice::changed, this, [=](){ - //qDebug() << m_outputDevice1->model() << " " << m_outputDevice1->uuid(); - }); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createOutputDevice"; - m_outputDevice1->setEventQueue(m_eventQueue); - - connect(m_outputDevice1, &OutputDevice::colorCurvesChanged, this, [=]() { - qDebug() << m_outputDevice1->model() << " " << m_outputDevice1->uuid(); - if (g_setBrightness) { - this->setColorCurves(m_outputDevice1, g_brightness); - } else if (g_setTemperature) { - this->setColorCurves(m_outputDevice1, g_temperature); - } - }); - } - } - } - ); - - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -int main(int argc, char **argv) -{ - if (argc != 3) { - qDebug() << "Invalid argument count"; - return -1; - } - for (int i = 1; i < argc; i++) { - if (!strcmp("-brightness", argv[i]) || !strcmp("--brightness", argv[i])) { - g_setBrightness = true; - sscanf(argv[i+1], "%f", &g_brightness); - break; - } else if (!strcmp("-temperature", argv[i]) || !strcmp("--temperature", argv[i])) { - g_setTemperature = true; - sscanf(argv[i+1], "%d", &g_temperature); - break; - } - } - - QGuiApplication app(argc, argv); - GammaTest client; - client.init(); - - return app.exec(); -} -#include "gammatest.moc" - diff -Nru dwayland-5.57.0.23/tests/globalpropertytest.cpp dwayland-5.57.0.24+really5.24.3/tests/globalpropertytest.cpp --- dwayland-5.57.0.23/tests/globalpropertytest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/globalpropertytest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -0,0 +1,196 @@ +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../src/client/compositor.h" +#include "../src/client/connection_thread.h" +#include "../src/client/event_queue.h" +#include "../src/client/pointer.h" +#include "../src/client/registry.h" +#include "../src/client/seat.h" +#include "../src/client/shadow.h" +#include "../src/client/shell.h" +#include "../src/client/shm_pool.h" +#include "../src/client/surface.h" +#include "../src/client/server_decoration.h" +#include "../src/client/xdgshell.h" +#include "../src/client/ddeshell.h" +#include "../src/client/globalproperty.h" +// Qt +#include +#include +#include +#include +#include +#include +#include + +using namespace KWayland::Client; + +class GlobalPropertyTest : public QObject +{ + Q_OBJECT +public: + explicit GlobalPropertyTest(QObject *parent = nullptr); + virtual ~GlobalPropertyTest(); + + void init(); + +private: + void setupRegistry(Registry *registry); + void render(); + QThread *m_connectionThread; + ConnectionThread *m_connectionThreadObject; + EventQueue *m_eventQueue = nullptr; + Compositor *m_compositor = nullptr; + ShmPool *m_shm = nullptr; + Surface *m_surface = nullptr; + XdgShell *m_xdgShell = nullptr; + XdgShellSurface *m_xdgShellSurface = nullptr; + Surface *m_popupSurface = nullptr; + XdgShellPopup *m_xdgShellPopup = nullptr; + GlobalProperty *m_ddeGlobalProperty = nullptr; + + DDEShell *m_ddeShell = nullptr; + DDEShellSurface *m_ddeShellSurface = nullptr; + KWayland::Client::ServerSideDecorationManager *m_decoration = nullptr; +}; + +GlobalPropertyTest::GlobalPropertyTest(QObject *parent) + : QObject(parent) + , m_connectionThread(new QThread(this)) + , m_connectionThreadObject(new ConnectionThread()) +{ +} + +GlobalPropertyTest::~GlobalPropertyTest() +{ + m_connectionThread->quit(); + m_connectionThread->wait(); + m_connectionThreadObject->deleteLater(); +} + +void GlobalPropertyTest::init() +{ + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, + [this] { + m_eventQueue = new EventQueue(this); + m_eventQueue->setup(m_connectionThreadObject); + + Registry *registry = new Registry(this); + setupRegistry(registry); + }, + Qt::QueuedConnection); + m_connectionThreadObject->moveToThread(m_connectionThread); + m_connectionThread->start(); + + m_connectionThreadObject->initConnection(); +} + +void GlobalPropertyTest::setupRegistry(Registry *registry) +{ + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::xdgShellStableAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_xdgShell = registry->createXdgShell(name, version, this); + m_xdgShell->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::ddeShellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_ddeShell = registry->createDDEShell(name, version, this); + m_ddeShell->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::ddeGlobalPropertyAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_ddeGlobalProperty = registry->createGlobalProperty(name, version, this); + m_ddeGlobalProperty->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::serverSideDecorationManagerAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_decoration = registry->createServerSideDecorationManager(name, version, this); + m_decoration->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_xdgShell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_xdgShellSurface = m_xdgShell->createSurface(m_surface, this); + m_ddeShellSurface = m_ddeShell->createShellSurface(m_surface, this); + auto parentDeco = m_decoration->create(m_surface, this); + Q_ASSERT(m_xdgShellSurface); + connect(m_xdgShellSurface, + &XdgShellSurface::configureRequested, + this, + [this](const QSize &size, KWayland::Client::XdgShellSurface::States states, int serial) { + Q_UNUSED(size); + Q_UNUSED(states); + m_xdgShellSurface->ackConfigure(serial); + render(); + }); + + m_xdgShellSurface->setTitle(QStringLiteral("Test Window")); + + m_surface->commit(); + + QJsonDocument doc; + QJsonObject obj; + QJsonArray arr; + unsigned char scissor_point[] = {0x0, 0x0, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x40, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x66, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x40, 0x67, 0xfe, 0x1d, 0xb3, 0x37, 0x8f, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x40, 0x69, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x20, 0x1e, 0x24, 0xcc, 0x87, 0xf, 0x7b, 0x0, 0x0, 0x0, 0x3, 0x40, 0x69, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x69, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x40, 0x69, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x5e, 0x7c, 0x3b, 0x66, 0x6f, 0x1e, 0x11, 0x0, 0x0, 0x0, 0x3, 0x40, 0x67, 0xfe, 0x1d, 0xb3, 0x37, 0x8f, 0x8, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x40, 0x66, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x5b, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x61, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x56, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x40, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x40, 0x20, 0x1e, 0x24, 0xcc, 0x87, 0xf, 0x7b, 0x40, 0x60, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x5e, 0x7c, 0x3b, 0x66, 0x6f, 0x1e, 0x11, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x20, 0x1e, 0x24, 0xcc, 0x87, 0xf, 0x7b, 0x0, 0x0, 0x0, 0x3, 0x40, 0x20, 0x1e, 0x24, 0xcc, 0x87, 0xf, 0x7b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x40, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + QByteArray scissor_array; + scissor_array.resize(sizeof(scissor_point) / sizeof(unsigned char)); + for (unsigned int i = 0; i < scissor_array.size(); i++) { + scissor_array[i] = scissor_point[i]; + arr.append(QJsonValue((char)scissor_point[i])); + } + obj.insert("clippath", arr); + obj.insert("direction", 1); + obj.insert("blurRegion", 1); + obj.insert("unstandardwindow", 1); + obj.insert("shadow", 1); + doc.setObject(obj); + QByteArray jsonByteArr = doc.toJson(QJsonDocument::JsonFormat::Compact); + // QString jsonStr = QString::fromUtf8(jsonByteArr); + m_ddeGlobalProperty->setProperty("window", "decorate", m_surface, 1, jsonByteArr.constData()); + }); + + registry->setEventQueue(m_eventQueue); + registry->create(m_connectionThreadObject); + registry->setup(); +} + +void GlobalPropertyTest::render() +{ + const QSize &size = m_xdgShellSurface->size().isValid() ? m_xdgShellSurface->size() : QSize(500, 500); + auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); + buffer->setUsed(true); + QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied); + image.fill(QColor(255, 255, 255, 255)); + // draw a red rectangle indicating the anchor of the top level + QPainter painter(&image); + painter.setBrush(Qt::red); + painter.setPen(Qt::black); + painter.drawRect(10, 10, 180, 100); + + m_surface->attachBuffer(*buffer); + m_surface->damage(QRect(QPoint(0, 0), size)); + m_surface->commit(Surface::CommitFlag::None); + buffer->setUsed(false); +} + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + GlobalPropertyTest client; + client.init(); + + return app.exec(); +} + +#include "globalpropertytest.moc" diff -Nru dwayland-5.57.0.23/tests/grabtest.cpp dwayland-5.57.0.24+really5.24.3/tests/grabtest.cpp --- dwayland-5.57.0.23/tests/grabtest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/grabtest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,378 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/client/compositor.h" -#include "../src/client/connection_thread.h" -#include "../src/client/datadevice.h" -#include "../src/client/datadevicemanager.h" -#include "../src/client/dataoffer.h" -#include "../src/client/event_queue.h" -#include "../src/client/keyboard.h" -#include "../src/client/plasmashell.h" -#include "../src/client/plasmawindowmanagement.h" -#include "../src/client/pointer.h" -#include "../src/client/registry.h" -#include "../src/client/seat.h" -#include "../src/client/shell.h" -#include "../src/client/shm_pool.h" -#include "../src/client/surface.h" -#include "../src/client/xwayland_keyboard_grab_v1.h" - - -// Qt -#include -#include -#include -#include -#include -#include -// system -#include - -#include - -using namespace KWayland::Client; - -class GrabTest : public QObject -{ - Q_OBJECT -public: - explicit GrabTest(QObject *parent = nullptr); - virtual ~GrabTest(); - - void init(); - -private: - void setupRegistry(Registry *registry); - void render(); - void showTooltip(const QPointF &pos); - void hideTooltip(); - void moveTooltip(const QPointF &pos); - QThread *m_connectionThread; - ConnectionThread *m_connectionThreadObject; - EventQueue *m_eventQueue = nullptr; - Compositor *m_compositor = nullptr; - Seat *m_seat = nullptr; - ZWPXwaylandKeyboardGrabManagerV1 *m_grabManager = nullptr; - ZWPXwaylandKeyboardGrabV1 *m_grab = nullptr; - Shell *m_shell = nullptr; - ShellSurface *m_shellSurface = nullptr; - ShmPool *m_shm = nullptr; - Surface *m_surface = nullptr; - PlasmaShell *m_plasmaShell = nullptr; - PlasmaShellSurface *m_plasmaShellSurface = nullptr; - PlasmaWindowManagement *m_windowManagement = nullptr; - struct { - Surface *surface = nullptr; - ShellSurface *shellSurface = nullptr; - PlasmaShellSurface *plasmaSurface = nullptr; - bool visible = false; - } m_tooltip; -}; - -GrabTest::GrabTest(QObject *parent) - : QObject(parent) - , m_connectionThread(new QThread(this)) - , m_connectionThreadObject(new ConnectionThread()) -{ -} - -GrabTest::~GrabTest() -{ - m_connectionThread->quit(); - m_connectionThread->wait(); - m_connectionThreadObject->deleteLater(); -} - -void GrabTest::init() -{ - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - - m_connectionThreadObject->initConnection(); -} - -void GrabTest::showTooltip(const QPointF &pos) -{ - if (!m_tooltip.surface) { - m_tooltip.surface = m_compositor->createSurface(this); - m_tooltip.shellSurface = m_shell->createSurface(m_tooltip.surface, this); - if (m_plasmaShell) { - m_tooltip.plasmaSurface = m_plasmaShell->createSurface(m_tooltip.surface, this); - } - } - m_tooltip.shellSurface->setTransient(m_surface, pos.toPoint()); - - if (!m_tooltip.visible) { - const QSize size(100, 50); - auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); - buffer->setUsed(true); - QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::red); - - m_tooltip.surface->attachBuffer(*buffer); - m_tooltip.surface->damage(QRect(QPoint(0, 0), size)); - m_tooltip.surface->commit(Surface::CommitFlag::None); - m_tooltip.visible = true; - } -} - -void GrabTest::hideTooltip() -{ - if (!m_tooltip.visible) { - return; - } - m_tooltip.surface->attachBuffer(Buffer::Ptr()); - m_tooltip.surface->commit(Surface::CommitFlag::None); - m_tooltip.visible = false; -} - -void GrabTest::moveTooltip(const QPointF &pos) -{ - if (m_tooltip.plasmaSurface) { - m_tooltip.plasmaSurface->setPosition(pos.toPoint()); - } -} - -void GrabTest::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_seat = registry->createSeat(name, version, this); - connect(m_seat, &Seat::hasPointerChanged, this, - [this] (bool has) { - if (!has) { - return; - } - auto p = m_seat->createPointer(this); - connect(p, &Pointer::buttonStateChanged, this, - [this] (quint32 serial, quint32 time, quint32 button, KWayland::Client::Pointer::ButtonState state) { - Q_UNUSED(time) - Q_UNUSED(serial) - if (!m_windowManagement) { - return; - } - if (state == Pointer::ButtonState::Released) { - return; - } - if (button == BTN_LEFT) { - m_windowManagement->showDesktop(); - } else if (button == BTN_RIGHT) { - m_windowManagement->hideDesktop(); - } - } - ); - connect(p, &Pointer::entered, this, - [this, p] (quint32 serial, const QPointF &relativeToSurface) { - Q_UNUSED(serial) - if (p->enteredSurface() == m_surface) { - showTooltip(relativeToSurface); - } - } - ); - connect(p, &Pointer::motion, this, - [this, p] (const QPointF &relativeToSurface) { - if (p->enteredSurface() == m_surface) { - moveTooltip(relativeToSurface); - } - } - ); - connect(p, &Pointer::left, this, - [this] { - // hideTooltip(); - } - ); - } - ); - } - ); - connect(registry, &Registry::xwaylandKeyboardGrabV1Announced, this, - [this, registry](quint32 name, quint32 version) { - m_grabManager = registry->createZWPXwaylandKeyboardGrabManagerV1(name, version, this); - } - ); - connect(registry, &Registry::plasmaShellAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_plasmaShell = registry->createPlasmaShell(name, version, this); - } - ); - connect(registry, &Registry::plasmaWindowManagementAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_windowManagement = registry->createPlasmaWindowManagement(name, version, this); - connect(m_windowManagement, &PlasmaWindowManagement::showingDesktopChanged, this, - [] (bool set) { - qDebug() << "Showing desktop changed, new state: " << set; - } - ); - connect(m_windowManagement, &PlasmaWindowManagement::windowCreated, this, - [this] (PlasmaWindow *w) { - connect(w, &PlasmaWindow::titleChanged, this, - [w] { - qDebug() << "Window title changed to: " << w->title(); - } - ); - connect(w, &PlasmaWindow::activeChanged, this, - [w] { - qDebug() << "Window active changed: " << w->isActive(); - } - ); - connect(w, &PlasmaWindow::maximizedChanged, this, - [w] { - qDebug() << "Window maximized changed: " << w->isMaximized(); - } - ); - connect(w, &PlasmaWindow::maximizedChanged, this, - [w] { - qDebug() << "Window minimized changed: " << w->isMinimized(); - } - ); - connect(w, &PlasmaWindow::keepAboveChanged, this, - [w] { - qDebug() << "Window keep above changed: " << w->isKeepAbove(); - } - ); - connect(w, &PlasmaWindow::keepBelowChanged, this, - [w] { - qDebug() << "Window keep below changed: " << w->isKeepBelow(); - } - ); - connect(w, &PlasmaWindow::onAllDesktopsChanged, this, - [w] { - qDebug() << "Window on all desktops changed: " << w->isOnAllDesktops(); - } - ); - connect(w, &PlasmaWindow::fullscreenChanged, this, - [w] { - qDebug() << "Window full screen changed: " << w->isFullscreen(); - } - ); - connect(w, &PlasmaWindow::demandsAttentionChanged, this, - [w] { - qDebug() << "Window demands attention changed: " << w->isDemandingAttention(); - } - ); - connect(w, &PlasmaWindow::closeableChanged, this, - [w] { - qDebug() << "Window is closeable changed: " << w->isCloseable(); - } - ); - connect(w, &PlasmaWindow::minimizeableChanged, this, - [w] { - qDebug() << "Window is minimizeable changed: " << w->isMinimizeable(); - } - ); - connect(w, &PlasmaWindow::maximizeableChanged, this, - [w] { - qDebug() << "Window is maximizeable changed: " << w->isMaximizeable(); - } - ); - connect(w, &PlasmaWindow::fullscreenableChanged, this, - [w] { - qDebug() << "Window is fullscreenable changed: " << w->isFullscreenable(); - } - ); - connect(w, &PlasmaWindow::iconChanged, this, - [w] { - qDebug() << "Window icon changed: " << w->icon().name(); - } - ); - } - ); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_seat); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setToplevel(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &GrabTest::render); - if (m_plasmaShell) { - m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); - m_plasmaShellSurface->setPosition(QPoint(0, 0)); - m_plasmaShellSurface->setRole(PlasmaShellSurface::Role::Panel); - } - if (m_grabManager) { - qDebug()<<"grabKeyBoard..."; - m_grab = m_grabManager->grabKeyBoard(m_surface,m_seat,this); - - } - render(); - } - ); - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -void GrabTest::render() -{ - const QSize &size = m_shellSurface->size().isValid() ? m_shellSurface->size() : QSize(1000, 500); - auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); - buffer->setUsed(true); - QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::blue); - - m_surface->attachBuffer(*buffer); - m_surface->damage(QRect(QPoint(0, 0), size)); - m_surface->commit(Surface::CommitFlag::None); - buffer->setUsed(false); -} - -int main(int argc, char **argv) -{ - QGuiApplication app(argc, argv); - GrabTest client; - client.init(); - - return app.exec(); -} - -#include "grabtest.moc" - diff -Nru dwayland-5.57.0.23/tests/paneltest.cpp dwayland-5.57.0.24+really5.24.3/tests/paneltest.cpp --- dwayland-5.57.0.23/tests/paneltest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/paneltest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/datadevice.h" @@ -32,13 +18,10 @@ #include "../src/client/shell.h" #include "../src/client/shm_pool.h" #include "../src/client/surface.h" -#include "../src/client/ddeseat.h" - - // Qt -#include #include #include +#include #include #include #include @@ -69,9 +52,6 @@ EventQueue *m_eventQueue = nullptr; Compositor *m_compositor = nullptr; Seat *m_seat = nullptr; - DDESeat *m_ddeSeat = nullptr; - DDEPointer *m_ddePointer = nullptr; - DDETouch *m_ddeTouch = nullptr; Shell *m_shell = nullptr; ShellSurface *m_shellSurface = nullptr; ShmPool *m_shm = nullptr; @@ -103,7 +83,10 @@ void PanelTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -111,8 +94,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -157,243 +139,130 @@ void PanelTest::moveTooltip(const QPointF &pos) { if (m_tooltip.plasmaSurface) { - m_tooltip.plasmaSurface->setPosition(pos.toPoint()); + m_tooltip.plasmaSurface->setPosition(QPoint(10, 0) + pos.toPoint()); } } void PanelTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_seat = registry->createSeat(name, version, this); - connect(m_seat, &Seat::hasPointerChanged, this, - [this] (bool has) { - if (!has) { - return; - } - auto p = m_seat->createPointer(this); - connect(p, &Pointer::buttonStateChanged, this, - [this] (quint32 serial, quint32 time, quint32 button, KWayland::Client::Pointer::ButtonState state) { - Q_UNUSED(time) - Q_UNUSED(serial) - if (!m_windowManagement) { - return; - } - if (state == Pointer::ButtonState::Released) { - return; - } - if (button == BTN_LEFT) { - m_windowManagement->showDesktop(); - } else if (button == BTN_RIGHT) { - m_windowManagement->hideDesktop(); - } - } - ); - connect(p, &Pointer::entered, this, - [this, p] (quint32 serial, const QPointF &relativeToSurface) { - Q_UNUSED(serial) - if (p->enteredSurface() == m_surface) { - showTooltip(relativeToSurface); - } - } - ); - connect(p, &Pointer::motion, this, - [this, p] (const QPointF &relativeToSurface) { - if (p->enteredSurface() == m_surface) { - moveTooltip(relativeToSurface); - } - } - ); - connect(p, &Pointer::left, this, - [this] { - // hideTooltip(); - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_seat = registry->createSeat(name, version, this); + connect(m_seat, &Seat::hasPointerChanged, this, [this](bool has) { + if (!has) { + return; + } + auto p = m_seat->createPointer(this); + connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, KWayland::Client::Pointer::ButtonState state) { + Q_UNUSED(time) + Q_UNUSED(serial) + if (!m_windowManagement) { + return; } - ); - } - ); -connect(registry, &Registry::ddeSeatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_ddeSeat = registry->createDDESeat(name, version, this); - } - ); - connect(registry, &Registry::plasmaShellAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_plasmaShell = registry->createPlasmaShell(name, version, this); - } - ); - connect(registry, &Registry::plasmaWindowManagementAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_windowManagement = registry->createPlasmaWindowManagement(name, version, this); - connect(m_windowManagement, &PlasmaWindowManagement::showingDesktopChanged, this, - [] (bool set) { - qDebug() << "Showing desktop changed, new state: " << set; + if (state == Pointer::ButtonState::Released) { + return; } - ); - connect(m_windowManagement, &PlasmaWindowManagement::windowCreated, this, - [this] (PlasmaWindow *w) { - connect(w, &PlasmaWindow::titleChanged, this, - [w] { - qDebug() << "Window title changed to: " << w->title(); - } - ); - connect(w, &PlasmaWindow::activeChanged, this, - [w] { - qDebug() << "Window active changed: " << w->isActive(); - } - ); - connect(w, &PlasmaWindow::maximizedChanged, this, - [w] { - qDebug() << "Window maximized changed: " << w->isMaximized(); - } - ); - connect(w, &PlasmaWindow::maximizedChanged, this, - [w] { - qDebug() << "Window minimized changed: " << w->isMinimized(); - } - ); - connect(w, &PlasmaWindow::keepAboveChanged, this, - [w] { - qDebug() << "Window keep above changed: " << w->isKeepAbove(); - } - ); - connect(w, &PlasmaWindow::keepBelowChanged, this, - [w] { - qDebug() << "Window keep below changed: " << w->isKeepBelow(); - } - ); - connect(w, &PlasmaWindow::onAllDesktopsChanged, this, - [w] { - qDebug() << "Window on all desktops changed: " << w->isOnAllDesktops(); - } - ); - connect(w, &PlasmaWindow::fullscreenChanged, this, - [w] { - qDebug() << "Window full screen changed: " << w->isFullscreen(); - } - ); - connect(w, &PlasmaWindow::demandsAttentionChanged, this, - [w] { - qDebug() << "Window demands attention changed: " << w->isDemandingAttention(); - } - ); - connect(w, &PlasmaWindow::closeableChanged, this, - [w] { - qDebug() << "Window is closeable changed: " << w->isCloseable(); - } - ); - connect(w, &PlasmaWindow::minimizeableChanged, this, - [w] { - qDebug() << "Window is minimizeable changed: " << w->isMinimizeable(); - } - ); - connect(w, &PlasmaWindow::maximizeableChanged, this, - [w] { - qDebug() << "Window is maximizeable changed: " << w->isMaximizeable(); - } - ); - connect(w, &PlasmaWindow::fullscreenableChanged, this, - [w] { - qDebug() << "Window is fullscreenable changed: " << w->isFullscreenable(); - } - ); - connect(w, &PlasmaWindow::iconChanged, this, - [w] { - qDebug() << "Window icon changed: " << w->icon().name(); - } - ); + if (button == BTN_LEFT) { + m_windowManagement->showDesktop(); + } else if (button == BTN_RIGHT) { + m_windowManagement->hideDesktop(); } - ); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_seat); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setToplevel(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PanelTest::render); - if (m_plasmaShell) { - m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); - m_plasmaShellSurface->setPosition(QPoint(0, 0)); - m_plasmaShellSurface->setRole(PlasmaShellSurface::Role::Panel); - } - if (m_ddeSeat) { - m_ddePointer = m_ddeSeat->createDDePointer(this); - // m_ddePointer->getMotion(); - // // 注意,roudntrip/dispatch两行非常重要,getMotion是客户端发送一个request给kwin,请求kwin返回当前全局坐标 - // // kwin收到改请求后,通过一个motioncallback发送一个event给客户端,带的参数就是全局坐标 - // // 客户端和kwin服务端是异步通信 - // // 如何保证客户端getGlobalPointerPos接口拿到的全局坐标不是上一次的全局坐标,而是kwin接收到getMotion请求后,回过来的最新的全局坐标 - // // wayland里面是通过roudntrip/dispatch机制来保证的,所有必须加上roundtrip/dispatch - // m_connectionThreadObject->roundtrip(); - // m_eventQueue->dispatch(); - - QPointF cursorPos = m_ddePointer->getGlobalPointerPos(); - qDebug() << "cursorPos" << cursorPos; - connect(m_ddePointer, &DDEPointer::buttonStateChanged, this, - [this] (const QPointF &pos, quint32 button, KWayland::Client::DDEPointer::ButtonState state) { - if (state == DDEPointer::ButtonState::Released) { - qDebug() << "button Released" << pos; - return; - } - if (button == BTN_LEFT) { - qDebug() << "BTN_LEFT Pressed" << pos; - hideTooltip(); - } else if (button == BTN_RIGHT) { - qDebug() << "BTN_RIGHT Pressed" << pos; - } - } - ); - connect(m_ddePointer, &DDEPointer::motion, this, - [this] (const QPointF &pos) { - qDebug() << "motion" << pos; - QPointF relativePos = QPoint((pos.x() / 2160) * 1000.0, (pos.y() / 1440) * 500.0); - moveTooltip(relativePos); - } - ); - - m_ddeTouch = m_ddeSeat->createDDETouch(this); - connect(m_ddeTouch, &DDETouch::touchDown, this, - [this] (int32_t id, const QPointF &pos) { - qDebug() << "ddeseat touch down" << id << pos; - } - ); - connect(m_ddeTouch, &DDETouch::touchMotion, this, - [this] (int32_t id, const QPointF &pos) { - qDebug() << "ddeseat touch motion" << id << pos; - } - ); - connect(m_ddeTouch, &DDETouch::touchUp, this, - [this] (int32_t id) { - qDebug() << "ddeseat touch up" << id; - } - ); - } - render(); + }); + connect(p, &Pointer::entered, this, [this, p](quint32 serial, const QPointF &relativeToSurface) { + Q_UNUSED(serial) + if (p->enteredSurface() == m_surface) { + showTooltip(relativeToSurface); + } + }); + connect(p, &Pointer::motion, this, [this, p](const QPointF &relativeToSurface) { + if (p->enteredSurface() == m_surface) { + moveTooltip(relativeToSurface); + } + }); + connect(p, &Pointer::left, this, [this] { + hideTooltip(); + }); + }); + }); + connect(registry, &Registry::plasmaShellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_plasmaShell = registry->createPlasmaShell(name, version, this); + }); + connect(registry, &Registry::plasmaWindowManagementAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_windowManagement = registry->createPlasmaWindowManagement(name, version, this); + connect(m_windowManagement, &PlasmaWindowManagement::showingDesktopChanged, this, [](bool set) { + qDebug() << "Showing desktop changed, new state: " << set; + }); + connect(m_windowManagement, &PlasmaWindowManagement::windowCreated, this, [this](PlasmaWindow *w) { + connect(w, &PlasmaWindow::titleChanged, this, [w] { + qDebug() << "Window title changed to: " << w->title(); + }); + connect(w, &PlasmaWindow::activeChanged, this, [w] { + qDebug() << "Window active changed: " << w->isActive(); + }); + connect(w, &PlasmaWindow::maximizedChanged, this, [w] { + qDebug() << "Window maximized changed: " << w->isMaximized(); + }); + connect(w, &PlasmaWindow::maximizedChanged, this, [w] { + qDebug() << "Window minimized changed: " << w->isMinimized(); + }); + connect(w, &PlasmaWindow::keepAboveChanged, this, [w] { + qDebug() << "Window keep above changed: " << w->isKeepAbove(); + }); + connect(w, &PlasmaWindow::keepBelowChanged, this, [w] { + qDebug() << "Window keep below changed: " << w->isKeepBelow(); + }); + connect(w, &PlasmaWindow::onAllDesktopsChanged, this, [w] { + qDebug() << "Window on all desktops changed: " << w->isOnAllDesktops(); + }); + connect(w, &PlasmaWindow::fullscreenChanged, this, [w] { + qDebug() << "Window full screen changed: " << w->isFullscreen(); + }); + connect(w, &PlasmaWindow::demandsAttentionChanged, this, [w] { + qDebug() << "Window demands attention changed: " << w->isDemandingAttention(); + }); + connect(w, &PlasmaWindow::closeableChanged, this, [w] { + qDebug() << "Window is closeable changed: " << w->isCloseable(); + }); + connect(w, &PlasmaWindow::minimizeableChanged, this, [w] { + qDebug() << "Window is minimizeable changed: " << w->isMinimizeable(); + }); + connect(w, &PlasmaWindow::maximizeableChanged, this, [w] { + qDebug() << "Window is maximizeable changed: " << w->isMaximizeable(); + }); + connect(w, &PlasmaWindow::fullscreenableChanged, this, [w] { + qDebug() << "Window is fullscreenable changed: " << w->isFullscreenable(); + }); + connect(w, &PlasmaWindow::iconChanged, this, [w] { + qDebug() << "Window icon changed: " << w->icon().name(); + }); + }); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_seat); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setToplevel(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PanelTest::render); + if (m_plasmaShell) { + m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); + m_plasmaShellSurface->setPosition(QPoint(10, 0)); + m_plasmaShellSurface->setRole(PlasmaShellSurface::Role::Panel); } - ); + render(); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); @@ -401,7 +270,7 @@ void PanelTest::render() { - const QSize &size = m_shellSurface->size().isValid() ? m_shellSurface->size() : QSize(1000, 500); + const QSize &size = m_shellSurface->size().isValid() ? m_shellSurface->size() : QSize(300, 20); auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); buffer->setUsed(true); QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied); @@ -423,4 +292,3 @@ } #include "paneltest.moc" - diff -Nru dwayland-5.57.0.23/tests/pasteclient.cpp dwayland-5.57.0.24+really5.24.3/tests/pasteclient.cpp --- dwayland-5.57.0.23/tests/pasteclient.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/pasteclient.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/datadevice.h" @@ -84,7 +70,10 @@ void PasteClient::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -92,8 +81,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -102,80 +90,63 @@ void PasteClient::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_seat = registry->createSeat(name, version, this); - } - ); - connect(registry, &Registry::dataDeviceManagerAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_dataDeviceManager = registry->createDataDeviceManager(name, version, this); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_dataDeviceManager); - Q_ASSERT(m_seat); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setFullscreen(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PasteClient::render); - - m_dataDevice = m_dataDeviceManager->getDataDevice(m_seat, this); - connect(m_dataDevice, &DataDevice::selectionOffered, this, - [this] { - auto dataOffer = m_dataDevice->offeredSelection(); - if (!dataOffer) { - return; - } - const auto &mimeTypes = dataOffer->offeredMimeTypes(); - auto it = std::find_if(mimeTypes.begin(), mimeTypes.end(), - [](const QMimeType &type) { - return type.inherits(QStringLiteral("text/plain")); - }); - if (it == mimeTypes.end()) { - return; - } - int pipeFds[2]; - if (pipe(pipeFds) != 0){ - return; - } - dataOffer->receive((*it).name(), pipeFds[1]); - close(pipeFds[1]); - QtConcurrent::run( - [pipeFds] { - QFile readPipe; - if (readPipe.open(pipeFds[0], QIODevice::ReadOnly)) { - qDebug() << "Pasted: " << readPipe.readLine(); - } - close(pipeFds[0]); - QCoreApplication::quit(); - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_seat = registry->createSeat(name, version, this); + }); + connect(registry, &Registry::dataDeviceManagerAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_dataDeviceManager = registry->createDataDeviceManager(name, version, this); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_dataDeviceManager); + Q_ASSERT(m_seat); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setFullscreen(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PasteClient::render); + + m_dataDevice = m_dataDeviceManager->getDataDevice(m_seat, this); + connect(m_dataDevice, &DataDevice::selectionOffered, this, [this] { + auto dataOffer = m_dataDevice->offeredSelection(); + if (!dataOffer) { + return; + } + const auto &mimeTypes = dataOffer->offeredMimeTypes(); + auto it = std::find_if(mimeTypes.constBegin(), mimeTypes.constEnd(), [](const QMimeType &type) { + return type.inherits(QStringLiteral("text/plain")); + }); + if (it == mimeTypes.constEnd()) { + return; + } + int pipeFds[2]; + if (pipe(pipeFds) != 0) { + return; + } + dataOffer->receive((*it).name(), pipeFds[1]); + close(pipeFds[1]); + QtConcurrent::run([pipeFds] { + QFile readPipe; + if (readPipe.open(pipeFds[0], QIODevice::ReadOnly)) { + qDebug() << "Pasted: " << readPipe.readLine(); } - ); - } - ); + close(pipeFds[0]); + QCoreApplication::quit(); + }); + }); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); diff -Nru dwayland-5.57.0.23/tests/plasmasurfacetest.cpp dwayland-5.57.0.24+really5.24.3/tests/plasmasurfacetest.cpp --- dwayland-5.57.0.23/tests/plasmasurfacetest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/plasmasurfacetest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,41 +1,22 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/event_queue.h" +#include "../src/client/plasmashell.h" #include "../src/client/registry.h" #include "../src/client/shell.h" #include "../src/client/shm_pool.h" #include "../src/client/surface.h" -#include "../src/client/plasmashell.h" -#include "../src/client/server_decoration.h" -#include "../src/client/xdgdecoration.h" -#include "../src/client/ddeshell.h" // Qt #include #include #include #include -#include - using namespace KWayland::Client; class PlasmaSurfaceTest : public QObject @@ -47,14 +28,17 @@ void init(); - void setRole(PlasmaShellSurface::Role role) { + void setRole(PlasmaShellSurface::Role role) + { m_role = role; } - void setSkipTaskbar(bool set) { + void setSkipTaskbar(bool set) + { m_skipTaskbar = set; } - void setSkipSwitcher(bool set) { + void setSkipSwitcher(bool set) + { m_skipSwitcher = set; } @@ -72,15 +56,8 @@ PlasmaShell *m_plasmaShell = nullptr; PlasmaShellSurface *m_plasmaShellSurface = nullptr; PlasmaShellSurface::Role m_role = PlasmaShellSurface::Role::Normal; - - DDEShell *m_ddeShell = nullptr; - DDEShellSurface *m_ddeShellSurface = nullptr; - bool m_skipTaskbar = false; bool m_skipSwitcher = false; - - KWayland::Client::ServerSideDecorationManager *m_decoration = nullptr; - KWayland::Client::XdgDecorationManager *m_xdgDecoration = nullptr; }; PlasmaSurfaceTest::PlasmaSurfaceTest(QObject *parent) @@ -97,10 +74,12 @@ m_connectionThreadObject->deleteLater(); } -static int count = 0; void PlasmaSurfaceTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -108,8 +87,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -118,148 +96,37 @@ void PlasmaSurfaceTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::plasmaShellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_plasmaShell = registry->createPlasmaShell(name, version, this); - m_plasmaShell->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::ddeShellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_ddeShell = registry->createDDEShell(name, version, this); - m_ddeShell->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::serverSideDecorationManagerAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_decoration = registry->createServerSideDecorationManager(name, version, this); - m_decoration->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::xdgDecorationAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_xdgDecoration = registry->createXdgDecorationManager(name, version, this); - m_xdgDecoration->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - Q_ASSERT(m_plasmaShell); - Q_ASSERT(m_ddeShell); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setToplevel(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PlasmaSurfaceTest::render); - m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); - m_plasmaShellSurface->setPosition(QPoint(300, 200)); - m_ddeShellSurface = m_ddeShell->createShellSurface(m_surface, this); - connect(m_ddeShellSurface, &DDEShellSurface::geometryChanged, this, - [this] (const QRect &geom) { - qDebug() << "get geom" << geom; - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::activeChanged, this, - [this] { - qDebug() << "Window active changed: " << m_ddeShellSurface->isActive(); - if (count++ > 5 && m_ddeShellSurface->isActive()) { - m_ddeShellSurface->requestKeepAbove(false); - } - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::maximizedChanged, this, - [this] { - qDebug() << "Window maximized changed: " << m_ddeShellSurface->isMaximized(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::maximizedChanged, this, - [this] { - qDebug() << "Window minimized changed: " << m_ddeShellSurface->isMinimized(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::keepAboveChanged, this, - [this] { - qDebug() << "Window keep above changed: " << m_ddeShellSurface->isKeepAbove(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::keepBelowChanged, this, - [this] { - qDebug() << "Window keep below changed: " << m_ddeShellSurface->isKeepBelow(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::fullscreenChanged, this, - [this] { - qDebug() << "Window full screen changed: " << m_ddeShellSurface->isFullscreen(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::closeableChanged, this, - [this] { - qDebug() << "Window is closeable changed: " << m_ddeShellSurface->isCloseable(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::minimizeableChanged, this, - [this] { - qDebug() << "Window is minimizeable changed: " << m_ddeShellSurface->isMinimizeable(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::maximizeableChanged, this, - [this] { - qDebug() << "Window is maximizeable changed: " << m_ddeShellSurface->isMaximizeable(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::fullscreenableChanged, this, - [this] { - qDebug() << "Window is fullscreenable changed: " << m_ddeShellSurface->isFullscreenable(); - } - ); - connect(m_ddeShellSurface, &DDEShellSurface::onAllDesktopsChanged, this, - [this] { - qDebug() << "Window is onAllDesktops changed: " << m_ddeShellSurface->isOnAllDesktops(); - } - ); - Q_ASSERT(m_plasmaShellSurface); - m_plasmaShellSurface->setSkipTaskbar(m_skipTaskbar); - m_plasmaShellSurface->setSkipSwitcher(m_skipSwitcher); - m_plasmaShellSurface->setRole(m_role); - - m_ddeShellSurface->requestKeepAbove(true); - m_ddeShellSurface->requestMinizeable(false); - m_ddeShellSurface->requestMaximizeable(false); - m_ddeShellSurface->requestResizable(false); - m_ddeShellSurface->requestOnAllDesktops(true); - - // //创建标题栏server decoration - auto parentDeco = m_decoration->create(m_surface, this); - //设置csd/ssd - parentDeco->requestMode(KWayland::Client::ServerSideDecoration::Mode::Server); - - //创建标题栏server decoration - // auto xdgDecoration = m_xdgDecoration->getToplevelDecoration(m_xdgshellSurface, this); - // //设置csd/ssd - // xdgDecoration->setMode(KWayland::Client::XdgDecoration::Mode::ServerSide); - - render(); - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::plasmaShellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_plasmaShell = registry->createPlasmaShell(name, version, this); + m_plasmaShell->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + Q_ASSERT(m_plasmaShell); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setToplevel(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PlasmaSurfaceTest::render); + m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); + Q_ASSERT(m_plasmaShellSurface); + m_plasmaShellSurface->setSkipTaskbar(m_skipTaskbar); + m_plasmaShellSurface->setSkipSwitcher(m_skipSwitcher); + m_plasmaShellSurface->setRole(m_role); + render(); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); @@ -286,6 +153,8 @@ parser.addHelpOption(); QCommandLineOption notificationOption(QStringLiteral("notification")); parser.addOption(notificationOption); + QCommandLineOption criticalNotificationOption(QStringLiteral("criticalNotification")); + parser.addOption(criticalNotificationOption); QCommandLineOption panelOption(QStringLiteral("panel")); parser.addOption(panelOption); QCommandLineOption desktopOption(QStringLiteral("desktop")); @@ -294,8 +163,12 @@ parser.addOption(osdOption); QCommandLineOption tooltipOption(QStringLiteral("tooltip")); parser.addOption(tooltipOption); + QCommandLineOption standaloneOption(QStringLiteral("standalone")); + parser.addOption(standaloneOption); QCommandLineOption overrideOption(QStringLiteral("override")); parser.addOption(overrideOption); + QCommandLineOption fullscreenOption(QStringLiteral("fullscreen")); + parser.addOption(fullscreenOption); QCommandLineOption skipTaskbarOption(QStringLiteral("skipTaskbar")); parser.addOption(skipTaskbarOption); parser.process(app); @@ -307,6 +180,8 @@ if (parser.isSet(notificationOption)) { client.setRole(PlasmaShellSurface::Role::Notification); + } else if (parser.isSet(criticalNotificationOption)) { + client.setRole(PlasmaShellSurface::Role::CriticalNotification); } else if (parser.isSet(panelOption)) { client.setRole(PlasmaShellSurface::Role::Panel); } else if (parser.isSet(desktopOption)) { @@ -315,8 +190,12 @@ client.setRole(PlasmaShellSurface::Role::OnScreenDisplay); } else if (parser.isSet(tooltipOption)) { client.setRole(PlasmaShellSurface::Role::ToolTip); + } else if (parser.isSet(standaloneOption)) { + client.setRole(PlasmaShellSurface::Role::StandAlone); } else if (parser.isSet(overrideOption)) { client.setRole(PlasmaShellSurface::Role::Override); + } else if (parser.isSet(fullscreenOption)) { + client.setRole(PlasmaShellSurface::Role::ActiveFullScreen); } client.setSkipTaskbar(parser.isSet(skipTaskbarOption)); client.setSkipSwitcher(parser.isSet(skipSwitcherOption)); diff -Nru dwayland-5.57.0.23/tests/qtwaylandintegrationtest.cpp dwayland-5.57.0.24+really5.24.3/tests/qtwaylandintegrationtest.cpp --- dwayland-5.57.0.23/tests/qtwaylandintegrationtest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/qtwaylandintegrationtest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "qtwaylandintegrationtest.h" -// KWin::Wayland -#include <../src/client/buffer.h> -#include <../src/client/compositor.h> -#include <../src/client/connection_thread.h> -#include <../src/client/pointer.h> -#include <../src/client/registry.h> -#include <../src/client/shell.h> -#include <../src/client/shm_pool.h> -#include <../src/client/surface.h> -// Qt -#include -#include -#include -#include -#include - -#include - -using namespace KWayland::Client; - -static Qt::GlobalColor s_colors[] = { - Qt::white, - Qt::red, - Qt::green, - Qt::blue, - Qt::black -}; -static int s_colorIndex = 0; - -WaylandClientTest::WaylandClientTest(QObject *parent) - : QObject(parent) - , m_connectionThreadObject(ConnectionThread::fromApplication(this)) - , m_compositor(Compositor::fromApplication(this)) - , m_surface(nullptr) - , m_shm(nullptr) - , m_shellSurface(nullptr) - , m_timer(new QTimer(this)) -{ - init(); -} - -WaylandClientTest::~WaylandClientTest() = default; - -void WaylandClientTest::init() -{ - connect(m_timer, &QTimer::timeout, this, - [this]() { - s_colorIndex = (s_colorIndex + 1) % 5; - render(); - } - ); - m_timer->setInterval(1000); - m_timer->start(); - - m_surface = m_compositor->createSurface(this); - Registry *registry = new Registry(this); - setupRegistry(registry); -} - -void WaylandClientTest::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name) { - Shell *shell = registry->createShell(name, 1, this); - m_shellSurface = shell->createSurface(m_surface, m_surface); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, static_cast(&WaylandClientTest::render)); - render(QSize(200, 200)); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name) { - m_shm = registry->createShmPool(name, 1, this); - } - ); - registry->create(m_connectionThreadObject->display()); - registry->setup(); -} - -void WaylandClientTest::render(const QSize &size) -{ - m_currentSize = size; - render(); -} - -void WaylandClientTest::render() -{ - if (!m_shm || !m_surface || !m_surface->isValid() || !m_currentSize.isValid()) { - return; - } - auto buffer = m_shm->getBuffer(m_currentSize, m_currentSize.width() * 4).toStrongRef(); - buffer->setUsed(true); - QImage image(buffer->address(), m_currentSize.width(), m_currentSize.height(), QImage::Format_ARGB32_Premultiplied); - image.fill(s_colors[s_colorIndex]); - - m_surface->attachBuffer(*buffer); - m_surface->damage(QRect(QPoint(0, 0), m_currentSize)); - m_surface->commit(Surface::CommitFlag::None); - buffer->setUsed(false); -} - -int main(int argc, char **argv) -{ - qputenv("QT_QPA_PLATFORM", "wayland"); - QGuiApplication app(argc, argv); - - new WaylandClientTest(&app); - - return app.exec(); -} diff -Nru dwayland-5.57.0.23/tests/qtwaylandintegrationtest.h dwayland-5.57.0.24+really5.24.3/tests/qtwaylandintegrationtest.h --- dwayland-5.57.0.23/tests/qtwaylandintegrationtest.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/qtwaylandintegrationtest.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef QTWAYLANDINTEGRATIONTEST_H -#define QTWAYLANDINTEGRATIONTEST_H - -#include -#include - -namespace KWayland -{ -namespace Client -{ -class Compositor; -class ConnectionThread; -class Registry; -class ShellSurface; -class ShmPool; -class Surface; -} -} - -class QTimer; - -class WaylandClientTest : public QObject -{ - Q_OBJECT -public: - explicit WaylandClientTest(QObject *parent = nullptr); - virtual ~WaylandClientTest(); - -private: - void init(); - void render(const QSize &size); - void render(); - void setupRegistry(KWayland::Client::Registry *registry); - void toggleTimer(); - KWayland::Client::ConnectionThread *m_connectionThreadObject; - KWayland::Client::Compositor *m_compositor; - KWayland::Client::Surface *m_surface; - KWayland::Client::ShmPool *m_shm; - KWayland::Client::ShellSurface *m_shellSurface; - QSize m_currentSize; - QTimer *m_timer; -}; - -#endif diff -Nru dwayland-5.57.0.23/tests/renderingservertest.cpp dwayland-5.57.0.24+really5.24.3/tests/renderingservertest.cpp --- dwayland-5.57.0.23/tests/renderingservertest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/renderingservertest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,23 +1,8 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/server/buffer_interface.h" + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/server/compositor_interface.h" #include "../src/server/datadevicemanager_interface.h" #include "../src/server/display.h" @@ -25,7 +10,8 @@ #include "../src/server/output_interface.h" #include "../src/server/pointer_interface.h" #include "../src/server/seat_interface.h" -#include "../src/server/shell_interface.h" +#include "../src/server/shmclientbuffer.h" +#include "../src/server/xdgshell_interface.h" #include #include @@ -36,17 +22,15 @@ #include #include -#include #include +#include static int startXServer() { const QByteArray process = QByteArrayLiteral("Xwayland"); int pipeFds[2]; if (pipe(pipeFds) != 0) { - std::cerr << "FATAL ERROR failed to create pipe to start X Server " - << process.constData() - << std::endl; + std::cerr << "FATAL ERROR failed to create pipe to start X Server " << process.constData() << std::endl; exit(1); } @@ -77,7 +61,7 @@ QByteArray displayNumber = readPipe.readLine(); displayNumber.prepend(QByteArray(":")); - displayNumber.remove(displayNumber.size() -1, 1); + displayNumber.remove(displayNumber.size() - 1, 1); std::cout << "X-Server started on display " << displayNumber.constData() << std::endl; setenv("DISPLAY", displayNumber.constData(), true); @@ -93,9 +77,9 @@ explicit CompositorWindow(QWidget *parent = nullptr); virtual ~CompositorWindow(); - void surfaceCreated(KWayland::Server::ShellSurfaceInterface *surface); + void surfaceCreated(KWaylandServer::XdgToplevelInterface *surface); - void setSeat(const QPointer &seat); + void setSeat(const QPointer &seat); protected: void paintEvent(QPaintEvent *event) override; @@ -108,8 +92,8 @@ private: void updateFocus(); - QList m_stackingOrder; - QPointer m_seat; + QList m_stackingOrder; + QPointer m_seat; }; CompositorWindow::CompositorWindow(QWidget *parent) @@ -120,46 +104,29 @@ CompositorWindow::~CompositorWindow() = default; -void CompositorWindow::surfaceCreated(KWayland::Server::ShellSurfaceInterface *surface) +void CompositorWindow::surfaceCreated(KWaylandServer::XdgToplevelInterface *surface) { - using namespace KWayland::Server; + using namespace KWaylandServer; + surface->sendConfigure(QSize(), XdgToplevelInterface::States()); m_stackingOrder << surface; - connect(surface, &ShellSurfaceInterface::fullscreenChanged, this, - [surface, this](bool fullscreen) { - if (fullscreen) { - surface->requestSize(size()); - } - } - ); - connect(surface, &ShellSurfaceInterface::maximizedChanged, this, - [surface, this](bool maximized) { - if (maximized) { - surface->requestSize(size()); - } - } - ); connect(surface->surface(), &SurfaceInterface::damaged, this, static_cast(&CompositorWindow::update)); - connect(surface, &ShellSurfaceInterface::destroyed, this, - [surface, this] { - m_stackingOrder.removeAll(surface); - updateFocus(); - update(); - } - ); + connect(surface, &XdgToplevelInterface::destroyed, this, [surface, this] { + m_stackingOrder.removeAll(surface); + updateFocus(); + update(); + }); updateFocus(); } void CompositorWindow::updateFocus() { - using namespace KWayland::Server; + using namespace KWaylandServer; if (!m_seat || m_stackingOrder.isEmpty()) { return; } - auto it = std::find_if(m_stackingOrder.constBegin(), m_stackingOrder.constEnd(), - [](ShellSurfaceInterface *s) { - return s->surface()->buffer() != nullptr; - } - ); + auto it = std::find_if(m_stackingOrder.constBegin(), m_stackingOrder.constEnd(), [](XdgToplevelInterface *toplevel) { + return toplevel->surface()->isMapped(); + }); if (it == m_stackingOrder.constEnd()) { return; } @@ -167,7 +134,7 @@ m_seat->setFocusedKeyboardSurface((*it)->surface()); } -void CompositorWindow::setSeat(const QPointer< KWayland::Server::SeatInterface > &seat) +void CompositorWindow::setSeat(const QPointer &seat) { m_seat = seat; } @@ -176,11 +143,16 @@ { QWidget::paintEvent(event); QPainter p(this); - for (auto s : m_stackingOrder) { - if (auto *b = s->surface()->buffer()) { - p.drawImage(QPoint(0, 0), b->data()); - s->surface()->frameRendered(QDateTime::currentMSecsSinceEpoch()); + for (auto window : m_stackingOrder) { + KWaylandServer::SurfaceInterface *surface = window->surface(); + if (!surface || !surface->isMapped()) { + continue; + } + auto clientBuffer = qobject_cast(surface->buffer()); + if (clientBuffer) { + p.drawImage(QPoint(0, 0), clientBuffer->data()); } + surface->frameRendered(QDateTime::currentMSecsSinceEpoch()); } } @@ -194,7 +166,7 @@ updateFocus(); } m_seat->setTimestamp(event->timestamp()); - m_seat->keyPressed(event->nativeScanCode() - 8); + m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWaylandServer::KeyboardKeyState::Pressed); } void CompositorWindow::keyReleaseEvent(QKeyEvent *event) @@ -204,7 +176,7 @@ return; } m_seat->setTimestamp(event->timestamp()); - m_seat->keyReleased(event->nativeScanCode() - 8); + m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWaylandServer::KeyboardKeyState::Released); } void CompositorWindow::mouseMoveEvent(QMouseEvent *event) @@ -214,7 +186,8 @@ updateFocus(); } m_seat->setTimestamp(event->timestamp()); - m_seat->setPointerPos(event->localPos().toPoint()); + m_seat->notifyPointerMotion(event->localPos().toPoint()); + m_seat->notifyPointerFrame(); } void CompositorWindow::mousePressEvent(QMouseEvent *event) @@ -226,14 +199,16 @@ } } m_seat->setTimestamp(event->timestamp()); - m_seat->pointerButtonPressed(event->button()); + m_seat->notifyPointerButton(event->button(), KWaylandServer::PointerButtonState::Pressed); + m_seat->notifyPointerFrame(); } void CompositorWindow::mouseReleaseEvent(QMouseEvent *event) { QWidget::mouseReleaseEvent(event); m_seat->setTimestamp(event->timestamp()); - m_seat->pointerButtonReleased(event->button()); + m_seat->notifyPointerButton(event->button(), KWaylandServer::PointerButtonState::Released); + m_seat->notifyPointerFrame(); } void CompositorWindow::wheelEvent(QWheelEvent *event) @@ -242,44 +217,39 @@ m_seat->setTimestamp(event->timestamp()); const QPoint &angle = event->angleDelta() / (8 * 15); if (angle.x() != 0) { - m_seat->pointerAxis(Qt::Horizontal, angle.x()); + m_seat->notifyPointerAxis(Qt::Horizontal, angle.x(), 1, KWaylandServer::PointerAxisSource::Wheel); } if (angle.y() != 0) { - m_seat->pointerAxis(Qt::Vertical, angle.y()); + m_seat->notifyPointerAxis(Qt::Vertical, angle.y(), 1, KWaylandServer::PointerAxisSource::Wheel); } + m_seat->notifyPointerFrame(); } int main(int argc, char **argv) { - using namespace KWayland::Server; + using namespace KWaylandServer; QApplication app(argc, argv); QCommandLineParser parser; parser.addHelpOption(); - QCommandLineOption xwaylandOption(QStringList{QStringLiteral("x"), QStringLiteral("xwayland")}, - QStringLiteral("Start a rootless Xwayland server")); + QCommandLineOption xwaylandOption(QStringList{QStringLiteral("x"), QStringLiteral("xwayland")}, QStringLiteral("Start a rootless Xwayland server")); parser.addOption(xwaylandOption); parser.process(app); Display display; display.start(); - DataDeviceManagerInterface *ddm = display.createDataDeviceManager(); - ddm->create(); - CompositorInterface *compositor = display.createCompositor(&display); - compositor->create(); - ShellInterface *shell = display.createShell(); - shell->create(); + new DataDeviceManagerInterface(&display); + new CompositorInterface(&display, &display); + XdgShellInterface *shell = new XdgShellInterface(&display); display.createShm(); - OutputInterface *output = display.createOutput(&display); + OutputInterface *output = new OutputInterface(&display, &display); output->setPhysicalSize(QSize(269, 202)); const QSize windowSize(1024, 768); - output->addMode(windowSize); - output->create(); - SeatInterface *seat = display.createSeat(); + output->setMode(windowSize); + SeatInterface *seat = new SeatInterface(&display); seat->setHasKeyboard(true); seat->setHasPointer(true); seat->setName(QStringLiteral("testSeat0")); - seat->create(); CompositorWindow compositorWindow; compositorWindow.setSeat(seat); @@ -287,7 +257,7 @@ compositorWindow.setMaximumSize(windowSize); compositorWindow.setGeometry(QRect(QPoint(0, 0), windowSize)); compositorWindow.show(); - QObject::connect(shell, &ShellInterface::surfaceCreated, &compositorWindow, &CompositorWindow::surfaceCreated); + QObject::connect(shell, &XdgShellInterface::toplevelCreated, &compositorWindow, &CompositorWindow::surfaceCreated); // start XWayland if (parser.isSet(xwaylandOption)) { @@ -297,7 +267,9 @@ exit(1); } - QtConcurrent::run([pipe] { readDisplayFromPipe(pipe); }); + QtConcurrent::run([pipe] { + readDisplayFromPipe(pipe); + }); } return app.exec(); diff -Nru dwayland-5.57.0.23/tests/rendersequencetest.cpp dwayland-5.57.0.24+really5.24.3/tests/rendersequencetest.cpp --- dwayland-5.57.0.23/tests/rendersequencetest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/rendersequencetest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/******************************************************************** -Copyright 2022 diguoliang - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/client/connection_thread.h" -#include "../src/client/clientmanagement.h" -#include "../src/client/event_queue.h" -#include "../src/client/registry.h" -#include "../src/client/remote_access.h" -#include "../src/client/output.h" - -// Qt -#include -#include -#include -#include -// system -#include - -using namespace KWayland::Client; - -class RenderSequenceTest : public QObject -{ - Q_OBJECT -public: - explicit RenderSequenceTest(QObject *parent = nullptr); - virtual ~RenderSequenceTest(); - void init(); - -private: - void setupRegistry(Registry *registry); - QThread *m_connectionThread; - ConnectionThread *m_connectionThreadObject; - EventQueue *m_eventQueue = nullptr; - RemoteAccessManager* m_remoteAccessManager = nullptr; - QVector m_windowStates; -}; - -RenderSequenceTest::RenderSequenceTest(QObject *parent) - : QObject(parent) - , m_connectionThread(new QThread(this)) - , m_connectionThreadObject(new ConnectionThread()) -{ -} - -RenderSequenceTest::~RenderSequenceTest() -{ - m_connectionThread->quit(); - m_connectionThread->wait(); - m_connectionThreadObject->deleteLater(); -} - -void RenderSequenceTest::init() -{ - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - - m_connectionThreadObject->initConnection(); -} - -void RenderSequenceTest::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::remoteAccessManagerAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - m_remoteAccessManager = registry->createRemoteAccessManager(name , version, this); - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "createRemoteAccessManager"; - m_remoteAccessManager->setEventQueue(m_eventQueue); - m_remoteAccessManager->getRendersequence(); - connect(m_remoteAccessManager, &RemoteAccessManager::renderSequence, this, [](int number) { - qDebug() << "============ get_rendersequence: " << number; - }); - } - ); - - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -int main(int argc, char **argv) -{ - QGuiApplication app(argc, argv); - RenderSequenceTest client; - client.init(); - - return app.exec(); -} -#include "rendersequencetest.moc" - diff -Nru dwayland-5.57.0.23/tests/screenDump.cpp dwayland-5.57.0.24+really5.24.3/tests/screenDump.cpp --- dwayland-5.57.0.23/tests/screenDump.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/screenDump.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../src/client/connection_thread.h" -#include "../src/client/event_queue.h" -#include "../src/client/registry.h" -#include "../src/client/output.h" -#include "../src/client/remote_access.h" -// Qt -#include -#include -#include -#include -#include -#include -#include -// system -#include -#include -#include - -using namespace KWayland::Client; - -class KwaylandTest : public QObject -{ - Q_OBJECT -public: - explicit KwaylandTest(QObject *parent = nullptr); - virtual ~KwaylandTest(); - - void processBuffer(const Output *m_output, const RemoteBuffer* m_remoteBuffer); - - void init(); - -private: - void setupRegistry(Registry *registry); - QThread *m_connectionThread; - ConnectionThread *m_connectionThreadObject; - EventQueue *m_eventQueue = nullptr; - Compositor *m_compositor = nullptr; - RemoteAccessManager *m_remoteAccessManager = nullptr; - QList m_outputList; - Output *m_bufferReadyOutput = nullptr; - Output *m_output0 = nullptr; - Output *m_output1 = nullptr; -}; - -KwaylandTest::KwaylandTest(QObject *parent) - : QObject(parent) - , m_connectionThread(new QThread(this)) - , m_connectionThreadObject(new ConnectionThread()) -{ -} - -KwaylandTest::~KwaylandTest() -{ - m_connectionThread->quit(); - m_connectionThread->wait(); - m_connectionThreadObject->deleteLater(); -} - -void KwaylandTest::init() -{ - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - - m_connectionThreadObject->initConnection(); -} - -void KwaylandTest::processBuffer(const Output *m_output, const RemoteBuffer* m_remoteBuffer) -{ - if (!m_remoteBuffer) { - qDebug() <fd(); - quint32 width = m_remoteBuffer->width(); - quint32 height = m_remoteBuffer->height(); - quint32 stride = m_remoteBuffer->stride(); - - unsigned char *mapData = static_cast(mmap(nullptr, stride * height, PROT_READ, MAP_SHARED, dma_fd, 0)); - if (MAP_FAILED == mapData) - { - qDebug() << "dma fd " << dma_fd <<" mmap failed - "; - } else { - qDebug() << "success dma fd " << dma_fd << "width"<createCompositor(name, version, this); - } - ); - - connect(registry, &Registry::outputAnnounced, this, - [this, registry] (quint32 name, quint32 version) { - auto output = registry->createOutput(name, version, this); - if (output) { - qDebug() << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss.zzz ")) << "Get output"<createRemoteAccessManager(name, version, this); - connect(m_remoteAccessManager, &RemoteAccessManager::bufferReady, this, - [this] (const void *output, const RemoteBuffer * m_remoteBuffer) - { - m_bufferReadyOutput = Output::get(reinterpret_cast(const_cast(output))); - qDebug() << "RemoteAccessManager::bufferReady output"<< m_bufferReadyOutput->manufacturer()<geometry(); - connect(m_remoteBuffer, &RemoteBuffer::parametersObtained, this, - [this, m_remoteBuffer] { - processBuffer(m_bufferReadyOutput, m_remoteBuffer); - } - ); - } - ); - } - ); - - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - } - ); - - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -int main(int argc, char **argv) -{ - QGuiApplication app(argc, argv); - KwaylandTest client; - client.init(); - - return app.exec(); -} - -#include "screenDump.moc" diff -Nru dwayland-5.57.0.23/tests/shadowtest.cpp dwayland-5.57.0.24+really5.24.3/tests/shadowtest.cpp --- dwayland-5.57.0.23/tests/shadowtest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/shadowtest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,27 +1,13 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../src/client/shadow.h" #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/event_queue.h" #include "../src/client/registry.h" -#include "../src/client/shadow.h" #include "../src/client/shell.h" #include "../src/client/shm_pool.h" #include "../src/client/surface.h" @@ -72,7 +58,10 @@ void ShadowTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -80,8 +69,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -90,42 +78,32 @@ void ShadowTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::shadowAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shadowManager = registry->createShadowManager(name, version, this); - m_shadowManager->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - setupShadow(); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setToplevel(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &ShadowTest::render); - render(); - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::shadowAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shadowManager = registry->createShadowManager(name, version, this); + m_shadowManager->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + setupShadow(); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setToplevel(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &ShadowTest::render); + render(); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); @@ -137,7 +115,7 @@ Shadow *shadow = m_shadowManager->createShadow(m_surface, this); Q_ASSERT(shadow); - auto addElement = [shadow, this](const QColor color) { + auto addElement = [this](const QColor color) { const QSize size = QSize(10, 10); auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); buffer->setUsed(true); diff -Nru dwayland-5.57.0.23/tests/subsurfacetest.cpp dwayland-5.57.0.24+really5.24.3/tests/subsurfacetest.cpp --- dwayland-5.57.0.23/tests/subsurfacetest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/subsurfacetest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/datadevice.h" @@ -31,9 +17,9 @@ #include "../src/client/subcompositor.h" #include "../src/client/surface.h" // Qt -#include #include #include +#include #include #include #include @@ -85,7 +71,10 @@ void SubSurfaceTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -93,91 +82,77 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); m_connectionThreadObject->initConnection(); } - void SubSurfaceTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_seat = registry->createSeat(name, version, this); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this, registry] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_seat); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - m_shellSurface->setToplevel(); - connect(m_shellSurface, &ShellSurface::sizeChanged, this, &SubSurfaceTest::render); - - auto subInterface = registry->interface(Registry::Interface::SubCompositor); - if (subInterface.name != 0) { - m_subCompositor = registry->createSubCompositor(subInterface.name, subInterface.version, this); - Q_ASSERT(m_subCompositor); - // create the sub surface - auto surface = m_compositor->createSurface(this); - Q_ASSERT(surface); - auto subsurface = m_subCompositor->createSubSurface(surface, m_surface, this); - Q_ASSERT(subsurface); - QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::red); - surface->attachBuffer(m_shm->createBuffer(image)); - surface->damage(QRect(0, 0, 100, 100)); - surface->commit(Surface::CommitFlag::None); - // and another sub-surface to the sub-surface - auto surface2 = m_compositor->createSurface(this); - Q_ASSERT(surface2); - auto subsurface2 = m_subCompositor->createSubSurface(surface2, surface, this); - Q_ASSERT(subsurface2); - QImage green(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); - green.fill(Qt::green); - surface2->attachBuffer(m_shm->createBuffer(green)); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_seat = registry->createSeat(name, version, this); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this, registry] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_seat); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + m_shellSurface->setToplevel(); + connect(m_shellSurface, &ShellSurface::sizeChanged, this, &SubSurfaceTest::render); + + auto subInterface = registry->interface(Registry::Interface::SubCompositor); + if (subInterface.name != 0) { + m_subCompositor = registry->createSubCompositor(subInterface.name, subInterface.version, this); + Q_ASSERT(m_subCompositor); + // create the sub surface + auto surface = m_compositor->createSurface(this); + Q_ASSERT(surface); + auto subsurface = m_subCompositor->createSubSurface(surface, m_surface, this); + Q_ASSERT(subsurface); + QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::red); + surface->attachBuffer(m_shm->createBuffer(image)); + surface->damage(QRect(0, 0, 100, 100)); + surface->commit(Surface::CommitFlag::None); + // and another sub-surface to the sub-surface + auto surface2 = m_compositor->createSurface(this); + Q_ASSERT(surface2); + auto subsurface2 = m_subCompositor->createSubSurface(surface2, surface, this); + Q_ASSERT(subsurface2); + QImage green(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); + green.fill(Qt::green); + surface2->attachBuffer(m_shm->createBuffer(green)); + surface2->damage(QRect(0, 0, 50, 50)); + surface2->commit(Surface::CommitFlag::None); + QTimer *timer = new QTimer(this); + connect(timer, &QTimer::timeout, surface2, [surface2, this] { + QImage yellow(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); + yellow.fill(Qt::yellow); + surface2->attachBuffer(m_shm->createBuffer(yellow)); surface2->damage(QRect(0, 0, 50, 50)); surface2->commit(Surface::CommitFlag::None); - QTimer *timer = new QTimer(this); - connect(timer, &QTimer::timeout, surface2, - [surface2, this] { - QImage yellow(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); - yellow.fill(Qt::yellow); - surface2->attachBuffer(m_shm->createBuffer(yellow)); - surface2->damage(QRect(0, 0, 50, 50)); - surface2->commit(Surface::CommitFlag::None); - m_surface->commit(Surface::CommitFlag::None); - } - ); - timer->setSingleShot(true); - timer->start(5000); - } - render(); + m_surface->commit(Surface::CommitFlag::None); + }); + timer->setSingleShot(true); + timer->start(5000); } - ); + render(); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); diff -Nru dwayland-5.57.0.23/tests/touchclienttest.cpp dwayland-5.57.0.24+really5.24.3/tests/touchclienttest.cpp --- dwayland-5.57.0.23/tests/touchclienttest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/touchclienttest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,22 +1,8 @@ -/******************************************************************** -Copyright 2014, 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014, 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "touchclienttest.h" // KWin::Wayland #include <../src/client/buffer.h> @@ -45,13 +31,7 @@ using namespace KWayland::Client; -static Qt::GlobalColor s_colors[] = { - Qt::white, - Qt::red, - Qt::green, - Qt::blue, - Qt::black -}; +static Qt::GlobalColor s_colors[] = {Qt::white, Qt::red, Qt::green, Qt::blue, Qt::black}; static int s_colorIndex = 0; WaylandClientTest::WaylandClientTest(QObject *parent) @@ -77,7 +57,10 @@ void WaylandClientTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this]() { // create the event queue for the main gui thread m_eventQueue = new EventQueue(this); @@ -93,134 +76,98 @@ m_connectionThreadObject->initConnection(); - connect(m_timer, &QTimer::timeout, this, - [this]() { - s_colorIndex = (s_colorIndex + 1) % 5; - render(); - } - ); + connect(m_timer, &QTimer::timeout, this, [this]() { + s_colorIndex = (s_colorIndex + 1) % 5; + render(); + }); m_timer->setInterval(1000); m_timer->start(); } void WaylandClientTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name) { - m_compositor = registry->createCompositor(name, 1, this); - m_surface = m_compositor->createSurface(this); - } - ); - connect(registry, &Registry::shellAnnounced, this, - [this, registry](quint32 name) { - Shell *shell = registry->createShell(name, 1, this); - ShellSurface *shellSurface = shell->createSurface(m_surface, m_surface); - shellSurface->setToplevel(); - render(QSize(400, 200)); - } - ); - connect(registry, &Registry::outputAnnounced, this, - [this, registry](quint32 name) { - if (m_output) { + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name) { + m_compositor = registry->createCompositor(name, 1, this); + m_surface = m_compositor->createSurface(this); + }); + connect(registry, &Registry::shellAnnounced, this, [this, registry](quint32 name) { + Shell *shell = registry->createShell(name, 1, this); + ShellSurface *shellSurface = shell->createSurface(m_surface, m_surface); + shellSurface->setToplevel(); + render(QSize(400, 200)); + }); + connect(registry, &Registry::outputAnnounced, this, [this, registry](quint32 name) { + if (m_output) { + return; + } + m_output = registry->createOutput(name, 2, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name) { + m_shm = registry->createShmPool(name, 1, this); + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name) { + Seat *s = registry->createSeat(name, 2, this); + connect(s, &Seat::hasKeyboardChanged, this, [this, s](bool has) { + if (!has) { return; } - m_output = registry->createOutput(name, 2, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name) { - m_shm = registry->createShmPool(name, 1, this); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name) { - Seat *s = registry->createSeat(name, 2, this); - connect(s, &Seat::hasKeyboardChanged, this, - [this, s](bool has) { - if (!has) { - return; - } - Keyboard *k = s->createKeyboard(this); - connect(k, &Keyboard::keyChanged, this, - [this](quint32 key, Keyboard::KeyState state) { - if (key == KEY_Q && state == Keyboard::KeyState::Released) { - QCoreApplication::instance()->quit(); - } - } - ); + Keyboard *k = s->createKeyboard(this); + connect(k, &Keyboard::keyChanged, this, [](quint32 key, Keyboard::KeyState state) { + if (key == KEY_Q && state == Keyboard::KeyState::Released) { + QCoreApplication::instance()->quit(); } - ); - connect(s, &Seat::hasPointerChanged, this, - [this, s](bool has) { - if (!has) { - return; - } - Pointer *p = s->createPointer(this); - connect(p, &Pointer::buttonStateChanged, this, - [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { - Q_UNUSED(serial) - Q_UNUSED(time) - if (state == Pointer::ButtonState::Released) { - if (button == BTN_LEFT) { - if (m_timer->isActive()) { - m_timer->stop(); - } else { - m_timer->start(); - } - } - if (button == BTN_RIGHT) { - QCoreApplication::instance()->quit(); - } - } + }); + }); + connect(s, &Seat::hasPointerChanged, this, [this, s](bool has) { + if (!has) { + return; + } + Pointer *p = s->createPointer(this); + connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { + Q_UNUSED(serial) + Q_UNUSED(time) + if (state == Pointer::ButtonState::Released) { + if (button == BTN_LEFT) { + if (m_timer->isActive()) { + m_timer->stop(); + } else { + m_timer->start(); } - ); - } - ); - connect(s, &Seat::hasTouchChanged, this, - [this, s](bool has) { - if (!has) { - return; } - Touch *t = s->createTouch(this); - connect(t, &Touch::sequenceStarted, this, - [] (KWayland::Client::TouchPoint *startPoint) { - qDebug() << "Touch sequence started at" << startPoint->position() << "with id" << startPoint->id(); - } - ); - connect(t, &Touch::sequenceCanceled, this, - [] () { - qDebug() << "Touch sequence canceled"; - } - ); - connect(t, &Touch::sequenceEnded, this, - [] () { - qDebug() << "Touch sequence finished"; - } - ); - connect(t, &Touch::frameEnded, this, - [] () { - qDebug() << "End of touch contact point list"; - } - ); - connect(t, &Touch::pointAdded, this, - [] (KWayland::Client::TouchPoint *point) { - qDebug() << "Touch point added at" << point->position() << "with id" << point->id(); - } - ); - connect(t, &Touch::pointRemoved, this, - [] (KWayland::Client::TouchPoint *point) { - qDebug() << "Touch point " << point->id() << " removed at" << point->position(); - } - ); - connect(t, &Touch::pointMoved, this, - [] (KWayland::Client::TouchPoint *point) { - qDebug() << "Touch point " << point->id() << " moved to" << point->position(); - } - ); + if (button == BTN_RIGHT) { + QCoreApplication::instance()->quit(); + } } - ); - } - ); + }); + }); + connect(s, &Seat::hasTouchChanged, this, [this, s](bool has) { + if (!has) { + return; + } + Touch *t = s->createTouch(this); + connect(t, &Touch::sequenceStarted, this, [](KWayland::Client::TouchPoint *startPoint) { + qDebug() << "Touch sequence started at" << startPoint->position() << "with id" << startPoint->id(); + }); + connect(t, &Touch::sequenceCanceled, this, []() { + qDebug() << "Touch sequence canceled"; + }); + connect(t, &Touch::sequenceEnded, this, []() { + qDebug() << "Touch sequence finished"; + }); + connect(t, &Touch::frameEnded, this, []() { + qDebug() << "End of touch contact point list"; + }); + connect(t, &Touch::pointAdded, this, [](KWayland::Client::TouchPoint *point) { + qDebug() << "Touch point added at" << point->position() << "with id" << point->id(); + }); + connect(t, &Touch::pointRemoved, this, [](KWayland::Client::TouchPoint *point) { + qDebug() << "Touch point " << point->id() << " removed at" << point->position(); + }); + connect(t, &Touch::pointMoved, this, [](KWayland::Client::TouchPoint *point) { + qDebug() << "Touch point " << point->id() << " moved to" << point->position(); + }); + }); + }); registry->create(m_connectionThreadObject->display()); registry->setEventQueue(m_eventQueue); registry->setup(); diff -Nru dwayland-5.57.0.23/tests/touchclienttest.h dwayland-5.57.0.24+really5.24.3/tests/touchclienttest.h --- dwayland-5.57.0.23/tests/touchclienttest.h 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/touchclienttest.h 2022-11-18 03:38:26.000000000 +0000 @@ -1,24 +1,9 @@ -/******************************************************************** -Copyright 2014, 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014, 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#ifndef TOUCHCLIENTTEST_H -#define TOUCHCLIENTTEST_H + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#pragma once #include #include @@ -52,7 +37,6 @@ void render(const QSize &size); void render(); void setupRegistry(KWayland::Client::Registry *registry); - void toggleTimer(); QThread *m_connectionThread; KWayland::Client::ConnectionThread *m_connectionThreadObject; KWayland::Client::EventQueue *m_eventQueue; @@ -63,5 +47,3 @@ QSize m_currentSize; QTimer *m_timer; }; - -#endif diff -Nru dwayland-5.57.0.23/tests/waylandservertest.cpp dwayland-5.57.0.24+really5.24.3/tests/waylandservertest.cpp --- dwayland-5.57.0.23/tests/waylandservertest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/waylandservertest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,43 +1,27 @@ -/******************************************************************** -Copyright 2014 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2014 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/server/compositor_interface.h" #include "../src/server/display.h" #include "../src/server/output_interface.h" #include "../src/server/seat_interface.h" -#include "../src/server/shell_interface.h" +#include "../src/server/xdgshell_interface.h" -#include #include +#include #include -#include #include +#include static int startXServer() { const QByteArray process = QByteArrayLiteral("Xwayland"); int pipeFds[2]; if (pipe(pipeFds) != 0) { - std::cerr << "FATAL ERROR failed to create pipe to start X Server " - << process.constData() - << std::endl; + std::cerr << "FATAL ERROR failed to create pipe to start X Server " << process.constData() << std::endl; exit(1); } @@ -68,7 +52,7 @@ QByteArray displayNumber = readPipe.readLine(); displayNumber.prepend(QByteArray(":")); - displayNumber.remove(displayNumber.size() -1, 1); + displayNumber.remove(displayNumber.size() - 1, 1); std::cout << "X-Server started on display " << displayNumber.constData() << std::endl; setenv("DISPLAY", displayNumber.constData(), true); @@ -79,7 +63,7 @@ int main(int argc, char **argv) { - using namespace KWayland::Server; + using namespace KWaylandServer; // set our own event dispatcher to be able to dispatch events before the event loop is started QAbstractEventDispatcher *eventDispatcher = new QEventDispatcherGlib(); @@ -89,14 +73,11 @@ Display display; display.start(); display.createShm(); - CompositorInterface *compositor = display.createCompositor(&display); - compositor->create(); - ShellInterface *shell = display.createShell(); - shell->create(); - OutputInterface *output = display.createOutput(&display); + new CompositorInterface(&display, &display); + new XdgShellInterface(&display, &display); + OutputInterface *output = new OutputInterface(&display, &display); output->setPhysicalSize(QSize(10, 10)); - output->addMode(QSize(1024, 768)); - output->create(); + output->setMode(QSize(1024, 768)); // starts XWayland by forking and opening a pipe const int pipe = startXServer(); @@ -119,9 +100,8 @@ QGuiApplication app(argc, argv); - SeatInterface *seat = display.createSeat(); + SeatInterface *seat = new SeatInterface(&display); seat->setName(QStringLiteral("testSeat0")); - seat->create(); return app.exec(); } diff -Nru dwayland-5.57.0.23/tests/xdgforeigntest.cpp dwayland-5.57.0.24+really5.24.3/tests/xdgforeigntest.cpp --- dwayland-5.57.0.23/tests/xdgforeigntest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/xdgforeigntest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,38 +1,24 @@ -/******************************************************************** -Copyright 2016 Martin Gräßlin -Copyright 2017 Marco Martin - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ +/* + SPDX-FileCopyrightText: 2016 Martin Gräßlin + SPDX-FileCopyrightText: 2017 Marco Martin + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ +#include "../src/client/xdgforeign.h" #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/event_queue.h" #include "../src/client/registry.h" +#include "../src/client/server_decoration.h" #include "../src/client/shell.h" #include "../src/client/shm_pool.h" -#include "../src/client/server_decoration.h" #include "../src/client/xdgshell.h" -#include "../src/client/xdgforeign.h" // Qt #include +#include #include #include #include -#include using namespace KWayland::Client; class XdgForeignTest : public QObject @@ -44,7 +30,6 @@ void init(); - private: void setupRegistry(Registry *registry); void render(); @@ -83,7 +68,10 @@ void XdgForeignTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -91,8 +79,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -101,69 +88,57 @@ void XdgForeignTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::xdgShellUnstableV5Announced, this, - [this, registry](quint32 name, quint32 version) { - m_shell = registry->createXdgShell(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::exporterUnstableV2Announced, this, - [this, registry](quint32 name, quint32 version) { - m_exporter = registry->createXdgExporter(name, version, this); - m_exporter->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::importerUnstableV2Announced, this, - [this, registry](quint32 name, quint32 version) { - m_importer = registry->createXdgImporter(name, version, this); - m_importer->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::serverSideDecorationManagerAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_decoration = registry->createServerSideDecorationManager(name, version, this); - m_decoration->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_shell); - Q_ASSERT(m_shm); - Q_ASSERT(m_exporter); - Q_ASSERT(m_importer); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - auto parentDeco = m_decoration->create(m_surface, this); - m_shellSurface = m_shell->createSurface(m_surface, this); - Q_ASSERT(m_shellSurface); - connect(m_shellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); - - m_childSurface = m_compositor->createSurface(this); - Q_ASSERT(m_childSurface); - auto childDeco = m_decoration->create(m_childSurface, this); - m_childShellSurface = m_shell->createSurface(m_childSurface, this); - Q_ASSERT(m_childShellSurface); - connect(m_childShellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); - - m_exported = m_exporter->exportTopLevel(m_surface, this); - Q_ASSERT(m_decoration); - connect(m_exported, &XdgExported::done, this, [this]() { - m_imported = m_importer->importTopLevel(m_exported->handle(), this); - m_imported->setParentOf(m_childSurface); - }); - render(); - } - ); + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::xdgShellUnstableV5Announced, this, [this, registry](quint32 name, quint32 version) { + m_shell = registry->createXdgShell(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::exporterUnstableV2Announced, this, [this, registry](quint32 name, quint32 version) { + m_exporter = registry->createXdgExporter(name, version, this); + m_exporter->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::importerUnstableV2Announced, this, [this, registry](quint32 name, quint32 version) { + m_importer = registry->createXdgImporter(name, version, this); + m_importer->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::serverSideDecorationManagerAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_decoration = registry->createServerSideDecorationManager(name, version, this); + m_decoration->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_shell); + Q_ASSERT(m_shm); + Q_ASSERT(m_exporter); + Q_ASSERT(m_importer); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + auto parentDeco = m_decoration->create(m_surface, this); + Q_UNUSED(parentDeco) + m_shellSurface = m_shell->createSurface(m_surface, this); + Q_ASSERT(m_shellSurface); + connect(m_shellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); + + m_childSurface = m_compositor->createSurface(this); + Q_ASSERT(m_childSurface); + auto childDeco = m_decoration->create(m_childSurface, this); + Q_UNUSED(childDeco) + m_childShellSurface = m_shell->createSurface(m_childSurface, this); + Q_ASSERT(m_childShellSurface); + connect(m_childShellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); + + m_exported = m_exporter->exportTopLevel(m_surface, this); + Q_ASSERT(m_decoration); + connect(m_exported, &XdgExported::done, this, [this]() { + m_imported = m_importer->importTopLevel(m_exported->handle(), this); + m_imported->setParentOf(m_childSurface); + }); + render(); + }); registry->setEventQueue(m_eventQueue); registry->create(m_connectionThreadObject); registry->setup(); @@ -181,7 +156,7 @@ m_surface->damage(QRect(QPoint(0, 0), size)); m_surface->commit(Surface::CommitFlag::None); buffer->setUsed(false); - + size = m_childShellSurface->size().isValid() ? m_childShellSurface->size() : QSize(200, 200); buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); buffer->setUsed(true); diff -Nru dwayland-5.57.0.23/tests/xdgtest.cpp dwayland-5.57.0.24+really5.24.3/tests/xdgtest.cpp --- dwayland-5.57.0.23/tests/xdgtest.cpp 2023-01-06 05:18:34.000000000 +0000 +++ dwayland-5.57.0.24+really5.24.3/tests/xdgtest.cpp 2022-11-18 03:38:26.000000000 +0000 @@ -1,38 +1,30 @@ -/******************************************************************** -Copyright 2015 Martin Gräßlin +/* + SPDX-FileCopyrightText: 2015 Martin Gräßlin -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ #include "../src/client/compositor.h" #include "../src/client/connection_thread.h" #include "../src/client/event_queue.h" +#include "../src/client/pointer.h" #include "../src/client/registry.h" +#include "../src/client/seat.h" #include "../src/client/shadow.h" #include "../src/client/shell.h" #include "../src/client/shm_pool.h" #include "../src/client/surface.h" +#include "../src/client/server_decoration.h" #include "../src/client/xdgshell.h" -#include "../src/client/pointer.h" -#include "../src/client/seat.h" +#include "../src/client/ddeshell.h" +#include "../src/client/globalproperty.h" // Qt #include #include -#include #include +#include +#include +#include +#include using namespace KWayland::Client; @@ -60,6 +52,11 @@ XdgShellSurface *m_xdgShellSurface = nullptr; Surface *m_popupSurface = nullptr; XdgShellPopup *m_xdgShellPopup = nullptr; + GlobalProperty *m_ddeGlobalProperty = nullptr; + + DDEShell *m_ddeShell = nullptr; + DDEShellSurface *m_ddeShellSurface = nullptr; + KWayland::Client::ServerSideDecorationManager *m_decoration = nullptr; }; XdgTest::XdgTest(QObject *parent) @@ -78,7 +75,10 @@ void XdgTest::init() { - connect(m_connectionThreadObject, &ConnectionThread::connected, this, + connect( + m_connectionThreadObject, + &ConnectionThread::connected, + this, [this] { m_eventQueue = new EventQueue(this); m_eventQueue->setup(m_connectionThreadObject); @@ -86,8 +86,7 @@ Registry *registry = new Registry(this); setupRegistry(registry); }, - Qt::QueuedConnection - ); + Qt::QueuedConnection); m_connectionThreadObject->moveToThread(m_connectionThread); m_connectionThread->start(); @@ -96,61 +95,74 @@ void XdgTest::setupRegistry(Registry *registry) { - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - connect(registry, &Registry::shmAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_shm = registry->createShmPool(name, version, this); - } - ); - connect(registry, &Registry::xdgShellUnstableV6Announced, this, - [this, registry](quint32 name, quint32 version) { - m_xdgShell = registry->createXdgShell(name, version, this); - m_xdgShell->setEventQueue(m_eventQueue); - } - ); - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_xdgShell); - Q_ASSERT(m_shm); - m_surface = m_compositor->createSurface(this); - Q_ASSERT(m_surface); - m_xdgShellSurface = m_xdgShell->createSurface(m_surface, this); - Q_ASSERT(m_xdgShellSurface); - connect(m_xdgShellSurface, &XdgShellSurface::sizeChanged, this, &XdgTest::render); - render(); - } - ); - connect(registry, &Registry::seatAnnounced, this, - [this, registry](quint32 name) { - Seat *s = registry->createSeat(name, 2, this); - connect(s, &Seat::hasPointerChanged, this, - [this, s](bool has) { - if (!has) { - return; + connect(registry, &Registry::compositorAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_compositor = registry->createCompositor(name, version, this); + }); + connect(registry, &Registry::shmAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_shm = registry->createShmPool(name, version, this); + }); + connect(registry, &Registry::xdgShellStableAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_xdgShell = registry->createXdgShell(name, version, this); + m_xdgShell->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::ddeShellAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_ddeShell = registry->createDDEShell(name, version, this); + m_ddeShell->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::ddeGlobalPropertyAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_ddeGlobalProperty = registry->createGlobalProperty(name, version, this); + m_ddeGlobalProperty->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::serverSideDecorationManagerAnnounced, this, [this, registry](quint32 name, quint32 version) { + m_decoration = registry->createServerSideDecorationManager(name, version, this); + m_decoration->setEventQueue(m_eventQueue); + }); + connect(registry, &Registry::interfacesAnnounced, this, [this] { + Q_ASSERT(m_compositor); + Q_ASSERT(m_xdgShell); + Q_ASSERT(m_shm); + m_surface = m_compositor->createSurface(this); + Q_ASSERT(m_surface); + m_xdgShellSurface = m_xdgShell->createSurface(m_surface, this); + m_ddeShellSurface = m_ddeShell->createShellSurface(m_surface, this); + auto parentDeco = m_decoration->create(m_surface, this); + Q_ASSERT(m_xdgShellSurface); + connect(m_xdgShellSurface, + &XdgShellSurface::configureRequested, + this, + [this](const QSize &size, KWayland::Client::XdgShellSurface::States states, int serial) { + Q_UNUSED(size); + Q_UNUSED(states); + m_xdgShellSurface->ackConfigure(serial); + render(); + }); + + m_xdgShellSurface->setTitle(QStringLiteral("Test Window")); + + m_surface->commit(); + + }); + connect(registry, &Registry::seatAnnounced, this, [this, registry](quint32 name) { + Seat *s = registry->createSeat(name, 2, this); + connect(s, &Seat::hasPointerChanged, this, [this, s](bool has) { + if (!has) { + return; + } + Pointer *p = s->createPointer(this); + connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { + Q_UNUSED(button) + Q_UNUSED(serial) + Q_UNUSED(time) + if (state == Pointer::ButtonState::Released) { + if (m_popupSurface) { + m_popupSurface->deleteLater(); + m_popupSurface = nullptr; + } else { + createPopup(); } - Pointer *p = s->createPointer(this); - connect(p, &Pointer::buttonStateChanged, this, - [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { - Q_UNUSED(button) - Q_UNUSED(serial) - Q_UNUSED(time) - if (state == Pointer::ButtonState::Released) { - if (m_popupSurface) { - m_popupSurface->deleteLater(); - m_popupSurface = nullptr; - } else { - createPopup(); - } - } - } - ); } - ); + }); + }); }); registry->setEventQueue(m_eventQueue); @@ -166,7 +178,7 @@ m_popupSurface = m_compositor->createSurface(this); - XdgPositioner positioner(QSize(200,200), QRect(50, 50, 400, 400)); + XdgPositioner positioner(QSize(200, 200), QRect(50, 50, 400, 400)); positioner.setAnchorEdge(Qt::BottomEdge | Qt::RightEdge); positioner.setGravity(Qt::BottomEdge); positioner.setConstraints(XdgPositioner::Constraint::FlipX | XdgPositioner::Constraint::SlideY); @@ -181,7 +193,7 @@ buffer->setUsed(true); QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied); image.fill(QColor(255, 255, 255, 255)); - //draw a red rectangle indicating the anchor of the top level + // draw a red rectangle indicating the anchor of the top level QPainter painter(&image); painter.setBrush(Qt::red); painter.setPen(Qt::black); @@ -195,7 +207,7 @@ void XdgTest::renderPopup() { - QSize size(200,200); + QSize size(200, 200); auto buffer = m_shm->getBuffer(size, size.width() * 4).toStrongRef(); buffer->setUsed(true); QImage image(buffer->address(), size.width(), size.height(), QImage::Format_ARGB32_Premultiplied);