Report unavailable protocols and services; send combos as real keys

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>
This commit is contained in:
2026-10-15 11:36:56 +02:00
co-authored by Claude Opus 5.5
parent 6164839886
commit 499e5ee76e
21 changed files with 362 additions and 104 deletions
+14 -1
View File
@@ -26,6 +26,7 @@ qt_add_library(sloposk_core STATIC
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.
@@ -39,6 +40,7 @@ set(SLOPOSK_QML_FILES
SectionHeader.qml
SettingsButton.qml
SettingsPanel.qml
ProblemList.qml
ToggleRow.qml
SliderRow.qml
Theme.qml
@@ -68,6 +70,7 @@ 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)
@@ -77,6 +80,7 @@ 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
@@ -107,4 +111,13 @@ target_link_libraries(sloposk PRIVATE
)
install(TARGETS sloposk)
install(FILES ${PROJECT_SOURCE_DIR}/data/org.sloposk.keyboard.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
# 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)