From 68c675d00d668187a5d8ff99a1adf5895745d180 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 9 Feb 2021 20:18:36 +0200 Subject: [PATCH] Make source code more relocatable Occasionally, I see complaints about the file organization of kwin, which is fair enough. This change makes the source code more relocatable by removing relative paths from includes. CMAKE_CURRENT_SOURCE_DIR was added to the interface include directories of kwin library. This means that as long as you link against kwin target, the real location of the source code of the library doesn't matter. With autotests, things are not as convenient as with kwin target. Some tests use cpp files from kwin core. If we move all source code in a src/ directory, they will need to be adjusted, but mostly only in build scripts. --- autotests/integration/kwin_wayland_test.cpp | 19 +++++++-------- autotests/integration/kwin_wayland_test.h | 2 +- .../integration/xwayland_selections_test.cpp | 2 +- autotests/libinput/CMakeLists.txt | 1 + autotests/libinput/context_test.cpp | 6 +++-- autotests/libinput/device_test.cpp | 2 +- autotests/libinput/gesture_event_test.cpp | 5 ++-- autotests/libinput/input_event_test.cpp | 5 ++-- autotests/libinput/key_event_test.cpp | 5 ++-- autotests/libinput/mock_udev.cpp | 3 ++- autotests/libinput/pointer_event_test.cpp | 5 ++-- autotests/libinput/switch_event_test.cpp | 5 ++-- autotests/libinput/touch_event_test.cpp | 5 ++-- .../libxrenderutils/blendpicture_test.cpp | 3 ++- autotests/mock_screens.h | 2 +- autotests/onscreennotificationtest.cpp | 5 ++-- .../opengl_context_attribute_builder_test.cpp | 4 ++-- autotests/tabbox/mock_tabboxclient.h | 2 +- autotests/tabbox/mock_tabboxhandler.h | 2 +- autotests/tabbox/test_desktopchain.cpp | 2 +- autotests/tabbox/test_tabbox_config.cpp | 2 +- autotests/test_builtin_effectloader.cpp | 6 ++--- autotests/test_client_machine.cpp | 4 ++-- autotests/test_gestures.cpp | 2 +- autotests/test_plugin_effectloader.cpp | 4 ++-- autotests/test_screen_edges.cpp | 23 ++++++++++--------- autotests/test_scripted_effectloader.cpp | 10 ++++---- autotests/test_virtual_desktops.cpp | 4 ++-- autotests/test_virtualkeyboard_dbus.cpp | 2 +- autotests/test_window_paint_data.cpp | 3 ++- autotests/test_xcb_size_hints.cpp | 2 +- autotests/test_xcb_window.cpp | 2 +- autotests/test_xcb_wrapper.cpp | 2 +- autotests/test_xkb.cpp | 2 +- libinput/connection.cpp | 18 +++++++-------- libinput/connection.h | 5 ++-- libinput/context.cpp | 5 ++-- libinput/events.h | 2 +- platformsupport/scenes/opengl/egl_dmabuf.cpp | 4 ++-- platformsupport/scenes/opengl/egl_dmabuf.h | 4 ++-- plugins/idletime/poller.cpp | 2 +- plugins/kglobalaccel/kglobalaccel_plugin.cpp | 3 ++- .../x11/standalone/overlaywindow_x11.h | 4 ++-- plugins/qpa/integration.cpp | 9 ++++---- plugins/qpa/platformcursor.cpp | 2 +- plugins/windowsystem/windoweffects.cpp | 2 +- scripting/scriptedeffect.cpp | 5 ++-- scripting/scripting.cpp | 9 ++++---- scripting/workspace_wrapper.cpp | 12 +++++----- tests/CMakeLists.txt | 3 +++ tests/libinputtest.cpp | 8 +++---- tests/screenedgeshowtest.cpp | 3 ++- tests/x11shadowreader.cpp | 3 ++- 53 files changed, 141 insertions(+), 115 deletions(-) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index 3e0ed8308e..87753f52a3 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -7,15 +7,16 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kwin_wayland_test.h" -#include "../../platform.h" -#include "../../pluginmanager.h" -#include "../../composite.h" -#include "../../effects.h" -#include "../../wayland_server.h" -#include "../../workspace.h" -#include "../../xcbutils.h" -#include "../../xwl/xwayland.h" -#include "../../inputmethod.h" + +#include "composite.h" +#include "effects.h" +#include "inputmethod.h" +#include "platform.h" +#include "pluginmanager.h" +#include "wayland_server.h" +#include "workspace.h" +#include "xcbutils.h" +#include "xwl/xwayland.h" #include diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index 6a494b7510..fd28ce8e45 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -9,7 +9,7 @@ #ifndef KWIN_WAYLAND_TEST_H #define KWIN_WAYLAND_TEST_H -#include "../../main.h" +#include "main.h" // Qt #include diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp index 4b0486dabd..a830332c33 100644 --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -13,7 +13,7 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "../../xwl/databridge.h" +#include "xwl/databridge.h" #include diff --git a/autotests/libinput/CMakeLists.txt b/autotests/libinput/CMakeLists.txt index 318f8d9558..f53ff60347 100644 --- a/autotests/libinput/CMakeLists.txt +++ b/autotests/libinput/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories(${Libinput_INCLUDE_DIRS}) add_library(LibInputTestObjects STATIC ../../libinput/device.cpp ../../libinput/events.cpp mock_libinput.cpp) target_link_libraries(LibInputTestObjects Qt::Test Qt::Widgets Qt::DBus Qt::Gui KF5::ConfigCore) +target_include_directories(LibInputTestObjects PUBLIC ${CMAKE_SOURCE_DIR}) ######################################################## # Test Devices diff --git a/autotests/libinput/context_test.cpp b/autotests/libinput/context_test.cpp index fbb1f56fb5..e7551430b6 100644 --- a/autotests/libinput/context_test.cpp +++ b/autotests/libinput/context_test.cpp @@ -8,8 +8,10 @@ */ #include "mock_libinput.h" #include "mock_udev.h" -#include "../../libinput/context.h" -#include "../../udev.h" + +#include "libinput/context.h" +#include "udev.h" + #include Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtWarningMsg) diff --git a/autotests/libinput/device_test.cpp b/autotests/libinput/device_test.cpp index f4c08f34ef..ccf1e996fb 100644 --- a/autotests/libinput/device_test.cpp +++ b/autotests/libinput/device_test.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" +#include "libinput/device.h" #include #include diff --git a/autotests/libinput/gesture_event_test.cpp b/autotests/libinput/gesture_event_test.cpp index 972bbae2c1..fcd4ad76cb 100644 --- a/autotests/libinput/gesture_event_test.cpp +++ b/autotests/libinput/gesture_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../../libinput/events.h" + +#include "libinput/device.h" +#include "libinput/events.h" #include diff --git a/autotests/libinput/input_event_test.cpp b/autotests/libinput/input_event_test.cpp index 4f918dd133..d75d446392 100644 --- a/autotests/libinput/input_event_test.cpp +++ b/autotests/libinput/input_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../input_event.h" + +#include "libinput/device.h" +#include "input_event.h" #include diff --git a/autotests/libinput/key_event_test.cpp b/autotests/libinput/key_event_test.cpp index b234b3858e..1be840e30b 100644 --- a/autotests/libinput/key_event_test.cpp +++ b/autotests/libinput/key_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../../libinput/events.h" + +#include "libinput/device.h" +#include "libinput/events.h" #include diff --git a/autotests/libinput/mock_udev.cpp b/autotests/libinput/mock_udev.cpp index 2548d66877..291ee1944a 100644 --- a/autotests/libinput/mock_udev.cpp +++ b/autotests/libinput/mock_udev.cpp @@ -6,7 +6,8 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../../udev.h" +#include "udev.h" + #include "mock_udev.h" udev *udev::s_mockUdev = nullptr; diff --git a/autotests/libinput/pointer_event_test.cpp b/autotests/libinput/pointer_event_test.cpp index d0d16c9087..9e363f9b43 100644 --- a/autotests/libinput/pointer_event_test.cpp +++ b/autotests/libinput/pointer_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../../libinput/events.h" + +#include "libinput/device.h" +#include "libinput/events.h" #include diff --git a/autotests/libinput/switch_event_test.cpp b/autotests/libinput/switch_event_test.cpp index f057baa888..38a35d43f0 100644 --- a/autotests/libinput/switch_event_test.cpp +++ b/autotests/libinput/switch_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../../libinput/events.h" + +#include "libinput/device.h" +#include "libinput/events.h" #include diff --git a/autotests/libinput/touch_event_test.cpp b/autotests/libinput/touch_event_test.cpp index 0068a46df0..e78efc8472 100644 --- a/autotests/libinput/touch_event_test.cpp +++ b/autotests/libinput/touch_event_test.cpp @@ -7,8 +7,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "mock_libinput.h" -#include "../../libinput/device.h" -#include "../../libinput/events.h" + +#include "libinput/device.h" +#include "libinput/events.h" #include diff --git a/autotests/libxrenderutils/blendpicture_test.cpp b/autotests/libxrenderutils/blendpicture_test.cpp index 9b04757624..09009df624 100644 --- a/autotests/libxrenderutils/blendpicture_test.cpp +++ b/autotests/libxrenderutils/blendpicture_test.cpp @@ -11,7 +11,8 @@ #include #include "../testutils.h" -#include "../../libkwineffects/kwinxrenderutils.h" + +#include "kwinxrenderutils.h" class BlendPictureTest : public QObject { diff --git a/autotests/mock_screens.h b/autotests/mock_screens.h index 7d37dd7c5e..a6b2da3c46 100644 --- a/autotests/mock_screens.h +++ b/autotests/mock_screens.h @@ -9,7 +9,7 @@ #ifndef KWIN_MOCK_SCREENS_H #define KWIN_MOCK_SCREENS_H -#include "../screens.h" +#include "screens.h" namespace KWin { diff --git a/autotests/onscreennotificationtest.cpp b/autotests/onscreennotificationtest.cpp index 6ea01d135e..8bf994ca26 100644 --- a/autotests/onscreennotificationtest.cpp +++ b/autotests/onscreennotificationtest.cpp @@ -6,8 +6,9 @@ */ #include "onscreennotificationtest.h" -#include "../onscreennotification.h" -#include "../input.h" + +#include "onscreennotification.h" +#include "input.h" #include #include diff --git a/autotests/opengl_context_attribute_builder_test.cpp b/autotests/opengl_context_attribute_builder_test.cpp index 8128765e36..7a3b9b32d4 100644 --- a/autotests/opengl_context_attribute_builder_test.cpp +++ b/autotests/opengl_context_attribute_builder_test.cpp @@ -6,8 +6,8 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../abstract_opengl_context_attribute_builder.h" -#include "../egl_context_attribute_builder.h" +#include "abstract_opengl_context_attribute_builder.h" +#include "egl_context_attribute_builder.h" #include #include diff --git a/autotests/tabbox/mock_tabboxclient.h b/autotests/tabbox/mock_tabboxclient.h index 3d4c42e02d..d8a62a7edc 100644 --- a/autotests/tabbox/mock_tabboxclient.h +++ b/autotests/tabbox/mock_tabboxclient.h @@ -9,7 +9,7 @@ #ifndef KWIN_MOCK_TABBOX_CLIENT_H #define KWIN_MOCK_TABBOX_CLIENT_H -#include "../../tabbox/tabboxhandler.h" +#include "tabbox/tabboxhandler.h" #include #include diff --git a/autotests/tabbox/mock_tabboxhandler.h b/autotests/tabbox/mock_tabboxhandler.h index 0a3ebd8518..719d899e2a 100644 --- a/autotests/tabbox/mock_tabboxhandler.h +++ b/autotests/tabbox/mock_tabboxhandler.h @@ -9,7 +9,7 @@ #ifndef KWIN_MOCK_TABBOX_HANDLER_H #define KWIN_MOCK_TABBOX_HANDLER_H -#include "../../tabbox/tabboxhandler.h" +#include "tabbox/tabboxhandler.h" namespace KWin { class MockTabBoxHandler : public TabBox::TabBoxHandler diff --git a/autotests/tabbox/test_desktopchain.cpp b/autotests/tabbox/test_desktopchain.cpp index 7841635f52..c758d82606 100644 --- a/autotests/tabbox/test_desktopchain.cpp +++ b/autotests/tabbox/test_desktopchain.cpp @@ -8,7 +8,7 @@ */ // KWin -#include "../../tabbox/desktopchain.h" +#include "tabbox/desktopchain.h" #include diff --git a/autotests/tabbox/test_tabbox_config.cpp b/autotests/tabbox/test_tabbox_config.cpp index f5e197fe79..452dfd8bd9 100644 --- a/autotests/tabbox/test_tabbox_config.cpp +++ b/autotests/tabbox/test_tabbox_config.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../../tabbox/tabboxconfig.h" +#include "tabbox/tabboxconfig.h" #include using namespace KWin; using namespace KWin::TabBox; diff --git a/autotests/test_builtin_effectloader.cpp b/autotests/test_builtin_effectloader.cpp index 219965dec8..a643969351 100644 --- a/autotests/test_builtin_effectloader.cpp +++ b/autotests/test_builtin_effectloader.cpp @@ -6,10 +6,10 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../effectloader.h" -#include "../effects/effect_builtins.h" +#include "effectloader.h" +#include "effects/effect_builtins.h" #include "mock_effectshandler.h" -#include "../scripting/scriptedeffect.h" // for mocking ScriptedEffect::create +#include "scripting/scriptedeffect.h" // for mocking ScriptedEffect::create #include "testutils.h" // KDE #include diff --git a/autotests/test_client_machine.cpp b/autotests/test_client_machine.cpp index bf400d5f46..d057bfc720 100644 --- a/autotests/test_client_machine.cpp +++ b/autotests/test_client_machine.cpp @@ -8,8 +8,8 @@ */ #include "testutils.h" // KWin -#include "../client_machine.h" -#include "../xcbutils.h" +#include "client_machine.h" +#include "xcbutils.h" // Qt #include #include diff --git a/autotests/test_gestures.cpp b/autotests/test_gestures.cpp index a01f494174..c499c1d6b7 100644 --- a/autotests/test_gestures.cpp +++ b/autotests/test_gestures.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../gestures.h" +#include "gestures.h" #include #include diff --git a/autotests/test_plugin_effectloader.cpp b/autotests/test_plugin_effectloader.cpp index 1bdc958cea..1dccad1344 100644 --- a/autotests/test_plugin_effectloader.cpp +++ b/autotests/test_plugin_effectloader.cpp @@ -6,9 +6,9 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../effectloader.h" +#include "effectloader.h" #include "mock_effectshandler.h" -#include "../scripting/scriptedeffect.h" // for mocking ScriptedEffect::create +#include "scripting/scriptedeffect.h" // for mocking ScriptedEffect::create // KDE #include #include diff --git a/autotests/test_screen_edges.cpp b/autotests/test_screen_edges.cpp index ac088e12e4..79658e8d5f 100644 --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -7,17 +7,18 @@ SPDX-License-Identifier: GPL-2.0-or-later */ // kwin -#include "../atoms.h" -#include "../cursor.h" -#include "../input.h" -#include "../gestures.h" -#include "../main.h" -#include "../screenedge.h" -#include "../screens.h" -#include "../utils.h" -#include "../virtualdesktops.h" -#include "../xcbutils.h" -#include "../platform.h" +#include "atoms.h" +#include "cursor.h" +#include "input.h" +#include "gestures.h" +#include "main.h" +#include "screenedge.h" +#include "screens.h" +#include "utils.h" +#include "virtualdesktops.h" +#include "xcbutils.h" +#include "platform.h" + #include "mock_screens.h" #include "mock_workspace.h" #include "mock_x11client.h" diff --git a/autotests/test_scripted_effectloader.cpp b/autotests/test_scripted_effectloader.cpp index d0b72f5244..b3afd95170 100644 --- a/autotests/test_scripted_effectloader.cpp +++ b/autotests/test_scripted_effectloader.cpp @@ -6,13 +6,13 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../effectloader.h" +#include "effectloader.h" #include "mock_effectshandler.h" -#include "../scripting/scriptedeffect.h" +#include "scripting/scriptedeffect.h" // for mocking -#include "../cursor.h" -#include "../input.h" -#include "../screenedge.h" +#include "cursor.h" +#include "input.h" +#include "screenedge.h" // KDE #include #include diff --git a/autotests/test_virtual_desktops.cpp b/autotests/test_virtual_desktops.cpp index 7af34e7df7..73bc05e634 100644 --- a/autotests/test_virtual_desktops.cpp +++ b/autotests/test_virtual_desktops.cpp @@ -6,8 +6,8 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../virtualdesktops.h" -#include "../input.h" +#include "input.h" +#include "virtualdesktops.h" // KDE #include diff --git a/autotests/test_virtualkeyboard_dbus.cpp b/autotests/test_virtualkeyboard_dbus.cpp index 54d7a745ef..3803562d28 100644 --- a/autotests/test_virtualkeyboard_dbus.cpp +++ b/autotests/test_virtualkeyboard_dbus.cpp @@ -12,7 +12,7 @@ #include #include -#include "../virtualkeyboard_dbus.h" +#include "virtualkeyboard_dbus.h" using KWin::VirtualKeyboardDBus; diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp index 1f457d82a7..8545a08c05 100644 --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -8,7 +8,8 @@ */ #include -#include "../virtualdesktops.h" + +#include "virtualdesktops.h" #include #include diff --git a/autotests/test_xcb_size_hints.cpp b/autotests/test_xcb_size_hints.cpp index 4be7a8ef4a..c8dd001ffb 100644 --- a/autotests/test_xcb_size_hints.cpp +++ b/autotests/test_xcb_size_hints.cpp @@ -8,7 +8,7 @@ */ #include "testutils.h" // KWin -#include "../xcbutils.h" +#include "xcbutils.h" // Qt #include #include diff --git a/autotests/test_xcb_window.cpp b/autotests/test_xcb_window.cpp index 321cb658b7..a419458f5a 100644 --- a/autotests/test_xcb_window.cpp +++ b/autotests/test_xcb_window.cpp @@ -8,7 +8,7 @@ */ #include "testutils.h" // KWin -#include "../xcbutils.h" +#include "xcbutils.h" // Qt #include #include diff --git a/autotests/test_xcb_wrapper.cpp b/autotests/test_xcb_wrapper.cpp index f7324177ff..762270287d 100644 --- a/autotests/test_xcb_wrapper.cpp +++ b/autotests/test_xcb_wrapper.cpp @@ -8,7 +8,7 @@ */ #include "testutils.h" // KWin -#include "../xcbutils.h" +#include "xcbutils.h" // Qt #include #include diff --git a/autotests/test_xkb.cpp b/autotests/test_xkb.cpp index 031e7b5fa5..da9c24ca9e 100644 --- a/autotests/test_xkb.cpp +++ b/autotests/test_xkb.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ -#include "../xkb.h" +#include "xkb.h" #include #include diff --git a/libinput/connection.cpp b/libinput/connection.cpp index cfec8c7829..6a7b5c3e5f 100644 --- a/libinput/connection.cpp +++ b/libinput/connection.cpp @@ -13,17 +13,17 @@ // TODO: Make it compile also in testing environment #ifndef KWIN_BUILD_TESTING -#include "../abstract_wayland_output.h" -#include "../main.h" -#include "../platform.h" -#include "../workspace.h" -#include "../abstract_client.h" -#include "../screens.h" +#include "abstract_wayland_output.h" +#include "main.h" +#include "platform.h" +#include "workspace.h" +#include "abstract_client.h" +#include "screens.h" #endif -#include "../input_event.h" -#include "../logind.h" -#include "../udev.h" +#include "input_event.h" +#include "logind.h" +#include "udev.h" #include "libinput_logging.h" #include diff --git a/libinput/connection.h b/libinput/connection.h index bc79d94faa..61dbd24888 100644 --- a/libinput/connection.h +++ b/libinput/connection.h @@ -9,10 +9,11 @@ #ifndef KWIN_LIBINPUT_CONNECTION_H #define KWIN_LIBINPUT_CONNECTION_H -#include "../input.h" -#include "../keyboard_input.h" #include +#include "input.h" +#include "keyboard_input.h" + #include #include #include diff --git a/libinput/context.cpp b/libinput/context.cpp index 00aa984900..9fbaa5438c 100644 --- a/libinput/context.cpp +++ b/libinput/context.cpp @@ -9,8 +9,9 @@ #include "context.h" #include "events.h" #include "libinput_logging.h" -#include "../logind.h" -#include "../udev.h" + +#include "logind.h" +#include "udev.h" #include #include diff --git a/libinput/events.h b/libinput/events.h index 1fdb2082fe..1e207b0573 100644 --- a/libinput/events.h +++ b/libinput/events.h @@ -9,7 +9,7 @@ #ifndef KWIN_LIBINPUT_EVENTS_H #define KWIN_LIBINPUT_EVENTS_H -#include "../input.h" +#include "input.h" #include diff --git a/platformsupport/scenes/opengl/egl_dmabuf.cpp b/platformsupport/scenes/opengl/egl_dmabuf.cpp index 45d325161d..09e948f096 100644 --- a/platformsupport/scenes/opengl/egl_dmabuf.cpp +++ b/platformsupport/scenes/opengl/egl_dmabuf.cpp @@ -8,10 +8,10 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "egl_dmabuf.h" - #include "drm_fourcc.h" #include "kwineglext.h" -#include "../../../wayland_server.h" + +#include "wayland_server.h" #include diff --git a/platformsupport/scenes/opengl/egl_dmabuf.h b/platformsupport/scenes/opengl/egl_dmabuf.h index e08febecdd..977d2d728f 100644 --- a/platformsupport/scenes/opengl/egl_dmabuf.h +++ b/platformsupport/scenes/opengl/egl_dmabuf.h @@ -9,10 +9,10 @@ */ #pragma once -#include "../../../linux_dmabuf.h" - #include "abstract_egl_backend.h" +#include "linux_dmabuf.h" + #include namespace KWin diff --git a/plugins/idletime/poller.cpp b/plugins/idletime/poller.cpp index 6832728127..e2165e424e 100644 --- a/plugins/idletime/poller.cpp +++ b/plugins/idletime/poller.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "poller.h" -#include "../../wayland_server.h" +#include "wayland_server.h" #include #include diff --git a/plugins/kglobalaccel/kglobalaccel_plugin.cpp b/plugins/kglobalaccel/kglobalaccel_plugin.cpp index b7f9dee198..17a5ec92f4 100644 --- a/plugins/kglobalaccel/kglobalaccel_plugin.cpp +++ b/plugins/kglobalaccel/kglobalaccel_plugin.cpp @@ -7,7 +7,8 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "kglobalaccel_plugin.h" -#include "../../input.h" + +#include "input.h" #include diff --git a/plugins/platforms/x11/standalone/overlaywindow_x11.h b/plugins/platforms/x11/standalone/overlaywindow_x11.h index 1f5a89ca76..1dfde4cabc 100644 --- a/plugins/platforms/x11/standalone/overlaywindow_x11.h +++ b/plugins/platforms/x11/standalone/overlaywindow_x11.h @@ -10,8 +10,8 @@ #ifndef KWIN_OVERLAYWINDOW_X11_H #define KWIN_OVERLAYWINDOW_X11_H -#include "../../../../overlaywindow.h" -#include "../../../../x11eventfilter.h" +#include "overlaywindow.h" +#include "x11eventfilter.h" namespace KWin { class KWIN_EXPORT OverlayWindowX11 : public OverlayWindow, public X11EventFilter { diff --git a/plugins/qpa/integration.cpp b/plugins/qpa/integration.cpp index b3465d73ed..1aca0c59db 100644 --- a/plugins/qpa/integration.cpp +++ b/plugins/qpa/integration.cpp @@ -8,16 +8,17 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "integration.h" -#include "abstract_output.h" #include "backingstore.h" #include "eglplatformcontext.h" #include "logging.h" #include "offscreensurface.h" #include "screen.h" #include "window.h" -#include "../../main.h" -#include "../../platform.h" -#include "../../screens.h" + +#include "abstract_output.h" +#include "main.h" +#include "platform.h" +#include "screens.h" #include #include diff --git a/plugins/qpa/platformcursor.cpp b/plugins/qpa/platformcursor.cpp index 49ae91eabb..017ebb85a2 100644 --- a/plugins/qpa/platformcursor.cpp +++ b/plugins/qpa/platformcursor.cpp @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "platformcursor.h" -#include "../../cursor.h" +#include "cursor.h" namespace KWin { diff --git a/plugins/windowsystem/windoweffects.cpp b/plugins/windowsystem/windoweffects.cpp index 2ab6e290cd..3703273d0c 100644 --- a/plugins/windowsystem/windoweffects.cpp +++ b/plugins/windowsystem/windoweffects.cpp @@ -5,7 +5,7 @@ */ #include "windoweffects.h" #include "effect_builtins.h" -#include "../../effects.h" +#include "effects.h" #include #include diff --git a/scripting/scriptedeffect.cpp b/scripting/scriptedeffect.cpp index eb7dce6800..cc975cd133 100644 --- a/scripting/scriptedeffect.cpp +++ b/scripting/scriptedeffect.cpp @@ -11,9 +11,10 @@ #include "meta.h" #include "scriptingutils.h" #include "workspace_wrapper.h" -#include "../screens.h" -#include "../screenedge.h" #include "scripting_logging.h" + +#include "screens.h" +#include "screenedge.h" // KDE #include #include diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index 11645dfba5..c12e1a2510 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -17,10 +17,11 @@ #include "screenedgeitem.h" #include "scripting_model.h" #include "scripting_logging.h" -#include "../x11client.h" -#include "../thumbnailitem.h" -#include "../options.h" -#include "../workspace.h" + +#include "options.h" +#include "thumbnailitem.h" +#include "workspace.h" +#include "x11client.h" // KDE #include #include diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 05bbc220a0..e88e63457d 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -9,13 +9,13 @@ */ #include "workspace_wrapper.h" -#include "../x11client.h" -#include "../outline.h" -#include "../screens.h" -#include "../virtualdesktops.h" -#include "../workspace.h" +#include "x11client.h" +#include "outline.h" +#include "screens.h" +#include "virtualdesktops.h" +#include "workspace.h" #ifdef KWIN_BUILD_ACTIVITIES -#include "../activities.h" +#include "activities.h" #endif #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a315944d4d..0647906a23 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,6 +8,7 @@ endif() set(screenedgeshowtest_SRCS screenedgeshowtest.cpp) add_executable(screenedgeshowtest ${screenedgeshowtest_SRCS}) target_link_libraries(screenedgeshowtest Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem KF5::WaylandClient ${XCB_XCB_LIBRARY}) +target_include_directories(screenedgeshowtest PRIVATE ${CMAKE_SOURCE_DIR}) set(libinputtest_SRCS ${KWin_SOURCE_DIR}/libinput/connection.cpp @@ -22,9 +23,11 @@ set(libinputtest_SRCS add_executable(libinputtest ${libinputtest_SRCS}) add_definitions(-DKWIN_BUILD_TESTING) target_link_libraries(libinputtest Qt::Core Qt::DBus Libinput::Libinput UDev::UDev KF5::ConfigCore KF5::GlobalAccel KF5::WindowSystem) +target_include_directories(libinputtest PRIVATE ${CMAKE_SOURCE_DIR}) add_executable(x11shadowreader x11shadowreader.cpp) target_link_libraries(x11shadowreader XCB::XCB Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem) +target_include_directories(x11shadowreader PRIVATE ${CMAKE_SOURCE_DIR}) add_executable(pointerconstraints pointerconstraintstest.cpp) add_definitions(-DDIR="${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/tests/libinputtest.cpp b/tests/libinputtest.cpp index 20f2ba6906..70a8a1fa67 100644 --- a/tests/libinputtest.cpp +++ b/tests/libinputtest.cpp @@ -3,10 +3,10 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ -#include "../input.h" -#include "../libinput/connection.h" -#include "../libinput/device.h" -#include "../logind.h" +#include "input.h" +#include "libinput/connection.h" +#include "libinput/device.h" +#include "logind.h" #include #include diff --git a/tests/screenedgeshowtest.cpp b/tests/screenedgeshowtest.cpp index b94e4dc5d1..2bf41701f3 100644 --- a/tests/screenedgeshowtest.cpp +++ b/tests/screenedgeshowtest.cpp @@ -3,6 +3,8 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ +#include "xcbutils.h" + #include #include #include @@ -15,7 +17,6 @@ #include #include #include -#include "../xcbutils.h" #include diff --git a/tests/x11shadowreader.cpp b/tests/x11shadowreader.cpp index dce56e147b..f4981bd5d1 100644 --- a/tests/x11shadowreader.cpp +++ b/tests/x11shadowreader.cpp @@ -3,7 +3,8 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ -#include "../xcbutils.h" +#include "xcbutils.h" + #include #include #include