diff --git a/.github/workflows/change.yml b/.github/workflows/change.yml index c4ab461b80..f415af2abd 100644 --- a/.github/workflows/change.yml +++ b/.github/workflows/change.yml @@ -32,3 +32,9 @@ jobs: |scene opengl|opengl shadow|no crash reinit compositor|buffer size change\ |no crash aurorae destroy deco|slidingpopups|scripted effects|window open close animation\ |subspace switching animation|minimize animation'" + + package: + uses: ./.github/workflows/package.yml + needs: build + with: + image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index dabe06aec2..e3d16ad29c 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -13,7 +13,8 @@ on: default: 'master' jobs: message-lint: - name: Commit Message Lint + if: github.event_name != 'pull_request' + name: On Push runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -36,3 +37,15 @@ jobs: run: > commitlint --verbose --config=tooling/docs/commitlint.config.js --from=_upstream/${{ inputs.upstream-branch }} + + message-lint-pr: + if: github.event_name == 'pull_request' + name: On Pull Request + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - uses: wagoid/commitlint-github-action@v5 + with: + configFile: tooling/docs/commitlint.config.js + helpURL: https://github.com/winft/como/blob/master/CONTRIBUTING.md#commit-message-guideline diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000000..c88b22765b --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,64 @@ +name: Package +on: + workflow_call: + inputs: + image: + description: Image to package on + required: true + type: string + artifact-name: + description: Artifact name of build dir + required: false + type: string + default: 'build' + +jobs: + deb: + name: Create deb + runs-on: ubuntu-latest + container: + image: ${{ inputs.image }} + steps: + - name: Install dpkg + run: pacman -Sy --needed --quiet --noconfirm dpkg + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + - name: Untar artifact + run: tar -xzf build-dir.tar + - name: Run CPack + run: cd build && cpack -G DEB -D CPACK_DEBIAN_FILE_NAME=como.deb + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: deb-package + path: build/_CPack_Packages/Linux/DEB/como.deb + retention-days: 8 + + tar: + name: Create tar + runs-on: ubuntu-latest + container: + image: ${{ inputs.image }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + - name: Untar artifact + run: tar -xzf build-dir.tar + - name: Run CPack + # Need to use CPACK_PACKAGE_FILE_NAME instead of CPACK_ARCHIVE_FILE_NAME + # See: https://gitlab.kitware.com/cmake/cmake/-/issues/20419 + run: cd build && cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=como + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: tar-package + path: build/_CPack_Packages/Linux/TGZ/como.tar.gz + retention-days: 8 diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml new file mode 100644 index 0000000000..f32540364e --- /dev/null +++ b/.github/workflows/rebuild.yml @@ -0,0 +1,16 @@ +name: Weekly Project Rebuild +on: + schedule: + - cron: '0 4 * * 4' +jobs: + build: + if: github.repository == 'winft/como' + uses: ./.github/workflows/build.yml + with: + image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master + + package: + uses: ./.github/workflows/package.yml + needs: build + with: + image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b6d9d61b0..7c86e82c24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,12 @@ cmake_minimum_required(VERSION 3.23 FATAL_ERROR) -project(KWinFT VERSION 5.27.80) +project("The Compositor Modules" VERSION 0.1.0) set(QT_MIN_VERSION "6.4.0") set(KF6_MIN_VERSION "5.240.0") set(KDE_COMPILERSETTINGS_LEVEL "5.84") +set(KDE_PLASMA_VERSION "5.27") set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 20) @@ -29,7 +30,7 @@ add_definitions(-DEGL_NO_PLATFORM_SPECIFIC_TYPES) find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/modules ${ECM_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) include(FeatureSummary) include(WriteBasicConfigVersionFile) @@ -64,6 +65,14 @@ include(ECMOptionalAddSubdirectory) include(ECMConfiguredInstall) include(ECMQmlModule) include(ECMGenerateQmlTypes) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT + VARIABLE_PREFIX COMO + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/como_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/como-config-version.cmake" + SOVERSION 0 +) # required frameworks by Core find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS @@ -110,7 +119,7 @@ set_package_properties(KF6Kirigami2 PROPERTIES TYPE RUNTIME ) -find_package(Plasma ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR} +find_package(Plasma ${KDE_PLASMA_VERSION} CONFIG ) set_package_properties(Plasma PROPERTIES @@ -119,14 +128,14 @@ set_package_properties(Plasma PROPERTIES TYPE RUNTIME ) -find_package(KDecoration2 ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR} +find_package(KDecoration2 ${KDE_PLASMA_VERSION} CONFIG REQUIRED ) find_package(KScreenLocker CONFIG REQUIRED) set_package_properties(KScreenLocker PROPERTIES TYPE REQUIRED - PURPOSE "For screenlocker integration in kwin_wayland" + PURPOSE "For screenlocker integration in the Wayland session" ) find_package(Breeze 5.9.0 CONFIG) @@ -148,7 +157,7 @@ add_feature_info("Breeze-Decoration" HAVE_BREEZE_DECO "Default decoration plugin find_package(EGL) set_package_properties(EGL PROPERTIES TYPE RUNTIME - PURPOSE "Required to build KWin with EGL support" + PURPOSE "Required to build with EGL support" ) find_package(epoxy 1.3) @@ -170,13 +179,13 @@ endif() find_package(Wayland 1.2 REQUIRED COMPONENTS Cursor Server OPTIONAL_COMPONENTS Egl) set_package_properties(Wayland PROPERTIES TYPE REQUIRED - PURPOSE "Required for building KWin with Wayland support" + PURPOSE "Required for building with Wayland support" ) find_package(XKB 0.7.0) set_package_properties(XKB PROPERTIES TYPE REQUIRED - PURPOSE "Required for building KWin with Wayland support" + PURPOSE "Required for building with Wayland support" ) # TODO(romangg): Only required for X11 session. @@ -186,7 +195,7 @@ add_feature_info(XKBX11 XKBX11_FOUND "Required for handling keyboard events in X find_package(Threads) set_package_properties(Threads PROPERTIES TYPE REQUIRED - PURPOSE "Required for building KWin with Wayland support" + PURPOSE "Required for building with Wayland support" ) find_package(Libinput 1.9) @@ -197,7 +206,9 @@ set_package_properties(Pixman PROPERTIES TYPE REQUIRED PURPOSE "Required for building wlroots backend." ) -find_package(wlroots 0.17.0) + +set(WLROOTS_MIN_VERSION "0.17.0") +find_package(wlroots ${WLROOTS_MIN_VERSION}) set_package_properties(wlroots PROPERTIES TYPE REQUIRED PURPOSE "Required for building wlroots backend." @@ -241,12 +252,12 @@ set_package_properties(Freetype PROPERTIES DESCRIPTION "A font rendering engine" URL "https://www.freetype.org" TYPE REQUIRED - PURPOSE "Needed for KWin's QPA plugin." + PURPOSE "Needed for own QPA plugin." ) find_package(Fontconfig REQUIRED) set_package_properties(Fontconfig PROPERTIES TYPE REQUIRED - PURPOSE "Needed for KWin's QPA plugin." + PURPOSE "Needed for own QPA plugin." ) find_package(Wrapland REQUIRED) @@ -260,13 +271,13 @@ set_package_properties(Xwayland PROPERTIES URL "https://x.org" DESCRIPTION "Xwayland X server" TYPE RUNTIME - PURPOSE "Needed for running kwin_wayland" + PURPOSE "Needed for running Wayland" ) find_package(Libcap) set_package_properties(Libcap PROPERTIES TYPE OPTIONAL - PURPOSE "Needed for running kwin_wayland with real-time scheduling policy" + PURPOSE "Needed for running Wayland session with real-time scheduling policy" ) set(HAVE_LIBCAP ${Libcap_FOUND}) @@ -290,16 +301,13 @@ ecm_find_qmlmodule(org.kde.plasma.core 2.0) ecm_find_qmlmodule(org.kde.plasma.components 2.0) ########### configure tests ############### -option(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON) -option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON) -option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON) -option(KWIN_BUILD_PERF "Build internal tools for performance analysis at runtime." ON) - -# Binary name of KWin -set(KWIN_NAME "kwin") -set(KWIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +option(COMO_BUILD_DECORATIONS "Enable building of decorations." ON) +option(COMO_BUILD_KCMS "Enable building of configuration modules." ON) +option(COMO_BUILD_TABBOX "Enable building of Tabbox functionality" ON) +option(COMO_BUILD_PERF "Build internal tools for performance analysis at runtime." ON) -set(HAVE_PERF ${KWIN_BUILD_PERF}) +set(COMO_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(HAVE_PERF ${COMO_BUILD_PERF}) include_directories(${XKB_INCLUDE_DIR}) @@ -312,70 +320,19 @@ include(CheckSymbolExists) check_symbol_exists(SCHED_RESET_ON_FORK "sched.h" HAVE_SCHED_RESET_ON_FORK) add_feature_info("SCHED_RESET_ON_FORK" HAVE_SCHED_RESET_ON_FORK - "Required for running kwin_wayland with real-time scheduling") + "Required for running Wayland session with real-time scheduling") ########### global ############### include_directories(BEFORE - ${CMAKE_CURRENT_BINARY_DIR}/lib - ${CMAKE_CURRENT_BINARY_DIR}/lib/effect + ${CMAKE_CURRENT_BINARY_DIR}/como ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/lib - ${CMAKE_CURRENT_SOURCE_DIR}/lib/effect + ${CMAKE_CURRENT_SOURCE_DIR} ) add_subdirectory(kconf_update) -add_subdirectory(lib) +add_subdirectory(como) add_subdirectory(plugins) -if (KWIN_BUILD_KCMS) - add_subdirectory(kcms) -endif() - -add_executable(kwin_x11 ${kwin_X11_SRCS} main_x11.cpp) -target_link_libraries(kwin_x11 - desktop-kde - kwinft::script - kwinft::x11 - KF6::Crash -) - -install(TARGETS kwin_x11) - -kcoreaddons_target_static_plugins(kwin_x11 NAMESPACE "kwin/effects/plugins") - -add_executable(kwin_wayland main_wayland.cpp) -target_link_libraries(kwin_wayland - desktop-kde - kwinft::script - kwinft::wayland - kwinft::xwayland - KF6IdleTimeKWinPlugin - KF6WindowSystemKWinPlugin - KWinQpaPlugin - KF6::DBusAddons -) - -install(TARGETS kwin_wayland) -if (HAVE_LIBCAP) - install( - CODE "execute_process( - COMMAND - ${SETCAP_EXECUTABLE} - CAP_SYS_NICE=+ep - \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/kwin_wayland)" - ) -endif() - -kcoreaddons_target_static_plugins(kwin_wayland NAMESPACE "kwin/effects/plugins") - -# Required for Plasma Wayland session. It expects a binary with this name to launch on startup. -add_custom_target(kwin_wayland_wrapper ALL COMMAND - ${CMAKE_COMMAND} -E create_symlink - kwin_wayland ${CMAKE_CURRENT_BINARY_DIR}/bin/kwin_wayland_wrapper -) - -########### install files ############### - if (BUILD_TESTING) add_subdirectory(autotests) add_subdirectory(tests) @@ -385,9 +342,41 @@ if (KF6DocTools_FOUND) add_subdirectory(docs) endif() -feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) +# create a Config.cmake and a ConfigVersion.cmake file and install them +set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/como") + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/como-config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/como-config.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} +) + +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/como-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/como-config-version.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel +) + +install( + EXPORT como-export + FILE como-targets.cmake + NAMESPACE como:: + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" +) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/kwin_wayland_wrapper - DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + FILES ${CMAKE_CURRENT_BINARY_DIR}/como_version.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT Devel ) + +install( + FILES + cmake/modules/FindPixman.cmake + cmake/modules/Findwlroots.cmake + DESTINATION ${CMAKECONFIG_INSTALL_DIR}/modules +) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) + +include(Packing) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f052c6bcf..562814e77d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,43 +1,49 @@ -# Contributing to KWinFT - - - [Logging and Debugging](#logging-and-debugging) - - [General information about the running instance](#general-information-about-the-running-instance) - - [Debug console](#debug-console) - - [Runtime logging](#runtime-logging) - - [Debugging with GDB](#debugging-with-gdb) - - [Developing](#developing) - - [Compiling](#compiling) - - [Running Tests](#running-tests) - - [Learning Material](#learning-material) - - [Submission Guideline](#submission-guideline) - - [Commit Message Guideline](#commit-message-guideline) - - [Contact](#contact) +# Contributing to the Compositor Modules + +- [Contributing to the Compositor Modules](#contributing-to-the-compositor-modules) + - [Logging and Debugging](#logging-and-debugging) + - [General information about the running instance](#general-information-about-the-running-instance) + - [Debug console](#debug-console) + - [Runtime logging](#runtime-logging) + - [Preparations](#preparations) + - [DRM logging](#drm-logging) + - [Developing](#developing) + - [Compiling](#compiling) + - [Using FDBuild](#using-fdbuild) + - [Running Tests](#running-tests) + - [Local Build](#local-build) + - [Learning Material](#learning-material) + - [Submission Guideline](#submission-guideline) + - [Commit Message Guideline](#commit-message-guideline) + - [Example](#example) + - [Tooling](#tooling) + - [Contact](#contact) ## Logging and Debugging The first step in contributing to the project by either providing meaningful feedback or by directly -sending in patches is always the analysis of KWinFT's runtime. -For KWinFT that means querying general information about its internal state and studying its debug -log while running and afterwards. +sending in patches is always the analysis of runtime. +For any compositor build with COMO that means +querying general information about its internal state and studying +its debug log while running and afterwards. ### General information about the running instance -Some general information about the running KWinFT instance can be queried via D-Bus by the following +Some general information about the running compositor instance can be queried via D-Bus by the following command (the qdbus tool must be installed): qdbus org.kde.KWin /KWin supportInformation ### Debug console -KWinFT comes with an integrated debug console. You can launch it with: +Compositors based on COMO usually come with an integrated debug console. You can launch it with: qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole -Note that the debug console provides much more information when KWinFT is running as a Wayland -compositor. +Note that the debug console provides much more information when run for a Wayland compositor. ### Runtime logging #### Preparations @@ -67,170 +73,7 @@ file The above list specifies `kwin_libinput.debug=false` because otherwise the log gets spammed with lines whenever a mouse button is pressed. In the same way other logging categories above can be switched on and off by changing the respective -boolean value in this file. The change will become active after a restart of KWinFT. - -#### Simple session logging -If you start KWinFT through SDDM as part of a full Plasma session -you find its log output in the systemd journal. - -You can retrieve its output specifically with: - - journalctl --user -u plasma-kwin_x11 - journalctl --user -u plasma-kwin_wayland - -You can get live updates with the `-f` flag. -Note also that in an X11 session we have the possibility to restart KWinFT. -In this case only the first execution will log to the journal. - -#### Live logging in a terminal -##### X11: In-session logging -In an X11 session it is very easy to log KWinFT from a terminal. Just execute the following command -to restart KWinFT: - - kwin_x11 --replace - -This is of course not possible in a Wayland session because the session would immediately die with -the Wayland server KWinFT being restarted. - -##### Wayland: Nested session logging -KWinFT as a Wayland compositor can be started nested in another Wayland or X11 session -what will print its debug log directly to the terminal emulator it was started from. -For that issue following command from the terminal emulator: - - dbus-run-session kwin_wayland --width=1920 --height=1080 --xwayland --exit-with-session konsole - -This will start a nested KWinFT Wayland session with a default output size of 1080p, having -Xwayland enabled and the application Konsole already running in it. -This nested session will also go down automatically when the Konsole window *in the session* is -closed. - -You can even start a full nested Plasma session by issuing the following command in the terminal -emulator: - - dbus-run-session startplasma-wayland - -##### Wayland: VT session logging -Nested session logging is often not sufficient. The behavior of KWinFT as a Wayland compositor on -real hardware can only be tested when KWinFT is started from a pristine non-graphical state. - -To do this switch to a free different virtual terminal (VT) with the key combination `CTRL+ALT+F` -where `` is a number from 1 onward. - -For example `CTRL+ALT+F1` is always the SDDM session or an X11 session launched by SDDM -(this session then reuses the Xserver which was internally started by SDDM for SDDM's own graphical -output). -A Wayland session started from SDDM is normally put onto the next free VT -reachable with `CTRL+ALT+F2` since SDDM requires its Xserver to stay active on the first VT . - -After we found a free VT and we logged in to it a Wayland KWinFT session can be launched with the -command: - - dbus-run-session kwin_wayland --xwayland --exit-with-session konsole 2>&1 | tee my-kwinft-output - -This is similar to above command for running it in a nested session but without the parameters -defining the resolution -(instead the best resolution is selected by the hardware driver automatically). - -Additionally the error output is redirected to the standard output (by `2>&1`) -and then all output copied with *tee* into the file "my-kwinft-output" in the current working -directory. -The log can then be read from this file either after the session ended or live-updating with the -command `tail -f` again. - -As above we can start a full Plasma session as well from terminal. For that issue the command: - - dbus-run-session startplasma-wayland 2>&1 | tee my-kwinft-output - -Again the log output is copied with tee into the file "my-kwinft-output" in the current working -directory. - -Note that by default when one is running KWinFT through any of the startplasma -methods, it is invoked using a wrapper that will automatically relaunch KWinFT -when it crashes. In order to disable this behavior you can define the -environment variable `KWIN_DISABLE_RELAUNCH`. - - export KWIN_DISABLE_RELAUNCH=1 - -#### Logging a KWinFT Wayland session through SSH -Starting KWinFT from a free VT as shown above is sufficient for quickly debugging singular issues -but for rapid prototyping it is not enough since it requires a VT switch and later on reading the -debug output from a separate file. -Additionally if the session crashes the VT might be stuck what can potentially even lead to an -unusable device until after a hard reset (reboot via hardware key). - -It would be better if we could start a KWinFT session on a VT from a separate device and then seeing -the log live on this secondary device and in case of stuck session kill the session on the VT from -this second device. - -With Secure Shell (SSH) this is possible. -For that you need to [create a SSH session][ssh-intro] from your secondary device that connects to -the testing device. -That means your secondary device – where you will watch the log output at – is the *SSH client* and -your testing device – where KWinFT will be executed on – is the *SSH server*. - -Once this done on your testing device you need to go to a free VT again and login. You have now -multiple options to launch KWinFT from your secondary device *on this VT* of the testing device: -* Start a terminal multiplexer like *GNU Screen* or *tmux* in the VT and attach to its session in - the SSH session. - * For Screen issue on the VT `screen -S tty` and then `screen -x tty` in the SSH session. - * For tmux issue on the VT `tmux` and then `tmux -a` in the SSH session. -* As an alternative you can simply set the XDG_SESSION_ID in the SSH session to the one in the VT - session. - For that issue first `echo $XDG_SESSION_ID` on the VT what gives you some integer value x. - Then set the same environment variable to that value in the SSH session - by issuing `XDG_SESSION_ID=x`. - -The variant with XDG_SESSION_ID has the advantage -that the terminal the SSH session is running in behaves as usual. -If you are not used to the way Screen or tmux change the terminal input -you might feel more comfortable this way. - -A downside of the variant is that depending on your systemd version -you might have to add a separate polkit rule to allow that. -To do that as described [here][polkit-rule] create a new file - - /etc/polkit-1/rules.d/10-allow-inactive-chvt.rules - -with the following content: - - /* Allow users with inactive sessions to switch the console */ - polkit.addRule(function(action, subject) { - if (action.id == "org.freedesktop.login1.chvt" && - subject.local && subject.session) { - return polkit.Result.YES; - } - }); - -In any case you should be now able to start KWinFT directly in the SSH session with: - - dbus-run-session kwin_wayland --xwayland --exit-with-session konsole - -Or as part of a full Plasma session with: - - dbus-run-session startplasma-wayland - -This is very similar to starting KWinFT from the VT directly. -The only difference is that we do not redirect the output or copy it with tee to a file -since we can now easily follow it on the screen of our second device. - -#### Troubleshooting full session logging with systemd -As described above we can issue `dbus-run-session startplasma-wayland` -to run KWinFT as part of a full Plasma session. -In this case KWinFT is executed as a D-Bus activated systemd service -and its log should be found in the system journal as described [above](#simple-session-logging). - -But there is currently the issue that the logs are not found in the journal -when we launch the Plasma session through the `dbus-run-session` command. -This is a problem in the Wayland session as we can't restart KWinFT from within -and has been [reported upstream](https://github.com/systemd/systemd/issues/22242). - -But for now a workaround is available for the Wayland session -to still allow retrieving KWinFT's logs. -For that set the environment variable `KWIN_LOG_PATH` -to specify a file where KWinFT's stderr output should be redirected: - - export KWIN_LOG_PATH="$HOME/kwinft-wayland.log" - dbus-run-session startplasma-wayland +boolean value in this file. The change will become active after a restart of the compositor. #### DRM logging In a Wayland session we talk through wlroots directly to the @@ -269,59 +112,16 @@ So only enable it shortly before triggering the faulty behavior and disable it directly afterwards again. You then find the dmesg log in `$HOME/dmesg.log`. -### Debugging with GDB -If the KWinFT process crashes the GNU Debugger (GDB) can often provide valuable information -about the cause of the crash by reading out a backtrace leading to the crash. - -#### Access backtrace of past crashes -Enable the [recording of core dumps][arch-core-dump] and after a crash issue `coredumpctl` to see a -list of all previous backtraces. Then read the backtrace with - - coredumpctl gdb kwin_wayland - bt - -or - - coredumpctl gdb - bt - -where the first variant can be used -when you want to analyse the most recent backtrace generated for KWinFT -and in the secondary command `` is the PID of one past KWinFT process -in the list you read before with `coredumpctl` -and that you want to analyse now with GDB. - -#### Live backtraces -Running gdb on the executing program is often a faster work flow. -A first variant for that is to start one of the `kwin_wayland` commands listed above directly -through gdb like with the command - - dbus-run-session gdb --ex r --args kwin_wayland --xwayland --exit-with-session konsole - -with which a gdb-infused KWinFT Wayland session is either started as a nested session or on a VT -through SSH. - -It is not recommended to run above command directly from a VT since on a crash you will not be able -to interact with GDB and even without a crash you will not be able to exit the process anymore. - -Another option is to attach GDB to an already running KWinFT process with the following command: - - sudo gdb --ex c --pid `pidof kwin_wayland` - -Again it is recommended to only do this for a nested session or from a secondary device -since otherwise we would not be able to regain control after a crash or when the process exits. - - ## Developing ### Compiling -To start writing code for KWinFT first the project needs to be compiled. -You usually want to compile KWinFT from its -[master branch](https://gitlab.com/kwinft/kwinft/-/commits/master/) +To start writing code for the Compositor modules first the project needs to be compiled. +You usually want to compile it from its +[master branch](https://github.com/winft/como/commits/master/) as it reflects the most recent state of development. #### Using FDBuild -Since some of KWinFT's dependencies are moving targets in KDE +Since some of COMO's dependencies are moving targets in KDE that do not offer backwards compatibility guarantees, it is often required to build these KDE dependencies also from their master branches and rebuild them regularly from the most recent state of the master branch. @@ -342,7 +142,7 @@ to remember settings about the projects inside these directories. Important is the setting specifying the installation location of the projects. This is set in the fdbuild.yaml file inside the toplevel directory. Adjust the setting to your liking. Recommended is setting it to a subdirectory inside `/opt`, -for example `/opt/kwinft`. +for example `/opt/como`. Then simply run FDBuild without any arguments from the toplevel directory and FDBuild will try to compile and install all projects one after the other. @@ -359,104 +159,30 @@ from where it failed command: fdbuild --resume-from ``` -#### Plasma Desktop Session Integration -With this setup KWinFT can be run already as a standalone binary for example from a VT. -In case you did not install into your `/usr` directory, -as is recommended, -additional steps are required -to run a full Plasma Desktop session together with your self-compiled KWinFT. - -The Plasma Desktop session requires -sourcing of some environment variables -pointing to the install location. -If you run the `dbus-run-session startplasma-wayland` command from a terminal, -you can source the following script to achieve that: -``` -#!/bin/bash - -export XDG_CURRENT_DESKTOP=KDE -source /kde/plasma-desktop/build/prefix.sh -``` - - -Additionally SDDM session scripts can be installed -and the session started directly from the drop-down menu inside SDDM. For that run: -``` -/kde/plasma-workspace/login-sessions/install-sessions.sh -``` - ### Running Tests -KWinFT comes with over 100 integration tests +The Compositor Modules come with over 100 integration tests which check the expected behavior of different parts of the application. #### Local Build -To run all relevant tests go to the build directory of KWinFT and issue: +To run all relevant tests go to the build directory and issue: ``` -dbus-run-session ctest -E 'testLockScreen|testModifierOnlyShortcut' +dbus-run-session ctest -E 'lockscreen|modifier only shortcut' ``` This command is composited from two commands. Let's quickly explain the different parts: * `dbus-run-session`: starts a new DBus session for the tests, so your current session is unimpaired. * `ctest`: the CMake testing utility running binaries, that have been marked as tests in the CMake files. -* `-E 'testLockScreen|testModifierOnlyShortcut'`: exclude two tests that are currently also not run on the CI. +* `-E 'lockscreen|modifier only shortcut'`: exclude two tests that are currently also not run on the CI. You can also run a single test. All tests are separate binaries in the `bin` directory inside the build directory. -That means in order to test e.g. pointer input run from the build directory: -``` -dbus-run-session bin/testPointerInput +That means in order to test e.g. "maximize animation" run from the build directory: ``` - -You can also run a specific test function inside such a test. -For example to run the -[`testPopup` function](https://gitlab.com/kwinft/kwinft/-/blob/0435b1d/autotests/integration/pointer_input.cpp#L1229-1344) -in the pointer input test run: -``` -dbus-run-session bin/testPointerInput testPopup -``` - -#### Docker Build -In case you don't have all dependencies installed locally -or you want to replicate the exact conditions of the CI pipeline -you can also use the Docker images of KWinFT's CI pipeline. - -For that you still need a source checkout. -Then from this directory launch a container based either on the master or the stable image, -depending on what version you want to test. This is the command for the master image: - -``` -docker run --rm -it --entrypoint /bin/bash -v $PWD:/kwinft registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master -``` - -Now similar to how it's done in the CI -[build the project](https://gitlab.com/kwinft/kwinft/-/blob/5d15e2de6/.gitlab-ci.yml#L79-L85) and -[run the test suite](https://gitlab.com/kwinft/tooling/-/blob/a8a50bae36/analysis/gitlab-ci/tests.yml#L21-25) -from within the container: - -``` -Xvfb :1 -ac -screen 0 1920x1080x24 > /dev/null 2>&1 & -export DISPLAY=:1 -export WAYLAND_DEBUG=1 MESA_DEBUG=1 LIBGL_DEBUG=verbose -export QT_LOGGING_RULES="*=true" - -cmake -S /kwinft -B /kwinft/build -Wno-dev \ - -GNinja \ - -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTING=ON - -cmake --build /kwinft/build - -dbus-run-session ctest --test-dir /kwinft/build -T Test --output-on-failure --no-compress-output \ --E 'testLockScreen|testModifierOnlyShortcut|testDontCrashEmptyDeco|testDontCrashNoBorder| -|testSceneOpenGL|testSceneOpenGLShadow|testDontCrashReinitializeCompositor|testBufferSizeChange| -|testDontCrashAuroraeDestroyDeco|testSlidingPopups|testScriptedEffects|testToplevelOpenCloseAnimation| -|testDesktopSwitchingAnimation|testMinimizeAnimation' +dbus-run-session bin/tests "maximize animation" ``` ### Learning Material -The KWinFT source code is vast and complex. +The Compositor Modules source code is vast and complex. Understanding it requires time and practice. For the beginning there are still few available resources to get an overview: * [Xplain](https://magcius.github.io/xplain/article/), introduction and explanations for X11. @@ -464,16 +190,15 @@ For the beginning there are still few available resources to get an overview: series on how to write an X window manager. * [The Wayland Book](https://wayland-book.com/), explains fundamental concepts of Wayland. * [KWin now and tomorrow at XDC 2019](https://www.youtube.com/watch?v=vj70xmG_5Bs), - gives an overview about the internal structure of KWinFT. - + gives an overview about the internal structure of the Compositor Modules. ## Submission Guideline -Code contributions to KWinFT are very welcome but follow a strict process that is laid out in +Code contributions to the Compositor Modules are very welcome but follow a strict process that is laid out in detail in Wrapland's [contributing document][wrapland-submissions]. *Summarizing the main points:* -* Use [merge requests][merge-request] directly for smaller contributions, but create +* Use [pull requests][pull-requests] directly for smaller contributions, but create [issue tickets][issue] *beforehand* for [larger changes][wrapland-large-changes]. * Adhere to the [KDE Frameworks Coding Style][frameworks-style]. * Merge requests have to be posted against master or a feature branch. Commits to the stable branch @@ -496,22 +221,18 @@ amendments: * style: improvements to code style without logic change * test: addition of a new test or correction of an existing one * Only the following optional scopes are allowed: - * debug: internal debug tools - * deco: window decorations - * effect: libkwineffects and internal effects handling - * input: libinput integration and input redirection - * hw: platform integration (drm, virtual, wayland,...) - * qpa: internal Qt Platform Abstraction plugin of KWinFT - * scene: composition of the overall scene - * script: API for KWinFT scripting - * space: virtual desktops and activities, workspace organisation and window placement - * xwl: XWayland integration + * input: library input module + * plugin: any plugin + * render: library render module + * win: library win module + * wl: Wayland windowing system related + * x11: X11 windowing system related * Any line of the message must be 90 characters or shorter. * Angular's [Revert][angular-revert] and [Subject][angular-subject] policies are applied. ### Example - fix(deco): provide correct return value + fix(input): provide correct return value For function exampleFunction the return value was incorrect. Instead provide the correct value A by changing B to C. @@ -524,15 +245,11 @@ See [Wrapland's documentation][wrapland-contact] for contact information. [angular-revert]: https://github.com/angular/angular/blob/3cf2005a936bec2058610b0786dd0671dae3d358/CONTRIBUTING.md#revert [angular-subject]: https://github.com/angular/angular/blob/3cf2005a936bec2058610b0786dd0671dae3d358/CONTRIBUTING.md#subject -[arch-core-dump]: https://wiki.archlinux.org/index.php/Core_dump [conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/#specification [frameworks-style]: https://community.kde.org/Policies/Frameworks_Coding_Style -[issue]: https://gitlab.com/kwinft/kwinft/-/issues -[merge-request]: https://gitlab.com/kwinft/kwinft/-/merge_requests -[plasma-schedule]: https://community.kde.org/Schedules/Plasma_5 -[polkit-rule]: https://github.com/swaywm/wlroots/issues/2236#issuecomment-635934081 -[ssh-intro]: https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys -[wrapland-contact]: https://gitlab.com/kwinft/wrapland/-/blob/master/CONTRIBUTING.md#contact -[wrapland-large-changes]: https://gitlab.com/kwinft/wrapland/-/blob/master/CONTRIBUTING.md#issues-for-large-changes -[wrapland-submissions]: https://gitlab.com/kwinft/wrapland/-/blob/master/CONTRIBUTING.md#submission-guideline -[wrapland-tooling]: https://gitlab.com/kwinft/wrapland/-/blob/master/CONTRIBUTING.md#tooling +[issue]: https://github.com/winft/como/issues +[pull-requests]: https://github.com/winft/como/pulls +[wrapland-contact]: https://github.com/winft/wrapland/blob/master/CONTRIBUTING.md#contact +[wrapland-large-changes]: https://github.com/winft/wrapland/blob/master/CONTRIBUTING.md#issues-for-large-changes +[wrapland-submissions]: https://github.com/winft/wrapland/blob/master/CONTRIBUTING.md#submission-guideline +[wrapland-tooling]: https://github.com/winft/wrapland/blob/master/CONTRIBUTING.md#tooling diff --git a/README.md b/README.md index 182fc6f912..b9a4341cae 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,75 @@ -# KWinFT - -KWinFT (KWin Fast Track) is a robust, fast and versatile yet -easy to use composited window manager for the -[Wayland](https://wayland.freedesktop.org/) and -[X11](https://en.wikipedia.org/wiki/X_Window_System) -windowing systems on Linux. +
+

+ + + + The Compositor Modules wide logo + +

-

- KWinFT Plasma Wayland session -
+The Compositor Modules (COMO) are a robust and versatile set of libraries +
+to create compositors for the Wayland and X11 windowing systems on Linux.

+
+ +# Features + +**Compatibility** +
+The Compositor Modules currently integrate primarily with +KDE's Plasma Desktop but can be used with other desktop environments as well. +This cross-desktop interoperability will be expanded upon in the future. + +**Ease of Use** +
+With the Compositor Modules a Wayland compositor can be created with a handful of lines only. +See our MVP [Minico](tests/minico) for an example of that. + +**Customizability**
+The Compositor Modules make heavy use of C++ templates. This allows consumers to replace +many functions and types with customized versions when required. -KWinFT is intended to be used as part of a -[KDE Plasma Desktop](https://kde.org/plasma-desktop/). -The KWinFT project is a reboot of KDE's -[KWin](https://en.wikipedia.org/wiki/KWin). -KWinFT differentates itself from KWin in some important aspects: -* KWinFT values stability and robustness. - This is achieved through upholding strict development standards - and deploying modern development methods to prevent regressions and code smell. -* KWinFT values collaboration with competitors and and upstream partners. - We want to overcome antiquated notions on community divisions - and work together on the best possible Linux graphics platform. -* KWinFT values the knowledge of experts but also the curiosity of beginners. - Well defined and transparent decision processes enable expert knowledge to proliferate - and new contributors to easily find help on their first steps. - -## Installation -Your distribution might provide KWinFT already as a package: - * Arch(AUR): [kwinft](https://aur.archlinux.org/packages/kwinft) - * Manjaro: `sudo pacman -S kwinft` - -Alternatively KWinFT can be compiled from source. +# Values + +**Stability and robustness** + +This is achieved through upholding strict development standards +and deploying modern development methods to prevent regressions and code smell. + +**Collaboration with competitors and upstream partners** + +We want to overcome antiquated notions on community divisions +and work together on the best possible Linux graphics platform. + +**Value the knowledge of experts but also the curiosity of beginners** + +Well defined and transparent decision processes enable expert knowledge to proliferate +and new contributors to easily find help on their first steps. + +# Installation +The Compositor Modules can be compiled from source. If you do that manually you have to check for your specific distribution how to best get the required dependencies. + You can also make use of the FDBuild tool to automate that process as described [here](CONTRIBUTING.md#compiling). -## Usage -KWinFT can be used as a drop-in replacement for KWin inside a KDE Plasma Desktop session. -After installation and a system restart the KWinFT binary will execute. -All configuration, plugins and shell interaction transfer over. +# Usage +It's easiest to link via CMake to the Compositor Modules libraries that you want to use. +As an example check out the test code of [Minico](tests/minico) and the [Plasma binaries](tests/plasma). -## Development +# Development The [CONTRIBUTING.md](CONTRIBUTING.md) document contains all information on how to get started with: * providing useful debug information, -* building KWinFT +* building the Compositor Modules * and doing your first code submission to the project. - -If you want to write an effect or script for KWinFT -you can do this as usual with the respective APIs that KWinFT provides. -We try to keep these APIs compatible with the ones of KWin -but there is no guarantee on that. -If there are incompatible changes or API-breaking changes in general, -this will be announced in the changelog. diff --git a/autotests/gestures.cpp b/autotests/gestures.cpp index 3137edc0db..1b11ce5d2c 100644 --- a/autotests/gestures.cpp +++ b/autotests/gestures.cpp @@ -6,12 +6,12 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "integration/lib/catch_macros.h" -#include "win/input/gestures.h" +#include "como/win/input/gestures.h" #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("gestures unit", "[input],[unit]") diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index 478b7115b1..845ec533b1 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -106,7 +106,7 @@ add_executable(tests ../libkwineffects/mock_gl.cpp ../tabbox/mock_tabbox_client.cpp ../tabbox/mock_tabbox_handler.cpp - ../../lib/render/backend/x11/glx_context_attribute_builder.cpp + ../../como/render/backend/x11/glx_context_attribute_builder.cpp ) target_compile_definitions(tests PRIVATE USE_XWL=1) @@ -114,18 +114,14 @@ target_compile_definitions(tests PRIVATE USE_XWL=1) target_link_libraries(tests PRIVATE desktop-kde - kwinft::wayland - kwinft::xwayland + como::wayland + como::xwayland script Qt::Test Catch2::Catch2WithMain KF6::Crash KF6::WindowSystem WraplandClient - # Static plugins - KWinQpaPlugin - KF6WindowSystemKWinPlugin - KF6IdleTimeKWinPlugin ) add_executable(tests-wl @@ -196,17 +192,13 @@ target_compile_definitions(tests-wl PRIVATE USE_XWL=0) target_link_libraries(tests-wl PRIVATE desktop-kde - kwinft::wayland + como::wayland script Qt::Test Catch2::Catch2WithMain KF6::Crash KF6::WindowSystem WraplandClient - # Static plugins - KWinQpaPlugin - KF6WindowSystemKWinPlugin - KF6IdleTimeKWinPlugin ) include(Catch) diff --git a/autotests/integration/activation.cpp b/autotests/integration/activation.cpp index 5167de4150..c61d7baab9 100644 --- a/autotests/integration/activation.cpp +++ b/autotests/integration/activation.cpp @@ -9,7 +9,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("activation", "[win]") diff --git a/autotests/integration/bindings.cpp b/autotests/integration/bindings.cpp index 592323d20c..c3e1aea9e3 100644 --- a/autotests/integration/bindings.cpp +++ b/autotests/integration/bindings.cpp @@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("bindings", "[input],[win]") diff --git a/autotests/integration/buffer_size_change.cpp b/autotests/integration/buffer_size_change.cpp index 6cf0824301..fe7ab63cf9 100644 --- a/autotests/integration/buffer_size_change.cpp +++ b/autotests/integration/buffer_size_change.cpp @@ -10,7 +10,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("buffer size change", "[render]") diff --git a/autotests/integration/client_machine.cpp b/autotests/integration/client_machine.cpp index 6c1ad361ce..7f839855df 100644 --- a/autotests/integration/client_machine.cpp +++ b/autotests/integration/client_machine.cpp @@ -12,7 +12,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("client machine", "[win],[xwl]") diff --git a/autotests/integration/dbus_interface.cpp b/autotests/integration/dbus_interface.cpp index 8ccd261fd8..6bb50a8794 100644 --- a/autotests/integration/dbus_interface.cpp +++ b/autotests/integration/dbus_interface.cpp @@ -16,7 +16,7 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { const QString s_destination{QStringLiteral("org.kde.KWin")}; diff --git a/autotests/integration/debug_console.cpp b/autotests/integration/debug_console.cpp index 5a02cd8a88..a745233488 100644 --- a/autotests/integration/debug_console.cpp +++ b/autotests/integration/debug_console.cpp @@ -14,7 +14,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { class HelperWindow : public QRasterWindow diff --git a/autotests/integration/decoration_input.cpp b/autotests/integration/decoration_input.cpp index a759dd3153..53fab82981 100644 --- a/autotests/integration/decoration_input.cpp +++ b/autotests/integration/decoration_input.cpp @@ -21,7 +21,7 @@ SPDX-License-Identifier: GPL-2.0-or-later Q_DECLARE_METATYPE(Qt::WindowFrameSection) -namespace KWin::detail::test +namespace como::detail::test { #define MOTION(target) pointer_motion_absolute(target, timestamp++) diff --git a/autotests/integration/desktop_window_x11.cpp b/autotests/integration/desktop_window_x11.cpp index fd1fc88048..8e6645d215 100644 --- a/autotests/integration/desktop_window_x11.cpp +++ b/autotests/integration/desktop_window_x11.cpp @@ -8,7 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("x11 desktop window", "[xwl],[win]") diff --git a/autotests/integration/effects/fade.cpp b/autotests/integration/effects/fade.cpp index 0647c8eaf7..fe1f5b6232 100644 --- a/autotests/integration/effects/fade.cpp +++ b/autotests/integration/effects/fade.cpp @@ -12,14 +12,14 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("fade", "[effect]") { - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", "1"); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); + qRegisterMetaType(); test::setup setup("fade"); diff --git a/autotests/integration/effects/maximize_animation.cpp b/autotests/integration/effects/maximize_animation.cpp index 5c465ee6a8..f0f03d1b19 100644 --- a/autotests/integration/effects/maximize_animation.cpp +++ b/autotests/integration/effects/maximize_animation.cpp @@ -10,12 +10,12 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("maximize animation", "[effect]") { - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); #if USE_XWL diff --git a/autotests/integration/effects/minimize_animation.cpp b/autotests/integration/effects/minimize_animation.cpp index 63b16d8675..988bb4430f 100644 --- a/autotests/integration/effects/minimize_animation.cpp +++ b/autotests/integration/effects/minimize_animation.cpp @@ -12,13 +12,13 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("minimize animation", "[effect]") { qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); #if USE_XWL diff --git a/autotests/integration/effects/popup_open_close_animation.cpp b/autotests/integration/effects/popup_open_close_animation.cpp index 34f4711f89..86b65b58e9 100644 --- a/autotests/integration/effects/popup_open_close_animation.cpp +++ b/autotests/integration/effects/popup_open_close_animation.cpp @@ -12,12 +12,12 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("popup open close animation", "[effect]") { - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); #if USE_XWL diff --git a/autotests/integration/effects/scripted_effects.cpp b/autotests/integration/effects/scripted_effects.cpp index 55c30c65eb..07ed243864 100644 --- a/autotests/integration/effects/scripted_effects.cpp +++ b/autotests/integration/effects/scripted_effects.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "lib/setup.h" -#include +#include "como/render/effect/interface/anidata_p.h" #include #include @@ -23,7 +23,7 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace std::chrono_literals; -namespace KWin::detail::test +namespace como::detail::test { namespace @@ -58,7 +58,7 @@ QList ScriptedEffectWithDebugSpy::actions() ScriptedEffectWithDebugSpy::ScriptedEffectWithDebugSpy(test::setup& setup) : scripting::effect( - *KWin::effects, + *como::effects, [&]() -> render::options& { return *setup.base->mod.render->options; }, [&] { return setup.base->topology.size; }) , setup{setup} @@ -81,11 +81,11 @@ bool ScriptedEffectWithDebugSpy::load(const QString& name) // used to find the internal effectloader and register ourselves auto c = effects.children(); for (auto it = c.begin(); it != c.end(); ++it) { - if (qstrcmp((*it)->metaObject()->className(), "KWin::render::basic_effect_loader") != 0) { + if (qstrcmp((*it)->metaObject()->className(), "como::render::basic_effect_loader") != 0) { continue; } QMetaObject::invokeMethod( - *it, "effectLoaded", Q_ARG(KWin::Effect*, this), Q_ARG(QString, name)); + *it, "effectLoaded", Q_ARG(como::Effect*, this), Q_ARG(QString, name)); break; } @@ -96,9 +96,9 @@ bool ScriptedEffectWithDebugSpy::load(const QString& name) TEST_CASE("scripted effects", "[effect]") { - qRegisterMetaType(); + qRegisterMetaType(); qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", "1"); #if USE_XWL auto operation_mode = GENERATE(base::operation_mode::wayland, base::operation_mode::xwayland); @@ -289,7 +289,7 @@ TEST_CASE("scripted effects", "[effect]") auto* effect = new ScriptedEffectWithDebugSpy(setup); // cleaned up in ::clean QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); QVERIFY(effect->load("screenEdgeTest")); - effect->borderActivated(KWin::ElectricTopRight); + effect->borderActivated(como::ElectricTopRight); QCOMPARE(effectOutputSpy.count(), 1); } diff --git a/autotests/integration/effects/slidingpopups.cpp b/autotests/integration/effects/slidingpopups.cpp index 62bb15e4f5..a818cee588 100644 --- a/autotests/integration/effects/slidingpopups.cpp +++ b/autotests/integration/effects/slidingpopups.cpp @@ -14,15 +14,15 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("slidingpopups", "[effect]") { qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", "1"); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); + qRegisterMetaType(); test::setup setup("slidingpopups", base::operation_mode::xwayland); diff --git a/autotests/integration/effects/subspace_switching_animation.cpp b/autotests/integration/effects/subspace_switching_animation.cpp index 4b0d3ae16a..f42c732f0c 100644 --- a/autotests/integration/effects/subspace_switching_animation.cpp +++ b/autotests/integration/effects/subspace_switching_animation.cpp @@ -10,7 +10,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("subspace switching animation", "[effect]") @@ -22,7 +22,7 @@ TEST_CASE("subspace switching animation", "[effect]") auto effectName = GENERATE(QString("cubeslide"), QString("fadedesktop"), QString("slide")); qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); test::setup setup("subspace-switching-animation"); diff --git a/autotests/integration/effects/translucency.cpp b/autotests/integration/effects/translucency.cpp index c6603d4156..d3e6e83913 100644 --- a/autotests/integration/effects/translucency.cpp +++ b/autotests/integration/effects/translucency.cpp @@ -9,14 +9,14 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("translucency", "[effect]") { - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", "1"); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); + qRegisterMetaType(); test::setup setup("translucency", base::operation_mode::xwayland); diff --git a/autotests/integration/effects/window_open_close_animation.cpp b/autotests/integration/effects/window_open_close_animation.cpp index 5a4c57dfb3..9d829a47f8 100644 --- a/autotests/integration/effects/window_open_close_animation.cpp +++ b/autotests/integration/effects/window_open_close_animation.cpp @@ -10,13 +10,13 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("window open close animation", "[effect]") { qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); + qputenv("COMO_EFFECTS_FORCE_ANIMATIONS", QByteArrayLiteral("1")); qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); #if USE_XWL diff --git a/autotests/integration/generic_scene_opengl.h b/autotests/integration/generic_scene_opengl.h index 4ab4125004..977e44ba16 100644 --- a/autotests/integration/generic_scene_opengl.h +++ b/autotests/integration/generic_scene_opengl.h @@ -8,7 +8,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include "lib/setup.h" -namespace KWin::detail::test +namespace como::detail::test { inline std::unique_ptr generic_scene_opengl_get_setup(std::string const& test_name, diff --git a/autotests/integration/gestures.cpp b/autotests/integration/gestures.cpp index 57955f0848..26258eed7e 100644 --- a/autotests/integration/gestures.cpp +++ b/autotests/integration/gestures.cpp @@ -9,7 +9,7 @@ #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("gestures", "[input]") diff --git a/autotests/integration/global_shortcuts.cpp b/autotests/integration/global_shortcuts.cpp index 60a092aa53..b5f2eb6fab 100644 --- a/autotests/integration/global_shortcuts.cpp +++ b/autotests/integration/global_shortcuts.cpp @@ -17,7 +17,7 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("global shortcuts", "[input]") @@ -77,7 +77,7 @@ TEST_CASE("global shortcuts", "[input]") QKeySequence const seq(mod_test_data.qt | key_test_data.qt); auto action = std::make_unique(); - action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setProperty("componentName", "kwin"); action->setObjectName("globalshortcuts-test-non-latin-layout"); QSignalSpy triggeredSpy(action.get(), &QAction::triggered); @@ -103,7 +103,7 @@ TEST_CASE("global shortcuts", "[input]") { // Verifies that a shortcut with a consumed shift modifier triggers create the action. auto action = std::make_unique(); - action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setProperty("componentName", "kwin"); action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift")); QSignalSpy triggeredSpy(action.get(), &QAction::triggered); @@ -134,7 +134,7 @@ TEST_CASE("global shortcuts", "[input]") // another key should stop triggering the shortcut. auto action = std::make_unique(); - action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setProperty("componentName", "kwin"); action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift")); QSignalSpy triggeredSpy(action.get(), &QAction::triggered); @@ -204,7 +204,7 @@ TEST_CASE("global shortcuts", "[input]") { // BUG 370341 auto action = std::make_unique(); - action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setProperty("componentName", QStringLiteral("kwin")); action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w")); QSignalSpy triggeredSpy(action.get(), &QAction::triggered); QVERIFY(triggeredSpy.isValid()); @@ -234,7 +234,7 @@ TEST_CASE("global shortcuts", "[input]") { // BUG 390110 auto action = std::make_unique(); - action->setProperty("componentName", QStringLiteral(KWIN_NAME)); + action->setProperty("componentName", QStringLiteral("kwin")); action->setObjectName(QStringLiteral("globalshortcuts-accent")); QSignalSpy triggeredSpy(action.get(), &QAction::triggered); diff --git a/autotests/integration/idle.cpp b/autotests/integration/idle.cpp index 140f3350d9..6e868f0806 100644 --- a/autotests/integration/idle.cpp +++ b/autotests/integration/idle.cpp @@ -12,7 +12,7 @@ #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("idle", "[input]") diff --git a/autotests/integration/idle_inhibition.cpp b/autotests/integration/idle_inhibition.cpp index 7c952b8b3a..80ec7b20f8 100644 --- a/autotests/integration/idle_inhibition.cpp +++ b/autotests/integration/idle_inhibition.cpp @@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("idle inhibition", "[win]") diff --git a/autotests/integration/input_method.cpp b/autotests/integration/input_method.cpp index 1067375157..b4f360e8db 100644 --- a/autotests/integration/input_method.cpp +++ b/autotests/integration/input_method.cpp @@ -18,7 +18,7 @@ #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("input method", "[input],[win]") diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 5374e457bc..5db47ff487 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -18,7 +18,7 @@ SPDX-License-Identifier: GPL-2.0-or-later #include #include -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("input stacking order", "[win]") diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index 653ccff986..81543712e3 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -128,7 +128,7 @@ void HelperWindow::keyReleaseEvent(QKeyEvent* event) } -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("internal window", "[win]") diff --git a/autotests/integration/keyboard_keymap.cpp b/autotests/integration/keyboard_keymap.cpp index 9f61bda280..d2a9a6ec40 100644 --- a/autotests/integration/keyboard_keymap.cpp +++ b/autotests/integration/keyboard_keymap.cpp @@ -14,7 +14,7 @@ #include #include -namespace KWin::detail::test +namespace como::detail::test { namespace diff --git a/autotests/integration/keyboard_layout.cpp b/autotests/integration/keyboard_layout.cpp index 2f42d11090..5f9c66d1db 100644 --- a/autotests/integration/keyboard_layout.cpp +++ b/autotests/integration/keyboard_layout.cpp @@ -21,7 +21,7 @@ extern "C" { #include } -namespace KWin::detail::test +namespace como::detail::test { namespace diff --git a/autotests/integration/keymap_creation_failure.cpp b/autotests/integration/keymap_creation_failure.cpp index 653cc47cf4..6c2b0c73d1 100644 --- a/autotests/integration/keymap_creation_failure.cpp +++ b/autotests/integration/keymap_creation_failure.cpp @@ -11,7 +11,7 @@ SPDX-License-Identifier: GPL-2.0-or-later using namespace Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { TEST_CASE("keymap creation failure", "[input]") diff --git a/autotests/integration/layer_shell.cpp b/autotests/integration/layer_shell.cpp index f78332a6d9..732a45d1d1 100644 --- a/autotests/integration/layer_shell.cpp +++ b/autotests/integration/layer_shell.cpp @@ -12,7 +12,7 @@ namespace Clt = Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { namespace diff --git a/autotests/integration/lib/client.cpp b/autotests/integration/lib/client.cpp index c2ac5d6c35..d253630aa9 100644 --- a/autotests/integration/lib/client.cpp +++ b/autotests/integration/lib/client.cpp @@ -17,7 +17,7 @@ namespace Clt = Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { client::client(global_selection globals) diff --git a/autotests/integration/lib/client.h b/autotests/integration/lib/client.h index fc0870e3c3..e61b186cd3 100644 --- a/autotests/integration/lib/client.h +++ b/autotests/integration/lib/client.h @@ -7,7 +7,7 @@ #include "types.h" -#include "kwin_export.h" +#include #include #include @@ -36,10 +36,10 @@ #include #include -namespace KWin::detail::test +namespace como::detail::test { -class KWIN_EXPORT client +class COMO_EXPORT client { public: Wrapland::Client::ConnectionThread* connection{nullptr}; diff --git a/autotests/integration/lib/helpers.cpp b/autotests/integration/lib/helpers.cpp index 14e6b6167a..7b8945787d 100644 --- a/autotests/integration/lib/helpers.cpp +++ b/autotests/integration/lib/helpers.cpp @@ -8,13 +8,13 @@ #include "setup.h" -#include "base/output_helpers.h" -#include "desktop/screen_locker_watcher.h" -#include "input/backend/wlroots/keyboard.h" -#include "input/backend/wlroots/pointer.h" -#include "input/backend/wlroots/touch.h" -#include "win/wayland/space.h" -#include "win/wayland/window.h" +#include "como/base/output_helpers.h" +#include "como/desktop/screen_locker_watcher.h" +#include "como/input/backend/wlroots/keyboard.h" +#include "como/input/backend/wlroots/pointer.h" +#include "como/input/backend/wlroots/touch.h" +#include "como/win/wayland/space.h" +#include "como/win/wayland/window.h" #include #include @@ -25,7 +25,7 @@ namespace Clt = Wrapland::Client; -namespace KWin::detail::test +namespace como::detail::test { output::output(QRect const& geometry) @@ -573,7 +573,7 @@ void keyboard_key_pressed(uint32_t key, uint32_t time, wlr_keyboard* keyboard) keyboard_key_impl(key, time, true, WL_KEYBOARD_KEY_STATE_PRESSED, keyboard); } -KWIN_EXPORT void keyboard_key_released(uint32_t key, uint32_t time, wlr_keyboard* keyboard) +void keyboard_key_released(uint32_t key, uint32_t time, wlr_keyboard* keyboard) { keyboard_key_impl(key, time, true, WL_KEYBOARD_KEY_STATE_RELEASED, keyboard); } diff --git a/autotests/integration/lib/helpers.h b/autotests/integration/lib/helpers.h index 7c8aeabde8..44c46450ec 100644 --- a/autotests/integration/lib/helpers.h +++ b/autotests/integration/lib/helpers.h @@ -10,21 +10,22 @@ #include #include "types.h" +#include -#include "base/output.h" -#include "win/wayland/window.h" -#include