Move source code to src/ directory

Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
This commit is contained in:
Vlad Zahorodnii 2021-02-09 21:31:40 +02:00
parent 68c675d00d
commit 93e0265e4e
1243 changed files with 460 additions and 469 deletions

View file

@ -47,6 +47,7 @@ include(KDEClangFormat)
include(ECMInstallIcons)
include(ECMOptionalAddSubdirectory)
include(ECMConfiguredInstall)
include(ECMQtDeclareLoggingCategory)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_USE_QSTRINGBUILDER -DQT_NO_URL_CAST_FROM_STRING)
@ -361,8 +362,6 @@ include_directories(${XKB_INCLUDE_DIR})
set(HAVE_EPOXY_GLX ${epoxy_HAS_GLX})
# for things that are also used by kwin libraries
configure_file(libkwineffects/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects/kwinconfig.h )
# for kwin internal things
set(HAVE_X11_XCB ${X11_XCB_FOUND})
@ -404,385 +403,24 @@ add_feature_info("SCHED_RESET_ON_FORK"
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
add_feature_info(PipeWire PipeWire_FOUND "Required for Wayland screencasting")
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h)
########### global ###############
set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml)
qt5_add_dbus_interface(effects_interface_SRCS ${kwin_effects_dbus_xml} kwineffects_interface)
add_library(KWinEffectsInterface STATIC ${effects_interface_SRCS})
target_link_libraries(KWinEffectsInterface Qt::DBus)
include_directories(BEFORE
${CMAKE_CURRENT_BINARY_DIR}/libkwineffects
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/libkwineffects
${CMAKE_CURRENT_SOURCE_DIR}/effects
${CMAKE_CURRENT_SOURCE_DIR}/tabbox
${CMAKE_CURRENT_SOURCE_DIR}/platformsupport
${CMAKE_CURRENT_BINARY_DIR}/src/libkwineffects
${CMAKE_CURRENT_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/libkwineffects
${CMAKE_CURRENT_SOURCE_DIR}/src/effects
${CMAKE_CURRENT_SOURCE_DIR}/src/tabbox
${CMAKE_CURRENT_SOURCE_DIR}/src/platformsupport
)
add_subdirectory(libkwineffects)
if (KWIN_BUILD_KCMS)
add_subdirectory(kcmkwin)
if (KF5DocTools_FOUND)
add_subdirectory(doc)
endif()
add_subdirectory(data)
add_subdirectory(effects)
add_subdirectory(scripts)
add_subdirectory(tabbox)
add_subdirectory(scripting)
add_subdirectory(helpers)
########### next target ###############
set(kwin_SRCS
3rdparty/xcursor.c
abstract_client.cpp
abstract_opengl_context_attribute_builder.cpp
abstract_output.cpp
abstract_wayland_output.cpp
activation.cpp
appmenu.cpp
atoms.cpp
client_machine.cpp
composite.cpp
cursor.cpp
dbusinterface.cpp
debug_console.cpp
decorations/decoratedclient.cpp
decorations/decorationbridge.cpp
decorations/decorationpalette.cpp
decorations/decorationrenderer.cpp
decorations/decorations_logging.cpp
decorations/settings.cpp
deleted.cpp
dmabuftexture.cpp
effectloader.cpp
effects.cpp
egl_context_attribute_builder.cpp
events.cpp
focuschain.cpp
ftrace.cpp
geometrytip.cpp
gestures.cpp
globalshortcuts.cpp
group.cpp
idle_inhibition.cpp
input.cpp
input_event.cpp
input_event_spy.cpp
inputmethod.cpp
inputpanelv1client.cpp
inputpanelv1integration.cpp
internal_client.cpp
keyboard_input.cpp
keyboard_layout.cpp
keyboard_layout_switching.cpp
keyboard_repeat.cpp
killwindow.cpp
layers.cpp
layershellv1client.cpp
layershellv1integration.cpp
libinput/connection.cpp
libinput/context.cpp
libinput/device.cpp
libinput/events.cpp
libinput/libinput_logging.cpp
linux_dmabuf.cpp
logind.cpp
main.cpp
modifier_only_shortcuts.cpp
moving_client_x11_filter.cpp
netinfo.cpp
onscreennotification.cpp
options.cpp
osd.cpp
outline.cpp
overlaywindow.cpp
placement.cpp
platform.cpp
plugin.cpp
pluginmanager.cpp
pointer_input.cpp
popup_input_filter.cpp
renderjournal.cpp
renderloop.cpp
rootinfo_filter.cpp
rulebooksettings.cpp
rules.cpp
scene.cpp
screenedge.cpp
screenlockerwatcher.cpp
screens.cpp
scripting/dbuscall.cpp
scripting/meta.cpp
scripting/screenedgeitem.cpp
scripting/scriptedeffect.cpp
scripting/scripting.cpp
scripting/scripting_logging.cpp
scripting/scripting_model.cpp
scripting/scriptingutils.cpp
scripting/timer.cpp
scripting/workspace_wrapper.cpp
shadow.cpp
sm.cpp
subsurfacemonitor.cpp
syncalarmx11filter.cpp
tablet_input.cpp
thumbnailitem.cpp
toplevel.cpp
touch_hide_cursor_spy.cpp
touch_input.cpp
udev.cpp
unmanaged.cpp
useractions.cpp
utils.cpp
virtualdesktops.cpp
virtualdesktopsdbustypes.cpp
virtualkeyboard_dbus.cpp
was_user_interaction_x11_filter.cpp
wayland_server.cpp
waylandclient.cpp
waylandshellintegration.cpp
window_property_notify_x11_filter.cpp
workspace.cpp
x11client.cpp
x11eventfilter.cpp
xcbutils.cpp
xcursortheme.cpp
xdgshellclient.cpp
xdgshellintegration.cpp
xkb.cpp
xwaylandclient.cpp
xwl/xwayland_interface.cpp
)
if (HAVE_LINUX_VT_H)
set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp
)
set(KWIN_TTY_PREFIX "/dev/tty")
endif()
if(CMAKE_SYSTEM MATCHES "FreeBSD")
# We know it has epoll, so supports VT as well
set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp
)
set(KWIN_TTY_PREFIX "/dev/ttyv")
endif()
if(KWIN_TTY_PREFIX)
set_source_files_properties(virtual_terminal.cpp PROPERTIES COMPILE_DEFINITIONS KWIN_TTY_PREFIX="${KWIN_TTY_PREFIX}")
endif()
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulesettings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulebooksettingsbase.kcfgc)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Plugins.xml dbusinterface.h KWin::PluginManagerDBusInterface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS org.kde.kappmenu.xml appmenu_interface)
ki18n_wrap_ui(kwin_SRCS
debug_console.ui
shortcutdialog.ui
)
########### target link libraries ###############
add_library(kwin SHARED ${kwin_SRCS})
if (Libinput_VERSION_STRING VERSION_GREATER 1.14)
set_source_files_properties(libinput/connection.cpp PROPERTIES COMPILE_DEFINITIONS LIBINPUT_HAS_TOTEM)
endif ()
set_target_properties(kwin PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
target_link_libraries(kwin
kwin4_effect_builtins
kwineffects
kwinglutils
Qt::Concurrent
Qt::DBus
Qt::Quick
Qt::Script
KF5::ConfigCore
KF5::ConfigWidgets
KF5::CoreAddons
KF5::GlobalAccel
KF5::GlobalAccelPrivate
KF5::I18n
KF5::Notifications
KF5::Package
KF5::Plasma
KF5::QuickAddons
KF5::WaylandClient
KF5::WindowSystem
KDecoration2::KDecoration
KDecoration2::KDecoration2Private
PW::KScreenLocker
Plasma::KWaylandServer
XCB::COMPOSITE
XCB::DAMAGE
XCB::GLX
XCB::ICCCM
XCB::KEYSYMS
XCB::RANDR
XCB::RENDER
XCB::SHAPE
XCB::SHM
XCB::SYNC
XCB::XCB
XCB::XFIXES
Libinput::Libinput
UDev::UDev
XKB::XKB
epoxy::epoxy
Threads::Threads
)
if (KWIN_BUILD_CMS)
target_sources(kwin PRIVATE
colordevice.cpp
colormanager.cpp
)
target_link_libraries(kwin lcms2::lcms2)
endif()
if (KWIN_BUILD_ACTIVITIES)
target_sources(kwin PRIVATE activities.cpp)
target_link_libraries(kwin KF5::Activities)
endif()
if (KWIN_BUILD_TABBOX)
target_sources(kwin PRIVATE
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
tabbox/switcheritem.cpp
tabbox/tabbox.cpp
tabbox/tabbox_logging.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/x11_filter.cpp
)
target_link_libraries(kwin Qt::GuiPrivate)
endif()
generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
if(CMAKE_SYSTEM MATCHES "FreeBSD")
# epoll is required, includes live under ${LOCALBASE}, separate library
target_include_directories(kwin PUBLIC ${epoll_INCLUDE_DIRS})
target_link_libraries(kwin ${epoll_LIBRARIES})
endif()
add_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kwin_x11 kwin KF5::Crash Qt::X11Extras)
install(TARGETS kwin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS kwin_x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
set(kwin_XWAYLAND_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/xwl/clipboard.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/databridge.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/dnd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/drag.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/drag_wl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/drag_x.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/selection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/selection_source.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/transfer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xwl/xwayland.cpp
)
include(ECMQtDeclareLoggingCategory)
ecm_qt_declare_logging_category(kwin_XWAYLAND_SRCS
HEADER
xwayland_logging.h
IDENTIFIER
KWIN_XWL
CATEGORY_NAME
kwin_xwl
DEFAULT_SEVERITY
Warning
)
set(kwin_WAYLAND_SRCS
main_wayland.cpp
tabletmodemanager.cpp
)
add_executable(kwin_wayland ${kwin_WAYLAND_SRCS} ${kwin_XWAYLAND_SRCS})
target_link_libraries(kwin_wayland
kwin
KF5::Crash
)
if (HAVE_LIBCAP)
target_link_libraries(kwin_wayland ${Libcap_LIBRARIES})
endif()
install(TARGETS kwin_wayland ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
if (HAVE_LIBCAP)
install(
CODE "execute_process(
COMMAND
${SETCAP_EXECUTABLE}
CAP_SYS_NICE=+ep
\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/kwin_wayland)"
)
endif()
add_subdirectory(platformsupport)
add_subdirectory(plugins)
target_link_libraries(kwin_wayland
KWinQpaPlugin
KF5GlobalAccelKWinPlugin
KF5WindowSystemKWinPlugin
KF5IdleTimeKWinPlugin
)
if (PipeWire_FOUND)
target_link_libraries(kwin_wayland KWinScreencastPlugin)
endif()
########### install files ###############
install(FILES kwin.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} RENAME ${KWIN_NAME}.kcfg)
install(FILES kwin.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} RENAME ${KWIN_NAME}.notifyrc)
install(
FILES
org.kde.KWin.VirtualDesktopManager.xml
org.kde.KWin.xml
org.kde.kwin.Compositing.xml
org.kde.kwin.Effects.xml
org.kde.KWin.Plugins.xml
DESTINATION
${KDE_INSTALL_DBUSINTERFACEDIR}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kwin_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
# Install the KWin/Script service type
install(FILES scripting/kwinscript.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
add_subdirectory(qml)
add_subdirectory(kconf_update)
add_subdirectory(src)
if (BUILD_TESTING)
find_package(WaylandProtocols 1.19 REQUIRED)
@ -793,12 +431,6 @@ if (BUILD_TESTING)
add_subdirectory(tests)
endif()
if (KF5DocTools_FOUND)
add_subdirectory(doc)
endif()
add_subdirectory(kconf_update)
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})

View file

@ -31,7 +31,7 @@ ecm_mark_as_test(testWindowPaintData)
# Test VirtualDesktopManager
########################################################
set(testVirtualDesktops_SRCS
../virtualdesktops.cpp
../src/virtualdesktops.cpp
test_virtual_desktops.cpp
)
add_executable(testVirtualDesktops ${testVirtualDesktops_SRCS})
@ -53,7 +53,7 @@ ecm_mark_as_test(testVirtualDesktops)
# Test ClientMachine
########################################################
set(testClientMachine_SRCS
../client_machine.cpp
../src/client_machine.cpp
test_client_machine.cpp
)
add_executable(testClientMachine ${testClientMachine_SRCS})
@ -140,7 +140,7 @@ ecm_mark_as_test(testXcbWindow)
# Test BuiltInEffectLoader
########################################################
set(testBuiltInEffectLoader_SRCS
../effectloader.cpp
../src/effectloader.cpp
mock_effectshandler.cpp
test_builtin_effectloader.cpp
)
@ -164,21 +164,21 @@ ecm_mark_as_test(testBuiltInEffectLoader)
########################################################
# Test ScriptedEffectLoader
########################################################
include_directories(${KWin_SOURCE_DIR})
include_directories(${KWin_SOURCE_DIR}/src)
set(testScriptedEffectLoader_SRCS
../effectloader.cpp
../cursor.cpp
../screens.cpp
../scripting/scriptedeffect.cpp
../scripting/scripting_logging.cpp
../scripting/scriptingutils.cpp
../src/effectloader.cpp
../src/cursor.cpp
../src/screens.cpp
../src/scripting/scriptedeffect.cpp
../src/scripting/scripting_logging.cpp
../src/scripting/scriptingutils.cpp
mock_abstract_client.cpp
mock_effectshandler.cpp
mock_screens.cpp
mock_workspace.cpp
test_scripted_effectloader.cpp
)
kconfig_add_kcfg_files(testScriptedEffectLoader_SRCS ../settings.kcfgc)
kconfig_add_kcfg_files(testScriptedEffectLoader_SRCS ../src/settings.kcfgc)
add_executable(testScriptedEffectLoader ${testScriptedEffectLoader_SRCS})
target_link_libraries(testScriptedEffectLoader
@ -205,7 +205,7 @@ ecm_mark_as_test(testScriptedEffectLoader)
# Test PluginEffectLoader
########################################################
set(testPluginEffectLoader_SRCS
../effectloader.cpp
../src/effectloader.cpp
mock_effectshandler.cpp
test_plugin_effectloader.cpp
)
@ -243,21 +243,21 @@ target_link_libraries(effectversionplugin kwineffects)
# Test ScreenEdges
########################################################
set(testScreenEdges_SRCS
../atoms.cpp
../gestures.cpp
../plugins/platforms/x11/standalone/edge.cpp
../screenedge.cpp
../screens.cpp
../virtualdesktops.cpp
../cursor.cpp
../xcbutils.cpp # init of extensions
../src/atoms.cpp
../src/gestures.cpp
../src/plugins/platforms/x11/standalone/edge.cpp
../src/screenedge.cpp
../src/screens.cpp
../src/virtualdesktops.cpp
../src/cursor.cpp
../src/xcbutils.cpp # init of extensions
mock_abstract_client.cpp
mock_screens.cpp
mock_workspace.cpp
mock_x11client.cpp
test_screen_edges.cpp
)
kconfig_add_kcfg_files(testScreenEdges_SRCS ../settings.kcfgc)
kconfig_add_kcfg_files(testScreenEdges_SRCS ../src/settings.kcfgc)
qt5_add_dbus_interface(testScreenEdges_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface )
add_executable(testScreenEdges ${testScreenEdges_SRCS})
@ -293,8 +293,8 @@ ecm_mark_as_test(testScreenEdges)
# Test OnScreenNotification
########################################################
set(testOnScreenNotification_SRCS
../input_event_spy.cpp
../onscreennotification.cpp
../src/input_event_spy.cpp
../src/onscreennotification.cpp
onscreennotificationtest.cpp
)
add_executable(testOnScreenNotification ${testOnScreenNotification_SRCS})
@ -315,7 +315,7 @@ ecm_mark_as_test(testOnScreenNotification)
# Test Gestures
########################################################
set(testGestures_SRCS
../gestures.cpp
../src/gestures.cpp
test_gestures.cpp
)
add_executable(testGestures ${testGestures_SRCS})
@ -340,13 +340,13 @@ add_test(NAME kwin-testX11TimestampUpdate COMMAND testX11TimestampUpdate)
ecm_mark_as_test(testX11TimestampUpdate)
set(testOpenGLContextAttributeBuilder_SRCS
../abstract_opengl_context_attribute_builder.cpp
../egl_context_attribute_builder.cpp
../src/abstract_opengl_context_attribute_builder.cpp
../src/egl_context_attribute_builder.cpp
opengl_context_attribute_builder_test.cpp
)
if (HAVE_EPOXY_GLX)
set(testOpenGLContextAttributeBuilder_SRCS ${testOpenGLContextAttributeBuilder_SRCS} ../plugins/platforms/x11/standalone/glx_context_attribute_builder.cpp)
set(testOpenGLContextAttributeBuilder_SRCS ${testOpenGLContextAttributeBuilder_SRCS} ../src/plugins/platforms/x11/standalone/glx_context_attribute_builder.cpp)
endif()
add_executable(testOpenGLContextAttributeBuilder ${testOpenGLContextAttributeBuilder_SRCS})
target_link_libraries(testOpenGLContextAttributeBuilder Qt::Test)
@ -354,7 +354,7 @@ add_test(NAME kwin-testOpenGLContextAttributeBuilder COMMAND testOpenGLContextAt
ecm_mark_as_test(testOpenGLContextAttributeBuilder)
set(testXkb_SRCS
../xkb.cpp
../src/xkb.cpp
test_xkb.cpp
)
add_executable(testXkb ${testXkb_SRCS})
@ -373,13 +373,13 @@ add_test(NAME kwin-testXkb COMMAND testXkb)
ecm_mark_as_test(testXkb)
if (HAVE_GBM)
add_executable(testGbmSurface test_gbm_surface.cpp ../plugins/platforms/drm/gbm_surface.cpp)
add_executable(testGbmSurface test_gbm_surface.cpp ../src/plugins/platforms/drm/gbm_surface.cpp)
target_link_libraries(testGbmSurface Qt::Test)
add_test(NAME kwin-testGbmSurface COMMAND testGbmSurface)
ecm_mark_as_test(testGbmSurface)
endif()
add_executable(testVirtualKeyboardDBus test_virtualkeyboard_dbus.cpp ../virtualkeyboard_dbus.cpp)
add_executable(testVirtualKeyboardDBus test_virtualkeyboard_dbus.cpp ../src/virtualkeyboard_dbus.cpp)
target_link_libraries(testVirtualKeyboardDBus
Qt::DBus
Qt::Test

View file

@ -2,11 +2,11 @@ include_directories(${Libdrm_INCLUDE_DIRS})
set(mockDRM_SRCS
mock_drm.cpp
../../plugins/platforms/drm/drm_buffer.cpp
../../plugins/platforms/drm/drm_object.cpp
../../plugins/platforms/drm/drm_object_connector.cpp
../../plugins/platforms/drm/drm_object_plane.cpp
../../plugins/platforms/drm/logging.cpp
../../src/plugins/platforms/drm/drm_buffer.cpp
../../src/plugins/platforms/drm/drm_object.cpp
../../src/plugins/platforms/drm/drm_object_connector.cpp
../../src/plugins/platforms/drm/drm_object_plane.cpp
../../src/plugins/platforms/drm/logging.cpp
)
add_library(mockDrm STATIC ${mockDRM_SRCS})

View file

@ -7,7 +7,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_drm.h"
#include "../../plugins/platforms/drm/drm_object.h"
#include "../../src/plugins/platforms/drm/drm_object.h"
#include <QtTest>
class MockDrmObject : public KWin::DrmObject

View file

@ -1,13 +1,11 @@
add_subdirectory(helper)
set(KWinIntegrationTestFramework_SOURCES
../../cursor.cpp
../../src/cursor.cpp
generic_scene_opengl_test.cpp
kwin_wayland_test.cpp
test_helpers.cpp
${kwin_XWAYLAND_SRCS}
)
ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
@ -31,6 +29,9 @@ target_link_libraries(KWinIntegrationTestFramework
kwin
Wayland::Client
# Own libraries
KWinXwaylandServerModule
# Static plugins
KWinQpaPlugin
KF5GlobalAccelKWinPlugin

View file

@ -1,8 +1,8 @@
include_directories(${Libinput_INCLUDE_DIRS})
add_library(LibInputTestObjects STATIC ../../libinput/device.cpp ../../libinput/events.cpp mock_libinput.cpp)
add_library(LibInputTestObjects STATIC ../../src/libinput/device.cpp ../../src/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})
target_include_directories(LibInputTestObjects PUBLIC ${CMAKE_SOURCE_DIR}/src)
########################################################
# Test Devices
@ -56,9 +56,9 @@ ecm_mark_as_test(testLibinputSwitchEvent)
# Test Context
########################################################
set(testLibinputContext_SRCS
../../libinput/context.cpp
../../libinput/libinput_logging.cpp
../../logind.cpp
../../src/libinput/context.cpp
../../src/libinput/libinput_logging.cpp
../../src/logind.cpp
context_test.cpp
mock_udev.cpp
)
@ -79,7 +79,7 @@ ecm_mark_as_test(testLibinputContext)
########################################################
# Test Input Events
########################################################
add_executable(testInputEvents input_event_test.cpp ../../input_event.cpp)
add_executable(testInputEvents input_event_test.cpp ../../src/input_event.cpp)
target_link_libraries(testInputEvents Qt::Test Qt::DBus Qt::Gui Qt::Widgets KF5::ConfigCore LibInputTestObjects)
add_test(NAME kwin-testInputEvents COMMAND testInputEvents)
ecm_mark_as_test(testInputEvents)

View file

@ -14,7 +14,7 @@ kwineffects_unit_tests(
timelinetest
)
add_executable(kwinglplatformtest kwinglplatformtest.cpp mock_gl.cpp ../../libkwineffects/kwinglplatform.cpp)
add_executable(kwinglplatformtest kwinglplatformtest.cpp mock_gl.cpp ../../src/libkwineffects/kwinglplatform.cpp)
add_test(NAME kwineffects-kwinglplatformtest COMMAND kwinglplatformtest)
target_link_libraries(kwinglplatformtest Qt::Test Qt::Gui Qt::X11Extras KF5::ConfigCore XCB::XCB)
ecm_mark_as_test(kwinglplatformtest)

View file

@ -13,7 +13,7 @@
#include <kwinconfig.h>
#if HAVE_EPOXY_GLX
#include "../plugins/platforms/x11/standalone/glx_context_attribute_builder.h"
#include "../src/plugins/platforms/x11/standalone/glx_context_attribute_builder.h"
#include <epoxy/glx.h>
#ifndef GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV

View file

@ -1,14 +1,14 @@
include_directories(${KWin_SOURCE_DIR})
include_directories(${KWin_SOURCE_DIR}/src)
add_definitions(-DKWIN_UNIT_TEST)
########################################################
# Test TabBox::ClientModel
########################################################
set(testTabBoxClientModel_SRCS
../../tabbox/clientmodel.cpp
../../tabbox/desktopmodel.cpp
../../tabbox/tabbox_logging.cpp
../../tabbox/tabboxconfig.cpp
../../tabbox/tabboxhandler.cpp
../../src/tabbox/clientmodel.cpp
../../src/tabbox/desktopmodel.cpp
../../src/tabbox/tabbox_logging.cpp
../../src/tabbox/tabboxconfig.cpp
../../src/tabbox/tabboxhandler.cpp
mock_tabboxclient.cpp
mock_tabboxhandler.cpp
test_tabbox_clientmodel.cpp
@ -40,11 +40,11 @@ ecm_mark_as_test(testTabBoxClientModel)
# Test TabBox::TabBoxHandler
########################################################
set(testTabBoxHandler_SRCS
../../tabbox/clientmodel.cpp
../../tabbox/desktopmodel.cpp
../../tabbox/tabbox_logging.cpp
../../tabbox/tabboxconfig.cpp
../../tabbox/tabboxhandler.cpp
../../src/tabbox/clientmodel.cpp
../../src/tabbox/desktopmodel.cpp
../../src/tabbox/tabbox_logging.cpp
../../src/tabbox/tabboxconfig.cpp
../../src/tabbox/tabboxhandler.cpp
mock_tabboxclient.cpp
mock_tabboxhandler.cpp
test_tabbox_handler.cpp
@ -76,8 +76,8 @@ ecm_mark_as_test(testTabBoxHandler)
# Test TabBox::TabBoxConfig
########################################################
set(testTabBoxConfig_SRCS
../../tabbox/tabbox_logging.cpp
../../tabbox/tabboxconfig.cpp
../../src/tabbox/tabbox_logging.cpp
../../src/tabbox/tabboxconfig.cpp
test_tabbox_config.cpp
)
@ -91,8 +91,8 @@ ecm_mark_as_test(testTabBoxConfig)
# Test TabBox::DesktopChainManager
########################################################
set(testDesktopChain_SRCS
../../tabbox/desktopchain.cpp
../../tabbox/tabbox_logging.cpp
../../src/tabbox/desktopchain.cpp
../../src/tabbox/tabbox_logging.cpp
test_desktopchain.cpp
)

View file

@ -6,7 +6,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "../plugins/platforms/drm/gbm_surface.h"
#include "../src/plugins/platforms/drm/gbm_surface.h"
#include <QtTest>
#include <gbm.h>

View file

@ -1,3 +0,0 @@
[Project]
Manager=KDevCMakeManager
Name=backgroundcontrast

363
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,363 @@
# for things that are also used by kwin libraries
configure_file(libkwineffects/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects/kwinconfig.h)
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h)
set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml)
qt5_add_dbus_interface(effects_interface_SRCS ${kwin_effects_dbus_xml} kwineffects_interface)
add_library(KWinEffectsInterface STATIC ${effects_interface_SRCS})
target_link_libraries(KWinEffectsInterface Qt::DBus)
add_subdirectory(effects)
add_subdirectory(scripts)
add_subdirectory(tabbox)
add_subdirectory(scripting)
add_subdirectory(helpers)
add_subdirectory(qml)
add_subdirectory(libkwineffects)
if (KWIN_BUILD_KCMS)
add_subdirectory(kcmkwin)
endif()
set(kwin_SRCS
3rdparty/xcursor.c
abstract_client.cpp
abstract_opengl_context_attribute_builder.cpp
abstract_output.cpp
abstract_wayland_output.cpp
activation.cpp
appmenu.cpp
atoms.cpp
client_machine.cpp
composite.cpp
cursor.cpp
dbusinterface.cpp
debug_console.cpp
decorations/decoratedclient.cpp
decorations/decorationbridge.cpp
decorations/decorationpalette.cpp
decorations/decorationrenderer.cpp
decorations/decorations_logging.cpp
decorations/settings.cpp
deleted.cpp
dmabuftexture.cpp
effectloader.cpp
effects.cpp
egl_context_attribute_builder.cpp
events.cpp
focuschain.cpp
ftrace.cpp
geometrytip.cpp
gestures.cpp
globalshortcuts.cpp
group.cpp
idle_inhibition.cpp
input.cpp
input_event.cpp
input_event_spy.cpp
inputmethod.cpp
inputpanelv1client.cpp
inputpanelv1integration.cpp
internal_client.cpp
keyboard_input.cpp
keyboard_layout.cpp
keyboard_layout_switching.cpp
keyboard_repeat.cpp
killwindow.cpp
layers.cpp
layershellv1client.cpp
layershellv1integration.cpp
libinput/connection.cpp
libinput/context.cpp
libinput/device.cpp
libinput/events.cpp
libinput/libinput_logging.cpp
linux_dmabuf.cpp
logind.cpp
main.cpp
modifier_only_shortcuts.cpp
moving_client_x11_filter.cpp
netinfo.cpp
onscreennotification.cpp
options.cpp
osd.cpp
outline.cpp
overlaywindow.cpp
placement.cpp
platform.cpp
plugin.cpp
pluginmanager.cpp
pointer_input.cpp
popup_input_filter.cpp
renderjournal.cpp
renderloop.cpp
rootinfo_filter.cpp
rulebooksettings.cpp
rules.cpp
scene.cpp
screenedge.cpp
screenlockerwatcher.cpp
screens.cpp
scripting/dbuscall.cpp
scripting/meta.cpp
scripting/screenedgeitem.cpp
scripting/scriptedeffect.cpp
scripting/scripting.cpp
scripting/scripting_logging.cpp
scripting/scripting_model.cpp
scripting/scriptingutils.cpp
scripting/timer.cpp
scripting/workspace_wrapper.cpp
shadow.cpp
sm.cpp
subsurfacemonitor.cpp
syncalarmx11filter.cpp
tablet_input.cpp
thumbnailitem.cpp
toplevel.cpp
touch_hide_cursor_spy.cpp
touch_input.cpp
udev.cpp
unmanaged.cpp
useractions.cpp
utils.cpp
virtualdesktops.cpp
virtualdesktopsdbustypes.cpp
virtualkeyboard_dbus.cpp
was_user_interaction_x11_filter.cpp
wayland_server.cpp
waylandclient.cpp
waylandshellintegration.cpp
window_property_notify_x11_filter.cpp
workspace.cpp
x11client.cpp
x11eventfilter.cpp
xcbutils.cpp
xcursortheme.cpp
xdgshellclient.cpp
xdgshellintegration.cpp
xkb.cpp
xwaylandclient.cpp
xwl/xwayland_interface.cpp
)
if (HAVE_LINUX_VT_H)
set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp
)
set(KWIN_TTY_PREFIX "/dev/tty")
endif()
if(CMAKE_SYSTEM MATCHES "FreeBSD")
# We know it has epoll, so supports VT as well
set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp
)
set(KWIN_TTY_PREFIX "/dev/ttyv")
endif()
if(KWIN_TTY_PREFIX)
set_source_files_properties(virtual_terminal.cpp PROPERTIES COMPILE_DEFINITIONS KWIN_TTY_PREFIX="${KWIN_TTY_PREFIX}")
endif()
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulesettings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS rulebooksettingsbase.kcfgc)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Plugins.xml dbusinterface.h KWin::PluginManagerDBusInterface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS org.kde.kappmenu.xml appmenu_interface)
ki18n_wrap_ui(kwin_SRCS
debug_console.ui
shortcutdialog.ui
)
add_library(kwin SHARED ${kwin_SRCS})
if (Libinput_VERSION_STRING VERSION_GREATER 1.14)
set_source_files_properties(libinput/connection.cpp PROPERTIES COMPILE_DEFINITIONS LIBINPUT_HAS_TOTEM)
endif ()
set_target_properties(kwin PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
target_link_libraries(kwin
kwin4_effect_builtins
kwineffects
kwinglutils
Qt::Concurrent
Qt::DBus
Qt::Quick
Qt::Script
KF5::ConfigCore
KF5::ConfigWidgets
KF5::CoreAddons
KF5::GlobalAccel
KF5::GlobalAccelPrivate
KF5::I18n
KF5::Notifications
KF5::Package
KF5::Plasma
KF5::QuickAddons
KF5::WaylandClient
KF5::WindowSystem
KDecoration2::KDecoration
KDecoration2::KDecoration2Private
PW::KScreenLocker
Plasma::KWaylandServer
XCB::COMPOSITE
XCB::DAMAGE
XCB::GLX
XCB::ICCCM
XCB::KEYSYMS
XCB::RANDR
XCB::RENDER
XCB::SHAPE
XCB::SHM
XCB::SYNC
XCB::XCB
XCB::XFIXES
Libinput::Libinput
UDev::UDev
XKB::XKB
epoxy::epoxy
${CMAKE_THREAD_LIBS_INIT}
)
if (KWIN_BUILD_CMS)
target_sources(kwin PRIVATE
colordevice.cpp
colormanager.cpp
)
target_link_libraries(kwin lcms2::lcms2)
endif()
if (KWIN_BUILD_ACTIVITIES)
target_sources(kwin PRIVATE activities.cpp)
target_link_libraries(kwin KF5::Activities)
endif()
if (KWIN_BUILD_TABBOX)
target_sources(kwin PRIVATE
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
tabbox/switcheritem.cpp
tabbox/tabbox.cpp
tabbox/tabbox_logging.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/x11_filter.cpp
)
target_link_libraries(kwin Qt::GuiPrivate)
endif()
generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
if(CMAKE_SYSTEM MATCHES "FreeBSD")
# epoll is required, includes live under ${LOCALBASE}, separate library
target_include_directories(kwin PUBLIC ${epoll_INCLUDE_DIRS})
target_link_libraries(kwin ${epoll_LIBRARIES})
endif()
add_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kwin_x11 kwin KF5::Crash Qt::X11Extras)
install(TARGETS kwin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS kwin_x11 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
ecm_qt_declare_logging_category(xwaylandlogging_SOURCES
HEADER
xwayland_logging.h
IDENTIFIER
KWIN_XWL
CATEGORY_NAME
kwin_xwl
DEFAULT_SEVERITY
Warning
)
add_library(KWinXwaylandServerModule OBJECT
xwl/clipboard.cpp
xwl/databridge.cpp
xwl/dnd.cpp
xwl/drag.cpp
xwl/drag_wl.cpp
xwl/drag_x.cpp
xwl/selection.cpp
xwl/selection_source.cpp
xwl/transfer.cpp
xwl/xwayland.cpp
${xwaylandlogging_SOURCES}
)
target_link_libraries(KWinXwaylandServerModule PUBLIC kwin)
add_executable(kwin_wayland
main_wayland.cpp
tabletmodemanager.cpp
)
target_link_libraries(kwin_wayland
kwin
KF5::Crash
KWinXwaylandServerModule
)
if (HAVE_LIBCAP)
target_link_libraries(kwin_wayland ${Libcap_LIBRARIES})
endif()
install(TARGETS kwin_wayland ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
if (HAVE_LIBCAP)
install(
CODE "execute_process(
COMMAND
${SETCAP_EXECUTABLE}
CAP_SYS_NICE=+ep
\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/kwin_wayland)"
)
endif()
add_subdirectory(platformsupport)
add_subdirectory(plugins)
target_link_libraries(kwin_wayland
KWinQpaPlugin
KF5GlobalAccelKWinPlugin
KF5WindowSystemKWinPlugin
KF5IdleTimeKWinPlugin
)
if (PipeWire_FOUND)
target_link_libraries(kwin_wayland KWinScreencastPlugin)
endif()
install(FILES kwin.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} RENAME ${KWIN_NAME}.kcfg)
install(FILES kwin.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} RENAME ${KWIN_NAME}.notifyrc)
install(
FILES
org.kde.KWin.VirtualDesktopManager.xml
org.kde.KWin.xml
org.kde.kwin.Compositing.xml
org.kde.kwin.Effects.xml
org.kde.KWin.Plugins.xml
DESTINATION
${KDE_INSTALL_DBUSINTERFACEDIR}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kwin_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
# Install the KWin/Script service type
install(FILES scripting/kwinscript.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})

View file

@ -1,7 +1,7 @@
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kwin_effects\" -DEFFECT_BUILTINS)
include_directories(${KWin_SOURCE_DIR}) # for xcbutils.h
include_directories(${KWin_SOURCE_DIR}/src) # for xcbutils.h
if (HAVE_ACCESSIBILITY)
include_directories(${QACCESSIBILITYCLIENT_INCLUDE_DIR})

Some files were not shown because too many files have changed in this diff Show more