Diagnostics collects what this session doesn't allow, logs it, and lists it in the settings panel (with a dot on the gear): KWin not launching sloposk as its keyboard (detected by WAYLAND_SOCKET, since KWin offers the input-method global to every client), fake input missing or too old, org.kde.keyboard unreachable, and the D-Bus control name taken. Modifier combos go through fake input even in text fields: KWin drops the input method's modifier mask for most clients, so Ctrl+A typed "a". The desktop file is generated with an absolute Exec, which KWin needs to match it: one for the installed binary, one for the build's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
124 lines
4.8 KiB
CMake
124 lines
4.8 KiB
CMake
# --- sloposk_core: everything that runs without a compositor; also the "Sloposk" QML module.
|
|
|
|
qt_add_library(sloposk_core STATIC
|
|
backend/TextBackend.h
|
|
backend/TextContext.h
|
|
engine/InputEngine.h
|
|
engine/DirectEngine.h engine/DirectEngine.cpp
|
|
input/ShiftState.h input/ShiftState.cpp
|
|
input/Modifiers.h input/Modifiers.cpp
|
|
input/DeadKeys.h input/DeadKeys.cpp
|
|
input/HardwareKeys.h input/HardwareKeys.cpp
|
|
input/PointerTracker.h input/PointerTracker.cpp
|
|
input/AlternatesPicker.h input/AlternatesPicker.cpp
|
|
input/KeyRepeater.h input/KeyRepeater.cpp
|
|
input/TextRules.h input/TextRules.cpp
|
|
input/TypingOptions.h
|
|
input/KeyboardController.h input/KeyboardController.cpp
|
|
input/KeyboardSurface.h input/KeyboardSurface.cpp
|
|
layout/Layout.h
|
|
layout/LayoutLoader.h layout/LayoutLoader.cpp
|
|
layout/KeymapKeys.h layout/KeymapKeys.cpp
|
|
layout/LayoutBuilder.h layout/LayoutBuilder.cpp
|
|
layout/KeyGeometry.h layout/KeyGeometry.cpp
|
|
layout/LayoutModel.h layout/LayoutModel.cpp
|
|
window/VisibilityController.h window/VisibilityController.cpp
|
|
window/WindowSettings.h window/WindowSettings.cpp
|
|
settings/DebouncedStore.h settings/DebouncedStore.cpp
|
|
settings/Settings.h settings/Settings.cpp
|
|
diagnostics/Diagnostics.h diagnostics/Diagnostics.cpp
|
|
)
|
|
|
|
# QML lives in the top-level qml/ dir; alias each file so the module sees it at its root.
|
|
set(SLOPOSK_QML_FILES
|
|
Main.qml
|
|
Keyboard.qml
|
|
Key.qml
|
|
AlternatesPopup.qml
|
|
DragHandle.qml
|
|
ResizeHandle.qml
|
|
SectionHeader.qml
|
|
SettingsButton.qml
|
|
SettingsPanel.qml
|
|
ProblemList.qml
|
|
ToggleRow.qml
|
|
SliderRow.qml
|
|
Theme.qml
|
|
)
|
|
list(TRANSFORM SLOPOSK_QML_FILES PREPEND ${PROJECT_SOURCE_DIR}/qml/ OUTPUT_VARIABLE sloposk_qml_paths)
|
|
foreach(file IN LISTS SLOPOSK_QML_FILES)
|
|
set_source_files_properties(${PROJECT_SOURCE_DIR}/qml/${file} PROPERTIES QT_RESOURCE_ALIAS ${file})
|
|
endforeach()
|
|
set_source_files_properties(${PROJECT_SOURCE_DIR}/qml/Theme.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
|
|
|
qt_add_qml_module(sloposk_core
|
|
URI Sloposk
|
|
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml/Sloposk
|
|
QML_FILES ${sloposk_qml_paths}
|
|
)
|
|
|
|
file(GLOB layout_files CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/layouts/*.json)
|
|
qt_add_resources(sloposk_core "layouts"
|
|
PREFIX /layouts
|
|
BASE ${PROJECT_SOURCE_DIR}/layouts
|
|
FILES ${layout_files}
|
|
)
|
|
|
|
target_include_directories(sloposk_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
# The generated QML type registration includes QML_ELEMENT headers by bare name.
|
|
target_include_directories(sloposk_core PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/input
|
|
${CMAKE_CURRENT_SOURCE_DIR}/layout
|
|
${CMAKE_CURRENT_SOURCE_DIR}/settings
|
|
${CMAKE_CURRENT_SOURCE_DIR}/diagnostics
|
|
)
|
|
target_link_libraries(sloposk_core PUBLIC Qt6::Quick PkgConfig::XKB)
|
|
|
|
# --- sloposk: the app, with the compositor-specific parts.
|
|
|
|
qt_add_executable(sloposk
|
|
main.cpp
|
|
app/DevHooks.h app/DevHooks.cpp
|
|
app/DBusControl.h app/DBusControl.cpp
|
|
app/Checks.h app/Checks.cpp
|
|
app/QuitOnSignal.h app/QuitOnSignal.cpp
|
|
app/SystemLayouts.h app/SystemLayouts.cpp
|
|
backend/InputMethodProtocol.h
|
|
backend/KWinInputMethod.h backend/KWinInputMethod.cpp
|
|
backend/KWinInputContext.h backend/KWinInputContext.cpp
|
|
backend/KWinFakeInput.h backend/KWinFakeInput.cpp
|
|
backend/WaylandKeymap.h backend/WaylandKeymap.cpp
|
|
window/FloatingWindow.h window/FloatingWindow.cpp
|
|
window/KWinRule.h window/KWinRule.cpp
|
|
)
|
|
|
|
qt6_generate_wayland_protocol_client_sources(sloposk PRIVATE_CODE FILES
|
|
${WAYLAND_PROTOCOLS_DIR}/unstable/input-method/input-method-unstable-v1.xml
|
|
${PROJECT_SOURCE_DIR}/protocols/fake-input.xml
|
|
)
|
|
# Generated code lacks the core-protocol include (see backend/InputMethodProtocol.h).
|
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/qwayland-input-method-unstable-v1.cpp
|
|
PROPERTIES COMPILE_OPTIONS "-include;wayland-client-protocol.h")
|
|
|
|
target_link_libraries(sloposk PRIVATE
|
|
sloposk_core
|
|
sloposk_coreplugin
|
|
Qt6::DBus
|
|
Qt6::WaylandClient
|
|
KF6::ConfigCore
|
|
KF6::WindowSystem
|
|
PkgConfig::WAYLAND
|
|
)
|
|
|
|
install(TARGETS sloposk)
|
|
# KWin grants restricted protocols by matching Exec to the absolute executable
|
|
# path. One file runs the installed binary; the other the build's, for development.
|
|
set(SLOPOSK_EXEC ${CMAKE_INSTALL_FULL_BINDIR}/sloposk)
|
|
configure_file(${PROJECT_SOURCE_DIR}/data/org.sloposk.keyboard.desktop.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/install/org.sloposk.keyboard.desktop @ONLY)
|
|
set(SLOPOSK_EXEC ${CMAKE_CURRENT_BINARY_DIR}/sloposk)
|
|
configure_file(${PROJECT_SOURCE_DIR}/data/org.sloposk.keyboard.desktop.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/org.sloposk.keyboard.desktop @ONLY)
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install/org.sloposk.keyboard.desktop
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|