From de36fe82e859b5b8dc89c15bac29ec688556edb9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 13 Sep 2023 20:59:29 +0300 Subject: [PATCH] wayland: Integrate KWaylandServer classes into KWin namespace --- autotests/integration/inputmethod_test.cpp | 6 +- .../integration/pointer_constraints_test.cpp | 4 +- .../integration/xwayland_selections_test.cpp | 2 +- src/backends/drm/drm_dmabuf_feedback.cpp | 10 +- src/backends/drm/drm_dmabuf_feedback.h | 12 +- src/backends/drm/drm_egl_backend.h | 5 - src/backends/drm/drm_virtual_egl_layer.h | 8 +- src/backends/fakeinput/fakeinputbackend.cpp | 6 +- src/backends/fakeinput/fakeinputbackend.h | 12 +- src/backends/fakeinput/fakeinputdevice.cpp | 28 ++-- src/backends/fakeinput/fakeinputdevice.h | 9 +- src/backends/x11/standalone/glxcontext.cpp | 2 +- src/backends/x11/standalone/glxcontext.h | 4 +- .../x11/standalone/x11_standalone_backend.cpp | 2 +- .../x11/standalone/x11_standalone_backend.h | 4 +- .../standalone/x11_standalone_egl_backend.cpp | 2 +- .../standalone/x11_standalone_egl_backend.h | 2 +- .../standalone/x11_standalone_glx_backend.cpp | 2 +- .../standalone/x11_standalone_glx_backend.h | 6 +- .../x11_standalone_glxconvenience.cpp | 2 +- .../x11_standalone_glxconvenience.h | 2 +- .../x11_standalone_sgivideosyncvsyncmonitor.h | 2 +- .../x11_standalone_xinputintegration.cpp | 10 +- .../x11_standalone_xinputintegration.h | 6 +- .../x11/windowed/x11_windowed_backend.cpp | 2 +- .../x11/windowed/x11_windowed_backend.h | 4 +- src/core/renderloop.cpp | 2 +- src/cursorsource.cpp | 8 +- src/cursorsource.h | 13 +- src/debug_console.cpp | 25 ++-- src/debug_console.h | 10 +- src/decorations/decorationbridge.cpp | 1 - src/effects.cpp | 6 +- src/effects.h | 12 +- src/events.cpp | 4 +- src/idle_inhibition.cpp | 2 - src/input.cpp | 137 +++++++++--------- src/inputmethod.cpp | 62 ++++---- src/inputmethod.h | 14 +- src/inputpanelv1integration.cpp | 2 - src/inputpanelv1integration.h | 9 +- src/inputpanelv1window.cpp | 4 +- src/inputpanelv1window.h | 6 +- src/keyboard_input.cpp | 2 +- src/layershellv1integration.cpp | 4 +- src/layershellv1integration.h | 13 +- src/layershellv1window.cpp | 10 +- src/layershellv1window.h | 18 +-- src/libkwineffects/kwineffects.h | 14 +- src/main.cpp | 2 +- .../scenes/opengl/abstract_egl_backend.cpp | 4 +- .../scenes/opengl/abstract_egl_backend.h | 4 +- src/plugins/backgroundcontrast/contrast.cpp | 10 +- src/plugins/backgroundcontrast/contrast.h | 8 +- src/plugins/blur/blur.cpp | 10 +- src/plugins/blur/blur.h | 9 +- src/plugins/screencast/screencastmanager.cpp | 38 ++--- src/plugins/screencast/screencastmanager.h | 24 +-- src/plugins/screencast/screencaststream.cpp | 12 +- src/plugins/screencast/screencaststream.h | 4 +- src/plugins/slidingpopups/slidingpopups.cpp | 18 +-- src/plugins/slidingpopups/slidingpopups.h | 9 +- src/pointer_input.cpp | 28 ++-- src/pointer_input.h | 12 +- src/scene/cursoritem.cpp | 2 +- src/scene/cursoritem.h | 2 +- src/scene/dndiconitem.cpp | 6 +- src/scene/dndiconitem.h | 8 +- src/scene/surfaceitem_wayland.cpp | 40 ++--- src/scene/surfaceitem_wayland.h | 20 +-- src/scene/surfaceitem_x11.h | 2 +- src/scene/workspacescene.cpp | 10 +- src/shadow.cpp | 2 +- src/shadow.h | 8 +- src/touch_input.cpp | 4 +- src/utils/subsurfacemonitor.cpp | 2 - src/utils/subsurfacemonitor.h | 14 +- src/virtualdesktops.cpp | 3 +- src/virtualdesktops.h | 10 +- src/wayland/DESIGN.md | 2 +- src/wayland/abstract_data_source.cpp | 5 +- src/wayland/abstract_data_source.h | 2 +- src/wayland/abstract_drop_handler.cpp | 2 +- src/wayland/abstract_drop_handler.h | 2 +- src/wayland/appmenu.cpp | 2 +- src/wayland/appmenu.h | 6 +- .../autotests/client/test_datadevice.cpp | 48 +++--- .../autotests/client/test_datasource.cpp | 32 ++-- .../autotests/client/test_drag_drop.cpp | 26 ++-- src/wayland/autotests/client/test_error.cpp | 6 +- .../autotests/client/test_fake_input.cpp | 6 +- .../client/test_plasma_activities.cpp | 16 +- .../client/test_plasma_virtual_desktop.cpp | 38 ++--- .../autotests/client/test_plasmashell.cpp | 8 +- .../client/test_pointer_constraints.cpp | 10 +- .../autotests/client/test_selection.cpp | 6 +- .../client/test_server_side_decoration.cpp | 24 +-- .../test_server_side_decoration_palette.cpp | 20 +-- src/wayland/autotests/client/test_shadow.cpp | 8 +- .../autotests/client/test_shm_pool.cpp | 6 +- .../autotests/client/test_text_input_v2.cpp | 78 +++++----- .../autotests/client/test_wayland_appmenu.cpp | 22 +-- .../autotests/client/test_wayland_blur.cpp | 22 +-- .../client/test_wayland_contrast.cpp | 22 +-- .../autotests/client/test_wayland_filter.cpp | 14 +- .../autotests/client/test_wayland_output.cpp | 16 +- .../autotests/client/test_wayland_seat.cpp | 90 ++++++------ .../autotests/client/test_wayland_slide.cpp | 20 +-- .../client/test_wayland_subsurface.cpp | 98 ++++++------- .../autotests/client/test_wayland_surface.cpp | 104 ++++++------- .../client/test_wayland_windowmanagement.cpp | 44 +++--- .../autotests/client/test_xdg_decoration.cpp | 24 +-- .../autotests/client/test_xdg_foreign.cpp | 72 ++++----- .../autotests/client/test_xdg_output.cpp | 12 +- .../autotests/client/test_xdg_shell.cpp | 6 +- .../server/test_datacontrol_interface.cpp | 6 +- src/wayland/autotests/server/test_display.cpp | 26 ++-- .../server/test_inputmethod_interface.cpp | 44 +++--- ...keyboard_shortcuts_inhibitor_interface.cpp | 4 +- .../server/test_layershellv1_interface.cpp | 8 +- .../server/test_no_xdg_runtime_dir.cpp | 6 +- .../autotests/server/test_screencast.cpp | 16 +- src/wayland/autotests/server/test_seat.cpp | 14 +- .../server/test_tablet_interface.cpp | 6 +- .../server/test_textinputv1_interface.cpp | 8 +- .../server/test_textinputv3_interface.cpp | 8 +- .../server/test_viewporter_interface.cpp | 4 +- src/wayland/blur.cpp | 2 +- src/wayland/blur.h | 2 +- src/wayland/clientconnection.cpp | 2 +- src/wayland/clientconnection.h | 19 ++- src/wayland/compositor.cpp | 4 +- src/wayland/compositor.h | 6 +- src/wayland/contenttype_v1.cpp | 14 +- src/wayland/contenttype_v1.h | 2 +- src/wayland/contrast.cpp | 2 +- src/wayland/contrast.h | 2 +- src/wayland/cursorshape_v1.cpp | 4 +- src/wayland/cursorshape_v1.h | 4 +- src/wayland/datacontroldevice_v1.cpp | 4 +- src/wayland/datacontroldevice_v1.h | 8 +- src/wayland/datacontroldevicemanager_v1.cpp | 2 +- src/wayland/datacontroldevicemanager_v1.h | 6 +- src/wayland/datacontroloffer_v1.cpp | 2 +- src/wayland/datacontroloffer_v1.h | 4 +- src/wayland/datacontrolsource_v1.cpp | 2 +- src/wayland/datacontrolsource_v1.h | 4 +- src/wayland/datadevice.cpp | 2 +- src/wayland/datadevice.h | 8 +- src/wayland/datadevice_p.h | 4 +- src/wayland/datadevicemanager.cpp | 2 +- src/wayland/datadevicemanager.h | 8 +- src/wayland/dataoffer.cpp | 2 +- src/wayland/dataoffer.h | 4 +- src/wayland/datasource.cpp | 2 +- src/wayland/datasource.h | 4 +- src/wayland/datasource_p.h | 2 +- src/wayland/display.cpp | 6 +- src/wayland/display.h | 25 +--- src/wayland/display_p.h | 4 +- src/wayland/dpms.cpp | 12 +- src/wayland/dpms.h | 8 +- src/wayland/drmclientbuffer.cpp | 4 +- src/wayland/drmclientbuffer.h | 4 +- src/wayland/drmlease_v1.cpp | 46 +++--- src/wayland/drmlease_v1.h | 16 +- src/wayland/drmlease_v1_p.h | 24 +-- src/wayland/fakeinput.cpp | 2 +- src/wayland/fakeinput.h | 8 +- src/wayland/filtered_display.cpp | 2 +- src/wayland/filtered_display.h | 2 +- src/wayland/fractionalscale_v1.cpp | 4 +- src/wayland/fractionalscale_v1.h | 4 +- src/wayland/fractionalscale_v1_p.h | 4 +- src/wayland/idle.cpp | 4 +- src/wayland/idle.h | 2 +- src/wayland/idle_p.h | 2 +- src/wayland/idleinhibit_v1.cpp | 2 +- src/wayland/idleinhibit_v1.h | 2 +- src/wayland/idleinhibit_v1_p.h | 2 +- src/wayland/idlenotify_v1.cpp | 4 +- src/wayland/idlenotify_v1.h | 2 +- src/wayland/inputmethod_v1.cpp | 4 +- src/wayland/inputmethod_v1.h | 8 +- src/wayland/keyboard.cpp | 8 +- src/wayland/keyboard.h | 4 +- src/wayland/keyboard_p.h | 4 +- src/wayland/keyboard_shortcuts_inhibit_v1.cpp | 2 +- src/wayland/keyboard_shortcuts_inhibit_v1.h | 2 +- src/wayland/keystate.cpp | 4 +- src/wayland/keystate.h | 2 +- src/wayland/layershell_v1.cpp | 4 +- src/wayland/layershell_v1.h | 4 +- src/wayland/linuxdmabufv1clientbuffer.cpp | 20 +-- src/wayland/linuxdmabufv1clientbuffer.h | 12 +- src/wayland/linuxdmabufv1clientbuffer_p.h | 16 +- src/wayland/lockscreen_overlay_v1.cpp | 2 +- src/wayland/lockscreen_overlay_v1.h | 2 +- src/wayland/output.cpp | 60 ++++---- src/wayland/output.h | 8 +- src/wayland/output_order_v1.cpp | 8 +- src/wayland/output_order_v1.h | 8 +- src/wayland/outputdevice_v2.cpp | 24 ++- src/wayland/outputdevice_v2.h | 14 +- src/wayland/outputmanagement_v2.cpp | 4 +- src/wayland/outputmanagement_v2.h | 2 +- src/wayland/plasmashell.cpp | 2 +- src/wayland/plasmashell.h | 8 +- src/wayland/plasmavirtualdesktop.cpp | 2 +- src/wayland/plasmavirtualdesktop.h | 2 +- src/wayland/plasmawindowmanagement.cpp | 4 +- src/wayland/plasmawindowmanagement.h | 6 +- src/wayland/pointer.cpp | 4 +- src/wayland/pointer.h | 4 +- src/wayland/pointer_p.h | 2 +- src/wayland/pointerconstraints_v1.cpp | 4 +- src/wayland/pointerconstraints_v1.h | 4 +- src/wayland/pointerconstraints_v1_p.h | 4 +- src/wayland/pointergestures_v1.cpp | 4 +- src/wayland/pointergestures_v1.h | 4 +- src/wayland/pointergestures_v1_p.h | 4 +- src/wayland/primaryselectiondevice_v1.cpp | 2 +- src/wayland/primaryselectiondevice_v1.h | 6 +- .../primaryselectiondevicemanager_v1.cpp | 2 +- .../primaryselectiondevicemanager_v1.h | 6 +- src/wayland/primaryselectionoffer_v1.cpp | 2 +- src/wayland/primaryselectionoffer_v1.h | 4 +- src/wayland/primaryselectionsource_v1.cpp | 2 +- src/wayland/primaryselectionsource_v1.h | 4 +- src/wayland/region.cpp | 4 +- src/wayland/region_p.h | 4 +- src/wayland/relativepointer_v1.cpp | 4 +- src/wayland/relativepointer_v1.h | 4 +- src/wayland/relativepointer_v1_p.h | 4 +- src/wayland/screencast_v1.cpp | 4 +- src/wayland/screencast_v1.h | 2 +- src/wayland/screenedge_v1.cpp | 6 +- src/wayland/screenedge_v1.h | 8 +- src/wayland/seat.cpp | 4 +- src/wayland/seat.h | 16 +- src/wayland/seat_p.h | 4 +- src/wayland/server_decoration.cpp | 2 +- src/wayland/server_decoration.h | 8 +- src/wayland/server_decoration_palette.cpp | 2 +- src/wayland/server_decoration_palette.h | 4 +- src/wayland/shadow.cpp | 28 ++-- src/wayland/shadow.h | 21 ++- src/wayland/shmclientbuffer.cpp | 6 +- src/wayland/shmclientbuffer.h | 4 +- src/wayland/shmclientbuffer_p.h | 18 +-- src/wayland/slide.cpp | 2 +- src/wayland/slide.h | 2 +- src/wayland/subcompositor.cpp | 4 +- src/wayland/subcompositor.h | 10 +- src/wayland/subsurface_p.h | 4 +- src/wayland/surface.cpp | 38 ++--- src/wayland/surface.h | 17 +-- src/wayland/surface_p.h | 14 +- src/wayland/tablet_v2.cpp | 4 +- src/wayland/tablet_v2.h | 6 +- src/wayland/tearingcontrol_v1.cpp | 2 +- src/wayland/tearingcontrol_v1.h | 2 +- src/wayland/tests/renderingservertest.cpp | 34 ++--- src/wayland/tests/waylandservertest.cpp | 4 +- src/wayland/textinput.h | 12 +- src/wayland/textinput_v1.cpp | 4 +- src/wayland/textinput_v1.h | 4 +- src/wayland/textinput_v1_p.h | 2 +- src/wayland/textinput_v2.cpp | 4 +- src/wayland/textinput_v2.h | 6 +- src/wayland/textinput_v2_p.h | 2 +- src/wayland/textinput_v3.cpp | 2 +- src/wayland/textinput_v3.h | 4 +- src/wayland/textinput_v3_p.h | 2 +- src/wayland/touch.cpp | 4 +- src/wayland/touch.h | 4 +- src/wayland/touch_p.h | 4 +- src/wayland/transaction.cpp | 6 +- src/wayland/transaction.h | 6 +- src/wayland/transaction_p.h | 8 +- src/wayland/utils.h | 17 +-- src/wayland/viewporter.cpp | 4 +- src/wayland/viewporter.h | 4 +- src/wayland/viewporter_p.h | 4 +- src/wayland/xdgactivation_v1.cpp | 2 +- src/wayland/xdgactivation_v1.h | 2 +- src/wayland/xdgdecoration_v1.cpp | 4 +- src/wayland/xdgdecoration_v1.h | 6 +- src/wayland/xdgdecoration_v1_p.h | 4 +- src/wayland/xdgforeign_v2.cpp | 2 +- src/wayland/xdgforeign_v2.h | 4 +- src/wayland/xdgforeign_v2_p.h | 4 +- src/wayland/xdgoutput_v1.cpp | 4 +- src/wayland/xdgoutput_v1.h | 2 +- src/wayland/xdgshell.cpp | 10 +- src/wayland/xdgshell.h | 20 +-- src/wayland/xdgshell_p.h | 4 +- src/wayland/xdgtopleveldrag_v1.cpp | 4 +- src/wayland/xdgtopleveldrag_v1.h | 2 +- src/wayland/xwaylandkeyboardgrab_v1.cpp | 2 +- src/wayland/xwaylandkeyboardgrab_v1.h | 2 +- src/wayland/xwaylandshell_v1.cpp | 4 +- src/wayland/xwaylandshell_v1.h | 4 +- src/wayland_server.cpp | 57 ++++---- src/wayland_server.h | 122 ++++++++-------- src/waylandwindow.cpp | 2 - src/waylandwindow.h | 2 +- src/window.cpp | 9 +- src/window.h | 18 +-- src/x11window.cpp | 2 +- src/xdgactivationv1.cpp | 4 +- src/xdgactivationv1.h | 20 ++- src/xdgshellintegration.cpp | 2 - src/xdgshellintegration.h | 13 +- src/xdgshellwindow.cpp | 12 +- src/xdgshellwindow.h | 65 ++++----- src/xkb.cpp | 4 +- src/xkb.h | 11 +- src/xwayland/clipboard.cpp | 8 +- src/xwayland/clipboard.h | 10 +- src/xwayland/databridge.cpp | 2 - src/xwayland/databridge.h | 6 +- src/xwayland/datasource.cpp | 8 +- src/xwayland/datasource.h | 14 +- src/xwayland/dnd.cpp | 10 +- src/xwayland/dnd.h | 10 +- src/xwayland/drag_wl.cpp | 10 +- src/xwayland/drag_wl.h | 16 +- src/xwayland/drag_x.cpp | 4 +- src/xwayland/drag_x.h | 8 +- src/xwayland/primary.cpp | 10 +- src/xwayland/primary.h | 9 +- src/xwayland/selection_source.cpp | 4 +- src/xwayland/selection_source.h | 9 +- src/xwayland/transfer.h | 5 +- src/xwayland/xwayland.cpp | 20 +-- src/xwayland/xwayland.h | 2 +- src/xwayland/xwayland_interface.h | 8 +- src/xwayland/xwldrophandler.cpp | 4 +- src/xwayland/xwldrophandler.h | 4 +- 340 files changed, 1673 insertions(+), 1906 deletions(-) diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index 2116df8e9e..a026bba532 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -581,7 +581,7 @@ void InputMethodTest::testDisableShowInputPanel() QVERIFY(inputMethodActiveSpy.count() || inputMethodActiveSpy.wait()); QVERIFY(!kwinApp()->inputMethod()->isActive()); - QSignalSpy requestShowInputPanelSpy(waylandServer()->seat()->textInputV2(), &KWaylandServer::TextInputV2Interface::requestShowInputPanel); + QSignalSpy requestShowInputPanelSpy(waylandServer()->seat()->textInputV2(), &TextInputV2Interface::requestShowInputPanel); textInputV2->showInputPanel(); QVERIFY(requestShowInputPanelSpy.count() || requestShowInputPanelSpy.wait()); QVERIFY(!kwinApp()->inputMethod()->isActive()); @@ -719,8 +719,8 @@ void InputMethodTest::testFakeEventFallback() // Special keys are not sent through commit_string but instead use keysym. auto enter = input()->keyboard()->xkb()->toKeysym(KEY_ENTER); - zwp_input_method_context_v1_keysym(context, 0, 0, enter, uint32_t(KWaylandServer::KeyboardKeyState::Pressed), 0); - zwp_input_method_context_v1_keysym(context, 0, 1, enter, uint32_t(KWaylandServer::KeyboardKeyState::Released), 0); + zwp_input_method_context_v1_keysym(context, 0, 0, enter, uint32_t(KeyboardKeyState::Pressed), 0); + zwp_input_method_context_v1_keysym(context, 0, 1, enter, uint32_t(KeyboardKeyState::Released), 0); keySpy.wait(); QVERIFY(keySpy.count() == 2); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp index a320200b12..fb357a5f0c 100644 --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -249,7 +249,7 @@ void TestPointerConstraints::testConfinedPointer() confinedPointer.reset(nullptr); Test::flushWaylandConnection(); - QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged); + QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &SurfaceInterface::pointerConstraintsChanged); QVERIFY(constraintsChangedSpy.wait()); // should be unconfined @@ -323,7 +323,7 @@ void TestPointerConstraints::testLockedPointer() lockedPointer.reset(nullptr); Test::flushWaylandConnection(); - QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged); + QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &SurfaceInterface::pointerConstraintsChanged); QVERIFY(constraintsChangedSpy.wait()); // moving cursor should be allowed again diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp index 997e20435e..e49ae08666 100644 --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -88,7 +88,7 @@ void XwaylandSelectionsTest::testSync() QVERIFY(!paste.isEmpty()); QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); - QSignalSpy clipboardChangedSpy(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged); + QSignalSpy clipboardChangedSpy(waylandServer()->seat(), &SeatInterface::selectionChanged); QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); diff --git a/src/backends/drm/drm_dmabuf_feedback.cpp b/src/backends/drm/drm_dmabuf_feedback.cpp index 269d6e57ec..20ae152886 100644 --- a/src/backends/drm/drm_dmabuf_feedback.cpp +++ b/src/backends/drm/drm_dmabuf_feedback.cpp @@ -32,7 +32,7 @@ void DmabufFeedback::renderingSurface() m_attemptedThisFrame = false; } -void DmabufFeedback::scanoutSuccessful(KWaylandServer::SurfaceInterface *surface) +void DmabufFeedback::scanoutSuccessful(SurfaceInterface *surface) { if (surface != m_surface) { if (m_surface && m_surface->dmabufFeedbackV1()) { @@ -43,7 +43,7 @@ void DmabufFeedback::scanoutSuccessful(KWaylandServer::SurfaceInterface *surface } } -void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, const QMap> &formats) +void DmabufFeedback::scanoutFailed(SurfaceInterface *surface, const QMap> &formats) { m_attemptedThisFrame = true; if (surface != m_surface) { @@ -57,10 +57,10 @@ void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, co const DmaBufAttributes *dmabufAttrs = surface->buffer()->dmabufAttributes(); if (!m_attemptedFormats[dmabufAttrs->format].contains(dmabufAttrs->modifier)) { m_attemptedFormats[dmabufAttrs->format] << dmabufAttrs->modifier; - QVector scanoutTranches; + QVector scanoutTranches; const auto tranches = m_eglBackend->tranches(); for (const auto &tranche : tranches) { - KWaylandServer::LinuxDmaBufV1Feedback::Tranche scanoutTranche; + LinuxDmaBufV1Feedback::Tranche scanoutTranche; for (auto it = tranche.formatTable.constBegin(); it != tranche.formatTable.constEnd(); it++) { const uint32_t format = it.key(); const auto trancheModifiers = it.value(); @@ -73,7 +73,7 @@ void DmabufFeedback::scanoutFailed(KWaylandServer::SurfaceInterface *surface, co } if (!scanoutTranche.formatTable.isEmpty()) { scanoutTranche.device = m_gpu->deviceId(); - scanoutTranche.flags = KWaylandServer::LinuxDmaBufV1Feedback::TrancheFlag::Scanout; + scanoutTranche.flags = LinuxDmaBufV1Feedback::TrancheFlag::Scanout; scanoutTranches << scanoutTranche; } } diff --git a/src/backends/drm/drm_dmabuf_feedback.h b/src/backends/drm/drm_dmabuf_feedback.h index 1b63a6210c..3bd312af91 100644 --- a/src/backends/drm/drm_dmabuf_feedback.h +++ b/src/backends/drm/drm_dmabuf_feedback.h @@ -12,16 +12,12 @@ #include #include -namespace KWaylandServer -{ -class SurfaceInterface; -} - namespace KWin { class EglGbmBackend; class DrmGpu; +class SurfaceInterface; class DmabufFeedback { @@ -29,11 +25,11 @@ public: DmabufFeedback(DrmGpu *gpu, EglGbmBackend *eglBackend); void renderingSurface(); - void scanoutSuccessful(KWaylandServer::SurfaceInterface *surface); - void scanoutFailed(KWaylandServer::SurfaceInterface *surface, const QMap> &formats); + void scanoutSuccessful(SurfaceInterface *surface); + void scanoutFailed(SurfaceInterface *surface, const QMap> &formats); private: - QPointer m_surface; + QPointer m_surface; QMap> m_attemptedFormats; bool m_attemptedThisFrame = false; diff --git a/src/backends/drm/drm_egl_backend.h b/src/backends/drm/drm_egl_backend.h index 5dacb929ea..8700c27ce6 100644 --- a/src/backends/drm/drm_egl_backend.h +++ b/src/backends/drm/drm_egl_backend.h @@ -16,11 +16,6 @@ #include #include -namespace KWaylandServer -{ -class SurfaceInterface; -} - namespace KWin { diff --git a/src/backends/drm/drm_virtual_egl_layer.h b/src/backends/drm/drm_virtual_egl_layer.h index 2e92bb0980..8028a28a07 100644 --- a/src/backends/drm/drm_virtual_egl_layer.h +++ b/src/backends/drm/drm_virtual_egl_layer.h @@ -16,11 +16,6 @@ #include #include -namespace KWaylandServer -{ -class SurfaceInterface; -} - namespace KWin { @@ -31,6 +26,7 @@ class GLTexture; class EglGbmBackend; class DrmVirtualOutput; class GLRenderTimeQuery; +class SurfaceInterface; class VirtualEglGbmLayer : public DrmOutputLayer { @@ -52,7 +48,7 @@ private: std::shared_ptr createGbmSwapchain() const; bool doesGbmSwapchainFit(EglSwapchain *swapchain) const; - QPointer m_scanoutSurface; + QPointer m_scanoutSurface; QPointer m_scanoutBuffer; DamageJournal m_damageJournal; DamageJournal m_oldDamageJournal; diff --git a/src/backends/fakeinput/fakeinputbackend.cpp b/src/backends/fakeinput/fakeinputbackend.cpp index 4942a12502..e76f1da057 100644 --- a/src/backends/fakeinput/fakeinputbackend.cpp +++ b/src/backends/fakeinput/fakeinputbackend.cpp @@ -17,12 +17,12 @@ FakeInputBackend::~FakeInputBackend() = default; void FakeInputBackend::initialize() { - m_interface = std::make_unique(waylandServer()->display()); - connect(m_interface.get(), &KWaylandServer::FakeInputInterface::deviceCreated, this, [this](KWaylandServer::FakeInputDeviceInterface *fakeDevice) { + m_interface = std::make_unique(waylandServer()->display()); + connect(m_interface.get(), &FakeInputInterface::deviceCreated, this, [this](FakeInputDeviceInterface *fakeDevice) { m_devices[fakeDevice] = std::make_unique(fakeDevice); Q_EMIT deviceAdded(m_devices[fakeDevice].get()); }); - connect(m_interface.get(), &KWaylandServer::FakeInputInterface::deviceDestroyed, this, [this](KWaylandServer::FakeInputDeviceInterface *fakeDevice) { + connect(m_interface.get(), &FakeInputInterface::deviceDestroyed, this, [this](FakeInputDeviceInterface *fakeDevice) { auto it = m_devices.find(fakeDevice); if (it != m_devices.end()) { const std::unique_ptr device = std::move(it->second); diff --git a/src/backends/fakeinput/fakeinputbackend.h b/src/backends/fakeinput/fakeinputbackend.h index 0641c3988c..4ae4f7a77b 100644 --- a/src/backends/fakeinput/fakeinputbackend.h +++ b/src/backends/fakeinput/fakeinputbackend.h @@ -11,16 +11,12 @@ #include #include -namespace KWaylandServer -{ -class FakeInputInterface; -class FakeInputDeviceInterface; -} - namespace KWin { class FakeInputDevice; +class FakeInputInterface; +class FakeInputDeviceInterface; class FakeInputBackend : public InputBackend { @@ -33,8 +29,8 @@ public: void initialize() override; private: - std::unique_ptr m_interface; - std::map> m_devices; + std::unique_ptr m_interface; + std::map> m_devices; }; } // namespace KWin diff --git a/src/backends/fakeinput/fakeinputdevice.cpp b/src/backends/fakeinput/fakeinputdevice.cpp index ce1cef37be..0e76084e1a 100644 --- a/src/backends/fakeinput/fakeinputdevice.cpp +++ b/src/backends/fakeinput/fakeinputdevice.cpp @@ -11,35 +11,35 @@ namespace KWin { static int s_lastDeviceId = 0; -FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *device, QObject *parent) +FakeInputDevice::FakeInputDevice(FakeInputDeviceInterface *device, QObject *parent) : InputDevice(parent) , m_name(QStringLiteral("Fake Input Device %1").arg(++s_lastDeviceId)) { - connect(device, &KWaylandServer::FakeInputDeviceInterface::authenticationRequested, this, [device](const QString &application, const QString &reason) { + connect(device, &FakeInputDeviceInterface::authenticationRequested, this, [device](const QString &application, const QString &reason) { // TODO: make secure device->setAuthentication(true); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerMotionRequested, this, [this](const QPointF &delta) { + connect(device, &FakeInputDeviceInterface::pointerMotionRequested, this, [this](const QPointF &delta) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT pointerMotion(delta, delta, time, this); Q_EMIT pointerFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) { + connect(device, &FakeInputDeviceInterface::pointerMotionAbsoluteRequested, this, [this](const QPointF &pos) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT pointerMotionAbsolute(pos, time, this); Q_EMIT pointerFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerButtonPressRequested, this, [this](quint32 button) { + connect(device, &FakeInputDeviceInterface::pointerButtonPressRequested, this, [this](quint32 button) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonPressed, time, this); Q_EMIT pointerFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerButtonReleaseRequested, this, [this](quint32 button) { + connect(device, &FakeInputDeviceInterface::pointerButtonReleaseRequested, this, [this](quint32 button) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT pointerButtonChanged(button, InputRedirection::PointerButtonReleased, time, this); Q_EMIT pointerFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) { + connect(device, &FakeInputDeviceInterface::pointerAxisRequested, this, [this](Qt::Orientation orientation, qreal delta) { InputRedirection::PointerAxis axis; switch (orientation) { case Qt::Horizontal: @@ -56,29 +56,29 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *devic Q_EMIT pointerAxisChanged(axis, delta, 0, InputRedirection::PointerAxisSourceUnknown, time, this); Q_EMIT pointerFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::touchDownRequested, this, [this](qint32 id, const QPointF &pos) { + connect(device, &FakeInputDeviceInterface::touchDownRequested, this, [this](qint32 id, const QPointF &pos) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT touchDown(id, pos, time, this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) { + connect(device, &FakeInputDeviceInterface::touchMotionRequested, this, [this](qint32 id, const QPointF &pos) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT touchMotion(id, pos, time, this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::touchUpRequested, this, [this](qint32 id) { + connect(device, &FakeInputDeviceInterface::touchUpRequested, this, [this](qint32 id) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT touchUp(id, time, this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::touchCancelRequested, this, [this]() { + connect(device, &FakeInputDeviceInterface::touchCancelRequested, this, [this]() { Q_EMIT touchCanceled(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::touchFrameRequested, this, [this]() { + connect(device, &FakeInputDeviceInterface::touchFrameRequested, this, [this]() { Q_EMIT touchFrame(this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::keyboardKeyPressRequested, this, [this](quint32 button) { + connect(device, &FakeInputDeviceInterface::keyboardKeyPressRequested, this, [this](quint32 button) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyPressed, time, this); }); - connect(device, &KWaylandServer::FakeInputDeviceInterface::keyboardKeyReleaseRequested, this, [this](quint32 button) { + connect(device, &FakeInputDeviceInterface::keyboardKeyReleaseRequested, this, [this](quint32 button) { const auto time = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()); Q_EMIT keyChanged(button, InputRedirection::KeyboardKeyReleased, time, this); }); diff --git a/src/backends/fakeinput/fakeinputdevice.h b/src/backends/fakeinput/fakeinputdevice.h index 13757cabda..fcd3b470bf 100644 --- a/src/backends/fakeinput/fakeinputdevice.h +++ b/src/backends/fakeinput/fakeinputdevice.h @@ -8,20 +8,17 @@ #include "core/inputdevice.h" -namespace KWaylandServer -{ -class FakeInputDeviceInterface; -} - namespace KWin { +class FakeInputDeviceInterface; + class KWIN_EXPORT FakeInputDevice : public InputDevice { Q_OBJECT public: - explicit FakeInputDevice(KWaylandServer::FakeInputDeviceInterface *device, QObject *parent = nullptr); + explicit FakeInputDevice(FakeInputDeviceInterface *device, QObject *parent = nullptr); QString sysName() const override; QString name() const override; diff --git a/src/backends/x11/standalone/glxcontext.cpp b/src/backends/x11/standalone/glxcontext.cpp index b73e670e5b..5d5467012f 100644 --- a/src/backends/x11/standalone/glxcontext.cpp +++ b/src/backends/x11/standalone/glxcontext.cpp @@ -16,7 +16,7 @@ namespace KWin { -GlxContext::GlxContext(Display *display, GLXWindow window, GLXContext handle) +GlxContext::GlxContext(::Display *display, GLXWindow window, GLXContext handle) : m_display(display) , m_window(window) , m_handle(handle) diff --git a/src/backends/x11/standalone/glxcontext.h b/src/backends/x11/standalone/glxcontext.h index d1b4da31cd..751aeedea1 100644 --- a/src/backends/x11/standalone/glxcontext.h +++ b/src/backends/x11/standalone/glxcontext.h @@ -18,7 +18,7 @@ namespace KWin class GlxContext : public OpenGlContext { public: - GlxContext(Display *display, GLXWindow window, GLXContext handle); + GlxContext(::Display *display, GLXWindow window, GLXContext handle); ~GlxContext() override; bool makeCurrent() const; @@ -27,7 +27,7 @@ public: static std::unique_ptr create(GlxBackend *backend, GLXFBConfig fbconfig, GLXWindow glxWindow); private: - Display *const m_display; + ::Display *const m_display; const GLXWindow m_window; const GLXContext m_handle; }; diff --git a/src/backends/x11/standalone/x11_standalone_backend.cpp b/src/backends/x11/standalone/x11_standalone_backend.cpp index 51c8c3805d..852bf0e96f 100644 --- a/src/backends/x11/standalone/x11_standalone_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_backend.cpp @@ -123,7 +123,7 @@ X11StandaloneBackend::~X11StandaloneBackend() XRenderUtils::cleanup(); } -Display *X11StandaloneBackend::display() const +::Display *X11StandaloneBackend::display() const { return m_x11Display; } diff --git a/src/backends/x11/standalone/x11_standalone_backend.h b/src/backends/x11/standalone/x11_standalone_backend.h index e93e842577..242d9a3d97 100644 --- a/src/backends/x11/standalone/x11_standalone_backend.h +++ b/src/backends/x11/standalone/x11_standalone_backend.h @@ -47,7 +47,7 @@ public: ~X11StandaloneBackend() override; bool initialize() override; - Display *display() const; + ::Display *display() const; xcb_connection_t *connection() const; xcb_window_t rootWindow() const; @@ -95,7 +95,7 @@ private: std::unique_ptr m_xinputIntegration; #endif std::unique_ptr m_updateOutputsTimer; - Display *m_x11Display; + ::Display *m_x11Display; std::unique_ptr m_windowSelector; std::unique_ptr m_screenEdgesFilter; std::unique_ptr m_randrEventFilter; diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp index 1bd5b8500f..8e98baca20 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp @@ -54,7 +54,7 @@ std::chrono::nanoseconds EglLayer::queryRenderTime() const return m_backend->queryRenderTime(); } -EglBackend::EglBackend(Display *display, X11StandaloneBackend *backend) +EglBackend::EglBackend(::Display *display, X11StandaloneBackend *backend) : m_backend(backend) , m_overlayWindow(std::make_unique(backend)) , m_layer(std::make_unique(this)) diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.h b/src/backends/x11/standalone/x11_standalone_egl_backend.h index 57708f77e2..41eadaa29c 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.h +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.h @@ -44,7 +44,7 @@ class EglBackend : public AbstractEglBackend Q_OBJECT public: - EglBackend(Display *display, X11StandaloneBackend *platform); + EglBackend(::Display *display, X11StandaloneBackend *platform); ~EglBackend() override; void init() override; diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp index 612d8d572b..b13c43d19a 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp @@ -125,7 +125,7 @@ std::chrono::nanoseconds GlxLayer::queryRenderTime() const return m_backend->queryRenderTime(); } -GlxBackend::GlxBackend(Display *display, X11StandaloneBackend *backend) +GlxBackend::GlxBackend(::Display *display, X11StandaloneBackend *backend) : OpenGLBackend() , m_overlayWindow(std::make_unique(backend)) , window(None) diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.h b/src/backends/x11/standalone/x11_standalone_glx_backend.h index 6283e261f4..1a37769a7c 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.h +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.h @@ -82,7 +82,7 @@ class GlxBackend : public OpenGLBackend Q_OBJECT public: - GlxBackend(Display *display, X11StandaloneBackend *backend); + GlxBackend(::Display *display, X11StandaloneBackend *backend); ~GlxBackend() override; std::unique_ptr createSurfaceTextureX11(SurfacePixmapX11 *pixmap) override; OutputLayerBeginFrameInfo beginFrame(); @@ -95,7 +95,7 @@ public: void init() override; OutputLayer *primaryLayer(Output *output) override; - Display *display() const + ::Display *display() const { return m_x11Display; } @@ -133,7 +133,7 @@ private: bool m_haveMESASwapControl = false; bool m_haveEXTSwapControl = false; bool m_haveSGISwapControl = false; - Display *m_x11Display; + ::Display *m_x11Display; X11StandaloneBackend *m_backend; std::unique_ptr m_vsyncMonitor; std::unique_ptr m_layer; diff --git a/src/backends/x11/standalone/x11_standalone_glxconvenience.cpp b/src/backends/x11/standalone/x11_standalone_glxconvenience.cpp index 0f6a21e6f7..33db2484b1 100644 --- a/src/backends/x11/standalone/x11_standalone_glxconvenience.cpp +++ b/src/backends/x11/standalone/x11_standalone_glxconvenience.cpp @@ -14,7 +14,7 @@ namespace KWin { -GLXFBConfig chooseGlxFbConfig(Display *display, const int attributes[]) +GLXFBConfig chooseGlxFbConfig(::Display *display, const int attributes[]) { int configCount = 0; GLXFBConfig *configs = glXChooseFBConfig(display, DefaultScreen(display), diff --git a/src/backends/x11/standalone/x11_standalone_glxconvenience.h b/src/backends/x11/standalone/x11_standalone_glxconvenience.h index 9676f92652..f017561624 100644 --- a/src/backends/x11/standalone/x11_standalone_glxconvenience.h +++ b/src/backends/x11/standalone/x11_standalone_glxconvenience.h @@ -12,6 +12,6 @@ namespace KWin { -GLXFBConfig chooseGlxFbConfig(Display *display, const int attributes[]); +GLXFBConfig chooseGlxFbConfig(::Display *display, const int attributes[]); } // namespace KWin diff --git a/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.h b/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.h index 510485854d..5b7abb731e 100644 --- a/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.h +++ b/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.h @@ -38,7 +38,7 @@ Q_SIGNALS: void vblankOccurred(std::chrono::nanoseconds timestamp); private: - Display *m_display = nullptr; + ::Display *m_display = nullptr; ::Window m_dummyWindow = 0; GLXContext m_localContext = 0; GLXDrawable m_drawable = 0; diff --git a/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp b/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp index a3f235deed..b66ef7fbb2 100644 --- a/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp +++ b/src/backends/x11/standalone/x11_standalone_xinputintegration.cpp @@ -163,19 +163,19 @@ public: { m_x11Cursor = cursor; } - void setDisplay(Display *display) + void setDisplay(::Display *display) { m_x11Display = display; } private: - Display *display() const + ::Display *display() const { return m_x11Display; } QPointer m_x11Cursor; - Display *m_x11Display = nullptr; + ::Display *m_x11Display = nullptr; uint32_t m_trackingTouchId = 0; QHash m_lastTouchPositions; }; @@ -204,7 +204,7 @@ public: } }; -XInputIntegration::XInputIntegration(Display *display, QObject *parent) +XInputIntegration::XInputIntegration(::Display *display, QObject *parent) : QObject(parent) , m_x11Display(display) { @@ -214,7 +214,7 @@ XInputIntegration::~XInputIntegration() = default; void XInputIntegration::init() { - Display *dpy = display(); + ::Display *dpy = display(); int xi_opcode, event, error; // init XInput extension if (!XQueryExtension(dpy, "XInputExtension", &xi_opcode, &event, &error)) { diff --git a/src/backends/x11/standalone/x11_standalone_xinputintegration.h b/src/backends/x11/standalone/x11_standalone_xinputintegration.h index a17ad9f1d4..366abaf833 100644 --- a/src/backends/x11/standalone/x11_standalone_xinputintegration.h +++ b/src/backends/x11/standalone/x11_standalone_xinputintegration.h @@ -24,7 +24,7 @@ class XInputIntegration : public QObject { Q_OBJECT public: - explicit XInputIntegration(Display *display, QObject *parent); + explicit XInputIntegration(::Display *display, QObject *parent); ~XInputIntegration() override; void init(); @@ -37,7 +37,7 @@ public: void setCursor(X11Cursor *cursor); private: - Display *display() const + ::Display *display() const { return m_x11Display; } @@ -47,7 +47,7 @@ private: int m_majorVersion = 0; int m_minorVersion = 0; QPointer m_x11Cursor; - Display *m_x11Display; + ::Display *m_x11Display; std::unique_ptr m_xiEventFilter; std::unique_ptr m_keyPressFilter; diff --git a/src/backends/x11/windowed/x11_windowed_backend.cpp b/src/backends/x11/windowed/x11_windowed_backend.cpp index 3472da544e..d0257e0427 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_backend.cpp @@ -744,7 +744,7 @@ int X11WindowedBackend::screenNumer() const return m_screenNumber; } -Display *X11WindowedBackend::display() const +::Display *X11WindowedBackend::display() const { return m_display; } diff --git a/src/backends/x11/windowed/x11_windowed_backend.h b/src/backends/x11/windowed/x11_windowed_backend.h index ecc8d17df6..7e44b22147 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.h +++ b/src/backends/x11/windowed/x11_windowed_backend.h @@ -99,7 +99,7 @@ public: explicit X11WindowedBackend(const X11WindowedBackendOptions &options); ~X11WindowedBackend() override; - Display *display() const; + ::Display *display() const; xcb_connection_t *connection() const; xcb_screen_t *screen() const; int screenNumer() const; @@ -155,7 +155,7 @@ private: xcb_atom_t m_protocols = XCB_ATOM_NONE; xcb_atom_t m_deleteWindowProtocol = XCB_ATOM_NONE; - Display *m_display = nullptr; + ::Display *m_display = nullptr; bool m_keyboardGrabbed = false; std::unique_ptr m_eventNotifier; diff --git a/src/core/renderloop.cpp b/src/core/renderloop.cpp index a1d7dea1c3..77484f2946 100644 --- a/src/core/renderloop.cpp +++ b/src/core/renderloop.cpp @@ -268,7 +268,7 @@ void RenderLoop::setFullscreenSurface(Item *surfaceItem) { d->fullscreenItem = surfaceItem; if (SurfaceItemWayland *wayland = qobject_cast(surfaceItem)) { - d->allowTearing = d->canDoTearing && options->allowTearing() && wayland->surface()->presentationHint() == KWaylandServer::PresentationHint::Async; + d->allowTearing = d->canDoTearing && options->allowTearing() && wayland->surface()->presentationHint() == PresentationHint::Async; } else { d->allowTearing = false; } diff --git a/src/cursorsource.cpp b/src/cursorsource.cpp index c1bbb980d9..c3c5553e41 100644 --- a/src/cursorsource.cpp +++ b/src/cursorsource.cpp @@ -116,7 +116,7 @@ SurfaceCursorSource::SurfaceCursorSource(QObject *parent) { } -KWaylandServer::SurfaceInterface *SurfaceCursorSource::surface() const +SurfaceInterface *SurfaceCursorSource::surface() const { return m_surface; } @@ -128,7 +128,7 @@ void SurfaceCursorSource::refresh() Q_EMIT changed(); } -void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, const QPointF &hotspot) +void SurfaceCursorSource::update(SurfaceInterface *surface, const QPointF &hotspot) { bool dirty = false; @@ -141,7 +141,7 @@ void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, cons dirty = true; if (m_surface) { - disconnect(m_surface, &KWaylandServer::SurfaceInterface::committed, this, &SurfaceCursorSource::refresh); + disconnect(m_surface, &SurfaceInterface::committed, this, &SurfaceCursorSource::refresh); } m_surface = surface; @@ -149,7 +149,7 @@ void SurfaceCursorSource::update(KWaylandServer::SurfaceInterface *surface, cons if (m_surface) { m_size = surface->size(); - connect(m_surface, &KWaylandServer::SurfaceInterface::committed, this, &SurfaceCursorSource::refresh); + connect(m_surface, &SurfaceInterface::committed, this, &SurfaceCursorSource::refresh); } else { m_size = QSizeF(0, 0); } diff --git a/src/cursorsource.h b/src/cursorsource.h index 81deabd833..aa5ecc7b7b 100644 --- a/src/cursorsource.h +++ b/src/cursorsource.h @@ -14,14 +14,11 @@ #include #include -namespace KWaylandServer -{ -class SurfaceInterface; -} - namespace KWin { +class SurfaceInterface; + /** * The CursorSource class represents the contents of the Cursor. */ @@ -85,15 +82,15 @@ class KWIN_EXPORT SurfaceCursorSource : public CursorSource public: explicit SurfaceCursorSource(QObject *parent = nullptr); - KWaylandServer::SurfaceInterface *surface() const; + SurfaceInterface *surface() const; public Q_SLOTS: - void update(KWaylandServer::SurfaceInterface *surface, const QPointF &hotspot); + void update(SurfaceInterface *surface, const QPointF &hotspot); private: void refresh(); - QPointer m_surface; + QPointer m_surface; }; } // namespace KWin diff --git a/src/debug_console.cpp b/src/debug_console.cpp index e1104c6a4a..3777229a2d 100644 --- a/src/debug_console.cpp +++ b/src/debug_console.cpp @@ -565,7 +565,7 @@ void DebugConsoleFilter::tabletPadRingEvent(int number, int position, bool isFin m_textEdit->ensureCursorVisible(); } -static QString sourceString(const KWaylandServer::AbstractDataSource *const source) +static QString sourceString(const AbstractDataSource *const source) { if (!source) { return QString(); @@ -577,11 +577,11 @@ static QString sourceString(const KWaylandServer::AbstractDataSource *const sour const QString executable = waylandServer()->display()->getConnection(source->client())->executablePath(); - if (auto dataSource = qobject_cast(source)) { + if (auto dataSource = qobject_cast(source)) { return QStringLiteral("wl_data_source@%1 of %2").arg(wl_resource_get_id(dataSource->resource())).arg(executable); - } else if (qobject_cast(source)) { + } else if (qobject_cast(source)) { return QStringLiteral("zwp_primary_selection_source_v1 of %2").arg(executable); - } else if (qobject_cast(source)) { + } else if (qobject_cast(source)) { return QStringLiteral("data control by %1").arg(executable); } return QStringLiteral("unknown source of").arg(executable); @@ -632,13 +632,13 @@ DebugConsole::DebugConsole() if (index == 6) { static_cast(m_ui->clipboardContent->model())->setSource(waylandServer()->seat()->selection()); m_ui->clipboardSource->setText(sourceString(waylandServer()->seat()->selection())); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged, this, [this](KWaylandServer::AbstractDataSource *source) { + connect(waylandServer()->seat(), &SeatInterface::selectionChanged, this, [this](AbstractDataSource *source) { static_cast(m_ui->clipboardContent->model())->setSource(source); m_ui->clipboardSource->setText(sourceString(source)); }); static_cast(m_ui->primaryContent->model())->setSource(waylandServer()->seat()->primarySelection()); m_ui->primarySource->setText(sourceString(waylandServer()->seat()->primarySelection())); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::primarySelectionChanged, this, [this](KWaylandServer::AbstractDataSource *source) { + connect(waylandServer()->seat(), &SeatInterface::primarySelectionChanged, this, [this](AbstractDataSource *source) { static_cast(m_ui->primaryContent->model())->setSource(source); m_ui->primarySource->setText(sourceString(source)); }); @@ -773,9 +773,9 @@ QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale & return QStringLiteral("%1,%2 %3x%4").arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height()); } default: - if (value.userType() == qMetaTypeId()) { - if (auto s = value.value()) { - return QStringLiteral("KWaylandServer::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16); + if (value.userType() == qMetaTypeId()) { + if (auto s = value.value()) { + return QStringLiteral("KWin::SurfaceInterface(0x%1)").arg(qulonglong(s), 0, 16); } else { return QStringLiteral("nullptr"); } @@ -1311,7 +1311,6 @@ SurfaceTreeModel::SurfaceTreeModel(QObject *parent) beginResetModel(); endResetModel(); }; - using namespace KWaylandServer; auto watchSubsurfaces = [this, reset](Window *c) { if (!c->surface()) { @@ -1343,7 +1342,6 @@ int SurfaceTreeModel::columnCount(const QModelIndex &parent) const int SurfaceTreeModel::rowCount(const QModelIndex &parent) const { if (parent.isValid()) { - using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(parent.internalPointer())) { return surface->below().count() + surface->above().count(); } @@ -1361,7 +1359,6 @@ QModelIndex SurfaceTreeModel::index(int row, int column, const QModelIndex &pare } if (parent.isValid()) { - using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(parent.internalPointer())) { int reference = 0; const auto &below = surface->below(); @@ -1389,7 +1386,6 @@ QModelIndex SurfaceTreeModel::index(int row, int column, const QModelIndex &pare QModelIndex SurfaceTreeModel::parent(const QModelIndex &child) const { - using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(child.internalPointer())) { const auto &subsurface = surface->subSurface(); if (!subsurface) { @@ -1440,7 +1436,6 @@ QVariant SurfaceTreeModel::data(const QModelIndex &index, int role) const if (!index.isValid()) { return QVariant(); } - using namespace KWaylandServer; if (SurfaceInterface *surface = static_cast(index.internalPointer())) { if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { return QStringLiteral("%1 (%2) - %3").arg(surface->client()->executablePath()).arg(surface->client()->processId()).arg(surface->id()); @@ -1663,7 +1658,7 @@ static QByteArray readData(int fd) } } -void DataSourceModel::setSource(KWaylandServer::AbstractDataSource *source) +void DataSourceModel::setSource(AbstractDataSource *source) { beginResetModel(); m_source = source; diff --git a/src/debug_console.h b/src/debug_console.h index 265db4c5d0..f9c75a555c 100644 --- a/src/debug_console.h +++ b/src/debug_console.h @@ -21,11 +21,6 @@ class QTextEdit; -namespace KWaylandServer -{ -class AbstractDataSource; -} - namespace Ui { class DebugConsole; @@ -34,6 +29,7 @@ class DebugConsole; namespace KWin { +class AbstractDataSource; class Window; class X11Window; class InternalWindow; @@ -196,10 +192,10 @@ public: QVariant data(const QModelIndex &index, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - void setSource(KWaylandServer::AbstractDataSource *source); + void setSource(AbstractDataSource *source); private: - KWaylandServer::AbstractDataSource *m_source = nullptr; + AbstractDataSource *m_source = nullptr; QVector m_data; }; } diff --git a/src/decorations/decorationbridge.cpp b/src/decorations/decorationbridge.cpp index 85f6edea9b..c919122600 100644 --- a/src/decorations/decorationbridge.cpp +++ b/src/decorations/decorationbridge.cpp @@ -85,7 +85,6 @@ bool DecorationBridge::hasPlugin() void DecorationBridge::init() { - using namespace KWaylandServer; m_noPlugin = readNoPlugin(); if (m_noPlugin) { if (waylandServer()) { diff --git a/src/effects.cpp b/src/effects.cpp index 11d29632cb..bfbb9930af 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -981,7 +981,7 @@ EffectWindow *EffectsHandlerImpl::findWindow(WId id) const return nullptr; } -EffectWindow *EffectsHandlerImpl::findWindow(KWaylandServer::SurfaceInterface *surf) const +EffectWindow *EffectsHandlerImpl::findWindow(SurfaceInterface *surf) const { if (waylandServer()) { if (Window *w = waylandServer()->findWindow(surf)) { @@ -1428,7 +1428,7 @@ bool EffectsHandlerImpl::blocksDirectScanout() const }); } -KWaylandServer::Display *EffectsHandlerImpl::waylandDisplay() const +Display *EffectsHandlerImpl::waylandDisplay() const { if (waylandServer()) { return waylandServer()->display(); @@ -1933,7 +1933,7 @@ WINDOW_HELPER(bool, isDeleted, isDeleted) WINDOW_HELPER(QString, windowRole, windowRole) WINDOW_HELPER(QStringList, activities, activities) WINDOW_HELPER(bool, skipsCloseAnimation, skipsCloseAnimation) -WINDOW_HELPER(KWaylandServer::SurfaceInterface *, surface, surface) +WINDOW_HELPER(SurfaceInterface *, surface, surface) WINDOW_HELPER(bool, isPopupWindow, isPopupWindow) WINDOW_HELPER(bool, isOutline, isOutline) WINDOW_HELPER(bool, isLockScreen, isLockScreen) diff --git a/src/effects.h b/src/effects.h index ccbb46edcf..7045b093cd 100644 --- a/src/effects.h +++ b/src/effects.h @@ -23,16 +23,12 @@ class QMouseEvent; class QWheelEvent; -namespace KWaylandServer -{ -class Display; -} - class QDBusPendingCallWatcher; class QDBusServiceWatcher; namespace KWin { +class Display; class Window; class Compositor; class EffectLoader; @@ -107,7 +103,7 @@ public: void startMousePolling() override; void stopMousePolling() override; EffectWindow *findWindow(WId id) const override; - EffectWindow *findWindow(KWaylandServer::SurfaceInterface *surf) const override; + EffectWindow *findWindow(SurfaceInterface *surf) const override; EffectWindow *findWindow(QWindow *w) const override; EffectWindow *findWindow(const QUuid &id) const override; EffectWindowList stackingOrder() const override; @@ -187,7 +183,7 @@ public: */ bool blocksDirectScanout() const; - KWaylandServer::Display *waylandDisplay() const override; + Display *waylandDisplay() const override; bool animationsSupported() const override; @@ -430,7 +426,7 @@ public: bool isOutline() const override; bool isLockScreen() const override; - KWaylandServer::SurfaceInterface *surface() const override; + SurfaceInterface *surface() const override; bool isFullScreen() const override; bool isUnresponsive() const override; diff --git a/src/events.cpp b/src/events.cpp index d28d96021e..9e4d5824db 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -650,14 +650,14 @@ void X11Window::clientMessageEvent(xcb_client_message_event_t *e) if (e->type == atoms->wl_surface_serial) { m_surfaceSerial = (uint64_t(e->data.data32[1]) << 32) | e->data.data32[0]; if (auto w = waylandServer()) { - if (KWaylandServer::XwaylandSurfaceV1Interface *xwaylandSurface = w->xwaylandShell()->findSurface(m_surfaceSerial)) { + if (XwaylandSurfaceV1Interface *xwaylandSurface = w->xwaylandShell()->findSurface(m_surfaceSerial)) { setSurface(xwaylandSurface->surface()); } } } else if (e->type == atoms->wl_surface_id) { m_pendingSurfaceId = e->data.data32[0]; if (auto w = waylandServer()) { - if (auto s = KWaylandServer::SurfaceInterface::get(m_pendingSurfaceId, w->xWaylandConnection())) { + if (auto s = SurfaceInterface::get(m_pendingSurfaceId, w->xWaylandConnection())) { setSurface(s); } } diff --git a/src/idle_inhibition.cpp b/src/idle_inhibition.cpp index f51d1e4db9..c5ccbf56f0 100644 --- a/src/idle_inhibition.cpp +++ b/src/idle_inhibition.cpp @@ -17,8 +17,6 @@ #include #include -using KWaylandServer::SurfaceInterface; - namespace KWin { diff --git a/src/input.cpp b/src/input.cpp index e2a7cc8820..e5b1cef632 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -81,20 +81,20 @@ using namespace std::literals; namespace KWin { -static KWaylandServer::PointerAxisSource kwinAxisSourceToKWaylandAxisSource(InputRedirection::PointerAxisSource source) +static PointerAxisSource kwinAxisSourceToKWaylandAxisSource(InputRedirection::PointerAxisSource source) { switch (source) { - case KWin::InputRedirection::PointerAxisSourceWheel: - return KWaylandServer::PointerAxisSource::Wheel; - case KWin::InputRedirection::PointerAxisSourceFinger: - return KWaylandServer::PointerAxisSource::Finger; - case KWin::InputRedirection::PointerAxisSourceContinuous: - return KWaylandServer::PointerAxisSource::Continuous; - case KWin::InputRedirection::PointerAxisSourceWheelTilt: - return KWaylandServer::PointerAxisSource::WheelTilt; - case KWin::InputRedirection::PointerAxisSourceUnknown: + case InputRedirection::PointerAxisSourceWheel: + return PointerAxisSource::Wheel; + case InputRedirection::PointerAxisSourceFinger: + return PointerAxisSource::Finger; + case InputRedirection::PointerAxisSourceContinuous: + return PointerAxisSource::Continuous; + case InputRedirection::PointerAxisSourceWheelTilt: + return PointerAxisSource::WheelTilt; + case InputRedirection::PointerAxisSourceUnknown: default: - return KWaylandServer::PointerAxisSource::Unknown; + return PointerAxisSource::Unknown; } } @@ -244,14 +244,14 @@ void InputEventFilter::passToWaylandServer(QKeyEvent *event) return; } - KWaylandServer::SeatInterface *seat = waylandServer()->seat(); + SeatInterface *seat = waylandServer()->seat(); const int keyCode = event->nativeScanCode(); switch (event->type()) { case QEvent::KeyPress: - seat->notifyKeyboardKey(keyCode, KWaylandServer::KeyboardKeyState::Pressed); + seat->notifyKeyboardKey(keyCode, KeyboardKeyState::Pressed); break; case QEvent::KeyRelease: - seat->notifyKeyboardKey(keyCode, KWaylandServer::KeyboardKeyState::Released); + seat->notifyKeyboardKey(keyCode, KeyboardKeyState::Released); break; default: break; @@ -267,7 +267,7 @@ bool InputEventFilter::passToInputMethod(QKeyEvent *event) if (event->isAutoRepeat()) { return true; } - auto newState = event->type() == QEvent::KeyPress ? KWaylandServer::KeyboardKeyState::Pressed : KWaylandServer::KeyboardKeyState::Released; + auto newState = event->type() == QEvent::KeyPress ? KeyboardKeyState::Pressed : KeyboardKeyState::Released; keyboardGrab->sendKey(waylandServer()->display()->nextSerial(), event->timestamp(), event->nativeScanCode(), newState); return true; } else { @@ -334,8 +334,8 @@ public: // TODO: can we leak presses/releases here when we move the mouse in between from an allowed surface to // disallowed one or vice versa? const auto state = event->type() == QEvent::MouseButtonPress - ? KWaylandServer::PointerButtonState::Pressed - : KWaylandServer::PointerButtonState::Released; + ? PointerButtonState::Pressed + : PointerButtonState::Released; seat->notifyPointerButton(nativeButton, state); } } @@ -397,10 +397,10 @@ public: } switch (event->type()) { case QEvent::KeyPress: - seat->notifyKeyboardKey(event->nativeScanCode(), KWaylandServer::KeyboardKeyState::Pressed); + seat->notifyKeyboardKey(event->nativeScanCode(), KeyboardKeyState::Pressed); break; case QEvent::KeyRelease: - seat->notifyKeyboardKey(event->nativeScanCode(), KWaylandServer::KeyboardKeyState::Released); + seat->notifyKeyboardKey(event->nativeScanCode(), KeyboardKeyState::Released); break; default: break; @@ -496,9 +496,9 @@ public: } private: - bool surfaceAllowed(KWaylandServer::SurfaceInterface *(KWaylandServer::SeatInterface::*method)() const) const + bool surfaceAllowed(SurfaceInterface *(SeatInterface::*method)() const) const { - if (KWaylandServer::SurfaceInterface *s = (waylandServer()->seat()->*method)()) { + if (SurfaceInterface *s = (waylandServer()->seat()->*method)()) { if (Window *t = waylandServer()->findWindow(s)) { return t->isLockScreen() || t->isInputMethod() || t->isLockScreenOverlay(); } @@ -508,15 +508,15 @@ private: } bool pointerSurfaceAllowed() const { - return surfaceAllowed(&KWaylandServer::SeatInterface::focusedPointerSurface); + return surfaceAllowed(&SeatInterface::focusedPointerSurface); } bool keyboardSurfaceAllowed() const { - return surfaceAllowed(&KWaylandServer::SeatInterface::focusedKeyboardSurface); + return surfaceAllowed(&SeatInterface::focusedKeyboardSurface); } bool touchSurfaceAllowed() const { - return surfaceAllowed(&KWaylandServer::SeatInterface::focusedTouchSurface); + return surfaceAllowed(&SeatInterface::focusedTouchSurface); } }; @@ -825,7 +825,7 @@ public: { return m_active; } - void start(std::function callback) + void start(std::function callback) { Q_ASSERT(!m_active); m_active = true; @@ -846,7 +846,7 @@ private: void deactivate() { m_active = false; - m_callback = std::function(); + m_callback = std::function(); m_pointSelectionFallback = std::function(); input()->pointer()->removeWindowSelectionCursor(); input()->keyboard()->update(); @@ -875,7 +875,7 @@ private: } bool m_active = false; - std::function m_callback; + std::function m_callback; std::function m_pointSelectionFallback; QMap m_touchPoints; }; @@ -1795,10 +1795,10 @@ public: break; } case QEvent::MouseButtonPress: - seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed); + seat->notifyPointerButton(nativeButton, PointerButtonState::Pressed); break; case QEvent::MouseButtonRelease: - seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released); + seat->notifyPointerButton(nativeButton, PointerButtonState::Released); break; default: break; @@ -1943,7 +1943,7 @@ public: } }; -static KWaylandServer::SeatInterface *findSeat() +static SeatInterface *findSeat() { auto server = waylandServer(); if (!server) { @@ -1955,12 +1955,12 @@ static KWaylandServer::SeatInterface *findSeat() class SurfaceCursor : public Cursor { public: - explicit SurfaceCursor(KWaylandServer::TabletToolV2Interface *tool) + explicit SurfaceCursor(TabletToolV2Interface *tool) : Cursor() { setParent(tool); - connect(tool, &KWaylandServer::TabletToolV2Interface::cursorChanged, this, [this](const KWaylandServer::TabletCursorSourceV2 &cursor) { - if (auto surfaceCursor = std::get_if(&cursor)) { + connect(tool, &TabletToolV2Interface::cursorChanged, this, [this](const TabletCursorSourceV2 &cursor) { + if (auto surfaceCursor = std::get_if(&cursor)) { // If the cursor is unset, fallback to the cross cursor. if ((*surfaceCursor) && (*surfaceCursor)->enteredSerial()) { if (!m_surfaceSource) { @@ -2017,13 +2017,13 @@ public: connect(tabletNextOutput, &QAction::triggered, this, &TabletInputFilter::trackNextOutput); } - static KWaylandServer::TabletSeatV2Interface *findTabletSeat() + static TabletSeatV2Interface *findTabletSeat() { auto server = waylandServer(); if (!server) { return nullptr; } - KWaylandServer::TabletManagerV2Interface *manager = server->tabletManagerV2(); + TabletManagerV2Interface *manager = server->tabletManagerV2(); return manager->seat(findSeat()); } @@ -2034,7 +2034,7 @@ public: return; } - KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); + TabletSeatV2Interface *tabletSeat = findTabletSeat(); if (!tabletSeat) { qCCritical(KWIN_CORE) << "Could not find tablet seat"; return; @@ -2043,7 +2043,7 @@ public: const char *devnode = udev_device_get_syspath(udev_device); auto deviceGroup = libinput_device_get_device_group(device->device()); - auto tablet = static_cast(libinput_device_group_get_user_data(deviceGroup)); + auto tablet = static_cast(libinput_device_group_get_user_data(deviceGroup)); if (!tablet) { tablet = tabletSeat->addTablet(device->vendor(), device->product(), device->sysName(), device->name(), {QString::fromUtf8(devnode)}); libinput_device_group_set_user_data(deviceGroup, tablet); @@ -2101,7 +2101,7 @@ public: auto deviceGroup = libinput_device_get_device_group(device->device()); libinput_device_group_set_user_data(deviceGroup, nullptr); - KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); + TabletSeatV2Interface *tabletSeat = findTabletSeat(); if (tabletSeat) { tabletSeat->removeDevice(device->sysName()); } else { @@ -2110,9 +2110,9 @@ public: } } - KWaylandServer::TabletToolV2Interface::Type getType(const KWin::TabletToolId &tabletToolId) + TabletToolV2Interface::Type getType(const TabletToolId &tabletToolId) { - using Type = KWaylandServer::TabletToolV2Interface::Type; + using Type = TabletToolV2Interface::Type; switch (tabletToolId.m_toolType) { case InputRedirection::Pen: return Type::Pen; @@ -2136,10 +2136,9 @@ public: return Type::Pen; } - KWaylandServer::TabletToolV2Interface *createTool(const KWin::TabletToolId &tabletToolId) + TabletToolV2Interface *createTool(const TabletToolId &tabletToolId) { - using namespace KWaylandServer; - KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); + TabletSeatV2Interface *tabletSeat = findTabletSeat(); const auto f = [](InputRedirection::Capability cap) { switch (cap) { @@ -2173,13 +2172,11 @@ public: bool tabletToolEvent(TabletEvent *event) override { - using namespace KWaylandServer; - if (!workspace()) { return false; } - KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); + TabletSeatV2Interface *tabletSeat = findTabletSeat(); if (!tabletSeat) { qCCritical(KWIN_CORE) << "Could not find tablet manager"; return false; @@ -2191,14 +2188,14 @@ public: // NOTE: tablet will be nullptr as the device is removed (see ::removeDevice) but events from the tool // may still happen (e.g. Release or ProximityOut events) - auto tablet = static_cast(event->tabletId().m_deviceGroupData); + auto tablet = static_cast(event->tabletId().m_deviceGroupData); Window *window = input()->findToplevel(event->globalPosF()); if (!window || !window->surface()) { return false; } - KWaylandServer::SurfaceInterface *surface = window->surface(); + SurfaceInterface *surface = window->surface(); tool->setCurrentSurface(surface); if (!tool->isClientSupported() || (tablet && !tablet->isSurfaceSupported(surface))) { @@ -2264,11 +2261,11 @@ public: input()->pointer()->processMotionAbsolute(event->globalPosF(), std::chrono::milliseconds(event->timestamp())); break; case QEvent::TabletPress: - input()->pointer()->processButton(KWin::qtMouseButtonToButton(Qt::LeftButton), + input()->pointer()->processButton(qtMouseButtonToButton(Qt::LeftButton), InputRedirection::PointerButtonPressed, std::chrono::milliseconds(event->timestamp())); break; case QEvent::TabletRelease: - input()->pointer()->processButton(KWin::qtMouseButtonToButton(Qt::LeftButton), + input()->pointer()->processButton(qtMouseButtonToButton(Qt::LeftButton), InputRedirection::PointerButtonReleased, std::chrono::milliseconds(event->timestamp())); break; case QEvent::TabletLeaveProximity: @@ -2282,7 +2279,7 @@ public: bool tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, std::chrono::microseconds time) override { - KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); + TabletSeatV2Interface *tabletSeat = findTabletSeat(); auto tool = tabletSeat->toolByHardwareSerial(tabletToolId.m_serialId, getType(tabletToolId)); if (!tool) { tool = createTool(tabletToolId); @@ -2294,7 +2291,7 @@ public: return true; } - KWaylandServer::TabletPadV2Interface *findAndAdoptPad(const TabletPadId &tabletPadId) const + TabletPadV2Interface *findAndAdoptPad(const TabletPadId &tabletPadId) const { Window *window = workspace()->activeWindow(); auto seat = findTabletSeat(); @@ -2302,8 +2299,8 @@ public: return nullptr; } - auto tablet = static_cast(tabletPadId.data); - KWaylandServer::SurfaceInterface *surface = window->surface(); + auto tablet = static_cast(tabletPadId.data); + SurfaceInterface *surface = window->surface(); auto pad = tablet->pad(); if (!pad) { return nullptr; @@ -2332,7 +2329,7 @@ public: ring->sendAngle(angle); if (isFinger) { - ring->sendSource(KWaylandServer::TabletPadRingV2Interface::SourceFinger); + ring->sendSource(TabletPadRingV2Interface::SourceFinger); } ring->sendFrame(std::chrono::duration_cast(time).count()); return true; @@ -2348,16 +2345,16 @@ public: strip->sendPosition(position); if (isFinger) { - strip->sendSource(KWaylandServer::TabletPadStripV2Interface::SourceFinger); + strip->sendSource(TabletPadStripV2Interface::SourceFinger); } strip->sendFrame(std::chrono::duration_cast(time).count()); return true; } - QHash m_cursorByTool; + QHash m_cursorByTool; }; -static KWaylandServer::AbstractDropHandler *dropHandler(Window *window) +static AbstractDropHandler *dropHandler(Window *window) { auto surface = window->surface(); if (!surface) { @@ -2386,7 +2383,7 @@ public: m_raiseTimer.setInterval(250); connect(&m_raiseTimer, &QTimer::timeout, this, &DragAndDropInputFilter::raiseDragTarget); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this] { + connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, [this] { if (!m_currentToplevelDragWindow) { return; } @@ -2452,12 +2449,12 @@ public: break; } case QEvent::MouseButtonPress: - seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Pressed); + seat->notifyPointerButton(nativeButton, PointerButtonState::Pressed); break; case QEvent::MouseButtonRelease: raiseDragTarget(); m_dragTarget = nullptr; - seat->notifyPointerButton(nativeButton, KWaylandServer::PointerButtonState::Released); + seat->notifyPointerButton(nativeButton, PointerButtonState::Released); break; default: break; @@ -2616,7 +2613,7 @@ private: return nullptr; } - void dragToplevel(const QPointF &pos, const KWaylandServer::XdgToplevelDragV1Interface *toplevelDrag) + void dragToplevel(const QPointF &pos, const XdgToplevelDragV1Interface *toplevelDrag) { auto window = toplevelDrag->toplevel() ? waylandServer()->findWindow(toplevelDrag->toplevel()->surface()) : nullptr; @@ -2657,9 +2654,9 @@ InputRedirection::InputRedirection(QObject *parent) , m_touch(new TouchInputRedirection(this)) , m_shortcuts(new GlobalShortcutsManager(this)) { - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); setupInputBackends(); connect(kwinApp(), &Application::workspaceCreated, this, &InputRedirection::setupWorkspace); } @@ -2756,7 +2753,7 @@ public: update(); } - void pointerEvent(KWin::MouseEvent *event) override + void pointerEvent(MouseEvent *event) override { if (event->type() != QEvent::MouseButtonPress) { return; @@ -2764,7 +2761,7 @@ public: update(); } - void tabletPadButtonEvent(uint, bool pressed, const KWin::TabletPadId &, std::chrono::microseconds time) override + void tabletPadButtonEvent(uint, bool pressed, const TabletPadId &, std::chrono::microseconds time) override { if (!pressed) { return; @@ -2772,7 +2769,7 @@ public: update(); } - void tabletToolButtonEvent(uint, bool pressed, const KWin::TabletToolId &, std::chrono::microseconds time) override + void tabletToolButtonEvent(uint, bool pressed, const TabletToolId &, std::chrono::microseconds time) override { if (!pressed) { return; @@ -2780,7 +2777,7 @@ public: update(); } - void tabletToolEvent(KWin::TabletEvent *event) override + void tabletToolEvent(TabletEvent *event) override { if (event->type() != QEvent::TabletPress) { return; @@ -3344,7 +3341,7 @@ QPointF InputRedirection::globalPointer() const return m_pointer->pos(); } -void InputRedirection::startInteractiveWindowSelection(std::function callback, const QByteArray &cursorName) +void InputRedirection::startInteractiveWindowSelection(std::function callback, const QByteArray &cursorName) { if (!m_windowSelector || m_windowSelector->isActive()) { callback(nullptr); diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index ac0b3f23f3..f6550c9903 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -46,8 +46,6 @@ #include #include -using namespace KWaylandServer; - namespace KWin { @@ -67,7 +65,7 @@ static std::vector textToKey(const QString &text) return {}; } - auto keyCode = KWin::input()->keyboard()->xkb()->keycodeFromKeysym(sym); + auto keyCode = input()->keyboard()->xkb()->keycodeFromKeysym(sym); if (!keyCode) { return {}; } @@ -382,7 +380,7 @@ void InputMethod::textInputInterfaceV1StateUpdated(quint32 serial) inputContext->sendCommitState(serial); } -void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServer::TextInputV2Interface::UpdateReason reason) +void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, TextInputV2Interface::UpdateReason reason) { if (!m_enabled) { return; @@ -400,13 +398,13 @@ void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServe m_panel->allow(); } switch (reason) { - case KWaylandServer::TextInputV2Interface::UpdateReason::StateChange: + case TextInputV2Interface::UpdateReason::StateChange: break; - case KWaylandServer::TextInputV2Interface::UpdateReason::StateEnter: - case KWaylandServer::TextInputV2Interface::UpdateReason::StateFull: + case TextInputV2Interface::UpdateReason::StateEnter: + case TextInputV2Interface::UpdateReason::StateFull: adoptInputMethodContext(); break; - case KWaylandServer::TextInputV2Interface::UpdateReason::StateReset: + case TextInputV2Interface::UpdateReason::StateReset: inputContext->sendReset(); break; } @@ -534,11 +532,11 @@ void InputMethod::keysymReceived(quint32 serial, quint32 time, quint32 sym, bool return; } - KWaylandServer::KeyboardKeyState state; + KeyboardKeyState state; if (pressed) { - state = KWaylandServer::KeyboardKeyState::Pressed; + state = KeyboardKeyState::Pressed; } else { - state = KWaylandServer::KeyboardKeyState::Released; + state = KeyboardKeyState::Released; } waylandServer()->seat()->notifyKeyboardKey(keysymToKeycode(sym), state); } @@ -571,7 +569,7 @@ void InputMethod::commitString(qint32 serial, const QString &text) // First, send all the extracted keys as pressed keys to the client. for (const auto &key : keys) { - waylandServer()->seat()->notifyKeyboardKey(key, KWaylandServer::KeyboardKeyState::Pressed); + waylandServer()->seat()->notifyKeyboardKey(key, KeyboardKeyState::Pressed); } // Then, send key release for those keys in reverse. @@ -582,7 +580,7 @@ void InputMethod::commitString(qint32 serial, const QString &text) auto key = *itr; QMetaObject::invokeMethod( this, [key]() { - waylandServer()->seat()->notifyKeyboardKey(key, KWaylandServer::KeyboardKeyState::Released); + waylandServer()->seat()->notifyKeyboardKey(key, KeyboardKeyState::Released); }, Qt::QueuedConnection); } @@ -741,7 +739,7 @@ void InputMethod::setPreeditString(uint32_t serial, const QString &text, const Q void InputMethod::key(quint32 /*serial*/, quint32 /*time*/, quint32 keyCode, bool pressed) { waylandServer()->seat()->notifyKeyboardKey(keyCode, - pressed ? KWaylandServer::KeyboardKeyState::Pressed : KWaylandServer::KeyboardKeyState::Released); + pressed ? KeyboardKeyState::Pressed : KeyboardKeyState::Released); } void InputMethod::modifiers(quint32 serial, quint32 mods_depressed, quint32 mods_latched, quint32 mods_locked, quint32 group) @@ -779,14 +777,14 @@ void InputMethod::adoptInputMethodContext() inputContext->sendSurroundingText(t1->surroundingText(), t1->surroundingTextCursorPosition(), t1->surroundingTextSelectionAnchor()); inputContext->sendPreferredLanguage(t1->preferredLanguage()); inputContext->sendContentType(t1->contentHints(), t2->contentPurpose()); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::language, this, &InputMethod::setLanguage); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection); + connect(inputContext, &InputMethodContextV1Interface::language, this, &InputMethod::setLanguage); + connect(inputContext, &InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection); } else if (t2 && t2->isEnabled()) { inputContext->sendSurroundingText(t2->surroundingText(), t2->surroundingTextCursorPosition(), t2->surroundingTextSelectionAnchor()); inputContext->sendPreferredLanguage(t2->preferredLanguage()); inputContext->sendContentType(t2->contentHints(), t2->contentPurpose()); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::language, this, &InputMethod::setLanguage); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection); + connect(inputContext, &InputMethodContextV1Interface::language, this, &InputMethod::setLanguage); + connect(inputContext, &InputMethodContextV1Interface::textDirection, this, &InputMethod::setTextDirection); } else if (t3 && t3->isEnabled()) { inputContext->sendSurroundingText(t3->surroundingText(), t3->surroundingTextCursorPosition(), t3->surroundingTextSelectionAnchor()); inputContext->sendContentType(t3->contentHints(), t3->contentPurpose()); @@ -794,22 +792,22 @@ void InputMethod::adoptInputMethodContext() // When we have neither text-input-v2 nor text-input-v3 we can only send // fake key events, not more complex text. So ask the input method to // only send basic characters without any pre-editing. - inputContext->sendContentType(KWaylandServer::TextInputContentHint::Latin, KWaylandServer::TextInputContentPurpose::Normal); + inputContext->sendContentType(TextInputContentHint::Latin, TextInputContentPurpose::Normal); } inputContext->sendCommitState(m_serial++); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keysym, this, &InputMethod::keysymReceived, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::key, this, &InputMethod::key, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiers, this, &InputMethod::modifiers, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::commitString, this, &InputMethod::commitString, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::deleteSurroundingText, this, &InputMethod::deleteSurroundingText, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::cursorPosition, this, &InputMethod::setCursorPosition, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditStyling, this, &InputMethod::setPreeditStyling, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection); - connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::keysym, this, &InputMethod::keysymReceived, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::key, this, &InputMethod::key, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::modifiers, this, &InputMethod::modifiers, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::commitString, this, &InputMethod::commitString, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::deleteSurroundingText, this, &InputMethod::deleteSurroundingText, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::cursorPosition, this, &InputMethod::setCursorPosition, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::preeditStyling, this, &InputMethod::setPreeditStyling, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection); + connect(inputContext, &InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection); } void InputMethod::updateInputPanelState() @@ -928,12 +926,12 @@ bool InputMethod::isActive() const return waylandServer()->inputMethod()->context(); } -KWaylandServer::InputMethodGrabV1 *InputMethod::keyboardGrab() +InputMethodGrabV1 *InputMethod::keyboardGrab() { return isActive() ? m_keyboardGrab : nullptr; } -void InputMethod::installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab) +void InputMethod::installKeyboardGrab(InputMethodGrabV1 *keyboardGrab) { auto xkb = input()->keyboard()->xkb(); m_keyboardGrab = keyboardGrab; diff --git a/src/inputmethod.h b/src/inputmethod.h index 1215895fdc..52c897245e 100644 --- a/src/inputmethod.h +++ b/src/inputmethod.h @@ -23,16 +23,12 @@ class QProcess; -namespace KWaylandServer -{ -class InputMethodGrabV1; -} - namespace KWin { class Window; class InputPanelV1Window; +class InputMethodGrabV1; /** * This class implements the zwp_input_method_unstable_v1, which is currently used to provide @@ -67,7 +63,7 @@ public: void setPanel(InputPanelV1Window *panel); void setInputMethodCommand(const QString &path); - KWaylandServer::InputMethodGrabV1 *keyboardGrab(); + InputMethodGrabV1 *keyboardGrab(); bool shouldShowOnActive() const; void forwardModifiers(ForwardModifiersForce force); @@ -94,7 +90,7 @@ private Q_SLOTS: void textInputInterfaceV1StateUpdated(quint32 serial); void textInputInterfaceV1Reset(); void invokeAction(quint32 button, quint32 index); - void textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServer::TextInputV2Interface::UpdateReason reason); + void textInputInterfaceV2StateUpdated(quint32 serial, KWin::TextInputV2Interface::UpdateReason reason); void textInputInterfaceV3EnableRequested(); // inputcontext slots @@ -116,7 +112,7 @@ private: void startInputMethod(); void stopInputMethod(); void setTrackedWindow(Window *trackedWindow); - void installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab); + void installKeyboardGrab(InputMethodGrabV1 *keyboardGrab); void updateModifiersMap(const QByteArray &modifiers); bool touchEventTriggered() const; @@ -134,7 +130,7 @@ private: quint32 m_serial = 0; QPointer m_panel; QPointer m_trackedWindow; - QPointer m_keyboardGrab; + QPointer m_keyboardGrab; QProcess *m_inputMethodProcess = nullptr; QTimer m_inputMethodCrashTimer; diff --git a/src/inputpanelv1integration.cpp b/src/inputpanelv1integration.cpp index 404b3cb7e2..db6f0cebb9 100644 --- a/src/inputpanelv1integration.cpp +++ b/src/inputpanelv1integration.cpp @@ -10,8 +10,6 @@ #include "wayland/inputmethod_v1.h" #include "wayland_server.h" -using namespace KWaylandServer; - namespace KWin { diff --git a/src/inputpanelv1integration.h b/src/inputpanelv1integration.h index 1e542567bd..61b0d4d091 100644 --- a/src/inputpanelv1integration.h +++ b/src/inputpanelv1integration.h @@ -8,14 +8,11 @@ #include "waylandshellintegration.h" -namespace KWaylandServer -{ -class InputPanelSurfaceV1Interface; -} - namespace KWin { +class InputPanelSurfaceV1Interface; + class InputPanelV1Integration : public WaylandShellIntegration { Q_OBJECT @@ -23,7 +20,7 @@ class InputPanelV1Integration : public WaylandShellIntegration public: explicit InputPanelV1Integration(QObject *parent = nullptr); - void createWindow(KWaylandServer::InputPanelSurfaceV1Interface *shellSurface); + void createWindow(InputPanelSurfaceV1Interface *shellSurface); }; } // namespace KWin diff --git a/src/inputpanelv1window.cpp b/src/inputpanelv1window.cpp index 8f7ecdf0ec..9706b10699 100644 --- a/src/inputpanelv1window.cpp +++ b/src/inputpanelv1window.cpp @@ -19,8 +19,6 @@ #include "wayland_server.h" #include "workspace.h" -using namespace KWaylandServer; - namespace KWin { @@ -78,7 +76,7 @@ void InputPanelV1Window::hide() } } -void KWin::InputPanelV1Window::reposition() +void InputPanelV1Window::reposition() { if (!readyForPainting()) { return; diff --git a/src/inputpanelv1window.h b/src/inputpanelv1window.h index 24ca9f4c7f..f791fa911f 100644 --- a/src/inputpanelv1window.h +++ b/src/inputpanelv1window.h @@ -21,7 +21,7 @@ class InputPanelV1Window : public WaylandWindow { Q_OBJECT public: - InputPanelV1Window(KWaylandServer::InputPanelSurfaceV1Interface *panelSurface); + InputPanelV1Window(InputPanelSurfaceV1Interface *panelSurface); enum class Mode { None, @@ -85,7 +85,7 @@ protected: void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override; private: - void showTopLevel(KWaylandServer::OutputInterface *output, KWaylandServer::InputPanelSurfaceV1Interface::Position position); + void showTopLevel(OutputInterface *output, InputPanelSurfaceV1Interface::Position position); void showOverlayPanel(); void reposition(); void handleMapped(); @@ -95,7 +95,7 @@ private: Mode m_mode = Mode::None; bool m_allowed = false; bool m_virtualKeyboardShouldBeShown = false; - const QPointer m_panelSurface; + const QPointer m_panelSurface; }; } diff --git a/src/keyboard_input.cpp b/src/keyboard_input.cpp index 591d646c0d..ac3ce9754c 100644 --- a/src/keyboard_input.cpp +++ b/src/keyboard_input.cpp @@ -123,7 +123,7 @@ void KeyboardInputRedirection::init() // Workaround for QTBUG-54371: if there is no real keyboard Qt doesn't request virtual keyboard waylandServer()->seat()->setHasKeyboard(true); // connect(m_input, &InputRedirection::hasAlphaNumericKeyboardChanged, - // waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasKeyboard); + // waylandServer()->seat(), &KWin::SeatInterface::setHasKeyboard); m_input->installInputEventSpy(new KeyStateChangedSpy(m_input)); m_modifiersChangedSpy = new ModifiersChangedSpy(m_input); diff --git a/src/layershellv1integration.cpp b/src/layershellv1integration.cpp index 7b7ac79b86..1f18e559db 100644 --- a/src/layershellv1integration.cpp +++ b/src/layershellv1integration.cpp @@ -15,8 +15,6 @@ #include -using namespace KWaylandServer; - namespace KWin { @@ -27,7 +25,7 @@ LayerShellV1Integration::LayerShellV1Integration(QObject *parent) : WaylandShellIntegration(parent) { LayerShellV1Interface *shell = new LayerShellV1Interface(waylandServer()->display(), this); - connect(shell, &KWaylandServer::LayerShellV1Interface::surfaceCreated, + connect(shell, &LayerShellV1Interface::surfaceCreated, this, &LayerShellV1Integration::createWindow); m_rearrangeTimer = new QTimer(this); diff --git a/src/layershellv1integration.h b/src/layershellv1integration.h index f5982d5e3a..6d6a4b17f6 100644 --- a/src/layershellv1integration.h +++ b/src/layershellv1integration.h @@ -8,14 +8,11 @@ #include "waylandshellintegration.h" -namespace KWaylandServer -{ -class LayerSurfaceV1Interface; -} - namespace KWin { +class LayerSurfaceV1Interface; + class LayerShellV1Integration : public WaylandShellIntegration { Q_OBJECT @@ -26,9 +23,9 @@ public: void rearrange(); void scheduleRearrange(); - void createWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface); - void recreateWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface); - void destroyWindow(KWaylandServer::LayerSurfaceV1Interface *shellSurface); + void createWindow(LayerSurfaceV1Interface *shellSurface); + void recreateWindow(LayerSurfaceV1Interface *shellSurface); + void destroyWindow(LayerSurfaceV1Interface *shellSurface); private: QTimer *m_rearrangeTimer; diff --git a/src/layershellv1window.cpp b/src/layershellv1window.cpp index 58c5e381b3..3f05b2c580 100644 --- a/src/layershellv1window.cpp +++ b/src/layershellv1window.cpp @@ -15,8 +15,6 @@ #include "wayland_server.h" #include "workspace.h" -using namespace KWaylandServer; - namespace KWin { @@ -295,15 +293,15 @@ void LayerShellV1Window::showOnScreenEdge() QTimer::singleShot(0, this, &LayerShellV1Window::deactivateScreenEdge); } -void LayerShellV1Window::installAutoHideScreenEdgeV1(KWaylandServer::AutoHideScreenEdgeV1Interface *edge) +void LayerShellV1Window::installAutoHideScreenEdgeV1(AutoHideScreenEdgeV1Interface *edge) { m_screenEdge = edge; - connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::destroyed, + connect(edge, &AutoHideScreenEdgeV1Interface::destroyed, this, &LayerShellV1Window::deactivateScreenEdge); - connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::activateRequested, + connect(edge, &AutoHideScreenEdgeV1Interface::activateRequested, this, &LayerShellV1Window::activateScreenEdge); - connect(edge, &KWaylandServer::AutoHideScreenEdgeV1Interface::deactivateRequested, + connect(edge, &AutoHideScreenEdgeV1Interface::deactivateRequested, this, &LayerShellV1Window::deactivateScreenEdge); connect(this, &LayerShellV1Window::frameGeometryChanged, edge, [this]() { diff --git a/src/layershellv1window.h b/src/layershellv1window.h index f2c5aa2da2..b825498d01 100644 --- a/src/layershellv1window.h +++ b/src/layershellv1window.h @@ -8,15 +8,11 @@ #include "waylandwindow.h" -namespace KWaylandServer -{ -class AutoHideScreenEdgeV1Interface; -class LayerSurfaceV1Interface; -} - namespace KWin { +class AutoHideScreenEdgeV1Interface; +class LayerSurfaceV1Interface; class Output; class LayerShellV1Integration; @@ -25,11 +21,11 @@ class LayerShellV1Window : public WaylandWindow Q_OBJECT public: - explicit LayerShellV1Window(KWaylandServer::LayerSurfaceV1Interface *shellSurface, + explicit LayerShellV1Window(LayerSurfaceV1Interface *shellSurface, Output *output, LayerShellV1Integration *integration); - KWaylandServer::LayerSurfaceV1Interface *shellSurface() const; + LayerSurfaceV1Interface *shellSurface() const; Output *desiredOutput() const; NET::WindowType windowType(bool direct = false) const override; @@ -47,7 +43,7 @@ public: void setVirtualKeyboardGeometry(const QRectF &geo) override; void showOnScreenEdge() override; - void installAutoHideScreenEdgeV1(KWaylandServer::AutoHideScreenEdgeV1Interface *edge); + void installAutoHideScreenEdgeV1(AutoHideScreenEdgeV1Interface *edge); protected: Layer belongsToLayer() const override; @@ -68,8 +64,8 @@ private: Output *m_desiredOutput; LayerShellV1Integration *m_integration; - KWaylandServer::LayerSurfaceV1Interface *m_shellSurface; - QPointer m_screenEdge; + LayerSurfaceV1Interface *m_shellSurface; + QPointer m_screenEdge; bool m_screenEdgeActive = false; NET::WindowType m_windowType; }; diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index c5e0cde3d0..33cafd3b63 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -61,15 +61,11 @@ namespace KDecoration2 class Decoration; } -namespace KWaylandServer -{ -class SurfaceInterface; -class Display; -} - namespace KWin { +class SurfaceInterface; +class Display; class PaintDataPrivate; class WindowPaintDataPrivate; @@ -1101,7 +1097,7 @@ public: virtual double animationTimeFactor() const = 0; Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(WId id) const = 0; - Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(KWaylandServer::SurfaceInterface *surf) const = 0; + Q_SCRIPTABLE virtual KWin::EffectWindow *findWindow(SurfaceInterface *surf) const = 0; /** * Finds the EffectWindow for the internal window @p w. * If there is no such window @c null is returned. @@ -1266,7 +1262,7 @@ public: * on Wayland, on X11 it will be nullptr * @since 5.5 */ - virtual KWaylandServer::Display *waylandDisplay() const = 0; + virtual Display *waylandDisplay() const = 0; /** * Whether animations are supported by the Scene. @@ -2552,7 +2548,7 @@ public: /** * @since 5.5 */ - virtual KWaylandServer::SurfaceInterface *surface() const = 0; + virtual SurfaceInterface *surface() const = 0; /** * @since 5.6 diff --git a/src/main.cpp b/src/main.cpp index da0ab35753..b6a8fe43cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,7 +84,7 @@ Application::Application(Application::OperationMode mode, int &argc, char **argv { qRegisterMetaType("Options::WindowOperation"); qRegisterMetaType(); - qRegisterMetaType("KWaylandServer::SurfaceInterface *"); + qRegisterMetaType("KWin::SurfaceInterface *"); qRegisterMetaType(); qRegisterMetaType(); } diff --git a/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp b/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp index 39919b08bb..4f300591f6 100644 --- a/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/src/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -182,7 +182,7 @@ void AbstractEglBackend::initWayland() .formatTable = filterFormats(-1), }); - KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf(); + LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf(); dmabuf->setRenderBackend(this); dmabuf->setSupportedFormatsWithModifiers(m_tranches); } @@ -239,7 +239,7 @@ void AbstractEglBackend::setSurface(const EGLSurface &surface) m_surface = surface; } -QVector AbstractEglBackend::tranches() const +QVector AbstractEglBackend::tranches() const { return m_tranches; } diff --git a/src/platformsupport/scenes/opengl/abstract_egl_backend.h b/src/platformsupport/scenes/opengl/abstract_egl_backend.h index a01aaf8e45..233839163d 100644 --- a/src/platformsupport/scenes/opengl/abstract_egl_backend.h +++ b/src/platformsupport/scenes/opengl/abstract_egl_backend.h @@ -40,7 +40,7 @@ public: bool testImportBuffer(GraphicsBuffer *buffer) override; QHash> supportedFormats() const override; - QVector tranches() const; + QVector tranches() const; dev_t deviceId() const; virtual bool prefer10bpc() const; @@ -73,7 +73,7 @@ private: std::unique_ptr m_context; QList m_clientExtensions; const dev_t m_deviceId; - QVector m_tranches; + QVector m_tranches; QHash m_importedBuffers; }; diff --git a/src/plugins/backgroundcontrast/contrast.cpp b/src/plugins/backgroundcontrast/contrast.cpp index 94a6c192b2..f45732d0ca 100644 --- a/src/plugins/backgroundcontrast/contrast.cpp +++ b/src/plugins/backgroundcontrast/contrast.cpp @@ -28,7 +28,7 @@ namespace KWin static const QByteArray s_contrastAtomName = QByteArrayLiteral("_KDE_NET_WM_BACKGROUND_CONTRAST_REGION"); -KWaylandServer::ContrastManagerInterface *ContrastEffect::s_contrastManager = nullptr; +ContrastManagerInterface *ContrastEffect::s_contrastManager = nullptr; QTimer *ContrastEffect::s_contrastManagerRemoveTimer = nullptr; ContrastEffect::ContrastEffect() @@ -53,7 +53,7 @@ ContrastEffect::ContrastEffect() } s_contrastManagerRemoveTimer->stop(); if (!s_contrastManager) { - s_contrastManager = new KWaylandServer::ContrastManagerInterface(effects->waylandDisplay(), s_contrastManagerRemoveTimer); + s_contrastManager = new ContrastManagerInterface(effects->waylandDisplay(), s_contrastManagerRemoveTimer); } } } @@ -129,7 +129,7 @@ void ContrastEffect::updateContrastRegion(EffectWindow *w) valid = !value.isNull(); } - KWaylandServer::SurfaceInterface *surf = w->surface(); + SurfaceInterface *surf = w->surface(); if (surf && surf->contrast()) { region = surf->contrast()->region(); @@ -173,10 +173,10 @@ void ContrastEffect::updateContrastRegion(EffectWindow *w) void ContrastEffect::slotWindowAdded(EffectWindow *w) { - KWaylandServer::SurfaceInterface *surf = w->surface(); + SurfaceInterface *surf = w->surface(); if (surf) { - m_contrastChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::contrastChanged, this, [this, w]() { + m_contrastChangedConnections[w] = connect(surf, &SurfaceInterface::contrastChanged, this, [this, w]() { if (w) { updateContrastRegion(w); } diff --git a/src/plugins/backgroundcontrast/contrast.h b/src/plugins/backgroundcontrast/contrast.h index 0299bba34a..e28553068f 100644 --- a/src/plugins/backgroundcontrast/contrast.h +++ b/src/plugins/backgroundcontrast/contrast.h @@ -15,14 +15,10 @@ #include #include -namespace KWaylandServer -{ -class ContrastManagerInterface; -} - namespace KWin { +class ContrastManagerInterface; class ContrastShader; class ContrastEffect : public KWin::Effect @@ -76,7 +72,7 @@ private: std::unique_ptr fbo; }; std::unordered_map m_windowData; - static KWaylandServer::ContrastManagerInterface *s_contrastManager; + static ContrastManagerInterface *s_contrastManager; static QTimer *s_contrastManagerRemoveTimer; }; diff --git a/src/plugins/blur/blur.cpp b/src/plugins/blur/blur.cpp index 49b9bc85c0..9339284256 100644 --- a/src/plugins/blur/blur.cpp +++ b/src/plugins/blur/blur.cpp @@ -45,7 +45,7 @@ namespace KWin static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEHIND_REGION"); -KWaylandServer::BlurManagerInterface *BlurEffect::s_blurManager = nullptr; +BlurManagerInterface *BlurEffect::s_blurManager = nullptr; QTimer *BlurEffect::s_blurManagerRemoveTimer = nullptr; BlurEffect::BlurEffect() @@ -107,7 +107,7 @@ BlurEffect::BlurEffect() } s_blurManagerRemoveTimer->stop(); if (!s_blurManager) { - s_blurManager = new KWaylandServer::BlurManagerInterface(effects->waylandDisplay(), s_blurManagerRemoveTimer); + s_blurManager = new BlurManagerInterface(effects->waylandDisplay(), s_blurManagerRemoveTimer); } } @@ -229,7 +229,7 @@ void BlurEffect::updateBlurRegion(EffectWindow *w) valid = !value.isNull(); } - KWaylandServer::SurfaceInterface *surf = w->surface(); + SurfaceInterface *surf = w->surface(); if (surf && surf->blur()) { region = surf->blur()->region(); @@ -256,10 +256,10 @@ void BlurEffect::updateBlurRegion(EffectWindow *w) void BlurEffect::slotWindowAdded(EffectWindow *w) { - KWaylandServer::SurfaceInterface *surf = w->surface(); + SurfaceInterface *surf = w->surface(); if (surf) { - windowBlurChangedConnections[w] = connect(surf, &KWaylandServer::SurfaceInterface::blurChanged, this, [this, w]() { + windowBlurChangedConnections[w] = connect(surf, &SurfaceInterface::blurChanged, this, [this, w]() { if (w) { updateBlurRegion(w); } diff --git a/src/plugins/blur/blur.h b/src/plugins/blur/blur.h index 99ae653cde..fbb6c9a8e3 100644 --- a/src/plugins/blur/blur.h +++ b/src/plugins/blur/blur.h @@ -14,14 +14,11 @@ #include -namespace KWaylandServer -{ -class BlurManagerInterface; -} - namespace KWin { +class BlurManagerInterface; + struct BlurRenderData { /// Temporary render targets needed for the Dual Kawase algorithm, the first texture @@ -144,7 +141,7 @@ private: QMap windowBlurChangedConnections; std::unordered_map m_windows; - static KWaylandServer::BlurManagerInterface *s_blurManager; + static BlurManagerInterface *s_blurManager; static QTimer *s_blurManagerRemoveTimer; }; diff --git a/src/plugins/screencast/screencastmanager.cpp b/src/plugins/screencast/screencastmanager.cpp index 9a8215bd65..0a8964563d 100644 --- a/src/plugins/screencast/screencastmanager.cpp +++ b/src/plugins/screencast/screencastmanager.cpp @@ -29,12 +29,12 @@ namespace KWin { ScreencastManager::ScreencastManager() - : m_screencast(new KWaylandServer::ScreencastV1Interface(waylandServer()->display(), this)) + : m_screencast(new ScreencastV1Interface(waylandServer()->display(), this)) { - connect(m_screencast, &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow); - connect(m_screencast, &KWaylandServer::ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput); - connect(m_screencast, &KWaylandServer::ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput); - connect(m_screencast, &KWaylandServer::ScreencastV1Interface::regionScreencastRequested, this, &ScreencastManager::streamRegion); + connect(m_screencast, &ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow); + connect(m_screencast, &ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput); + connect(m_screencast, &ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput); + connect(m_screencast, &ScreencastV1Interface::regionScreencastRequested, this, &ScreencastManager::streamRegion); } static QRegion scaleRegion(const QRegion &_region, qreal scale) @@ -96,9 +96,9 @@ private: QTimer m_timer; }; -void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface *waylandStream, +void ScreencastManager::streamWindow(ScreencastStreamV1Interface *waylandStream, const QString &winid, - KWaylandServer::ScreencastV1Interface::CursorMode mode) + ScreencastV1Interface::CursorMode mode) { auto window = Workspace::self()->findWindow(QUuid(winid)); if (!window) { @@ -108,7 +108,7 @@ void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface auto stream = new WindowStream(window, this); stream->setCursorMode(mode, 1, window->clientGeometry()); - if (mode != KWaylandServer::ScreencastV1Interface::CursorMode::Hidden) { + if (mode != ScreencastV1Interface::CursorMode::Hidden) { connect(window, &Window::clientGeometryChanged, stream, [window, stream, mode]() { stream->setCursorMode(mode, 1, window->clientGeometry().toRect()); }); @@ -117,29 +117,29 @@ void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface integrateStreams(waylandStream, stream); } -void ScreencastManager::streamVirtualOutput(KWaylandServer::ScreencastStreamV1Interface *stream, +void ScreencastManager::streamVirtualOutput(ScreencastStreamV1Interface *stream, const QString &name, const QSize &size, double scale, - KWaylandServer::ScreencastV1Interface::CursorMode mode) + ScreencastV1Interface::CursorMode mode) { auto output = kwinApp()->outputBackend()->createVirtualOutput(name, size, scale); streamOutput(stream, output, mode); - connect(stream, &KWaylandServer::ScreencastStreamV1Interface::finished, output, [output] { + connect(stream, &ScreencastStreamV1Interface::finished, output, [output] { kwinApp()->outputBackend()->removeVirtualOutput(output); }); } -void ScreencastManager::streamWaylandOutput(KWaylandServer::ScreencastStreamV1Interface *waylandStream, - KWaylandServer::OutputInterface *output, - KWaylandServer::ScreencastV1Interface::CursorMode mode) +void ScreencastManager::streamWaylandOutput(ScreencastStreamV1Interface *waylandStream, + OutputInterface *output, + ScreencastV1Interface::CursorMode mode) { streamOutput(waylandStream, output->handle(), mode); } -void ScreencastManager::streamOutput(KWaylandServer::ScreencastStreamV1Interface *waylandStream, +void ScreencastManager::streamOutput(ScreencastStreamV1Interface *waylandStream, Output *streamOutput, - KWaylandServer::ScreencastV1Interface::CursorMode mode) + ScreencastV1Interface::CursorMode mode) { if (!streamOutput) { waylandStream->sendFailed(i18n("Could not find output")); @@ -166,7 +166,7 @@ static QString rectToString(const QRect &rect) return QStringLiteral("%1,%2 %3x%4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()); } -void ScreencastManager::streamRegion(KWaylandServer::ScreencastStreamV1Interface *waylandStream, const QRect &geometry, qreal scale, KWaylandServer::ScreencastV1Interface::CursorMode mode) +void ScreencastManager::streamRegion(ScreencastStreamV1Interface *waylandStream, const QRect &geometry, qreal scale, ScreencastV1Interface::CursorMode mode) { if (!geometry.isValid()) { waylandStream->sendFailed(i18n("Invalid region")); @@ -206,9 +206,9 @@ void ScreencastManager::streamRegion(KWaylandServer::ScreencastStreamV1Interface integrateStreams(waylandStream, stream); } -void ScreencastManager::integrateStreams(KWaylandServer::ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream) +void ScreencastManager::integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream) { - connect(waylandStream, &KWaylandServer::ScreencastStreamV1Interface::finished, stream, &ScreenCastStream::stop); + connect(waylandStream, &ScreencastStreamV1Interface::finished, stream, &ScreenCastStream::stop); connect(stream, &ScreenCastStream::stopStreaming, waylandStream, [stream, waylandStream] { waylandStream->sendClosed(); stream->deleteLater(); diff --git a/src/plugins/screencast/screencastmanager.h b/src/plugins/screencast/screencastmanager.h index 0ecf850aa2..c4829c0bd0 100644 --- a/src/plugins/screencast/screencastmanager.h +++ b/src/plugins/screencast/screencastmanager.h @@ -25,27 +25,27 @@ public: explicit ScreencastManager(); private: - void streamWindow(KWaylandServer::ScreencastStreamV1Interface *stream, + void streamWindow(ScreencastStreamV1Interface *stream, const QString &winid, - KWaylandServer::ScreencastV1Interface::CursorMode mode); - void streamWaylandOutput(KWaylandServer::ScreencastStreamV1Interface *stream, - KWaylandServer::OutputInterface *output, - KWaylandServer::ScreencastV1Interface::CursorMode mode); + ScreencastV1Interface::CursorMode mode); + void streamWaylandOutput(ScreencastStreamV1Interface *stream, + OutputInterface *output, + ScreencastV1Interface::CursorMode mode); void - streamOutput(KWaylandServer::ScreencastStreamV1Interface *stream, Output *output, KWaylandServer::ScreencastV1Interface::CursorMode mode); - void streamVirtualOutput(KWaylandServer::ScreencastStreamV1Interface *stream, + streamOutput(ScreencastStreamV1Interface *stream, Output *output, ScreencastV1Interface::CursorMode mode); + void streamVirtualOutput(ScreencastStreamV1Interface *stream, const QString &name, const QSize &size, double scale, - KWaylandServer::ScreencastV1Interface::CursorMode mode); - void streamRegion(KWaylandServer::ScreencastStreamV1Interface *stream, + ScreencastV1Interface::CursorMode mode); + void streamRegion(ScreencastStreamV1Interface *stream, const QRect &geometry, qreal scale, - KWaylandServer::ScreencastV1Interface::CursorMode mode); + ScreencastV1Interface::CursorMode mode); - void integrateStreams(KWaylandServer::ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream); + void integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream); - KWaylandServer::ScreencastV1Interface *m_screencast; + ScreencastV1Interface *m_screencast; }; } // namespace KWin diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp index afb180642a..80428d54de 100644 --- a/src/plugins/screencast/screencaststream.cpp +++ b/src/plugins/screencast/screencaststream.cpp @@ -424,12 +424,12 @@ bool ScreenCastStream::createStream() return false; } - if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded) { + if (m_cursor.mode == ScreencastV1Interface::Embedded) { connect(Cursors::self(), &Cursors::currentCursorChanged, this, &ScreenCastStream::invalidateCursor); connect(Cursors::self(), &Cursors::positionChanged, this, [this] { recordFrame({}); }); - } else if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) { + } else if (m_cursor.mode == ScreencastV1Interface::Metadata) { connect(Cursors::self(), &Cursors::currentCursorChanged, this, &ScreenCastStream::invalidateCursor); connect(Cursors::self(), &Cursors::positionChanged, this, &ScreenCastStream::recordCursor); } @@ -534,7 +534,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion) m_source->render(spa_data, m_videoFormat.format); auto cursor = Cursors::self()->currentCursor(); - if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) { + if (m_cursor.mode == ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) { QImage dest(data, size.width(), size.height(), stride, hasAlpha ? QImage::Format_RGBA8888_Premultiplied : QImage::Format_RGB888); QPainter painter(&dest); const auto position = (cursor->pos() - m_cursor.viewport.topLeft() - cursor->hotspot()) * m_cursor.scale; @@ -556,7 +556,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion) m_source->render(buf->framebuffer()); auto cursor = Cursors::self()->currentCursor(); - if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) { + if (m_cursor.mode == ScreencastV1Interface::Embedded && exclusiveContains(m_cursor.viewport, cursor->pos())) { if (m_cursor.invalid) { m_cursor.invalid = false; const PlatformCursorImage cursorImage = kwinApp()->cursorImage(); @@ -598,7 +598,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion) } } - if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) { + if (m_cursor.mode == ScreencastV1Interface::Metadata) { sendCursorData(Cursors::self()->currentCursor(), (spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor))); } @@ -873,7 +873,7 @@ void ScreenCastStream::sendCursorData(Cursor *cursor, spa_meta_cursor *spa_meta_ } } -void ScreenCastStream::setCursorMode(KWaylandServer::ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport) +void ScreenCastStream::setCursorMode(ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport) { m_cursor.mode = mode; m_cursor.scale = scale; diff --git a/src/plugins/screencast/screencaststream.h b/src/plugins/screencast/screencaststream.h index ca8c403049..b188147f94 100644 --- a/src/plugins/screencast/screencaststream.h +++ b/src/plugins/screencast/screencaststream.h @@ -69,7 +69,7 @@ public: */ void recordFrame(const QRegion &damagedRegion); - void setCursorMode(KWaylandServer::ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport); + void setCursorMode(ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport); public Q_SLOTS: void invalidateCursor(); @@ -124,7 +124,7 @@ private: struct { - KWaylandServer::ScreencastV1Interface::CursorMode mode = KWaylandServer::ScreencastV1Interface::Hidden; + ScreencastV1Interface::CursorMode mode = ScreencastV1Interface::Hidden; const QSize bitmapSize = QSize(256, 256); qreal scale = 1; QRectF viewport; diff --git a/src/plugins/slidingpopups/slidingpopups.cpp b/src/plugins/slidingpopups/slidingpopups.cpp index 398ef804d5..ff75942bc5 100644 --- a/src/plugins/slidingpopups/slidingpopups.cpp +++ b/src/plugins/slidingpopups/slidingpopups.cpp @@ -27,14 +27,14 @@ Q_DECLARE_METATYPE(KWindowEffects::SlideFromLocation) namespace KWin { -KWaylandServer::SlideManagerInterface *SlidingPopupsEffect::s_slideManager = nullptr; +SlideManagerInterface *SlidingPopupsEffect::s_slideManager = nullptr; QTimer *SlidingPopupsEffect::s_slideManagerRemoveTimer = nullptr; SlidingPopupsEffect::SlidingPopupsEffect() { initConfig(); - KWaylandServer::Display *display = effects->waylandDisplay(); + Display *display = effects->waylandDisplay(); if (display) { if (!s_slideManagerRemoveTimer) { s_slideManagerRemoveTimer = new QTimer(QCoreApplication::instance()); @@ -46,7 +46,7 @@ SlidingPopupsEffect::SlidingPopupsEffect() } s_slideManagerRemoveTimer->stop(); if (!s_slideManager) { - s_slideManager = new KWaylandServer::SlideManagerInterface(display, s_slideManagerRemoveTimer); + s_slideManager = new SlideManagerInterface(display, s_slideManagerRemoveTimer); } } @@ -214,7 +214,7 @@ void SlidingPopupsEffect::setupSlideData(EffectWindow *w) // Wayland if (auto surf = w->surface()) { slotWaylandSlideOnShowChanged(w); - connect(surf, &KWaylandServer::SurfaceInterface::slideOnShowHideChanged, this, [this, surf] { + connect(surf, &SurfaceInterface::slideOnShowHideChanged, this, [this, surf] { slotWaylandSlideOnShowChanged(effects->findWindow(surf)); }); } @@ -378,7 +378,7 @@ void SlidingPopupsEffect::slotWaylandSlideOnShowChanged(EffectWindow *w) return; } - KWaylandServer::SurfaceInterface *surf = w->surface(); + SurfaceInterface *surf = w->surface(); if (!surf) { return; } @@ -389,16 +389,16 @@ void SlidingPopupsEffect::slotWaylandSlideOnShowChanged(EffectWindow *w) animData.offset = surf->slideOnShowHide()->offset(); switch (surf->slideOnShowHide()->location()) { - case KWaylandServer::SlideInterface::Location::Top: + case SlideInterface::Location::Top: animData.location = Location::Top; break; - case KWaylandServer::SlideInterface::Location::Left: + case SlideInterface::Location::Left: animData.location = Location::Left; break; - case KWaylandServer::SlideInterface::Location::Right: + case SlideInterface::Location::Right: animData.location = Location::Right; break; - case KWaylandServer::SlideInterface::Location::Bottom: + case SlideInterface::Location::Bottom: default: animData.location = Location::Bottom; break; diff --git a/src/plugins/slidingpopups/slidingpopups.h b/src/plugins/slidingpopups/slidingpopups.h index f8d8420409..a85b3bc2ce 100644 --- a/src/plugins/slidingpopups/slidingpopups.h +++ b/src/plugins/slidingpopups/slidingpopups.h @@ -13,14 +13,11 @@ // Include with base class for effects. #include "libkwineffects/kwineffects.h" -namespace KWaylandServer -{ -class SlideManagerInterface; -} - namespace KWin { +class SlideManagerInterface; + class SlidingPopupsEffect : public Effect { Q_OBJECT @@ -66,7 +63,7 @@ private: void setupSlideData(EffectWindow *w); void setupInputPanelSlide(); - static KWaylandServer::SlideManagerInterface *s_slideManager; + static SlideManagerInterface *s_slideManager; static QTimer *s_slideManagerRemoveTimer; long m_atom = 0; diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index dfb13ce19b..0466f8f711 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -79,7 +79,7 @@ void PointerInputRedirection::init() Q_ASSERT(!inited()); waylandServer()->seat()->setHasPointer(input()->hasPointer()); connect(input(), &InputRedirection::hasPointerChanged, - waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasPointer); + waylandServer()->seat(), &SeatInterface::setHasPointer); m_cursor = new CursorImage(this); setInited(true); @@ -121,7 +121,7 @@ void PointerInputRedirection::init() connect(waylandServer(), &QObject::destroyed, this, [this] { setInited(false); }); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, [this]() { + connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, [this]() { // need to force a focused pointer change setFocus(nullptr); update(); @@ -557,14 +557,14 @@ void PointerInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) seat->setFocusedPointerSurfaceTransformation(focus()->inputTransformation()); }); - m_constraintsConnection = connect(focusNow->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged, + m_constraintsConnection = connect(focusNow->surface(), &SurfaceInterface::pointerConstraintsChanged, this, &PointerInputRedirection::updatePointerConstraints); m_constraintsActivatedConnection = connect(workspace(), &Workspace::windowActivated, this, &PointerInputRedirection::updatePointerConstraints); updatePointerConstraints(); } -void PointerInputRedirection::breakPointerConstraints(KWaylandServer::SurfaceInterface *surface) +void PointerInputRedirection::breakPointerConstraints(SurfaceInterface *surface) { // cancel pointer constraints if (surface) { @@ -641,7 +641,7 @@ void PointerInputRedirection::updatePointerConstraints() if (canConstrain && cf->region().contains(flooredPoint(focus()->mapToLocal(m_pos)))) { cf->setConfined(true); m_confined = true; - m_confinedPointerRegionConnection = connect(cf, &KWaylandServer::ConfinedPointerV1Interface::regionChanged, this, [this]() { + m_confinedPointerRegionConnection = connect(cf, &ConfinedPointerV1Interface::regionChanged, this, [this]() { if (!focus()) { return; } @@ -687,7 +687,7 @@ void PointerInputRedirection::updatePointerConstraints() // The client might cancel pointer locking from its side by unbinding the LockedPointerInterface. // In this case the cached cursor position hint must be fetched before the resource goes away - m_lockedPointerAboutToBeUnboundConnection = connect(lock, &KWaylandServer::LockedPointerV1Interface::aboutToBeDestroyed, this, [this, lock]() { + m_lockedPointerAboutToBeUnboundConnection = connect(lock, &LockedPointerV1Interface::aboutToBeDestroyed, this, [this, lock]() { const auto hint = lock->cursorPositionHint(); if (hint.x() < 0 || hint.y() < 0 || !focus()) { return; @@ -695,7 +695,7 @@ void PointerInputRedirection::updatePointerConstraints() auto globalHint = focus()->mapFromLocal(hint); // When the resource finally goes away, reposition the cursor according to the hint - connect(lock, &KWaylandServer::LockedPointerV1Interface::destroyed, this, [this, globalHint]() { + connect(lock, &LockedPointerV1Interface::destroyed, this, [this, globalHint]() { processMotionAbsolute(globalHint, waylandServer()->seat()->timestamp()); }); }); @@ -904,9 +904,9 @@ CursorImage::CursorImage(PointerInputRedirection *parent) m_serverCursor.shape->setTheme(m_waylandImage.theme()); }); - KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer(); + PointerInterface *pointer = waylandServer()->seat()->pointer(); - connect(pointer, &KWaylandServer::PointerInterface::focusedSurfaceChanged, + connect(pointer, &PointerInterface::focusedSurfaceChanged, this, &CursorImage::handleFocusedSurfaceChanged); reevaluteSource(); @@ -937,11 +937,11 @@ void CursorImage::markAsRendered(std::chrono::milliseconds timestamp) void CursorImage::handleFocusedSurfaceChanged() { - KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer(); + PointerInterface *pointer = waylandServer()->seat()->pointer(); disconnect(m_serverCursor.connection); if (pointer->focusedSurface()) { - m_serverCursor.connection = connect(pointer, &KWaylandServer::PointerInterface::cursorChanged, + m_serverCursor.connection = connect(pointer, &PointerInterface::cursorChanged, this, &CursorImage::updateServerCursor); } else { m_serverCursor.connection = QMetaObject::Connection(); @@ -979,9 +979,9 @@ void CursorImage::updateMoveResize() reevaluteSource(); } -void CursorImage::updateServerCursor(const KWaylandServer::PointerCursor &cursor) +void CursorImage::updateServerCursor(const PointerCursor &cursor) { - if (auto surfaceCursor = std::get_if(&cursor)) { + if (auto surfaceCursor = std::get_if(&cursor)) { m_serverCursor.surface->update((*surfaceCursor)->surface(), (*surfaceCursor)->hotspot()); m_serverCursor.cursor = m_serverCursor.surface.get(); } else if (auto shapeCursor = std::get_if(&cursor)) { @@ -1074,7 +1074,7 @@ void CursorImage::reevaluteSource() setSource(m_decoration.cursor.get()); return; } - const KWaylandServer::PointerInterface *pointer = waylandServer()->seat()->pointer(); + const PointerInterface *pointer = waylandServer()->seat()->pointer(); if (pointer && pointer->focusedSurface()) { setSource(m_serverCursor.cursor); return; diff --git a/src/pointer_input.h b/src/pointer_input.h index 3b08efa9b3..f3d1aa50db 100644 --- a/src/pointer_input.h +++ b/src/pointer_input.h @@ -21,12 +21,6 @@ class QWindow; -namespace KWaylandServer -{ -class PointerSurfaceCursor; -class SurfaceInterface; -} - namespace KWin { class Window; @@ -36,6 +30,8 @@ class InputRedirection; class CursorShape; class ShapeCursorSource; class SurfaceCursorSource; +class PointerSurfaceCursor; +class SurfaceInterface; namespace Decoration { @@ -163,7 +159,7 @@ private: void disconnectConfinedPointerRegionConnection(); void disconnectLockedPointerAboutToBeUnboundConnection(); void disconnectPointerConstraintsConnection(); - void breakPointerConstraints(KWaylandServer::SurfaceInterface *surface); + void breakPointerConstraints(SurfaceInterface *surface); CursorImage *m_cursor; QPointF m_pos; QHash m_buttons; @@ -223,7 +219,7 @@ Q_SIGNALS: private: void reevaluteSource(); - void updateServerCursor(const std::variant &cursor); + void updateServerCursor(const std::variant &cursor); void updateDecoration(); void updateDecorationCursor(); void updateMoveResize(); diff --git a/src/scene/cursoritem.cpp b/src/scene/cursoritem.cpp index 6c9bfdcfff..96011941c0 100644 --- a/src/scene/cursoritem.cpp +++ b/src/scene/cursoritem.cpp @@ -36,7 +36,7 @@ void CursorItem::refresh() } } -void CursorItem::setSurface(KWaylandServer::SurfaceInterface *surface) +void CursorItem::setSurface(SurfaceInterface *surface) { m_imageItem.reset(); diff --git a/src/scene/cursoritem.h b/src/scene/cursoritem.h index 70d400a284..810f3f6542 100644 --- a/src/scene/cursoritem.h +++ b/src/scene/cursoritem.h @@ -24,7 +24,7 @@ public: private: void refresh(); - void setSurface(KWaylandServer::SurfaceInterface *surface); + void setSurface(SurfaceInterface *surface); void setImage(const QImage &image); std::unique_ptr m_imageItem; diff --git a/src/scene/dndiconitem.cpp b/src/scene/dndiconitem.cpp index 1f1c2ea2df..84acde3bb5 100644 --- a/src/scene/dndiconitem.cpp +++ b/src/scene/dndiconitem.cpp @@ -12,16 +12,16 @@ namespace KWin { -DragAndDropIconItem::DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent) +DragAndDropIconItem::DragAndDropIconItem(DragAndDropIcon *icon, Scene *scene, Item *parent) : Item(scene, parent) { m_surfaceItem = std::make_unique(icon->surface(), scene, this); m_surfaceItem->setPosition(icon->position()); - connect(icon, &KWaylandServer::DragAndDropIcon::destroyed, this, [this]() { + connect(icon, &DragAndDropIcon::destroyed, this, [this]() { m_surfaceItem.reset(); }); - connect(icon, &KWaylandServer::DragAndDropIcon::changed, this, [this, icon]() { + connect(icon, &DragAndDropIcon::changed, this, [this, icon]() { m_surfaceItem->setPosition(icon->position()); }); } diff --git a/src/scene/dndiconitem.h b/src/scene/dndiconitem.h index 3c3c316982..97abb7db26 100644 --- a/src/scene/dndiconitem.h +++ b/src/scene/dndiconitem.h @@ -9,14 +9,10 @@ #include "core/output.h" #include "scene/item.h" -namespace KWaylandServer -{ -class DragAndDropIcon; -} - namespace KWin { +class DragAndDropIcon; class SurfaceItemWayland; class DragAndDropIconItem : public Item @@ -24,7 +20,7 @@ class DragAndDropIconItem : public Item Q_OBJECT public: - explicit DragAndDropIconItem(KWaylandServer::DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr); + explicit DragAndDropIconItem(DragAndDropIcon *icon, Scene *scene, Item *parent = nullptr); ~DragAndDropIconItem() override; void frameRendered(quint32 timestamp); diff --git a/src/scene/surfaceitem_wayland.cpp b/src/scene/surfaceitem_wayland.cpp index 35c2ab6739..2f947dd738 100644 --- a/src/scene/surfaceitem_wayland.cpp +++ b/src/scene/surfaceitem_wayland.cpp @@ -16,38 +16,38 @@ namespace KWin { -SurfaceItemWayland::SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent) +SurfaceItemWayland::SurfaceItemWayland(SurfaceInterface *surface, Scene *scene, Item *parent) : SurfaceItem(scene, parent) , m_surface(surface) { - connect(surface, &KWaylandServer::SurfaceInterface::surfaceToBufferMatrixChanged, + connect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged, this, &SurfaceItemWayland::handleSurfaceToBufferMatrixChanged); - connect(surface, &KWaylandServer::SurfaceInterface::sizeChanged, + connect(surface, &SurfaceInterface::sizeChanged, this, &SurfaceItemWayland::handleSurfaceSizeChanged); - connect(surface, &KWaylandServer::SurfaceInterface::bufferSizeChanged, + connect(surface, &SurfaceInterface::bufferSizeChanged, this, &SurfaceItemWayland::handleBufferSizeChanged); - connect(surface, &KWaylandServer::SurfaceInterface::bufferSourceBoxChanged, + connect(surface, &SurfaceInterface::bufferSourceBoxChanged, this, &SurfaceItemWayland::handleBufferSourceBoxChanged); - connect(surface, &KWaylandServer::SurfaceInterface::bufferTransformChanged, + connect(surface, &SurfaceInterface::bufferTransformChanged, this, &SurfaceItemWayland::handleBufferTransformChanged); - connect(surface, &KWaylandServer::SurfaceInterface::childSubSurfacesChanged, + connect(surface, &SurfaceInterface::childSubSurfacesChanged, this, &SurfaceItemWayland::handleChildSubSurfacesChanged); - connect(surface, &KWaylandServer::SurfaceInterface::committed, + connect(surface, &SurfaceInterface::committed, this, &SurfaceItemWayland::handleSurfaceCommitted); - connect(surface, &KWaylandServer::SurfaceInterface::damaged, + connect(surface, &SurfaceInterface::damaged, this, &SurfaceItemWayland::addDamage); - connect(surface, &KWaylandServer::SurfaceInterface::childSubSurfaceRemoved, + connect(surface, &SurfaceInterface::childSubSurfaceRemoved, this, &SurfaceItemWayland::handleChildSubSurfaceRemoved); - KWaylandServer::SubSurfaceInterface *subsurface = surface->subSurface(); + SubSurfaceInterface *subsurface = surface->subSurface(); if (subsurface) { - connect(surface, &KWaylandServer::SurfaceInterface::mapped, + connect(surface, &SurfaceInterface::mapped, this, &SurfaceItemWayland::handleSubSurfaceMappedChanged); - connect(surface, &KWaylandServer::SurfaceInterface::unmapped, + connect(surface, &SurfaceInterface::unmapped, this, &SurfaceItemWayland::handleSubSurfaceMappedChanged); - connect(subsurface, &KWaylandServer::SubSurfaceInterface::positionChanged, + connect(subsurface, &SubSurfaceInterface::positionChanged, this, &SurfaceItemWayland::handleSubSurfacePositionChanged); setVisible(surface->isMapped()); setPosition(subsurface->position()); @@ -74,7 +74,7 @@ QRegion SurfaceItemWayland::opaque() const return QRegion(); } -KWaylandServer::SurfaceInterface *SurfaceItemWayland::surface() const +SurfaceInterface *SurfaceItemWayland::surface() const { return m_surface; } @@ -114,7 +114,7 @@ void SurfaceItemWayland::handleSurfaceCommitted() } } -SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(KWaylandServer::SubSurfaceInterface *child) +SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(SubSurfaceInterface *child) { auto &item = m_subsurfaces[child]; if (!item) { @@ -124,15 +124,15 @@ SurfaceItemWayland *SurfaceItemWayland::getOrCreateSubSurfaceItem(KWaylandServer return item.get(); } -void SurfaceItemWayland::handleChildSubSurfaceRemoved(KWaylandServer::SubSurfaceInterface *child) +void SurfaceItemWayland::handleChildSubSurfaceRemoved(SubSurfaceInterface *child) { m_subsurfaces.erase(child); } void SurfaceItemWayland::handleChildSubSurfacesChanged() { - const QList below = m_surface->below(); - const QList above = m_surface->above(); + const QList below = m_surface->below(); + const QList above = m_surface->above(); for (int i = 0; i < below.count(); ++i) { SurfaceItemWayland *subsurfaceItem = getOrCreateSubSurfaceItem(below[i]); @@ -178,7 +178,7 @@ void SurfacePixmapWayland::create() void SurfacePixmapWayland::update() { - KWaylandServer::SurfaceInterface *surface = m_item->surface(); + SurfaceInterface *surface = m_item->surface(); if (surface) { setBuffer(surface->buffer()); } diff --git a/src/scene/surfaceitem_wayland.h b/src/scene/surfaceitem_wayland.h index f3b54b6f35..67a001426b 100644 --- a/src/scene/surfaceitem_wayland.h +++ b/src/scene/surfaceitem_wayland.h @@ -10,16 +10,12 @@ #include -namespace KWaylandServer -{ -class SubSurfaceInterface; -class SurfaceInterface; -} - namespace KWin { class GraphicsBuffer; +class SubSurfaceInterface; +class SurfaceInterface; class X11Window; /** @@ -30,13 +26,13 @@ class KWIN_EXPORT SurfaceItemWayland : public SurfaceItem Q_OBJECT public: - explicit SurfaceItemWayland(KWaylandServer::SurfaceInterface *surface, Scene *scene, Item *parent = nullptr); + explicit SurfaceItemWayland(SurfaceInterface *surface, Scene *scene, Item *parent = nullptr); QVector shape() const override; QRegion opaque() const override; ContentType contentType() const override; - KWaylandServer::SurfaceInterface *surface() const; + SurfaceInterface *surface() const; private Q_SLOTS: void handleSurfaceToBufferMatrixChanged(); @@ -46,7 +42,7 @@ private Q_SLOTS: void handleBufferSourceBoxChanged(); void handleBufferTransformChanged(); - void handleChildSubSurfaceRemoved(KWaylandServer::SubSurfaceInterface *child); + void handleChildSubSurfaceRemoved(SubSurfaceInterface *child); void handleChildSubSurfacesChanged(); void handleSubSurfacePositionChanged(); void handleSubSurfaceMappedChanged(); @@ -55,10 +51,10 @@ protected: std::unique_ptr createPixmap() override; private: - SurfaceItemWayland *getOrCreateSubSurfaceItem(KWaylandServer::SubSurfaceInterface *s); + SurfaceItemWayland *getOrCreateSubSurfaceItem(SubSurfaceInterface *s); - QPointer m_surface; - std::unordered_map> m_subsurfaces; + QPointer m_surface; + std::unordered_map> m_subsurfaces; }; class KWIN_EXPORT SurfacePixmapWayland final : public SurfacePixmap diff --git a/src/scene/surfaceitem_x11.h b/src/scene/surfaceitem_x11.h index 12cf3bcafe..2d2a8dec29 100644 --- a/src/scene/surfaceitem_x11.h +++ b/src/scene/surfaceitem_x11.h @@ -74,4 +74,4 @@ private: xcb_pixmap_t m_pixmap = XCB_PIXMAP_NONE; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/scene/workspacescene.cpp b/src/scene/workspacescene.cpp index 760e3bbbc4..fbc734082b 100644 --- a/src/scene/workspacescene.cpp +++ b/src/scene/workspacescene.cpp @@ -100,14 +100,14 @@ void WorkspaceScene::initialize() }); if (waylandServer()) { - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem); + connect(waylandServer()->seat(), &SeatInterface::dragStarted, this, &WorkspaceScene::createDndIconItem); + connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, &WorkspaceScene::destroyDndIconItem); } } void WorkspaceScene::createDndIconItem() { - KWaylandServer::DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon(); + DragAndDropIcon *dragIcon = waylandServer()->seat()->dragIcon(); if (!dragIcon) { return; } @@ -120,7 +120,7 @@ void WorkspaceScene::createDndIconItem() }; updatePosition(); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::pointerPosChanged, m_dndIcon.get(), updatePosition); + connect(waylandServer()->seat(), &SeatInterface::pointerPosChanged, m_dndIcon.get(), updatePosition); } else if (waylandServer()->seat()->isDragTouch()) { auto updatePosition = [this]() { const auto touchPos = waylandServer()->seat()->firstTouchPointPosition(); @@ -129,7 +129,7 @@ void WorkspaceScene::createDndIconItem() }; updatePosition(); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::touchMoved, m_dndIcon.get(), updatePosition); + connect(waylandServer()->seat(), &SeatInterface::touchMoved, m_dndIcon.get(), updatePosition); } } diff --git a/src/shadow.cpp b/src/shadow.cpp index f8667bed52..951f06e913 100644 --- a/src/shadow.cpp +++ b/src/shadow.cpp @@ -210,7 +210,7 @@ static QImage shadowTileForBuffer(GraphicsBuffer *buffer) return QImage(); } -bool Shadow::init(const QPointer &shadow) +bool Shadow::init(const QPointer &shadow) { if (!shadow) { return false; diff --git a/src/shadow.h b/src/shadow.h index c4d334429b..0cca918878 100644 --- a/src/shadow.h +++ b/src/shadow.h @@ -18,14 +18,10 @@ class Decoration; class DecorationShadow; } -namespace KWaylandServer -{ -class ShadowInterface; -} - namespace KWin { +class ShadowInterface; class Window; /** @@ -128,7 +124,7 @@ private: static QVector readX11ShadowProperty(xcb_window_t id); bool init(const QVector &data); bool init(KDecoration2::Decoration *decoration); - bool init(const QPointer &shadow); + bool init(const QPointer &shadow); bool init(const QWindow *window); Window *m_window; // shadow elements diff --git a/src/touch_input.cpp b/src/touch_input.cpp index 6795907d82..f2f9805626 100644 --- a/src/touch_input.cpp +++ b/src/touch_input.cpp @@ -43,7 +43,7 @@ void TouchInputRedirection::init() Q_ASSERT(!inited()); waylandServer()->seat()->setHasTouch(input()->hasTouch()); connect(input(), &InputRedirection::hasTouchChanged, - waylandServer()->seat(), &KWaylandServer::SeatInterface::setHasTouch); + waylandServer()->seat(), &SeatInterface::setHasTouch); setInited(true); InputDeviceHandler::init(); @@ -109,7 +109,7 @@ void TouchInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) // TODO: invalidate pointer focus? - // FIXME: add input transformation API to KWaylandServer::SeatInterface for touch input + // FIXME: add input transformation API to SeatInterface for touch input seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos()); m_focusGeometryConnection = connect(focusNow, &Window::frameGeometryChanged, this, [this]() { if (!focus()) { diff --git a/src/utils/subsurfacemonitor.cpp b/src/utils/subsurfacemonitor.cpp index 6bd041445a..b7fef609d6 100644 --- a/src/utils/subsurfacemonitor.cpp +++ b/src/utils/subsurfacemonitor.cpp @@ -12,8 +12,6 @@ #include "wayland/subcompositor.h" #include "wayland/surface.h" -using namespace KWaylandServer; - namespace KWin { diff --git a/src/utils/subsurfacemonitor.h b/src/utils/subsurfacemonitor.h index ed8ee76e33..db1059b4f1 100644 --- a/src/utils/subsurfacemonitor.h +++ b/src/utils/subsurfacemonitor.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class SurfaceInterface; class SubSurfaceInterface; @@ -32,7 +32,7 @@ public: /** * Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent. */ - SubSurfaceMonitor(KWaylandServer::SurfaceInterface *surface, QObject *parent); + SubSurfaceMonitor(SurfaceInterface *surface, QObject *parent); Q_SIGNALS: /** @@ -68,13 +68,13 @@ Q_SIGNALS: * This signal is emitted when the buffer size of a subsurface has changed. */ void subSurfaceBufferSizeChanged(); - void subSurfaceCommitted(KWaylandServer::SubSurfaceInterface *subSurface); + void subSurfaceCommitted(SubSurfaceInterface *subSurface); private: - void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface); - void unregisterSubSurface(KWaylandServer::SubSurfaceInterface *subSurface); - void registerSurface(KWaylandServer::SurfaceInterface *surface); - void unregisterSurface(KWaylandServer::SurfaceInterface *surface); + void registerSubSurface(SubSurfaceInterface *subSurface); + void unregisterSubSurface(SubSurfaceInterface *subSurface); + void registerSurface(SurfaceInterface *surface); + void unregisterSurface(SurfaceInterface *surface); }; } // namespace KWin diff --git a/src/virtualdesktops.cpp b/src/virtualdesktops.cpp index 9e787d88f1..bc666c01b8 100644 --- a/src/virtualdesktops.cpp +++ b/src/virtualdesktops.cpp @@ -44,9 +44,8 @@ VirtualDesktop::~VirtualDesktop() Q_EMIT aboutToBeDestroyed(); } -void VirtualDesktopManager::setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management) +void VirtualDesktopManager::setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management) { - using namespace KWaylandServer; Q_ASSERT(!m_virtualDesktopManagement); m_virtualDesktopManagement = management; diff --git a/src/virtualdesktops.h b/src/virtualdesktops.h index 570d9a22a8..645c6c6f6d 100644 --- a/src/virtualdesktops.h +++ b/src/virtualdesktops.h @@ -25,15 +25,11 @@ class KLocalizedString; class NETRootInfo; class QAction; -namespace KWaylandServer -{ -class PlasmaVirtualDesktopManagementInterface; -} - namespace KWin { class Options; +class PlasmaVirtualDesktopManagementInterface; class KWIN_EXPORT VirtualDesktop : public QObject { @@ -156,7 +152,7 @@ public: /** * @internal, for Wayland case */ - void setVirtualDesktopManagement(KWaylandServer::PlasmaVirtualDesktopManagementInterface *management); + void setVirtualDesktopManagement(PlasmaVirtualDesktopManagementInterface *management); /** * @internal */ @@ -490,7 +486,7 @@ private: VirtualDesktopGrid m_grid; // TODO: QPointer NETRootInfo *m_rootInfo; - KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; + PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; KSharedConfig::Ptr m_config; std::unique_ptr m_swipeGestureReleasedY; diff --git a/src/wayland/DESIGN.md b/src/wayland/DESIGN.md index 28f4dbba88..dde6cfe70f 100644 --- a/src/wayland/DESIGN.md +++ b/src/wayland/DESIGN.md @@ -18,7 +18,7 @@ An implementation should handle all versions of a given interface, but not diffe # Implementations -There are 3 modes of operation happening within the exported classes of KWaylandServer +There are 3 modes of operation happening within the exported classes The generated classes can behave in all these modes, it is up to our implementation to use the correct methods. diff --git a/src/wayland/abstract_data_source.cpp b/src/wayland/abstract_data_source.cpp index 7cb562c3db..43ec21e533 100644 --- a/src/wayland/abstract_data_source.cpp +++ b/src/wayland/abstract_data_source.cpp @@ -6,11 +6,14 @@ #include "abstract_data_source.h" -using namespace KWaylandServer; +namespace KWin +{ AbstractDataSource::AbstractDataSource(QObject *parent) : QObject(parent) { } +} // namespace KWin + #include "moc_abstract_data_source.cpp" diff --git a/src/wayland/abstract_data_source.h b/src/wayland/abstract_data_source.h index 4a42807157..d5213d8f8a 100644 --- a/src/wayland/abstract_data_source.h +++ b/src/wayland/abstract_data_source.h @@ -13,7 +13,7 @@ struct wl_client; -namespace KWaylandServer +namespace KWin { /** * @brief The AbstractDataSource class abstracts the data that diff --git a/src/wayland/abstract_drop_handler.cpp b/src/wayland/abstract_drop_handler.cpp index 5c95ec707a..5a38598cd5 100644 --- a/src/wayland/abstract_drop_handler.cpp +++ b/src/wayland/abstract_drop_handler.cpp @@ -7,7 +7,7 @@ #include "abstract_drop_handler.h" -namespace KWaylandServer +namespace KWin { AbstractDropHandler::AbstractDropHandler(QObject *parent) : QObject(parent) diff --git a/src/wayland/abstract_drop_handler.h b/src/wayland/abstract_drop_handler.h index aadd044469..3dab288ec8 100644 --- a/src/wayland/abstract_drop_handler.h +++ b/src/wayland/abstract_drop_handler.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class SurfaceInterface; diff --git a/src/wayland/appmenu.cpp b/src/wayland/appmenu.cpp index 63ed44902f..ca233e3452 100644 --- a/src/wayland/appmenu.cpp +++ b/src/wayland/appmenu.cpp @@ -12,7 +12,7 @@ #include "qwayland-server-appmenu.h" -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/appmenu.h b/src/wayland/appmenu.h index 6a585be6f0..ad9cf8e935 100644 --- a/src/wayland/appmenu.h +++ b/src/wayland/appmenu.h @@ -12,7 +12,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; @@ -44,7 +44,7 @@ Q_SIGNALS: /** * Emitted whenever a new AppmenuInterface is created. */ - void appMenuCreated(KWaylandServer::AppMenuInterface *); + void appMenuCreated(KWin::AppMenuInterface *); private: std::unique_ptr d; @@ -85,7 +85,7 @@ Q_SIGNALS: /** * Emitted when the address changes or is first received */ - void addressChanged(KWaylandServer::AppMenuInterface::InterfaceAddress); + void addressChanged(KWin::AppMenuInterface::InterfaceAddress); private: explicit AppMenuInterface(SurfaceInterface *s, wl_resource *resource); diff --git a/src/wayland/autotests/client/test_datadevice.cpp b/src/wayland/autotests/client/test_datadevice.cpp index 84018e71fa..0e6c69e4f4 100644 --- a/src/wayland/autotests/client/test_datadevice.cpp +++ b/src/wayland/autotests/client/test_datadevice.cpp @@ -51,10 +51,10 @@ private Q_SLOTS: void testReplaceSource(); private: - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; - KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; - KWaylandServer::SeatInterface *m_seatInterface = nullptr; + KWin::Display *m_display = nullptr; + KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWin::CompositorInterface *m_compositorInterface = nullptr; + KWin::SeatInterface *m_seatInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; @@ -67,10 +67,10 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-datade void TestDataDevice::init() { - qRegisterMetaType(); - using namespace KWaylandServer; + qRegisterMetaType(); + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -157,9 +157,9 @@ void TestDataDevice::cleanup() void TestDataDevice::testCreate() { - using namespace KWaylandServer; + using namespace KWin; - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated); std::unique_ptr dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); @@ -197,10 +197,10 @@ void TestDataDevice::testDrag_data() void TestDataDevice::testDrag() { - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated); std::unique_ptr dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); @@ -210,7 +210,7 @@ void TestDataDevice::testDrag() auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -220,7 +220,7 @@ void TestDataDevice::testDrag() auto sourceInterface = dataSourceCreatedSpy.first().first().value(); QVERIFY(sourceInterface); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); @@ -230,7 +230,7 @@ void TestDataDevice::testDrag() auto surfaceInterface = surfaceCreatedSpy.first().first().value(); // now we have all we need to start a drag operation - QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted); + QSignalSpy dragStartedSpy(deviceInterface, &KWin::DataDeviceInterface::dragStarted); // first we need to fake the pointer enter QFETCH(bool, hasGrab); @@ -277,10 +277,10 @@ void TestDataDevice::testDragInternally_data() void TestDataDevice::testDragInternally() { - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated); std::unique_ptr dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); @@ -290,7 +290,7 @@ void TestDataDevice::testDragInternally() auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); @@ -307,7 +307,7 @@ void TestDataDevice::testDragInternally() auto iconSurfaceInterface = surfaceCreatedSpy.last().first().value(); // now we have all we need to start a drag operation - QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted); + QSignalSpy dragStartedSpy(deviceInterface, &KWin::DataDeviceInterface::dragStarted); // first we need to fake the pointer enter QFETCH(bool, hasGrab); @@ -347,10 +347,10 @@ void TestDataDevice::testDragInternally() void TestDataDevice::testSetSelection() { - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr pointer(m_seat->createPointer()); - QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated); + QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataDeviceCreated); std::unique_ptr dataDevice(m_dataDeviceManager->getDataDevice(m_seat)); QVERIFY(dataDevice->isValid()); @@ -360,7 +360,7 @@ void TestDataDevice::testSetSelection() auto deviceInterface = dataDeviceCreatedSpy.first().first().value(); QVERIFY(deviceInterface); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -372,7 +372,7 @@ void TestDataDevice::testSetSelection() QVERIFY(sourceInterface); // everything setup, now we can test setting the selection - QSignalSpy selectionChangedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionChanged); + QSignalSpy selectionChangedSpy(deviceInterface, &KWin::DataDeviceInterface::selectionChanged); QVERIFY(!deviceInterface->selection()); dataDevice->setSelection(1, dataSource.get()); @@ -419,7 +419,7 @@ void TestDataDevice::testSetSelection() void TestDataDevice::testSendSelectionOnSeat() { // this test verifies that the selection is sent when setting a focused keyboard - using namespace KWaylandServer; + using namespace KWin; // first add keyboard support to Seat QSignalSpy keyboardChangedSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); m_seatInterface->setHasKeyboard(true); @@ -470,7 +470,7 @@ void TestDataDevice::testSendSelectionOnSeat() void TestDataDevice::testReplaceSource() { // this test verifies that replacing a data source cancels the previous source - using namespace KWaylandServer; + using namespace KWin; // first add keyboard support to Seat QSignalSpy keyboardChangedSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); m_seatInterface->setHasKeyboard(true); diff --git a/src/wayland/autotests/client/test_datasource.cpp b/src/wayland/autotests/client/test_datasource.cpp index 54d48c1d80..497bf604c7 100644 --- a/src/wayland/autotests/client/test_datasource.cpp +++ b/src/wayland/autotests/client/test_datasource.cpp @@ -38,8 +38,8 @@ private Q_SLOTS: void testServerGet(); private: - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWin::Display *m_display = nullptr; + KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::DataDeviceManager *m_dataDeviceManager = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -50,9 +50,9 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-dataso void TestDataSource::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -115,10 +115,10 @@ void TestDataSource::cleanup() void TestDataSource::testOffer() { - using namespace KWaylandServer; + using namespace KWin; - qRegisterMetaType(); - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + qRegisterMetaType(); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -130,7 +130,7 @@ void TestDataSource::testOffer() QVERIFY(!serverDataSource.isNull()); QCOMPARE(serverDataSource->mimeTypes().count(), 0); - QSignalSpy offeredSpy(serverDataSource.data(), &KWaylandServer::AbstractDataSource::mimeTypeOffered); + QSignalSpy offeredSpy(serverDataSource.data(), &KWin::AbstractDataSource::mimeTypeOffered); const QString plain = QStringLiteral("text/plain"); QMimeDatabase db; @@ -171,9 +171,9 @@ void TestDataSource::testTargetAccepts_data() void TestDataSource::testTargetAccepts() { - using namespace KWaylandServer; + using namespace KWin; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -193,9 +193,9 @@ void TestDataSource::testTargetAccepts() void TestDataSource::testRequestSend() { - using namespace KWaylandServer; + using namespace KWin; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -221,9 +221,9 @@ void TestDataSource::testRequestSend() void TestDataSource::testCancel() { - using namespace KWaylandServer; + using namespace KWin; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); @@ -240,9 +240,9 @@ void TestDataSource::testCancel() void TestDataSource::testServerGet() { - using namespace KWaylandServer; + using namespace KWin; - QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated); + QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWin::DataDeviceManagerInterface::dataSourceCreated); std::unique_ptr dataSource(m_dataDeviceManager->createDataSource()); QVERIFY(dataSource->isValid()); diff --git a/src/wayland/autotests/client/test_drag_drop.cpp b/src/wayland/autotests/client/test_drag_drop.cpp index c2871fdde4..5e419626ec 100644 --- a/src/wayland/autotests/client/test_drag_drop.cpp +++ b/src/wayland/autotests/client/test_drag_drop.cpp @@ -45,12 +45,12 @@ private Q_SLOTS: private: KWayland::Client::Surface *createSurface(); - KWaylandServer::SurfaceInterface *getServerSurface(); + KWin::SurfaceInterface *getServerSurface(); - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; - KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; - KWaylandServer::SeatInterface *m_seatInterface = nullptr; + KWin::Display *m_display = nullptr; + KWin::CompositorInterface *m_compositorInterface = nullptr; + KWin::DataDeviceManagerInterface *m_dataDeviceManagerInterface = nullptr; + KWin::SeatInterface *m_seatInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -69,9 +69,9 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-drag-n void TestDragAndDrop::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -177,9 +177,9 @@ KWayland::Client::Surface *TestDragAndDrop::createSurface() return s; } -KWaylandServer::SurfaceInterface *TestDragAndDrop::getServerSurface() +KWin::SurfaceInterface *TestDragAndDrop::getServerSurface() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); if (!surfaceCreatedSpy.isValid()) { return nullptr; @@ -193,7 +193,7 @@ KWaylandServer::SurfaceInterface *TestDragAndDrop::getServerSurface() void TestDragAndDrop::testPointerDragAndDrop() { // this test verifies the very basic drag and drop on one surface, an enter, a move and the drop - using namespace KWaylandServer; + using namespace KWin; // first create a window std::unique_ptr s(createSurface()); auto serverSurface = getServerSurface(); @@ -281,7 +281,7 @@ void TestDragAndDrop::testPointerDragAndDrop() void TestDragAndDrop::testTouchDragAndDrop() { // this test verifies the very basic drag and drop on one surface, an enter, a move and the drop - using namespace KWaylandServer; + using namespace KWin; // first create a window std::unique_ptr s(createSurface()); s->setSize(QSize(100, 100)); @@ -371,7 +371,7 @@ void TestDragAndDrop::testTouchDragAndDrop() void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource() { // this test simulates the problem from BUG 389221 - using namespace KWaylandServer; + using namespace KWin; // first create a window std::unique_ptr s(createSurface()); auto serverSurface = getServerSurface(); @@ -458,7 +458,7 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource() void TestDragAndDrop::testPointerEventsIgnored() { // this test verifies that all pointer events are ignored on the focused Pointer device during drag - using namespace KWaylandServer; + using namespace KWin; // first create a window std::unique_ptr s(createSurface()); auto serverSurface = getServerSurface(); diff --git a/src/wayland/autotests/client/test_error.cpp b/src/wayland/autotests/client/test_error.cpp index 9ef1111fcb..5e26e8d1e3 100644 --- a/src/wayland/autotests/client/test_error.cpp +++ b/src/wayland/autotests/client/test_error.cpp @@ -24,7 +24,7 @@ #include // For EPROTO -using namespace KWaylandServer; +using namespace KWin; class ErrorTest : public QObject { @@ -36,7 +36,7 @@ private Q_SLOTS: void testMultiplePlasmaShellSurfacesForSurface(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; CompositorInterface *m_ci = nullptr; PlasmaShellInterface *m_psi = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; @@ -51,7 +51,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-error-0"); void ErrorTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/client/test_fake_input.cpp b/src/wayland/autotests/client/test_fake_input.cpp index 23b2e33386..79e4d7a75c 100644 --- a/src/wayland/autotests/client/test_fake_input.cpp +++ b/src/wayland/autotests/client/test_fake_input.cpp @@ -17,7 +17,7 @@ #include -using namespace KWaylandServer; +using namespace KWin; Q_DECLARE_METATYPE(Qt::MouseButton) @@ -42,7 +42,7 @@ private Q_SLOTS: void testKeyboardKeyLinux(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; FakeInputInterface *m_fakeInputInterface = nullptr; FakeInputDeviceInterface *m_device = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; @@ -56,7 +56,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-fake-input-0") void FakeInputTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/client/test_plasma_activities.cpp b/src/wayland/autotests/client/test_plasma_activities.cpp index 526ee9c1ab..e3e5d99193 100644 --- a/src/wayland/autotests/client/test_plasma_activities.cpp +++ b/src/wayland/autotests/client/test_plasma_activities.cpp @@ -31,10 +31,10 @@ private Q_SLOTS: void testEnterLeaveActivity(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; - KWaylandServer::PlasmaWindowInterface *m_windowInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWin::PlasmaWindowInterface *m_windowInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; @@ -60,9 +60,9 @@ TestActivities::TestActivities(QObject *parent) void TestActivities::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -143,7 +143,7 @@ void TestActivities::cleanup() void TestActivities::testEnterLeaveActivity() { - QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaActivityRequested); + QSignalSpy enterRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::enterPlasmaActivityRequested); m_window->requestEnterActivity(QStringLiteral("0-1")); enterRequestedSpy.wait(); @@ -171,7 +171,7 @@ void TestActivities::testEnterLeaveActivity() QCOMPARE(m_window->plasmaActivities()[1], QStringLiteral("0-3")); // remove an activity - QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaActivityRequested); + QSignalSpy leaveRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::leavePlasmaActivityRequested); m_window->requestLeaveActivity(QStringLiteral("0-1")); leaveRequestedSpy.wait(); diff --git a/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp b/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp index 49c635128a..801793466e 100644 --- a/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp +++ b/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp @@ -42,11 +42,11 @@ private Q_SLOTS: void testRemoveRequested(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface; - KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; - KWaylandServer::PlasmaWindowInterface *m_windowInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface; + KWin::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWin::PlasmaWindowInterface *m_windowInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; @@ -73,9 +73,9 @@ TestVirtualDesktop::TestVirtualDesktop(QObject *parent) void TestVirtualDesktop::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -172,7 +172,7 @@ void TestVirtualDesktop::testCreate() QSignalSpy managementDoneSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::done); // 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")); + KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1")); desktop1Int->setName("Desktop 1"); QVERIFY(desktopCreatedSpy.wait()); @@ -193,7 +193,7 @@ void TestVirtualDesktop::testCreate() QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1")); // on those createDesktop the bind will already be done - KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2")); + KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2")); desktop2Int->setName("Desktop 2"); QVERIFY(desktopCreatedSpy.wait()); arguments = desktopCreatedSpy.takeFirst(); @@ -201,7 +201,7 @@ void TestVirtualDesktop::testCreate() QCOMPARE(arguments.at(1).toUInt(), (quint32)1); QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2); - KWaylandServer::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3")); + KWin::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3")); desktop3Int->setName("Desktop 3"); QVERIFY(desktopCreatedSpy.wait()); arguments = desktopCreatedSpy.takeFirst(); @@ -287,7 +287,7 @@ void TestVirtualDesktop::testDestroy() // rebuild some desktops testCreate(); - KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); + KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first(); QSignalSpy desktop1IntDestroyedSpy(desktop1Int, &QObject::destroyed); @@ -323,16 +323,16 @@ void TestVirtualDesktop::testActivate() // rebuild some desktops testCreate(); - KWaylandServer::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); + KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first(); KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first(); QVERIFY(desktop1->isActive()); QVERIFY(desktop1Int->isActive()); - KWaylandServer::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1]; + KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1]; KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1]; QVERIFY(!desktop2Int->isActive()); - QSignalSpy requestActivateSpy(desktop2Int, &KWaylandServer::PlasmaVirtualDesktopInterface::activateRequested); + QSignalSpy requestActivateSpy(desktop2Int, &KWin::PlasmaVirtualDesktopInterface::activateRequested); QSignalSpy activatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::activated); desktop2->requestActivate(); @@ -372,7 +372,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop() { testCreate(); - QSignalSpy enterRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested); + QSignalSpy enterRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested); m_window->requestEnterVirtualDesktop(QStringLiteral("0-1")); QVERIFY(enterRequestedSpy.wait()); @@ -404,7 +404,7 @@ void TestVirtualDesktop::testEnterLeaveDesktop() QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2); // remove a desktop - QSignalSpy leaveRequestedSpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested); + QSignalSpy leaveRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested); m_window->requestLeaveVirtualDesktop(QStringLiteral("0-1")); QVERIFY(leaveRequestedSpy.wait()); @@ -469,7 +469,7 @@ void TestVirtualDesktop::testCreateRequested() testCreate(); QSignalSpy desktopCreateRequestedSpy(m_plasmaVirtualDesktopManagementInterface, - &KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested); + &KWin::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested); QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopCreated); // listen for createdRequested @@ -480,7 +480,7 @@ void TestVirtualDesktop::testCreateRequested() // actually create m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-4"), 1); - KWaylandServer::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1); + KWin::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1); QCOMPARE(desktopInt->id(), QStringLiteral("0-4")); desktopInt->setName(QStringLiteral("Desktop")); @@ -507,7 +507,7 @@ void TestVirtualDesktop::testRemoveRequested() testCreate(); QSignalSpy desktopRemoveRequestedSpy(m_plasmaVirtualDesktopManagementInterface, - &KWaylandServer::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested); + &KWin::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested); // request a remove, just check the request arrived, ignore the request. m_plasmaVirtualDesktopManagement->requestRemoveVirtualDesktop(QStringLiteral("0-1")); diff --git a/src/wayland/autotests/client/test_plasmashell.cpp b/src/wayland/autotests/client/test_plasmashell.cpp index dbffb546da..4cfe7ef6f7 100644 --- a/src/wayland/autotests/client/test_plasmashell.cpp +++ b/src/wayland/autotests/client/test_plasmashell.cpp @@ -18,7 +18,7 @@ #include "KWayland/Client/registry.h" #include "KWayland/Client/surface.h" -using namespace KWaylandServer; +using namespace KWin; class TestPlasmaShell : public QObject { @@ -40,7 +40,7 @@ private Q_SLOTS: void testWhileDestroying(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; CompositorInterface *m_compositorInterface = nullptr; PlasmaShellInterface *m_plasmaShellInterface = nullptr; @@ -57,7 +57,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-wayland-plasma void TestPlasmaShell::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -134,7 +134,7 @@ void TestPlasmaShell::cleanup() void TestPlasmaShell::testRole_data() { QTest::addColumn("clientRole"); - QTest::addColumn("serverRole"); + QTest::addColumn("serverRole"); QTest::newRow("desktop") << KWayland::Client::PlasmaShellSurface::Role::Desktop << PlasmaShellSurfaceInterface::Role::Desktop; QTest::newRow("osd") << KWayland::Client::PlasmaShellSurface::Role::OnScreenDisplay << PlasmaShellSurfaceInterface::Role::OnScreenDisplay; diff --git a/src/wayland/autotests/client/test_pointer_constraints.cpp b/src/wayland/autotests/client/test_pointer_constraints.cpp index cc9cc0bbf5..d9ed4d8a0c 100644 --- a/src/wayland/autotests/client/test_pointer_constraints.cpp +++ b/src/wayland/autotests/client/test_pointer_constraints.cpp @@ -23,11 +23,11 @@ #include "wayland/seat.h" #include "wayland/surface.h" -using namespace KWaylandServer; +using namespace KWin; Q_DECLARE_METATYPE(KWayland::Client::PointerConstraints::LifeTime) -Q_DECLARE_METATYPE(KWaylandServer::ConfinedPointerV1Interface::LifeTime) -Q_DECLARE_METATYPE(KWaylandServer::LockedPointerV1Interface::LifeTime) +Q_DECLARE_METATYPE(KWin::ConfinedPointerV1Interface::LifeTime) +Q_DECLARE_METATYPE(KWin::LockedPointerV1Interface::LifeTime) class TestPointerConstraints : public QObject { @@ -45,7 +45,7 @@ private Q_SLOTS: void testAlreadyConstrained(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; CompositorInterface *m_compositorInterface = nullptr; SeatInterface *m_seatInterface = nullptr; PointerConstraintsV1Interface *m_pointerConstraintsInterface = nullptr; @@ -64,7 +64,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-pointer_constr void TestPointerConstraints::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/client/test_selection.cpp b/src/wayland/autotests/client/test_selection.cpp index d81dd3850a..403b880914 100644 --- a/src/wayland/autotests/client/test_selection.cpp +++ b/src/wayland/autotests/client/test_selection.cpp @@ -23,7 +23,7 @@ #include "wayland/display.h" #include "wayland/seat.h" -using namespace KWaylandServer; +using namespace KWin; class SelectionTest : public QObject { @@ -34,7 +34,7 @@ private Q_SLOTS: void testClearOnEnter(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; CompositorInterface *m_compositorInterface = nullptr; SeatInterface *m_seatInterface = nullptr; DataDeviceManagerInterface *m_ddmInterface = nullptr; @@ -62,7 +62,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-selection-0"); void SelectionTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/client/test_server_side_decoration.cpp b/src/wayland/autotests/client/test_server_side_decoration.cpp index 5fafe55333..c1bdfec221 100644 --- a/src/wayland/autotests/client/test_server_side_decoration.cpp +++ b/src/wayland/autotests/client/test_server_side_decoration.cpp @@ -36,9 +36,9 @@ private Q_SLOTS: void testSurfaceDestroy(); private: - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; - KWaylandServer::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr; + KWin::Display *m_display = nullptr; + KWin::CompositorInterface *m_compositorInterface = nullptr; + KWin::ServerSideDecorationManagerInterface *m_serverSideDecorationManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; KWayland::Client::EventQueue *m_queue = nullptr; @@ -56,9 +56,9 @@ TestServerSideDecoration::TestServerSideDecoration(QObject *parent) void TestServerSideDecoration::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -136,7 +136,7 @@ void TestServerSideDecoration::cleanup() void TestServerSideDecoration::testCreate_data() { - using namespace KWaylandServer; + using namespace KWin; QTest::addColumn("serverMode"); QTest::addColumn("clientMode"); @@ -147,8 +147,8 @@ void TestServerSideDecoration::testCreate_data() void TestServerSideDecoration::testCreate() { - using namespace KWaylandServer; - QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, serverMode); + using namespace KWin; + QFETCH(KWin::ServerSideDecorationManagerInterface::Mode, serverMode); m_serverSideDecorationManagerInterface->setDefaultMode(serverMode); QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), serverMode); @@ -186,7 +186,7 @@ void TestServerSideDecoration::testCreate() void TestServerSideDecoration::testRequest_data() { - using namespace KWaylandServer; + using namespace KWin; QTest::addColumn("defaultMode"); QTest::addColumn("clientMode"); QTest::addColumn("clientRequestMode"); @@ -212,8 +212,8 @@ void TestServerSideDecoration::testRequest_data() void TestServerSideDecoration::testRequest() { - using namespace KWaylandServer; - QFETCH(KWaylandServer::ServerSideDecorationManagerInterface::Mode, defaultMode); + using namespace KWin; + QFETCH(KWin::ServerSideDecorationManagerInterface::Mode, defaultMode); m_serverSideDecorationManagerInterface->setDefaultMode(defaultMode); QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), defaultMode); @@ -260,7 +260,7 @@ void TestServerSideDecoration::testRequest() void TestServerSideDecoration::testSurfaceDestroy() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated); diff --git a/src/wayland/autotests/client/test_server_side_decoration_palette.cpp b/src/wayland/autotests/client/test_server_side_decoration_palette.cpp index 1065324e60..4c8fed7cb2 100644 --- a/src/wayland/autotests/client/test_server_side_decoration_palette.cpp +++ b/src/wayland/autotests/client/test_server_side_decoration_palette.cpp @@ -32,9 +32,9 @@ private Q_SLOTS: void testCreateAndSet(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::ServerSideDecorationPaletteManagerInterface *m_paletteManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ServerSideDecorationPaletteManager *m_paletteManager; @@ -57,9 +57,9 @@ TestServerSideDecorationPalette::TestServerSideDecorationPalette(QObject *parent void TestServerSideDecorationPalette::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -132,24 +132,24 @@ void TestServerSideDecorationPalette::cleanup() void TestServerSideDecorationPalette::testCreateAndSet() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWaylandServer::ServerSideDecorationPaletteManagerInterface::paletteCreated); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy paletteCreatedSpy(m_paletteManagerInterface, &KWin::ServerSideDecorationPaletteManagerInterface::paletteCreated); QVERIFY(!m_paletteManagerInterface->paletteForSurface(serverSurface)); auto palette = m_paletteManager->create(surface.get(), surface.get()); 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, &KWaylandServer::ServerSideDecorationPaletteInterface::paletteChanged); + QSignalSpy changedSpy(paletteInterface, &KWin::ServerSideDecorationPaletteInterface::paletteChanged); palette->setPalette("foobar"); diff --git a/src/wayland/autotests/client/test_shadow.cpp b/src/wayland/autotests/client/test_shadow.cpp index da74007349..919fb73d56 100644 --- a/src/wayland/autotests/client/test_shadow.cpp +++ b/src/wayland/autotests/client/test_shadow.cpp @@ -20,7 +20,7 @@ #include "wayland/display.h" #include "wayland/shadow.h" -using namespace KWaylandServer; +using namespace KWin; class ShadowTest : public QObject { @@ -34,7 +34,7 @@ private Q_SLOTS: void testSurfaceDestroy(); private: - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; CompositorInterface *m_compositorInterface = nullptr; @@ -51,7 +51,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-shadow-0"); void ShadowTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -235,7 +235,7 @@ void ShadowTest::testShadowElements() void ShadowTest::testSurfaceDestroy() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); diff --git a/src/wayland/autotests/client/test_shm_pool.cpp b/src/wayland/autotests/client/test_shm_pool.cpp index 452d4033cc..e491f118c6 100644 --- a/src/wayland/autotests/client/test_shm_pool.cpp +++ b/src/wayland/autotests/client/test_shm_pool.cpp @@ -36,7 +36,7 @@ private Q_SLOTS: void testReuseBuffer(); private: - KWaylandServer::Display *m_display; + KWin::Display *m_display; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shmPool; @@ -57,9 +57,9 @@ TestShmPool::TestShmPool(QObject *parent) void TestShmPool::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/client/test_text_input_v2.cpp b/src/wayland/autotests/client/test_text_input_v2.cpp index 1d33bd2360..846d08d8a8 100644 --- a/src/wayland/autotests/client/test_text_input_v2.cpp +++ b/src/wayland/autotests/client/test_text_input_v2.cpp @@ -22,7 +22,7 @@ #include "wayland/textinput.h" #include "wayland/textinput_v2.h" -using namespace KWaylandServer; +using namespace KWin; using namespace std::literals; class TextInputTest : public QObject @@ -54,7 +54,7 @@ private Q_SLOTS: private: SurfaceInterface *waitForSurface(); KWayland::Client::TextInput *createTextInput(); - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; SeatInterface *m_seatInterface = nullptr; CompositorInterface *m_compositorInterface = nullptr; TextInputManagerV2Interface *m_textInputManagerV2Interface = nullptr; @@ -72,7 +72,7 @@ static const QString s_socketName = QStringLiteral("kwayland-test-text-input-0") void TextInputTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -443,43 +443,43 @@ void TextInputTest::testSurroundingText() void TextInputTest::testContentHints_data() { QTest::addColumn("clientHints"); - QTest::addColumn("serverHints"); + QTest::addColumn("serverHints"); QTest::newRow("completion/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::AutoCompletion) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCompletion); + << KWin::TextInputContentHints(KWin::TextInputContentHint::AutoCompletion); QTest::newRow("Correction/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::AutoCorrection) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCorrection); + << KWin::TextInputContentHints(KWin::TextInputContentHint::AutoCorrection); QTest::newRow("Capitalization/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::AutoCapitalization) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::AutoCapitalization); + << KWin::TextInputContentHints(KWin::TextInputContentHint::AutoCapitalization); QTest::newRow("Lowercase/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::LowerCase) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::LowerCase); + << KWin::TextInputContentHints(KWin::TextInputContentHint::LowerCase); QTest::newRow("Uppercase/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::UpperCase) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::UpperCase); + << KWin::TextInputContentHints(KWin::TextInputContentHint::UpperCase); QTest::newRow("Titlecase/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::TitleCase) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::TitleCase); + << KWin::TextInputContentHints(KWin::TextInputContentHint::TitleCase); QTest::newRow("HiddenText/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::HiddenText) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::HiddenText); + << KWin::TextInputContentHints(KWin::TextInputContentHint::HiddenText); QTest::newRow("SensitiveData/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::SensitiveData) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::SensitiveData); + << KWin::TextInputContentHints(KWin::TextInputContentHint::SensitiveData); QTest::newRow("Latin/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::Latin) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::Latin); + << KWin::TextInputContentHints(KWin::TextInputContentHint::Latin); QTest::newRow("Multiline/v2") << KWayland::Client::TextInput::ContentHints(KWayland::Client::TextInput::ContentHint::MultiLine) - << KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::MultiLine); + << KWin::TextInputContentHints(KWin::TextInputContentHint::MultiLine); QTest::newRow("autos/v2") << (KWayland::Client::TextInput::ContentHint::AutoCompletion | KWayland::Client::TextInput::ContentHint::AutoCorrection | KWayland::Client::TextInput::ContentHint::AutoCapitalization) - << (KWaylandServer::TextInputContentHint::AutoCompletion | KWaylandServer::TextInputContentHint::AutoCorrection - | KWaylandServer::TextInputContentHint::AutoCapitalization); + << (KWin::TextInputContentHint::AutoCompletion | KWin::TextInputContentHint::AutoCorrection + | KWin::TextInputContentHint::AutoCapitalization); // all has combinations which don't make sense - what's both lowercase and uppercase? QTest::newRow("all/v2") << (KWayland::Client::TextInput::ContentHint::AutoCompletion | KWayland::Client::TextInput::ContentHint::AutoCorrection | KWayland::Client::TextInput::ContentHint::AutoCapitalization | KWayland::Client::TextInput::ContentHint::LowerCase | KWayland::Client::TextInput::ContentHint::UpperCase | KWayland::Client::TextInput::ContentHint::TitleCase | KWayland::Client::TextInput::ContentHint::HiddenText | KWayland::Client::TextInput::ContentHint::SensitiveData | KWayland::Client::TextInput::ContentHint::Latin | KWayland::Client::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); + << (KWin::TextInputContentHint::AutoCompletion | KWin::TextInputContentHint::AutoCorrection + | KWin::TextInputContentHint::AutoCapitalization | KWin::TextInputContentHint::LowerCase + | KWin::TextInputContentHint::UpperCase | KWin::TextInputContentHint::TitleCase + | KWin::TextInputContentHint::HiddenText | KWin::TextInputContentHint::SensitiveData + | KWin::TextInputContentHint::Latin | KWin::TextInputContentHint::MultiLine); } void TextInputTest::testContentHints() @@ -498,7 +498,7 @@ void TextInputTest::testContentHints() m_seatInterface->setFocusedKeyboardSurface(serverSurface); auto ti = m_seatInterface->textInputV2(); QVERIFY(ti); - QCOMPARE(ti->contentHints(), KWaylandServer::TextInputContentHints()); + QCOMPARE(ti->contentHints(), KWin::TextInputContentHints()); QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged); QFETCH(KWayland::Client::TextInput::ContentHints, clientHints); @@ -513,26 +513,26 @@ void TextInputTest::testContentHints() // unsetting should work textInput->setContentType(KWayland::Client::TextInput::ContentHints(), KWayland::Client::TextInput::ContentPurpose::Normal); QVERIFY(contentTypeChangedSpy.wait()); - QCOMPARE(ti->contentHints(), KWaylandServer::TextInputContentHints()); + QCOMPARE(ti->contentHints(), KWin::TextInputContentHints()); } void TextInputTest::testContentPurpose_data() { QTest::addColumn("clientPurpose"); - QTest::addColumn("serverPurpose"); - - QTest::newRow("Alpha/v2") << KWayland::Client::TextInput::ContentPurpose::Alpha << KWaylandServer::TextInputContentPurpose::Alpha; - QTest::newRow("Digits/v2") << KWayland::Client::TextInput::ContentPurpose::Digits << KWaylandServer::TextInputContentPurpose::Digits; - QTest::newRow("Number/v2") << KWayland::Client::TextInput::ContentPurpose::Number << KWaylandServer::TextInputContentPurpose::Number; - QTest::newRow("Phone/v2") << KWayland::Client::TextInput::ContentPurpose::Phone << KWaylandServer::TextInputContentPurpose::Phone; - QTest::newRow("Url/v2") << KWayland::Client::TextInput::ContentPurpose::Url << KWaylandServer::TextInputContentPurpose::Url; - QTest::newRow("Email/v2") << KWayland::Client::TextInput::ContentPurpose::Email << KWaylandServer::TextInputContentPurpose::Email; - QTest::newRow("Name/v2") << KWayland::Client::TextInput::ContentPurpose::Name << KWaylandServer::TextInputContentPurpose::Name; - QTest::newRow("Password/v2") << KWayland::Client::TextInput::ContentPurpose::Password << KWaylandServer::TextInputContentPurpose::Password; - QTest::newRow("Date/v2") << KWayland::Client::TextInput::ContentPurpose::Date << KWaylandServer::TextInputContentPurpose::Date; - QTest::newRow("Time/v2") << KWayland::Client::TextInput::ContentPurpose::Time << KWaylandServer::TextInputContentPurpose::Time; - QTest::newRow("Datetime/v2") << KWayland::Client::TextInput::ContentPurpose::DateTime << KWaylandServer::TextInputContentPurpose::DateTime; - QTest::newRow("Terminal/v2") << KWayland::Client::TextInput::ContentPurpose::Terminal << KWaylandServer::TextInputContentPurpose::Terminal; + QTest::addColumn("serverPurpose"); + + QTest::newRow("Alpha/v2") << KWayland::Client::TextInput::ContentPurpose::Alpha << KWin::TextInputContentPurpose::Alpha; + QTest::newRow("Digits/v2") << KWayland::Client::TextInput::ContentPurpose::Digits << KWin::TextInputContentPurpose::Digits; + QTest::newRow("Number/v2") << KWayland::Client::TextInput::ContentPurpose::Number << KWin::TextInputContentPurpose::Number; + QTest::newRow("Phone/v2") << KWayland::Client::TextInput::ContentPurpose::Phone << KWin::TextInputContentPurpose::Phone; + QTest::newRow("Url/v2") << KWayland::Client::TextInput::ContentPurpose::Url << KWin::TextInputContentPurpose::Url; + QTest::newRow("Email/v2") << KWayland::Client::TextInput::ContentPurpose::Email << KWin::TextInputContentPurpose::Email; + QTest::newRow("Name/v2") << KWayland::Client::TextInput::ContentPurpose::Name << KWin::TextInputContentPurpose::Name; + QTest::newRow("Password/v2") << KWayland::Client::TextInput::ContentPurpose::Password << KWin::TextInputContentPurpose::Password; + QTest::newRow("Date/v2") << KWayland::Client::TextInput::ContentPurpose::Date << KWin::TextInputContentPurpose::Date; + QTest::newRow("Time/v2") << KWayland::Client::TextInput::ContentPurpose::Time << KWin::TextInputContentPurpose::Time; + QTest::newRow("Datetime/v2") << KWayland::Client::TextInput::ContentPurpose::DateTime << KWin::TextInputContentPurpose::DateTime; + QTest::newRow("Terminal/v2") << KWayland::Client::TextInput::ContentPurpose::Terminal << KWin::TextInputContentPurpose::Terminal; } void TextInputTest::testContentPurpose() @@ -551,7 +551,7 @@ void TextInputTest::testContentPurpose() m_seatInterface->setFocusedKeyboardSurface(serverSurface); auto ti = m_seatInterface->textInputV2(); QVERIFY(ti); - QCOMPARE(ti->contentPurpose(), KWaylandServer::TextInputContentPurpose::Normal); + QCOMPARE(ti->contentPurpose(), KWin::TextInputContentPurpose::Normal); QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged); QFETCH(KWayland::Client::TextInput::ContentPurpose, clientPurpose); @@ -566,7 +566,7 @@ void TextInputTest::testContentPurpose() // unsetting should work textInput->setContentType(KWayland::Client::TextInput::ContentHints(), KWayland::Client::TextInput::ContentPurpose::Normal); QVERIFY(contentTypeChangedSpy.wait()); - QCOMPARE(ti->contentPurpose(), KWaylandServer::TextInputContentPurpose::Normal); + QCOMPARE(ti->contentPurpose(), KWin::TextInputContentPurpose::Normal); } void TextInputTest::testTextDirection_data() diff --git a/src/wayland/autotests/client/test_wayland_appmenu.cpp b/src/wayland/autotests/client/test_wayland_appmenu.cpp index 5e8f16b29b..df540cedd6 100644 --- a/src/wayland/autotests/client/test_wayland_appmenu.cpp +++ b/src/wayland/autotests/client/test_wayland_appmenu.cpp @@ -20,7 +20,7 @@ #include "KWayland/Client/registry.h" #include "KWayland/Client/surface.h" -Q_DECLARE_METATYPE(KWaylandServer::AppMenuInterface::InterfaceAddress) +Q_DECLARE_METATYPE(KWin::AppMenuInterface::InterfaceAddress) class TestAppmenu : public QObject { @@ -34,9 +34,9 @@ private Q_SLOTS: void testCreateAndSet(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::AppMenuManagerInterface *m_appmenuManagerInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::AppMenuManagerInterface *m_appmenuManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::AppMenuManager *m_appmenuManager; @@ -59,10 +59,10 @@ TestAppmenu::TestAppmenu(QObject *parent) void TestAppmenu::init() { - using namespace KWaylandServer; + using namespace KWin; qRegisterMetaType(); delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -134,25 +134,25 @@ void TestAppmenu::cleanup() void TestAppmenu::testCreateAndSet() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy appMenuCreated(m_appmenuManagerInterface, &KWaylandServer::AppMenuManagerInterface::appMenuCreated); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy appMenuCreated(m_appmenuManagerInterface, &KWin::AppMenuManagerInterface::appMenuCreated); QVERIFY(!m_appmenuManagerInterface->appMenuForSurface(serverSurface)); auto appmenu = m_appmenuManager->create(surface.get(), surface.get()); 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, &KWaylandServer::AppMenuInterface::addressChanged); + QSignalSpy appMenuChangedSpy(appMenuInterface, &KWin::AppMenuInterface::addressChanged); appmenu->setAddress("net.somename", "/test/path"); diff --git a/src/wayland/autotests/client/test_wayland_blur.cpp b/src/wayland/autotests/client/test_wayland_blur.cpp index c18b28bdb0..265cbdfccc 100644 --- a/src/wayland/autotests/client/test_wayland_blur.cpp +++ b/src/wayland/autotests/client/test_wayland_blur.cpp @@ -32,9 +32,9 @@ private Q_SLOTS: void testSurfaceDestroy(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::BlurManagerInterface *m_blurManagerInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::BlurManagerInterface *m_blurManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::BlurManager *m_blurManager; @@ -57,9 +57,9 @@ TestBlur::TestBlur(QObject *parent) void TestBlur::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -132,13 +132,13 @@ void TestBlur::cleanup() void TestBlur::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy blurChanged(serverSurface, &KWaylandServer::SurfaceInterface::blurChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy blurChanged(serverSurface, &KWin::SurfaceInterface::blurChanged); auto blur = m_blurManager->createBlur(surface.get(), surface.get()); blur->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); @@ -156,13 +156,13 @@ void TestBlur::testCreate() void TestBlur::testSurfaceDestroy() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy blurChanged(serverSurface, &KWaylandServer::SurfaceInterface::blurChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy blurChanged(serverSurface, &KWin::SurfaceInterface::blurChanged); std::unique_ptr blur(m_blurManager->createBlur(surface.get())); blur->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); diff --git a/src/wayland/autotests/client/test_wayland_contrast.cpp b/src/wayland/autotests/client/test_wayland_contrast.cpp index d9ae7a84af..88852b6782 100644 --- a/src/wayland/autotests/client/test_wayland_contrast.cpp +++ b/src/wayland/autotests/client/test_wayland_contrast.cpp @@ -35,9 +35,9 @@ private Q_SLOTS: void testSurfaceDestroy(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::ContrastManagerInterface *m_contrastManagerInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::ContrastManagerInterface *m_contrastManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ContrastManager *m_contrastManager; @@ -60,9 +60,9 @@ TestContrast::TestContrast(QObject *parent) void TestContrast::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -136,13 +136,13 @@ void TestContrast::cleanup() void TestContrast::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy contrastChanged(serverSurface, &KWaylandServer::SurfaceInterface::contrastChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy contrastChanged(serverSurface, &KWin::SurfaceInterface::contrastChanged); auto contrast = m_contrastManager->createContrast(surface.get(), surface.get()); contrast->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); @@ -168,13 +168,13 @@ void TestContrast::testCreate() void TestContrast::testSurfaceDestroy() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy contrastChanged(serverSurface, &KWaylandServer::SurfaceInterface::contrastChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy contrastChanged(serverSurface, &KWin::SurfaceInterface::contrastChanged); std::unique_ptr contrast(m_contrastManager->createContrast(surface.get())); contrast->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr)); diff --git a/src/wayland/autotests/client/test_wayland_filter.cpp b/src/wayland/autotests/client/test_wayland_filter.cpp index 0b1f1e2ae2..e7f181c802 100644 --- a/src/wayland/autotests/client/test_wayland_filter.cpp +++ b/src/wayland/autotests/client/test_wayland_filter.cpp @@ -37,28 +37,28 @@ private Q_SLOTS: private: TestDisplay *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::BlurManagerInterface *m_blurManagerInterface; + KWin::CompositorInterface *m_compositorInterface; + KWin::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 KWaylandServer::FilteredDisplay +class TestDisplay : public KWin::FilteredDisplay { public: TestDisplay(QObject *parent); - bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override; + bool allowInterface(KWin::ClientConnection *client, const QByteArray &interfaceName) override; QList m_allowedClients; }; TestDisplay::TestDisplay(QObject *parent) - : KWaylandServer::FilteredDisplay(parent) + : KWin::FilteredDisplay(parent) { } -bool TestDisplay::allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) +bool TestDisplay::allowInterface(KWin::ClientConnection *client, const QByteArray &interfaceName) { if (interfaceName == "org_kde_kwin_blur_manager") { return m_allowedClients.contains(*client); @@ -75,7 +75,7 @@ TestFilter::TestFilter(QObject *parent) void TestFilter::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; m_display = new TestDisplay(this); m_display->addSocketName(s_socketName); diff --git a/src/wayland/autotests/client/test_wayland_output.cpp b/src/wayland/autotests/client/test_wayland_output.cpp index 1a22d77013..b0cfc91bea 100644 --- a/src/wayland/autotests/client/test_wayland_output.cpp +++ b/src/wayland/autotests/client/test_wayland_output.cpp @@ -40,7 +40,7 @@ private Q_SLOTS: void testTransform(); private: - KWaylandServer::Display *m_display; + KWin::Display *m_display; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::EventQueue *m_queue; QThread *m_thread; @@ -59,7 +59,7 @@ TestWaylandOutput::TestWaylandOutput(QObject *parent) void TestWaylandOutput::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -108,7 +108,7 @@ void TestWaylandOutput::testRegistry() outputHandle->moveTo(QPoint(100, 50)); outputHandle->setPhysicalSize(QSize(200, 100)); - auto outputInterface = std::make_unique(m_display, outputHandle.get()); + auto outputInterface = std::make_unique(m_display, outputHandle.get()); KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); @@ -158,7 +158,7 @@ void TestWaylandOutput::testModeChange() auto outputHandle = std::make_unique(); outputHandle->setMode(QSize(1024, 768), 60000); - auto outputInterface = std::make_unique(m_display, outputHandle.get()); + auto outputInterface = std::make_unique(m_display, outputHandle.get()); KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); @@ -200,7 +200,7 @@ void TestWaylandOutput::testScaleChange() auto outputHandle = std::make_unique(); outputHandle->setMode(QSize(1024, 768), 60000); - auto outputInterface = std::make_unique(m_display, outputHandle.get()); + auto outputInterface = std::make_unique(m_display, outputHandle.get()); KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); @@ -253,7 +253,7 @@ void TestWaylandOutput::testSubPixel() outputHandle->setMode(QSize(1024, 768), 60000); outputHandle->setSubPixel(actual); - auto outputInterface = std::make_unique(m_display, outputHandle.get()); + auto outputInterface = std::make_unique(m_display, outputHandle.get()); KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); @@ -296,9 +296,9 @@ void TestWaylandOutput::testTransform() outputHandle->setMode(QSize(1024, 768), 60000); outputHandle->setTransform(actual); - auto outputInterface = std::make_unique(m_display, outputHandle.get()); + auto outputInterface = std::make_unique(m_display, outputHandle.get()); - using namespace KWaylandServer; + using namespace KWin; KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); diff --git a/src/wayland/autotests/client/test_wayland_seat.cpp b/src/wayland/autotests/client/test_wayland_seat.cpp index dbaf719a5d..7e7ab71bf2 100644 --- a/src/wayland/autotests/client/test_wayland_seat.cpp +++ b/src/wayland/autotests/client/test_wayland_seat.cpp @@ -115,12 +115,12 @@ private Q_SLOTS: private: bool sync(); - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::SeatInterface *m_seatInterface; - KWaylandServer::SubCompositorInterface *m_subCompositorInterface; - KWaylandServer::RelativePointerManagerV1Interface *m_relativePointerManagerV1Interface; - KWaylandServer::PointerGesturesV1Interface *m_pointerGesturesV1Interface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::SeatInterface *m_seatInterface; + KWin::SubCompositorInterface *m_subCompositorInterface; + KWin::RelativePointerManagerV1Interface *m_relativePointerManagerV1Interface; + KWin::PointerGesturesV1Interface *m_pointerGesturesV1Interface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::Seat *m_seat; @@ -156,9 +156,9 @@ TestWaylandSeat::TestWaylandSeat(QObject *parent) void TestWaylandSeat::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -363,16 +363,16 @@ void TestWaylandSeat::testCapabilities() void TestWaylandSeat::testPointer() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); @@ -380,7 +380,7 @@ void TestWaylandSeat::testPointer() s->attachBuffer(m_shm->createBuffer(image)); s->damage(image.rect()); s->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); m_seatInterface->notifyPointerEnter(serverSurface, QPointF(20, 18), QPointF(10, 15)); @@ -565,7 +565,7 @@ void TestWaylandSeat::testPointerTransformation_data() void TestWaylandSeat::testPointerTransformation() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); m_seatInterface->setHasPointer(true); @@ -574,7 +574,7 @@ void TestWaylandSeat::testPointerTransformation() QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); 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); @@ -582,7 +582,7 @@ void TestWaylandSeat::testPointerTransformation() s->attachBuffer(m_shm->createBuffer(image)); s->damage(image.rect()); s->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); KWayland::Client::Pointer *p = m_seat->createPointer(m_seat); @@ -665,16 +665,16 @@ void TestWaylandSeat::testPointerButton_data() void TestWaylandSeat::testPointerButton() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); @@ -682,7 +682,7 @@ void TestWaylandSeat::testPointerButton() s->attachBuffer(m_shm->createBuffer(image)); s->damage(image.rect()); s->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); std::unique_ptr p(m_seat->createPointer()); @@ -731,7 +731,7 @@ void TestWaylandSeat::testPointerButton() void TestWaylandSeat::testPointerSubSurfaceTree() { // this test verifies that pointer motion on a surface with sub-surfaces sends motion enter/leave to the sub-surface - using namespace KWaylandServer; + using namespace KWin; // first create the pointer QSignalSpy hasPointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); @@ -832,7 +832,7 @@ void TestWaylandSeat::testPointerSwipeGesture_data() void TestWaylandSeat::testPointerSwipeGesture() { - using namespace KWaylandServer; + using namespace KWin; // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); @@ -862,7 +862,7 @@ void TestWaylandSeat::testPointerSwipeGesture() surface->attachBuffer(m_shm->createBuffer(image)); surface->damage(image.rect()); surface->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0)); @@ -953,7 +953,7 @@ void TestWaylandSeat::testPointerPinchGesture_data() void TestWaylandSeat::testPointerPinchGesture() { - using namespace KWaylandServer; + using namespace KWin; // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); @@ -983,7 +983,7 @@ void TestWaylandSeat::testPointerPinchGesture() surface->attachBuffer(m_shm->createBuffer(image)); surface->damage(image.rect()); surface->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0)); @@ -1097,7 +1097,7 @@ Q_SIGNALS: void TestWaylandSeat::testPointerHoldGesture() { - using namespace KWaylandServer; + using namespace KWin; // first create the pointer and pointer swipe gesture QSignalSpy hasPointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); @@ -1129,7 +1129,7 @@ void TestWaylandSeat::testPointerHoldGesture() surface->attachBuffer(m_shm->createBuffer(image)); surface->damage(image.rect()); surface->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0)); @@ -1189,7 +1189,7 @@ void TestWaylandSeat::testPointerHoldGesture() void TestWaylandSeat::testPointerAxis() { - using namespace KWaylandServer; + using namespace KWin; // first create the pointer QSignalSpy hasPointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); @@ -1210,7 +1210,7 @@ void TestWaylandSeat::testPointerAxis() surface->attachBuffer(m_shm->createBuffer(image)); surface->damage(image.rect()); surface->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0)); @@ -1290,16 +1290,16 @@ void TestWaylandSeat::testPointerAxis() void TestWaylandSeat::testCursor() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged); m_seatInterface->setHasPointer(true); QVERIFY(pointerSpy.wait()); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); @@ -1307,7 +1307,7 @@ void TestWaylandSeat::testCursor() surface->attachBuffer(m_shm->createBuffer(image)); surface->damage(image.rect()); surface->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); QVERIFY(committedSpy.wait()); std::unique_ptr p(m_seat->createPointer()); @@ -1323,12 +1323,12 @@ void TestWaylandSeat::testCursor() QCOMPARE_GT(enteredSpy.first().first().value(), serial); QVERIFY(m_seatInterface->focusedPointerSurface()); - QSignalSpy cursorChangedSpy(m_seatInterface->pointer(), &KWaylandServer::PointerInterface::cursorChanged); + QSignalSpy cursorChangedSpy(m_seatInterface->pointer(), &KWin::PointerInterface::cursorChanged); // just remove the pointer p->setCursor(nullptr); QVERIFY(cursorChangedSpy.wait()); QCOMPARE(cursorChangedSpy.count(), 1); - auto cursor = std::get(cursorChangedSpy.last().first().value()); + auto cursor = std::get(cursorChangedSpy.last().first().value()); QVERIFY(cursor); QVERIFY(!cursor->surface()); QCOMPARE(cursor->hotspot(), QPoint()); @@ -1361,7 +1361,7 @@ void TestWaylandSeat::testCursor() void TestWaylandSeat::testKeyboard() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy keyboardSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); m_seatInterface->setHasKeyboard(true); @@ -1371,10 +1371,10 @@ void TestWaylandSeat::testKeyboard() m_seatInterface->notifyKeyboardModifiers(4, 3, 2, 1); // create the surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); KWayland::Client::Keyboard *keyboard = m_seat->createKeyboard(m_seat); @@ -1533,7 +1533,7 @@ void TestWaylandSeat::testKeyboard() void TestWaylandSeat::testSelection() { - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr ddmi(new DataDeviceManagerInterface(m_display)); KWayland::Client::Registry registry; QSignalSpy dataDeviceManagerSpy(®istry, &KWayland::Client::Registry::dataDeviceManagerAnnounced); @@ -1553,7 +1553,7 @@ void TestWaylandSeat::testSelection() QSignalSpy selectionSpy(dd1.get(), &KWayland::Client::DataDevice::selectionOffered); QSignalSpy selectionClearedSpy(dd1.get(), &KWayland::Client::DataDevice::selectionCleared); - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); @@ -1639,7 +1639,7 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface() // this test verifies that the server does not crash when creating a datadevice for the focused keyboard surface // and the currentSelection does not have a DataSource. // to properly test the functionality this test requires a second client - using namespace KWaylandServer; + using namespace KWin; // create the DataDeviceManager std::unique_ptr ddmi(new DataDeviceManagerInterface(m_display)); QSignalSpy ddiCreatedSpy(ddmi.get(), &DataDeviceManagerInterface::dataDeviceCreated); @@ -1727,17 +1727,17 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface() void TestWaylandSeat::testTouch() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy touchSpy(m_seat, &KWayland::Client::Seat::hasTouchChanged); m_seatInterface->setHasTouch(true); QVERIFY(touchSpy.wait()); // create the surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); m_seatInterface->setFocusedTouchSurface(serverSurface); @@ -1906,7 +1906,7 @@ void TestWaylandSeat::testTouch() void TestWaylandSeat::testKeymap() { - using namespace KWaylandServer; + using namespace KWin; m_seatInterface->setHasKeyboard(true); QSignalSpy keyboardChangedSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged); @@ -1915,7 +1915,7 @@ void TestWaylandSeat::testKeymap() std::unique_ptr keyboard(m_seat->createKeyboard()); // create surface - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(surface->isValid()); QVERIFY(surfaceCreatedSpy.wait()); diff --git a/src/wayland/autotests/client/test_wayland_slide.cpp b/src/wayland/autotests/client/test_wayland_slide.cpp index 44345590b6..44bb3bda27 100644 --- a/src/wayland/autotests/client/test_wayland_slide.cpp +++ b/src/wayland/autotests/client/test_wayland_slide.cpp @@ -32,9 +32,9 @@ private Q_SLOTS: void testSurfaceDestroy(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::SlideManagerInterface *m_slideManagerInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::SlideManagerInterface *m_slideManagerInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::SlideManager *m_slideManager; @@ -57,9 +57,9 @@ TestSlide::TestSlide(QObject *parent) void TestSlide::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -132,12 +132,12 @@ void TestSlide::cleanup() void TestSlide::testCreate() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface = serverSurfaceCreated.first().first().value(); - QSignalSpy slideChanged(serverSurface, &KWaylandServer::SurfaceInterface::slideOnShowHideChanged); + auto serverSurface = serverSurfaceCreated.first().first().value(); + QSignalSpy slideChanged(serverSurface, &KWin::SurfaceInterface::slideOnShowHideChanged); auto slide = m_slideManager->createSlide(surface.get(), surface.get()); slide->setLocation(KWayland::Client::Slide::Location::Top); @@ -146,7 +146,7 @@ void TestSlide::testCreate() surface->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(slideChanged.wait()); - QCOMPARE(serverSurface->slideOnShowHide()->location(), KWaylandServer::SlideInterface::Location::Top); + QCOMPARE(serverSurface->slideOnShowHide()->location(), KWin::SlideInterface::Location::Top); QCOMPARE(serverSurface->slideOnShowHide()->offset(), 15); // and destroy @@ -157,7 +157,7 @@ void TestSlide::testCreate() void TestSlide::testSurfaceDestroy() { - using namespace KWaylandServer; + using namespace KWin; QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); diff --git a/src/wayland/autotests/client/test_wayland_subsurface.cpp b/src/wayland/autotests/client/test_wayland_subsurface.cpp index 8e727a4f67..6bfd26c8e5 100644 --- a/src/wayland/autotests/client/test_wayland_subsurface.cpp +++ b/src/wayland/autotests/client/test_wayland_subsurface.cpp @@ -52,9 +52,9 @@ private Q_SLOTS: void testDestroyParentSurface(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::SubCompositorInterface *m_subcompositorInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::SubCompositorInterface *m_subcompositorInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shm; @@ -81,9 +81,9 @@ TestSubSurface::TestSubSurface(QObject *parent) void TestSubSurface::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -167,28 +167,28 @@ void TestSubSurface::cleanup() void TestSubSurface::testCreate() { - using namespace KWaylandServer; - QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + using namespace KWin; + QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); // create two Surfaces std::unique_ptr surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); + SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); surfaceCreatedSpy.clear(); std::unique_ptr 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, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWin::SubCompositorInterface::subSurfaceCreated); // create subSurface for surface of parent std::unique_ptr subSurface(m_subCompositor->createSubSurface(surface.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface); QVERIFY(serverSubSurface->parentSurface()); QCOMPARE(serverSubSurface->parentSurface(), serverParentSurface); @@ -230,17 +230,17 @@ void TestSubSurface::testCreate() void TestSubSurface::testMode() { - using namespace KWaylandServer; + using namespace KWin; // create two Surface std::unique_ptr surface(m_compositor->createSurface()); std::unique_ptr parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWin::SubCompositorInterface::subSurfaceCreated); // create the SubSurface for surface of parent std::unique_ptr subSurface(m_subCompositor->createSubSurface(surface.get(), parent.get())); 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 @@ -248,13 +248,13 @@ void TestSubSurface::testMode() QCOMPARE(serverSubSurface->mode(), SubSurfaceInterface::Mode::Synchronized); // verify that we can change to desynchronized - QSignalSpy modeChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::modeChanged); + QSignalSpy modeChangedSpy(serverSubSurface, &KWin::SubSurfaceInterface::modeChanged); subSurface->setMode(KWayland::Client::SubSurface::Mode::Desynchronized); QCOMPARE(subSurface->mode(), KWayland::Client::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 @@ -268,8 +268,8 @@ void TestSubSurface::testMode() 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); } @@ -283,17 +283,17 @@ void TestSubSurface::testPosition_data() void TestSubSurface::testPosition() { - using namespace KWaylandServer; + using namespace KWin; // create two Surface std::unique_ptr surface(m_compositor->createSurface()); std::unique_ptr parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWin::SubCompositorInterface::subSurfaceCreated); // create the SubSurface for surface of parent std::unique_ptr subSurface(m_subCompositor->createSubSurface(surface.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface); // put the subsurface in the desired commit mode @@ -304,7 +304,7 @@ void TestSubSurface::testPosition() QCOMPARE(subSurface->position(), QPoint()); QCOMPARE(serverSubSurface->position(), QPoint()); - QSignalSpy positionChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::positionChanged); + QSignalSpy positionChangedSpy(serverSubSurface, &KWin::SubSurfaceInterface::positionChanged); // changing the position should not trigger a direct update on server side subSurface->setPosition(QPoint(10, 20)); @@ -332,29 +332,29 @@ void TestSubSurface::testPosition() void TestSubSurface::testPlaceAbove() { - using namespace KWaylandServer; + using namespace KWin; // create needed Surfaces (one parent, three client std::unique_ptr surface1(m_compositor->createSurface()); std::unique_ptr surface2(m_compositor->createSurface()); std::unique_ptr surface3(m_compositor->createSurface()); std::unique_ptr parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWin::SubCompositorInterface::subSurfaceCreated); // create the SubSurfaces for surface of parent std::unique_ptr subSurface1(m_subCompositor->createSubSurface(surface1.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface1); subSurfaceCreatedSpy.clear(); std::unique_ptr subSurface2(m_subCompositor->createSubSurface(surface2.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface2); subSurfaceCreatedSpy.clear(); std::unique_ptr subSurface3(m_subCompositor->createSubSurface(surface3.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface3); subSurfaceCreatedSpy.clear(); @@ -433,29 +433,29 @@ void TestSubSurface::testPlaceAbove() void TestSubSurface::testPlaceBelow() { - using namespace KWaylandServer; + using namespace KWin; // create needed Surfaces (one parent, three client std::unique_ptr surface1(m_compositor->createSurface()); std::unique_ptr surface2(m_compositor->createSurface()); std::unique_ptr surface3(m_compositor->createSurface()); std::unique_ptr parent(m_compositor->createSurface()); - QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated); + QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWin::SubCompositorInterface::subSurfaceCreated); // create the SubSurfaces for surface of parent std::unique_ptr subSurface1(m_subCompositor->createSubSurface(surface1.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface1 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface1); subSurfaceCreatedSpy.clear(); std::unique_ptr subSurface2(m_subCompositor->createSubSurface(surface2.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface2 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface2); subSurfaceCreatedSpy.clear(); std::unique_ptr subSurface3(m_subCompositor->createSubSurface(surface3.get(), parent.get())); QVERIFY(subSurfaceCreatedSpy.wait()); - SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); + SubSurfaceInterface *serverSubSurface3 = subSurfaceCreatedSpy.first().first().value(); QVERIFY(serverSubSurface3); subSurfaceCreatedSpy.clear(); @@ -539,7 +539,7 @@ void TestSubSurface::testPlaceBelow() void TestSubSurface::testSyncMode() { // this test verifies that state is only applied when the parent surface commits its pending state - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); @@ -590,7 +590,7 @@ void TestSubSurface::testSyncMode() void TestSubSurface::testDeSyncMode() { // this test verifies that state gets applied immediately in desync mode - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); @@ -637,7 +637,7 @@ void TestSubSurface::testDeSyncMode() void TestSubSurface::testMainSurfaceFromTree() { // this test verifies that in a tree of surfaces every surface has the same main surface - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr parentSurface(m_compositor->createSurface()); @@ -687,7 +687,7 @@ void TestSubSurface::testMainSurfaceFromTree() void TestSubSurface::testRemoveSurface() { // this test verifies that removing the surface also removes the sub-surface from the parent - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); @@ -719,7 +719,7 @@ void TestSubSurface::testRemoveSurface() void TestSubSurface::testMappingOfSurfaceTree() { // this test verifies mapping and unmapping of a sub-surface tree - using namespace KWaylandServer; + using namespace KWin; QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr parentSurface(m_compositor->createSurface()); @@ -836,7 +836,7 @@ void TestSubSurface::testMappingOfSurfaceTree() void TestSubSurface::testSurfaceAt() { // this test verifies that the correct surface is picked in a sub-surface tree - using namespace KWaylandServer; + using namespace KWin; // first create a parent surface and map it QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr parent(m_compositor->createSurface()); @@ -846,7 +846,7 @@ void TestSubSurface::testSurfaceAt() parent->damage(QRect(0, 0, 100, 100)); parent->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *parentServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *parentServerSurface = serverSurfaceCreated.last().first().value(); // directChild1 occupies the top-left quarter of the parent surface QImage directImage(QSize(50, 50), QImage::Format_ARGB32_Premultiplied); @@ -855,7 +855,7 @@ void TestSubSurface::testSurfaceAt() directChild1->damage(QRect(0, 0, 50, 50)); directChild1->commit(KWayland::Client::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 @@ -864,7 +864,7 @@ void TestSubSurface::testSurfaceAt() directChild2->damage(QRect(0, 0, 50, 50)); directChild2->commit(KWayland::Client::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 @@ -890,10 +890,10 @@ void TestSubSurface::testSurfaceAt() // each of the children gets a child std::unique_ptr childFor1(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *childFor1ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *childFor1ServerSurface = serverSurfaceCreated.last().first().value(); std::unique_ptr childFor2(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *childFor2ServerSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *childFor2ServerSurface = serverSurfaceCreated.last().first().value(); // create sub surfaces for them std::unique_ptr childFor1SubSurface(m_subCompositor->createSubSurface(childFor1.get(), directChild1.get())); @@ -958,14 +958,14 @@ void TestSubSurface::testSurfaceAt() void TestSubSurface::testDestroyAttachedBuffer() { // this test verifies that destroying of a buffer attached to a sub-surface works - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr parent(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); std::unique_ptr 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.get(), parent.get()); @@ -989,18 +989,18 @@ void TestSubSurface::testDestroyParentSurface() { // this test verifies that destroying a parent surface does not create problems // see BUG 389231 - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr parent(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverParentSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverParentSurface = serverSurfaceCreated.last().first().value(); std::unique_ptr child(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); + SurfaceInterface *serverChildSurface = serverSurfaceCreated.last().first().value(); std::unique_ptr 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.get(), parent.get()); sub1->setMode(KWayland::Client::SubSurface::Mode::Desynchronized); diff --git a/src/wayland/autotests/client/test_wayland_surface.cpp b/src/wayland/autotests/client/test_wayland_surface.cpp index bd2a33305b..eb23a4e63e 100644 --- a/src/wayland/autotests/client/test_wayland_surface.cpp +++ b/src/wayland/autotests/client/test_wayland_surface.cpp @@ -57,9 +57,9 @@ private Q_SLOTS: void testInhibit(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::IdleInhibitManagerV1Interface *m_idleInhibitInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::IdleInhibitManagerV1Interface *m_idleInhibitInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::ShmPool *m_shm; @@ -82,9 +82,9 @@ TestWaylandSurface::TestWaylandSurface(QObject *parent) void TestWaylandSurface::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -181,10 +181,10 @@ void TestWaylandSurface::cleanup() void TestWaylandSurface::testStaticAccessor() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); - QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr)); - QVERIFY(!KWaylandServer::SurfaceInterface::get(1, nullptr)); + QVERIFY(!KWin::SurfaceInterface::get(nullptr)); + QVERIFY(!KWin::SurfaceInterface::get(1, nullptr)); QVERIFY(KWayland::Client::Surface::all().isEmpty()); std::unique_ptr s1(m_compositor->createSurface()); QVERIFY(s1->isValid()); @@ -192,10 +192,10 @@ void TestWaylandSurface::testStaticAccessor() QCOMPARE(KWayland::Client::Surface::all().first(), s1.get()); QCOMPARE(KWayland::Client::Surface::get(*s1), s1.get()); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface1 = serverSurfaceCreated.first().first().value(); + auto serverSurface1 = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface1); - QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); - QCOMPARE(KWaylandServer::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); QVERIFY(!s1->size().isValid()); QSignalSpy sizeChangedSpy(s1.get(), &KWayland::Client::Surface::sizeChanged); @@ -215,12 +215,12 @@ void TestWaylandSurface::testStaticAccessor() QCOMPARE(KWayland::Client::Surface::get(*s2), s2.get()); serverSurfaceCreated.clear(); QVERIFY(serverSurfaceCreated.wait()); - auto serverSurface2 = serverSurfaceCreated.first().first().value(); + auto serverSurface2 = serverSurfaceCreated.first().first().value(); QVERIFY(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); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface1->resource()), serverSurface1); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface1->id(), serverSurface1->client()), serverSurface1); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface2->resource()), serverSurface2); + QCOMPARE(KWin::SurfaceInterface::get(serverSurface2->id(), serverSurface2->client()), serverSurface2); const quint32 surfaceId1 = serverSurface1->id(); const quint32 surfaceId2 = serverSurface2->id(); @@ -235,26 +235,26 @@ void TestWaylandSurface::testStaticAccessor() s1.reset(); QVERIFY(KWayland::Client::Surface::all().isEmpty()); QVERIFY(!KWayland::Client::Surface::get(nullptr)); - QSignalSpy destroyedSpy(serverSurface1, &KWaylandServer::SurfaceInterface::destroyed); + QSignalSpy destroyedSpy(serverSurface1, &KWin::SurfaceInterface::destroyed); QVERIFY(destroyedSpy.wait()); - QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr)); - QVERIFY(!KWaylandServer::SurfaceInterface::get(surfaceId1, nullptr)); - QVERIFY(!KWaylandServer::SurfaceInterface::get(surfaceId2, nullptr)); + QVERIFY(!KWin::SurfaceInterface::get(nullptr)); + QVERIFY(!KWin::SurfaceInterface::get(surfaceId1, nullptr)); + QVERIFY(!KWin::SurfaceInterface::get(surfaceId2, nullptr)); } void TestWaylandSurface::testDamage() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); s->setScale(2); QVERIFY(serverSurfaceCreated.wait()); - KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWin::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); QCOMPARE(serverSurface->bufferDamage(), QRegion()); QVERIFY(!serverSurface->isMapped()); - QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed); - QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); + QSignalSpy committedSpy(serverSurface, &KWin::SurfaceInterface::committed); + QSignalSpy damageSpy(serverSurface, &KWin::SurfaceInterface::damaged); // send damage without a buffer { @@ -340,13 +340,13 @@ void TestWaylandSurface::testDamage() void TestWaylandSurface::testFrameCallback() { - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWin::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); + QSignalSpy damageSpy(serverSurface, &KWin::SurfaceInterface::damaged); QSignalSpy frameRenderedSpy(s.get(), &KWayland::Client::Surface::frameRendered); QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); @@ -365,10 +365,10 @@ void TestWaylandSurface::testFrameCallback() void TestWaylandSurface::testAttachBuffer() { // create the surface - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + KWin::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); // create three images @@ -397,9 +397,9 @@ void TestWaylandSurface::testAttachBuffer() s->attachBuffer(blackBuffer); s->damage(QRect(0, 0, 24, 24)); s->commit(KWayland::Client::Surface::CommitFlag::None); - QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged); - QSignalSpy mappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::mapped); - QSignalSpy unmappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::unmapped); + QSignalSpy damageSpy(serverSurface, &KWin::SurfaceInterface::damaged); + QSignalSpy mappedSpy(serverSurface, &KWin::SurfaceInterface::mapped); + QSignalSpy unmappedSpy(serverSurface, &KWin::SurfaceInterface::unmapped); QVERIFY(damageSpy.wait()); QCOMPARE(mappedSpy.count(), 1); QVERIFY(unmappedSpy.isEmpty()); @@ -513,13 +513,13 @@ void TestWaylandSurface::testAttachBuffer() void TestWaylandSurface::testOpaque() { - using namespace KWaylandServer; - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + using namespace KWin; + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy opaqueRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::opaqueChanged); + QSignalSpy opaqueRegionChangedSpy(serverSurface, &KWin::SurfaceInterface::opaqueChanged); // by default there should be an empty opaque region QCOMPARE(serverSurface->opaque(), QRegion()); @@ -569,13 +569,13 @@ void TestWaylandSurface::testOpaque() void TestWaylandSurface::testInput() { - using namespace KWaylandServer; - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + using namespace KWin; + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QVERIFY(serverSurface); - QSignalSpy inputRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::inputChanged); + QSignalSpy inputRegionChangedSpy(serverSurface, &KWin::SurfaceInterface::inputChanged); QSignalSpy committedSpy(serverSurface, &SurfaceInterface::committed); // the input region should be empty if the surface has no buffer @@ -633,13 +633,13 @@ void TestWaylandSurface::testInput() void TestWaylandSurface::testScale() { // this test verifies that updating the scale factor is correctly passed to the Wayland server - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr 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); // changing the scale implicitly changes the size @@ -680,12 +680,12 @@ void TestWaylandSurface::testScale() void TestWaylandSurface::testUnmapOfNotMappedSurface() { // this test verifies that a surface which doesn't have a buffer attached doesn't trigger the unmapped signal - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(serverSurfaceCreated.wait()); - SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); + SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value(); QSignalSpy unmappedSpy(serverSurface, &SurfaceInterface::unmapped); QSignalSpy committedSpy(serverSurface, &SurfaceInterface::committed); @@ -701,12 +701,12 @@ void TestWaylandSurface::testUnmapOfNotMappedSurface() void TestWaylandSurface::testSurfaceAt() { // this test verifies that surfaceAt(const QPointF&) works as expected for the case of no children - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr 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()); @@ -733,12 +733,12 @@ void TestWaylandSurface::testSurfaceAt() void TestWaylandSurface::testDestroyAttachedBuffer() { // this test verifies that destroying of a buffer attached to a surface works - using namespace KWaylandServer; + using namespace KWin; // create surface QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated); std::unique_ptr 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); @@ -765,7 +765,7 @@ void TestWaylandSurface::testDestroyWithPendingCallback() { // this test tries to verify that destroying a surface with a pending callback works correctly // first create surface - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr s(m_compositor->createSurface()); QVERIFY(s != nullptr); QVERIFY(s->isValid()); @@ -797,7 +797,7 @@ void TestWaylandSurface::testDestroyWithPendingCallback() void TestWaylandSurface::testDisconnect() { // this test verifies that the server side correctly tears down the resources when the client disconnects - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr s(m_compositor->createSurface()); QVERIFY(s != nullptr); QVERIFY(s->isValid()); @@ -830,7 +830,7 @@ void TestWaylandSurface::testDisconnect() void TestWaylandSurface::testOutput() { // This test verifies that the enter/leave are sent correctly to the Client - using namespace KWaylandServer; + using namespace KWin; qRegisterMetaType(); std::unique_ptr s(m_compositor->createSurface()); QVERIFY(s != nullptr); @@ -904,7 +904,7 @@ void TestWaylandSurface::testOutput() void TestWaylandSurface::testInhibit() { - using namespace KWaylandServer; + using namespace KWin; std::unique_ptr s(m_compositor->createSurface()); // wait for the surface on the Server side QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); diff --git a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp index 6d75c83597..fedb24f82f 100644 --- a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp +++ b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp @@ -21,9 +21,9 @@ #include "KWayland/Client/registry.h" #include "KWayland/Client/surface.h" -typedef void (KWaylandServer::PlasmaWindowInterface::*ServerWindowSignal)(); +typedef void (KWin::PlasmaWindowInterface::*ServerWindowSignal)(); Q_DECLARE_METATYPE(ServerWindowSignal) -typedef void (KWaylandServer::PlasmaWindowInterface::*ServerWindowBooleanSignal)(bool); +typedef void (KWin::PlasmaWindowInterface::*ServerWindowBooleanSignal)(bool); Q_DECLARE_METATYPE(ServerWindowBooleanSignal) typedef void (KWayland::Client::PlasmaWindow::*ClientWindowVoidSetter)(); Q_DECLARE_METATYPE(ClientWindowVoidSetter) @@ -62,11 +62,11 @@ private Q_SLOTS: void cleanup(); private: - KWaylandServer::Display *m_display; - KWaylandServer::CompositorInterface *m_compositorInterface; - KWaylandServer::PlasmaWindowManagementInterface *m_windowManagementInterface; - KWaylandServer::PlasmaWindowInterface *m_windowInterface; - QPointer m_surfaceInterface; + KWin::Display *m_display; + KWin::CompositorInterface *m_compositorInterface; + KWin::PlasmaWindowManagementInterface *m_windowManagementInterface; + KWin::PlasmaWindowInterface *m_windowInterface; + QPointer m_surfaceInterface; KWayland::Client::Surface *m_surface = nullptr; KWayland::Client::ConnectionThread *m_connection; @@ -93,10 +93,10 @@ TestWindowManagement::TestWindowManagement(QObject *parent) void TestWindowManagement::init() { - using namespace KWaylandServer; - qRegisterMetaType("ShowingDesktopState"); + using namespace KWin; + qRegisterMetaType("ShowingDesktopState"); delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -148,12 +148,12 @@ void TestWindowManagement::init() QVERIFY(windowSpy.wait()); m_window = windowSpy.first().first().value(); - QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWin::CompositorInterface::surfaceCreated); 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); } @@ -184,7 +184,7 @@ void TestWindowManagement::testMinimizedGeometry() { m_window->setMinimizedGeometry(m_surface, QRect(5, 10, 100, 200)); - QSignalSpy geometrySpy(m_windowInterface, &KWaylandServer::PlasmaWindowInterface::minimizedGeometriesChanged); + QSignalSpy geometrySpy(m_windowInterface, &KWin::PlasmaWindowInterface::minimizedGeometriesChanged); QVERIFY(geometrySpy.wait()); QCOMPARE(m_windowInterface->minimizedGeometries().values().first(), QRect(5, 10, 100, 200)); @@ -332,7 +332,7 @@ void TestWindowManagement::testCreateAfterUnmap() void TestWindowManagement::testRequests_data() { - using namespace KWaylandServer; + using namespace KWin; QTest::addColumn("changedSignal"); QTest::addColumn("requester"); @@ -353,7 +353,7 @@ void TestWindowManagement::testRequests() void TestWindowManagement::testRequestsBoolean_data() { - using namespace KWaylandServer; + using namespace KWin; QTest::addColumn("changedSignal"); QTest::addColumn("flag"); @@ -396,7 +396,7 @@ void TestWindowManagement::testRequestsBoolean() void TestWindowManagement::testShowingDesktop() { - using namespace KWaylandServer; + using namespace KWin; // this test verifies setting the showing desktop state QVERIFY(!m_windowManagement->isShowingDesktop()); QSignalSpy showingDesktopChangedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::showingDesktopChanged); @@ -420,7 +420,7 @@ void TestWindowManagement::testShowingDesktop() void TestWindowManagement::testRequestShowingDesktop_data() { - using namespace KWaylandServer; + using namespace KWin; QTest::addColumn("value"); QTest::addColumn("expectedValue"); @@ -431,7 +431,7 @@ void TestWindowManagement::testRequestShowingDesktop_data() void TestWindowManagement::testRequestShowingDesktop() { // this test verifies requesting show desktop state - using namespace KWaylandServer; + using namespace KWin; QSignalSpy requestSpy(m_windowManagementInterface, &PlasmaWindowManagementInterface::requestChangeShowingDesktop); QFETCH(bool, value); m_windowManagement->setShowingDesktop(value); @@ -442,7 +442,7 @@ void TestWindowManagement::testRequestShowingDesktop() void TestWindowManagement::testKeepAbove() { - using namespace KWaylandServer; + using namespace KWin; // this test verifies setting the keep above state QVERIFY(!m_window->isKeepAbove()); QSignalSpy keepAboveChangedSpy(m_window, &KWayland::Client::PlasmaWindow::keepAboveChanged); @@ -463,7 +463,7 @@ void TestWindowManagement::testKeepAbove() void TestWindowManagement::testKeepBelow() { - using namespace KWaylandServer; + using namespace KWin; // this test verifies setting the keep below state QVERIFY(!m_window->isKeepBelow()); QSignalSpy keepBelowChangedSpy(m_window, &KWayland::Client::PlasmaWindow::keepBelowChanged); @@ -492,7 +492,7 @@ void TestWindowManagement::testParentWindow() // now let's create a second window QSignalSpy windowAddedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated); - std::unique_ptr serverTransient(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); + std::unique_ptr serverTransient(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); serverTransient->setParentWindow(m_windowInterface); QVERIFY(windowAddedSpy.wait()); auto transient = windowAddedSpy.first().first().value(); @@ -579,7 +579,7 @@ void TestWindowManagement::testPid() QVERIFY(m_window->pid() == 1337); // test server not setting a PID for whatever reason - std::unique_ptr newWindowInterface(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); + std::unique_ptr newWindowInterface(m_windowManagementInterface->createWindow(this, QUuid::createUuid())); QSignalSpy windowSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated); QVERIFY(windowSpy.wait()); std::unique_ptr newWindow(windowSpy.first().first().value()); diff --git a/src/wayland/autotests/client/test_xdg_decoration.cpp b/src/wayland/autotests/client/test_xdg_decoration.cpp index a99cb107d5..8d29edc32d 100644 --- a/src/wayland/autotests/client/test_xdg_decoration.cpp +++ b/src/wayland/autotests/client/test_xdg_decoration.cpp @@ -33,10 +33,10 @@ private Q_SLOTS: void testDecoration(); private: - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::CompositorInterface *m_compositorInterface = nullptr; - KWaylandServer::XdgShellInterface *m_xdgShellInterface = nullptr; - KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerInterface = nullptr; + KWin::Display *m_display = nullptr; + KWin::CompositorInterface *m_compositorInterface = nullptr; + KWin::XdgShellInterface *m_xdgShellInterface = nullptr; + KWin::XdgDecorationManagerV1Interface *m_xdgDecorationManagerInterface = nullptr; KWayland::Client::ConnectionThread *m_connection = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; @@ -57,13 +57,13 @@ TestXdgDecoration::TestXdgDecoration(QObject *parent) void TestXdgDecoration::init() { - using namespace KWaylandServer; + using namespace KWin; qRegisterMetaType(); qRegisterMetaType(); delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -150,11 +150,11 @@ void TestXdgDecoration::cleanup() void TestXdgDecoration::testDecoration_data() { - using namespace KWaylandServer; - QTest::addColumn("configuredMode"); + using namespace KWin; + QTest::addColumn("configuredMode"); QTest::addColumn("configuredModeExp"); QTest::addColumn("setMode"); - QTest::addColumn("setModeExp"); + QTest::addColumn("setModeExp"); const auto serverClient = XdgToplevelDecorationV1Interface::Mode::Client; const auto serverServer = XdgToplevelDecorationV1Interface::Mode::Server; @@ -169,12 +169,12 @@ void TestXdgDecoration::testDecoration_data() void TestXdgDecoration::testDecoration() { - using namespace KWaylandServer; + using namespace KWin; - QFETCH(KWaylandServer::XdgToplevelDecorationV1Interface::Mode, configuredMode); + QFETCH(KWin::XdgToplevelDecorationV1Interface::Mode, configuredMode); QFETCH(KWayland::Client::XdgDecoration::Mode, configuredModeExp); QFETCH(KWayland::Client::XdgDecoration::Mode, setMode); - QFETCH(KWaylandServer::XdgToplevelDecorationV1Interface::Mode, setModeExp); + QFETCH(KWin::XdgToplevelDecorationV1Interface::Mode, setModeExp); QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated); QSignalSpy shellSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); diff --git a/src/wayland/autotests/client/test_xdg_foreign.cpp b/src/wayland/autotests/client/test_xdg_foreign.cpp index aade23c16e..ebdd9a5214 100644 --- a/src/wayland/autotests/client/test_xdg_foreign.cpp +++ b/src/wayland/autotests/client/test_xdg_foreign.cpp @@ -42,9 +42,9 @@ private Q_SLOTS: private: void doExport(); - KWaylandServer::Display *m_display; - QPointer m_compositorInterface; - KWaylandServer::XdgForeignV2Interface *m_foreignInterface; + KWin::Display *m_display; + QPointer m_compositorInterface; + KWin::XdgForeignV2Interface *m_foreignInterface; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::Compositor *m_compositor; KWayland::Client::EventQueue *m_queue; @@ -52,13 +52,13 @@ private: 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; }; @@ -80,9 +80,9 @@ TestForeign::TestForeign(QObject *parent) void TestForeign::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -166,12 +166,12 @@ void TestForeign::cleanup() void TestForeign::doExport() { - QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWin::CompositorInterface::surfaceCreated); 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); @@ -180,23 +180,23 @@ void TestForeign::doExport() QVERIFY(doneSpy.wait()); QVERIFY(!m_exported->handle().isEmpty()); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); // Import the just exported window m_imported = m_importer->importTopLevel(m_exported->handle()); QVERIFY(m_imported->isValid()); - QSignalSpy childSurfaceInterfaceCreated(m_compositorInterface.data(), &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy childSurfaceInterfaceCreated(m_compositorInterface.data(), &KWin::CompositorInterface::surfaceCreated); m_childSurface = m_compositor->createSurface(); QVERIFY(childSurfaceInterfaceCreated.wait()); - m_childSurfaceInterface = childSurfaceInterfaceCreated.first().first().value(); + m_childSurfaceInterface = childSurfaceInterfaceCreated.first().first().value(); m_childSurface->commit(KWayland::Client::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 QCOMPARE(m_foreignInterface->transientFor(m_childSurfaceInterface), m_exportedSurfaceInterface.data()); @@ -211,15 +211,15 @@ void TestForeign::testDeleteImported() { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); 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)); } @@ -227,26 +227,26 @@ void TestForeign::testDeleteChildSurface() { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); m_childSurface->deleteLater(); QVERIFY(transientSpy.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, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); m_exportedSurface->deleteLater(); 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)); } @@ -254,7 +254,7 @@ void TestForeign::testDeleteExported() { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); QSignalSpy destroyedSpy(m_imported.data(), &KWayland::Client::XdgImported::importedDestroyed); m_exported->deleteLater(); @@ -263,8 +263,8 @@ void TestForeign::testDeleteExported() 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()); @@ -281,25 +281,25 @@ void TestForeign::testExportTwoTimes() QVERIFY(doneSpy.wait()); QVERIFY(!exported2->handle().isEmpty()); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); // 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.data(), &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWin::CompositorInterface::surfaceCreated); KWayland::Client::Surface *childSurface2 = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWaylandServer::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); + KWin::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()); + QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); // transientFor api // check the old relationship is still here @@ -312,25 +312,25 @@ void TestForeign::testImportTwoTimes() { doExport(); - QSignalSpy transientSpy(m_foreignInterface, &KWaylandServer::XdgForeignV2Interface::transientChanged); + QSignalSpy transientSpy(m_foreignInterface, &KWin::XdgForeignV2Interface::transientChanged); // 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.data(), &KWaylandServer::CompositorInterface::surfaceCreated); + QSignalSpy serverSurfaceCreated(m_compositorInterface.data(), &KWin::CompositorInterface::surfaceCreated); KWayland::Client::Surface *childSurface2 = m_compositor->createSurface(); QVERIFY(serverSurfaceCreated.wait()); - KWaylandServer::SurfaceInterface *childSurface2Interface = serverSurfaceCreated.first().first().value(); + KWin::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()); + QCOMPARE(transientSpy.first().first().value(), childSurface2Interface); + QCOMPARE(transientSpy.first().at(1).value(), m_exportedSurfaceInterface.data()); // transientFor api // check the old relationship is still here diff --git a/src/wayland/autotests/client/test_xdg_output.cpp b/src/wayland/autotests/client/test_xdg_output.cpp index b11626704a..33d54d7aaf 100644 --- a/src/wayland/autotests/client/test_xdg_output.cpp +++ b/src/wayland/autotests/client/test_xdg_output.cpp @@ -30,10 +30,10 @@ private Q_SLOTS: void testChanges(); private: - KWaylandServer::Display *m_display; + KWin::Display *m_display; std::unique_ptr m_outputHandle; - KWaylandServer::OutputInterface *m_serverOutput; - KWaylandServer::XdgOutputManagerV1Interface *m_serverXdgOutputManager; + KWin::OutputInterface *m_serverOutput; + KWin::XdgOutputManagerV1Interface *m_serverXdgOutputManager; KWayland::Client::ConnectionThread *m_connection; KWayland::Client::EventQueue *m_queue; QThread *m_thread; @@ -52,9 +52,9 @@ TestXdgOutput::TestXdgOutput(QObject *parent) void TestXdgOutput::init() { - using namespace KWaylandServer; + using namespace KWin; delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -116,7 +116,7 @@ void TestXdgOutput::cleanup() void TestXdgOutput::testChanges() { // verify the server modes - using namespace KWaylandServer; + using namespace KWin; KWayland::Client::Registry registry; QSignalSpy announced(®istry, &KWayland::Client::Registry::outputAnnounced); QSignalSpy xdgOutputAnnounced(®istry, &KWayland::Client::Registry::xdgOutputAnnounced); diff --git a/src/wayland/autotests/client/test_xdg_shell.cpp b/src/wayland/autotests/client/test_xdg_shell.cpp index 559cc0a875..257379d664 100644 --- a/src/wayland/autotests/client/test_xdg_shell.cpp +++ b/src/wayland/autotests/client/test_xdg_shell.cpp @@ -28,7 +28,7 @@ #include "../../tests/fakeoutput.h" -using namespace KWaylandServer; +using namespace KWin; Q_DECLARE_METATYPE(Qt::MouseButton) @@ -63,7 +63,7 @@ private: XdgShellInterface *m_xdgShellInterface = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; KWayland::Client::XdgShell *m_xdgShell = nullptr; - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; CompositorInterface *m_compositorInterface = nullptr; std::unique_ptr m_output1Handle; OutputInterface *m_output1Interface = nullptr; @@ -91,7 +91,7 @@ private: void XdgShellTest::init() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/server/test_datacontrol_interface.cpp b/src/wayland/autotests/server/test_datacontrol_interface.cpp index bb7d1046b6..efe5f70b39 100644 --- a/src/wayland/autotests/server/test_datacontrol_interface.cpp +++ b/src/wayland/autotests/server/test_datacontrol_interface.cpp @@ -27,7 +27,7 @@ #include "qwayland-wlr-data-control-unstable-v1.h" -using namespace KWaylandServer; +using namespace KWin; // Faux-client API for tests @@ -150,7 +150,7 @@ private: KWayland::Client::Seat *m_clientSeat = nullptr; QThread *m_thread; - KWaylandServer::Display *m_display; + KWin::Display *m_display; SeatInterface *m_seat; CompositorInterface *m_serverCompositor; @@ -165,7 +165,7 @@ static const QString s_socketName = QStringLiteral("kwin-wayland-datacontrol-tes void DataControlInterfaceTest::init() { - m_display = new KWaylandServer::Display(); + m_display = new KWin::Display(); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); diff --git a/src/wayland/autotests/server/test_display.cpp b/src/wayland/autotests/server/test_display.cpp index 0c881c7ae4..1791abfb64 100644 --- a/src/wayland/autotests/server/test_display.cpp +++ b/src/wayland/autotests/server/test_display.cpp @@ -16,7 +16,7 @@ #include #include -using namespace KWaylandServer; +using namespace KWin; class TestWaylandServerDisplay : public QObject { @@ -31,8 +31,8 @@ private Q_SLOTS: void TestWaylandServerDisplay::testSocketName() { - KWaylandServer::Display display; - QSignalSpy changedSpy(&display, &KWaylandServer::Display::socketNamesChanged); + KWin::Display display; + QSignalSpy changedSpy(&display, &KWin::Display::socketNamesChanged); QCOMPARE(display.socketNames(), QStringList()); const QString testSName = QStringLiteral("fooBar"); display.addSocketName(testSName); @@ -51,8 +51,8 @@ void TestWaylandServerDisplay::testStartStop() QVERIFY(runtimeDir.exists()); QVERIFY(!runtimeDir.exists(testSocketName)); - std::unique_ptr display(new KWaylandServer::Display); - QSignalSpy runningSpy(display.get(), &KWaylandServer::Display::runningChanged); + std::unique_ptr display(new KWin::Display); + QSignalSpy runningSpy(display.get(), &KWin::Display::runningChanged); display->addSocketName(testSocketName); QVERIFY(!display->isRunning()); display->start(); @@ -68,11 +68,11 @@ void TestWaylandServerDisplay::testStartStop() void TestWaylandServerDisplay::testClientConnection() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(QStringLiteral("kwin-wayland-server-display-test-client-connection")); display.start(); - QSignalSpy connectedSpy(&display, &KWaylandServer::Display::clientConnected); - QSignalSpy disconnectedSpy(&display, &KWaylandServer::Display::clientDisconnected); + QSignalSpy connectedSpy(&display, &KWin::Display::clientConnected); + QSignalSpy disconnectedSpy(&display, &KWin::Display::clientDisconnected); int sv[2]; QVERIFY(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) >= 0); @@ -141,7 +141,7 @@ void TestWaylandServerDisplay::testClientConnection() void TestWaylandServerDisplay::testConnectNoSocket() { - KWaylandServer::Display display; + KWin::Display display; display.start(); QVERIFY(display.isRunning()); @@ -162,16 +162,16 @@ void TestWaylandServerDisplay::testAutoSocketName() QVERIFY(runtimeDir.isValid()); QVERIFY(qputenv("XDG_RUNTIME_DIR", runtimeDir.path().toUtf8())); - KWaylandServer::Display display0; - QSignalSpy socketNameChangedSpy0(&display0, &KWaylandServer::Display::socketNamesChanged); + KWin::Display display0; + QSignalSpy socketNameChangedSpy0(&display0, &KWin::Display::socketNamesChanged); QVERIFY(socketNameChangedSpy0.isValid()); QVERIFY(display0.addSocketName()); display0.start(); QVERIFY(display0.isRunning()); QCOMPARE(socketNameChangedSpy0.count(), 1); - KWaylandServer::Display display1; - QSignalSpy socketNameChangedSpy1(&display1, &KWaylandServer::Display::socketNamesChanged); + KWin::Display display1; + QSignalSpy socketNameChangedSpy1(&display1, &KWin::Display::socketNamesChanged); QVERIFY(socketNameChangedSpy1.isValid()); QVERIFY(display1.addSocketName()); display1.start(); diff --git a/src/wayland/autotests/server/test_inputmethod_interface.cpp b/src/wayland/autotests/server/test_inputmethod_interface.cpp index 73b577a4c3..696fee925b 100644 --- a/src/wayland/autotests/server/test_inputmethod_interface.cpp +++ b/src/wayland/autotests/server/test_inputmethod_interface.cpp @@ -33,7 +33,7 @@ #include -using namespace KWaylandServer; +using namespace KWin; class InputPanelSurface : public QObject, public QtWayland::zwp_input_panel_surface_v1 { @@ -175,14 +175,14 @@ private: InputMethodV1 *m_inputMethod; InputPanel *m_inputPanel; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; SeatInterface *m_seat; CompositorInterface *m_serverCompositor; std::unique_ptr m_outputHandle; std::unique_ptr m_outputInterface; - KWaylandServer::InputMethodV1Interface *m_inputMethodIface; - KWaylandServer::InputPanelV1Interface *m_inputPanelIface; + KWin::InputMethodV1Interface *m_inputMethodIface; + KWin::InputPanelV1Interface *m_inputPanelIface; QVector m_surfaces; }; @@ -340,7 +340,7 @@ void TestInputMethodInterface::testContext() QVERIFY(inputMethodActivateSpy.wait()); QCOMPARE(inputMethodActivateSpy.count(), 1); - KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + KWin::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); QVERIFY(serverContext); InputMethodV1Context *imContext = m_inputMethod->context(); @@ -349,7 +349,7 @@ void TestInputMethodInterface::testContext() quint32 serial = 1; // commit some text - QSignalSpy commitStringSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::commitString); + QSignalSpy commitStringSpy(serverContext, &KWin::InputMethodContextV1Interface::commitString); imContext->commit_string(serial, "hello"); QVERIFY(commitStringSpy.wait()); QCOMPARE(commitStringSpy.count(), serial); @@ -358,7 +358,7 @@ void TestInputMethodInterface::testContext() serial++; // preedit styling event - QSignalSpy preeditStylingSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::preeditStyling); + QSignalSpy preeditStylingSpy(serverContext, &KWin::InputMethodContextV1Interface::preeditStyling); // protocol does not document 3rd argument mean in much details (styling) imContext->preedit_styling(0, 5, 1); QVERIFY(preeditStylingSpy.wait()); @@ -368,14 +368,14 @@ void TestInputMethodInterface::testContext() QCOMPARE(preeditStylingSpy.last().at(2).value(), 1); // preedit cursor event - QSignalSpy preeditCursorSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor); + QSignalSpy preeditCursorSpy(serverContext, &KWin::InputMethodContextV1Interface::preeditCursor); 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); + QSignalSpy preeditStringSpy(serverContext, &KWin::InputMethodContextV1Interface::preeditString); imContext->preedit_string(serial, "hello", "kde"); QVERIFY(preeditStringSpy.wait()); QCOMPARE(preeditStringSpy.count(), 1); @@ -385,7 +385,7 @@ void TestInputMethodInterface::testContext() serial++; // delete surrounding text - QSignalSpy deleteSurroundingSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::deleteSurroundingText); + QSignalSpy deleteSurroundingSpy(serverContext, &KWin::InputMethodContextV1Interface::deleteSurroundingText); imContext->delete_surrounding_text(0, 5); QVERIFY(deleteSurroundingSpy.wait()); QCOMPARE(deleteSurroundingSpy.count(), 1); @@ -393,7 +393,7 @@ void TestInputMethodInterface::testContext() QCOMPARE(deleteSurroundingSpy.last().at(1).value(), 5); // set cursor position - QSignalSpy cursorPositionSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::cursorPosition); + QSignalSpy cursorPositionSpy(serverContext, &KWin::InputMethodContextV1Interface::cursorPosition); imContext->cursor_position(2, 4); QVERIFY(cursorPositionSpy.wait()); QCOMPARE(cursorPositionSpy.count(), 1); @@ -452,18 +452,18 @@ void TestInputMethodInterface::testGrabkeyboard() QVERIFY(inputMethodActivateSpy.wait()); QCOMPARE(inputMethodActivateSpy.count(), 1); - KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + KWin::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); QVERIFY(serverContext); InputMethodV1Context *imContext = m_inputMethod->context(); QVERIFY(imContext); - QSignalSpy keyEventSpy(serverContext, &KWaylandServer::InputMethodContextV1Interface::key); + QSignalSpy keyEventSpy(serverContext, &KWin::InputMethodContextV1Interface::key); 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); + QSignalSpy modifierEventSpy(serverContext, &KWin::InputMethodContextV1Interface::modifiers); 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)); @@ -484,7 +484,7 @@ void TestInputMethodInterface::testGrabkeyboard() void TestInputMethodInterface::testContentHints_data() { - QTest::addColumn("serverHints"); + QTest::addColumn("serverHints"); QTest::addColumn("imHint"); QTest::addRow("Spellcheck") << TextInputContentHints(TextInputContentHint::AutoCorrection) << quint32(QtWaylandServer::zwp_text_input_v1::content_hint_auto_correction); @@ -518,7 +518,7 @@ void TestInputMethodInterface::testContentHints() QVERIFY(inputMethodActivateSpy.wait()); QCOMPARE(inputMethodActivateSpy.count(), 1); - KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + KWin::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); QVERIFY(serverContext); InputMethodV1Context *imContext = m_inputMethod->context(); @@ -526,8 +526,8 @@ void TestInputMethodInterface::testContentHints() QSignalSpy contentTypeChangedSpy(imContext, &InputMethodV1Context::content_type_changed); - QFETCH(KWaylandServer::TextInputContentHints, serverHints); - serverContext->sendContentType(serverHints, KWaylandServer::TextInputContentPurpose::Normal); + QFETCH(KWin::TextInputContentHints, serverHints); + serverContext->sendContentType(serverHints, KWin::TextInputContentPurpose::Normal); QVERIFY(contentTypeChangedSpy.wait()); QCOMPARE(contentTypeChangedSpy.count(), 1); QEXPECT_FAIL("SensitiveData", "SensitiveData content hint need fixing", Continue); @@ -543,7 +543,7 @@ void TestInputMethodInterface::testContentHints() void TestInputMethodInterface::testContentPurpose_data() { - QTest::addColumn("serverPurpose"); + QTest::addColumn("serverPurpose"); QTest::addColumn("imPurpose"); QTest::newRow("Alpha") << TextInputContentPurpose::Alpha << quint32(QtWaylandServer::zwp_text_input_v1::content_purpose_alpha); @@ -576,7 +576,7 @@ void TestInputMethodInterface::testContentPurpose() QVERIFY(inputMethodActivateSpy.wait()); QCOMPARE(inputMethodActivateSpy.count(), 1); - KWaylandServer::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); + KWin::InputMethodContextV1Interface *serverContext = m_inputMethodIface->context(); QVERIFY(serverContext); InputMethodV1Context *imContext = m_inputMethod->context(); @@ -584,8 +584,8 @@ void TestInputMethodInterface::testContentPurpose() QSignalSpy contentTypeChangedSpy(imContext, &InputMethodV1Context::content_type_changed); - QFETCH(KWaylandServer::TextInputContentPurpose, serverPurpose); - serverContext->sendContentType(KWaylandServer::TextInputContentHints(KWaylandServer::TextInputContentHint::None), serverPurpose); + QFETCH(KWin::TextInputContentPurpose, serverPurpose); + serverContext->sendContentType(KWin::TextInputContentHints(KWin::TextInputContentHint::None), serverPurpose); QVERIFY(contentTypeChangedSpy.wait()); QCOMPARE(contentTypeChangedSpy.count(), 1); QEXPECT_FAIL("Pin", "Pin should return content_purpose_password", Continue); diff --git a/src/wayland/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp b/src/wayland/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp index c1834ff02e..80fb4fe686 100644 --- a/src/wayland/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp +++ b/src/wayland/autotests/server/test_keyboard_shortcuts_inhibitor_interface.cpp @@ -24,7 +24,7 @@ #include "qwayland-keyboard-shortcuts-inhibit-unstable-v1.h" -using namespace KWaylandServer; +using namespace KWin; class KeyboardShortcutsInhibitManager : public QObject, public QtWayland::zwp_keyboard_shortcuts_inhibit_manager_v1 { @@ -80,7 +80,7 @@ private: KWayland::Client::Seat *m_clientSeat = nullptr; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; SeatInterface *m_seat; CompositorInterface *m_serverCompositor; diff --git a/src/wayland/autotests/server/test_layershellv1_interface.cpp b/src/wayland/autotests/server/test_layershellv1_interface.cpp index 02d04d72a4..c331c1adc8 100644 --- a/src/wayland/autotests/server/test_layershellv1_interface.cpp +++ b/src/wayland/autotests/server/test_layershellv1_interface.cpp @@ -23,10 +23,10 @@ #include "qwayland-wlr-layer-shell-unstable-v1.h" #include "qwayland-xdg-shell.h" -Q_DECLARE_METATYPE(KWaylandServer::LayerSurfaceV1Interface::Layer) -Q_DECLARE_METATYPE(KWaylandServer::LayerSurfaceV1Interface *) +Q_DECLARE_METATYPE(KWin::LayerSurfaceV1Interface::Layer) +Q_DECLARE_METATYPE(KWin::LayerSurfaceV1Interface *) -using namespace KWaylandServer; +using namespace KWin; class LayerShellV1 : public QtWayland::zwlr_layer_shell_v1 { @@ -109,7 +109,7 @@ private: KWayland::Client::Compositor *m_clientCompositor; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; CompositorInterface *m_serverCompositor; LayerShellV1 *m_clientLayerShell = nullptr; LayerShellV1Interface *m_serverLayerShell = nullptr; diff --git a/src/wayland/autotests/server/test_no_xdg_runtime_dir.cpp b/src/wayland/autotests/server/test_no_xdg_runtime_dir.cpp index 6cfac68ccb..54d921507b 100644 --- a/src/wayland/autotests/server/test_no_xdg_runtime_dir.cpp +++ b/src/wayland/autotests/server/test_no_xdg_runtime_dir.cpp @@ -9,7 +9,7 @@ // WaylandServer #include "wayland/display.h" -using namespace KWaylandServer; +using namespace KWin; class NoXdgRuntimeDirTest : public QObject { @@ -29,8 +29,8 @@ void NoXdgRuntimeDirTest::testCreate() // this test verifies that not having an XDG_RUNTIME_DIR is handled gracefully // the server cannot start, but should not crash const QString testSocketName = QStringLiteral("kwayland-test-no-xdg-runtime-dir-0"); - KWaylandServer::Display display; - QSignalSpy runningSpy(&display, &KWaylandServer::Display::runningChanged); + KWin::Display display; + QSignalSpy runningSpy(&display, &KWin::Display::runningChanged); QVERIFY(!display.addSocketName(testSocketName)); display.start(); diff --git a/src/wayland/autotests/server/test_screencast.cpp b/src/wayland/autotests/server/test_screencast.cpp index a844aac823..b5dd6720e1 100644 --- a/src/wayland/autotests/server/test_screencast.cpp +++ b/src/wayland/autotests/server/test_screencast.cpp @@ -82,11 +82,11 @@ private: KWayland::Client::EventQueue *m_queue = nullptr; ScreencastV1 *m_screencast = nullptr; - KWaylandServer::ScreencastV1Interface *m_screencastInterface = nullptr; + KWin::ScreencastV1Interface *m_screencastInterface = nullptr; - QPointer m_triggered = nullptr; + QPointer m_triggered = nullptr; QThread *m_thread; - KWaylandServer::Display *m_display = nullptr; + KWin::Display *m_display = nullptr; }; static const QString s_socketName = QStringLiteral("kwin-wayland-server-screencast-test-0"); @@ -94,7 +94,7 @@ static const QString s_socketName = QStringLiteral("kwin-wayland-server-screenca void TestScreencastV1Interface::initTestCase() { delete m_display; - m_display = new KWaylandServer::Display(this); + m_display = new KWin::Display(this); m_display->addSocketName(s_socketName); m_display->start(); QVERIFY(m_display->isRunning()); @@ -119,11 +119,11 @@ void TestScreencastV1Interface::initTestCase() KWayland::Client::Registry registry; QSignalSpy screencastSpy(®istry, &KWayland::Client::Registry::interfacesAnnounced); - m_screencastInterface = new KWaylandServer::ScreencastV1Interface(m_display, this); + m_screencastInterface = new KWin::ScreencastV1Interface(m_display, this); connect(m_screencastInterface, - &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, + &KWin::ScreencastV1Interface::windowScreencastRequested, this, - [this](KWaylandServer::ScreencastStreamV1Interface *stream, const QString &winid) { + [this](KWin::ScreencastStreamV1Interface *stream, const QString &winid) { stream->sendCreated(123); m_triggered = stream; }); @@ -174,7 +174,7 @@ void TestScreencastV1Interface::testCreate() QVERIFY(spyWorking.count() || spyWorking.wait()); QVERIFY(m_triggered); - QSignalSpy spyStop(m_triggered, &KWaylandServer::ScreencastStreamV1Interface::finished); + QSignalSpy spyStop(m_triggered, &KWin::ScreencastStreamV1Interface::finished); stream->close(); QVERIFY(spyStop.count() || spyStop.wait()); } diff --git a/src/wayland/autotests/server/test_seat.cpp b/src/wayland/autotests/server/test_seat.cpp index fe928fd1a9..3f3f43ece7 100644 --- a/src/wayland/autotests/server/test_seat.cpp +++ b/src/wayland/autotests/server/test_seat.cpp @@ -12,7 +12,7 @@ #include "wayland/pointer.h" #include "wayland/seat.h" -using namespace KWaylandServer; +using namespace KWin; class TestWaylandServerSeat : public QObject { @@ -30,7 +30,7 @@ static const QString s_socketName = QStringLiteral("kwin-wayland-server-seat-tes void TestWaylandServerSeat::testCapabilities() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); SeatInterface *seat = new SeatInterface(&display, &display); @@ -77,7 +77,7 @@ void TestWaylandServerSeat::testCapabilities() void TestWaylandServerSeat::testName() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); SeatInterface *seat = new SeatInterface(&display, &display); @@ -95,7 +95,7 @@ void TestWaylandServerSeat::testName() void TestWaylandServerSeat::testPointerButton() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); SeatInterface *seat = new SeatInterface(&display, &display); @@ -126,7 +126,7 @@ void TestWaylandServerSeat::testPointerButton() void TestWaylandServerSeat::testPointerPos() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); SeatInterface *seat = new SeatInterface(&display, &display); @@ -155,7 +155,7 @@ void TestWaylandServerSeat::testPointerPos() void TestWaylandServerSeat::testRepeatInfo() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); SeatInterface *seat = new SeatInterface(&display, &display); @@ -173,7 +173,7 @@ void TestWaylandServerSeat::testRepeatInfo() void TestWaylandServerSeat::testMultiple() { - KWaylandServer::Display display; + KWin::Display display; display.addSocketName(s_socketName); display.start(); QVERIFY(display.seats().isEmpty()); diff --git a/src/wayland/autotests/server/test_tablet_interface.cpp b/src/wayland/autotests/server/test_tablet_interface.cpp index 538b30e600..3e41d94fe1 100644 --- a/src/wayland/autotests/server/test_tablet_interface.cpp +++ b/src/wayland/autotests/server/test_tablet_interface.cpp @@ -23,7 +23,7 @@ #include "qwayland-tablet-unstable-v2.h" -using namespace KWaylandServer; +using namespace KWin; using namespace std::literals; class Tablet : public QtWayland::zwp_tablet_v2 @@ -158,7 +158,7 @@ private: KWayland::Client::Seat *m_clientSeat = nullptr; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; SeatInterface *m_seat; CompositorInterface *m_serverCompositor; @@ -267,7 +267,7 @@ void TestTabletInterface::testAdd() 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}, "my tablet"); + m_tool = seatInterface->addTool(KWin::TabletToolV2Interface::Pen, 0, 0, {TabletToolV2Interface::Tilt, TabletToolV2Interface::Pressure}, "my tablet"); QVERIFY(m_tool); QVERIFY(toolSpy.wait() || toolSpy.count() == 1); QCOMPARE(m_tabletSeatClient->m_tools.count(), 1); diff --git a/src/wayland/autotests/server/test_textinputv1_interface.cpp b/src/wayland/autotests/server/test_textinputv1_interface.cpp index 1e96799de1..c054294333 100644 --- a/src/wayland/autotests/server/test_textinputv1_interface.cpp +++ b/src/wayland/autotests/server/test_textinputv1_interface.cpp @@ -23,7 +23,7 @@ #include "qwayland-text-input-unstable-v1.h" -using namespace KWaylandServer; +using namespace KWin; Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v1::content_purpose) Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v1::content_hint) @@ -93,7 +93,7 @@ private: SeatInterface *m_seat; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; TextInputV1 *m_clientTextInputV1; CompositorInterface *m_serverCompositor; TextInputV1Interface *m_serverTextInputV1; @@ -293,7 +293,7 @@ void TestTextInputV1Interface::testEvents() void TestTextInputV1Interface::testContentPurpose_data() { QTest::addColumn("clientPurpose"); - QTest::addColumn("serverPurpose"); + QTest::addColumn("serverPurpose"); QTest::newRow("Alpha") << QtWayland::zwp_text_input_v1::content_purpose_alpha << TextInputContentPurpose::Alpha; QTest::newRow("Digits") << QtWayland::zwp_text_input_v1::content_purpose_digits << TextInputContentPurpose::Digits; @@ -372,7 +372,7 @@ void TestTextInputV1Interface::testContentPurpose() void TestTextInputV1Interface::testContentHints_data() { QTest::addColumn("clientHint"); - QTest::addColumn("serverHints"); + QTest::addColumn("serverHints"); QTest::addRow("Spellcheck") << quint32(QtWayland::zwp_text_input_v1::content_hint_auto_correction) << TextInputContentHints(TextInputContentHint::AutoCorrection); diff --git a/src/wayland/autotests/server/test_textinputv3_interface.cpp b/src/wayland/autotests/server/test_textinputv3_interface.cpp index 3139bb4911..837893fdb3 100644 --- a/src/wayland/autotests/server/test_textinputv3_interface.cpp +++ b/src/wayland/autotests/server/test_textinputv3_interface.cpp @@ -23,7 +23,7 @@ #include "qwayland-text-input-unstable-v3.h" -using namespace KWaylandServer; +using namespace KWin; Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v3::content_purpose) Q_DECLARE_METATYPE(QtWayland::zwp_text_input_v3::content_hint) @@ -116,7 +116,7 @@ private: SeatInterface *m_seat; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; TextInputV3 *m_clientTextInputV3; CompositorInterface *m_serverCompositor; TextInputV3Interface *m_serverTextInputV3; @@ -359,7 +359,7 @@ void TestTextInputV3Interface::testEvents() void TestTextInputV3Interface::testContentPurpose_data() { QTest::addColumn("clientPurpose"); - QTest::addColumn("serverPurpose"); + 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; @@ -444,7 +444,7 @@ void TestTextInputV3Interface::testContentPurpose() void TestTextInputV3Interface::testContentHints_data() { QTest::addColumn("clientHint"); - QTest::addColumn("serverHints"); + QTest::addColumn("serverHints"); QTest::addRow("Spellcheck") << quint32(QtWayland::zwp_text_input_v3::content_hint_spellcheck) << TextInputContentHints(TextInputContentHint::AutoCorrection); diff --git a/src/wayland/autotests/server/test_viewporter_interface.cpp b/src/wayland/autotests/server/test_viewporter_interface.cpp index 8dd9df9ff2..9e14271936 100644 --- a/src/wayland/autotests/server/test_viewporter_interface.cpp +++ b/src/wayland/autotests/server/test_viewporter_interface.cpp @@ -22,7 +22,7 @@ #include "qwayland-viewporter.h" -using namespace KWaylandServer; +using namespace KWin; class Viewporter : public QtWayland::wp_viewporter { @@ -50,7 +50,7 @@ private: KWayland::Client::ShmPool *m_shm; QThread *m_thread; - KWaylandServer::Display m_display; + KWin::Display m_display; CompositorInterface *m_serverCompositor; Viewporter *m_viewporter; }; diff --git a/src/wayland/blur.cpp b/src/wayland/blur.cpp index c0bc7dd336..792ec33186 100644 --- a/src/wayland/blur.cpp +++ b/src/wayland/blur.cpp @@ -12,7 +12,7 @@ #include "qwayland-server-blur.h" -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/blur.h b/src/wayland/blur.h index 7f0c721ecd..52139aedc2 100644 --- a/src/wayland/blur.h +++ b/src/wayland/blur.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class BlurManagerInterfacePrivate; diff --git a/src/wayland/clientconnection.cpp b/src/wayland/clientconnection.cpp index 0fb95f466c..a3225be269 100644 --- a/src/wayland/clientconnection.cpp +++ b/src/wayland/clientconnection.cpp @@ -12,7 +12,7 @@ // Wayland #include -namespace KWaylandServer +namespace KWin { class ClientConnectionPrivate { diff --git a/src/wayland/clientconnection.h b/src/wayland/clientconnection.h index d34b7b2d7e..1739a7406d 100644 --- a/src/wayland/clientconnection.h +++ b/src/wayland/clientconnection.h @@ -15,7 +15,7 @@ struct wl_client; struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnectionPrivate; class Display; @@ -23,9 +23,8 @@ 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 KWaylandServer. In particular the signal - * @link Display::clientConnected @endlink will be emitted. + * The ClientConnection gets automatically created for a wl_client. In particular, + * the signal @link Display::clientConnected @endlink will be emitted. * * @see Display */ @@ -57,7 +56,7 @@ public: * 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 KWaylandServer::Display. + * the pid will be identical to the process running the KWin::Display. * * @returns The pid of the connection. */ @@ -66,7 +65,7 @@ public: * 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 KWaylandServer::Display. + * the uid will be identical to the process running the KWin::Display. * * @returns The uid of the connection. */ @@ -75,7 +74,7 @@ public: * 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 KWaylandServer::Display. + * the gid will be identical to the process running the KWin::Display. * * @returns The gid of the connection. */ @@ -85,7 +84,7 @@ public: * 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 KWaylandServer::Display. + * the executablePath will be identical to the process running the KWin::Display. * * If the executable path cannot be resolved an empty QString is returned. * @@ -133,7 +132,7 @@ Q_SIGNALS: /** * Signal emitted when the ClientConnection got disconnected from the server. */ - void disconnected(KWaylandServer::ClientConnection *); + void disconnected(KWin::ClientConnection *); void scaleOverrideChanged(); @@ -145,4 +144,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::ClientConnection *) +Q_DECLARE_METATYPE(KWin::ClientConnection *) diff --git a/src/wayland/compositor.cpp b/src/wayland/compositor.cpp index 92812c61d5..43fd55426c 100644 --- a/src/wayland/compositor.cpp +++ b/src/wayland/compositor.cpp @@ -11,7 +11,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 6; @@ -70,6 +70,6 @@ Display *CompositorInterface::display() const return d->display; } -} // namespace KWaylandServer +} // namespace KWin #include "wayland/moc_compositor.cpp" diff --git a/src/wayland/compositor.h b/src/wayland/compositor.h index 5f70d3ae79..e021fde3c7 100644 --- a/src/wayland/compositor.h +++ b/src/wayland/compositor.h @@ -12,7 +12,7 @@ #include -namespace KWaylandServer +namespace KWin { class CompositorInterfacePrivate; class Display; @@ -39,10 +39,10 @@ Q_SIGNALS: /** * This signal is emitted when a new SurfaceInterface @a surface has been created. */ - void surfaceCreated(KWaylandServer::SurfaceInterface *surface); + void surfaceCreated(KWin::SurfaceInterface *surface); private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/contenttype_v1.cpp b/src/wayland/contenttype_v1.cpp index f8a9d47ec3..6b0385804b 100644 --- a/src/wayland/contenttype_v1.cpp +++ b/src/wayland/contenttype_v1.cpp @@ -8,23 +8,23 @@ #include "display.h" #include "surface_p.h" -namespace KWaylandServer +namespace KWin { static constexpr uint32_t s_version = 1; -static KWin::ContentType waylandToKwinContentType(uint32_t type) +static ContentType waylandToKwinContentType(uint32_t type) { using Type = QtWaylandServer::wp_content_type_v1::type; switch (type) { case Type::type_photo: - return KWin::ContentType::Photo; + return ContentType::Photo; case Type::type_video: - return KWin::ContentType::Video; + return ContentType::Video; case Type::type_game: - return KWin::ContentType::Game; + return ContentType::Game; default: - return KWin::ContentType::None; + return ContentType::None; } } @@ -70,7 +70,7 @@ void ContentTypeV1Interface::wp_content_type_v1_destroy(Resource *resource) { if (m_surface) { SurfaceInterfacePrivate *surfacePrivate = SurfaceInterfacePrivate::get(m_surface); - surfacePrivate->pending->contentType = KWin::ContentType::None; + surfacePrivate->pending->contentType = ContentType::None; surfacePrivate->pending->contentTypeIsSet = true; } wl_resource_destroy(resource->handle); diff --git a/src/wayland/contenttype_v1.h b/src/wayland/contenttype_v1.h index e5cf3627ab..625a0194d8 100644 --- a/src/wayland/contenttype_v1.h +++ b/src/wayland/contenttype_v1.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class ContentTypeV1Interface; diff --git a/src/wayland/contrast.cpp b/src/wayland/contrast.cpp index b80cc9342f..e23d86ee55 100644 --- a/src/wayland/contrast.cpp +++ b/src/wayland/contrast.cpp @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 2; diff --git a/src/wayland/contrast.h b/src/wayland/contrast.h index 990c272a70..5e14c3eb5b 100644 --- a/src/wayland/contrast.h +++ b/src/wayland/contrast.h @@ -16,7 +16,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class ContrastManagerInterfacePrivate; diff --git a/src/wayland/cursorshape_v1.cpp b/src/wayland/cursorshape_v1.cpp index cc986d7c53..5225db42c4 100644 --- a/src/wayland/cursorshape_v1.cpp +++ b/src/wayland/cursorshape_v1.cpp @@ -14,7 +14,7 @@ #include "qwayland-server-cursor-shape-v1.h" -namespace KWaylandServer +namespace KWin { static constexpr int s_version = 1; @@ -206,4 +206,4 @@ void CursorShapeDeviceV1Interface::wp_cursor_shape_device_v1_set_shape(Resource } } -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/cursorshape_v1.h b/src/wayland/cursorshape_v1.h index 007d522a33..bf905598bd 100644 --- a/src/wayland/cursorshape_v1.h +++ b/src/wayland/cursorshape_v1.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class CursorShapeManagerV1InterfacePrivate; @@ -28,4 +28,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/datacontroldevice_v1.cpp b/src/wayland/datacontroldevice_v1.cpp index d6081d739f..41ef009b5e 100644 --- a/src/wayland/datacontroldevice_v1.cpp +++ b/src/wayland/datacontroldevice_v1.cpp @@ -16,7 +16,7 @@ // Wayland #include -namespace KWaylandServer +namespace KWin { class DataControlDeviceV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_device_v1 { @@ -141,7 +141,7 @@ void DataControlDeviceV1Interface::sendSelection(AbstractDataSource *other) d->send_selection(offer ? offer->resource() : nullptr); } -void DataControlDeviceV1Interface::sendPrimarySelection(KWaylandServer::AbstractDataSource *other) +void DataControlDeviceV1Interface::sendPrimarySelection(AbstractDataSource *other) { if (d->resource()->version() >= ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION_SINCE_VERSION) { DataControlOfferV1Interface *offer = d->createDataOffer(other); diff --git a/src/wayland/datacontroldevice_v1.h b/src/wayland/datacontroldevice_v1.h index 8b4d1dfa49..f55c8aa946 100644 --- a/src/wayland/datacontroldevice_v1.h +++ b/src/wayland/datacontroldevice_v1.h @@ -12,7 +12,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class DataControlDeviceManagerV1Interface; @@ -43,9 +43,9 @@ public: void sendPrimarySelection(AbstractDataSource *other); Q_SIGNALS: - void selectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource); + void selectionChanged(KWin::DataControlSourceV1Interface *dataSource); - void primarySelectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource); + void primarySelectionChanged(KWin::DataControlSourceV1Interface *dataSource); private: friend class DataControlDeviceManagerV1InterfacePrivate; @@ -56,4 +56,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataControlDeviceV1Interface *) +Q_DECLARE_METATYPE(KWin::DataControlDeviceV1Interface *) diff --git a/src/wayland/datacontroldevicemanager_v1.cpp b/src/wayland/datacontroldevicemanager_v1.cpp index 90cf610baf..6936d99569 100644 --- a/src/wayland/datacontroldevicemanager_v1.cpp +++ b/src/wayland/datacontroldevicemanager_v1.cpp @@ -13,7 +13,7 @@ #include static const int s_version = 2; -namespace KWaylandServer +namespace KWin { class DataControlDeviceManagerV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_manager_v1 { diff --git a/src/wayland/datacontroldevicemanager_v1.h b/src/wayland/datacontroldevicemanager_v1.h index 30a8b56dda..ee10924c26 100644 --- a/src/wayland/datacontroldevicemanager_v1.h +++ b/src/wayland/datacontroldevicemanager_v1.h @@ -10,7 +10,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class DataControlSourceV1Interface; @@ -32,8 +32,8 @@ public: ~DataControlDeviceManagerV1Interface() override; Q_SIGNALS: - void dataSourceCreated(KWaylandServer::DataControlSourceV1Interface *dataSource); - void dataDeviceCreated(KWaylandServer::DataControlDeviceV1Interface *dataDevice); + void dataSourceCreated(KWin::DataControlSourceV1Interface *dataSource); + void dataDeviceCreated(KWin::DataControlDeviceV1Interface *dataDevice); private: std::unique_ptr d; diff --git a/src/wayland/datacontroloffer_v1.cpp b/src/wayland/datacontroloffer_v1.cpp index c056977b85..d34f6eb65d 100644 --- a/src/wayland/datacontroloffer_v1.cpp +++ b/src/wayland/datacontroloffer_v1.cpp @@ -14,7 +14,7 @@ // system #include -namespace KWaylandServer +namespace KWin { class DataControlOfferV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_offer_v1 { diff --git a/src/wayland/datacontroloffer_v1.h b/src/wayland/datacontroloffer_v1.h index 30bcd75957..7aed399da8 100644 --- a/src/wayland/datacontroloffer_v1.h +++ b/src/wayland/datacontroloffer_v1.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class DataControlDeviceV1Interface; @@ -44,4 +44,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataControlOfferV1Interface *) +Q_DECLARE_METATYPE(KWin::DataControlOfferV1Interface *) diff --git a/src/wayland/datacontrolsource_v1.cpp b/src/wayland/datacontrolsource_v1.cpp index ff8e444a31..11cba29b03 100644 --- a/src/wayland/datacontrolsource_v1.cpp +++ b/src/wayland/datacontrolsource_v1.cpp @@ -14,7 +14,7 @@ // system #include -namespace KWaylandServer +namespace KWin { class DataControlSourceV1InterfacePrivate : public QtWaylandServer::zwlr_data_control_source_v1 { diff --git a/src/wayland/datacontrolsource_v1.h b/src/wayland/datacontrolsource_v1.h index 3723672548..56a4344fb2 100644 --- a/src/wayland/datacontrolsource_v1.h +++ b/src/wayland/datacontrolsource_v1.h @@ -10,7 +10,7 @@ #include "abstract_data_source.h" #include "datacontroldevicemanager_v1.h" -namespace KWaylandServer +namespace KWin { class DataControlSourceV1InterfacePrivate; @@ -43,4 +43,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataControlSourceV1Interface *) +Q_DECLARE_METATYPE(KWin::DataControlSourceV1Interface *) diff --git a/src/wayland/datadevice.cpp b/src/wayland/datadevice.cpp index 0e2bdd6d46..a95f3c2ebc 100644 --- a/src/wayland/datadevice.cpp +++ b/src/wayland/datadevice.cpp @@ -17,7 +17,7 @@ #include "seat_p.h" #include "surface.h" -namespace KWaylandServer +namespace KWin { class DragAndDropIconPrivate { diff --git a/src/wayland/datadevice.h b/src/wayland/datadevice.h index d4eb4d8f02..687c471700 100644 --- a/src/wayland/datadevice.h +++ b/src/wayland/datadevice.h @@ -17,7 +17,7 @@ struct wl_client; struct wl_resource; -namespace KWaylandServer +namespace KWin { class DataDeviceManagerInterface; class DataOfferInterface; @@ -86,7 +86,7 @@ public: DataSourceInterface *selection() const; - void sendSelection(KWaylandServer::AbstractDataSource *other); + void sendSelection(KWin::AbstractDataSource *other); /** * The event is sent when a drag-and-drop operation is ended because the implicit grab is removed. */ @@ -109,7 +109,7 @@ public: Q_SIGNALS: void aboutToBeDestroyed(); void dragStarted(AbstractDataSource *source, SurfaceInterface *originSurface, quint32 serial, DragAndDropIcon *dragIcon); - void selectionChanged(KWaylandServer::DataSourceInterface *); + void selectionChanged(KWin::DataSourceInterface *); private: friend class DataDeviceManagerInterfacePrivate; @@ -120,4 +120,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataDeviceInterface *) +Q_DECLARE_METATYPE(KWin::DataDeviceInterface *) diff --git a/src/wayland/datadevice_p.h b/src/wayland/datadevice_p.h index 5077831c99..dbf60b5b8c 100644 --- a/src/wayland/datadevice_p.h +++ b/src/wayland/datadevice_p.h @@ -11,7 +11,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class DataDeviceInterface; @@ -52,4 +52,4 @@ protected: void data_device_release(Resource *resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/datadevicemanager.cpp b/src/wayland/datadevicemanager.cpp index 1906e5925b..1b864e60b4 100644 --- a/src/wayland/datadevicemanager.cpp +++ b/src/wayland/datadevicemanager.cpp @@ -11,7 +11,7 @@ // Wayland #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 3; diff --git a/src/wayland/datadevicemanager.h b/src/wayland/datadevicemanager.h index cba0024e35..7870f77069 100644 --- a/src/wayland/datadevicemanager.h +++ b/src/wayland/datadevicemanager.h @@ -13,7 +13,7 @@ #include "datadevice.h" -namespace KWaylandServer +namespace KWin { class Display; class DataSourceInterface; @@ -43,8 +43,8 @@ public: Q_DECLARE_FLAGS(DnDActions, DnDAction) Q_SIGNALS: - void dataSourceCreated(KWaylandServer::DataSourceInterface *); - void dataDeviceCreated(KWaylandServer::DataDeviceInterface *); + void dataSourceCreated(KWin::DataSourceInterface *); + void dataDeviceCreated(KWin::DataDeviceInterface *); private: std::unique_ptr d; @@ -52,4 +52,4 @@ private: } -Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::DataDeviceManagerInterface::DnDActions) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::DataDeviceManagerInterface::DnDActions) diff --git a/src/wayland/dataoffer.cpp b/src/wayland/dataoffer.cpp index aa01760943..91f5f552b9 100644 --- a/src/wayland/dataoffer.cpp +++ b/src/wayland/dataoffer.cpp @@ -16,7 +16,7 @@ // system #include -namespace KWaylandServer +namespace KWin { class DataOfferInterfacePrivate : public QtWaylandServer::wl_data_offer { diff --git a/src/wayland/dataoffer.h b/src/wayland/dataoffer.h index 54dd4401d5..83f014d45b 100644 --- a/src/wayland/dataoffer.h +++ b/src/wayland/dataoffer.h @@ -14,7 +14,7 @@ #include -namespace KWaylandServer +namespace KWin { class DataDeviceInterface; class AbstractDataSource; @@ -65,4 +65,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataOfferInterface *) +Q_DECLARE_METATYPE(KWin::DataOfferInterface *) diff --git a/src/wayland/datasource.cpp b/src/wayland/datasource.cpp index a30c888144..08fab2ce6c 100644 --- a/src/wayland/datasource.cpp +++ b/src/wayland/datasource.cpp @@ -16,7 +16,7 @@ // system #include -namespace KWaylandServer +namespace KWin { DataSourceInterfacePrivate::DataSourceInterfacePrivate(DataSourceInterface *_q, ::wl_resource *resource) : QtWaylandServer::wl_data_source(resource) diff --git a/src/wayland/datasource.h b/src/wayland/datasource.h index a449c8f09c..dc39556ed6 100644 --- a/src/wayland/datasource.h +++ b/src/wayland/datasource.h @@ -11,7 +11,7 @@ #include "abstract_data_source.h" #include "datadevicemanager.h" -namespace KWaylandServer +namespace KWin { class DataSourceInterfacePrivate; class XdgToplevelDragV1Interface; @@ -65,4 +65,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::DataSourceInterface *) +Q_DECLARE_METATYPE(KWin::DataSourceInterface *) diff --git a/src/wayland/datasource_p.h b/src/wayland/datasource_p.h index 5cdad2c5ff..d9cdbc9958 100644 --- a/src/wayland/datasource_p.h +++ b/src/wayland/datasource_p.h @@ -11,7 +11,7 @@ #include "datadevicemanager.h" -namespace KWaylandServer +namespace KWin { class DataSourceInterface; class XdgToplevelDragV1Interface; diff --git a/src/wayland/display.cpp b/src/wayland/display.cpp index 738e9b95d3..dae40c3057 100644 --- a/src/wayland/display.cpp +++ b/src/wayland/display.cpp @@ -16,7 +16,7 @@ #include #include -namespace KWaylandServer +namespace KWin { DisplayPrivate *DisplayPrivate::get(Display *display) { @@ -216,7 +216,7 @@ ClientConnection *Display::createClient(int fd) return getConnection(c); } -KWin::GraphicsBuffer *Display::bufferForResource(wl_resource *resource) +GraphicsBuffer *Display::bufferForResource(wl_resource *resource) { if (auto buffer = LinuxDmaBufV1ClientBuffer::get(resource)) { return buffer; @@ -227,6 +227,6 @@ KWin::GraphicsBuffer *Display::bufferForResource(wl_resource *resource) } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_display.cpp" diff --git a/src/wayland/display.h b/src/wayland/display.h index 6660e6a24d..f428f1f433 100644 --- a/src/wayland/display.h +++ b/src/wayland/display.h @@ -18,30 +18,13 @@ struct wl_display; namespace KWin { -class GraphicsBuffer; -} - -namespace KWaylandServer -{ -/** - * @short KWayland Server. - * - * This namespace groups all classes related to the Server module. - * - * 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. - * - * KWaylandServer is an API to easily create a head-less Wayland server with a - * Qt style API. - * - * @see Display - */ class ClientConnection; class DisplayPrivate; class OutputInterface; class OutputDeviceV2Interface; class SeatInterface; +class GraphicsBuffer; /** * @brief Class holding the Wayland server display loop. @@ -132,7 +115,7 @@ public: /** * Returns the graphics buffer for the given @a resource, or @c null if there's no buffer. */ - static KWin::GraphicsBuffer *bufferForResource(wl_resource *resource); + static GraphicsBuffer *bufferForResource(wl_resource *resource); private Q_SLOTS: void flush(); @@ -140,8 +123,8 @@ private Q_SLOTS: Q_SIGNALS: void socketNamesChanged(); void runningChanged(bool); - void clientConnected(KWaylandServer::ClientConnection *); - void clientDisconnected(KWaylandServer::ClientConnection *); + void clientConnected(KWin::ClientConnection *); + void clientDisconnected(KWin::ClientConnection *); private: friend class DisplayPrivate; diff --git a/src/wayland/display_p.h b/src/wayland/display_p.h index 816e3cd154..80546e7988 100644 --- a/src/wayland/display_p.h +++ b/src/wayland/display_p.h @@ -16,7 +16,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -44,4 +44,4 @@ public: QStringList socketNames; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/dpms.cpp b/src/wayland/dpms.cpp index 2cec63af22..206462a051 100644 --- a/src/wayland/dpms.cpp +++ b/src/wayland/dpms.cpp @@ -11,9 +11,7 @@ #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; @@ -149,16 +147,16 @@ void DpmsInterface::sendMode() const auto mode = m_output->handle()->dpmsMode(); org_kde_kwin_dpms_mode wlMode; switch (mode) { - case KWin::Output::DpmsMode::On: + case Output::DpmsMode::On: wlMode = ORG_KDE_KWIN_DPMS_MODE_ON; break; - case KWin::Output::DpmsMode::Standby: + case Output::DpmsMode::Standby: wlMode = ORG_KDE_KWIN_DPMS_MODE_STANDBY; break; - case KWin::Output::DpmsMode::Suspend: + case Output::DpmsMode::Suspend: wlMode = ORG_KDE_KWIN_DPMS_MODE_SUSPEND; break; - case KWin::Output::DpmsMode::Off: + case Output::DpmsMode::Off: wlMode = ORG_KDE_KWIN_DPMS_MODE_OFF; break; default: diff --git a/src/wayland/dpms.h b/src/wayland/dpms.h index 1248ac8d6c..0a9d8385b2 100644 --- a/src/wayland/dpms.h +++ b/src/wayland/dpms.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class Display; class DpmsManagerInterfacePrivate; @@ -36,13 +36,13 @@ class DpmsManagerInterfacePrivate; * @code * // We have our OutputInterface called output. * output->setDpmsSupported(true); - * output->setDpmsMode(KWin::Output::DpmsMode::On); + * output->setDpmsMode(Output::DpmsMode::On); * @endcode * * To connect to Dpms change requests use: * @code - * connect(output, &KWin::Output::DpmsModeRequested, - * [] (KWaylandServer::KWin::Output::DpmsMode requestedMode) { qDebug() << "Mode change requested"; }); + * connect(output, &Output::DpmsModeRequested, + * [] (Output::DpmsMode requestedMode) { qDebug() << "Mode change requested"; }); * @endcode * * @see Display diff --git a/src/wayland/drmclientbuffer.cpp b/src/wayland/drmclientbuffer.cpp index 7d70214d96..6e9ae60c2d 100644 --- a/src/wayland/drmclientbuffer.cpp +++ b/src/wayland/drmclientbuffer.cpp @@ -10,7 +10,7 @@ #include "qwayland-server-drm.h" -namespace KWaylandServer +namespace KWin { static constexpr int s_version = 2; @@ -133,6 +133,6 @@ void DrmClientBufferIntegration::setDevice(const QString &node) d->nodeName = node; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_drmclientbuffer.cpp" diff --git a/src/wayland/drmclientbuffer.h b/src/wayland/drmclientbuffer.h index 46369d413e..c326cb5cc9 100644 --- a/src/wayland/drmclientbuffer.h +++ b/src/wayland/drmclientbuffer.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class Display; @@ -41,4 +41,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/drmlease_v1.cpp b/src/wayland/drmlease_v1.cpp index 80c975a11d..14432fe5df 100644 --- a/src/wayland/drmlease_v1.cpp +++ b/src/wayland/drmlease_v1.cpp @@ -12,12 +12,12 @@ #include #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; -DrmLeaseManagerV1::DrmLeaseManagerV1(KWin::DrmBackend *backend, Display *display, QObject *parent) +DrmLeaseManagerV1::DrmLeaseManagerV1(DrmBackend *backend, Display *display, QObject *parent) : QObject(parent) , m_backend(backend) , m_display(display) @@ -26,9 +26,9 @@ DrmLeaseManagerV1::DrmLeaseManagerV1(KWin::DrmBackend *backend, Display *display for (const auto &gpu : gpus) { addGpu(gpu.get()); } - connect(m_backend, &KWin::DrmBackend::gpuAdded, this, &DrmLeaseManagerV1::addGpu); - connect(m_backend, &KWin::DrmBackend::gpuRemoved, this, &DrmLeaseManagerV1::removeGpu); - connect(m_backend, &KWin::DrmBackend::outputsQueried, this, &DrmLeaseManagerV1::handleOutputsQueried); + connect(m_backend, &DrmBackend::gpuAdded, this, &DrmLeaseManagerV1::addGpu); + connect(m_backend, &DrmBackend::gpuRemoved, this, &DrmLeaseManagerV1::removeGpu); + connect(m_backend, &DrmBackend::outputsQueried, this, &DrmLeaseManagerV1::handleOutputsQueried); } DrmLeaseManagerV1::~DrmLeaseManagerV1() @@ -38,12 +38,12 @@ DrmLeaseManagerV1::~DrmLeaseManagerV1() } } -void DrmLeaseManagerV1::addGpu(KWin::DrmGpu *gpu) +void DrmLeaseManagerV1::addGpu(DrmGpu *gpu) { m_leaseDevices[gpu] = new DrmLeaseDeviceV1Interface(m_display, gpu); } -void DrmLeaseManagerV1::removeGpu(KWin::DrmGpu *gpu) +void DrmLeaseManagerV1::removeGpu(DrmGpu *gpu) { if (auto device = m_leaseDevices.take(gpu)) { device->remove(); @@ -58,7 +58,7 @@ void DrmLeaseManagerV1::handleOutputsQueried() } } -DrmLeaseDeviceV1Interface::DrmLeaseDeviceV1Interface(Display *display, KWin::DrmGpu *gpu) +DrmLeaseDeviceV1Interface::DrmLeaseDeviceV1Interface(Display *display, DrmGpu *gpu) : QtWaylandServer::wp_drm_lease_device_v1(*display, s_version) , m_gpu(gpu) { @@ -66,9 +66,9 @@ DrmLeaseDeviceV1Interface::DrmLeaseDeviceV1Interface(Display *display, KWin::Drm for (const auto output : outputs) { addOutput(output); } - connect(gpu, &KWin::DrmGpu::outputAdded, this, &DrmLeaseDeviceV1Interface::addOutput); - connect(gpu, &KWin::DrmGpu::outputRemoved, this, &DrmLeaseDeviceV1Interface::removeOutput); - connect(gpu, &KWin::DrmGpu::activeChanged, this, &DrmLeaseDeviceV1Interface::setDrmMaster); + connect(gpu, &DrmGpu::outputAdded, this, &DrmLeaseDeviceV1Interface::addOutput); + connect(gpu, &DrmGpu::outputRemoved, this, &DrmLeaseDeviceV1Interface::removeOutput); + connect(gpu, &DrmGpu::activeChanged, this, &DrmLeaseDeviceV1Interface::setDrmMaster); } DrmLeaseDeviceV1Interface::~DrmLeaseDeviceV1Interface() @@ -78,9 +78,9 @@ DrmLeaseDeviceV1Interface::~DrmLeaseDeviceV1Interface() } } -void DrmLeaseDeviceV1Interface::addOutput(KWin::DrmAbstractOutput *output) +void DrmLeaseDeviceV1Interface::addOutput(DrmAbstractOutput *output) { - KWin::DrmOutput *drmOutput = qobject_cast(output); + DrmOutput *drmOutput = qobject_cast(output); if (!drmOutput || !drmOutput->isNonDesktop()) { return; } @@ -91,7 +91,7 @@ void DrmLeaseDeviceV1Interface::addOutput(KWin::DrmAbstractOutput *output) } } -void DrmLeaseDeviceV1Interface::removeOutput(KWin::DrmAbstractOutput *output) +void DrmLeaseDeviceV1Interface::removeOutput(DrmAbstractOutput *output) { const auto it = m_connectors.find(output); if (it != m_connectors.end()) { @@ -120,7 +120,7 @@ void DrmLeaseDeviceV1Interface::setDrmMaster(bool hasDrmMaster) if (hasDrmMaster) { // send pending drm fds while (!m_pendingFds.isEmpty()) { - KWin::FileDescriptor fd = m_gpu->createNonMasterFd(); + FileDescriptor fd = m_gpu->createNonMasterFd(); send_drm_fd(m_pendingFds.dequeue(), fd.get()); } // offer all connectors again @@ -189,7 +189,7 @@ bool DrmLeaseDeviceV1Interface::hasDrmMaster() const return m_hasDrmMaster; } -KWin::DrmGpu *DrmLeaseDeviceV1Interface::gpu() const +DrmGpu *DrmLeaseDeviceV1Interface::gpu() const { return m_gpu; } @@ -229,7 +229,7 @@ void DrmLeaseDeviceV1Interface::wp_drm_lease_device_v1_bind_resource(Resource *r m_pendingFds << resource->handle; return; } - KWin::FileDescriptor fd = m_gpu->createNonMasterFd(); + FileDescriptor fd = m_gpu->createNonMasterFd(); send_drm_fd(resource->handle, fd.get()); for (const auto &[output, connector] : m_connectors) { if (!connector->withdrawn()) { @@ -246,7 +246,7 @@ void DrmLeaseDeviceV1Interface::wp_drm_lease_device_v1_destroy_global() delete this; } -DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, KWin::DrmOutput *output) +DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, DrmOutput *output) : wp_drm_lease_connector_v1() , m_device(leaseDevice) , m_output(output) @@ -263,7 +263,7 @@ DrmLeaseDeviceV1Interface *DrmLeaseConnectorV1Interface::device() const return m_device; } -KWin::DrmOutput *DrmLeaseConnectorV1Interface::output() const +DrmOutput *DrmLeaseConnectorV1Interface::output() const { return m_output; } @@ -356,7 +356,7 @@ void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_submit(Resource *resour } else if (m_connectors.isEmpty()) { wl_resource_post_error(resource->handle, WP_DRM_LEASE_REQUEST_V1_ERROR_EMPTY_LEASE, "Requested lease without connectors"); } else { - QVector outputs; + QVector outputs; for (const auto &connector : m_connectors) { outputs.push_back(connector->output()); } @@ -392,12 +392,12 @@ DrmLeaseV1Interface::~DrmLeaseV1Interface() m_device->removeLease(this); } -void DrmLeaseV1Interface::grant(std::unique_ptr &&lease) +void DrmLeaseV1Interface::grant(std::unique_ptr &&lease) { - KWin::FileDescriptor tmp = std::move(lease->fd()); + FileDescriptor tmp = std::move(lease->fd()); send_lease_fd(tmp.get()); m_lease = std::move(lease); - connect(m_lease.get(), &KWin::DrmLease::revokeRequested, this, &DrmLeaseV1Interface::revoke); + connect(m_lease.get(), &DrmLease::revokeRequested, this, &DrmLeaseV1Interface::revoke); for (const auto &connector : std::as_const(m_connectors)) { connector->withdraw(); } diff --git a/src/wayland/drmlease_v1.h b/src/wayland/drmlease_v1.h index 82560d15e7..0e662aadca 100644 --- a/src/wayland/drmlease_v1.h +++ b/src/wayland/drmlease_v1.h @@ -12,13 +12,9 @@ namespace KWin { + class DrmBackend; class DrmGpu; -} - -namespace KWaylandServer -{ - class DrmLeaseDeviceV1Interface; class DrmLeaseConnectorV1Interface; class Display; @@ -27,16 +23,16 @@ class DrmLeaseManagerV1 : public QObject { Q_OBJECT public: - DrmLeaseManagerV1(KWin::DrmBackend *backend, Display *display, QObject *parent = nullptr); + DrmLeaseManagerV1(DrmBackend *backend, Display *display, QObject *parent = nullptr); ~DrmLeaseManagerV1(); private: - void addGpu(KWin::DrmGpu *gpu); - void removeGpu(KWin::DrmGpu *gpu); + void addGpu(DrmGpu *gpu); + void removeGpu(DrmGpu *gpu); void handleOutputsQueried(); - KWin::DrmBackend *const m_backend; + DrmBackend *const m_backend; Display *const m_display; - QHash m_leaseDevices; + QHash m_leaseDevices; }; } diff --git a/src/wayland/drmlease_v1_p.h b/src/wayland/drmlease_v1_p.h index 69be438b01..21d088116e 100644 --- a/src/wayland/drmlease_v1_p.h +++ b/src/wayland/drmlease_v1_p.h @@ -17,7 +17,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; @@ -28,11 +28,11 @@ class DrmLeaseV1Interface; class DrmLeaseDeviceV1Interface : public QObject, public QtWaylandServer::wp_drm_lease_device_v1 { public: - explicit DrmLeaseDeviceV1Interface(Display *display, KWin::DrmGpu *gpu); + explicit DrmLeaseDeviceV1Interface(Display *display, DrmGpu *gpu); ~DrmLeaseDeviceV1Interface(); - void addOutput(KWin::DrmAbstractOutput *output); - void removeOutput(KWin::DrmAbstractOutput *output); + void addOutput(DrmAbstractOutput *output); + void removeOutput(DrmAbstractOutput *output); void setDrmMaster(bool hasDrmMaster); void done(); void remove(); @@ -43,7 +43,7 @@ public: void offerConnector(DrmLeaseConnectorV1Interface *connector); bool hasDrmMaster() const; - KWin::DrmGpu *gpu() const; + DrmGpu *gpu() const; private: void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override; @@ -51,9 +51,9 @@ private: void wp_drm_lease_device_v1_bind_resource(Resource *resource) override; void wp_drm_lease_device_v1_destroy_global() override; - KWin::DrmGpu *const m_gpu; + DrmGpu *const m_gpu; bool m_hasDrmMaster = true; - std::map> m_connectors; + std::map> m_connectors; QQueue m_pendingFds; QVector m_leaseRequests; QVector m_leases; @@ -63,14 +63,14 @@ class DrmLeaseConnectorV1Interface : public QObject, public QtWaylandServer::wp_ { Q_OBJECT public: - explicit DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, KWin::DrmOutput *output); + explicit DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, DrmOutput *output); uint32_t id() const; void send(wl_resource *resource); void withdraw(); DrmLeaseDeviceV1Interface *device() const; - KWin::DrmOutput *output() const; + DrmOutput *output() const; bool withdrawn() const; private: @@ -78,7 +78,7 @@ private: QPointer m_device; bool m_withdrawn = false; - KWin::DrmOutput *const m_output; + DrmOutput *const m_output; }; class DrmLeaseRequestV1Interface : public QtWaylandServer::wp_drm_lease_request_v1 @@ -107,7 +107,7 @@ public: DrmLeaseV1Interface(DrmLeaseDeviceV1Interface *device, const QVector &connectors, wl_resource *resource); ~DrmLeaseV1Interface(); - void grant(std::unique_ptr &&lease); + void grant(std::unique_ptr &&lease); void deny(); void revoke(); @@ -116,7 +116,7 @@ public: private: DrmLeaseDeviceV1Interface *m_device; QVector m_connectors; - std::unique_ptr m_lease; + std::unique_ptr m_lease; bool m_finished = false; void wp_drm_lease_v1_destroy(Resource *resource) override; diff --git a/src/wayland/fakeinput.cpp b/src/wayland/fakeinput.cpp index 20937ee1bf..c8d3637808 100644 --- a/src/wayland/fakeinput.cpp +++ b/src/wayland/fakeinput.cpp @@ -13,7 +13,7 @@ #include #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 4; diff --git a/src/wayland/fakeinput.h b/src/wayland/fakeinput.h index fe2125594a..822ab2ee9f 100644 --- a/src/wayland/fakeinput.h +++ b/src/wayland/fakeinput.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class FakeInputDeviceInterface; @@ -49,9 +49,9 @@ Q_SIGNALS: * Signal emitted whenever a client bound the fake input @p device. * @param device The created FakeInputDevice */ - void deviceCreated(KWaylandServer::FakeInputDeviceInterface *device); + void deviceCreated(KWin::FakeInputDeviceInterface *device); - void deviceDestroyed(KWaylandServer::FakeInputDeviceInterface *device); + void deviceDestroyed(KWin::FakeInputDeviceInterface *device); private: std::unique_ptr d; @@ -153,4 +153,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::FakeInputDeviceInterface *) +Q_DECLARE_METATYPE(KWin::FakeInputDeviceInterface *) diff --git a/src/wayland/filtered_display.cpp b/src/wayland/filtered_display.cpp index 5be5de9bde..535a809ae0 100644 --- a/src/wayland/filtered_display.cpp +++ b/src/wayland/filtered_display.cpp @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class FilteredDisplayPrivate { diff --git a/src/wayland/filtered_display.h b/src/wayland/filtered_display.h index 5e12b7f968..4eaafba77e 100644 --- a/src/wayland/filtered_display.h +++ b/src/wayland/filtered_display.h @@ -8,7 +8,7 @@ #include "display.h" -namespace KWaylandServer +namespace KWin { class FilteredDisplayPrivate; diff --git a/src/wayland/fractionalscale_v1.cpp b/src/wayland/fractionalscale_v1.cpp index c6beaa13d5..946cb03f28 100644 --- a/src/wayland/fractionalscale_v1.cpp +++ b/src/wayland/fractionalscale_v1.cpp @@ -14,7 +14,7 @@ static const int s_version = 1; -namespace KWaylandServer +namespace KWin { class FractionalScaleManagerV1InterfacePrivate : public QtWaylandServer::wp_fractional_scale_manager_v1 { @@ -93,6 +93,6 @@ FractionalScaleManagerV1Interface::~FractionalScaleManagerV1Interface() { } -} // namespace KWaylandServer +} // namespace KWin #include "moc_fractionalscale_v1.cpp" diff --git a/src/wayland/fractionalscale_v1.h b/src/wayland/fractionalscale_v1.h index ca60b0bf41..db1b775b9d 100644 --- a/src/wayland/fractionalscale_v1.h +++ b/src/wayland/fractionalscale_v1.h @@ -11,7 +11,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class FractionalScaleManagerV1InterfacePrivate; @@ -28,4 +28,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/fractionalscale_v1_p.h b/src/wayland/fractionalscale_v1_p.h index 69c1545146..660fbd765b 100644 --- a/src/wayland/fractionalscale_v1_p.h +++ b/src/wayland/fractionalscale_v1_p.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class SurfaceInterface; @@ -30,4 +30,4 @@ protected: void wp_fractional_scale_v1_destroy_resource(Resource *resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/idle.cpp b/src/wayland/idle.cpp index 066238a1ee..82e5a55708 100644 --- a/src/wayland/idle.cpp +++ b/src/wayland/idle.cpp @@ -10,9 +10,7 @@ #include "idledetector.h" #include "input.h" -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/idle.h b/src/wayland/idle.h index 9f6b223a63..221002aa03 100644 --- a/src/wayland/idle.h +++ b/src/wayland/idle.h @@ -11,7 +11,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class IdleInterfacePrivate; diff --git a/src/wayland/idle_p.h b/src/wayland/idle_p.h index d26f1fb4e7..cb5386d96f 100644 --- a/src/wayland/idle_p.h +++ b/src/wayland/idle_p.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class Display; class SeatInterface; diff --git a/src/wayland/idleinhibit_v1.cpp b/src/wayland/idleinhibit_v1.cpp index 13214a5dc1..416d96cee9 100644 --- a/src/wayland/idleinhibit_v1.cpp +++ b/src/wayland/idleinhibit_v1.cpp @@ -7,7 +7,7 @@ #include "idleinhibit_v1_p.h" #include "surface_p.h" -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/idleinhibit_v1.h b/src/wayland/idleinhibit_v1.h index e948dea681..90c52880e6 100644 --- a/src/wayland/idleinhibit_v1.h +++ b/src/wayland/idleinhibit_v1.h @@ -11,7 +11,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class IdleInhibitManagerV1InterfacePrivate; diff --git a/src/wayland/idleinhibit_v1_p.h b/src/wayland/idleinhibit_v1_p.h index ae25719987..2842365e26 100644 --- a/src/wayland/idleinhibit_v1_p.h +++ b/src/wayland/idleinhibit_v1_p.h @@ -9,7 +9,7 @@ #include -namespace KWaylandServer +namespace KWin { class IdleInhibitManagerV1InterfacePrivate : public QtWaylandServer::zwp_idle_inhibit_manager_v1 { diff --git a/src/wayland/idlenotify_v1.cpp b/src/wayland/idlenotify_v1.cpp index 6a01f07f39..1a774bc720 100644 --- a/src/wayland/idlenotify_v1.cpp +++ b/src/wayland/idlenotify_v1.cpp @@ -11,9 +11,7 @@ #include "qwayland-server-ext-idle-notify-v1.h" -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/idlenotify_v1.h b/src/wayland/idlenotify_v1.h index 97520a4caa..c1c23ba122 100644 --- a/src/wayland/idlenotify_v1.h +++ b/src/wayland/idlenotify_v1.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; diff --git a/src/wayland/inputmethod_v1.cpp b/src/wayland/inputmethod_v1.cpp index 1f8156dce5..c786827c80 100644 --- a/src/wayland/inputmethod_v1.cpp +++ b/src/wayland/inputmethod_v1.cpp @@ -22,7 +22,7 @@ #include "qwayland-server-text-input-unstable-v1.h" #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { static int s_version = 1; @@ -46,7 +46,7 @@ InputMethodGrabV1::~InputMethodGrabV1() void InputMethodGrabV1::sendKeymap(const QByteArray &keymap) { - KWin::RamFile keymapFile("kwin-xkb-input-method-grab-keymap", keymap.constData(), keymap.size() + 1); // include QByteArray null terminator + RamFile keymapFile("kwin-xkb-input-method-grab-keymap", keymap.constData(), keymap.size() + 1); // include QByteArray null terminator const auto resources = d->resourceMap(); for (auto r : resources) { diff --git a/src/wayland/inputmethod_v1.h b/src/wayland/inputmethod_v1.h index 969408bdcc..a0229cb4c8 100644 --- a/src/wayland/inputmethod_v1.h +++ b/src/wayland/inputmethod_v1.h @@ -14,7 +14,7 @@ #include "textinput.h" -namespace KWaylandServer +namespace KWin { class OutputInterface; class SurfaceInterface; @@ -75,7 +75,7 @@ public: void sendSurroundingText(const QString &text, quint32 cursor, quint32 anchor); void sendReset(); - void sendContentType(KWaylandServer::TextInputContentHints hint, KWaylandServer::TextInputContentPurpose purpose); + void sendContentType(KWin::TextInputContentHints hint, KWin::TextInputContentPurpose purpose); void sendInvokeAction(quint32 button, quint32 index); void sendCommitState(quint32 serial); void sendPreferredLanguage(const QString &language); @@ -172,5 +172,5 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::InputMethodV1Interface *) -Q_DECLARE_METATYPE(KWaylandServer::InputMethodGrabV1 *) +Q_DECLARE_METATYPE(KWin::InputMethodV1Interface *) +Q_DECLARE_METATYPE(KWin::InputMethodGrabV1 *) diff --git a/src/wayland/keyboard.cpp b/src/wayland/keyboard.cpp index 505442b9b6..68da013726 100644 --- a/src/wayland/keyboard.cpp +++ b/src/wayland/keyboard.cpp @@ -14,7 +14,7 @@ #include -namespace KWaylandServer +namespace KWin { KeyboardInterfacePrivate::KeyboardInterfacePrivate(SeatInterface *s) : seat(s) @@ -75,11 +75,11 @@ void KeyboardInterfacePrivate::sendKeymap(Resource *resource) { // From version 7 on, keymaps must be mapped privately, so that // we can seal the fd and reuse it between clients. - if (resource->version() >= 7 && sharedKeymapFile.effectiveFlags().testFlag(KWin::RamFile::Flag::SealWrite)) { + if (resource->version() >= 7 && sharedKeymapFile.effectiveFlags().testFlag(RamFile::Flag::SealWrite)) { send_keymap(resource->handle, keymap_format::keymap_format_xkb_v1, sharedKeymapFile.fd(), sharedKeymapFile.size()); // otherwise give each client its own unsealed copy. } else { - KWin::RamFile keymapFile("kwin-xkb-keymap", keymap.constData(), keymap.size() + 1); // Include QByteArray null-terminator. + RamFile keymapFile("kwin-xkb-keymap", keymap.constData(), keymap.size() + 1); // Include QByteArray null-terminator. send_keymap(resource->handle, keymap_format::keymap_format_xkb_v1, keymapFile.fd(), keymapFile.size()); } } @@ -92,7 +92,7 @@ void KeyboardInterface::setKeymap(const QByteArray &content) d->keymap = content; // +1 to include QByteArray null terminator. - d->sharedKeymapFile = KWin::RamFile("kwin-xkb-keymap-shared", content.constData(), content.size() + 1, KWin::RamFile::Flag::SealWrite); + d->sharedKeymapFile = RamFile("kwin-xkb-keymap-shared", content.constData(), content.size() + 1, RamFile::Flag::SealWrite); const auto keyboardResources = d->resourceMap(); for (KeyboardInterfacePrivate::Resource *resource : keyboardResources) { diff --git a/src/wayland/keyboard.h b/src/wayland/keyboard.h index b301248c1f..3f1bd02e40 100644 --- a/src/wayland/keyboard.h +++ b/src/wayland/keyboard.h @@ -9,7 +9,7 @@ #include -namespace KWaylandServer +namespace KWin { class ClientConnection; class SeatInterface; @@ -71,4 +71,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::KeyboardInterface *) +Q_DECLARE_METATYPE(KWin::KeyboardInterface *) diff --git a/src/wayland/keyboard_p.h b/src/wayland/keyboard_p.h index 17e985dea0..65f49629fe 100644 --- a/src/wayland/keyboard_p.h +++ b/src/wayland/keyboard_p.h @@ -13,7 +13,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class ClientConnection; @@ -40,7 +40,7 @@ public: QMetaObject::Connection destroyConnection; QPointer modifierFocusSurface; QByteArray keymap; - KWin::RamFile sharedKeymapFile; + RamFile sharedKeymapFile; struct { diff --git a/src/wayland/keyboard_shortcuts_inhibit_v1.cpp b/src/wayland/keyboard_shortcuts_inhibit_v1.cpp index 682ff8c57f..1d634eecda 100644 --- a/src/wayland/keyboard_shortcuts_inhibit_v1.cpp +++ b/src/wayland/keyboard_shortcuts_inhibit_v1.cpp @@ -15,7 +15,7 @@ static const int s_version = 1; -namespace KWaylandServer +namespace KWin { class KeyboardShortcutsInhibitorV1InterfacePrivate : public QtWaylandServer::zwp_keyboard_shortcuts_inhibitor_v1 { diff --git a/src/wayland/keyboard_shortcuts_inhibit_v1.h b/src/wayland/keyboard_shortcuts_inhibit_v1.h index caed5a0768..8297c3cf60 100644 --- a/src/wayland/keyboard_shortcuts_inhibit_v1.h +++ b/src/wayland/keyboard_shortcuts_inhibit_v1.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { /** * This is an implementation of wayland-protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml diff --git a/src/wayland/keystate.cpp b/src/wayland/keystate.cpp index b8ac499a5c..cf3dd6b002 100644 --- a/src/wayland/keystate.cpp +++ b/src/wayland/keystate.cpp @@ -14,9 +14,7 @@ #include #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/keystate.h b/src/wayland/keystate.h index 156d18c826..5f0efdf316 100644 --- a/src/wayland/keystate.h +++ b/src/wayland/keystate.h @@ -11,7 +11,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class KeyStateInterfacePrivate; diff --git a/src/wayland/layershell_v1.cpp b/src/wayland/layershell_v1.cpp index 86091b30f0..34f934cc63 100644 --- a/src/wayland/layershell_v1.cpp +++ b/src/wayland/layershell_v1.cpp @@ -16,7 +16,7 @@ #include "qwayland-server-wlr-layer-shell-unstable-v1.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 3; @@ -498,6 +498,6 @@ void LayerSurfaceV1Interface::sendClosed() } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_layershell_v1.cpp" diff --git a/src/wayland/layershell_v1.h b/src/wayland/layershell_v1.h index f541fe7bab..d488b889ae 100644 --- a/src/wayland/layershell_v1.h +++ b/src/wayland/layershell_v1.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class LayerShellV1InterfacePrivate; class LayerSurfaceV1Interface; @@ -189,4 +189,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/linuxdmabufv1clientbuffer.cpp b/src/wayland/linuxdmabufv1clientbuffer.cpp index 4c1631ab25..e5f4e056e7 100644 --- a/src/wayland/linuxdmabufv1clientbuffer.cpp +++ b/src/wayland/linuxdmabufv1clientbuffer.cpp @@ -20,7 +20,7 @@ #include #include -namespace KWaylandServer +namespace KWin { static const int s_version = 4; @@ -125,7 +125,7 @@ void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_add(Resource *resource, close(fd); return; } - m_attrs.fd[plane_idx] = KWin::FileDescriptor{fd}; + m_attrs.fd[plane_idx] = FileDescriptor{fd}; m_attrs.offset[plane_idx] = offset; m_attrs.pitch[plane_idx] = stride; m_attrs.modifier = (quint64(modifier_hi) << 32) | modifier_lo; @@ -143,7 +143,7 @@ void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_create(Resource *resource, return; } - KWin::RenderBackend *renderBackend = m_integration->renderBackend(); + RenderBackend *renderBackend = m_integration->renderBackend(); if (Q_UNLIKELY(!renderBackend)) { send_failed(resource->handle); return; @@ -194,7 +194,7 @@ void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_create_immed(Resource *reso return; } - KWin::RenderBackend *renderBackend = m_integration->renderBackend(); + RenderBackend *renderBackend = m_integration->renderBackend(); if (Q_UNLIKELY(!renderBackend)) { wl_resource_post_error(resource->handle, error_invalid_wl_buffer, "importing the supplied dmabufs failed"); return; @@ -303,12 +303,12 @@ bool operator==(const LinuxDmaBufV1Feedback::Tranche &t1, const LinuxDmaBufV1Fee return t1.device == t2.device && t1.flags == t2.flags && t1.formatTable == t2.formatTable; } -KWin::RenderBackend *LinuxDmaBufV1ClientBufferIntegration::renderBackend() const +RenderBackend *LinuxDmaBufV1ClientBufferIntegration::renderBackend() const { return d->renderBackend; } -void LinuxDmaBufV1ClientBufferIntegration::setRenderBackend(KWin::RenderBackend *renderBackend) +void LinuxDmaBufV1ClientBufferIntegration::setRenderBackend(RenderBackend *renderBackend) { d->renderBackend = renderBackend; } @@ -344,7 +344,7 @@ const struct wl_buffer_interface LinuxDmaBufV1ClientBuffer::implementation = { .destroy = buffer_destroy, }; -LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(KWin::DmaBufAttributes &&attrs) +LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(DmaBufAttributes &&attrs) { m_attrs = std::move(attrs); m_hasAlphaChannel = alphaChannelFromDrmFormat(m_attrs.format); @@ -360,7 +360,7 @@ void LinuxDmaBufV1ClientBuffer::initialize(wl_resource *resource) }); } -const KWin::DmaBufAttributes *LinuxDmaBufV1ClientBuffer::dmabufAttributes() const +const DmaBufAttributes *LinuxDmaBufV1ClientBuffer::dmabufAttributes() const { return &m_attrs; } @@ -475,14 +475,14 @@ LinuxDmaBufV1FormatTable::LinuxDmaBufV1FormatTable(const QHash &tranches); @@ -79,4 +75,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/linuxdmabufv1clientbuffer_p.h b/src/wayland/linuxdmabufv1clientbuffer_p.h index 1316466fc7..f713ec46e9 100644 --- a/src/wayland/linuxdmabufv1clientbuffer_p.h +++ b/src/wayland/linuxdmabufv1clientbuffer_p.h @@ -23,7 +23,7 @@ #include -namespace KWaylandServer +namespace KWin { class LinuxDmaBufV1FormatTable; @@ -37,7 +37,7 @@ public: std::unique_ptr defaultFeedback; std::unique_ptr table; dev_t mainDevice; - QPointer renderBackend; + QPointer renderBackend; QHash> supportedModifiers; protected: @@ -71,20 +71,20 @@ private: bool test(Resource *resource, uint32_t width, uint32_t height); LinuxDmaBufV1ClientBufferIntegration *m_integration; - KWin::DmaBufAttributes m_attrs; + DmaBufAttributes m_attrs; bool m_isUsed = false; }; -class LinuxDmaBufV1ClientBuffer : public KWin::GraphicsBuffer +class LinuxDmaBufV1ClientBuffer : public GraphicsBuffer { Q_OBJECT public: - LinuxDmaBufV1ClientBuffer(KWin::DmaBufAttributes &&attrs); + LinuxDmaBufV1ClientBuffer(DmaBufAttributes &&attrs); QSize size() const override; bool hasAlphaChannel() const override; - const KWin::DmaBufAttributes *dmabufAttributes() const override; + const DmaBufAttributes *dmabufAttributes() const override; static LinuxDmaBufV1ClientBuffer *get(wl_resource *resource); @@ -96,7 +96,7 @@ private: static const struct wl_buffer_interface implementation; wl_resource *m_resource = nullptr; - KWin::DmaBufAttributes m_attrs; + DmaBufAttributes m_attrs; bool m_hasAlphaChannel = false; friend class LinuxDmaBufParamsV1; @@ -107,7 +107,7 @@ class LinuxDmaBufV1FormatTable public: LinuxDmaBufV1FormatTable(const QHash> &supportedModifiers); - KWin::RamFile file; + RamFile file; QMap, uint16_t> indices; }; diff --git a/src/wayland/lockscreen_overlay_v1.cpp b/src/wayland/lockscreen_overlay_v1.cpp index 50b08f5edb..2770508736 100644 --- a/src/wayland/lockscreen_overlay_v1.cpp +++ b/src/wayland/lockscreen_overlay_v1.cpp @@ -11,7 +11,7 @@ #include "qwayland-server-kde-lockscreen-overlay-v1.h" -namespace KWaylandServer +namespace KWin { static constexpr int s_version = 1; diff --git a/src/wayland/lockscreen_overlay_v1.h b/src/wayland/lockscreen_overlay_v1.h index 25c25c59dd..12a90556d7 100644 --- a/src/wayland/lockscreen_overlay_v1.h +++ b/src/wayland/lockscreen_overlay_v1.h @@ -16,7 +16,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; diff --git a/src/wayland/output.cpp b/src/wayland/output.cpp index 0cc28c73e5..8141d9981a 100644 --- a/src/wayland/output.cpp +++ b/src/wayland/output.cpp @@ -19,14 +19,14 @@ #include -namespace KWaylandServer +namespace KWin { static const int s_version = 4; class OutputInterfacePrivate : public QtWaylandServer::wl_output { public: - explicit OutputInterfacePrivate(Display *display, OutputInterface *q, KWin::Output *handle); + explicit OutputInterfacePrivate(Display *display, OutputInterface *q, Output *handle); void sendScale(Resource *resource); void sendGeometry(Resource *resource); @@ -35,14 +35,14 @@ public: OutputInterface *q; QPointer display; - QPointer handle; + QPointer handle; QSize physicalSize; QPoint globalPosition; QString manufacturer; QString model; int scale = 1; - KWin::Output::SubPixel subPixel = KWin::Output::SubPixel::Unknown; - KWin::OutputTransform transform = KWin::OutputTransform::Normal; + Output::SubPixel subPixel = Output::SubPixel::Unknown; + OutputTransform transform = OutputTransform::Normal; QSize modeSize; int refreshRate = 0; QString name; @@ -55,7 +55,7 @@ private: void output_release(Resource *resource) override; }; -OutputInterfacePrivate::OutputInterfacePrivate(Display *display, OutputInterface *q, KWin::Output *handle) +OutputInterfacePrivate::OutputInterfacePrivate(Display *display, OutputInterface *q, Output *handle) : QtWaylandServer::wl_output(*display, s_version) , q(q) , display(display) @@ -75,44 +75,44 @@ void OutputInterfacePrivate::sendScale(Resource *resource) } } -static quint32 kwaylandServerTransformToWaylandTransform(KWin::OutputTransform transform) +static quint32 kwaylandServerTransformToWaylandTransform(OutputTransform transform) { switch (transform.kind()) { - case KWin::OutputTransform::Normal: + case OutputTransform::Normal: return OutputInterfacePrivate::transform_normal; - case KWin::OutputTransform::Rotated90: + case OutputTransform::Rotated90: return OutputInterfacePrivate::transform_90; - case KWin::OutputTransform::Rotated180: + case OutputTransform::Rotated180: return OutputInterfacePrivate::transform_180; - case KWin::OutputTransform::Rotated270: + case OutputTransform::Rotated270: return OutputInterfacePrivate::transform_270; - case KWin::OutputTransform::Flipped: + case OutputTransform::Flipped: return OutputInterfacePrivate::transform_flipped; - case KWin::OutputTransform::Flipped90: + case OutputTransform::Flipped90: return OutputInterfacePrivate::transform_flipped_90; - case KWin::OutputTransform::Flipped180: + case OutputTransform::Flipped180: return OutputInterfacePrivate::transform_flipped_180; - case KWin::OutputTransform::Flipped270: + case OutputTransform::Flipped270: return OutputInterfacePrivate::transform_flipped_270; default: Q_UNREACHABLE(); } } -static quint32 kwaylandServerSubPixelToWaylandSubPixel(KWin::Output::SubPixel subPixel) +static quint32 kwaylandServerSubPixelToWaylandSubPixel(Output::SubPixel subPixel) { switch (subPixel) { - case KWin::Output::SubPixel::Unknown: + case Output::SubPixel::Unknown: return OutputInterfacePrivate::subpixel_unknown; - case KWin::Output::SubPixel::None: + case Output::SubPixel::None: return OutputInterfacePrivate::subpixel_none; - case KWin::Output::SubPixel::Horizontal_RGB: + case Output::SubPixel::Horizontal_RGB: return OutputInterfacePrivate::subpixel_horizontal_rgb; - case KWin::Output::SubPixel::Horizontal_BGR: + case Output::SubPixel::Horizontal_BGR: return OutputInterfacePrivate::subpixel_horizontal_bgr; - case KWin::Output::SubPixel::Vertical_RGB: + case Output::SubPixel::Vertical_RGB: return OutputInterfacePrivate::subpixel_vertical_rgb; - case KWin::Output::SubPixel::Vertical_BGR: + case Output::SubPixel::Vertical_BGR: return OutputInterfacePrivate::subpixel_vertical_bgr; default: Q_UNREACHABLE(); @@ -170,7 +170,7 @@ void OutputInterfacePrivate::output_bind_resource(Resource *resource) Q_EMIT q->bound(display->getConnection(resource->client()), resource->handle); } -OutputInterface::OutputInterface(Display *display, KWin::Output *handle, QObject *parent) +OutputInterface::OutputInterface(Display *display, Output *handle, QObject *parent) : QObject(parent) , d(new OutputInterfacePrivate(display, this, handle)) { @@ -199,7 +199,7 @@ OutputInterface::OutputInterface(Display *display, KWin::Output *handle, QObject d->refreshRate = handle->refreshRate(); d->subPixel = handle->subPixel(); - connect(handle, &KWin::Output::geometryChanged, this, [this]() { + connect(handle, &Output::geometryChanged, this, [this]() { const QPoint position = d->handle->geometry().topLeft(); if (d->globalPosition != position) { d->globalPosition = position; @@ -211,7 +211,7 @@ OutputInterface::OutputInterface(Display *display, KWin::Output *handle, QObject } }); - connect(handle, &KWin::Output::scaleChanged, this, [this]() { + connect(handle, &Output::scaleChanged, this, [this]() { const int scale = std::ceil(d->handle->scale()); if (d->scale != scale) { d->scale = scale; @@ -223,8 +223,8 @@ OutputInterface::OutputInterface(Display *display, KWin::Output *handle, QObject } }); - connect(handle, &KWin::Output::transformChanged, this, [this]() { - const KWin::OutputTransform transform = d->handle->transform(); + connect(handle, &Output::transformChanged, this, [this]() { + const OutputTransform transform = d->handle->transform(); if (d->transform != transform) { d->transform = transform; const auto resources = d->resourceMap(); @@ -235,7 +235,7 @@ OutputInterface::OutputInterface(Display *display, KWin::Output *handle, QObject } }); - connect(handle, &KWin::Output::currentModeChanged, this, [this]() { + connect(handle, &Output::currentModeChanged, this, [this]() { const QSize size = d->handle->modeSize(); const int refreshRate = d->handle->refreshRate(); if (d->modeSize != size || d->refreshRate != refreshRate) { @@ -260,7 +260,7 @@ Display *OutputInterface::display() const return d->display; } -KWin::Output *OutputInterface::handle() const +Output *OutputInterface::handle() const { return d->handle; } @@ -325,6 +325,6 @@ OutputInterface *OutputInterface::get(wl_resource *native) return nullptr; } -} // namespace KWaylandServer +} // namespace KWin #include "wayland/moc_output.cpp" diff --git a/src/wayland/output.h b/src/wayland/output.h index b477bdd420..ed7c6be6b6 100644 --- a/src/wayland/output.h +++ b/src/wayland/output.h @@ -21,7 +21,7 @@ namespace KWin class Output; } -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -36,13 +36,13 @@ class KWIN_EXPORT OutputInterface : public QObject Q_OBJECT public: - explicit OutputInterface(Display *display, KWin::Output *handle, QObject *parent = nullptr); + explicit OutputInterface(Display *display, Output *handle, QObject *parent = nullptr); ~OutputInterface() override; bool isRemoved() const; void remove(); - KWin::Output *handle() const; + Output *handle() const; /** * @returns all wl_resources bound for the @p client @@ -76,4 +76,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/output_order_v1.cpp b/src/wayland/output_order_v1.cpp index 2eef3d7eee..cbec8b7eae 100644 --- a/src/wayland/output_order_v1.cpp +++ b/src/wayland/output_order_v1.cpp @@ -9,7 +9,7 @@ #include "qwayland-server-kde-output-order-v1.h" -namespace KWaylandServer +namespace KWin { static constexpr uint32_t s_version = 1; @@ -20,7 +20,7 @@ public: OutputOrderV1InterfacePrivate(Display *display); void sendList(wl_resource *resource); - QVector outputOrder; + QVector outputOrder; protected: void kde_output_order_v1_bind_resource(Resource *resource) override; @@ -35,7 +35,7 @@ OutputOrderV1Interface::OutputOrderV1Interface(Display *display, QObject *parent OutputOrderV1Interface::~OutputOrderV1Interface() = default; -void OutputOrderV1Interface::setOutputOrder(const QVector &outputOrder) +void OutputOrderV1Interface::setOutputOrder(const QVector &outputOrder) { d->outputOrder = outputOrder; const auto resources = d->resourceMap(); @@ -56,7 +56,7 @@ void OutputOrderV1InterfacePrivate::kde_output_order_v1_bind_resource(Resource * void OutputOrderV1InterfacePrivate::sendList(wl_resource *resource) { - for (KWin::Output *const output : std::as_const(outputOrder)) { + for (Output *const output : std::as_const(outputOrder)) { kde_output_order_v1_send_output(resource, output->name().toUtf8().constData()); } kde_output_order_v1_send_done(resource); diff --git a/src/wayland/output_order_v1.h b/src/wayland/output_order_v1.h index ed649cbefb..5d7c9b73e2 100644 --- a/src/wayland/output_order_v1.h +++ b/src/wayland/output_order_v1.h @@ -10,12 +10,8 @@ namespace KWin { -class Output; -} - -namespace KWaylandServer -{ +class Output; class Display; class OutputOrderV1InterfacePrivate; @@ -26,7 +22,7 @@ public: explicit OutputOrderV1Interface(Display *display, QObject *parent); ~OutputOrderV1Interface() override; - void setOutputOrder(const QVector &outputOrder); + void setOutputOrder(const QVector &outputOrder); private: std::unique_ptr d; diff --git a/src/wayland/outputdevice_v2.cpp b/src/wayland/outputdevice_v2.cpp index cfdbb4c9ba..3c6b8fd7a4 100644 --- a/src/wayland/outputdevice_v2.cpp +++ b/src/wayland/outputdevice_v2.cpp @@ -19,9 +19,7 @@ #include "qwayland-server-kde-output-device-v2.h" -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 3; @@ -70,7 +68,7 @@ static QtWaylandServer::kde_output_device_v2::rgb_range kwinRgbRangeToOutputDevi class OutputDeviceV2InterfacePrivate : public QtWaylandServer::kde_output_device_v2 { public: - OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display, KWin::Output *handle); + OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display, Output *handle); ~OutputDeviceV2InterfacePrivate() override; void sendGeometry(Resource *resource); @@ -94,7 +92,7 @@ public: OutputDeviceV2Interface *q; QPointer m_display; - KWin::Output *m_handle; + Output *m_handle; QSize m_physicalSize; QPoint m_globalPosition; QString m_manufacturer = QStringLiteral("org.kde.kwin"); @@ -131,7 +129,7 @@ public: OutputDeviceV2InterfacePrivate::Resource *output; }; - OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, std::shared_ptr handle); + OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, std::shared_ptr handle); ~OutputDeviceModeV2InterfacePrivate() override; Resource *createResource(OutputDeviceV2InterfacePrivate::Resource *output); @@ -145,7 +143,7 @@ public: } OutputDeviceModeV2Interface *q; - std::weak_ptr m_handle; + std::weak_ptr m_handle; QSize m_size; int m_refreshRate = 60000; bool m_preferred = false; @@ -154,7 +152,7 @@ protected: Resource *kde_output_device_mode_v2_allocate() override; }; -OutputDeviceV2InterfacePrivate::OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display, KWin::Output *handle) +OutputDeviceV2InterfacePrivate::OutputDeviceV2InterfacePrivate(OutputDeviceV2Interface *q, Display *display, Output *handle) : QtWaylandServer::kde_output_device_v2(*display, s_version) , q(q) , m_display(display) @@ -172,7 +170,7 @@ OutputDeviceV2InterfacePrivate::~OutputDeviceV2InterfacePrivate() } } -OutputDeviceV2Interface::OutputDeviceV2Interface(Display *display, KWin::Output *handle, QObject *parent) +OutputDeviceV2Interface::OutputDeviceV2Interface(Display *display, Output *handle, QObject *parent) : QObject(parent) , d(new OutputDeviceV2InterfacePrivate(this, display, handle)) { @@ -242,7 +240,7 @@ void OutputDeviceV2Interface::remove() d->globalRemove(); } -KWin::Output *OutputDeviceV2Interface::handle() const +Output *OutputDeviceV2Interface::handle() const { return d->m_handle; } @@ -656,7 +654,7 @@ OutputDeviceV2Interface *OutputDeviceV2Interface::get(wl_resource *native) return nullptr; } -OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, std::shared_ptr handle) +OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDeviceModeV2Interface *q, std::shared_ptr handle) : QtWaylandServer::kde_output_device_mode_v2() , q(q) , m_handle(handle) @@ -666,7 +664,7 @@ OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDev { } -OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(std::shared_ptr handle, QObject *parent) +OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(std::shared_ptr handle, QObject *parent) : QObject(parent) , d(new OutputDeviceModeV2InterfacePrivate(this, handle)) { @@ -706,7 +704,7 @@ OutputDeviceModeV2InterfacePrivate::Resource *OutputDeviceModeV2InterfacePrivate return new ModeResource; } -std::weak_ptr OutputDeviceModeV2Interface::handle() const +std::weak_ptr OutputDeviceModeV2Interface::handle() const { return d->m_handle; } diff --git a/src/wayland/outputdevice_v2.h b/src/wayland/outputdevice_v2.h index 70ec8d9d2a..37884f9c0b 100644 --- a/src/wayland/outputdevice_v2.h +++ b/src/wayland/outputdevice_v2.h @@ -19,13 +19,9 @@ struct wl_resource; namespace KWin { + class Output; class OutputMode; -} - -namespace KWaylandServer -{ - class Display; class OutputDeviceV2InterfacePrivate; class OutputDeviceModeV2Interface; @@ -43,12 +39,12 @@ class KWIN_EXPORT OutputDeviceV2Interface : public QObject Q_OBJECT public: - explicit OutputDeviceV2Interface(Display *display, KWin::Output *handle, QObject *parent = nullptr); + explicit OutputDeviceV2Interface(Display *display, Output *handle, QObject *parent = nullptr); ~OutputDeviceV2Interface() override; void remove(); - KWin::Output *handle() const; + Output *handle() const; static OutputDeviceV2Interface *get(wl_resource *native); @@ -92,10 +88,10 @@ class KWIN_EXPORT OutputDeviceModeV2Interface : public QObject Q_OBJECT public: - OutputDeviceModeV2Interface(std::shared_ptr handle, QObject *parent = nullptr); + OutputDeviceModeV2Interface(std::shared_ptr handle, QObject *parent = nullptr); ~OutputDeviceModeV2Interface() override; - std::weak_ptr handle() const; + std::weak_ptr handle() const; static OutputDeviceModeV2Interface *get(wl_resource *native); diff --git a/src/wayland/outputmanagement_v2.cpp b/src/wayland/outputmanagement_v2.cpp index aae66b5156..4e617f3087 100644 --- a/src/wayland/outputmanagement_v2.cpp +++ b/src/wayland/outputmanagement_v2.cpp @@ -20,9 +20,7 @@ #include #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 4; diff --git a/src/wayland/outputmanagement_v2.h b/src/wayland/outputmanagement_v2.h index 8663913e57..81eda26c92 100644 --- a/src/wayland/outputmanagement_v2.h +++ b/src/wayland/outputmanagement_v2.h @@ -10,7 +10,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; diff --git a/src/wayland/plasmashell.cpp b/src/wayland/plasmashell.cpp index 17b4de7bd1..99d8b50210 100644 --- a/src/wayland/plasmashell.cpp +++ b/src/wayland/plasmashell.cpp @@ -13,7 +13,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 8; static QList s_shellSurfaces; diff --git a/src/wayland/plasmashell.h b/src/wayland/plasmashell.h index 85a0ea3996..33933c7104 100644 --- a/src/wayland/plasmashell.h +++ b/src/wayland/plasmashell.h @@ -14,7 +14,7 @@ class QSize; struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; @@ -45,7 +45,7 @@ Q_SIGNALS: /** * Emitted whenever a PlasmaShellSurfaceInterface got created. */ - void surfaceCreated(KWaylandServer::PlasmaShellSurfaceInterface *); + void surfaceCreated(KWin::PlasmaShellSurfaceInterface *); private: std::unique_ptr d; @@ -230,5 +230,5 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::PlasmaShellSurfaceInterface::Role) -Q_DECLARE_METATYPE(KWaylandServer::PlasmaShellSurfaceInterface::PanelBehavior) +Q_DECLARE_METATYPE(KWin::PlasmaShellSurfaceInterface::Role) +Q_DECLARE_METATYPE(KWin::PlasmaShellSurfaceInterface::PanelBehavior) diff --git a/src/wayland/plasmavirtualdesktop.cpp b/src/wayland/plasmavirtualdesktop.cpp index 42f0b70dc0..1967f34a8e 100644 --- a/src/wayland/plasmavirtualdesktop.cpp +++ b/src/wayland/plasmavirtualdesktop.cpp @@ -12,7 +12,7 @@ #include #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 2; diff --git a/src/wayland/plasmavirtualdesktop.h b/src/wayland/plasmavirtualdesktop.h index a1cc41e995..fad321f68c 100644 --- a/src/wayland/plasmavirtualdesktop.h +++ b/src/wayland/plasmavirtualdesktop.h @@ -10,7 +10,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class PlasmaVirtualDesktopInterface; diff --git a/src/wayland/plasmawindowmanagement.cpp b/src/wayland/plasmawindowmanagement.cpp index b17a6046bd..c43d041290 100644 --- a/src/wayland/plasmawindowmanagement.cpp +++ b/src/wayland/plasmawindowmanagement.cpp @@ -22,7 +22,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 16; static const quint32 s_activationVersion = 1; @@ -521,7 +521,7 @@ void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_leave_activity( void PlasmaWindowInterfacePrivate::org_kde_plasma_window_send_to_output(Resource *resource, struct wl_resource *output) { - Q_EMIT q->sendToOutput(KWaylandServer::OutputInterface::get(output)); + Q_EMIT q->sendToOutput(OutputInterface::get(output)); } void PlasmaWindowInterfacePrivate::setTitle(const QString &title) diff --git a/src/wayland/plasmawindowmanagement.h b/src/wayland/plasmawindowmanagement.h index 38f376c8bc..d2d19432ae 100644 --- a/src/wayland/plasmawindowmanagement.h +++ b/src/wayland/plasmawindowmanagement.h @@ -12,7 +12,7 @@ class QSize; -namespace KWaylandServer +namespace KWin { class Display; class OutputInterface; @@ -288,7 +288,7 @@ Q_SIGNALS: /** * Requests sending the window to @p output */ - void sendToOutput(KWaylandServer::OutputInterface *output); + void sendToOutput(KWin::OutputInterface *output); private: friend class PlasmaWindowManagementInterface; @@ -301,4 +301,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::PlasmaWindowManagementInterface::ShowingDesktopState) +Q_DECLARE_METATYPE(KWin::PlasmaWindowManagementInterface::ShowingDesktopState) diff --git a/src/wayland/pointer.cpp b/src/wayland/pointer.cpp index f5d2450bd9..9a3b8a4968 100644 --- a/src/wayland/pointer.cpp +++ b/src/wayland/pointer.cpp @@ -17,7 +17,7 @@ #include "utils.h" #include "utils/common.h" -namespace KWaylandServer +namespace KWin { class PointerSurfaceCursorPrivate { @@ -389,6 +389,6 @@ SurfaceInterface *PointerSurfaceCursor::surface() const return d->surface; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_pointer.cpp" diff --git a/src/wayland/pointer.h b/src/wayland/pointer.h index 646f92aa10..d7f1129791 100644 --- a/src/wayland/pointer.h +++ b/src/wayland/pointer.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class PointerSurfaceCursorPrivate; class PointerSurfaceCursor; @@ -105,4 +105,4 @@ private: friend class PointerInterfacePrivate; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/pointer_p.h b/src/wayland/pointer_p.h index ed8c342bb1..4430ff34c1 100644 --- a/src/wayland/pointer_p.h +++ b/src/wayland/pointer_p.h @@ -15,7 +15,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class ClientConnection; class PointerPinchGestureV1Interface; diff --git a/src/wayland/pointerconstraints_v1.cpp b/src/wayland/pointerconstraints_v1.cpp index 96cc1409a3..009f802075 100644 --- a/src/wayland/pointerconstraints_v1.cpp +++ b/src/wayland/pointerconstraints_v1.cpp @@ -12,7 +12,7 @@ #include "region_p.h" #include "surface_p.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 1; @@ -344,6 +344,6 @@ void ConfinedPointerV1Interface::setConfined(bool confined) Q_EMIT confinedChanged(); } -} // namespace KWaylandServer +} // namespace KWin #include "moc_pointerconstraints_v1.cpp" diff --git a/src/wayland/pointerconstraints_v1.h b/src/wayland/pointerconstraints_v1.h index 8614d030fe..6e6f82736f 100644 --- a/src/wayland/pointerconstraints_v1.h +++ b/src/wayland/pointerconstraints_v1.h @@ -15,7 +15,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class ConfinedPointerV1InterfacePrivate; class Display; @@ -242,4 +242,4 @@ private: friend class PointerConstraintsV1InterfacePrivate; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/pointerconstraints_v1_p.h b/src/wayland/pointerconstraints_v1_p.h index 5716538c58..66cc076e54 100644 --- a/src/wayland/pointerconstraints_v1_p.h +++ b/src/wayland/pointerconstraints_v1_p.h @@ -14,7 +14,7 @@ #include "qwayland-server-pointer-constraints-unstable-v1.h" -namespace KWaylandServer +namespace KWin { class PointerConstraintsV1InterfacePrivate : public QtWaylandServer::zwp_pointer_constraints_v1 { @@ -98,4 +98,4 @@ protected: void zwp_confined_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region_resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/pointergestures_v1.cpp b/src/wayland/pointergestures_v1.cpp index e721f31e3e..4db2225f57 100644 --- a/src/wayland/pointergestures_v1.cpp +++ b/src/wayland/pointergestures_v1.cpp @@ -13,7 +13,7 @@ #include "seat.h" #include "surface.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 3; @@ -323,6 +323,6 @@ void PointerHoldGestureV1Interface::sendCancel(quint32 serial) focusedClient = nullptr; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_pointergestures_v1.cpp" diff --git a/src/wayland/pointergestures_v1.h b/src/wayland/pointergestures_v1.h index eebc935314..69639e8203 100644 --- a/src/wayland/pointergestures_v1.h +++ b/src/wayland/pointergestures_v1.h @@ -12,7 +12,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class PointerGesturesV1InterfacePrivate; @@ -35,4 +35,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/pointergestures_v1_p.h b/src/wayland/pointergestures_v1_p.h index e3e52ae87f..d96b79dd4e 100644 --- a/src/wayland/pointergestures_v1_p.h +++ b/src/wayland/pointergestures_v1_p.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -89,4 +89,4 @@ private: QPointer focusedClient; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/primaryselectiondevice_v1.cpp b/src/wayland/primaryselectiondevice_v1.cpp index c325b2e976..2f0940c496 100644 --- a/src/wayland/primaryselectiondevice_v1.cpp +++ b/src/wayland/primaryselectiondevice_v1.cpp @@ -14,7 +14,7 @@ // Wayland #include -namespace KWaylandServer +namespace KWin { class PrimarySelectionDeviceV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_device_v1 { diff --git a/src/wayland/primaryselectiondevice_v1.h b/src/wayland/primaryselectiondevice_v1.h index d0fb61538f..5c18fde0a3 100644 --- a/src/wayland/primaryselectiondevice_v1.h +++ b/src/wayland/primaryselectiondevice_v1.h @@ -13,7 +13,7 @@ struct wl_resource; struct wl_client; -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class PrimarySelectionDeviceManagerV1Interface; @@ -45,7 +45,7 @@ public: wl_client *client() const; Q_SIGNALS: - void selectionChanged(KWaylandServer::PrimarySelectionSourceV1Interface *); + void selectionChanged(KWin::PrimarySelectionSourceV1Interface *); private: friend class PrimarySelectionDeviceManagerV1InterfacePrivate; @@ -56,4 +56,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionDeviceV1Interface *) +Q_DECLARE_METATYPE(KWin::PrimarySelectionDeviceV1Interface *) diff --git a/src/wayland/primaryselectiondevicemanager_v1.cpp b/src/wayland/primaryselectiondevicemanager_v1.cpp index 29f426288b..adb19a043d 100644 --- a/src/wayland/primaryselectiondevicemanager_v1.cpp +++ b/src/wayland/primaryselectiondevicemanager_v1.cpp @@ -13,7 +13,7 @@ #include static const int s_version = 1; -namespace KWaylandServer +namespace KWin { class PrimarySelectionDeviceManagerV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_device_manager_v1 { diff --git a/src/wayland/primaryselectiondevicemanager_v1.h b/src/wayland/primaryselectiondevicemanager_v1.h index 8d5e67e2de..5067ed0791 100644 --- a/src/wayland/primaryselectiondevicemanager_v1.h +++ b/src/wayland/primaryselectiondevicemanager_v1.h @@ -10,7 +10,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class PrimarySelectionSourceV1Interface; @@ -30,8 +30,8 @@ public: ~PrimarySelectionDeviceManagerV1Interface(); Q_SIGNALS: - void dataSourceCreated(KWaylandServer::PrimarySelectionSourceV1Interface *dataSource); - void dataDeviceCreated(KWaylandServer::PrimarySelectionDeviceV1Interface *dataDevice); + void dataSourceCreated(KWin::PrimarySelectionSourceV1Interface *dataSource); + void dataDeviceCreated(KWin::PrimarySelectionDeviceV1Interface *dataDevice); private: std::unique_ptr d; diff --git a/src/wayland/primaryselectionoffer_v1.cpp b/src/wayland/primaryselectionoffer_v1.cpp index 21757c0772..df60cf8157 100644 --- a/src/wayland/primaryselectionoffer_v1.cpp +++ b/src/wayland/primaryselectionoffer_v1.cpp @@ -14,7 +14,7 @@ // system #include -namespace KWaylandServer +namespace KWin { class PrimarySelectionOfferV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_offer_v1 { diff --git a/src/wayland/primaryselectionoffer_v1.h b/src/wayland/primaryselectionoffer_v1.h index 88eddf2e04..1b07549712 100644 --- a/src/wayland/primaryselectionoffer_v1.h +++ b/src/wayland/primaryselectionoffer_v1.h @@ -13,7 +13,7 @@ #include "primaryselectiondevicemanager_v1.h" struct wl_resource; -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class PrimarySelectionDeviceV1Interface; @@ -42,4 +42,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionOfferV1Interface *) +Q_DECLARE_METATYPE(KWin::PrimarySelectionOfferV1Interface *) diff --git a/src/wayland/primaryselectionsource_v1.cpp b/src/wayland/primaryselectionsource_v1.cpp index d6323ed5c5..4b1d0e85dc 100644 --- a/src/wayland/primaryselectionsource_v1.cpp +++ b/src/wayland/primaryselectionsource_v1.cpp @@ -14,7 +14,7 @@ // system #include -namespace KWaylandServer +namespace KWin { class PrimarySelectionSourceV1InterfacePrivate : public QtWaylandServer::zwp_primary_selection_source_v1 { diff --git a/src/wayland/primaryselectionsource_v1.h b/src/wayland/primaryselectionsource_v1.h index 0fce3e2d57..5285dd4306 100644 --- a/src/wayland/primaryselectionsource_v1.h +++ b/src/wayland/primaryselectionsource_v1.h @@ -10,7 +10,7 @@ #include "abstract_data_source.h" #include "primaryselectiondevicemanager_v1.h" -namespace KWaylandServer +namespace KWin { class PrimarySelectionSourceV1InterfacePrivate; @@ -41,4 +41,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionSourceV1Interface *) +Q_DECLARE_METATYPE(KWin::PrimarySelectionSourceV1Interface *) diff --git a/src/wayland/region.cpp b/src/wayland/region.cpp index 9eff5c42e5..c44d49062e 100644 --- a/src/wayland/region.cpp +++ b/src/wayland/region.cpp @@ -7,7 +7,7 @@ #include "region_p.h" #include "utils.h" -namespace KWaylandServer +namespace KWin { RegionInterface::RegionInterface(wl_resource *resource) : QtWaylandServer::wl_region(resource) @@ -44,4 +44,4 @@ RegionInterface *RegionInterface::get(wl_resource *native) return resource_cast(native); } -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/region_p.h b/src/wayland/region_p.h index f0b1df1026..9b7f9b88bf 100644 --- a/src/wayland/region_p.h +++ b/src/wayland/region_p.h @@ -10,7 +10,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class RegionInterface : public QtWaylandServer::wl_region { @@ -30,4 +30,4 @@ private: QRegion m_region; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/relativepointer_v1.cpp b/src/wayland/relativepointer_v1.cpp index 406868fd45..435084bf44 100644 --- a/src/wayland/relativepointer_v1.cpp +++ b/src/wayland/relativepointer_v1.cpp @@ -13,7 +13,7 @@ #include "seat.h" #include "surface.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 1; @@ -93,6 +93,6 @@ void RelativePointerV1Interface::sendRelativeMotion(const QPointF &delta, const } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_relativepointer_v1.cpp" diff --git a/src/wayland/relativepointer_v1.h b/src/wayland/relativepointer_v1.h index e4da68d2c5..f1e19c0d97 100644 --- a/src/wayland/relativepointer_v1.h +++ b/src/wayland/relativepointer_v1.h @@ -12,7 +12,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class RelativePointerManagerV1InterfacePrivate; @@ -36,4 +36,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/relativepointer_v1_p.h b/src/wayland/relativepointer_v1_p.h index 16a81ede93..4da2c5178d 100644 --- a/src/wayland/relativepointer_v1_p.h +++ b/src/wayland/relativepointer_v1_p.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -42,4 +42,4 @@ private: PointerInterface *pointer; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/screencast_v1.cpp b/src/wayland/screencast_v1.cpp index 7dfdef8a33..2b79eacea3 100644 --- a/src/wayland/screencast_v1.cpp +++ b/src/wayland/screencast_v1.cpp @@ -13,7 +13,7 @@ #include "qwayland-server-zkde-screencast-unstable-v1.h" -namespace KWaylandServer +namespace KWin { static int s_version = 3; @@ -141,6 +141,6 @@ ScreencastV1Interface::ScreencastV1Interface(Display *display, QObject *parent) ScreencastV1Interface::~ScreencastV1Interface() = default; -} // namespace KWaylandServer +} // namespace KWin #include "moc_screencast_v1.cpp" diff --git a/src/wayland/screencast_v1.h b/src/wayland/screencast_v1.h index 9aa1d08448..891b109183 100644 --- a/src/wayland/screencast_v1.h +++ b/src/wayland/screencast_v1.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class OutputInterface; diff --git a/src/wayland/screenedge_v1.cpp b/src/wayland/screenedge_v1.cpp index e4349d4a85..d54dade2ed 100644 --- a/src/wayland/screenedge_v1.cpp +++ b/src/wayland/screenedge_v1.cpp @@ -12,9 +12,7 @@ #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const int s_version = 1; @@ -147,6 +145,6 @@ ElectricBorder AutoHideScreenEdgeV1Interface::border() const return d->border; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_screenedge_v1.cpp" diff --git a/src/wayland/screenedge_v1.h b/src/wayland/screenedge_v1.h index 00de03378c..1f5bdc0689 100644 --- a/src/wayland/screenedge_v1.h +++ b/src/wayland/screenedge_v1.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; @@ -42,11 +42,11 @@ class KWIN_EXPORT AutoHideScreenEdgeV1Interface : public QObject Q_OBJECT public: - AutoHideScreenEdgeV1Interface(SurfaceInterface *surface, KWin::ElectricBorder border, wl_resource *resource); + AutoHideScreenEdgeV1Interface(SurfaceInterface *surface, ElectricBorder border, wl_resource *resource); ~AutoHideScreenEdgeV1Interface() override; SurfaceInterface *surface() const; - KWin::ElectricBorder border() const; + ElectricBorder border() const; Q_SIGNALS: void deactivateRequested(); @@ -56,4 +56,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/seat.cpp b/src/wayland/seat.cpp index bd2b704394..6836a37e47 100644 --- a/src/wayland/seat.cpp +++ b/src/wayland/seat.cpp @@ -37,7 +37,7 @@ #include -namespace KWaylandServer +namespace KWin { static const int s_version = 8; @@ -171,7 +171,7 @@ void SeatInterfacePrivate::registerDataDevice(DataDeviceInterface *dataDevice) } } -KWaylandServer::AbstractDropHandler *SeatInterface::dropHandlerForSurface(SurfaceInterface *surface) const +AbstractDropHandler *SeatInterface::dropHandlerForSurface(SurfaceInterface *surface) const { auto list = d->dataDevicesForSurface(surface); if (list.isEmpty()) { diff --git a/src/wayland/seat.h b/src/wayland/seat.h index 2cd6b7a708..c17d04b74d 100644 --- a/src/wayland/seat.h +++ b/src/wayland/seat.h @@ -15,7 +15,7 @@ struct wl_client; struct wl_resource; -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class AbstractDropHandler; @@ -182,11 +182,11 @@ public: * @returns The DataDeviceInterface which started the drag and drop operation. * @see isDrag */ - KWaylandServer::AbstractDataSource *dragSource() const; + AbstractDataSource *dragSource() const; /** * @returns the toplevel drag if the current drag is a toplevel drag */ - KWaylandServer::XdgToplevelDragV1Interface *xdgTopleveldrag() const; + XdgToplevelDragV1Interface *xdgTopleveldrag() const; /** * Sets the current drag target to @p surface. @@ -623,7 +623,7 @@ public: * @see setSelection * This may be null */ - KWaylandServer::AbstractDataSource *selection() const; + AbstractDataSource *selection() const; /** * This method allows to manually set the @p dataDevice for the current clipboard selection. @@ -639,7 +639,7 @@ public: */ void setSelection(AbstractDataSource *selection); - KWaylandServer::AbstractDataSource *primarySelection() const; + AbstractDataSource *primarySelection() const; void setPrimarySelection(AbstractDataSource *selection); void startDrag(AbstractDataSource *source, SurfaceInterface *sourceSurface, int dragSerial = -1, DragAndDropIcon *dragIcon = nullptr); @@ -666,13 +666,13 @@ Q_SIGNALS: * @see selection * @see setSelection */ - void selectionChanged(KWaylandServer::AbstractDataSource *); + void selectionChanged(KWin::AbstractDataSource *); /** * Emitted whenever the primary selection changes * @see primarySelection */ - void primarySelectionChanged(KWaylandServer::AbstractDataSource *); + void primarySelectionChanged(KWin::AbstractDataSource *); /** * Emitted when a drag'n'drop operation is started @@ -712,4 +712,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::SeatInterface *) +Q_DECLARE_METATYPE(KWin::SeatInterface *) diff --git a/src/wayland/seat_p.h b/src/wayland/seat_p.h index 12b51a0f4a..79dd4ee7b2 100644 --- a/src/wayland/seat_p.h +++ b/src/wayland/seat_p.h @@ -18,7 +18,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class AbstractDataSource; class DataDeviceInterface; @@ -154,4 +154,4 @@ private: void updatePrimarySelection(PrimarySelectionDeviceV1Interface *primarySelectionDevice); }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/server_decoration.cpp b/src/wayland/server_decoration.cpp index ef82632dca..ca89fc959c 100644 --- a/src/wayland/server_decoration.cpp +++ b/src/wayland/server_decoration.cpp @@ -14,7 +14,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/server_decoration.h b/src/wayland/server_decoration.h index 677597e04d..0cdf265e14 100644 --- a/src/wayland/server_decoration.h +++ b/src/wayland/server_decoration.h @@ -12,7 +12,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class ServerSideDecorationInterface; @@ -65,7 +65,7 @@ Q_SIGNALS: /** * Emitted whenever a new ServerSideDecorationInterface is created. */ - void decorationCreated(KWaylandServer::ServerSideDecorationInterface *); + void decorationCreated(KWin::ServerSideDecorationInterface *); private: std::unique_ptr d; @@ -128,5 +128,5 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::ServerSideDecorationInterface *) -Q_DECLARE_METATYPE(KWaylandServer::ServerSideDecorationManagerInterface::Mode) +Q_DECLARE_METATYPE(KWin::ServerSideDecorationInterface *) +Q_DECLARE_METATYPE(KWin::ServerSideDecorationManagerInterface::Mode) diff --git a/src/wayland/server_decoration_palette.cpp b/src/wayland/server_decoration_palette.cpp index 53a67cd9ad..710199bc78 100644 --- a/src/wayland/server_decoration_palette.cpp +++ b/src/wayland/server_decoration_palette.cpp @@ -12,7 +12,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/server_decoration_palette.h b/src/wayland/server_decoration_palette.h index 0402b34f22..4884cdcdda 100644 --- a/src/wayland/server_decoration_palette.h +++ b/src/wayland/server_decoration_palette.h @@ -12,7 +12,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; @@ -43,7 +43,7 @@ Q_SIGNALS: /** * Emitted whenever a new ServerSideDecorationPaletteInterface is created. */ - void paletteCreated(KWaylandServer::ServerSideDecorationPaletteInterface *); + void paletteCreated(KWin::ServerSideDecorationPaletteInterface *); private: std::unique_ptr d; diff --git a/src/wayland/shadow.cpp b/src/wayland/shadow.cpp index da5719679a..1a6e5eed46 100644 --- a/src/wayland/shadow.cpp +++ b/src/wayland/shadow.cpp @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 2; @@ -97,14 +97,14 @@ public: BottomLeftBuffer = 1 << 7, Offset = 1 << 8, }; - QPointer left; - QPointer topLeft; - QPointer top; - QPointer topRight; - QPointer right; - QPointer bottomRight; - QPointer bottom; - QPointer bottomLeft; + QPointer left; + QPointer topLeft; + QPointer top; + QPointer topRight; + QPointer right; + QPointer bottomRight; + QPointer bottom; + QPointer bottomLeft; QMarginsF offset; Flags flags = Flags::None; }; @@ -165,7 +165,7 @@ void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource) void ShadowInterfacePrivate::attach(ShadowInterfacePrivate::State::Flags flag, wl_resource *buffer) { - KWin::GraphicsBuffer *b = Display::bufferForResource(buffer); + GraphicsBuffer *b = Display::bufferForResource(buffer); switch (flag) { case State::LeftBuffer: pending.left = b; @@ -309,10 +309,10 @@ QMarginsF ShadowInterface::offset() const return d->current.offset; } -#define BUFFER(__PART__) \ - KWin::GraphicsBuffer *ShadowInterface::__PART__() const \ - { \ - return d->current.__PART__; \ +#define BUFFER(__PART__) \ + GraphicsBuffer *ShadowInterface::__PART__() const \ + { \ + return d->current.__PART__; \ } BUFFER(left) diff --git a/src/wayland/shadow.h b/src/wayland/shadow.h index 619986a9be..3a7d3cb1f9 100644 --- a/src/wayland/shadow.h +++ b/src/wayland/shadow.h @@ -15,11 +15,8 @@ struct wl_resource; namespace KWin { -class GraphicsBuffer; -} -namespace KWaylandServer -{ +class GraphicsBuffer; class Display; class ShadowManagerInterfacePrivate; class ShadowInterfacePrivate; @@ -42,14 +39,14 @@ class KWIN_EXPORT ShadowInterface : public QObject public: ~ShadowInterface() override; - KWin::GraphicsBuffer *left() const; - KWin::GraphicsBuffer *topLeft() const; - KWin::GraphicsBuffer *top() const; - KWin::GraphicsBuffer *topRight() const; - KWin::GraphicsBuffer *right() const; - KWin::GraphicsBuffer *bottomRight() const; - KWin::GraphicsBuffer *bottom() const; - KWin::GraphicsBuffer *bottomLeft() const; + GraphicsBuffer *left() const; + GraphicsBuffer *topLeft() const; + GraphicsBuffer *top() const; + GraphicsBuffer *topRight() const; + GraphicsBuffer *right() const; + GraphicsBuffer *bottomRight() const; + GraphicsBuffer *bottom() const; + GraphicsBuffer *bottomLeft() const; QMarginsF offset() const; diff --git a/src/wayland/shmclientbuffer.cpp b/src/wayland/shmclientbuffer.cpp index 2c27d90534..019dc6cbaa 100644 --- a/src/wayland/shmclientbuffer.cpp +++ b/src/wayland/shmclientbuffer.cpp @@ -17,9 +17,7 @@ #include #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static constexpr int s_version = 1; @@ -315,7 +313,7 @@ ShmClientBufferIntegration::~ShmClientBufferIntegration() { } -} // namespace KWaylandServer +} // namespace KWin #include "moc_shmclientbuffer_p.cpp" diff --git a/src/wayland/shmclientbuffer.h b/src/wayland/shmclientbuffer.h index 288fe7cc07..abaf52389c 100644 --- a/src/wayland/shmclientbuffer.h +++ b/src/wayland/shmclientbuffer.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class Display; @@ -32,4 +32,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/shmclientbuffer_p.h b/src/wayland/shmclientbuffer_p.h index 3493ff6c4d..8376e6f164 100644 --- a/src/wayland/shmclientbuffer_p.h +++ b/src/wayland/shmclientbuffer_p.h @@ -13,7 +13,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class ShmClientBufferIntegrationPrivate : public QtWaylandServer::wl_shm @@ -31,14 +31,14 @@ protected: class ShmPool : public QtWaylandServer::wl_shm_pool { public: - ShmPool(ShmClientBufferIntegration *integration, wl_client *client, int id, uint32_t version, KWin::FileDescriptor &&fd, KWin::MemoryMap &&mapping); + ShmPool(ShmClientBufferIntegration *integration, wl_client *client, int id, uint32_t version, FileDescriptor &&fd, MemoryMap &&mapping); void ref(); void unref(); ShmClientBufferIntegration *integration; - KWin::MemoryMap mapping; - KWin::FileDescriptor fd; + MemoryMap mapping; + FileDescriptor fd; int refCount = 1; bool sigbusImpossible = false; @@ -49,12 +49,12 @@ protected: void shm_pool_resize(Resource *resource, int32_t size) override; }; -class KWIN_EXPORT ShmClientBuffer : public KWin::GraphicsBuffer +class KWIN_EXPORT ShmClientBuffer : public GraphicsBuffer { Q_OBJECT public: - ShmClientBuffer(ShmPool *pool, KWin::ShmAttributes attributes, wl_client *client, uint32_t id); + ShmClientBuffer(ShmPool *pool, ShmAttributes attributes, wl_client *client, uint32_t id); ~ShmClientBuffer() override; Map map(MapFlags flags) override; @@ -62,7 +62,7 @@ public: QSize size() const override; bool hasAlphaChannel() const override; - const KWin::ShmAttributes *shmAttributes() const override; + const ShmAttributes *shmAttributes() const override; static ShmClientBuffer *get(wl_resource *resource); @@ -73,7 +73,7 @@ private: wl_resource *m_resource = nullptr; ShmPool *m_shmPool; - KWin::ShmAttributes m_shmAttributes; + ShmAttributes m_shmAttributes; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/slide.cpp b/src/wayland/slide.cpp index 6c9e14a11d..d21c106866 100644 --- a/src/wayland/slide.cpp +++ b/src/wayland/slide.cpp @@ -9,7 +9,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; diff --git a/src/wayland/slide.h b/src/wayland/slide.h index 574a03c707..26951965c4 100644 --- a/src/wayland/slide.h +++ b/src/wayland/slide.h @@ -12,7 +12,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SlideManagerInterfacePrivate; diff --git a/src/wayland/subcompositor.cpp b/src/wayland/subcompositor.cpp index 654d6561be..6939eb0278 100644 --- a/src/wayland/subcompositor.cpp +++ b/src/wayland/subcompositor.cpp @@ -10,7 +10,7 @@ #include "surface_p.h" #include "transaction.h" -namespace KWaylandServer +namespace KWin { static const int s_version = 1; @@ -290,6 +290,6 @@ void SubSurfaceInterface::parentApplyState(quint32 serial) } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_subcompositor.cpp" diff --git a/src/wayland/subcompositor.h b/src/wayland/subcompositor.h index 7db8aabc31..fe3545f132 100644 --- a/src/wayland/subcompositor.h +++ b/src/wayland/subcompositor.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SubCompositorInterfacePrivate; @@ -42,7 +42,7 @@ Q_SIGNALS: /** * This signal is emitted when a new sub-surface @subsurface has been created. */ - void subSurfaceCreated(KWaylandServer::SubSurfaceInterface *subsurface); + void subSurfaceCreated(KWin::SubSurfaceInterface *subsurface); private: std::unique_ptr d; @@ -115,7 +115,7 @@ Q_SIGNALS: /** * This signal is emitted when the commit mode of the sub-surface has changed. */ - void modeChanged(KWaylandServer::SubSurfaceInterface::Mode mode); + void modeChanged(KWin::SubSurfaceInterface::Mode mode); private: SubSurfaceInterface(SurfaceInterface *surface, SurfaceInterface *parent, wl_resource *resource); @@ -129,6 +129,6 @@ private: friend class SubCompositorInterfacePrivate; }; -} // namespace KWaylandServer +} // namespace KWin -Q_DECLARE_METATYPE(KWaylandServer::SubSurfaceInterface::Mode) +Q_DECLARE_METATYPE(KWin::SubSurfaceInterface::Mode) diff --git a/src/wayland/subsurface_p.h b/src/wayland/subsurface_p.h index 263c8f42ac..d1b251bab5 100644 --- a/src/wayland/subsurface_p.h +++ b/src/wayland/subsurface_p.h @@ -14,7 +14,7 @@ #include "qwayland-server-wayland.h" -namespace KWaylandServer +namespace KWin { class SubCompositorInterfacePrivate : public QtWaylandServer::wl_subcompositor { @@ -51,4 +51,4 @@ protected: void subsurface_set_desync(Resource *resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/surface.cpp b/src/wayland/surface.cpp index 3c78db411b..2e6027a0ca 100644 --- a/src/wayland/surface.cpp +++ b/src/wayland/surface.cpp @@ -28,7 +28,7 @@ #include #include -namespace KWaylandServer +namespace KWin { static QRegion map_helper(const QMatrix4x4 &matrix, const QRegion ®ion) @@ -364,7 +364,7 @@ void SurfaceInterfacePrivate::surface_set_buffer_transform(Resource *resource, i wl_resource_post_error(resource->handle, error_invalid_transform, "buffer transform must be a valid transform (%d specified)", transform); return; } - pending->bufferTransform = KWin::OutputTransform::Kind(transform); + pending->bufferTransform = OutputTransform::Kind(transform); pending->bufferTransformIsSet = true; } @@ -477,34 +477,34 @@ QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix() surfaceToBufferMatrix.scale(scaleOverride, scaleOverride); switch (current->bufferTransform.kind()) { - case KWin::OutputTransform::Normal: - case KWin::OutputTransform::Flipped: + case OutputTransform::Normal: + case OutputTransform::Flipped: break; - case KWin::OutputTransform::Rotated90: - case KWin::OutputTransform::Flipped90: + case OutputTransform::Rotated90: + case OutputTransform::Flipped90: surfaceToBufferMatrix.translate(0, bufferSize.height() / current->bufferScale); surfaceToBufferMatrix.rotate(-90, 0, 0, 1); break; - case KWin::OutputTransform::Rotated180: - case KWin::OutputTransform::Flipped180: + case OutputTransform::Rotated180: + case OutputTransform::Flipped180: surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, bufferSize.height() / current->bufferScale); surfaceToBufferMatrix.rotate(-180, 0, 0, 1); break; - case KWin::OutputTransform::Rotated270: - case KWin::OutputTransform::Flipped270: + case OutputTransform::Rotated270: + case OutputTransform::Flipped270: surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, 0); surfaceToBufferMatrix.rotate(-270, 0, 0, 1); break; } switch (current->bufferTransform.kind()) { - case KWin::OutputTransform::Flipped: - case KWin::OutputTransform::Flipped180: + case OutputTransform::Flipped: + case OutputTransform::Flipped180: surfaceToBufferMatrix.translate(bufferSize.width() / current->bufferScale, 0); surfaceToBufferMatrix.scale(-1, 1); break; - case KWin::OutputTransform::Flipped90: - case KWin::OutputTransform::Flipped270: + case OutputTransform::Flipped90: + case OutputTransform::Flipped270: surfaceToBufferMatrix.translate(bufferSize.height() / current->bufferScale, 0); surfaceToBufferMatrix.scale(-1, 1); break; @@ -829,12 +829,12 @@ QRectF SurfaceInterface::bufferSourceBox() const return d->bufferSourceBox; } -KWin::OutputTransform SurfaceInterface::bufferTransform() const +OutputTransform SurfaceInterface::bufferTransform() const { return d->current->bufferTransform; } -KWin::GraphicsBuffer *SurfaceInterface::buffer() const +GraphicsBuffer *SurfaceInterface::buffer() const { return d->bufferRef.buffer(); } @@ -1058,7 +1058,7 @@ LinuxDmaBufV1Feedback *SurfaceInterface::dmabufFeedbackV1() const return d->dmabufFeedbackV1.get(); } -KWin::ContentType SurfaceInterface::contentType() const +ContentType SurfaceInterface::contentType() const { return d->current->contentType; } @@ -1147,7 +1147,7 @@ void SurfaceInterface::setPreferredBufferScale(qreal scale) } } -void SurfaceInterface::setPreferredBufferTransform(KWin::OutputTransform transform) +void SurfaceInterface::setPreferredBufferTransform(OutputTransform transform) { if (transform == d->preferredBufferTransform) { return; @@ -1186,6 +1186,6 @@ void SurfaceInterface::setLastTransaction(Transaction *transaction) d->lastTransaction = transaction; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_surface.cpp" diff --git a/src/wayland/surface.h b/src/wayland/surface.h index 0b3fb93fed..0560088762 100644 --- a/src/wayland/surface.h +++ b/src/wayland/surface.h @@ -16,11 +16,8 @@ struct wl_resource; namespace KWin { -class GraphicsBuffer; -} -namespace KWaylandServer -{ +class GraphicsBuffer; class BlurInterface; class ClientConnection; class ConfinedPointerV1Interface; @@ -177,11 +174,11 @@ public: * If the surface is on an output that is rotated 90 degrees clockwise, the buffer will * be rotated 90 degrees counter clockwise. */ - KWin::OutputTransform bufferTransform() const; + OutputTransform bufferTransform() const; /** * @returns the current GraphicsBuffer, might be @c nullptr. */ - KWin::GraphicsBuffer *buffer() const; + GraphicsBuffer *buffer() const; QPoint offset() const; /** * Returns the current size of the surface, in surface coordinates. @@ -317,7 +314,7 @@ public: /** * @returns the current content type of this surface */ - KWin::ContentType contentType() const; + ContentType contentType() const; /** * @returns The SurfaceInterface for the @p native resource. @@ -360,7 +357,7 @@ public: * This indicates to the client the preferred buffer transform to use when * attaching buffers to this surface. */ - void setPreferredBufferTransform(KWin::OutputTransform transform); + void setPreferredBufferTransform(OutputTransform transform); /** * The first committed transaction that is scheduled to be applied to this surface. @@ -525,6 +522,6 @@ private: } }; -} // namespace KWaylandServer +} // namespace KWin -Q_DECLARE_METATYPE(KWaylandServer::SurfaceInterface *) +Q_DECLARE_METATYPE(KWin::SurfaceInterface *) diff --git a/src/wayland/surface_p.h b/src/wayland/surface_p.h index 568c11c6f3..b0b25b510a 100644 --- a/src/wayland/surface_p.h +++ b/src/wayland/surface_p.h @@ -19,7 +19,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class IdleInhibitorV1Interface; class ViewportInterface; @@ -54,15 +54,15 @@ struct SurfaceState bool contentTypeIsSet = false; bool tearingIsSet = false; qint32 bufferScale = 1; - KWin::OutputTransform bufferTransform = KWin::OutputTransform::Normal; + OutputTransform bufferTransform = OutputTransform::Normal; wl_list frameCallbacks; QPoint offset = QPoint(); - QPointer buffer; + QPointer buffer; QPointer shadow; QPointer blur; QPointer contrast; QPointer slide; - KWin::ContentType contentType = KWin::ContentType::None; + ContentType contentType = ContentType::None; PresentationHint presentationHint = PresentationHint::VSync; struct @@ -135,7 +135,7 @@ public: QRegion inputRegion; QRegion opaqueRegion; - KWin::GraphicsBufferRef bufferRef; + GraphicsBufferRef bufferRef; QRegion bufferDamage; bool mapped = false; qreal scaleOverride = 1.; @@ -146,7 +146,7 @@ public: QVector outputs; std::optional preferredBufferScale; - std::optional preferredBufferTransform; + std::optional preferredBufferTransform; LockedPointerV1Interface *lockedPointer = nullptr; ConfinedPointerV1Interface *confinedPointer = nullptr; @@ -186,4 +186,4 @@ private: QMetaObject::Connection constrainsUnboundConnection; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/tablet_v2.cpp b/src/wayland/tablet_v2.cpp index 8609d61ac6..9e983491bd 100644 --- a/src/wayland/tablet_v2.cpp +++ b/src/wayland/tablet_v2.cpp @@ -15,7 +15,7 @@ #include #include -namespace KWaylandServer +namespace KWin { static int s_version = 1; @@ -900,6 +900,6 @@ bool TabletSeatV2Interface::isClientSupported(ClientConnection *client) const TabletManagerV2Interface::~TabletManagerV2Interface() = default; -} // namespace KWaylandServer +} // namespace KWin #include "moc_tablet_v2.cpp" diff --git a/src/wayland/tablet_v2.h b/src/wayland/tablet_v2.h index c81386559d..9a5cc85630 100644 --- a/src/wayland/tablet_v2.h +++ b/src/wayland/tablet_v2.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -167,7 +167,7 @@ public: SurfaceInterface *currentSurface() const; Q_SIGNALS: - void feedback(KWaylandServer::ClientConnection *client, quint32 button, const QString &description, quint32 serial); + void feedback(KWin::ClientConnection *client, quint32 button, const QString &description, quint32 serial); private: friend class TabletSeatV2Interface; @@ -303,4 +303,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::TabletSeatV2Interface *) +Q_DECLARE_METATYPE(KWin::TabletSeatV2Interface *) diff --git a/src/wayland/tearingcontrol_v1.cpp b/src/wayland/tearingcontrol_v1.cpp index bee3aa6f9d..9dad0ce463 100644 --- a/src/wayland/tearingcontrol_v1.cpp +++ b/src/wayland/tearingcontrol_v1.cpp @@ -7,7 +7,7 @@ #include "display.h" #include "surface_p.h" -namespace KWaylandServer +namespace KWin { static constexpr uint32_t s_version = 1; diff --git a/src/wayland/tearingcontrol_v1.h b/src/wayland/tearingcontrol_v1.h index 8f1e4e20be..cd1fc7c038 100644 --- a/src/wayland/tearingcontrol_v1.h +++ b/src/wayland/tearingcontrol_v1.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class TearingControlManagerV1InterfacePrivate; diff --git a/src/wayland/tests/renderingservertest.cpp b/src/wayland/tests/renderingservertest.cpp index beeb203149..986b2aeeb3 100644 --- a/src/wayland/tests/renderingservertest.cpp +++ b/src/wayland/tests/renderingservertest.cpp @@ -81,9 +81,9 @@ public: explicit CompositorWindow(QWidget *parent = nullptr); virtual ~CompositorWindow(); - void surfaceCreated(KWaylandServer::XdgToplevelInterface *surface); + void surfaceCreated(KWin::XdgToplevelInterface *surface); - void setSeat(const QPointer &seat); + void setSeat(const QPointer &seat); protected: void paintEvent(QPaintEvent *event) override; @@ -96,8 +96,8 @@ protected: private: void updateFocus(); - QList m_stackingOrder; - QPointer m_seat; + QList m_stackingOrder; + QPointer m_seat; }; CompositorWindow::CompositorWindow(QWidget *parent) @@ -108,9 +108,9 @@ CompositorWindow::CompositorWindow(QWidget *parent) CompositorWindow::~CompositorWindow() = default; -void CompositorWindow::surfaceCreated(KWaylandServer::XdgToplevelInterface *surface) +void CompositorWindow::surfaceCreated(KWin::XdgToplevelInterface *surface) { - using namespace KWaylandServer; + using namespace KWin; surface->sendConfigure(QSize(), XdgToplevelInterface::States()); m_stackingOrder << surface; connect(surface->surface(), &SurfaceInterface::damaged, this, static_cast(&CompositorWindow::update)); @@ -124,7 +124,7 @@ void CompositorWindow::surfaceCreated(KWaylandServer::XdgToplevelInterface *surf void CompositorWindow::updateFocus() { - using namespace KWaylandServer; + using namespace KWin; if (!m_seat || m_stackingOrder.isEmpty()) { return; } @@ -138,7 +138,7 @@ void CompositorWindow::updateFocus() m_seat->setFocusedKeyboardSurface((*it)->surface()); } -void CompositorWindow::setSeat(const QPointer &seat) +void CompositorWindow::setSeat(const QPointer &seat) { m_seat = seat; } @@ -148,7 +148,7 @@ void CompositorWindow::paintEvent(QPaintEvent *event) QWidget::paintEvent(event); QPainter p(this); for (auto window : m_stackingOrder) { - KWaylandServer::SurfaceInterface *surface = window->surface(); + KWin::SurfaceInterface *surface = window->surface(); if (!surface || !surface->isMapped()) { continue; } @@ -170,7 +170,7 @@ void CompositorWindow::keyPressEvent(QKeyEvent *event) updateFocus(); } m_seat->setTimestamp(std::chrono::milliseconds(event->timestamp())); - m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWaylandServer::KeyboardKeyState::Pressed); + m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWin::KeyboardKeyState::Pressed); } void CompositorWindow::keyReleaseEvent(QKeyEvent *event) @@ -180,7 +180,7 @@ void CompositorWindow::keyReleaseEvent(QKeyEvent *event) return; } m_seat->setTimestamp(std::chrono::milliseconds(event->timestamp())); - m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWaylandServer::KeyboardKeyState::Released); + m_seat->notifyKeyboardKey(event->nativeScanCode() - 8, KWin::KeyboardKeyState::Released); } void CompositorWindow::mouseMoveEvent(QMouseEvent *event) @@ -203,7 +203,7 @@ void CompositorWindow::mousePressEvent(QMouseEvent *event) } } m_seat->setTimestamp(std::chrono::milliseconds(event->timestamp())); - m_seat->notifyPointerButton(event->button(), KWaylandServer::PointerButtonState::Pressed); + m_seat->notifyPointerButton(event->button(), KWin::PointerButtonState::Pressed); m_seat->notifyPointerFrame(); } @@ -211,7 +211,7 @@ void CompositorWindow::mouseReleaseEvent(QMouseEvent *event) { QWidget::mouseReleaseEvent(event); m_seat->setTimestamp(std::chrono::milliseconds(event->timestamp())); - m_seat->notifyPointerButton(event->button(), KWaylandServer::PointerButtonState::Released); + m_seat->notifyPointerButton(event->button(), KWin::PointerButtonState::Released); m_seat->notifyPointerFrame(); } @@ -221,17 +221,17 @@ void CompositorWindow::wheelEvent(QWheelEvent *event) m_seat->setTimestamp(std::chrono::milliseconds(event->timestamp())); const QPoint &angle = event->angleDelta() / (8 * 15); if (angle.x() != 0) { - m_seat->notifyPointerAxis(Qt::Horizontal, angle.x(), 1, KWaylandServer::PointerAxisSource::Wheel); + m_seat->notifyPointerAxis(Qt::Horizontal, angle.x(), 1, KWin::PointerAxisSource::Wheel); } if (angle.y() != 0) { - m_seat->notifyPointerAxis(Qt::Vertical, angle.y(), 1, KWaylandServer::PointerAxisSource::Wheel); + m_seat->notifyPointerAxis(Qt::Vertical, angle.y(), 1, KWin::PointerAxisSource::Wheel); } m_seat->notifyPointerFrame(); } int main(int argc, char **argv) { - using namespace KWaylandServer; + using namespace KWin; QApplication app(argc, argv); QCommandLineParser parser; @@ -240,7 +240,7 @@ int main(int argc, char **argv) parser.addOption(xwaylandOption); parser.process(app); - KWaylandServer::Display display; + KWin::Display display; display.start(); new DataDeviceManagerInterface(&display); new CompositorInterface(&display, &display); diff --git a/src/wayland/tests/waylandservertest.cpp b/src/wayland/tests/waylandservertest.cpp index 7886c3962a..6d97e338a7 100644 --- a/src/wayland/tests/waylandservertest.cpp +++ b/src/wayland/tests/waylandservertest.cpp @@ -65,14 +65,14 @@ static void readDisplayFromPipe(int pipe) int main(int argc, char **argv) { - using namespace KWaylandServer; + using namespace KWin; // set our own event dispatcher to be able to dispatch events before the event loop is started QAbstractEventDispatcher *eventDispatcher = new QEventDispatcherGlib(); QCoreApplication::setEventDispatcher(eventDispatcher); // first create the Server and setup with minimum to get an XWayland connected - KWaylandServer::Display display; + KWin::Display display; display.start(); display.createShm(); new CompositorInterface(&display, &display); diff --git a/src/wayland/textinput.h b/src/wayland/textinput.h index 6f4695f31b..217683e8eb 100644 --- a/src/wayland/textinput.h +++ b/src/wayland/textinput.h @@ -13,7 +13,7 @@ #include -namespace KWaylandServer +namespace KWin { Q_NAMESPACE_EXPORT(KWIN_EXPORT) /** @@ -150,8 +150,8 @@ 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) +Q_DECLARE_METATYPE(KWin::TextInputContentHint) +Q_DECLARE_METATYPE(KWin::TextInputContentHints) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::TextInputContentHints) +Q_DECLARE_METATYPE(KWin::TextInputContentPurpose) +Q_DECLARE_METATYPE(KWin::TextInputChangeCause) diff --git a/src/wayland/textinput_v1.cpp b/src/wayland/textinput_v1.cpp index 4542b19791..7c9b7ba568 100644 --- a/src/wayland/textinput_v1.cpp +++ b/src/wayland/textinput_v1.cpp @@ -13,7 +13,7 @@ #include "wayland/surface.h" #include -namespace KWaylandServer +namespace KWin { namespace @@ -425,7 +425,7 @@ TextInputContentHints TextInputV1Interface::contentHints() const return d->contentHints; } -TextInputContentPurpose KWaylandServer::TextInputV1Interface::contentPurpose() const +TextInputContentPurpose TextInputV1Interface::contentPurpose() const { return d->contentPurpose; } diff --git a/src/wayland/textinput_v1.h b/src/wayland/textinput_v1.h index dddc94f315..1dda8f7d84 100644 --- a/src/wayland/textinput_v1.h +++ b/src/wayland/textinput_v1.h @@ -11,7 +11,7 @@ #include "textinput.h" struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -290,4 +290,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::TextInputV1Interface *) +Q_DECLARE_METATYPE(KWin::TextInputV1Interface *) diff --git a/src/wayland/textinput_v1_p.h b/src/wayland/textinput_v1_p.h index 153e065b2a..a27cb1034a 100644 --- a/src/wayland/textinput_v1_p.h +++ b/src/wayland/textinput_v1_p.h @@ -18,7 +18,7 @@ #include -namespace KWaylandServer +namespace KWin { class TextInputManagerV1InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v1 { diff --git a/src/wayland/textinput_v2.cpp b/src/wayland/textinput_v2.cpp index 2517f42dea..e3f151426f 100644 --- a/src/wayland/textinput_v2.cpp +++ b/src/wayland/textinput_v2.cpp @@ -8,7 +8,7 @@ #include "surface_p.h" #include "textinput_v2_p.h" -namespace KWaylandServer +namespace KWin { namespace @@ -433,7 +433,7 @@ TextInputContentHints TextInputV2Interface::contentHints() const return d->contentHints; } -TextInputContentPurpose KWaylandServer::TextInputV2Interface::contentPurpose() const +TextInputContentPurpose TextInputV2Interface::contentPurpose() const { return d->contentPurpose; } diff --git a/src/wayland/textinput_v2.h b/src/wayland/textinput_v2.h index 32f3259733..095bd3b405 100644 --- a/src/wayland/textinput_v2.h +++ b/src/wayland/textinput_v2.h @@ -11,7 +11,7 @@ #include "textinput.h" struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -289,5 +289,5 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::TextInputV2Interface *) -Q_DECLARE_METATYPE(KWaylandServer::TextInputV2Interface::UpdateReason) +Q_DECLARE_METATYPE(KWin::TextInputV2Interface *) +Q_DECLARE_METATYPE(KWin::TextInputV2Interface::UpdateReason) diff --git a/src/wayland/textinput_v2_p.h b/src/wayland/textinput_v2_p.h index bc76770abc..8b70a31e05 100644 --- a/src/wayland/textinput_v2_p.h +++ b/src/wayland/textinput_v2_p.h @@ -15,7 +15,7 @@ #include -namespace KWaylandServer +namespace KWin { class TextInputManagerV2InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v2 { diff --git a/src/wayland/textinput_v3.cpp b/src/wayland/textinput_v3.cpp index 7128c64d9f..2688c079d3 100644 --- a/src/wayland/textinput_v3.cpp +++ b/src/wayland/textinput_v3.cpp @@ -10,7 +10,7 @@ #include "surface_p.h" #include "textinput_v3_p.h" -namespace KWaylandServer +namespace KWin { namespace { diff --git a/src/wayland/textinput_v3.h b/src/wayland/textinput_v3.h index eabab14c3b..658644396a 100644 --- a/src/wayland/textinput_v3.h +++ b/src/wayland/textinput_v3.h @@ -11,7 +11,7 @@ #include "textinput.h" struct wl_resource; -namespace KWaylandServer +namespace KWin { class ClientConnection; class Display; @@ -207,4 +207,4 @@ private: } -Q_DECLARE_METATYPE(KWaylandServer::TextInputV3Interface *) +Q_DECLARE_METATYPE(KWin::TextInputV3Interface *) diff --git a/src/wayland/textinput_v3_p.h b/src/wayland/textinput_v3_p.h index 88a182e98f..6eba27b384 100644 --- a/src/wayland/textinput_v3_p.h +++ b/src/wayland/textinput_v3_p.h @@ -15,7 +15,7 @@ #include -namespace KWaylandServer +namespace KWin { class TextInputManagerV3InterfacePrivate : public QtWaylandServer::zwp_text_input_manager_v3 { diff --git a/src/wayland/touch.cpp b/src/wayland/touch.cpp index 6a1a92862c..c8844417a0 100644 --- a/src/wayland/touch.cpp +++ b/src/wayland/touch.cpp @@ -12,7 +12,7 @@ #include "surface.h" #include "touch_p.h" -namespace KWaylandServer +namespace KWin { TouchInterfacePrivate *TouchInterfacePrivate::get(TouchInterface *touch) { @@ -126,6 +126,6 @@ void TouchInterface::sendDown(qint32 id, quint32 serial, const QPointF &localPos } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_touch.cpp" diff --git a/src/wayland/touch.h b/src/wayland/touch.h index 0aec515f20..32e613dcb1 100644 --- a/src/wayland/touch.h +++ b/src/wayland/touch.h @@ -12,7 +12,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class SeatInterface; class SurfaceInterface; @@ -45,4 +45,4 @@ private: friend class TouchInterfacePrivate; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/touch_p.h b/src/wayland/touch_p.h index 6f2e53b0c0..81560b2976 100644 --- a/src/wayland/touch_p.h +++ b/src/wayland/touch_p.h @@ -12,7 +12,7 @@ #include -namespace KWaylandServer +namespace KWin { class ClientConnection; @@ -33,4 +33,4 @@ protected: void touch_release(Resource *resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/transaction.cpp b/src/wayland/transaction.cpp index aeaaf7d16e..b6364220c3 100644 --- a/src/wayland/transaction.cpp +++ b/src/wayland/transaction.cpp @@ -10,9 +10,7 @@ #include "wayland/surface_p.h" #include "wayland/transaction_p.h" -using namespace KWin; - -namespace KWaylandServer +namespace KWin { TransactionDmaBufLocker *TransactionDmaBufLocker::get(GraphicsBuffer *buffer) @@ -270,6 +268,6 @@ void Transaction::commit() } } -} // namespace KWaylandServer +} // namespace KWin #include "moc_transaction.cpp" diff --git a/src/wayland/transaction.h b/src/wayland/transaction.h index 06e58fc440..00d76f630a 100644 --- a/src/wayland/transaction.h +++ b/src/wayland/transaction.h @@ -14,7 +14,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class SurfaceInterface; @@ -41,7 +41,7 @@ struct TransactionEntry /** * Graphics buffer reference to prevent it from being destroyed. */ - KWin::GraphicsBufferRef buffer; + GraphicsBufferRef buffer; /** * The surface state that is going to be applied. @@ -113,4 +113,4 @@ private: int m_locks = 0; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/transaction_p.h b/src/wayland/transaction_p.h index 804737eebd..5bcf148aaa 100644 --- a/src/wayland/transaction_p.h +++ b/src/wayland/transaction_p.h @@ -11,7 +11,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class TransactionDmaBufLocker : public QObject @@ -19,12 +19,12 @@ class TransactionDmaBufLocker : public QObject Q_OBJECT public: - static TransactionDmaBufLocker *get(KWin::GraphicsBuffer *buffer); + static TransactionDmaBufLocker *get(GraphicsBuffer *buffer); void add(Transaction *transaction); private: - explicit TransactionDmaBufLocker(const KWin::DmaBufAttributes *attributes); + explicit TransactionDmaBufLocker(const DmaBufAttributes *attributes); bool arm(); @@ -33,4 +33,4 @@ private: std::vector> m_notifiers; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/utils.h b/src/wayland/utils.h index 30cbd923ff..a5b8b0687d 100644 --- a/src/wayland/utils.h +++ b/src/wayland/utils.h @@ -8,26 +8,13 @@ #include "kwin_export.h" -#include - #include #include struct wl_resource; -namespace KWaylandServer -{ - -/** - * Returns an infinite region. - */ -inline QRegion KWIN_EXPORT infiniteRegion() +namespace KWin { - 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) @@ -39,4 +26,4 @@ T resource_cast(::wl_resource *resource) return T(); } -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/viewporter.cpp b/src/wayland/viewporter.cpp index a6cdae28db..9375d09fe2 100644 --- a/src/wayland/viewporter.cpp +++ b/src/wayland/viewporter.cpp @@ -11,7 +11,7 @@ static const int s_version = 1; -namespace KWaylandServer +namespace KWin { class ViewporterInterfacePrivate : public QtWaylandServer::wp_viewporter { @@ -143,6 +143,6 @@ ViewporterInterface::~ViewporterInterface() { } -} // namespace KWaylandServer +} // namespace KWin #include "moc_viewporter.cpp" diff --git a/src/wayland/viewporter.h b/src/wayland/viewporter.h index fe5659b945..35c57862ef 100644 --- a/src/wayland/viewporter.h +++ b/src/wayland/viewporter.h @@ -11,7 +11,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class ViewporterInterfacePrivate; @@ -36,4 +36,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/viewporter_p.h b/src/wayland/viewporter_p.h index 5d9c41657e..9e35b62442 100644 --- a/src/wayland/viewporter_p.h +++ b/src/wayland/viewporter_p.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class SurfaceInterface; @@ -31,4 +31,4 @@ protected: void wp_viewport_set_destination(Resource *resource, int32_t width, int32_t height) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/xdgactivation_v1.cpp b/src/wayland/xdgactivation_v1.cpp index ee19bc552e..ccd59b98a6 100644 --- a/src/wayland/xdgactivation_v1.cpp +++ b/src/wayland/xdgactivation_v1.cpp @@ -13,7 +13,7 @@ #include -namespace KWaylandServer +namespace KWin { static const int s_version = 1; diff --git a/src/wayland/xdgactivation_v1.h b/src/wayland/xdgactivation_v1.h index 780c185532..84e25ae985 100644 --- a/src/wayland/xdgactivation_v1.h +++ b/src/wayland/xdgactivation_v1.h @@ -16,7 +16,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; diff --git a/src/wayland/xdgdecoration_v1.cpp b/src/wayland/xdgdecoration_v1.cpp index 7463bf1e07..5d2afbfbe5 100644 --- a/src/wayland/xdgdecoration_v1.cpp +++ b/src/wayland/xdgdecoration_v1.cpp @@ -9,7 +9,7 @@ #include "xdgdecoration_v1_p.h" #include "xdgshell_p.h" -namespace KWaylandServer +namespace KWin { // TODO: We need to wait for an ack_configure either here or in xdgshellclient.cpp. @@ -139,6 +139,6 @@ XdgToplevelDecorationV1Interface *XdgToplevelDecorationV1Interface::get(XdgTople return toplevelPrivate->decoration; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_xdgdecoration_v1.cpp" diff --git a/src/wayland/xdgdecoration_v1.h b/src/wayland/xdgdecoration_v1.h index 07732590cf..c2c582dcf9 100644 --- a/src/wayland/xdgdecoration_v1.h +++ b/src/wayland/xdgdecoration_v1.h @@ -13,7 +13,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class XdgDecorationManagerV1InterfacePrivate; @@ -106,10 +106,10 @@ 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); + void preferredModeChanged(KWin::XdgToplevelDecorationV1Interface::Mode mode); private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/xdgdecoration_v1_p.h b/src/wayland/xdgdecoration_v1_p.h index cb2a32d017..1cb7c04215 100644 --- a/src/wayland/xdgdecoration_v1_p.h +++ b/src/wayland/xdgdecoration_v1_p.h @@ -10,7 +10,7 @@ #include "qwayland-server-xdg-decoration-unstable-v1.h" -namespace KWaylandServer +namespace KWin { class XdgDecorationManagerV1InterfacePrivate : public QtWaylandServer::zxdg_decoration_manager_v1 { @@ -40,4 +40,4 @@ protected: void zxdg_toplevel_decoration_v1_unset_mode(Resource *resource) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/xdgforeign_v2.cpp b/src/wayland/xdgforeign_v2.cpp index 8166ec6508..cf24d3f7db 100644 --- a/src/wayland/xdgforeign_v2.cpp +++ b/src/wayland/xdgforeign_v2.cpp @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_exporterVersion = 1; static const quint32 s_importerVersion = 1; diff --git a/src/wayland/xdgforeign_v2.h b/src/wayland/xdgforeign_v2.h index 9fb8192a0f..8c394a778d 100644 --- a/src/wayland/xdgforeign_v2.h +++ b/src/wayland/xdgforeign_v2.h @@ -10,7 +10,7 @@ #include -namespace KWaylandServer +namespace KWin { class Display; class SurfaceInterface; @@ -49,7 +49,7 @@ Q_SIGNALS: * 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); + void transientChanged(KWin::SurfaceInterface *child, KWin::SurfaceInterface *parent); private: friend class XdgExporterV2Interface; diff --git a/src/wayland/xdgforeign_v2_p.h b/src/wayland/xdgforeign_v2_p.h index 7054e40bb5..13b7f20d78 100644 --- a/src/wayland/xdgforeign_v2_p.h +++ b/src/wayland/xdgforeign_v2_p.h @@ -11,7 +11,7 @@ #include -namespace KWaylandServer +namespace KWin { class XdgExportedV2Interface; class XdgImportedV2Interface; @@ -107,7 +107,7 @@ public: SurfaceInterface *surface() const; Q_SIGNALS: - void childChanged(KWaylandServer::SurfaceInterface *child); + void childChanged(KWin::SurfaceInterface *child); private Q_SLOTS: void handleExportedDestroyed(); diff --git a/src/wayland/xdgoutput_v1.cpp b/src/wayland/xdgoutput_v1.cpp index 993c6e4d40..c0c5f89455 100644 --- a/src/wayland/xdgoutput_v1.cpp +++ b/src/wayland/xdgoutput_v1.cpp @@ -17,9 +17,7 @@ #include #include -using namespace KWin; - -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 3; diff --git a/src/wayland/xdgoutput_v1.h b/src/wayland/xdgoutput_v1.h index 8293ca428f..bb4d276147 100644 --- a/src/wayland/xdgoutput_v1.h +++ b/src/wayland/xdgoutput_v1.h @@ -11,7 +11,7 @@ #include #include -namespace KWaylandServer +namespace KWin { class Display; class OutputInterface; diff --git a/src/wayland/xdgshell.cpp b/src/wayland/xdgshell.cpp index d77b6fbd65..cb4cc6c3e5 100644 --- a/src/wayland/xdgshell.cpp +++ b/src/wayland/xdgshell.cpp @@ -15,7 +15,7 @@ #include -namespace KWaylandServer +namespace KWin { static const int s_version = 6; @@ -1051,7 +1051,7 @@ QRectF XdgPositioner::placement(const QRectF &bounds) const return true; }; - QRectF popupRect(KWin::popupOffset(d->anchorRect, d->anchorEdges, d->gravityEdges, d->size) + d->offset, d->size); + QRectF popupRect(popupOffset(d->anchorRect, d->anchorEdges, d->gravityEdges, d->size) + d->offset, d->size); // if that fits, we don't need to do anything if (inBounds(popupRect)) { @@ -1070,7 +1070,7 @@ QRectF XdgPositioner::placement(const QRectF &bounds) const if (flippedGravity & (Qt::LeftEdge | Qt::RightEdge)) { flippedGravity ^= (Qt::LeftEdge | Qt::RightEdge); } - auto flippedPopupRect = QRectF(KWin::popupOffset(d->anchorRect, flippedAnchorEdge, flippedGravity, d->size) + d->offset, d->size); + auto flippedPopupRect = QRectF(popupOffset(d->anchorRect, flippedAnchorEdge, flippedGravity, d->size) + d->offset, d->size); // if it still doesn't fit we should continue with the unflipped version if (inBounds(flippedPopupRect, Qt::LeftEdge | Qt::RightEdge)) { @@ -1112,7 +1112,7 @@ QRectF XdgPositioner::placement(const QRectF &bounds) const if (flippedGravity & (Qt::TopEdge | Qt::BottomEdge)) { flippedGravity ^= (Qt::TopEdge | Qt::BottomEdge); } - auto flippedPopupRect = QRectF(KWin::popupOffset(d->anchorRect, flippedAnchorEdge, flippedGravity, d->size) + d->offset, d->size); + auto flippedPopupRect = QRectF(popupOffset(d->anchorRect, flippedAnchorEdge, flippedGravity, d->size) + d->offset, d->size); // if it still doesn't fit we should continue with the unflipped version if (inBounds(flippedPopupRect, Qt::TopEdge | Qt::BottomEdge)) { @@ -1159,6 +1159,6 @@ XdgPositioner::XdgPositioner(const QSharedDataPointer &data) { } -} // namespace KWaylandServer +} // namespace KWin #include "moc_xdgshell.cpp" diff --git a/src/wayland/xdgshell.h b/src/wayland/xdgshell.h index 75726bc2ef..c4822f8f5c 100644 --- a/src/wayland/xdgshell.h +++ b/src/wayland/xdgshell.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; class OutputInterface; @@ -350,7 +350,7 @@ Q_SIGNALS: * 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); + void windowMenuRequested(KWin::SeatInterface *seat, const QPoint &pos, quint32 serial); /** * This signal is emitted when the toplevel's minimum size has been changed. @@ -366,14 +366,14 @@ Q_SIGNALS: * 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); + void moveRequested(KWin::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); + void resizeRequested(KWin::SeatInterface *seat, KWin::XdgToplevelInterface::ResizeAnchor anchor, quint32 serial); /** * This signal is emitted when the toplevel surface wants to become maximized. @@ -388,7 +388,7 @@ Q_SIGNALS: /** * This signal is emitted when the toplevel wants to be shown in the full screen mode. */ - void fullscreenRequested(KWaylandServer::OutputInterface *output); + void fullscreenRequested(KWin::OutputInterface *output); /** * This signal is emitted when the toplevel surface wants to leave the full screen mode. @@ -555,9 +555,9 @@ private: friend class XdgPopupInterfacePrivate; }; -} // namespace KWaylandServer +} // namespace KWin -Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::XdgToplevelInterface::States) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::XdgToplevelInterface::Capabilities) -Q_DECLARE_METATYPE(KWaylandServer::XdgToplevelInterface::State) -Q_DECLARE_METATYPE(KWaylandServer::XdgToplevelInterface::States) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::XdgToplevelInterface::States) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::XdgToplevelInterface::Capabilities) +Q_DECLARE_METATYPE(KWin::XdgToplevelInterface::State) +Q_DECLARE_METATYPE(KWin::XdgToplevelInterface::States) diff --git a/src/wayland/xdgshell_p.h b/src/wayland/xdgshell_p.h index 62b0152078..8b79d3f9b5 100644 --- a/src/wayland/xdgshell_p.h +++ b/src/wayland/xdgshell_p.h @@ -11,7 +11,7 @@ #include "surface_p.h" -namespace KWaylandServer +namespace KWin { class XdgToplevelDecorationV1Interface; @@ -190,4 +190,4 @@ protected: void xdg_popup_reposition(Resource *resource, struct ::wl_resource *positioner, uint32_t token) override; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland/xdgtopleveldrag_v1.cpp b/src/wayland/xdgtopleveldrag_v1.cpp index ee1a5ced44..aa03684448 100644 --- a/src/wayland/xdgtopleveldrag_v1.cpp +++ b/src/wayland/xdgtopleveldrag_v1.cpp @@ -19,7 +19,7 @@ #include -namespace KWaylandServer +namespace KWin { constexpr int version = 1; @@ -119,7 +119,7 @@ protected: XdgToplevelDragManagerV1Interface *q; }; -XdgToplevelDragManagerV1Interface::XdgToplevelDragManagerV1Interface(KWaylandServer::Display *display, QObject *parent) +XdgToplevelDragManagerV1Interface::XdgToplevelDragManagerV1Interface(Display *display, QObject *parent) : QObject(parent) , d(std::make_unique(this, display)) { diff --git a/src/wayland/xdgtopleveldrag_v1.h b/src/wayland/xdgtopleveldrag_v1.h index 9b14f9d9b3..5abc3e6d4e 100644 --- a/src/wayland/xdgtopleveldrag_v1.h +++ b/src/wayland/xdgtopleveldrag_v1.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class DataOfferInterface; diff --git a/src/wayland/xwaylandkeyboardgrab_v1.cpp b/src/wayland/xwaylandkeyboardgrab_v1.cpp index f73993308d..43f66039fb 100644 --- a/src/wayland/xwaylandkeyboardgrab_v1.cpp +++ b/src/wayland/xwaylandkeyboardgrab_v1.cpp @@ -14,7 +14,7 @@ constexpr int version = 1; -namespace KWaylandServer +namespace KWin { class XWaylandKeyboardGrabManagerV1InterfacePrivate : QtWaylandServer::zwp_xwayland_keyboard_grab_manager_v1 diff --git a/src/wayland/xwaylandkeyboardgrab_v1.h b/src/wayland/xwaylandkeyboardgrab_v1.h index f44c6dce75..60a6390cc7 100644 --- a/src/wayland/xwaylandkeyboardgrab_v1.h +++ b/src/wayland/xwaylandkeyboardgrab_v1.h @@ -14,7 +14,7 @@ struct wl_resource; -namespace KWaylandServer +namespace KWin { class Display; diff --git a/src/wayland/xwaylandshell_v1.cpp b/src/wayland/xwaylandshell_v1.cpp index 5368b26257..5f9e219c79 100644 --- a/src/wayland/xwaylandshell_v1.cpp +++ b/src/wayland/xwaylandshell_v1.cpp @@ -12,7 +12,7 @@ #include -namespace KWaylandServer +namespace KWin { static const quint32 s_version = 1; @@ -173,6 +173,6 @@ std::optional XwaylandSurfaceV1Interface::serial() const return d->serial; } -} // namespace KWaylandServer +} // namespace KWin #include "moc_xwaylandshell_v1.cpp" diff --git a/src/wayland/xwaylandshell_v1.h b/src/wayland/xwaylandshell_v1.h index 942f69c49a..e507b69340 100644 --- a/src/wayland/xwaylandshell_v1.h +++ b/src/wayland/xwaylandshell_v1.h @@ -15,7 +15,7 @@ struct wl_client; -namespace KWaylandServer +namespace KWin { class Display; @@ -59,4 +59,4 @@ private: std::unique_ptr d; }; -} // namespace KWaylandServer +} // namespace KWin diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index ea2578fec9..fffae9a093 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -89,18 +89,16 @@ #include #endif -using namespace KWaylandServer; - namespace KWin { KWIN_SINGLETON_FACTORY(WaylandServer) -class KWinDisplay : public KWaylandServer::FilteredDisplay +class KWinDisplay : public FilteredDisplay { public: KWinDisplay(QObject *parent) - : KWaylandServer::FilteredDisplay(parent) + : FilteredDisplay(parent) { } @@ -116,7 +114,7 @@ public: return QByteArray(); } - bool isTrustedOrigin(KWaylandServer::ClientConnection *client) const + bool isTrustedOrigin(ClientConnection *client) const { const auto fullPathSha = sha256(client->executablePath()); const auto localSha = sha256(QLatin1String("/proc/") + QString::number(client->processId()) + QLatin1String("/exe")); @@ -129,7 +127,7 @@ public: return trusted; } - QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const + QStringList fetchRequestedInterfaces(ClientConnection *client) const { return KWin::fetchRequestedInterfaces(client->executablePath()); } @@ -152,7 +150,7 @@ public: QSet m_reported; - bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override + bool allowInterface(ClientConnection *client, const QByteArray &interfaceName) override { if (client->processId() == getpid()) { return true; @@ -221,12 +219,12 @@ WaylandServer::~WaylandServer() s_self = nullptr; } -KWaylandServer::ClientConnection *WaylandServer::xWaylandConnection() const +ClientConnection *WaylandServer::xWaylandConnection() const { return m_xwaylandConnection; } -KWaylandServer::ClientConnection *WaylandServer::inputMethodConnection() const +ClientConnection *WaylandServer::inputMethodConnection() const { return m_inputMethodServerConnection; } @@ -289,7 +287,7 @@ void WaylandServer::registerXdgGenericWindow(Window *window) void WaylandServer::handleOutputAdded(Output *output) { if (!output->isPlaceholder() && !output->isNonDesktop()) { - m_waylandOutputDevices.insert(output, new KWaylandServer::OutputDeviceV2Interface(m_display, output)); + m_waylandOutputDevices.insert(output, new OutputDeviceV2Interface(m_display, output)); } } @@ -303,7 +301,7 @@ void WaylandServer::handleOutputRemoved(Output *output) void WaylandServer::handleOutputEnabled(Output *output) { if (!output->isPlaceholder() && !output->isNonDesktop()) { - auto waylandOutput = new KWaylandServer::OutputInterface(waylandServer()->display(), output); + auto waylandOutput = new OutputInterface(waylandServer()->display(), output); m_xdgOutputManagerV1->offer(waylandOutput); m_waylandOutputs.insert(output, waylandOutput); @@ -365,8 +363,8 @@ bool WaylandServer::init(InitializationFlags flags) // The surface will be bound later when a WL_SURFACE_ID message is received. }); - m_xwaylandShell = new KWaylandServer::XwaylandShellV1Interface(m_display, m_display); - connect(m_xwaylandShell, &KWaylandServer::XwaylandShellV1Interface::surfaceAssociated, this, [](KWaylandServer::XwaylandSurfaceV1Interface *surface) { + m_xwaylandShell = new XwaylandShellV1Interface(m_display, m_display); + connect(m_xwaylandShell, &XwaylandShellV1Interface::surfaceAssociated, this, [](XwaylandSurfaceV1Interface *surface) { X11Window *window = workspace()->findClient([&surface](const X11Window *window) { return window->surfaceSerial() == surface->serial(); }); @@ -493,7 +491,7 @@ bool WaylandServer::init(InitializationFlags flags) m_inputMethod = new InputMethodV1Interface(m_display, m_display); m_xWaylandKeyboardGrabManager = new XWaylandKeyboardGrabManagerV1Interface(m_display, m_display); - auto activation = new KWaylandServer::XdgActivationV1Interface(m_display, this); + auto activation = new XdgActivationV1Interface(m_display, this); auto init = [this, activation] { m_xdgActivationIntegration = new XdgActivationV1Integration(activation, this); }; @@ -503,8 +501,8 @@ bool WaylandServer::init(InitializationFlags flags) connect(static_cast(qApp), &Application::workspaceCreated, this, init); } - auto aboveLockscreen = new KWaylandServer::LockscreenOverlayV1Interface(m_display, this); - connect(aboveLockscreen, &KWaylandServer::LockscreenOverlayV1Interface::allowRequested, this, [](SurfaceInterface *surface) { + auto aboveLockscreen = new LockscreenOverlayV1Interface(m_display, this); + connect(aboveLockscreen, &LockscreenOverlayV1Interface::allowRequested, this, [](SurfaceInterface *surface) { auto w = waylandServer()->findWindow(surface); if (!w) { return; @@ -512,12 +510,12 @@ bool WaylandServer::init(InitializationFlags flags) w->setLockScreenOverlay(true); }); - m_contentTypeManager = new KWaylandServer::ContentTypeManagerV1Interface(m_display, m_display); - m_tearingControlInterface = new KWaylandServer::TearingControlManagerV1Interface(m_display, m_display); + m_contentTypeManager = new ContentTypeManagerV1Interface(m_display, m_display); + m_tearingControlInterface = new TearingControlManagerV1Interface(m_display, m_display); new XdgToplevelDragManagerV1Interface(m_display, this); - auto screenEdgeManager = new KWaylandServer::ScreenEdgeManagerV1Interface(m_display, m_display); - connect(screenEdgeManager, &KWaylandServer::ScreenEdgeManagerV1Interface::edgeRequested, this, [this](KWaylandServer::AutoHideScreenEdgeV1Interface *edge) { + auto screenEdgeManager = new ScreenEdgeManagerV1Interface(m_display, m_display); + connect(screenEdgeManager, &ScreenEdgeManagerV1Interface::edgeRequested, this, [this](AutoHideScreenEdgeV1Interface *edge) { if (auto window = qobject_cast(findWindow(edge->surface()))) { window->installAutoHideScreenEdgeV1(edge); } @@ -526,7 +524,7 @@ bool WaylandServer::init(InitializationFlags flags) return true; } -KWaylandServer::DrmClientBufferIntegration *WaylandServer::drm() +DrmClientBufferIntegration *WaylandServer::drm() { if (!m_drm) { m_drm = new DrmClientBufferIntegration(m_display); @@ -534,7 +532,7 @@ KWaylandServer::DrmClientBufferIntegration *WaylandServer::drm() return m_drm; } -KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *WaylandServer::linuxDmabuf() +LinuxDmaBufV1ClientBufferIntegration *WaylandServer::linuxDmabuf() { if (!m_linuxDmabuf) { m_linuxDmabuf = new LinuxDmaBufV1ClientBufferIntegration(m_display); @@ -555,7 +553,6 @@ void WaylandServer::initWorkspace() if (m_windowManagement) { connect(workspace(), &Workspace::showingDesktopChanged, this, [this](bool set) { - using namespace KWaylandServer; m_windowManagement->setShowingDesktopState(set ? PlasmaWindowManagementInterface::ShowingDesktopState::Enabled : PlasmaWindowManagementInterface::ShowingDesktopState::Disabled); }); @@ -596,10 +593,10 @@ void WaylandServer::initWorkspace() } if (auto backend = qobject_cast(kwinApp()->outputBackend())) { - m_leaseManager = new KWaylandServer::DrmLeaseManagerV1(backend, m_display, m_display); + m_leaseManager = new DrmLeaseManagerV1(backend, m_display, m_display); } - m_outputOrder = new KWaylandServer::OutputOrderV1Interface(m_display, m_display); + m_outputOrder = new OutputOrderV1Interface(m_display, m_display); m_outputOrder->setOutputOrder(workspace()->outputOrder()); connect(workspace(), &Workspace::outputOrderChanged, m_outputOrder, [this]() { m_outputOrder->setOutputOrder(workspace()->outputOrder()); @@ -630,7 +627,7 @@ void WaylandServer::initScreenLocker() const QVector seatIfaces = m_display->seats(); for (auto *seat : seatIfaces) { - connect(seat, &KWaylandServer::SeatInterface::timestampChanged, + connect(seat, &SeatInterface::timestampChanged, screenLockerApp, &ScreenLocker::KSldApp::userActivity); } }); @@ -644,7 +641,7 @@ void WaylandServer::initScreenLocker() const QVector seatIfaces = m_display->seats(); for (auto *seat : seatIfaces) { - disconnect(seat, &KWaylandServer::SeatInterface::timestampChanged, + disconnect(seat, &SeatInterface::timestampChanged, screenLockerApp, &ScreenLocker::KSldApp::userActivity); } ScreenLocker::KSldApp::self()->setWaylandFd(-1); @@ -680,7 +677,7 @@ int WaylandServer::createScreenLockerConnection() return -1; } m_screenLockerClientConnection = socket.connection; - connect(m_screenLockerClientConnection, &KWaylandServer::ClientConnection::disconnected, this, [this]() { + connect(m_screenLockerClientConnection, &ClientConnection::disconnected, this, [this]() { m_screenLockerClientConnection = nullptr; }); return socket.fd; @@ -738,7 +735,7 @@ void WaylandServer::removeWindow(Window *c) } } -static Window *findWindowInList(const QList &windows, const KWaylandServer::SurfaceInterface *surface) +static Window *findWindowInList(const QList &windows, const SurfaceInterface *surface) { auto it = std::find_if(windows.begin(), windows.end(), [surface](Window *w) { return w->surface() == surface; @@ -749,7 +746,7 @@ static Window *findWindowInList(const QList &windows, const KWaylandSe return *it; } -Window *WaylandServer::findWindow(const KWaylandServer::SurfaceInterface *surface) const +Window *WaylandServer::findWindow(const SurfaceInterface *surface) const { if (!surface) { return nullptr; diff --git a/src/wayland_server.h b/src/wayland_server.h index 1cda45bec5..2f5acbca33 100644 --- a/src/wayland_server.h +++ b/src/wayland_server.h @@ -14,8 +14,9 @@ #include #include -namespace KWaylandServer +namespace KWin { + class AppMenuManagerInterface; class ClientConnection; class CompositorInterface; @@ -48,11 +49,6 @@ class DrmLeaseManagerV1; class TearingControlManagerV1Interface; class XwaylandShellV1Interface; class OutputOrderV1Interface; -} - -namespace KWin -{ - class Window; class Output; class XdgActivationV1Integration; @@ -80,65 +76,65 @@ public: bool start(); - KWaylandServer::Display *display() const + Display *display() const { return m_display; } - KWaylandServer::CompositorInterface *compositor() const + CompositorInterface *compositor() const { return m_compositor; } - KWaylandServer::SeatInterface *seat() const + SeatInterface *seat() const { return m_seat; } - KWaylandServer::TabletManagerV2Interface *tabletManagerV2() const + TabletManagerV2Interface *tabletManagerV2() const { return m_tabletManagerV2; } - KWaylandServer::DataDeviceManagerInterface *dataDeviceManager() const + DataDeviceManagerInterface *dataDeviceManager() const { return m_dataDeviceManager; } - KWaylandServer::PlasmaWindowActivationFeedbackInterface *plasmaActivationFeedback() const + PlasmaWindowActivationFeedbackInterface *plasmaActivationFeedback() const { return m_plasmaActivationFeedback; } - KWaylandServer::PlasmaVirtualDesktopManagementInterface *virtualDesktopManagement() const + PlasmaVirtualDesktopManagementInterface *virtualDesktopManagement() const { return m_virtualDesktopManagement; } - KWaylandServer::PlasmaWindowManagementInterface *windowManagement() const + PlasmaWindowManagementInterface *windowManagement() const { return m_windowManagement; } - KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const + ServerSideDecorationManagerInterface *decorationManager() const { return m_decorationManager; } - KWaylandServer::XdgOutputManagerV1Interface *xdgOutputManagerV1() const + XdgOutputManagerV1Interface *xdgOutputManagerV1() const { return m_xdgOutputManagerV1; } - KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *keyboardShortcutsInhibitManager() const + KeyboardShortcutsInhibitManagerV1Interface *keyboardShortcutsInhibitManager() const { return m_keyboardShortcutsInhibitManager; } - KWaylandServer::XwaylandShellV1Interface *xwaylandShell() const + XwaylandShellV1Interface *xwaylandShell() const { return m_xwaylandShell; } bool isKeyboardShortcutsInhibited() const; - KWaylandServer::DrmClientBufferIntegration *drm(); - KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *linuxDmabuf(); + DrmClientBufferIntegration *drm(); + LinuxDmaBufV1ClientBufferIntegration *linuxDmabuf(); - KWaylandServer::InputMethodV1Interface *inputMethod() const + InputMethodV1Interface *inputMethod() const { return m_inputMethod; } - KWaylandServer::IdleInterface *idle() const + IdleInterface *idle() const { return m_idle; } @@ -147,14 +143,14 @@ public: return m_windows; } void removeWindow(Window *c); - Window *findWindow(const KWaylandServer::SurfaceInterface *surface) const; - XdgToplevelWindow *findXdgToplevelWindow(KWaylandServer::SurfaceInterface *surface) const; - XdgSurfaceWindow *findXdgSurfaceWindow(KWaylandServer::SurfaceInterface *surface) const; + Window *findWindow(const SurfaceInterface *surface) const; + XdgToplevelWindow *findXdgToplevelWindow(SurfaceInterface *surface) const; + XdgSurfaceWindow *findXdgSurfaceWindow(SurfaceInterface *surface) const; /** * @returns a transient parent of a surface imported with the foreign protocol, if any */ - KWaylandServer::SurfaceInterface *findForeignTransientForSurface(KWaylandServer::SurfaceInterface *surface); + SurfaceInterface *findForeignTransientForSurface(SurfaceInterface *surface); /** * @returns file descriptor for Xwayland to connect to. @@ -184,9 +180,9 @@ public: void initWorkspace(); - KWaylandServer::ClientConnection *xWaylandConnection() const; - KWaylandServer::ClientConnection *inputMethodConnection() const; - KWaylandServer::ClientConnection *screenLockerClientConnection() const + ClientConnection *xWaylandConnection() const; + ClientConnection *inputMethodConnection() const; + ClientConnection *screenLockerClientConnection() const { return m_screenLockerClientConnection; } @@ -200,7 +196,7 @@ public: /** * ServerSide Connection */ - KWaylandServer::ClientConnection *connection = nullptr; + ClientConnection *connection = nullptr; /** * client-side file descriptor for the socket */ @@ -226,7 +222,7 @@ Q_SIGNALS: void windowAdded(KWin::Window *); void windowRemoved(KWin::Window *); void initialized(); - void foreignTransientChanged(KWaylandServer::SurfaceInterface *child); + void foreignTransientChanged(KWin::SurfaceInterface *child); void lockStateChanged(); private: @@ -250,41 +246,41 @@ private: QSet m_signaledOutputs; }; - KWaylandServer::Display *m_display = nullptr; - KWaylandServer::CompositorInterface *m_compositor = nullptr; - KWaylandServer::SeatInterface *m_seat = nullptr; - KWaylandServer::TabletManagerV2Interface *m_tabletManagerV2 = nullptr; - KWaylandServer::DataDeviceManagerInterface *m_dataDeviceManager = nullptr; - KWaylandServer::PlasmaShellInterface *m_plasmaShell = nullptr; - KWaylandServer::PlasmaWindowActivationFeedbackInterface *m_plasmaActivationFeedback = nullptr; - KWaylandServer::PlasmaWindowManagementInterface *m_windowManagement = nullptr; - KWaylandServer::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; - KWaylandServer::ServerSideDecorationManagerInterface *m_decorationManager = nullptr; - KWaylandServer::OutputManagementV2Interface *m_outputManagement = nullptr; - KWaylandServer::AppMenuManagerInterface *m_appMenuManager = nullptr; - KWaylandServer::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; - KWaylandServer::IdleInterface *m_idle = nullptr; - KWaylandServer::XdgOutputManagerV1Interface *m_xdgOutputManagerV1 = nullptr; - KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr; - KWaylandServer::DrmClientBufferIntegration *m_drm = nullptr; - KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *m_linuxDmabuf = nullptr; - KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr; - QPointer m_xwaylandConnection; - KWaylandServer::InputMethodV1Interface *m_inputMethod = nullptr; - QPointer m_inputMethodServerConnection; - KWaylandServer::ClientConnection *m_screenLockerClientConnection = nullptr; - KWaylandServer::XdgForeignV2Interface *m_XdgForeign = nullptr; + Display *m_display = nullptr; + CompositorInterface *m_compositor = nullptr; + SeatInterface *m_seat = nullptr; + TabletManagerV2Interface *m_tabletManagerV2 = nullptr; + DataDeviceManagerInterface *m_dataDeviceManager = nullptr; + PlasmaShellInterface *m_plasmaShell = nullptr; + PlasmaWindowActivationFeedbackInterface *m_plasmaActivationFeedback = nullptr; + PlasmaWindowManagementInterface *m_windowManagement = nullptr; + PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; + ServerSideDecorationManagerInterface *m_decorationManager = nullptr; + OutputManagementV2Interface *m_outputManagement = nullptr; + AppMenuManagerInterface *m_appMenuManager = nullptr; + ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; + IdleInterface *m_idle = nullptr; + XdgOutputManagerV1Interface *m_xdgOutputManagerV1 = nullptr; + XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr; + DrmClientBufferIntegration *m_drm = nullptr; + LinuxDmaBufV1ClientBufferIntegration *m_linuxDmabuf = nullptr; + KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr; + QPointer m_xwaylandConnection; + InputMethodV1Interface *m_inputMethod = nullptr; + QPointer m_inputMethodServerConnection; + ClientConnection *m_screenLockerClientConnection = nullptr; + XdgForeignV2Interface *m_XdgForeign = nullptr; XdgActivationV1Integration *m_xdgActivationIntegration = nullptr; - KWaylandServer::XWaylandKeyboardGrabManagerV1Interface *m_xWaylandKeyboardGrabManager = nullptr; - KWaylandServer::ContentTypeManagerV1Interface *m_contentTypeManager = nullptr; - KWaylandServer::TearingControlManagerV1Interface *m_tearingControlInterface = nullptr; - KWaylandServer::XwaylandShellV1Interface *m_xwaylandShell = nullptr; + XWaylandKeyboardGrabManagerV1Interface *m_xWaylandKeyboardGrabManager = nullptr; + ContentTypeManagerV1Interface *m_contentTypeManager = nullptr; + TearingControlManagerV1Interface *m_tearingControlInterface = nullptr; + XwaylandShellV1Interface *m_xwaylandShell = nullptr; QList m_windows; InitializationFlags m_initFlags; - QHash m_waylandOutputs; - QHash m_waylandOutputDevices; - KWaylandServer::DrmLeaseManagerV1 *m_leaseManager = nullptr; - KWaylandServer::OutputOrderV1Interface *m_outputOrder = nullptr; + QHash m_waylandOutputs; + QHash m_waylandOutputDevices; + DrmLeaseManagerV1 *m_leaseManager = nullptr; + OutputOrderV1Interface *m_outputOrder = nullptr; KWIN_SINGLETON(WaylandServer) }; diff --git a/src/waylandwindow.cpp b/src/waylandwindow.cpp index c083102461..349d8060bc 100644 --- a/src/waylandwindow.cpp +++ b/src/waylandwindow.cpp @@ -21,8 +21,6 @@ #include #include -using namespace KWaylandServer; - namespace KWin { diff --git a/src/waylandwindow.h b/src/waylandwindow.h index 67888cbb82..d76fd11a4f 100644 --- a/src/waylandwindow.h +++ b/src/waylandwindow.h @@ -16,7 +16,7 @@ class WaylandWindow : public Window Q_OBJECT public: - WaylandWindow(KWaylandServer::SurfaceInterface *surface); + WaylandWindow(SurfaceInterface *surface); QString captionNormal() const override; QString captionSuffix() const override; diff --git a/src/window.cpp b/src/window.cpp index 11e831f570..5bdbeb79c6 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -133,7 +133,7 @@ QDebug operator<<(QDebug debug, const Window *window) debug.nospace(); if (window) { debug << window->metaObject()->className() << '(' << static_cast(window); - if (const KWaylandServer::SurfaceInterface *surface = window->surface()) { + if (const SurfaceInterface *surface = window->surface()) { debug << ", surface=" << surface; } if (window->isClient()) { @@ -337,12 +337,12 @@ void Window::setSkipCloseAnimation(bool set) Q_EMIT skipCloseAnimationChanged(); } -KWaylandServer::SurfaceInterface *Window::surface() const +SurfaceInterface *Window::surface() const { return m_surface; } -void Window::setSurface(KWaylandServer::SurfaceInterface *surface) +void Window::setSurface(SurfaceInterface *surface) { if (m_surface == surface) { return; @@ -1800,7 +1800,6 @@ void Window::setupWindowManagementInterface() if (!waylandServer() || !waylandServer()->windowManagement()) { return; } - using namespace KWaylandServer; auto w = waylandServer()->windowManagement()->createWindow(this, internalId()); w->setTitle(caption()); w->setActive(isActive()); @@ -1968,7 +1967,7 @@ void Window::setupWindowManagementInterface() connect(w, &PlasmaWindowInterface::leavePlasmaActivityRequested, this, [this](const QString &activityId) { setOnActivity(activityId, false); }); - connect(w, &PlasmaWindowInterface::sendToOutput, this, [this](KWaylandServer::OutputInterface *output) { + connect(w, &PlasmaWindowInterface::sendToOutput, this, [this](OutputInterface *output) { sendToOutput(output->handle()); }); diff --git a/src/window.h b/src/window.h index 2635487033..3d9334a965 100644 --- a/src/window.h +++ b/src/window.h @@ -31,12 +31,6 @@ class QMouseEvent; -namespace KWaylandServer -{ -class PlasmaWindowInterface; -class SurfaceInterface; -} - namespace KDecoration2 { class Decoration; @@ -44,6 +38,8 @@ class Decoration; namespace KWin { +class PlasmaWindowInterface; +class SurfaceInterface; class Group; class Output; class ClientMachine; @@ -785,8 +781,8 @@ public: bool skipsCloseAnimation() const; void setSkipCloseAnimation(bool set); - KWaylandServer::SurfaceInterface *surface() const; - void setSurface(KWaylandServer::SurfaceInterface *surface); + SurfaceInterface *surface() const; + void setSurface(SurfaceInterface *surface); /** * @returns Transformation to map from global to window coordinates. @@ -1299,7 +1295,7 @@ public: /** * Return window management interface */ - KWaylandServer::PlasmaWindowInterface *windowManagementInterface() const + PlasmaWindowInterface *windowManagementInterface() const { return m_windowManagementInterface; } @@ -1738,7 +1734,7 @@ protected: QString resource_class; ClientMachine *m_clientMachine; bool m_skipCloseAnimation; - QPointer m_surface; + QPointer m_surface; qreal m_opacity = 1.0; int m_stackingOrder = 0; @@ -1771,7 +1767,7 @@ protected: static QHash> s_palettes; static std::shared_ptr s_defaultPalette; - KWaylandServer::PlasmaWindowInterface *m_windowManagementInterface = nullptr; + PlasmaWindowInterface *m_windowManagementInterface = nullptr; Window *m_transientFor = nullptr; QList m_transients; diff --git a/src/x11window.cpp b/src/x11window.cpp index a5855dd22a..1a55c41905 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -4985,7 +4985,7 @@ void X11Window::associate() } else { // Queued connection because we want to mark the window ready for painting after // the associated surface item has processed the new surface state. - connect(surface(), &KWaylandServer::SurfaceInterface::mapped, this, handleMapped, Qt::QueuedConnection); + connect(surface(), &SurfaceInterface::mapped, this, handleMapped, Qt::QueuedConnection); } m_pendingSurfaceId = 0; diff --git a/src/xdgactivationv1.cpp b/src/xdgactivationv1.cpp index 55845f83c8..414be2b6cf 100644 --- a/src/xdgactivationv1.cpp +++ b/src/xdgactivationv1.cpp @@ -20,8 +20,6 @@ #include #include -using namespace KWaylandServer; - namespace KWin { @@ -104,7 +102,7 @@ QString XdgActivationV1Integration::requestToken(bool isPrivileged, SurfaceInter } icon = QIcon::fromTheme(df.readIcon(), icon); } - std::unique_ptr activation; + std::unique_ptr activation; if (showNotify) { activation = waylandServer()->plasmaActivationFeedback()->createActivation(appId); } diff --git a/src/xdgactivationv1.h b/src/xdgactivationv1.h index b62faa5e81..98835def8a 100644 --- a/src/xdgactivationv1.h +++ b/src/xdgactivationv1.h @@ -13,43 +13,41 @@ #include #include -namespace KWaylandServer +namespace KWin { + class SeatInterface; class ClientConnection; class SurfaceInterface; class XdgActivationV1Interface; class PlasmaWindowActivationInterface; -} -namespace KWin -{ class KWIN_EXPORT XdgActivationV1Integration : public QObject { Q_OBJECT public: - XdgActivationV1Integration(KWaylandServer::XdgActivationV1Interface *activation, QObject *parent); + XdgActivationV1Integration(XdgActivationV1Interface *activation, QObject *parent); - QString requestPrivilegedToken(KWaylandServer::SurfaceInterface *surface, uint serial, KWaylandServer::SeatInterface *seat, const QString &appId) + QString requestPrivilegedToken(SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId) { return requestToken(true, surface, serial, seat, appId); } - void activateSurface(KWaylandServer::SurfaceInterface *surface, const QString &token); + void activateSurface(SurfaceInterface *surface, const QString &token); private: - QString requestToken(bool isPrivileged, KWaylandServer::SurfaceInterface *surface, uint serial, KWaylandServer::SeatInterface *seat, const QString &appId); + QString requestToken(bool isPrivileged, SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId); void clear(); struct ActivationToken { QString token; bool isPrivileged; - QPointer surface; + QPointer surface; uint serial; - KWaylandServer::SeatInterface *seat; + SeatInterface *seat; QString applicationId; bool showNotify; - std::unique_ptr activation; + std::unique_ptr activation; }; std::unique_ptr m_currentActivationToken; }; diff --git a/src/xdgshellintegration.cpp b/src/xdgshellintegration.cpp index 8d5d0740c3..205163294e 100644 --- a/src/xdgshellintegration.cpp +++ b/src/xdgshellintegration.cpp @@ -11,8 +11,6 @@ #include "workspace.h" #include "xdgshellwindow.h" -using namespace KWaylandServer; - namespace KWin { diff --git a/src/xdgshellintegration.h b/src/xdgshellintegration.h index b96e5a8e4a..78c9a4fe62 100644 --- a/src/xdgshellintegration.h +++ b/src/xdgshellintegration.h @@ -8,14 +8,11 @@ #include "waylandshellintegration.h" -namespace KWaylandServer +namespace KWin { + class XdgToplevelInterface; class XdgPopupInterface; -} - -namespace KWin -{ class XdgShellIntegration : public WaylandShellIntegration { @@ -25,9 +22,9 @@ public: explicit XdgShellIntegration(QObject *parent = nullptr); private: - void registerXdgToplevel(KWaylandServer::XdgToplevelInterface *toplevel); - void registerXdgPopup(KWaylandServer::XdgPopupInterface *popup); - void createXdgToplevelWindow(KWaylandServer::XdgToplevelInterface *surface); + void registerXdgToplevel(XdgToplevelInterface *toplevel); + void registerXdgPopup(XdgPopupInterface *popup); + void createXdgToplevelWindow(XdgToplevelInterface *surface); }; } // namespace KWin diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 3ce7d19d1b..b4b4c0fbe0 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -33,8 +33,6 @@ #include #include -using namespace KWaylandServer; - namespace KWin { @@ -1253,16 +1251,16 @@ void XdgToplevelWindow::updateFullScreenMode(bool set) void XdgToplevelWindow::updateCapabilities() { - KWaylandServer::XdgToplevelInterface::Capabilities caps = KWaylandServer::XdgToplevelInterface::Capability::WindowMenu; + XdgToplevelInterface::Capabilities caps = XdgToplevelInterface::Capability::WindowMenu; if (isMaximizable()) { - caps.setFlag(KWaylandServer::XdgToplevelInterface::Capability::Maximize); + caps.setFlag(XdgToplevelInterface::Capability::Maximize); } if (isFullScreenable()) { - caps.setFlag(KWaylandServer::XdgToplevelInterface::Capability::FullScreen); + caps.setFlag(XdgToplevelInterface::Capability::FullScreen); } if (isMinimizable()) { - caps.setFlag(KWaylandServer::XdgToplevelInterface::Capability::Minimize); + caps.setFlag(XdgToplevelInterface::Capability::Minimize); } if (m_capabilities != caps) { @@ -1484,7 +1482,7 @@ void XdgToplevelWindow::maximize(MaximizeMode mode) m_requestedMaximizeMode = mode; // call into decoration update borders - if (m_nextDecoration && !(options->borderlessMaximizedWindows() && m_requestedMaximizeMode == KWin::MaximizeFull)) { + if (m_nextDecoration && !(options->borderlessMaximizedWindows() && m_requestedMaximizeMode == MaximizeFull)) { changeMaximizeRecursion = true; const auto c = m_nextDecoration->client(); if ((m_requestedMaximizeMode & MaximizeVertical) != (oldMode & MaximizeVertical)) { diff --git a/src/xdgshellwindow.h b/src/xdgshellwindow.h index 1a734c856e..4a415a25b4 100644 --- a/src/xdgshellwindow.h +++ b/src/xdgshellwindow.h @@ -19,17 +19,14 @@ #include -namespace KWaylandServer +namespace KWin { + class AppMenuInterface; class PlasmaShellSurfaceInterface; class ServerSideDecorationInterface; class ServerSideDecorationPaletteInterface; class XdgToplevelDecorationV1Interface; -} - -namespace KWin -{ class Output; class XdgSurfaceConfigure @@ -55,14 +52,14 @@ class XdgSurfaceWindow : public WaylandWindow Q_OBJECT public: - explicit XdgSurfaceWindow(KWaylandServer::XdgSurfaceInterface *shellSurface); + explicit XdgSurfaceWindow(XdgSurfaceInterface *shellSurface); ~XdgSurfaceWindow() override; NET::WindowType windowType(bool direct = false) const override; QRectF frameRectToBufferRect(const QRectF &rect) const override; void destroyWindow() override; - void installPlasmaShellSurface(KWaylandServer::PlasmaShellSurfaceInterface *shellSurface); + void installPlasmaShellSurface(PlasmaShellSurfaceInterface *shellSurface); protected: void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override; @@ -76,7 +73,7 @@ protected: void scheduleConfigure(); void sendConfigure(); - QPointer m_plasmaShellSurface; + QPointer m_plasmaShellSurface; NET::WindowType m_windowType = NET::Normal; Gravity m_nextGravity = Gravity::None; @@ -90,7 +87,7 @@ private: void resetHaveNextWindowGeometry(); void maybeUpdateMoveResizeGeometry(const QRectF &rect); - KWaylandServer::XdgSurfaceInterface *m_shellSurface; + XdgSurfaceInterface *m_shellSurface; QTimer *m_configureTimer; XdgSurfaceConfigure::ConfigureFlags m_configureFlags; QQueue m_configureEvents; @@ -104,7 +101,7 @@ class XdgToplevelConfigure final : public XdgSurfaceConfigure { public: std::shared_ptr decoration; - KWaylandServer::XdgToplevelInterface::States states; + XdgToplevelInterface::States states; }; class XdgToplevelWindow final : public XdgSurfaceWindow @@ -123,10 +120,10 @@ class XdgToplevelWindow final : public XdgSurfaceWindow }; public: - explicit XdgToplevelWindow(KWaylandServer::XdgToplevelInterface *shellSurface); + explicit XdgToplevelWindow(XdgToplevelInterface *shellSurface); ~XdgToplevelWindow() override; - KWaylandServer::XdgToplevelInterface *shellSurface() const; + XdgToplevelInterface *shellSurface() const; MaximizeMode maximizeMode() const override; MaximizeMode requestedMaximizeMode() const override; @@ -157,10 +154,10 @@ public: void closeWindow() override; void maximize(MaximizeMode mode) override; - void installAppMenu(KWaylandServer::AppMenuInterface *appMenu); - void installServerDecoration(KWaylandServer::ServerSideDecorationInterface *decoration); - void installPalette(KWaylandServer::ServerSideDecorationPaletteInterface *palette); - void installXdgDecoration(KWaylandServer::XdgToplevelDecorationV1Interface *decoration); + void installAppMenu(AppMenuInterface *appMenu); + void installServerDecoration(ServerSideDecorationInterface *decoration); + void installPalette(ServerSideDecorationPaletteInterface *palette); + void installXdgDecoration(XdgToplevelDecorationV1Interface *decoration); protected: XdgSurfaceConfigure *sendRoleConfigure() const override; @@ -182,18 +179,18 @@ protected: private: void handleWindowTitleChanged(); void handleWindowClassChanged(); - void handleWindowMenuRequested(KWaylandServer::SeatInterface *seat, + void handleWindowMenuRequested(SeatInterface *seat, const QPoint &surfacePos, quint32 serial); - void handleMoveRequested(KWaylandServer::SeatInterface *seat, quint32 serial); - void handleResizeRequested(KWaylandServer::SeatInterface *seat, KWaylandServer::XdgToplevelInterface::ResizeAnchor anchor, quint32 serial); - void handleStatesAcknowledged(const KWaylandServer::XdgToplevelInterface::States &states); + void handleMoveRequested(SeatInterface *seat, quint32 serial); + void handleResizeRequested(SeatInterface *seat, XdgToplevelInterface::ResizeAnchor anchor, quint32 serial); + void handleStatesAcknowledged(const XdgToplevelInterface::States &states); void handleMaximizeRequested(); void handleUnmaximizeRequested(); - void handleFullscreenRequested(KWaylandServer::OutputInterface *output); + void handleFullscreenRequested(OutputInterface *output); void handleUnfullscreenRequested(); void handleMinimizeRequested(); void handleTransientForChanged(); - void handleForeignTransientForChanged(KWaylandServer::SurfaceInterface *child); + void handleForeignTransientForChanged(SurfaceInterface *child); void handlePingTimeout(quint32 serial); void handlePingDelayed(quint32 serial); void handlePongReceived(quint32 serial); @@ -212,15 +209,15 @@ private: void clearDecoration(); void updateCapabilities(); - QPointer m_appMenuInterface; - QPointer m_paletteInterface; - QPointer m_serverDecoration; - QPointer m_xdgDecoration; - KWaylandServer::XdgToplevelInterface *m_shellSurface; - KWaylandServer::XdgToplevelInterface::States m_nextStates; - KWaylandServer::XdgToplevelInterface::States m_acknowledgedStates; - KWaylandServer::XdgToplevelInterface::States m_initialStates; - KWaylandServer::XdgToplevelInterface::Capabilities m_capabilities; + QPointer m_appMenuInterface; + QPointer m_paletteInterface; + QPointer m_serverDecoration; + QPointer m_xdgDecoration; + XdgToplevelInterface *m_shellSurface; + XdgToplevelInterface::States m_nextStates; + XdgToplevelInterface::States m_acknowledgedStates; + XdgToplevelInterface::States m_initialStates; + XdgToplevelInterface::Capabilities m_capabilities; QMap m_pings; MaximizeMode m_maximizeMode = MaximizeRestore; MaximizeMode m_requestedMaximizeMode = MaximizeRestore; @@ -238,7 +235,7 @@ class XdgPopupWindow final : public XdgSurfaceWindow Q_OBJECT public: - explicit XdgPopupWindow(KWaylandServer::XdgPopupInterface *shellSurface); + explicit XdgPopupWindow(XdgPopupInterface *shellSurface); ~XdgPopupWindow() override; bool hasPopupGrab() const override; @@ -261,13 +258,13 @@ protected: void handleRoleDestroyed() override; private: - void handleGrabRequested(KWaylandServer::SeatInterface *seat, quint32 serial); + void handleGrabRequested(SeatInterface *seat, quint32 serial); void handleRepositionRequested(quint32 token); void initialize(); void updateRelativePlacement(); void relayout(); - KWaylandServer::XdgPopupInterface *m_shellSurface; + XdgPopupInterface *m_shellSurface; bool m_haveExplicitGrab = false; QRectF m_relativePlacement; }; diff --git a/src/xkb.cpp b/src/xkb.cpp index 5db8993853..7ed36999c9 100644 --- a/src/xkb.cpp +++ b/src/xkb.cpp @@ -714,9 +714,9 @@ quint32 Xkb::numberOfLayouts() const return xkb_keymap_num_layouts(m_keymap); } -void Xkb::setSeat(KWaylandServer::SeatInterface *seat) +void Xkb::setSeat(SeatInterface *seat) { - m_seat = QPointer(seat); + m_seat = QPointer(seat); } std::optional Xkb::keycodeFromKeysym(xkb_keysym_t keysym) diff --git a/src/xkb.h b/src/xkb.h index 4966a23567..2dbb5073bf 100644 --- a/src/xkb.h +++ b/src/xkb.h @@ -30,14 +30,11 @@ typedef uint32_t xkb_led_index_t; typedef uint32_t xkb_keysym_t; typedef uint32_t xkb_layout_index_t; -namespace KWaylandServer -{ -class SeatInterface; -} - namespace KWin { +class SeatInterface; + class KWIN_EXPORT Xkb : public QObject { Q_OBJECT @@ -104,7 +101,7 @@ public: */ void forwardModifiers(); - void setSeat(KWaylandServer::SeatInterface *seat); + void setSeat(SeatInterface *seat); QByteArray keymapContents() const; std::optional keycodeFromKeysym(xkb_keysym_t keysym); @@ -161,7 +158,7 @@ private: xkb_mod_index_t locked = 0; } m_modifierState; - QPointer m_seat; + QPointer m_seat; const bool m_followLocale1; }; diff --git a/src/xwayland/clipboard.cpp b/src/xwayland/clipboard.cpp index c505305794..0a39c541de 100644 --- a/src/xwayland/clipboard.cpp +++ b/src/xwayland/clipboard.cpp @@ -46,11 +46,11 @@ Clipboard::Clipboard(xcb_atom_t atom, QObject *parent) registerXfixes(); xcb_flush(xcbConn); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged, + connect(waylandServer()->seat(), &SeatInterface::selectionChanged, this, &Clipboard::wlSelectionChanged); } -void Clipboard::wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi) +void Clipboard::wlSelectionChanged(AbstractDataSource *dsi) { if (m_waitingForTargets) { return; @@ -68,7 +68,7 @@ void Clipboard::wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi) checkWlSource(); } -bool Clipboard::ownsSelection(KWaylandServer::AbstractDataSource *dsi) const +bool Clipboard::ownsSelection(AbstractDataSource *dsi) const { return dsi && dsi == m_selectionSource.get(); } @@ -170,7 +170,7 @@ void Clipboard::x11OffersChanged(const QStringList &added, const QStringList &re std::swap(m_selectionSource, newSelection); waylandServer()->seat()->setSelection(m_selectionSource.get()); } else { - KWaylandServer::AbstractDataSource *currentSelection = waylandServer()->seat()->selection(); + AbstractDataSource *currentSelection = waylandServer()->seat()->selection(); if (!ownsSelection(currentSelection)) { waylandServer()->seat()->setSelection(nullptr); m_selectionSource.reset(); diff --git a/src/xwayland/clipboard.h b/src/xwayland/clipboard.h index 3037a4a434..0ab0577489 100644 --- a/src/xwayland/clipboard.h +++ b/src/xwayland/clipboard.h @@ -12,13 +12,11 @@ #include -namespace KWaylandServer +namespace KWin { + class AbstractDataSource; -} -namespace KWin -{ namespace Xwl { class XwlDataSource; @@ -41,7 +39,7 @@ private: /** * React to Wl selection change. */ - void wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi); + void wlSelectionChanged(AbstractDataSource *dsi); /** * Check the current state of the selection and if a source needs * to be created or destroyed. @@ -51,7 +49,7 @@ private: /** * Returns if dsi is managed by our data bridge */ - bool ownsSelection(KWaylandServer::AbstractDataSource *dsi) const; + bool ownsSelection(AbstractDataSource *dsi) const; QMetaObject::Connection m_checkConnection; diff --git a/src/xwayland/databridge.cpp b/src/xwayland/databridge.cpp index fd6ed5ea25..a836e49ab0 100644 --- a/src/xwayland/databridge.cpp +++ b/src/xwayland/databridge.cpp @@ -22,8 +22,6 @@ #include "window.h" #include "workspace.h" -using namespace KWaylandServer; - namespace KWin { namespace Xwl diff --git a/src/xwayland/databridge.h b/src/xwayland/databridge.h index 31984b28b9..f5ef97205b 100644 --- a/src/xwayland/databridge.h +++ b/src/xwayland/databridge.h @@ -14,14 +14,10 @@ #include #include -namespace KWaylandServer +namespace KWin { class DataDeviceInterface; class SurfaceInterface; -} - -namespace KWin -{ class Window; namespace Xwl diff --git a/src/xwayland/datasource.cpp b/src/xwayland/datasource.cpp index e80b928b16..ce907fe1c9 100644 --- a/src/xwayland/datasource.cpp +++ b/src/xwayland/datasource.cpp @@ -37,23 +37,23 @@ void XwlDataSource::accept(const QString &mimeType) m_accepted = !mimeType.isEmpty(); } -KWaylandServer::DataDeviceManagerInterface::DnDActions XwlDataSource::supportedDragAndDropActions() const +DataDeviceManagerInterface::DnDActions XwlDataSource::supportedDragAndDropActions() const { return m_supportedDndActions; } -void XwlDataSource::setSupportedDndActions(KWaylandServer::DataDeviceManagerInterface::DnDActions dndActions) +void XwlDataSource::setSupportedDndActions(DataDeviceManagerInterface::DnDActions dndActions) { m_supportedDndActions = dndActions; Q_EMIT supportedDragAndDropActionsChanged(); } -KWaylandServer::DataDeviceManagerInterface::DnDAction XwlDataSource::selectedDndAction() const +DataDeviceManagerInterface::DnDAction XwlDataSource::selectedDndAction() const { return m_dndAction; } -void XwlDataSource::dndAction(KWaylandServer::DataDeviceManagerInterface::DnDAction action) +void XwlDataSource::dndAction(DataDeviceManagerInterface::DnDAction action) { m_dndAction = action; } diff --git a/src/xwayland/datasource.h b/src/xwayland/datasource.h index 6696f1e663..2e517316f0 100644 --- a/src/xwayland/datasource.h +++ b/src/xwayland/datasource.h @@ -19,7 +19,7 @@ namespace Xwl * The XwlDataSource class is sealed as its destructor emits the aboutToBeDestroyed() signal. * If you decide to unseal it, ensure that the about to be destroyed signal is emitted properly! */ -class XwlDataSource final : public KWaylandServer::AbstractDataSource +class XwlDataSource final : public AbstractDataSource { Q_OBJECT @@ -32,11 +32,11 @@ public: void setMimeTypes(const QStringList &mimeTypes); void accept(const QString &mimeType) override; - KWaylandServer::DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override; - void setSupportedDndActions(KWaylandServer::DataDeviceManagerInterface::DnDActions dndActions); + DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override; + void setSupportedDndActions(DataDeviceManagerInterface::DnDActions dndActions); - KWaylandServer::DataDeviceManagerInterface::DnDAction selectedDndAction() const override; - void dndAction(KWaylandServer::DataDeviceManagerInterface::DnDAction action) override; + DataDeviceManagerInterface::DnDAction selectedDndAction() const override; + void dndAction(DataDeviceManagerInterface::DnDAction action) override; void dropPerformed() override { @@ -61,8 +61,8 @@ Q_SIGNALS: private: QStringList m_mimeTypes; - KWaylandServer::DataDeviceManagerInterface::DnDActions m_supportedDndActions; - KWaylandServer::DataDeviceManagerInterface::DnDAction m_dndAction = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDActions m_supportedDndActions; + DataDeviceManagerInterface::DnDAction m_dndAction = DataDeviceManagerInterface::DnDAction::None; bool m_accepted = false; }; } diff --git a/src/xwayland/dnd.cpp b/src/xwayland/dnd.cpp index 615f7d0f03..a2b5477be1 100644 --- a/src/xwayland/dnd.cpp +++ b/src/xwayland/dnd.cpp @@ -73,8 +73,8 @@ Dnd::Dnd(xcb_atom_t atom, QObject *parent) 32, 1, &s_version); xcb_flush(xcbConn); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragStarted, this, &Dnd::startDrag); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::dragEnded, this, &Dnd::endDrag); + connect(waylandServer()->seat(), &SeatInterface::dragStarted, this, &Dnd::startDrag); + connect(waylandServer()->seat(), &SeatInterface::dragEnded, this, &Dnd::endDrag); } void Dnd::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) @@ -154,7 +154,7 @@ void Dnd::startDrag() m_currentDrag = new WlToXDrag(this); auto source = new WlSource(this); source->setDataSourceIface(dragSource); - connect(dragSource, &KWaylandServer::AbstractDataSource::aboutToBeDestroyed, this, [this, source] { + connect(dragSource, &AbstractDataSource::aboutToBeDestroyed, this, [this, source] { if (source == wlSource()) { setWlSource(nullptr); } @@ -179,8 +179,8 @@ void Dnd::clearOldDrag(Drag *drag) delete drag; } -using DnDAction = KWaylandServer::DataDeviceManagerInterface::DnDAction; -using DnDActions = KWaylandServer::DataDeviceManagerInterface::DnDActions; +using DnDAction = DataDeviceManagerInterface::DnDAction; +using DnDActions = DataDeviceManagerInterface::DnDActions; DnDAction Dnd::atomToClientAction(xcb_atom_t atom) { diff --git a/src/xwayland/dnd.h b/src/xwayland/dnd.h index bd019b9512..b7a6881b0b 100644 --- a/src/xwayland/dnd.h +++ b/src/xwayland/dnd.h @@ -14,13 +14,9 @@ #include -namespace KWaylandServer -{ -class SurfaceInterface; -} - namespace KWin { +class SurfaceInterface; class Window; namespace Xwl @@ -51,8 +47,8 @@ public: DragEventReply dragMoveFilter(Window *target); - using DnDAction = KWaylandServer::DataDeviceManagerInterface::DnDAction; - using DnDActions = KWaylandServer::DataDeviceManagerInterface::DnDActions; + using DnDAction = DataDeviceManagerInterface::DnDAction; + using DnDActions = DataDeviceManagerInterface::DnDActions; static DnDAction atomToClientAction(xcb_atom_t atom); static xcb_atom_t clientActionToAtom(DnDAction action); diff --git a/src/xwayland/drag_wl.cpp b/src/xwayland/drag_wl.cpp index 9ddb68d4b2..74f203d673 100644 --- a/src/xwayland/drag_wl.cpp +++ b/src/xwayland/drag_wl.cpp @@ -27,8 +27,8 @@ #include #include -using DnDAction = KWaylandServer::DataDeviceManagerInterface::DnDAction; -using DnDActions = KWaylandServer::DataDeviceManagerInterface::DnDActions; +using DnDAction = KWin::DataDeviceManagerInterface::DnDAction; +using DnDActions = KWin::DataDeviceManagerInterface::DnDActions; namespace KWin { @@ -50,7 +50,7 @@ bool WlToXDrag::handleClientMessage(xcb_client_message_event_t *event) return m_dnd->dropHandler()->handleClientMessage(event); } -Xvisit::Xvisit(X11Window *target, KWaylandServer::AbstractDataSource *dataSource, Dnd *dnd, QObject *parent) +Xvisit::Xvisit(X11Window *target, AbstractDataSource *dataSource, Dnd *dnd, QObject *parent) : QObject(parent) , m_dnd(dnd) , m_target(target) @@ -197,7 +197,7 @@ void Xvisit::leave() void Xvisit::receiveOffer() { retrieveSupportedActions(); - connect(m_dataSource, &KWaylandServer::AbstractDataSource::supportedDragAndDropActionsChanged, + connect(m_dataSource, &AbstractDataSource::supportedDragAndDropActionsChanged, this, &Xvisit::retrieveSupportedActions); enter(); } @@ -211,7 +211,7 @@ void Xvisit::enter() // proxy future pointer position changes m_motionConnection = connect(waylandServer()->seat(), - &KWaylandServer::SeatInterface::pointerPosChanged, + &SeatInterface::pointerPosChanged, this, &Xvisit::sendPosition); } diff --git a/src/xwayland/drag_wl.h b/src/xwayland/drag_wl.h index f24db20eb1..7811e2f2db 100644 --- a/src/xwayland/drag_wl.h +++ b/src/xwayland/drag_wl.h @@ -16,15 +16,11 @@ #include #include -namespace KWaylandServer +namespace KWin { class DataDeviceInterface; class DataSourceInterface; class SurfaceInterface; -} - -namespace KWin -{ class Window; class X11Window; @@ -58,7 +54,7 @@ class Xvisit : public QObject public: // TODO: handle ask action - Xvisit(X11Window *target, KWaylandServer::AbstractDataSource *dataSource, Dnd *dnd, QObject *parent); + Xvisit(X11Window *target, AbstractDataSource *dataSource, Dnd *dnd, QObject *parent); bool handleClientMessage(xcb_client_message_event_t *event); bool handleStatus(xcb_client_message_event_t *event); @@ -97,7 +93,7 @@ private: Dnd *const m_dnd; X11Window *m_target; - QPointer m_dataSource; + QPointer m_dataSource; uint32_t m_version = 0; QMetaObject::Connection m_motionConnection; @@ -110,11 +106,11 @@ private: } m_pos; // supported by the Wl source - KWaylandServer::DataDeviceManagerInterface::DnDActions m_supportedActions = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDActions m_supportedActions = DataDeviceManagerInterface::DnDAction::None; // preferred by the X client - KWaylandServer::DataDeviceManagerInterface::DnDAction m_preferredAction = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDAction m_preferredAction = DataDeviceManagerInterface::DnDAction::None; // decided upon by the compositor - KWaylandServer::DataDeviceManagerInterface::DnDAction m_proposedAction = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDAction m_proposedAction = DataDeviceManagerInterface::DnDAction::None; struct { diff --git a/src/xwayland/drag_x.cpp b/src/xwayland/drag_x.cpp index a22a78e8bd..27fad37167 100644 --- a/src/xwayland/drag_x.cpp +++ b/src/xwayland/drag_x.cpp @@ -33,8 +33,8 @@ namespace KWin namespace Xwl { -using DnDAction = KWaylandServer::DataDeviceManagerInterface::DnDAction; -using DnDActions = KWaylandServer::DataDeviceManagerInterface::DnDActions; +using DnDAction = KWin::DataDeviceManagerInterface::DnDAction; +using DnDActions = KWin::DataDeviceManagerInterface::DnDActions; static QStringList atomToMimeTypes(xcb_atom_t atom) { diff --git a/src/xwayland/drag_x.h b/src/xwayland/drag_x.h index 7abb77bde0..7c55e75d82 100644 --- a/src/xwayland/drag_x.h +++ b/src/xwayland/drag_x.h @@ -41,8 +41,8 @@ public: DragEventReply moveFilter(Window *target) override; bool handleClientMessage(xcb_client_message_event_t *event) override; - void setDragAndDropAction(KWaylandServer::DataDeviceManagerInterface::DnDAction action); - KWaylandServer::DataDeviceManagerInterface::DnDAction selectedDragAndDropAction(); + void setDragAndDropAction(DataDeviceManagerInterface::DnDAction action); + DataDeviceManagerInterface::DnDAction selectedDragAndDropAction(); X11Source *x11Source() const { @@ -67,7 +67,7 @@ private: QVector m_oldVisits; bool m_performed = false; - KWaylandServer::DataDeviceManagerInterface::DnDAction m_lastSelectedDragAndDropAction = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDAction m_lastSelectedDragAndDropAction = DataDeviceManagerInterface::DnDAction::None; Q_DISABLE_COPY(XToWlDrag) }; @@ -134,7 +134,7 @@ private: uint32_t m_version = 0; xcb_atom_t m_actionAtom; - KWaylandServer::DataDeviceManagerInterface::DnDAction m_action = KWaylandServer::DataDeviceManagerInterface::DnDAction::None; + DataDeviceManagerInterface::DnDAction m_action = DataDeviceManagerInterface::DnDAction::None; bool m_mapped = false; bool m_entered = false; diff --git a/src/xwayland/primary.cpp b/src/xwayland/primary.cpp index 098f451174..ab73c24258 100644 --- a/src/xwayland/primary.cpp +++ b/src/xwayland/primary.cpp @@ -47,13 +47,13 @@ Primary::Primary(xcb_atom_t atom, QObject *parent) registerXfixes(); xcb_flush(xcbConn); - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::primarySelectionChanged, + connect(waylandServer()->seat(), &SeatInterface::primarySelectionChanged, this, &Primary::wlPrimarySelectionChanged); } Primary::~Primary() = default; -void Primary::wlPrimarySelectionChanged(KWaylandServer::AbstractDataSource *dsi) +void Primary::wlPrimarySelectionChanged(AbstractDataSource *dsi) { if (m_waitingForTargets) { return; @@ -71,7 +71,7 @@ void Primary::wlPrimarySelectionChanged(KWaylandServer::AbstractDataSource *dsi) checkWlSource(); } -bool Primary::ownsSelection(KWaylandServer::AbstractDataSource *dsi) const +bool Primary::ownsSelection(AbstractDataSource *dsi) const { return dsi && dsi == m_primarySelectionSource.get(); } @@ -106,7 +106,7 @@ void Primary::checkWlSource() removeSource(); return; } - if (!qobject_cast(workspace()->activeWindow())) { + if (!qobject_cast(workspace()->activeWindow())) { // no active window or active window is Wayland native removeSource(); return; @@ -173,7 +173,7 @@ void Primary::x11OffersChanged(const QStringList &added, const QStringList &remo std::swap(m_primarySelectionSource, newSelection); waylandServer()->seat()->setPrimarySelection(m_primarySelectionSource.get()); } else { - KWaylandServer::AbstractDataSource *currentSelection = waylandServer()->seat()->primarySelection(); + AbstractDataSource *currentSelection = waylandServer()->seat()->primarySelection(); if (!ownsSelection(currentSelection)) { waylandServer()->seat()->setPrimarySelection(nullptr); m_primarySelectionSource.reset(); diff --git a/src/xwayland/primary.h b/src/xwayland/primary.h index 16d3195716..375eed6e8f 100644 --- a/src/xwayland/primary.h +++ b/src/xwayland/primary.h @@ -13,13 +13,10 @@ #include -namespace KWaylandServer +namespace KWin { class AbstractDataSource; -} -namespace KWin -{ namespace Xwl { class XwlDataSource; @@ -43,7 +40,7 @@ private: /** * React to Wl selection change. */ - void wlPrimarySelectionChanged(KWaylandServer::AbstractDataSource *dsi); + void wlPrimarySelectionChanged(AbstractDataSource *dsi); /** * Check the current state of the selection and if a source needs * to be created or destroyed. @@ -53,7 +50,7 @@ private: /** * Returns if dsi is managed by our data bridge */ - bool ownsSelection(KWaylandServer::AbstractDataSource *dsi) const; + bool ownsSelection(AbstractDataSource *dsi) const; QMetaObject::Connection m_checkConnection; diff --git a/src/xwayland/selection_source.cpp b/src/xwayland/selection_source.cpp index d499cb7f99..d4fbed6ca1 100644 --- a/src/xwayland/selection_source.cpp +++ b/src/xwayland/selection_source.cpp @@ -38,7 +38,7 @@ WlSource::WlSource(Selection *selection) { } -void WlSource::setDataSourceIface(KWaylandServer::AbstractDataSource *dsi) +void WlSource::setDataSourceIface(AbstractDataSource *dsi) { if (m_dsi == dsi) { return; @@ -50,7 +50,7 @@ void WlSource::setDataSourceIface(KWaylandServer::AbstractDataSource *dsi) // TODO, this can probably be removed after some testing // all mime types should be constant after a data source is set m_offerConnection = connect(dsi, - &KWaylandServer::DataSourceInterface::mimeTypeOffered, + &DataSourceInterface::mimeTypeOffered, this, &WlSource::receiveOffer); m_dsi = dsi; diff --git a/src/xwayland/selection_source.h b/src/xwayland/selection_source.h index df2fa7c636..89a9a591e7 100644 --- a/src/xwayland/selection_source.h +++ b/src/xwayland/selection_source.h @@ -18,15 +18,12 @@ class QSocketNotifier; struct xcb_selection_request_event_t; struct xcb_xfixes_selection_notify_event_t; -namespace KWaylandServer +namespace KWin { class DataDeviceInterface; class DataSourceInterface; class AbstractDataSource; -} -namespace KWin -{ namespace Xwl { class Selection; @@ -81,7 +78,7 @@ class WlSource : public SelectionSource public: WlSource(Selection *selection); - void setDataSourceIface(KWaylandServer::AbstractDataSource *dsi); + void setDataSourceIface(AbstractDataSource *dsi); bool handleSelectionRequest(xcb_selection_request_event_t *event); void sendTargets(xcb_selection_request_event_t *event); @@ -96,7 +93,7 @@ Q_SIGNALS: private: bool checkStartTransfer(xcb_selection_request_event_t *event); - KWaylandServer::AbstractDataSource *m_dsi = nullptr; + AbstractDataSource *m_dsi = nullptr; QVector m_offers; QMetaObject::Connection m_offerConnection; diff --git a/src/xwayland/transfer.h b/src/xwayland/transfer.h index 4c7cf304b3..6f47f37e89 100644 --- a/src/xwayland/transfer.h +++ b/src/xwayland/transfer.h @@ -22,13 +22,10 @@ class DataDevice; class DataSource; } } -namespace KWaylandServer +namespace KWin { class DataDeviceInterface; -} -namespace KWin -{ namespace Xwl { diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index 1f07cae7dc..ec2c9bf65e 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -87,8 +87,8 @@ class XwaylandInputSpy : public QObject, public KWin::InputEventSpy public: XwaylandInputSpy() { - connect(waylandServer()->seat(), &KWaylandServer::SeatInterface::focusedKeyboardSurfaceAboutToChange, - this, [this](KWaylandServer::SurfaceInterface *newSurface) { + connect(waylandServer()->seat(), &SeatInterface::focusedKeyboardSurfaceAboutToChange, + this, [this](SurfaceInterface *newSurface) { auto keyboard = waylandServer()->seat()->keyboard(); if (!newSurface) { return; @@ -100,8 +100,8 @@ public: // This loop makes sure all key press events are reset before we switch back to the // Xwayland client and the state is correctly restored. for (auto it = m_states.constBegin(); it != m_states.constEnd(); ++it) { - if (it.value() == KWaylandServer::KeyboardKeyState::Pressed) { - keyboard->sendKey(it.key(), KWaylandServer::KeyboardKeyState::Released, waylandServer()->xWaylandConnection()); + if (it.value() == KeyboardKeyState::Pressed) { + keyboard->sendKey(it.key(), KeyboardKeyState::Released, waylandServer()->xWaylandConnection()); } } m_states.clear(); @@ -157,10 +157,10 @@ public: return; } - KWaylandServer::ClientConnection *client = surface->client(); - KWaylandServer::ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection(); + ClientConnection *client = surface->client(); + ClientConnection *xwaylandClient = waylandServer()->xWaylandConnection(); if (xwaylandClient && xwaylandClient != client) { - KWaylandServer::KeyboardKeyState state{event->type() == QEvent::KeyPress}; + KeyboardKeyState state{event->type() == QEvent::KeyPress}; if (!updateKey(event->nativeScanCode(), state)) { return; } @@ -175,7 +175,7 @@ public: } } - bool updateKey(quint32 key, KWaylandServer::KeyboardKeyState state) + bool updateKey(quint32 key, KeyboardKeyState state) { auto it = m_states.find(key); if (it == m_states.end()) { @@ -189,7 +189,7 @@ public: return true; } - QHash m_states; + QHash m_states; std::function m_filter; }; @@ -456,7 +456,7 @@ DragEventReply Xwayland::dragMoveFilter(Window *target) } } -KWaylandServer::AbstractDropHandler *Xwayland::xwlDropHandler() +AbstractDropHandler *Xwayland::xwlDropHandler() { if (m_dataBridge) { return m_dataBridge->dnd()->dropHandler(); diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h index b5d92d36f3..1ebd8da925 100644 --- a/src/xwayland/xwayland.h +++ b/src/xwayland/xwayland.h @@ -80,7 +80,7 @@ private: void destroyX11Connection(); DragEventReply dragMoveFilter(Window *target) override; - KWaylandServer::AbstractDropHandler *xwlDropHandler() override; + AbstractDropHandler *xwlDropHandler() override; QSocketNotifier *m_socketNotifier = nullptr; Application *m_app; diff --git a/src/xwayland/xwayland_interface.h b/src/xwayland/xwayland_interface.h index 655af2e3b8..043b49da03 100644 --- a/src/xwayland/xwayland_interface.h +++ b/src/xwayland/xwayland_interface.h @@ -14,13 +14,9 @@ class QProcess; -namespace KWaylandServer -{ -class AbstractDropHandler; -} - namespace KWin { +class AbstractDropHandler; class Window; namespace Xwl @@ -39,7 +35,7 @@ class KWIN_EXPORT XwaylandInterface { public: virtual Xwl::DragEventReply dragMoveFilter(Window *target) = 0; - virtual KWaylandServer::AbstractDropHandler *xwlDropHandler() = 0; + virtual AbstractDropHandler *xwlDropHandler() = 0; protected: explicit XwaylandInterface() = default; diff --git a/src/xwayland/xwldrophandler.cpp b/src/xwayland/xwldrophandler.cpp index f58c558601..f21d0c92cc 100644 --- a/src/xwayland/xwldrophandler.cpp +++ b/src/xwayland/xwldrophandler.cpp @@ -21,7 +21,7 @@ namespace KWin::Xwl { XwlDropHandler::XwlDropHandler(Dnd *dnd) - : KWaylandServer::AbstractDropHandler(dnd) + : AbstractDropHandler(dnd) , m_dnd(dnd) { } @@ -47,7 +47,7 @@ bool XwlDropHandler::handleClientMessage(xcb_client_message_event_t *event) return false; } -void XwlDropHandler::updateDragTarget(KWaylandServer::SurfaceInterface *surface, quint32 serial) +void XwlDropHandler::updateDragTarget(SurfaceInterface *surface, quint32 serial) { auto client = workspace()->findClient([surface](const X11Window *c) { return c->surface() == surface; diff --git a/src/xwayland/xwldrophandler.h b/src/xwayland/xwldrophandler.h index 15c53f6698..3826e7fa16 100644 --- a/src/xwayland/xwldrophandler.h +++ b/src/xwayland/xwldrophandler.h @@ -22,13 +22,13 @@ namespace Xwl class Xvisit; class Dnd; -class XwlDropHandler : public KWaylandServer::AbstractDropHandler +class XwlDropHandler : public AbstractDropHandler { Q_OBJECT public: XwlDropHandler(Dnd *dnd); - void updateDragTarget(KWaylandServer::SurfaceInterface *surface, quint32 serial) override; + void updateDragTarget(SurfaceInterface *surface, quint32 serial) override; bool handleClientMessage(xcb_client_message_event_t *event); private: