Commit 4af785ea authored by Sebastian Kügler's avatar Sebastian Kügler Committed by Daniel Vrátil
Browse files

rework kscreen's OSD logic

Summary:
This changeset moves the various OSDs used in kscreen (output identifier, display button feedback) into the kded module.

The functional change in here is that instead of calling into plasmashell, now kscreen renders its own OSD. Plasmashell falls short since it doesn't offer the controls which kscreen needs, namely deciding what ends up on which output. The display button feedback is done entirely in the kded module, the output identification bits will be called over dbus by the new kscreen module. (I don't want to change the old one too much at this point.)

The ui code also now works better on high dpi displays.

I've tested this code on Wayland and X11, and it works on both. The previous OSD code doesn't.

Delaying the display button switch now also allows us to indicate what actually happened after pressing the button, so the user gets much better feedback (after the changes have been applied.)

Test Plan:
- tested on X11 and wayland, multi and single screen
- changeset contains a test app

Reviewers: #plasma

Subscribers: plasma-devel, davidedmundson

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3598
parent bd9c1d86
......@@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(Qt5 REQUIRED COMPONENTS QuickWidgets Test)
find_package(KF5 REQUIRED COMPONENTS DBusAddons Config ConfigWidgets I18n XmlGui GlobalAccel WidgetsAddons
Declarative IconThemes Plasma WindowSystem
Declarative IconThemes Plasma
)
# WARNING PlasmaQuick provides unversioned CMake config
find_package(KF5 REQUIRED COMPONENTS PlasmaQuick)
......
include_directories(${CMAKE_SOURCE_DIR}/kcm/src)
add_executable(osdtest main.cpp osdtest.cpp ../../kded/osd.cpp ../../kded/osdmanager.cpp ../../kcm/src/utils.cpp)
add_executable(osdtest main.cpp
osdtest.cpp
../../kded/osd.cpp
../../kded/osdmanager.cpp
../../kcm/src/utils.cpp
)
target_link_libraries(osdtest Qt5::Core
Qt5::DBus
Qt5::Quick
Qt5::Qml
KF5::Screen
#KF5::PlasmaQuick
KF5::I18n
KF5::Declarative
#KF5::IconThemes
#KF5::QuickAddons
)
add_test(kscreen-kded-osdtest osdtest)
......
......@@ -26,12 +26,8 @@ int main(int argc, char **argv)
QGuiApplication app(argc, argv);
KScreen::OsdTest osdtest;
QCommandLineOption config = QCommandLineOption(QStringList() << QStringLiteral("c") << "config",
QStringLiteral("Config file"), "config");
QCommandLineParser parser;
parser.addHelpOption();
parser.addOption(config);
parser.process(app);
osdtest.start();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment