kcms/options: Hide "active mouse screen" option

In the late Plasma 5 times we agreed that it would be better to drop
"active mouse screen" option and stick with last interacted screen
approach instead. However, it was forgotten and nobody has pursued this
goal, so let's hide the option in the system settings ui at least.

The option is not completely removed because some parts of kwin would
need adjustments.
This commit is contained in:
Vlad Zahorodnii 2024-02-05 11:00:17 +02:00
parent 8f7f97148c
commit e7d6e8b217
6 changed files with 35 additions and 15 deletions

View file

@ -6,6 +6,11 @@ target_sources(kwin-6.0-delete-desktop-switching-shortcuts PRIVATE kwin-6.0-dele
target_link_libraries(kwin-6.0-delete-desktop-switching-shortcuts PRIVATE KF6::GlobalAccel) target_link_libraries(kwin-6.0-delete-desktop-switching-shortcuts PRIVATE KF6::GlobalAccel)
install(TARGETS kwin-6.0-delete-desktop-switching-shortcuts DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/) install(TARGETS kwin-6.0-delete-desktop-switching-shortcuts DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
add_executable(kwin-6.0-reset-active-mouse-screen)
target_sources(kwin-6.0-reset-active-mouse-screen PRIVATE kwin-6.0-reset-active-mouse-screen.cpp)
target_link_libraries(kwin-6.0-reset-active-mouse-screen PRIVATE KF6::ConfigCore)
install(TARGETS kwin-6.0-reset-active-mouse-screen DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/)
install(FILES kwin.upd install(FILES kwin.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS kwin-6.0-overview-activities-shortcuts.py install(PROGRAMS kwin-6.0-overview-activities-shortcuts.py

View file

@ -0,0 +1,26 @@
/*
SPDX-FileCopyrightText: 2024 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <KConfigGroup>
#include <KSharedConfig>
int main()
{
auto config = KSharedConfig::openConfig(QStringLiteral("kwinrc"));
KConfigGroup windows = config->group(QStringLiteral("Windows"));
if (!windows.exists()) {
return EXIT_SUCCESS;
}
if (!windows.hasKey(QStringLiteral("ActiveMouseScreen"))) {
return EXIT_SUCCESS;
}
windows.deleteEntry(QStringLiteral("ActiveMouseScreen"));
return windows.sync() ? EXIT_SUCCESS : EXIT_FAILURE;
}

View file

@ -3,6 +3,10 @@
Version=6 Version=6
# Reset ActiveMouseScreen config option.
Id=kwin-6.0-reset-active-mouse-screen
Script=kwin-6.0-reset-active-mouse-screen
# Delete old desktop switching shortcuts. # Delete old desktop switching shortcuts.
Id=kwin-6.0-delete-desktop-switching-shortcuts Id=kwin-6.0-delete-desktop-switching-shortcuts
Script=kwin-6.0-delete-desktop-switching-shortcuts Script=kwin-6.0-delete-desktop-switching-shortcuts

View file

@ -198,16 +198,6 @@
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="6" column="1">
<widget class="QCheckBox" name="kcfg_ActiveMouseScreen">
<property name="whatsThis">
<string>When this option is enabled, the active screen (where new windows appear, for example) is the screen containing the mouse pointer. When disabled, the active screen is the screen containing the focused window.</string>
</property>
<property name="text">
<string>Active screen follows &amp;mouse</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="kcfg_SeparateScreenFocus"> <widget class="QCheckBox" name="kcfg_SeparateScreenFocus">
<property name="whatsThis"> <property name="whatsThis">
<string>When this option is enabled, focus operations are limited only to the active screen</string> <string>When this option is enabled, focus operations are limited only to the active screen</string>

View file

@ -139,10 +139,6 @@
<default>false</default> <default>false</default>
</entry> </entry>
<entry key="ActiveMouseScreen" type="Bool">
<default>true</default>
</entry>
<entry key="FocusStealingPreventionLevel" type="Int"> <entry key="FocusStealingPreventionLevel" type="Int">
<default>1</default> <default>1</default>
<min>0</min> <min>0</min>

View file

@ -74,7 +74,6 @@ void KFocusConfig::initialize(KWinOptionsSettings *settings)
void KFocusConfig::updateMultiScreen() void KFocusConfig::updateMultiScreen()
{ {
m_ui->multiscreenBehaviorLabel->setVisible(QApplication::screens().count() > 1); m_ui->multiscreenBehaviorLabel->setVisible(QApplication::screens().count() > 1);
m_ui->kcfg_ActiveMouseScreen->setVisible(QApplication::screens().count() > 1);
m_ui->kcfg_SeparateScreenFocus->setVisible(QApplication::screens().count() > 1); m_ui->kcfg_SeparateScreenFocus->setVisible(QApplication::screens().count() > 1);
} }